diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-09-10 18:01:55 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-15 16:48:22 -0400 |
commit | c2b13452b283f9c4a5b02a6b53ed6416ebf4c03c (patch) | |
tree | 756b8c9668c643293a46389b8b8f34b8efd3d2ea /net/mac80211/scan.c | |
parent | 213cd118cbb88b76ae48f92cfb7dbef9a83cca62 (diff) |
mac80211: clean up scan namespace
Most of the scan functions are called ieee80211_sta_scan_*
or similar, make clean it up so they are all just called
ieee80211_scan_*.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/scan.c')
-rw-r--r-- | net/mac80211/scan.c | 153 |
1 files changed, 77 insertions, 76 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 27727027d76d..5e719e7b720b 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -32,26 +32,26 @@ | |||
32 | 32 | ||
33 | void ieee80211_rx_bss_list_init(struct ieee80211_local *local) | 33 | void ieee80211_rx_bss_list_init(struct ieee80211_local *local) |
34 | { | 34 | { |
35 | spin_lock_init(&local->sta_bss_lock); | 35 | spin_lock_init(&local->bss_lock); |
36 | INIT_LIST_HEAD(&local->sta_bss_list); | 36 | INIT_LIST_HEAD(&local->bss_list); |
37 | } | 37 | } |
38 | 38 | ||
39 | void ieee80211_rx_bss_list_deinit(struct ieee80211_local *local) | 39 | void ieee80211_rx_bss_list_deinit(struct ieee80211_local *local) |
40 | { | 40 | { |
41 | struct ieee80211_sta_bss *bss, *tmp; | 41 | struct ieee80211_bss *bss, *tmp; |
42 | 42 | ||
43 | list_for_each_entry_safe(bss, tmp, &local->sta_bss_list, list) | 43 | list_for_each_entry_safe(bss, tmp, &local->bss_list, list) |
44 | ieee80211_rx_bss_put(local, bss); | 44 | ieee80211_rx_bss_put(local, bss); |
45 | } | 45 | } |
46 | 46 | ||
47 | struct ieee80211_sta_bss * | 47 | struct ieee80211_bss * |
48 | ieee80211_rx_bss_get(struct ieee80211_local *local, u8 *bssid, int freq, | 48 | ieee80211_rx_bss_get(struct ieee80211_local *local, u8 *bssid, int freq, |
49 | u8 *ssid, u8 ssid_len) | 49 | u8 *ssid, u8 ssid_len) |
50 | { | 50 | { |
51 | struct ieee80211_sta_bss *bss; | 51 | struct ieee80211_bss *bss; |
52 | 52 | ||
53 | spin_lock_bh(&local->sta_bss_lock); | 53 | spin_lock_bh(&local->bss_lock); |
54 | bss = local->sta_bss_hash[STA_HASH(bssid)]; | 54 | bss = local->bss_hash[STA_HASH(bssid)]; |
55 | while (bss) { | 55 | while (bss) { |
56 | if (!bss_mesh_cfg(bss) && | 56 | if (!bss_mesh_cfg(bss) && |
57 | !memcmp(bss->bssid, bssid, ETH_ALEN) && | 57 | !memcmp(bss->bssid, bssid, ETH_ALEN) && |
@@ -63,13 +63,13 @@ ieee80211_rx_bss_get(struct ieee80211_local *local, u8 *bssid, int freq, | |||
63 | } | 63 | } |
64 | bss = bss->hnext; | 64 | bss = bss->hnext; |
65 | } | 65 | } |
66 | spin_unlock_bh(&local->sta_bss_lock); | 66 | spin_unlock_bh(&local->bss_lock); |
67 | return bss; | 67 | return bss; |
68 | } | 68 | } |
69 | 69 | ||
70 | /* Caller must hold local->sta_bss_lock */ | 70 | /* Caller must hold local->bss_lock */ |
71 | static void __ieee80211_rx_bss_hash_add(struct ieee80211_local *local, | 71 | static void __ieee80211_rx_bss_hash_add(struct ieee80211_local *local, |
72 | struct ieee80211_sta_bss *bss) | 72 | struct ieee80211_bss *bss) |
73 | { | 73 | { |
74 | u8 hash_idx; | 74 | u8 hash_idx; |
75 | 75 | ||
@@ -79,20 +79,20 @@ static void __ieee80211_rx_bss_hash_add(struct ieee80211_local *local, | |||
79 | else | 79 | else |
80 | hash_idx = STA_HASH(bss->bssid); | 80 | hash_idx = STA_HASH(bss->bssid); |
81 | 81 | ||
82 | bss->hnext = local->sta_bss_hash[hash_idx]; | 82 | bss->hnext = local->bss_hash[hash_idx]; |
83 | local->sta_bss_hash[hash_idx] = bss; | 83 | local->bss_hash[hash_idx] = bss; |
84 | } | 84 | } |
85 | 85 | ||
86 | /* Caller must hold local->sta_bss_lock */ | 86 | /* Caller must hold local->bss_lock */ |
87 | static void __ieee80211_rx_bss_hash_del(struct ieee80211_local *local, | 87 | static void __ieee80211_rx_bss_hash_del(struct ieee80211_local *local, |
88 | struct ieee80211_sta_bss *bss) | 88 | struct ieee80211_bss *bss) |
89 | { | 89 | { |
90 | struct ieee80211_sta_bss *b, *prev = NULL; | 90 | struct ieee80211_bss *b, *prev = NULL; |
91 | b = local->sta_bss_hash[STA_HASH(bss->bssid)]; | 91 | b = local->bss_hash[STA_HASH(bss->bssid)]; |
92 | while (b) { | 92 | while (b) { |
93 | if (b == bss) { | 93 | if (b == bss) { |
94 | if (!prev) | 94 | if (!prev) |
95 | local->sta_bss_hash[STA_HASH(bss->bssid)] = | 95 | local->bss_hash[STA_HASH(bss->bssid)] = |
96 | bss->hnext; | 96 | bss->hnext; |
97 | else | 97 | else |
98 | prev->hnext = bss->hnext; | 98 | prev->hnext = bss->hnext; |
@@ -103,11 +103,11 @@ static void __ieee80211_rx_bss_hash_del(struct ieee80211_local *local, | |||
103 | } | 103 | } |
104 | } | 104 | } |
105 | 105 | ||
106 | struct ieee80211_sta_bss * | 106 | struct ieee80211_bss * |
107 | ieee80211_rx_bss_add(struct ieee80211_local *local, u8 *bssid, int freq, | 107 | ieee80211_rx_bss_add(struct ieee80211_local *local, u8 *bssid, int freq, |
108 | u8 *ssid, u8 ssid_len) | 108 | u8 *ssid, u8 ssid_len) |
109 | { | 109 | { |
110 | struct ieee80211_sta_bss *bss; | 110 | struct ieee80211_bss *bss; |
111 | 111 | ||
112 | bss = kzalloc(sizeof(*bss), GFP_ATOMIC); | 112 | bss = kzalloc(sizeof(*bss), GFP_ATOMIC); |
113 | if (!bss) | 113 | if (!bss) |
@@ -120,23 +120,23 @@ ieee80211_rx_bss_add(struct ieee80211_local *local, u8 *bssid, int freq, | |||
120 | bss->ssid_len = ssid_len; | 120 | bss->ssid_len = ssid_len; |
121 | } | 121 | } |
122 | 122 | ||
123 | spin_lock_bh(&local->sta_bss_lock); | 123 | spin_lock_bh(&local->bss_lock); |
124 | /* TODO: order by RSSI? */ | 124 | /* TODO: order by RSSI? */ |
125 | list_add_tail(&bss->list, &local->sta_bss_list); | 125 | list_add_tail(&bss->list, &local->bss_list); |
126 | __ieee80211_rx_bss_hash_add(local, bss); | 126 | __ieee80211_rx_bss_hash_add(local, bss); |
127 | spin_unlock_bh(&local->sta_bss_lock); | 127 | spin_unlock_bh(&local->bss_lock); |
128 | return bss; | 128 | return bss; |
129 | } | 129 | } |
130 | 130 | ||
131 | #ifdef CONFIG_MAC80211_MESH | 131 | #ifdef CONFIG_MAC80211_MESH |
132 | static struct ieee80211_sta_bss * | 132 | static struct ieee80211_bss * |
133 | ieee80211_rx_mesh_bss_get(struct ieee80211_local *local, u8 *mesh_id, int mesh_id_len, | 133 | ieee80211_rx_mesh_bss_get(struct ieee80211_local *local, u8 *mesh_id, int mesh_id_len, |
134 | u8 *mesh_cfg, int freq) | 134 | u8 *mesh_cfg, int freq) |
135 | { | 135 | { |
136 | struct ieee80211_sta_bss *bss; | 136 | struct ieee80211_bss *bss; |
137 | 137 | ||
138 | spin_lock_bh(&local->sta_bss_lock); | 138 | spin_lock_bh(&local->bss_lock); |
139 | bss = local->sta_bss_hash[mesh_id_hash(mesh_id, mesh_id_len)]; | 139 | bss = local->bss_hash[mesh_id_hash(mesh_id, mesh_id_len)]; |
140 | while (bss) { | 140 | while (bss) { |
141 | if (bss_mesh_cfg(bss) && | 141 | if (bss_mesh_cfg(bss) && |
142 | !memcmp(bss_mesh_cfg(bss), mesh_cfg, MESH_CFG_CMP_LEN) && | 142 | !memcmp(bss_mesh_cfg(bss), mesh_cfg, MESH_CFG_CMP_LEN) && |
@@ -149,15 +149,15 @@ ieee80211_rx_mesh_bss_get(struct ieee80211_local *local, u8 *mesh_id, int mesh_i | |||
149 | } | 149 | } |
150 | bss = bss->hnext; | 150 | bss = bss->hnext; |
151 | } | 151 | } |
152 | spin_unlock_bh(&local->sta_bss_lock); | 152 | spin_unlock_bh(&local->bss_lock); |
153 | return bss; | 153 | return bss; |
154 | } | 154 | } |
155 | 155 | ||
156 | static struct ieee80211_sta_bss * | 156 | static struct ieee80211_bss * |
157 | ieee80211_rx_mesh_bss_add(struct ieee80211_local *local, u8 *mesh_id, int mesh_id_len, | 157 | ieee80211_rx_mesh_bss_add(struct ieee80211_local *local, u8 *mesh_id, int mesh_id_len, |
158 | u8 *mesh_cfg, int mesh_config_len, int freq) | 158 | u8 *mesh_cfg, int mesh_config_len, int freq) |
159 | { | 159 | { |
160 | struct ieee80211_sta_bss *bss; | 160 | struct ieee80211_bss *bss; |
161 | 161 | ||
162 | if (mesh_config_len != MESH_CFG_LEN) | 162 | if (mesh_config_len != MESH_CFG_LEN) |
163 | return NULL; | 163 | return NULL; |
@@ -186,16 +186,16 @@ ieee80211_rx_mesh_bss_add(struct ieee80211_local *local, u8 *mesh_id, int mesh_i | |||
186 | memcpy(bss->mesh_cfg, mesh_cfg, MESH_CFG_CMP_LEN); | 186 | memcpy(bss->mesh_cfg, mesh_cfg, MESH_CFG_CMP_LEN); |
187 | bss->mesh_id_len = mesh_id_len; | 187 | bss->mesh_id_len = mesh_id_len; |
188 | bss->freq = freq; | 188 | bss->freq = freq; |
189 | spin_lock_bh(&local->sta_bss_lock); | 189 | spin_lock_bh(&local->bss_lock); |
190 | /* TODO: order by RSSI? */ | 190 | /* TODO: order by RSSI? */ |
191 | list_add_tail(&bss->list, &local->sta_bss_list); | 191 | list_add_tail(&bss->list, &local->bss_list); |
192 | __ieee80211_rx_bss_hash_add(local, bss); | 192 | __ieee80211_rx_bss_hash_add(local, bss); |
193 | spin_unlock_bh(&local->sta_bss_lock); | 193 | spin_unlock_bh(&local->bss_lock); |
194 | return bss; | 194 | return bss; |
195 | } | 195 | } |
196 | #endif | 196 | #endif |
197 | 197 | ||
198 | static void ieee80211_rx_bss_free(struct ieee80211_sta_bss *bss) | 198 | static void ieee80211_rx_bss_free(struct ieee80211_bss *bss) |
199 | { | 199 | { |
200 | kfree(bss->ies); | 200 | kfree(bss->ies); |
201 | kfree(bss_mesh_id(bss)); | 201 | kfree(bss_mesh_id(bss)); |
@@ -204,21 +204,21 @@ static void ieee80211_rx_bss_free(struct ieee80211_sta_bss *bss) | |||
204 | } | 204 | } |
205 | 205 | ||
206 | void ieee80211_rx_bss_put(struct ieee80211_local *local, | 206 | void ieee80211_rx_bss_put(struct ieee80211_local *local, |
207 | struct ieee80211_sta_bss *bss) | 207 | struct ieee80211_bss *bss) |
208 | { | 208 | { |
209 | local_bh_disable(); | 209 | local_bh_disable(); |
210 | if (!atomic_dec_and_lock(&bss->users, &local->sta_bss_lock)) { | 210 | if (!atomic_dec_and_lock(&bss->users, &local->bss_lock)) { |
211 | local_bh_enable(); | 211 | local_bh_enable(); |
212 | return; | 212 | return; |
213 | } | 213 | } |
214 | 214 | ||
215 | __ieee80211_rx_bss_hash_del(local, bss); | 215 | __ieee80211_rx_bss_hash_del(local, bss); |
216 | list_del(&bss->list); | 216 | list_del(&bss->list); |
217 | spin_unlock_bh(&local->sta_bss_lock); | 217 | spin_unlock_bh(&local->bss_lock); |
218 | ieee80211_rx_bss_free(bss); | 218 | ieee80211_rx_bss_free(bss); |
219 | } | 219 | } |
220 | 220 | ||
221 | struct ieee80211_sta_bss * | 221 | struct ieee80211_bss * |
222 | ieee80211_bss_info_update(struct ieee80211_local *local, | 222 | ieee80211_bss_info_update(struct ieee80211_local *local, |
223 | struct ieee80211_rx_status *rx_status, | 223 | struct ieee80211_rx_status *rx_status, |
224 | struct ieee80211_mgmt *mgmt, | 224 | struct ieee80211_mgmt *mgmt, |
@@ -226,7 +226,7 @@ ieee80211_bss_info_update(struct ieee80211_local *local, | |||
226 | struct ieee802_11_elems *elems, | 226 | struct ieee802_11_elems *elems, |
227 | int freq, bool beacon) | 227 | int freq, bool beacon) |
228 | { | 228 | { |
229 | struct ieee80211_sta_bss *bss; | 229 | struct ieee80211_bss *bss; |
230 | int clen; | 230 | int clen; |
231 | 231 | ||
232 | #ifdef CONFIG_MAC80211_MESH | 232 | #ifdef CONFIG_MAC80211_MESH |
@@ -252,9 +252,9 @@ ieee80211_bss_info_update(struct ieee80211_local *local, | |||
252 | } else { | 252 | } else { |
253 | #if 0 | 253 | #if 0 |
254 | /* TODO: order by RSSI? */ | 254 | /* TODO: order by RSSI? */ |
255 | spin_lock_bh(&local->sta_bss_lock); | 255 | spin_lock_bh(&local->bss_lock); |
256 | list_move_tail(&bss->list, &local->sta_bss_list); | 256 | list_move_tail(&bss->list, &local->bss_list); |
257 | spin_unlock_bh(&local->sta_bss_lock); | 257 | spin_unlock_bh(&local->bss_lock); |
258 | #endif | 258 | #endif |
259 | } | 259 | } |
260 | 260 | ||
@@ -327,11 +327,11 @@ ieee80211_bss_info_update(struct ieee80211_local *local, | |||
327 | } | 327 | } |
328 | 328 | ||
329 | ieee80211_rx_result | 329 | ieee80211_rx_result |
330 | ieee80211_sta_rx_scan(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb, | 330 | ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb, |
331 | struct ieee80211_rx_status *rx_status) | 331 | struct ieee80211_rx_status *rx_status) |
332 | { | 332 | { |
333 | struct ieee80211_mgmt *mgmt; | 333 | struct ieee80211_mgmt *mgmt; |
334 | struct ieee80211_sta_bss *bss; | 334 | struct ieee80211_bss *bss; |
335 | u8 *elements; | 335 | u8 *elements; |
336 | struct ieee80211_channel *channel; | 336 | struct ieee80211_channel *channel; |
337 | size_t baselen; | 337 | size_t baselen; |
@@ -430,7 +430,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw) | |||
430 | struct ieee80211_sub_if_data *sdata; | 430 | struct ieee80211_sub_if_data *sdata; |
431 | union iwreq_data wrqu; | 431 | union iwreq_data wrqu; |
432 | 432 | ||
433 | if (WARN_ON(!local->sta_hw_scanning && !local->sta_sw_scanning)) | 433 | if (WARN_ON(!local->hw_scanning && !local->sw_scanning)) |
434 | return; | 434 | return; |
435 | 435 | ||
436 | local->last_scan_completed = jiffies; | 436 | local->last_scan_completed = jiffies; |
@@ -445,8 +445,8 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw) | |||
445 | if (sdata) | 445 | if (sdata) |
446 | wireless_send_event(sdata->dev, SIOCGIWSCAN, &wrqu, NULL); | 446 | wireless_send_event(sdata->dev, SIOCGIWSCAN, &wrqu, NULL); |
447 | 447 | ||
448 | if (local->sta_hw_scanning) { | 448 | if (local->hw_scanning) { |
449 | local->sta_hw_scanning = 0; | 449 | local->hw_scanning = false; |
450 | if (ieee80211_hw_config(local)) | 450 | if (ieee80211_hw_config(local)) |
451 | printk(KERN_DEBUG "%s: failed to restore operational " | 451 | printk(KERN_DEBUG "%s: failed to restore operational " |
452 | "channel after scan\n", wiphy_name(local->hw.wiphy)); | 452 | "channel after scan\n", wiphy_name(local->hw.wiphy)); |
@@ -454,7 +454,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw) | |||
454 | goto done; | 454 | goto done; |
455 | } | 455 | } |
456 | 456 | ||
457 | local->sta_sw_scanning = 0; | 457 | local->sw_scanning = false; |
458 | if (ieee80211_hw_config(local)) | 458 | if (ieee80211_hw_config(local)) |
459 | printk(KERN_DEBUG "%s: failed to restore operational " | 459 | printk(KERN_DEBUG "%s: failed to restore operational " |
460 | "channel after scan\n", wiphy_name(local->hw.wiphy)); | 460 | "channel after scan\n", wiphy_name(local->hw.wiphy)); |
@@ -492,7 +492,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw) | |||
492 | EXPORT_SYMBOL(ieee80211_scan_completed); | 492 | EXPORT_SYMBOL(ieee80211_scan_completed); |
493 | 493 | ||
494 | 494 | ||
495 | void ieee80211_sta_scan_work(struct work_struct *work) | 495 | void ieee80211_scan_work(struct work_struct *work) |
496 | { | 496 | { |
497 | struct ieee80211_local *local = | 497 | struct ieee80211_local *local = |
498 | container_of(work, struct ieee80211_local, scan_work.work); | 498 | container_of(work, struct ieee80211_local, scan_work.work); |
@@ -589,8 +589,8 @@ void ieee80211_sta_scan_work(struct work_struct *work) | |||
589 | } | 589 | } |
590 | 590 | ||
591 | 591 | ||
592 | int ieee80211_sta_start_scan(struct ieee80211_sub_if_data *scan_sdata, | 592 | int ieee80211_start_scan(struct ieee80211_sub_if_data *scan_sdata, |
593 | u8 *ssid, size_t ssid_len) | 593 | u8 *ssid, size_t ssid_len) |
594 | { | 594 | { |
595 | struct ieee80211_local *local = scan_sdata->local; | 595 | struct ieee80211_local *local = scan_sdata->local; |
596 | struct ieee80211_sub_if_data *sdata; | 596 | struct ieee80211_sub_if_data *sdata; |
@@ -615,7 +615,7 @@ int ieee80211_sta_start_scan(struct ieee80211_sub_if_data *scan_sdata, | |||
615 | * ResultCode: SUCCESS, INVALID_PARAMETERS | 615 | * ResultCode: SUCCESS, INVALID_PARAMETERS |
616 | */ | 616 | */ |
617 | 617 | ||
618 | if (local->sta_sw_scanning || local->sta_hw_scanning) { | 618 | if (local->sw_scanning || local->hw_scanning) { |
619 | if (local->scan_sdata == scan_sdata) | 619 | if (local->scan_sdata == scan_sdata) |
620 | return 0; | 620 | return 0; |
621 | return -EBUSY; | 621 | return -EBUSY; |
@@ -624,17 +624,17 @@ int ieee80211_sta_start_scan(struct ieee80211_sub_if_data *scan_sdata, | |||
624 | if (local->ops->hw_scan) { | 624 | if (local->ops->hw_scan) { |
625 | int rc; | 625 | int rc; |
626 | 626 | ||
627 | local->sta_hw_scanning = 1; | 627 | local->hw_scanning = true; |
628 | rc = local->ops->hw_scan(local_to_hw(local), ssid, ssid_len); | 628 | rc = local->ops->hw_scan(local_to_hw(local), ssid, ssid_len); |
629 | if (rc) { | 629 | if (rc) { |
630 | local->sta_hw_scanning = 0; | 630 | local->hw_scanning = false; |
631 | return rc; | 631 | return rc; |
632 | } | 632 | } |
633 | local->scan_sdata = scan_sdata; | 633 | local->scan_sdata = scan_sdata; |
634 | return 0; | 634 | return 0; |
635 | } | 635 | } |
636 | 636 | ||
637 | local->sta_sw_scanning = 1; | 637 | local->sw_scanning = true; |
638 | 638 | ||
639 | rcu_read_lock(); | 639 | rcu_read_lock(); |
640 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { | 640 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { |
@@ -675,13 +675,14 @@ int ieee80211_sta_start_scan(struct ieee80211_sub_if_data *scan_sdata, | |||
675 | } | 675 | } |
676 | 676 | ||
677 | 677 | ||
678 | int ieee80211_sta_req_scan(struct ieee80211_sub_if_data *sdata, u8 *ssid, size_t ssid_len) | 678 | int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata, |
679 | u8 *ssid, size_t ssid_len) | ||
679 | { | 680 | { |
680 | struct ieee80211_local *local = sdata->local; | 681 | struct ieee80211_local *local = sdata->local; |
681 | struct ieee80211_if_sta *ifsta; | 682 | struct ieee80211_if_sta *ifsta; |
682 | 683 | ||
683 | if (sdata->vif.type != IEEE80211_IF_TYPE_STA) | 684 | if (sdata->vif.type != IEEE80211_IF_TYPE_STA) |
684 | return ieee80211_sta_start_scan(sdata, ssid, ssid_len); | 685 | return ieee80211_start_scan(sdata, ssid, ssid_len); |
685 | 686 | ||
686 | /* | 687 | /* |
687 | * STA has a state machine that might need to defer scanning | 688 | * STA has a state machine that might need to defer scanning |
@@ -689,7 +690,7 @@ int ieee80211_sta_req_scan(struct ieee80211_sub_if_data *sdata, u8 *ssid, size_t | |||
689 | * queue it up to the state machine in that case. | 690 | * queue it up to the state machine in that case. |
690 | */ | 691 | */ |
691 | 692 | ||
692 | if (local->sta_sw_scanning || local->sta_hw_scanning) { | 693 | if (local->sw_scanning || local->hw_scanning) { |
693 | if (local->scan_sdata == sdata) | 694 | if (local->scan_sdata == sdata) |
694 | return 0; | 695 | return 0; |
695 | return -EBUSY; | 696 | return -EBUSY; |
@@ -707,9 +708,9 @@ int ieee80211_sta_req_scan(struct ieee80211_sub_if_data *sdata, u8 *ssid, size_t | |||
707 | } | 708 | } |
708 | 709 | ||
709 | 710 | ||
710 | static void ieee80211_sta_add_scan_ies(struct iw_request_info *info, | 711 | static void ieee80211_scan_add_ies(struct iw_request_info *info, |
711 | struct ieee80211_sta_bss *bss, | 712 | struct ieee80211_bss *bss, |
712 | char **current_ev, char *end_buf) | 713 | char **current_ev, char *end_buf) |
713 | { | 714 | { |
714 | u8 *pos, *end, *next; | 715 | u8 *pos, *end, *next; |
715 | struct iw_event iwe; | 716 | struct iw_event iwe; |
@@ -749,10 +750,10 @@ static void ieee80211_sta_add_scan_ies(struct iw_request_info *info, | |||
749 | 750 | ||
750 | 751 | ||
751 | static char * | 752 | static char * |
752 | ieee80211_sta_scan_result(struct ieee80211_local *local, | 753 | ieee80211_scan_result(struct ieee80211_local *local, |
753 | struct iw_request_info *info, | 754 | struct iw_request_info *info, |
754 | struct ieee80211_sta_bss *bss, | 755 | struct ieee80211_bss *bss, |
755 | char *current_ev, char *end_buf) | 756 | char *current_ev, char *end_buf) |
756 | { | 757 | { |
757 | struct iw_event iwe; | 758 | struct iw_event iwe; |
758 | char *buf; | 759 | char *buf; |
@@ -828,7 +829,7 @@ ieee80211_sta_scan_result(struct ieee80211_local *local, | |||
828 | current_ev = iwe_stream_add_point(info, current_ev, end_buf, | 829 | current_ev = iwe_stream_add_point(info, current_ev, end_buf, |
829 | &iwe, ""); | 830 | &iwe, ""); |
830 | 831 | ||
831 | ieee80211_sta_add_scan_ies(info, bss, ¤t_ev, end_buf); | 832 | ieee80211_scan_add_ies(info, bss, ¤t_ev, end_buf); |
832 | 833 | ||
833 | if (bss->supp_rates_len > 0) { | 834 | if (bss->supp_rates_len > 0) { |
834 | /* display all supported rates in readable format */ | 835 | /* display all supported rates in readable format */ |
@@ -914,23 +915,23 @@ ieee80211_sta_scan_result(struct ieee80211_local *local, | |||
914 | } | 915 | } |
915 | 916 | ||
916 | 917 | ||
917 | int ieee80211_sta_scan_results(struct ieee80211_local *local, | 918 | int ieee80211_scan_results(struct ieee80211_local *local, |
918 | struct iw_request_info *info, | 919 | struct iw_request_info *info, |
919 | char *buf, size_t len) | 920 | char *buf, size_t len) |
920 | { | 921 | { |
921 | char *current_ev = buf; | 922 | char *current_ev = buf; |
922 | char *end_buf = buf + len; | 923 | char *end_buf = buf + len; |
923 | struct ieee80211_sta_bss *bss; | 924 | struct ieee80211_bss *bss; |
924 | 925 | ||
925 | spin_lock_bh(&local->sta_bss_lock); | 926 | spin_lock_bh(&local->bss_lock); |
926 | list_for_each_entry(bss, &local->sta_bss_list, list) { | 927 | list_for_each_entry(bss, &local->bss_list, list) { |
927 | if (buf + len - current_ev <= IW_EV_ADDR_LEN) { | 928 | if (buf + len - current_ev <= IW_EV_ADDR_LEN) { |
928 | spin_unlock_bh(&local->sta_bss_lock); | 929 | spin_unlock_bh(&local->bss_lock); |
929 | return -E2BIG; | 930 | return -E2BIG; |
930 | } | 931 | } |
931 | current_ev = ieee80211_sta_scan_result(local, info, bss, | 932 | current_ev = ieee80211_scan_result(local, info, bss, |
932 | current_ev, end_buf); | 933 | current_ev, end_buf); |
933 | } | 934 | } |
934 | spin_unlock_bh(&local->sta_bss_lock); | 935 | spin_unlock_bh(&local->bss_lock); |
935 | return current_ev - buf; | 936 | return current_ev - buf; |
936 | } | 937 | } |