aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/hostap/hostap_info.c
diff options
context:
space:
mode:
authorJouni Malinen <jkmaline@cc.hut.fi>2005-07-30 15:50:02 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-07-30 18:17:23 -0400
commit2e4fd068e7e25e654a454ed4a425f239c0f6407a (patch)
tree64206e16c44242428b9eeb48b21109d478de6782 /drivers/net/wireless/hostap/hostap_info.c
parent72ca9c61cddb82a8596cee8141656d50aba42be5 (diff)
[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.c24
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 cf9e0898b57f..6ca94918e0f8 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)
160{ 160{
161 struct hfa384x_join_request req; 161 struct hfa384x_join_request req;
162 struct net_device *dev = local->dev; 162 struct net_device *dev = local->dev;
163 struct hfa384x_scan_result *selected, *entry; 163 struct hfa384x_hostscan_result *selected, *entry;
164 int i; 164 int i;
165 unsigned long flags; 165 unsigned long flags;
166 166
@@ -244,9 +244,10 @@ static void prism2_info_scanresults(local_info_t *local, unsigned char *buf,
244 int left) 244 int left)
245{ 245{
246 u16 *pos; 246 u16 *pos;
247 int new_count; 247 int new_count, i;
248 unsigned long flags; 248 unsigned long flags;
249 struct hfa384x_scan_result *results, *prev; 249 struct hfa384x_scan_result *res;
250 struct hfa384x_hostscan_result *results, *prev;
250 251
251 if (left < 4) { 252 if (left < 4) {
252 printk(KERN_DEBUG "%s: invalid scanresult info frame " 253 printk(KERN_DEBUG "%s: invalid scanresult info frame "
@@ -260,11 +261,18 @@ static void prism2_info_scanresults(local_info_t *local, unsigned char *buf,
260 left -= 4; 261 left -= 4;
261 262
262 new_count = left / sizeof(struct hfa384x_scan_result); 263 new_count = left / sizeof(struct hfa384x_scan_result);
263 results = kmalloc(new_count * sizeof(struct hfa384x_scan_result), 264 results = kmalloc(new_count * sizeof(struct hfa384x_hostscan_result),
264 GFP_ATOMIC); 265 GFP_ATOMIC);
265 if (results == NULL) 266 if (results == NULL)
266 return; 267 return;
267 memcpy(results, pos, new_count * sizeof(struct hfa384x_scan_result)); 268
269 /* Convert to hostscan result format. */
270 res = (struct hfa384x_scan_result *) pos;
271 for (i = 0; i < new_count; i++) {
272 memcpy(&results[i], &res[i],
273 sizeof(struct hfa384x_scan_result));
274 results[i].atim = 0;
275 }
268 276
269 spin_lock_irqsave(&local->lock, flags); 277 spin_lock_irqsave(&local->lock, flags);
270 local->last_scan_type = PRISM2_SCAN; 278 local->last_scan_type = PRISM2_SCAN;
@@ -335,9 +343,9 @@ static void prism2_info_hostscanresults(local_info_t *local,
335 343
336 spin_lock_irqsave(&local->lock, flags); 344 spin_lock_irqsave(&local->lock, flags);
337 local->last_scan_type = PRISM2_HOSTSCAN; 345 local->last_scan_type = PRISM2_HOSTSCAN;
338 prev = local->last_hostscan_results; 346 prev = local->last_scan_results;
339 local->last_hostscan_results = results; 347 local->last_scan_results = results;
340 local->last_hostscan_results_count = new_count; 348 local->last_scan_results_count = new_count;
341 spin_unlock_irqrestore(&local->lock, flags); 349 spin_unlock_irqrestore(&local->lock, flags);
342 kfree(prev); 350 kfree(prev);
343 351