diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-02-15 06:44:28 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-27 14:51:42 -0500 |
commit | 469002983fc90c2ff0959e2b03335c0fe2e4d5a9 (patch) | |
tree | fdcf78dcdaeadba897abd86d39d0275e236803b3 /net/mac80211/ieee80211_i.h | |
parent | 96f5e66e8a79810e2982cdcfa28e554f3d97da21 (diff) |
mac80211: split IBSS/managed code
This patch splits out the ibss code and data from managed (station) mode.
The reason to do this is to better separate the state machines, and have
the code be contained better so it gets easier to determine what exactly
a given change will affect, that in turn makes it easier to understand.
This is quite some churn, especially because I split sdata->u.sta into
sdata->u.mgd and sdata->u.ibss, but I think it's easier to maintain that
way. I've also shuffled around some code -- null function sending is only
applicable to managed interfaces so put that into that file, some other
functions are needed from various places so put them into util, and also
rearranged the prototypes in ieee80211_i.h accordingly.
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 | 117 |
1 files changed, 84 insertions, 33 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index e2bbd3f11797..27d56414019d 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -239,7 +239,7 @@ struct mesh_preq_queue { | |||
239 | u8 flags; | 239 | u8 flags; |
240 | }; | 240 | }; |
241 | 241 | ||
242 | /* flags used in struct ieee80211_if_sta.flags */ | 242 | /* flags used in struct ieee80211_if_managed.flags */ |
243 | #define IEEE80211_STA_SSID_SET BIT(0) | 243 | #define IEEE80211_STA_SSID_SET BIT(0) |
244 | #define IEEE80211_STA_BSSID_SET BIT(1) | 244 | #define IEEE80211_STA_BSSID_SET BIT(1) |
245 | #define IEEE80211_STA_PREV_BSSID_SET BIT(2) | 245 | #define IEEE80211_STA_PREV_BSSID_SET BIT(2) |
@@ -262,31 +262,30 @@ struct mesh_preq_queue { | |||
262 | #define IEEE80211_STA_REQ_AUTH 2 | 262 | #define IEEE80211_STA_REQ_AUTH 2 |
263 | #define IEEE80211_STA_REQ_RUN 3 | 263 | #define IEEE80211_STA_REQ_RUN 3 |
264 | 264 | ||
265 | /* STA/IBSS MLME states */ | ||
266 | enum ieee80211_sta_mlme_state { | ||
267 | IEEE80211_STA_MLME_DISABLED, | ||
268 | IEEE80211_STA_MLME_DIRECT_PROBE, | ||
269 | IEEE80211_STA_MLME_AUTHENTICATE, | ||
270 | IEEE80211_STA_MLME_ASSOCIATE, | ||
271 | IEEE80211_STA_MLME_ASSOCIATED, | ||
272 | IEEE80211_STA_MLME_IBSS_SEARCH, | ||
273 | IEEE80211_STA_MLME_IBSS_JOINED, | ||
274 | }; | ||
275 | |||
276 | /* bitfield of allowed auth algs */ | 265 | /* bitfield of allowed auth algs */ |
277 | #define IEEE80211_AUTH_ALG_OPEN BIT(0) | 266 | #define IEEE80211_AUTH_ALG_OPEN BIT(0) |
278 | #define IEEE80211_AUTH_ALG_SHARED_KEY BIT(1) | 267 | #define IEEE80211_AUTH_ALG_SHARED_KEY BIT(1) |
279 | #define IEEE80211_AUTH_ALG_LEAP BIT(2) | 268 | #define IEEE80211_AUTH_ALG_LEAP BIT(2) |
280 | 269 | ||
281 | struct ieee80211_if_sta { | 270 | struct ieee80211_if_managed { |
282 | struct timer_list timer; | 271 | struct timer_list timer; |
283 | struct timer_list chswitch_timer; | 272 | struct timer_list chswitch_timer; |
284 | struct work_struct work; | 273 | struct work_struct work; |
285 | struct work_struct chswitch_work; | 274 | struct work_struct chswitch_work; |
275 | |||
286 | u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; | 276 | u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; |
277 | |||
287 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 278 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
288 | enum ieee80211_sta_mlme_state state; | ||
289 | size_t ssid_len; | 279 | size_t ssid_len; |
280 | |||
281 | enum { | ||
282 | IEEE80211_STA_MLME_DISABLED, | ||
283 | IEEE80211_STA_MLME_DIRECT_PROBE, | ||
284 | IEEE80211_STA_MLME_AUTHENTICATE, | ||
285 | IEEE80211_STA_MLME_ASSOCIATE, | ||
286 | IEEE80211_STA_MLME_ASSOCIATED, | ||
287 | } state; | ||
288 | |||
290 | u16 aid; | 289 | u16 aid; |
291 | u16 ap_capab, capab; | 290 | u16 ap_capab, capab; |
292 | u8 *extra_ie; /* to be added to the end of AssocReq */ | 291 | u8 *extra_ie; /* to be added to the end of AssocReq */ |
@@ -319,10 +318,6 @@ struct ieee80211_if_sta { | |||
319 | IEEE80211_MFP_REQUIRED | 318 | IEEE80211_MFP_REQUIRED |
320 | } mfp; /* management frame protection */ | 319 | } mfp; /* management frame protection */ |
321 | 320 | ||
322 | unsigned long ibss_join_req; | ||
323 | struct sk_buff *probe_resp; /* ProbeResp template for IBSS */ | ||
324 | u32 supp_rates_bits[IEEE80211_NUM_BANDS]; | ||
325 | |||
326 | int wmm_last_param_set; | 321 | int wmm_last_param_set; |
327 | 322 | ||
328 | /* Extra IE data for management frames */ | 323 | /* Extra IE data for management frames */ |
@@ -342,6 +337,42 @@ struct ieee80211_if_sta { | |||
342 | size_t ie_disassoc_len; | 337 | size_t ie_disassoc_len; |
343 | }; | 338 | }; |
344 | 339 | ||
340 | enum ieee80211_ibss_flags { | ||
341 | IEEE80211_IBSS_AUTO_CHANNEL_SEL = BIT(0), | ||
342 | IEEE80211_IBSS_AUTO_BSSID_SEL = BIT(1), | ||
343 | IEEE80211_IBSS_BSSID_SET = BIT(2), | ||
344 | IEEE80211_IBSS_PREV_BSSID_SET = BIT(3), | ||
345 | IEEE80211_IBSS_SSID_SET = BIT(4), | ||
346 | }; | ||
347 | |||
348 | enum ieee80211_ibss_request { | ||
349 | IEEE80211_IBSS_REQ_RUN = 0, | ||
350 | }; | ||
351 | |||
352 | struct ieee80211_if_ibss { | ||
353 | struct timer_list timer; | ||
354 | struct work_struct work; | ||
355 | |||
356 | struct sk_buff_head skb_queue; | ||
357 | |||
358 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | ||
359 | u8 ssid_len; | ||
360 | |||
361 | u32 flags; | ||
362 | |||
363 | u8 bssid[ETH_ALEN]; | ||
364 | |||
365 | unsigned long request; | ||
366 | |||
367 | unsigned long ibss_join_req; | ||
368 | struct sk_buff *probe_resp; /* ProbeResp template for IBSS */ | ||
369 | |||
370 | enum { | ||
371 | IEEE80211_IBSS_MLME_SEARCH, | ||
372 | IEEE80211_IBSS_MLME_JOINED, | ||
373 | } state; | ||
374 | }; | ||
375 | |||
345 | struct ieee80211_if_mesh { | 376 | struct ieee80211_if_mesh { |
346 | struct work_struct work; | 377 | struct work_struct work; |
347 | struct timer_list housekeeping_timer; | 378 | struct timer_list housekeeping_timer; |
@@ -445,7 +476,8 @@ struct ieee80211_sub_if_data { | |||
445 | struct ieee80211_if_ap ap; | 476 | struct ieee80211_if_ap ap; |
446 | struct ieee80211_if_wds wds; | 477 | struct ieee80211_if_wds wds; |
447 | struct ieee80211_if_vlan vlan; | 478 | struct ieee80211_if_vlan vlan; |
448 | struct ieee80211_if_sta sta; | 479 | struct ieee80211_if_managed mgd; |
480 | struct ieee80211_if_ibss ibss; | ||
449 | #ifdef CONFIG_MAC80211_MESH | 481 | #ifdef CONFIG_MAC80211_MESH |
450 | struct ieee80211_if_mesh mesh; | 482 | struct ieee80211_if_mesh mesh; |
451 | #endif | 483 | #endif |
@@ -892,34 +924,39 @@ void ieee80211_tx_set_protected(struct ieee80211_tx_data *tx); | |||
892 | void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata, | 924 | void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata, |
893 | u32 changed); | 925 | u32 changed); |
894 | void ieee80211_configure_filter(struct ieee80211_local *local); | 926 | void ieee80211_configure_filter(struct ieee80211_local *local); |
927 | u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata); | ||
895 | 928 | ||
896 | /* wireless extensions */ | 929 | /* wireless extensions */ |
897 | extern const struct iw_handler_def ieee80211_iw_handler_def; | 930 | extern const struct iw_handler_def ieee80211_iw_handler_def; |
898 | 931 | ||
899 | /* STA/IBSS code */ | 932 | /* STA code */ |
900 | void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata); | 933 | void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata); |
901 | void ieee80211_scan_work(struct work_struct *work); | 934 | ieee80211_rx_result ieee80211_sta_rx_mgmt(struct ieee80211_sub_if_data *sdata, |
902 | void ieee80211_sta_rx_mgmt(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb, | 935 | struct sk_buff *skb, |
903 | struct ieee80211_rx_status *rx_status); | 936 | struct ieee80211_rx_status *rx_status); |
904 | int ieee80211_sta_set_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size_t len); | 937 | int ieee80211_sta_set_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size_t len); |
905 | int ieee80211_sta_get_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size_t *len); | 938 | int ieee80211_sta_get_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size_t *len); |
906 | int ieee80211_sta_set_bssid(struct ieee80211_sub_if_data *sdata, u8 *bssid); | 939 | int ieee80211_sta_set_bssid(struct ieee80211_sub_if_data *sdata, u8 *bssid); |
907 | void ieee80211_sta_req_auth(struct ieee80211_sub_if_data *sdata, | 940 | void ieee80211_sta_req_auth(struct ieee80211_sub_if_data *sdata); |
908 | struct ieee80211_if_sta *ifsta); | ||
909 | struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, | ||
910 | u8 *bssid, u8 *addr, u32 supp_rates); | ||
911 | int ieee80211_sta_deauthenticate(struct ieee80211_sub_if_data *sdata, u16 reason); | 941 | int ieee80211_sta_deauthenticate(struct ieee80211_sub_if_data *sdata, u16 reason); |
912 | int ieee80211_sta_disassociate(struct ieee80211_sub_if_data *sdata, u16 reason); | 942 | int ieee80211_sta_disassociate(struct ieee80211_sub_if_data *sdata, u16 reason); |
913 | u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata); | ||
914 | u32 ieee80211_sta_get_rates(struct ieee80211_local *local, | ||
915 | struct ieee802_11_elems *elems, | ||
916 | enum ieee80211_band band); | ||
917 | void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, | ||
918 | u8 *ssid, size_t ssid_len); | ||
919 | void ieee80211_send_pspoll(struct ieee80211_local *local, | 943 | void ieee80211_send_pspoll(struct ieee80211_local *local, |
920 | struct ieee80211_sub_if_data *sdata); | 944 | struct ieee80211_sub_if_data *sdata); |
921 | 945 | ||
946 | /* IBSS code */ | ||
947 | int ieee80211_ibss_set_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size_t len); | ||
948 | int ieee80211_ibss_get_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size_t *len); | ||
949 | int ieee80211_ibss_set_bssid(struct ieee80211_sub_if_data *sdata, u8 *bssid); | ||
950 | void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local); | ||
951 | void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata); | ||
952 | ieee80211_rx_result | ||
953 | ieee80211_ibss_rx_mgmt(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb, | ||
954 | struct ieee80211_rx_status *rx_status); | ||
955 | struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, | ||
956 | u8 *bssid, u8 *addr, u32 supp_rates); | ||
957 | |||
922 | /* scan/BSS handling */ | 958 | /* scan/BSS handling */ |
959 | void ieee80211_scan_work(struct work_struct *work); | ||
923 | int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata, | 960 | int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata, |
924 | struct cfg80211_scan_request *req); | 961 | struct cfg80211_scan_request *req); |
925 | int ieee80211_scan_results(struct ieee80211_local *local, | 962 | int ieee80211_scan_results(struct ieee80211_local *local, |
@@ -1051,6 +1088,20 @@ void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue, | |||
1051 | void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue, | 1088 | void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue, |
1052 | enum queue_stop_reason reason); | 1089 | enum queue_stop_reason reason); |
1053 | 1090 | ||
1091 | void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, | ||
1092 | u16 transaction, u16 auth_alg, | ||
1093 | u8 *extra, size_t extra_len, | ||
1094 | const u8 *bssid, int encrypt); | ||
1095 | void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, | ||
1096 | u8 *ssid, size_t ssid_len); | ||
1097 | |||
1098 | void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, | ||
1099 | const size_t supp_rates_len, | ||
1100 | const u8 *supp_rates); | ||
1101 | u32 ieee80211_sta_get_rates(struct ieee80211_local *local, | ||
1102 | struct ieee802_11_elems *elems, | ||
1103 | enum ieee80211_band band); | ||
1104 | |||
1054 | #ifdef CONFIG_MAC80211_NOINLINE | 1105 | #ifdef CONFIG_MAC80211_NOINLINE |
1055 | #define debug_noinline noinline | 1106 | #define debug_noinline noinline |
1056 | #else | 1107 | #else |