diff options
author | Jouni Malinen <jkmaline@cc.hut.fi> | 2005-07-30 12:50:02 -0700 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-07-30 18:17:23 -0400 |
commit | 2e4fd068e7e25e654a454ed4a425f239c0f6407a (patch) | |
tree | 64206e16c44242428b9eeb48b21109d478de6782 /drivers/net/wireless/hostap/hostap_info.c | |
parent | 72ca9c61cddb82a8596cee8141656d50aba42be5 (diff) | |
download | kernel_samsung_smdk4412-2e4fd068e7e25e654a454ed4a425f239c0f6407a.zip kernel_samsung_smdk4412-2e4fd068e7e25e654a454ed4a425f239c0f6407a.tar.gz kernel_samsung_smdk4412-2e4fd068e7e25e654a454ed4a425f239c0f6407a.tar.bz2 |
[PATCH] hostap update
Cleaned up scan result processing by converting struct
hfa384x_scan_result into struct hfa384x_hostscan_result. This removes
special cases from result processing since the results are only used
in one, hostscan, format.
Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/wireless/hostap/hostap_info.c')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_info.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/net/wireless/hostap/hostap_info.c b/drivers/net/wireless/hostap/hostap_info.c index cf9e089..6ca9491 100644 --- a/drivers/net/wireless/hostap/hostap_info.c +++ b/drivers/net/wireless/hostap/hostap_info.c @@ -160,7 +160,7 @@ static void prism2_host_roaming(local_info_t *local) { struct hfa384x_join_request req; struct net_device *dev = local->dev; - struct hfa384x_scan_result *selected, *entry; + struct hfa384x_hostscan_result *selected, *entry; int i; unsigned long flags; @@ -244,9 +244,10 @@ static void prism2_info_scanresults(local_info_t *local, unsigned char *buf, int left) { u16 *pos; - int new_count; + int new_count, i; unsigned long flags; - struct hfa384x_scan_result *results, *prev; + struct hfa384x_scan_result *res; + struct hfa384x_hostscan_result *results, *prev; if (left < 4) { printk(KERN_DEBUG "%s: invalid scanresult info frame " @@ -260,11 +261,18 @@ static void prism2_info_scanresults(local_info_t *local, unsigned char *buf, left -= 4; new_count = left / sizeof(struct hfa384x_scan_result); - results = kmalloc(new_count * sizeof(struct hfa384x_scan_result), + results = kmalloc(new_count * sizeof(struct hfa384x_hostscan_result), GFP_ATOMIC); if (results == NULL) return; - memcpy(results, pos, new_count * sizeof(struct hfa384x_scan_result)); + + /* Convert to hostscan result format. */ + res = (struct hfa384x_scan_result *) pos; + for (i = 0; i < new_count; i++) { + memcpy(&results[i], &res[i], + sizeof(struct hfa384x_scan_result)); + results[i].atim = 0; + } spin_lock_irqsave(&local->lock, flags); local->last_scan_type = PRISM2_SCAN; @@ -335,9 +343,9 @@ static void prism2_info_hostscanresults(local_info_t *local, spin_lock_irqsave(&local->lock, flags); local->last_scan_type = PRISM2_HOSTSCAN; - prev = local->last_hostscan_results; - local->last_hostscan_results = results; - local->last_hostscan_results_count = new_count; + prev = local->last_scan_results; + local->last_scan_results = results; + local->last_scan_results_count = new_count; spin_unlock_irqrestore(&local->lock, flags); kfree(prev); |