diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-12-23 07:15:35 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-12-28 16:54:55 -0500 |
commit | af6b63741cc4e4dfd575d06beb333b11a8a6e0c0 (patch) | |
tree | a2c1a27b6b6b0fb171606f3653b5c280537b32a3 /net/mac80211/ieee80211_i.h | |
parent | f679f65d417c3ea3f91b4bbfb68e3951c9eb8f04 (diff) |
mac80211: generalise work handling
In order to use auth/assoc for different purposes
other than MLME, it needs to be split up. For other
purposes, a generic work handling (potentially on
another channel) will be useful.
To achieve that, this patch moves much of the MLME
work handling out of mlme into a new work API. The
API can currently handle probing a specific AP,
authentication and association. The MLME previously
handled probe/authentication as one step and will
continue to do so, but they are separate in the new
work handling.
Work items are RCU-managed to be able to check for
existence of an item for a specific frame in the RX
path, but they can be re-used which the MLME right
now will do for its combined probe/auth step.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ieee80211_i.h')
-rw-r--r-- | net/mac80211/ieee80211_i.h | 59 |
1 files changed, 44 insertions, 15 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 0339e909e0c4..97b6076b492e 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -228,41 +228,63 @@ struct mesh_preq_queue { | |||
228 | }; | 228 | }; |
229 | 229 | ||
230 | enum ieee80211_work_type { | 230 | enum ieee80211_work_type { |
231 | IEEE80211_WORK_AUTH_PROBE, | 231 | IEEE80211_WORK_DIRECT_PROBE, |
232 | IEEE80211_WORK_AUTH, | 232 | IEEE80211_WORK_AUTH, |
233 | IEEE80211_WORK_ASSOC, | 233 | IEEE80211_WORK_ASSOC, |
234 | }; | 234 | }; |
235 | 235 | ||
236 | /** | ||
237 | * enum work_done_result - indicates what to do after work was done | ||
238 | * | ||
239 | * @WORK_DONE_DESTROY: This work item is no longer needed, destroy. | ||
240 | * @WORK_DONE_REQUEUE: This work item was reset to be reused, and | ||
241 | * should be requeued. | ||
242 | */ | ||
243 | enum work_done_result { | ||
244 | WORK_DONE_DESTROY, | ||
245 | WORK_DONE_REQUEUE, | ||
246 | }; | ||
247 | |||
236 | struct ieee80211_work { | 248 | struct ieee80211_work { |
237 | struct list_head list; | 249 | struct list_head list; |
238 | 250 | ||
251 | struct rcu_head rcu_head; | ||
252 | |||
253 | struct ieee80211_sub_if_data *sdata; | ||
254 | |||
255 | enum work_done_result (*done)(struct ieee80211_work *wk, | ||
256 | struct sk_buff *skb); | ||
257 | |||
239 | struct ieee80211_channel *chan; | 258 | struct ieee80211_channel *chan; |
240 | /* XXX: chan type? -- right now not really needed */ | 259 | /* XXX: chan type? -- right now not really needed */ |
260 | |||
241 | unsigned long timeout; | 261 | unsigned long timeout; |
242 | enum ieee80211_work_type type; | 262 | enum ieee80211_work_type type; |
243 | 263 | ||
264 | u8 filter_ta[ETH_ALEN]; | ||
265 | |||
244 | union { | 266 | union { |
245 | struct { | 267 | struct { |
246 | int tries; | 268 | int tries; |
247 | u16 algorithm, transaction; | 269 | u16 algorithm, transaction; |
248 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 270 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
249 | u8 ssid_len; | 271 | u8 ssid_len; |
250 | u8 bssid[ETH_ALEN]; | ||
251 | u8 key[WLAN_KEY_LEN_WEP104]; | 272 | u8 key[WLAN_KEY_LEN_WEP104]; |
252 | u8 key_len, key_idx; | 273 | u8 key_len, key_idx; |
253 | bool privacy; | 274 | bool privacy; |
254 | } auth; | 275 | } probe_auth; |
255 | struct { | 276 | struct { |
256 | struct ieee80211_bss *bss; | 277 | struct ieee80211_bss *bss; |
257 | const u8 *supp_rates; | 278 | const u8 *supp_rates; |
258 | const u8 *ht_information_ie; | 279 | const u8 *ht_information_ie; |
280 | enum ieee80211_smps_mode smps; | ||
259 | int tries; | 281 | int tries; |
260 | u16 capability; | 282 | u16 capability; |
261 | u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; | 283 | u8 prev_bssid[ETH_ALEN]; |
262 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 284 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
263 | u8 ssid_len; | 285 | u8 ssid_len; |
264 | u8 supp_rates_len; | 286 | u8 supp_rates_len; |
265 | bool wmm_used; | 287 | bool wmm_used, use_11n; |
266 | } assoc; | 288 | } assoc; |
267 | }; | 289 | }; |
268 | 290 | ||
@@ -276,17 +298,11 @@ enum ieee80211_sta_flags { | |||
276 | IEEE80211_STA_BEACON_POLL = BIT(0), | 298 | IEEE80211_STA_BEACON_POLL = BIT(0), |
277 | IEEE80211_STA_CONNECTION_POLL = BIT(1), | 299 | IEEE80211_STA_CONNECTION_POLL = BIT(1), |
278 | IEEE80211_STA_CONTROL_PORT = BIT(2), | 300 | IEEE80211_STA_CONTROL_PORT = BIT(2), |
279 | IEEE80211_STA_WMM_ENABLED = BIT(3), | ||
280 | IEEE80211_STA_DISABLE_11N = BIT(4), | 301 | IEEE80211_STA_DISABLE_11N = BIT(4), |
281 | IEEE80211_STA_CSA_RECEIVED = BIT(5), | 302 | IEEE80211_STA_CSA_RECEIVED = BIT(5), |
282 | IEEE80211_STA_MFP_ENABLED = BIT(6), | 303 | IEEE80211_STA_MFP_ENABLED = BIT(6), |
283 | }; | 304 | }; |
284 | 305 | ||
285 | /* flags for MLME request */ | ||
286 | enum ieee80211_sta_request { | ||
287 | IEEE80211_STA_REQ_SCAN, | ||
288 | }; | ||
289 | |||
290 | struct ieee80211_if_managed { | 306 | struct ieee80211_if_managed { |
291 | struct timer_list timer; | 307 | struct timer_list timer; |
292 | struct timer_list conn_mon_timer; | 308 | struct timer_list conn_mon_timer; |
@@ -302,12 +318,10 @@ struct ieee80211_if_managed { | |||
302 | 318 | ||
303 | struct mutex mtx; | 319 | struct mutex mtx; |
304 | struct ieee80211_bss *associated; | 320 | struct ieee80211_bss *associated; |
305 | struct list_head work_list; | ||
306 | 321 | ||
307 | u8 bssid[ETH_ALEN]; | 322 | u8 bssid[ETH_ALEN]; |
308 | 323 | ||
309 | u16 aid; | 324 | u16 aid; |
310 | u16 capab; | ||
311 | 325 | ||
312 | struct sk_buff_head skb_queue; | 326 | struct sk_buff_head skb_queue; |
313 | 327 | ||
@@ -316,8 +330,6 @@ struct ieee80211_if_managed { | |||
316 | enum ieee80211_smps_mode req_smps, /* requested smps mode */ | 330 | enum ieee80211_smps_mode req_smps, /* requested smps mode */ |
317 | ap_smps; /* smps mode AP thinks we're in */ | 331 | ap_smps; /* smps mode AP thinks we're in */ |
318 | 332 | ||
319 | unsigned long request; | ||
320 | |||
321 | unsigned int flags; | 333 | unsigned int flags; |
322 | 334 | ||
323 | u32 beacon_crc; | 335 | u32 beacon_crc; |
@@ -584,6 +596,15 @@ struct ieee80211_local { | |||
584 | const struct ieee80211_ops *ops; | 596 | const struct ieee80211_ops *ops; |
585 | 597 | ||
586 | /* | 598 | /* |
599 | * work stuff, potentially off-channel (in the future) | ||
600 | */ | ||
601 | struct mutex work_mtx; | ||
602 | struct list_head work_list; | ||
603 | struct timer_list work_timer; | ||
604 | struct work_struct work_work; | ||
605 | struct sk_buff_head work_skb_queue; | ||
606 | |||
607 | /* | ||
587 | * private workqueue to mac80211. mac80211 makes this accessible | 608 | * private workqueue to mac80211. mac80211 makes this accessible |
588 | * via ieee80211_queue_work() | 609 | * via ieee80211_queue_work() |
589 | */ | 610 | */ |
@@ -1127,6 +1148,14 @@ int __ieee80211_request_smps(struct ieee80211_sub_if_data *sdata, | |||
1127 | void ieee80211_recalc_smps(struct ieee80211_local *local, | 1148 | void ieee80211_recalc_smps(struct ieee80211_local *local, |
1128 | struct ieee80211_sub_if_data *forsdata); | 1149 | struct ieee80211_sub_if_data *forsdata); |
1129 | 1150 | ||
1151 | /* internal work items */ | ||
1152 | void ieee80211_work_init(struct ieee80211_local *local); | ||
1153 | void ieee80211_add_work(struct ieee80211_work *wk); | ||
1154 | void free_work(struct ieee80211_work *wk); | ||
1155 | void ieee80211_work_purge(struct ieee80211_sub_if_data *sdata); | ||
1156 | ieee80211_rx_result ieee80211_work_rx_mgmt(struct ieee80211_sub_if_data *sdata, | ||
1157 | struct sk_buff *skb); | ||
1158 | |||
1130 | #ifdef CONFIG_MAC80211_NOINLINE | 1159 | #ifdef CONFIG_MAC80211_NOINLINE |
1131 | #define debug_noinline noinline | 1160 | #define debug_noinline noinline |
1132 | #else | 1161 | #else |