diff options
Diffstat (limited to 'net/mac80211/ieee80211_i.h')
-rw-r--r-- | net/mac80211/ieee80211_i.h | 141 |
1 files changed, 108 insertions, 33 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 88b0ba6c7484..a27921ee6e63 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -71,9 +71,6 @@ struct ieee80211_fragment_entry { | |||
71 | 71 | ||
72 | 72 | ||
73 | struct ieee80211_bss { | 73 | struct ieee80211_bss { |
74 | /* Yes, this is a hack */ | ||
75 | struct cfg80211_bss cbss; | ||
76 | |||
77 | /* don't want to look up all the time */ | 74 | /* don't want to look up all the time */ |
78 | size_t ssid_len; | 75 | size_t ssid_len; |
79 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 76 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
@@ -227,31 +224,78 @@ struct mesh_preq_queue { | |||
227 | u8 flags; | 224 | u8 flags; |
228 | }; | 225 | }; |
229 | 226 | ||
230 | enum ieee80211_mgd_state { | 227 | enum ieee80211_work_type { |
231 | IEEE80211_MGD_STATE_IDLE, | 228 | IEEE80211_WORK_ABORT, |
232 | IEEE80211_MGD_STATE_PROBE, | 229 | IEEE80211_WORK_DIRECT_PROBE, |
233 | IEEE80211_MGD_STATE_AUTH, | 230 | IEEE80211_WORK_AUTH, |
234 | IEEE80211_MGD_STATE_ASSOC, | 231 | IEEE80211_WORK_ASSOC, |
232 | IEEE80211_WORK_REMAIN_ON_CHANNEL, | ||
235 | }; | 233 | }; |
236 | 234 | ||
237 | struct ieee80211_mgd_work { | 235 | /** |
236 | * enum work_done_result - indicates what to do after work was done | ||
237 | * | ||
238 | * @WORK_DONE_DESTROY: This work item is no longer needed, destroy. | ||
239 | * @WORK_DONE_REQUEUE: This work item was reset to be reused, and | ||
240 | * should be requeued. | ||
241 | */ | ||
242 | enum work_done_result { | ||
243 | WORK_DONE_DESTROY, | ||
244 | WORK_DONE_REQUEUE, | ||
245 | }; | ||
246 | |||
247 | struct ieee80211_work { | ||
238 | struct list_head list; | 248 | struct list_head list; |
239 | struct ieee80211_bss *bss; | 249 | |
240 | int ie_len; | 250 | struct rcu_head rcu_head; |
241 | u8 prev_bssid[ETH_ALEN]; | 251 | |
242 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 252 | struct ieee80211_sub_if_data *sdata; |
243 | u8 ssid_len; | 253 | |
254 | enum work_done_result (*done)(struct ieee80211_work *wk, | ||
255 | struct sk_buff *skb); | ||
256 | |||
257 | struct ieee80211_channel *chan; | ||
258 | enum nl80211_channel_type chan_type; | ||
259 | |||
244 | unsigned long timeout; | 260 | unsigned long timeout; |
245 | enum ieee80211_mgd_state state; | 261 | enum ieee80211_work_type type; |
246 | u16 auth_alg, auth_transaction; | ||
247 | 262 | ||
248 | int tries; | 263 | u8 filter_ta[ETH_ALEN]; |
264 | |||
265 | bool started; | ||
249 | 266 | ||
250 | u8 key[WLAN_KEY_LEN_WEP104]; | 267 | union { |
251 | u8 key_len, key_idx; | 268 | struct { |
269 | int tries; | ||
270 | u16 algorithm, transaction; | ||
271 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | ||
272 | u8 ssid_len; | ||
273 | u8 key[WLAN_KEY_LEN_WEP104]; | ||
274 | u8 key_len, key_idx; | ||
275 | bool privacy; | ||
276 | } probe_auth; | ||
277 | struct { | ||
278 | struct cfg80211_bss *bss; | ||
279 | const u8 *supp_rates; | ||
280 | const u8 *ht_information_ie; | ||
281 | enum ieee80211_smps_mode smps; | ||
282 | int tries; | ||
283 | u16 capability; | ||
284 | u8 prev_bssid[ETH_ALEN]; | ||
285 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | ||
286 | u8 ssid_len; | ||
287 | u8 supp_rates_len; | ||
288 | bool wmm_used, use_11n; | ||
289 | } assoc; | ||
290 | struct { | ||
291 | u32 duration; | ||
292 | bool started; | ||
293 | } remain; | ||
294 | }; | ||
252 | 295 | ||
296 | int ie_len; | ||
253 | /* must be last */ | 297 | /* must be last */ |
254 | u8 ie[0]; /* for auth or assoc frame, not probe */ | 298 | u8 ie[0]; |
255 | }; | 299 | }; |
256 | 300 | ||
257 | /* flags used in struct ieee80211_if_managed.flags */ | 301 | /* flags used in struct ieee80211_if_managed.flags */ |
@@ -259,17 +303,11 @@ enum ieee80211_sta_flags { | |||
259 | IEEE80211_STA_BEACON_POLL = BIT(0), | 303 | IEEE80211_STA_BEACON_POLL = BIT(0), |
260 | IEEE80211_STA_CONNECTION_POLL = BIT(1), | 304 | IEEE80211_STA_CONNECTION_POLL = BIT(1), |
261 | IEEE80211_STA_CONTROL_PORT = BIT(2), | 305 | IEEE80211_STA_CONTROL_PORT = BIT(2), |
262 | IEEE80211_STA_WMM_ENABLED = BIT(3), | ||
263 | IEEE80211_STA_DISABLE_11N = BIT(4), | 306 | IEEE80211_STA_DISABLE_11N = BIT(4), |
264 | IEEE80211_STA_CSA_RECEIVED = BIT(5), | 307 | IEEE80211_STA_CSA_RECEIVED = BIT(5), |
265 | IEEE80211_STA_MFP_ENABLED = BIT(6), | 308 | IEEE80211_STA_MFP_ENABLED = BIT(6), |
266 | }; | 309 | }; |
267 | 310 | ||
268 | /* flags for MLME request */ | ||
269 | enum ieee80211_sta_request { | ||
270 | IEEE80211_STA_REQ_SCAN, | ||
271 | }; | ||
272 | |||
273 | struct ieee80211_if_managed { | 311 | struct ieee80211_if_managed { |
274 | struct timer_list timer; | 312 | struct timer_list timer; |
275 | struct timer_list conn_mon_timer; | 313 | struct timer_list conn_mon_timer; |
@@ -284,14 +322,11 @@ struct ieee80211_if_managed { | |||
284 | int probe_send_count; | 322 | int probe_send_count; |
285 | 323 | ||
286 | struct mutex mtx; | 324 | struct mutex mtx; |
287 | struct ieee80211_bss *associated; | 325 | struct cfg80211_bss *associated; |
288 | struct ieee80211_mgd_work *old_associate_work; | ||
289 | struct list_head work_list; | ||
290 | 326 | ||
291 | u8 bssid[ETH_ALEN]; | 327 | u8 bssid[ETH_ALEN]; |
292 | 328 | ||
293 | u16 aid; | 329 | u16 aid; |
294 | u16 capab; | ||
295 | 330 | ||
296 | struct sk_buff_head skb_queue; | 331 | struct sk_buff_head skb_queue; |
297 | 332 | ||
@@ -300,8 +335,6 @@ struct ieee80211_if_managed { | |||
300 | enum ieee80211_smps_mode req_smps, /* requested smps mode */ | 335 | enum ieee80211_smps_mode req_smps, /* requested smps mode */ |
301 | ap_smps; /* smps mode AP thinks we're in */ | 336 | ap_smps; /* smps mode AP thinks we're in */ |
302 | 337 | ||
303 | unsigned long request; | ||
304 | |||
305 | unsigned int flags; | 338 | unsigned int flags; |
306 | 339 | ||
307 | u32 beacon_crc; | 340 | u32 beacon_crc; |
@@ -568,6 +601,15 @@ struct ieee80211_local { | |||
568 | const struct ieee80211_ops *ops; | 601 | const struct ieee80211_ops *ops; |
569 | 602 | ||
570 | /* | 603 | /* |
604 | * work stuff, potentially off-channel (in the future) | ||
605 | */ | ||
606 | struct mutex work_mtx; | ||
607 | struct list_head work_list; | ||
608 | struct timer_list work_timer; | ||
609 | struct work_struct work_work; | ||
610 | struct sk_buff_head work_skb_queue; | ||
611 | |||
612 | /* | ||
571 | * private workqueue to mac80211. mac80211 makes this accessible | 613 | * private workqueue to mac80211. mac80211 makes this accessible |
572 | * via ieee80211_queue_work() | 614 | * via ieee80211_queue_work() |
573 | */ | 615 | */ |
@@ -695,6 +737,10 @@ struct ieee80211_local { | |||
695 | enum nl80211_channel_type oper_channel_type; | 737 | enum nl80211_channel_type oper_channel_type; |
696 | struct ieee80211_channel *oper_channel, *csa_channel; | 738 | struct ieee80211_channel *oper_channel, *csa_channel; |
697 | 739 | ||
740 | /* Temporary remain-on-channel for off-channel operations */ | ||
741 | struct ieee80211_channel *tmp_channel; | ||
742 | enum nl80211_channel_type tmp_channel_type; | ||
743 | |||
698 | /* SNMP counters */ | 744 | /* SNMP counters */ |
699 | /* dot11CountersTable */ | 745 | /* dot11CountersTable */ |
700 | u32 dot11TransmittedFragmentCount; | 746 | u32 dot11TransmittedFragmentCount; |
@@ -752,7 +798,7 @@ struct ieee80211_local { | |||
752 | unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */ | 798 | unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */ |
753 | 799 | ||
754 | bool pspolling; | 800 | bool pspolling; |
755 | bool scan_ps_enabled; | 801 | bool offchannel_ps_enabled; |
756 | /* | 802 | /* |
757 | * PS can only be enabled when we have exactly one managed | 803 | * PS can only be enabled when we have exactly one managed |
758 | * interface (and monitors) in PS, this then points there. | 804 | * interface (and monitors) in PS, this then points there. |
@@ -947,6 +993,12 @@ ieee80211_rx_bss_get(struct ieee80211_local *local, u8 *bssid, int freq, | |||
947 | void ieee80211_rx_bss_put(struct ieee80211_local *local, | 993 | void ieee80211_rx_bss_put(struct ieee80211_local *local, |
948 | struct ieee80211_bss *bss); | 994 | struct ieee80211_bss *bss); |
949 | 995 | ||
996 | /* off-channel helpers */ | ||
997 | void ieee80211_offchannel_stop_beaconing(struct ieee80211_local *local); | ||
998 | void ieee80211_offchannel_stop_station(struct ieee80211_local *local); | ||
999 | void ieee80211_offchannel_return(struct ieee80211_local *local, | ||
1000 | bool enable_beaconing); | ||
1001 | |||
950 | /* interface handling */ | 1002 | /* interface handling */ |
951 | int ieee80211_iface_init(void); | 1003 | int ieee80211_iface_init(void); |
952 | void ieee80211_iface_exit(void); | 1004 | void ieee80211_iface_exit(void); |
@@ -960,6 +1012,11 @@ void ieee80211_remove_interfaces(struct ieee80211_local *local); | |||
960 | u32 __ieee80211_recalc_idle(struct ieee80211_local *local); | 1012 | u32 __ieee80211_recalc_idle(struct ieee80211_local *local); |
961 | void ieee80211_recalc_idle(struct ieee80211_local *local); | 1013 | void ieee80211_recalc_idle(struct ieee80211_local *local); |
962 | 1014 | ||
1015 | static inline bool ieee80211_sdata_running(struct ieee80211_sub_if_data *sdata) | ||
1016 | { | ||
1017 | return netif_running(sdata->dev); | ||
1018 | } | ||
1019 | |||
963 | /* tx handling */ | 1020 | /* tx handling */ |
964 | void ieee80211_clear_tx_pending(struct ieee80211_local *local); | 1021 | void ieee80211_clear_tx_pending(struct ieee80211_local *local); |
965 | void ieee80211_tx_pending(unsigned long data); | 1022 | void ieee80211_tx_pending(unsigned long data); |
@@ -1106,6 +1163,24 @@ int __ieee80211_request_smps(struct ieee80211_sub_if_data *sdata, | |||
1106 | void ieee80211_recalc_smps(struct ieee80211_local *local, | 1163 | void ieee80211_recalc_smps(struct ieee80211_local *local, |
1107 | struct ieee80211_sub_if_data *forsdata); | 1164 | struct ieee80211_sub_if_data *forsdata); |
1108 | 1165 | ||
1166 | size_t ieee80211_ie_split(const u8 *ies, size_t ielen, | ||
1167 | const u8 *ids, int n_ids, size_t offset); | ||
1168 | size_t ieee80211_ie_split_vendor(const u8 *ies, size_t ielen, size_t offset); | ||
1169 | |||
1170 | /* internal work items */ | ||
1171 | void ieee80211_work_init(struct ieee80211_local *local); | ||
1172 | void ieee80211_add_work(struct ieee80211_work *wk); | ||
1173 | void free_work(struct ieee80211_work *wk); | ||
1174 | void ieee80211_work_purge(struct ieee80211_sub_if_data *sdata); | ||
1175 | ieee80211_rx_result ieee80211_work_rx_mgmt(struct ieee80211_sub_if_data *sdata, | ||
1176 | struct sk_buff *skb); | ||
1177 | int ieee80211_wk_remain_on_channel(struct ieee80211_sub_if_data *sdata, | ||
1178 | struct ieee80211_channel *chan, | ||
1179 | enum nl80211_channel_type channel_type, | ||
1180 | unsigned int duration, u64 *cookie); | ||
1181 | int ieee80211_wk_cancel_remain_on_channel( | ||
1182 | struct ieee80211_sub_if_data *sdata, u64 cookie); | ||
1183 | |||
1109 | #ifdef CONFIG_MAC80211_NOINLINE | 1184 | #ifdef CONFIG_MAC80211_NOINLINE |
1110 | #define debug_noinline noinline | 1185 | #define debug_noinline noinline |
1111 | #else | 1186 | #else |