aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_i.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-07-06 21:45:17 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 15:02:30 -0400
commit77fdaa12cea26c204cc12c312fe40bc0f3dcdfd8 (patch)
treec28fdd28f2ca2783783adb4b5e13b7ba57a223a3 /net/mac80211/ieee80211_i.h
parenta7c1cfc9616ee76213a6d4fd4c17f13fdc92ddce (diff)
mac80211: rework MLME for multiple authentications
Sit tight. This shakes up the world as you know it. Let go of your spaghetti tongs, they will no longer be required, the horrible statemachine in net/mac80211/mlme.c is no more... With the cfg80211 SME mac80211 now has much less to keep track of, but, on the other hand, for FT it needs to be able to keep track of at least one authentication being in progress while associated. So convert from a single state machine to having small ones for all the different things we need to do. For real FT it will still need work wrt. PS, but this should be a good 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.h86
1 files changed, 36 insertions, 50 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index d0354b16d24f..2e92bbd9b2d0 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -227,11 +227,32 @@ struct mesh_preq_queue {
227 u8 flags; 227 u8 flags;
228}; 228};
229 229
230enum ieee80211_mgd_state {
231 IEEE80211_MGD_STATE_IDLE,
232 IEEE80211_MGD_STATE_PROBE,
233 IEEE80211_MGD_STATE_AUTH,
234 IEEE80211_MGD_STATE_ASSOC,
235};
236
237struct ieee80211_mgd_work {
238 struct list_head list;
239 struct ieee80211_bss *bss;
240 int ie_len;
241 u8 prev_bssid[ETH_ALEN];
242 u8 ssid[IEEE80211_MAX_SSID_LEN];
243 u8 ssid_len;
244 unsigned long timeout;
245 enum ieee80211_mgd_state state;
246 u16 auth_alg, auth_transaction;
247
248 int tries;
249
250 /* must be last */
251 u8 ie[0]; /* for auth or assoc frame, not probe */
252};
253
230/* flags used in struct ieee80211_if_managed.flags */ 254/* flags used in struct ieee80211_if_managed.flags */
231enum ieee80211_sta_flags { 255enum ieee80211_sta_flags {
232 IEEE80211_STA_PREV_BSSID_SET = BIT(0),
233 IEEE80211_STA_AUTHENTICATED = BIT(1),
234 IEEE80211_STA_ASSOCIATED = BIT(2),
235 IEEE80211_STA_PROBEREQ_POLL = BIT(3), 256 IEEE80211_STA_PROBEREQ_POLL = BIT(3),
236 IEEE80211_STA_CONTROL_PORT = BIT(4), 257 IEEE80211_STA_CONTROL_PORT = BIT(4),
237 IEEE80211_STA_WMM_ENABLED = BIT(5), 258 IEEE80211_STA_WMM_ENABLED = BIT(5),
@@ -243,8 +264,6 @@ enum ieee80211_sta_flags {
243/* flags for MLME request */ 264/* flags for MLME request */
244enum ieee80211_sta_request { 265enum ieee80211_sta_request {
245 IEEE80211_STA_REQ_SCAN, 266 IEEE80211_STA_REQ_SCAN,
246 IEEE80211_STA_REQ_AUTH,
247 IEEE80211_STA_REQ_RUN,
248}; 267};
249 268
250struct ieee80211_if_managed { 269struct ieee80211_if_managed {
@@ -254,35 +273,17 @@ struct ieee80211_if_managed {
254 struct work_struct chswitch_work; 273 struct work_struct chswitch_work;
255 struct work_struct beacon_loss_work; 274 struct work_struct beacon_loss_work;
256 275
257 u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; 276 struct mutex mtx;
277 struct ieee80211_bss *associated;
278 struct list_head work_list;
258 279
259 u8 ssid[IEEE80211_MAX_SSID_LEN]; 280 u8 bssid[ETH_ALEN];
260 size_t ssid_len;
261
262 enum {
263 IEEE80211_STA_MLME_DISABLED,
264 IEEE80211_STA_MLME_DIRECT_PROBE,
265 IEEE80211_STA_MLME_AUTHENTICATE,
266 IEEE80211_STA_MLME_ASSOCIATE,
267 IEEE80211_STA_MLME_ASSOCIATED,
268 } state;
269 281
270 u16 aid; 282 u16 aid;
271 u16 capab; 283 u16 capab;
272 u8 *extra_ie; /* to be added to the end of AssocReq */
273 size_t extra_ie_len;
274
275 /* The last AssocReq/Resp IEs */
276 u8 *assocreq_ies, *assocresp_ies;
277 size_t assocreq_ies_len, assocresp_ies_len;
278 284
279 struct sk_buff_head skb_queue; 285 struct sk_buff_head skb_queue;
280 286
281 int assoc_scan_tries; /* number of scans done pre-association */
282 int direct_probe_tries; /* retries for direct probes */
283 int auth_tries; /* retries for auth req */
284 int assoc_tries; /* retries for assoc req */
285
286 unsigned long timers_running; /* used for quiesce/restart */ 287 unsigned long timers_running; /* used for quiesce/restart */
287 bool powersave; /* powersave requested for this iface */ 288 bool powersave; /* powersave requested for this iface */
288 289
@@ -292,9 +293,6 @@ struct ieee80211_if_managed {
292 293
293 unsigned int flags; 294 unsigned int flags;
294 295
295 int auth_alg; /* currently used IEEE 802.11 authentication algorithm */
296 int auth_transaction;
297
298 u32 beacon_crc; 296 u32 beacon_crc;
299 297
300 enum { 298 enum {
@@ -304,10 +302,6 @@ struct ieee80211_if_managed {
304 } mfp; /* management frame protection */ 302 } mfp; /* management frame protection */
305 303
306 int wmm_last_param_set; 304 int wmm_last_param_set;
307
308 /* Extra IE data for management frames */
309 u8 *sme_auth_ie;
310 size_t sme_auth_ie_len;
311}; 305};
312 306
313enum ieee80211_ibss_request { 307enum ieee80211_ibss_request {
@@ -466,18 +460,9 @@ struct ieee80211_sub_if_data {
466 union { 460 union {
467 struct { 461 struct {
468 struct dentry *drop_unencrypted; 462 struct dentry *drop_unencrypted;
469 struct dentry *state;
470 struct dentry *bssid; 463 struct dentry *bssid;
471 struct dentry *prev_bssid;
472 struct dentry *ssid_len;
473 struct dentry *aid; 464 struct dentry *aid;
474 struct dentry *capab; 465 struct dentry *capab;
475 struct dentry *extra_ie_len;
476 struct dentry *auth_tries;
477 struct dentry *assoc_tries;
478 struct dentry *auth_alg;
479 struct dentry *auth_transaction;
480 struct dentry *flags;
481 struct dentry *force_unicast_rateidx; 466 struct dentry *force_unicast_rateidx;
482 struct dentry *max_ratectrl_rateidx; 467 struct dentry *max_ratectrl_rateidx;
483 } sta; 468 } sta;
@@ -928,11 +913,16 @@ extern const struct iw_handler_def ieee80211_iw_handler_def;
928 913
929/* STA code */ 914/* STA code */
930void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata); 915void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata);
916int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
917 struct cfg80211_auth_request *req);
918int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
919 struct cfg80211_assoc_request *req);
920int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
921 struct cfg80211_deauth_request *req);
922int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
923 struct cfg80211_disassoc_request *req);
931ieee80211_rx_result ieee80211_sta_rx_mgmt(struct ieee80211_sub_if_data *sdata, 924ieee80211_rx_result ieee80211_sta_rx_mgmt(struct ieee80211_sub_if_data *sdata,
932 struct sk_buff *skb); 925 struct sk_buff *skb);
933void ieee80211_sta_req_auth(struct ieee80211_sub_if_data *sdata);
934int ieee80211_sta_deauthenticate(struct ieee80211_sub_if_data *sdata, u16 reason);
935int ieee80211_sta_disassociate(struct ieee80211_sub_if_data *sdata, u16 reason);
936void ieee80211_send_pspoll(struct ieee80211_local *local, 926void ieee80211_send_pspoll(struct ieee80211_local *local,
937 struct ieee80211_sub_if_data *sdata); 927 struct ieee80211_sub_if_data *sdata);
938void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency); 928void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency);
@@ -966,8 +956,6 @@ int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata,
966void ieee80211_scan_cancel(struct ieee80211_local *local); 956void ieee80211_scan_cancel(struct ieee80211_local *local);
967ieee80211_rx_result 957ieee80211_rx_result
968ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); 958ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb);
969int ieee80211_sta_set_extra_ie(struct ieee80211_sub_if_data *sdata,
970 const char *ie, size_t len);
971 959
972void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local); 960void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local);
973struct ieee80211_bss * 961struct ieee80211_bss *
@@ -983,8 +971,6 @@ ieee80211_rx_bss_get(struct ieee80211_local *local, u8 *bssid, int freq,
983 u8 *ssid, u8 ssid_len); 971 u8 *ssid, u8 ssid_len);
984void ieee80211_rx_bss_put(struct ieee80211_local *local, 972void ieee80211_rx_bss_put(struct ieee80211_local *local,
985 struct ieee80211_bss *bss); 973 struct ieee80211_bss *bss);
986void ieee80211_rx_bss_remove(struct ieee80211_sub_if_data *sdata, u8 *bssid,
987 int freq, u8 *ssid, u8 ssid_len);
988 974
989/* interface handling */ 975/* interface handling */
990int ieee80211_if_add(struct ieee80211_local *local, const char *name, 976int ieee80211_if_add(struct ieee80211_local *local, const char *name,