]>
Commit | Line | Data |
---|---|---|
f0706e82 JB |
1 | /* |
2 | * Copyright 2002-2005, Instant802 Networks, Inc. | |
3 | * Copyright 2005, Devicescape Software, Inc. | |
4 | * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License version 2 as | |
8 | * published by the Free Software Foundation. | |
9 | */ | |
10 | ||
11 | #ifndef IEEE80211_I_H | |
12 | #define IEEE80211_I_H | |
13 | ||
14 | #include <linux/kernel.h> | |
15 | #include <linux/device.h> | |
16 | #include <linux/if_ether.h> | |
17 | #include <linux/interrupt.h> | |
18 | #include <linux/list.h> | |
19 | #include <linux/netdevice.h> | |
20 | #include <linux/skbuff.h> | |
21 | #include <linux/workqueue.h> | |
22 | #include <linux/types.h> | |
23 | #include <linux/spinlock.h> | |
571ecf67 | 24 | #include <linux/etherdevice.h> |
f0706e82 | 25 | #include <net/wireless.h> |
2c8dccc7 | 26 | #include "key.h" |
f0706e82 JB |
27 | #include "sta_info.h" |
28 | ||
29 | /* ieee80211.o internal definitions, etc. These are not included into | |
30 | * low-level drivers. */ | |
31 | ||
32 | #ifndef ETH_P_PAE | |
33 | #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ | |
34 | #endif /* ETH_P_PAE */ | |
35 | ||
36 | #define WLAN_FC_DATA_PRESENT(fc) (((fc) & 0x4c) == 0x08) | |
37 | ||
9cfb0009 | 38 | #define IEEE80211_FC(type, subtype) cpu_to_le16(type | subtype) |
f0706e82 | 39 | |
9cfb0009 | 40 | struct ieee80211_local; |
f0706e82 JB |
41 | |
42 | /* Maximum number of broadcast/multicast frames to buffer when some of the | |
43 | * associated stations are using power saving. */ | |
44 | #define AP_MAX_BC_BUFFER 128 | |
45 | ||
46 | /* Maximum number of frames buffered to all STAs, including multicast frames. | |
47 | * Note: increasing this limit increases the potential memory requirement. Each | |
48 | * frame can be up to about 2 kB long. */ | |
49 | #define TOTAL_MAX_TX_BUFFER 512 | |
50 | ||
51 | /* Required encryption head and tailroom */ | |
52 | #define IEEE80211_ENCRYPT_HEADROOM 8 | |
53 | #define IEEE80211_ENCRYPT_TAILROOM 12 | |
54 | ||
55 | /* IEEE 802.11 (Ch. 9.5 Defragmentation) requires support for concurrent | |
56 | * reception of at least three fragmented frames. This limit can be increased | |
57 | * by changing this define, at the cost of slower frame reassembly and | |
58 | * increased memory use (about 2 kB of RAM per entry). */ | |
59 | #define IEEE80211_FRAGMENT_MAX 4 | |
60 | ||
61 | struct ieee80211_fragment_entry { | |
62 | unsigned long first_frag_time; | |
63 | unsigned int seq; | |
64 | unsigned int rx_queue; | |
65 | unsigned int last_frag; | |
66 | unsigned int extra_len; | |
67 | struct sk_buff_head skb_list; | |
68 | int ccmp; /* Whether fragments were encrypted with CCMP */ | |
69 | u8 last_pn[6]; /* PN of the last fragment if CCMP was used */ | |
70 | }; | |
71 | ||
72 | ||
73 | struct ieee80211_sta_bss { | |
74 | struct list_head list; | |
75 | struct ieee80211_sta_bss *hnext; | |
056cdd59 JB |
76 | size_t ssid_len; |
77 | ||
f0706e82 JB |
78 | atomic_t users; |
79 | ||
80 | u8 bssid[ETH_ALEN]; | |
81 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | |
f0706e82 | 82 | u16 capability; /* host byte order */ |
8318d78a | 83 | enum ieee80211_band band; |
f0706e82 | 84 | int freq; |
566bfe5a | 85 | int signal, noise, qual; |
f0706e82 JB |
86 | u8 *wpa_ie; |
87 | size_t wpa_ie_len; | |
88 | u8 *rsn_ie; | |
89 | size_t rsn_ie_len; | |
90 | u8 *wmm_ie; | |
91 | size_t wmm_ie_len; | |
c7153508 RR |
92 | u8 *ht_ie; |
93 | size_t ht_ie_len; | |
ee385855 LCC |
94 | #ifdef CONFIG_MAC80211_MESH |
95 | u8 *mesh_id; | |
96 | size_t mesh_id_len; | |
24736701 | 97 | u8 *mesh_cfg; |
902acc78 | 98 | #endif |
f0706e82 JB |
99 | #define IEEE80211_MAX_SUPP_RATES 32 |
100 | u8 supp_rates[IEEE80211_MAX_SUPP_RATES]; | |
101 | size_t supp_rates_len; | |
f0706e82 | 102 | u64 timestamp; |
056cdd59 | 103 | int beacon_int; |
f0706e82 | 104 | |
30b89b0f | 105 | bool probe_resp; |
f0706e82 JB |
106 | unsigned long last_update; |
107 | ||
5628221c DD |
108 | /* during assocation, we save an ERP value from a probe response so |
109 | * that we can feed ERP info to the driver when handling the | |
110 | * association completes. these fields probably won't be up-to-date | |
111 | * otherwise, you probably don't want to use them. */ | |
112 | int has_erp_value; | |
113 | u8 erp_value; | |
f0706e82 JB |
114 | }; |
115 | ||
24736701 | 116 | static inline u8 *bss_mesh_cfg(struct ieee80211_sta_bss *bss) |
902acc78 JB |
117 | { |
118 | #ifdef CONFIG_MAC80211_MESH | |
119 | return bss->mesh_cfg; | |
120 | #endif | |
121 | return NULL; | |
122 | } | |
123 | ||
124 | static inline u8 *bss_mesh_id(struct ieee80211_sta_bss *bss) | |
125 | { | |
126 | #ifdef CONFIG_MAC80211_MESH | |
127 | return bss->mesh_id; | |
128 | #endif | |
129 | return NULL; | |
130 | } | |
131 | ||
132 | static inline u8 bss_mesh_id_len(struct ieee80211_sta_bss *bss) | |
133 | { | |
134 | #ifdef CONFIG_MAC80211_MESH | |
135 | return bss->mesh_id_len; | |
136 | #endif | |
137 | return 0; | |
138 | } | |
139 | ||
f0706e82 | 140 | |
9ae54c84 JB |
141 | typedef unsigned __bitwise__ ieee80211_tx_result; |
142 | #define TX_CONTINUE ((__force ieee80211_tx_result) 0u) | |
143 | #define TX_DROP ((__force ieee80211_tx_result) 1u) | |
144 | #define TX_QUEUED ((__force ieee80211_tx_result) 2u) | |
145 | ||
5cf121c3 JB |
146 | #define IEEE80211_TX_FRAGMENTED BIT(0) |
147 | #define IEEE80211_TX_UNICAST BIT(1) | |
148 | #define IEEE80211_TX_PS_BUFFERED BIT(2) | |
149 | #define IEEE80211_TX_PROBE_LAST_FRAG BIT(3) | |
150 | #define IEEE80211_TX_INJECTED BIT(4) | |
151 | ||
152 | struct ieee80211_tx_data { | |
153 | struct sk_buff *skb; | |
154 | struct net_device *dev; | |
155 | struct ieee80211_local *local; | |
156 | struct ieee80211_sub_if_data *sdata; | |
157 | struct sta_info *sta; | |
5cf121c3 | 158 | struct ieee80211_key *key; |
5cf121c3 JB |
159 | |
160 | struct ieee80211_tx_control *control; | |
161 | struct ieee80211_channel *channel; | |
162 | struct ieee80211_rate *rate; | |
163 | /* use this rate (if set) for last fragment; rate can | |
164 | * be set to lower rate for the first fragments, e.g., | |
165 | * when using CTS protection with IEEE 802.11g. */ | |
166 | struct ieee80211_rate *last_frag_rate; | |
167 | ||
168 | /* Extra fragments (in addition to the first fragment | |
169 | * in skb) */ | |
5cf121c3 | 170 | struct sk_buff **extra_frag; |
056cdd59 JB |
171 | int num_extra_frag; |
172 | ||
173 | u16 fc, ethertype; | |
174 | unsigned int flags; | |
5cf121c3 JB |
175 | }; |
176 | ||
177 | ||
9ae54c84 | 178 | typedef unsigned __bitwise__ ieee80211_rx_result; |
e4c26add JB |
179 | #define RX_CONTINUE ((__force ieee80211_rx_result) 0u) |
180 | #define RX_DROP_UNUSABLE ((__force ieee80211_rx_result) 1u) | |
181 | #define RX_DROP_MONITOR ((__force ieee80211_rx_result) 2u) | |
182 | #define RX_QUEUED ((__force ieee80211_rx_result) 3u) | |
9ae54c84 | 183 | |
5cf121c3 | 184 | #define IEEE80211_RX_IN_SCAN BIT(0) |
badffb72 | 185 | /* frame is destined to interface currently processed (incl. multicast frames) */ |
5cf121c3 JB |
186 | #define IEEE80211_RX_RA_MATCH BIT(1) |
187 | #define IEEE80211_RX_AMSDU BIT(2) | |
188 | #define IEEE80211_RX_CMNTR_REPORTED BIT(3) | |
189 | #define IEEE80211_RX_FRAGMENTED BIT(4) | |
190 | ||
191 | struct ieee80211_rx_data { | |
f0706e82 JB |
192 | struct sk_buff *skb; |
193 | struct net_device *dev; | |
194 | struct ieee80211_local *local; | |
195 | struct ieee80211_sub_if_data *sdata; | |
196 | struct sta_info *sta; | |
f0706e82 | 197 | struct ieee80211_key *key; |
5cf121c3 JB |
198 | struct ieee80211_rx_status *status; |
199 | struct ieee80211_rate *rate; | |
056cdd59 JB |
200 | |
201 | u16 fc, ethertype; | |
202 | unsigned int flags; | |
5cf121c3 JB |
203 | int sent_ps_buffered; |
204 | int queue; | |
205 | int load; | |
206 | u32 tkip_iv32; | |
207 | u16 tkip_iv16; | |
f0706e82 JB |
208 | }; |
209 | ||
e8bf9649 JS |
210 | /* flags used in struct ieee80211_tx_packet_data.flags */ |
211 | #define IEEE80211_TXPD_REQ_TX_STATUS BIT(0) | |
212 | #define IEEE80211_TXPD_DO_NOT_ENCRYPT BIT(1) | |
213 | #define IEEE80211_TXPD_REQUEUE BIT(2) | |
678f5f71 | 214 | #define IEEE80211_TXPD_EAPOL_FRAME BIT(3) |
9e723492 | 215 | #define IEEE80211_TXPD_AMPDU BIT(4) |
f0706e82 JB |
216 | /* Stored in sk_buff->cb */ |
217 | struct ieee80211_tx_packet_data { | |
218 | int ifindex; | |
219 | unsigned long jiffies; | |
e8bf9649 JS |
220 | unsigned int flags; |
221 | u8 queue; | |
f0706e82 JB |
222 | }; |
223 | ||
224 | struct ieee80211_tx_stored_packet { | |
225 | struct ieee80211_tx_control control; | |
226 | struct sk_buff *skb; | |
f0706e82 | 227 | struct sk_buff **extra_frag; |
f0706e82 | 228 | struct ieee80211_rate *last_frag_rate; |
056cdd59 | 229 | int num_extra_frag; |
badffb72 | 230 | unsigned int last_frag_rate_ctrl_probe; |
f0706e82 JB |
231 | }; |
232 | ||
5dfdaf58 JB |
233 | struct beacon_data { |
234 | u8 *head, *tail; | |
235 | int head_len, tail_len; | |
236 | int dtim_period; | |
237 | }; | |
238 | ||
f0706e82 | 239 | struct ieee80211_if_ap { |
5dfdaf58 | 240 | struct beacon_data *beacon; |
f0706e82 | 241 | |
0ec3ca44 JB |
242 | struct list_head vlans; |
243 | ||
f0706e82 JB |
244 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
245 | size_t ssid_len; | |
f0706e82 JB |
246 | |
247 | /* yes, this looks ugly, but guarantees that we can later use | |
248 | * bitmap_empty :) | |
004c872e | 249 | * NB: don't touch this bitmap, use sta_info_{set,clear}_tim_bit */ |
f0706e82 | 250 | u8 tim[sizeof(unsigned long) * BITS_TO_LONGS(IEEE80211_MAX_AID + 1)]; |
f0706e82 | 251 | struct sk_buff_head ps_bc_buf; |
056cdd59 | 252 | atomic_t num_sta_ps; /* number of stations in PS mode */ |
5dfdaf58 | 253 | int dtim_count; |
f0706e82 JB |
254 | int force_unicast_rateidx; /* forced TX rateidx for unicast frames */ |
255 | int max_ratectrl_rateidx; /* max TX rateidx for rate control */ | |
256 | int num_beacons; /* number of TXed beacon frames for this BSS */ | |
257 | }; | |
258 | ||
259 | struct ieee80211_if_wds { | |
f0706e82 | 260 | struct sta_info *sta; |
056cdd59 | 261 | u8 remote_addr[ETH_ALEN]; |
f0706e82 JB |
262 | }; |
263 | ||
264 | struct ieee80211_if_vlan { | |
0ec3ca44 JB |
265 | struct ieee80211_sub_if_data *ap; |
266 | struct list_head list; | |
f0706e82 JB |
267 | }; |
268 | ||
ee385855 LCC |
269 | struct mesh_stats { |
270 | __u32 fwded_frames; /* Mesh forwarded frames */ | |
271 | __u32 dropped_frames_ttl; /* Not transmitted since mesh_ttl == 0*/ | |
272 | __u32 dropped_frames_no_route; /* Not transmitted, no route found */ | |
273 | atomic_t estab_plinks; | |
274 | }; | |
275 | ||
276 | #define PREQ_Q_F_START 0x1 | |
277 | #define PREQ_Q_F_REFRESH 0x2 | |
278 | struct mesh_preq_queue { | |
279 | struct list_head list; | |
280 | u8 dst[ETH_ALEN]; | |
281 | u8 flags; | |
282 | }; | |
283 | ||
ee385855 LCC |
284 | struct mesh_config { |
285 | /* Timeouts in ms */ | |
286 | /* Mesh plink management parameters */ | |
287 | u16 dot11MeshRetryTimeout; | |
288 | u16 dot11MeshConfirmTimeout; | |
289 | u16 dot11MeshHoldingTimeout; | |
290 | u16 dot11MeshMaxPeerLinks; | |
291 | u8 dot11MeshMaxRetries; | |
292 | u8 dot11MeshTTL; | |
293 | bool auto_open_plinks; | |
294 | /* HWMP parameters */ | |
ee385855 LCC |
295 | u8 dot11MeshHWMPmaxPREQretries; |
296 | u32 path_refresh_time; | |
297 | u16 min_discovery_timeout; | |
056cdd59 JB |
298 | u32 dot11MeshHWMPactivePathTimeout; |
299 | u16 dot11MeshHWMPpreqMinInterval; | |
300 | u16 dot11MeshHWMPnetDiameterTraversalTime; | |
ee385855 | 301 | }; |
902acc78 | 302 | |
ee385855 | 303 | |
d6f2da5b JS |
304 | /* flags used in struct ieee80211_if_sta.flags */ |
305 | #define IEEE80211_STA_SSID_SET BIT(0) | |
306 | #define IEEE80211_STA_BSSID_SET BIT(1) | |
307 | #define IEEE80211_STA_PREV_BSSID_SET BIT(2) | |
308 | #define IEEE80211_STA_AUTHENTICATED BIT(3) | |
309 | #define IEEE80211_STA_ASSOCIATED BIT(4) | |
310 | #define IEEE80211_STA_PROBEREQ_POLL BIT(5) | |
311 | #define IEEE80211_STA_CREATE_IBSS BIT(6) | |
312 | #define IEEE80211_STA_MIXED_CELL BIT(7) | |
313 | #define IEEE80211_STA_WMM_ENABLED BIT(8) | |
314 | #define IEEE80211_STA_AUTO_SSID_SEL BIT(10) | |
315 | #define IEEE80211_STA_AUTO_BSSID_SEL BIT(11) | |
316 | #define IEEE80211_STA_AUTO_CHANNEL_SEL BIT(12) | |
5b98b1f7 | 317 | #define IEEE80211_STA_PRIVACY_INVOKED BIT(13) |
f0706e82 | 318 | struct ieee80211_if_sta { |
056cdd59 JB |
319 | struct timer_list timer; |
320 | struct work_struct work; | |
321 | u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; | |
322 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | |
f0706e82 JB |
323 | enum { |
324 | IEEE80211_DISABLED, IEEE80211_AUTHENTICATE, | |
325 | IEEE80211_ASSOCIATE, IEEE80211_ASSOCIATED, | |
ee385855 LCC |
326 | IEEE80211_IBSS_SEARCH, IEEE80211_IBSS_JOINED, |
327 | IEEE80211_MESH_UP | |
f0706e82 | 328 | } state; |
f0706e82 | 329 | size_t ssid_len; |
a0af5f14 HS |
330 | u8 scan_ssid[IEEE80211_MAX_SSID_LEN]; |
331 | size_t scan_ssid_len; | |
ee385855 LCC |
332 | #ifdef CONFIG_MAC80211_MESH |
333 | struct timer_list mesh_path_timer; | |
334 | u8 mesh_id[IEEE80211_MAX_MESH_ID_LEN]; | |
ee385855 LCC |
335 | size_t mesh_id_len; |
336 | /* Active Path Selection Protocol Identifier */ | |
337 | u8 mesh_pp_id[4]; | |
338 | /* Active Path Selection Metric Identifier */ | |
339 | u8 mesh_pm_id[4]; | |
340 | /* Congestion Control Mode Identifier */ | |
341 | u8 mesh_cc_id[4]; | |
342 | /* Local mesh Destination Sequence Number */ | |
343 | u32 dsn; | |
344 | /* Last used PREQ ID */ | |
345 | u32 preq_id; | |
346 | atomic_t mpaths; | |
347 | /* Timestamp of last DSN update */ | |
348 | unsigned long last_dsn_update; | |
349 | /* Timestamp of last DSN sent */ | |
350 | unsigned long last_preq; | |
351 | struct mesh_rmc *rmc; | |
352 | spinlock_t mesh_preq_queue_lock; | |
353 | struct mesh_preq_queue preq_queue; | |
354 | int preq_queue_len; | |
355 | struct mesh_stats mshstats; | |
356 | struct mesh_config mshcfg; | |
51ceddad | 357 | u32 mesh_seqnum; |
056cdd59 | 358 | bool accepting_plinks; |
ee385855 | 359 | #endif |
f0706e82 JB |
360 | u16 aid; |
361 | u16 ap_capab, capab; | |
362 | u8 *extra_ie; /* to be added to the end of AssocReq */ | |
363 | size_t extra_ie_len; | |
364 | ||
365 | /* The last AssocReq/Resp IEs */ | |
366 | u8 *assocreq_ies, *assocresp_ies; | |
367 | size_t assocreq_ies_len, assocresp_ies_len; | |
368 | ||
056cdd59 JB |
369 | struct sk_buff_head skb_queue; |
370 | ||
f0706e82 JB |
371 | int auth_tries, assoc_tries; |
372 | ||
056cdd59 JB |
373 | unsigned long request; |
374 | ||
375 | unsigned long last_probe; | |
376 | ||
d6f2da5b | 377 | unsigned int flags; |
f0706e82 JB |
378 | #define IEEE80211_STA_REQ_SCAN 0 |
379 | #define IEEE80211_STA_REQ_AUTH 1 | |
380 | #define IEEE80211_STA_REQ_RUN 2 | |
f0706e82 JB |
381 | |
382 | #define IEEE80211_AUTH_ALG_OPEN BIT(0) | |
383 | #define IEEE80211_AUTH_ALG_SHARED_KEY BIT(1) | |
384 | #define IEEE80211_AUTH_ALG_LEAP BIT(2) | |
385 | unsigned int auth_algs; /* bitfield of allowed auth algs */ | |
386 | int auth_alg; /* currently used IEEE 802.11 authentication algorithm */ | |
387 | int auth_transaction; | |
388 | ||
389 | unsigned long ibss_join_req; | |
390 | struct sk_buff *probe_resp; /* ProbeResp template for IBSS */ | |
8318d78a | 391 | u32 supp_rates_bits[IEEE80211_NUM_BANDS]; |
f0706e82 JB |
392 | |
393 | int wmm_last_param_set; | |
ee385855 | 394 | int num_beacons; /* number of TXed beacon frames by this STA */ |
f0706e82 JB |
395 | }; |
396 | ||
902acc78 JB |
397 | static inline void ieee80211_if_sta_set_mesh_id(struct ieee80211_if_sta *ifsta, |
398 | u8 mesh_id_len, u8 *mesh_id) | |
399 | { | |
400 | #ifdef CONFIG_MAC80211_MESH | |
401 | ifsta->mesh_id_len = mesh_id_len; | |
402 | memcpy(ifsta->mesh_id, mesh_id, mesh_id_len); | |
403 | #endif | |
404 | } | |
405 | ||
406 | #ifdef CONFIG_MAC80211_MESH | |
407 | #define IEEE80211_IFSTA_MESH_CTR_INC(sta, name) \ | |
408 | do { (sta)->mshstats.name++; } while (0) | |
409 | #else | |
410 | #define IEEE80211_IFSTA_MESH_CTR_INC(sta, name) \ | |
411 | do { } while (0) | |
412 | #endif | |
f0706e82 | 413 | |
13262ffd JS |
414 | /* flags used in struct ieee80211_sub_if_data.flags */ |
415 | #define IEEE80211_SDATA_ALLMULTI BIT(0) | |
416 | #define IEEE80211_SDATA_PROMISC BIT(1) | |
471b3efd | 417 | #define IEEE80211_SDATA_USERSPACE_MLME BIT(2) |
8318d78a | 418 | #define IEEE80211_SDATA_OPERATING_GMODE BIT(3) |
f0706e82 JB |
419 | struct ieee80211_sub_if_data { |
420 | struct list_head list; | |
f0706e82 JB |
421 | |
422 | struct wireless_dev wdev; | |
423 | ||
11a843b7 JB |
424 | /* keys */ |
425 | struct list_head key_list; | |
426 | ||
f0706e82 JB |
427 | struct net_device *dev; |
428 | struct ieee80211_local *local; | |
429 | ||
13262ffd | 430 | unsigned int flags; |
7e9ed188 | 431 | |
f0706e82 | 432 | int drop_unencrypted; |
f0706e82 | 433 | |
8318d78a JB |
434 | /* |
435 | * basic rates of this AP or the AP we're associated to | |
436 | */ | |
437 | u64 basic_rates; | |
438 | ||
f0706e82 JB |
439 | u16 sequence; |
440 | ||
441 | /* Fragment table for host-based reassembly */ | |
442 | struct ieee80211_fragment_entry fragments[IEEE80211_FRAGMENT_MAX]; | |
443 | unsigned int fragment_next; | |
444 | ||
445 | #define NUM_DEFAULT_KEYS 4 | |
446 | struct ieee80211_key *keys[NUM_DEFAULT_KEYS]; | |
447 | struct ieee80211_key *default_key; | |
448 | ||
471b3efd JB |
449 | /* |
450 | * BSS configuration for this interface. | |
451 | * | |
452 | * FIXME: I feel bad putting this here when we already have a | |
453 | * bss pointer, but the bss pointer is just wrong when | |
454 | * you have multiple virtual STA mode interfaces... | |
455 | * This needs to be fixed. | |
456 | */ | |
457 | struct ieee80211_bss_conf bss_conf; | |
f0706e82 JB |
458 | struct ieee80211_if_ap *bss; /* BSS that this device belongs to */ |
459 | ||
460 | union { | |
461 | struct ieee80211_if_ap ap; | |
462 | struct ieee80211_if_wds wds; | |
463 | struct ieee80211_if_vlan vlan; | |
464 | struct ieee80211_if_sta sta; | |
8cc9a739 | 465 | u32 mntr_flags; |
f0706e82 JB |
466 | } u; |
467 | int channel_use; | |
468 | int channel_use_raw; | |
e9f207f0 JB |
469 | |
470 | #ifdef CONFIG_MAC80211_DEBUGFS | |
471 | struct dentry *debugfsdir; | |
472 | union { | |
473 | struct { | |
474 | struct dentry *channel_use; | |
475 | struct dentry *drop_unencrypted; | |
e9f207f0 JB |
476 | struct dentry *state; |
477 | struct dentry *bssid; | |
478 | struct dentry *prev_bssid; | |
479 | struct dentry *ssid_len; | |
480 | struct dentry *aid; | |
481 | struct dentry *ap_capab; | |
482 | struct dentry *capab; | |
483 | struct dentry *extra_ie_len; | |
484 | struct dentry *auth_tries; | |
485 | struct dentry *assoc_tries; | |
486 | struct dentry *auth_algs; | |
487 | struct dentry *auth_alg; | |
488 | struct dentry *auth_transaction; | |
489 | struct dentry *flags; | |
ee385855 | 490 | struct dentry *num_beacons_sta; |
e9f207f0 JB |
491 | } sta; |
492 | struct { | |
493 | struct dentry *channel_use; | |
494 | struct dentry *drop_unencrypted; | |
e9f207f0 | 495 | struct dentry *num_sta_ps; |
e9f207f0 JB |
496 | struct dentry *dtim_count; |
497 | struct dentry *num_beacons; | |
498 | struct dentry *force_unicast_rateidx; | |
499 | struct dentry *max_ratectrl_rateidx; | |
500 | struct dentry *num_buffered_multicast; | |
e9f207f0 JB |
501 | } ap; |
502 | struct { | |
503 | struct dentry *channel_use; | |
504 | struct dentry *drop_unencrypted; | |
e9f207f0 JB |
505 | struct dentry *peer; |
506 | } wds; | |
507 | struct { | |
508 | struct dentry *channel_use; | |
509 | struct dentry *drop_unencrypted; | |
e9f207f0 JB |
510 | } vlan; |
511 | struct { | |
512 | struct dentry *mode; | |
513 | } monitor; | |
514 | struct dentry *default_key; | |
515 | } debugfs; | |
ee385855 LCC |
516 | |
517 | #ifdef CONFIG_MAC80211_MESH | |
518 | struct dentry *mesh_stats_dir; | |
519 | struct { | |
520 | struct dentry *fwded_frames; | |
521 | struct dentry *dropped_frames_ttl; | |
522 | struct dentry *dropped_frames_no_route; | |
523 | struct dentry *estab_plinks; | |
902acc78 | 524 | struct timer_list mesh_path_timer; |
ee385855 LCC |
525 | } mesh_stats; |
526 | ||
527 | struct dentry *mesh_config_dir; | |
528 | struct { | |
529 | struct dentry *dot11MeshRetryTimeout; | |
530 | struct dentry *dot11MeshConfirmTimeout; | |
531 | struct dentry *dot11MeshHoldingTimeout; | |
532 | struct dentry *dot11MeshMaxRetries; | |
533 | struct dentry *dot11MeshTTL; | |
534 | struct dentry *auto_open_plinks; | |
535 | struct dentry *dot11MeshMaxPeerLinks; | |
536 | struct dentry *dot11MeshHWMPactivePathTimeout; | |
537 | struct dentry *dot11MeshHWMPpreqMinInterval; | |
538 | struct dentry *dot11MeshHWMPnetDiameterTraversalTime; | |
539 | struct dentry *dot11MeshHWMPmaxPREQretries; | |
540 | struct dentry *path_refresh_time; | |
541 | struct dentry *min_discovery_timeout; | |
542 | } mesh_config; | |
543 | #endif | |
544 | ||
e9f207f0 | 545 | #endif |
32bfd35d JB |
546 | /* must be last, dynamically sized area in this! */ |
547 | struct ieee80211_vif vif; | |
f0706e82 JB |
548 | }; |
549 | ||
32bfd35d JB |
550 | static inline |
551 | struct ieee80211_sub_if_data *vif_to_sdata(struct ieee80211_vif *p) | |
552 | { | |
553 | return container_of(p, struct ieee80211_sub_if_data, vif); | |
554 | } | |
555 | ||
f0706e82 JB |
556 | #define IEEE80211_DEV_TO_SUB_IF(dev) netdev_priv(dev) |
557 | ||
558 | enum { | |
559 | IEEE80211_RX_MSG = 1, | |
560 | IEEE80211_TX_STATUS_MSG = 2, | |
eadc8d9e RR |
561 | IEEE80211_DELBA_MSG = 3, |
562 | IEEE80211_ADDBA_MSG = 4, | |
f0706e82 JB |
563 | }; |
564 | ||
565 | struct ieee80211_local { | |
566 | /* embed the driver visible part. | |
567 | * don't cast (use the static inlines below), but we keep | |
568 | * it first anyway so they become a no-op */ | |
569 | struct ieee80211_hw hw; | |
570 | ||
571 | const struct ieee80211_ops *ops; | |
572 | ||
f0706e82 | 573 | struct net_device *mdev; /* wmaster# - "master" 802.11 device */ |
f0706e82 | 574 | int open_count; |
3d30d949 | 575 | int monitors, cooked_mntrs; |
8cc9a739 MW |
576 | /* number of interfaces with corresponding FIF_ flags */ |
577 | int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss; | |
4150c572 | 578 | unsigned int filter_flags; /* FIF_* */ |
f0706e82 JB |
579 | struct iw_statistics wstats; |
580 | u8 wstats_flags; | |
d0709a65 | 581 | bool tim_in_locked_section; /* see ieee80211_beacon_get() */ |
b306f453 | 582 | int tx_headroom; /* required headroom for hardware/radiotap */ |
f0706e82 JB |
583 | |
584 | enum { | |
585 | IEEE80211_DEV_UNINITIALIZED = 0, | |
586 | IEEE80211_DEV_REGISTERED, | |
587 | IEEE80211_DEV_UNREGISTERED, | |
588 | } reg_state; | |
589 | ||
590 | /* Tasklet and skb queue to process calls from IRQ mode. All frames | |
591 | * added to skb_queue will be processed, but frames in | |
592 | * skb_queue_unreliable may be dropped if the total length of these | |
593 | * queues increases over the limit. */ | |
594 | #define IEEE80211_IRQSAFE_QUEUE_LIMIT 128 | |
595 | struct tasklet_struct tasklet; | |
596 | struct sk_buff_head skb_queue; | |
597 | struct sk_buff_head skb_queue_unreliable; | |
598 | ||
d0709a65 JB |
599 | /* Station data */ |
600 | /* | |
601 | * The lock only protects the list, hash, timer and counter | |
602 | * against manipulation, reads are done in RCU. Additionally, | |
b16bd15c | 603 | * the lock protects each BSS's TIM bitmap. |
d0709a65 JB |
604 | */ |
605 | spinlock_t sta_lock; | |
606 | unsigned long num_sta; | |
f0706e82 | 607 | struct list_head sta_list; |
dc6676b7 JB |
608 | struct list_head sta_flush_list; |
609 | struct work_struct sta_flush_work; | |
f0706e82 JB |
610 | struct sta_info *sta_hash[STA_HASH_SIZE]; |
611 | struct timer_list sta_cleanup; | |
612 | ||
fac371d9 JB |
613 | unsigned long state[IEEE80211_MAX_QUEUES + IEEE80211_MAX_AMPDU_QUEUES]; |
614 | struct ieee80211_tx_stored_packet pending_packet[IEEE80211_MAX_QUEUES + IEEE80211_MAX_AMPDU_QUEUES]; | |
f0706e82 JB |
615 | struct tasklet_struct tx_pending_tasklet; |
616 | ||
53918994 JB |
617 | /* number of interfaces with corresponding IFF_ flags */ |
618 | atomic_t iff_allmultis, iff_promiscs; | |
f0706e82 JB |
619 | |
620 | struct rate_control_ref *rate_ctrl; | |
621 | ||
f0706e82 | 622 | int rts_threshold; |
f0706e82 JB |
623 | int fragmentation_threshold; |
624 | int short_retry_limit; /* dot11ShortRetryLimit */ | |
625 | int long_retry_limit; /* dot11LongRetryLimit */ | |
f0706e82 JB |
626 | |
627 | struct crypto_blkcipher *wep_tx_tfm; | |
628 | struct crypto_blkcipher *wep_rx_tfm; | |
629 | u32 wep_iv; | |
f0706e82 JB |
630 | |
631 | int bridge_packets; /* bridge packets between associated stations and | |
632 | * deliver multicast frames both back to wireless | |
633 | * media and to the local net stack */ | |
634 | ||
79010420 JB |
635 | struct list_head interfaces; |
636 | ||
b16bd15c JB |
637 | /* |
638 | * Key lock, protects sdata's key_list and sta_info's | |
639 | * key pointers (write access, they're RCU.) | |
640 | */ | |
641 | spinlock_t key_lock; | |
642 | ||
643 | ||
ece8eddd ZY |
644 | bool sta_sw_scanning; |
645 | bool sta_hw_scanning; | |
f0706e82 | 646 | int scan_channel_idx; |
8318d78a JB |
647 | enum ieee80211_band scan_band; |
648 | ||
f0706e82 JB |
649 | enum { SCAN_SET_CHANNEL, SCAN_SEND_PROBE } scan_state; |
650 | unsigned long last_scan_completed; | |
651 | struct delayed_work scan_work; | |
652 | struct net_device *scan_dev; | |
653 | struct ieee80211_channel *oper_channel, *scan_channel; | |
f0706e82 JB |
654 | u8 scan_ssid[IEEE80211_MAX_SSID_LEN]; |
655 | size_t scan_ssid_len; | |
656 | struct list_head sta_bss_list; | |
657 | struct ieee80211_sta_bss *sta_bss_hash[STA_HASH_SIZE]; | |
658 | spinlock_t sta_bss_lock; | |
f0706e82 JB |
659 | |
660 | /* SNMP counters */ | |
661 | /* dot11CountersTable */ | |
662 | u32 dot11TransmittedFragmentCount; | |
663 | u32 dot11MulticastTransmittedFrameCount; | |
664 | u32 dot11FailedCount; | |
665 | u32 dot11RetryCount; | |
666 | u32 dot11MultipleRetryCount; | |
667 | u32 dot11FrameDuplicateCount; | |
668 | u32 dot11ReceivedFragmentCount; | |
669 | u32 dot11MulticastReceivedFrameCount; | |
670 | u32 dot11TransmittedFrameCount; | |
671 | u32 dot11WEPUndecryptableCount; | |
672 | ||
673 | #ifdef CONFIG_MAC80211_LEDS | |
674 | int tx_led_counter, rx_led_counter; | |
cdcb006f ID |
675 | struct led_trigger *tx_led, *rx_led, *assoc_led, *radio_led; |
676 | char tx_led_name[32], rx_led_name[32], | |
677 | assoc_led_name[32], radio_led_name[32]; | |
f0706e82 JB |
678 | #endif |
679 | ||
680 | u32 channel_use; | |
681 | u32 channel_use_raw; | |
f0706e82 | 682 | |
e9f207f0 JB |
683 | #ifdef CONFIG_MAC80211_DEBUGFS |
684 | struct work_struct sta_debugfs_add; | |
685 | #endif | |
686 | ||
f0706e82 JB |
687 | #ifdef CONFIG_MAC80211_DEBUG_COUNTERS |
688 | /* TX/RX handler statistics */ | |
689 | unsigned int tx_handlers_drop; | |
690 | unsigned int tx_handlers_queued; | |
691 | unsigned int tx_handlers_drop_unencrypted; | |
692 | unsigned int tx_handlers_drop_fragment; | |
693 | unsigned int tx_handlers_drop_wep; | |
694 | unsigned int tx_handlers_drop_not_assoc; | |
695 | unsigned int tx_handlers_drop_unauth_port; | |
696 | unsigned int rx_handlers_drop; | |
697 | unsigned int rx_handlers_queued; | |
698 | unsigned int rx_handlers_drop_nullfunc; | |
699 | unsigned int rx_handlers_drop_defrag; | |
700 | unsigned int rx_handlers_drop_short; | |
701 | unsigned int rx_handlers_drop_passive_scan; | |
702 | unsigned int tx_expand_skb_head; | |
703 | unsigned int tx_expand_skb_head_cloned; | |
704 | unsigned int rx_expand_skb_head; | |
705 | unsigned int rx_expand_skb_head2; | |
706 | unsigned int rx_handlers_fragments; | |
707 | unsigned int tx_status_drop; | |
f0706e82 JB |
708 | #define I802_DEBUG_INC(c) (c)++ |
709 | #else /* CONFIG_MAC80211_DEBUG_COUNTERS */ | |
710 | #define I802_DEBUG_INC(c) do { } while (0) | |
711 | #endif /* CONFIG_MAC80211_DEBUG_COUNTERS */ | |
712 | ||
713 | ||
f0706e82 JB |
714 | int total_ps_buffered; /* total number of all buffered unicast and |
715 | * multicast packets for power saving stations | |
716 | */ | |
f0706e82 JB |
717 | int wifi_wme_noack_test; |
718 | unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */ | |
719 | ||
e9f207f0 JB |
720 | #ifdef CONFIG_MAC80211_DEBUGFS |
721 | struct local_debugfsdentries { | |
e9f207f0 | 722 | struct dentry *frequency; |
e9f207f0 JB |
723 | struct dentry *antenna_sel_tx; |
724 | struct dentry *antenna_sel_rx; | |
725 | struct dentry *bridge_packets; | |
e9f207f0 JB |
726 | struct dentry *rts_threshold; |
727 | struct dentry *fragmentation_threshold; | |
728 | struct dentry *short_retry_limit; | |
729 | struct dentry *long_retry_limit; | |
730 | struct dentry *total_ps_buffered; | |
e9f207f0 | 731 | struct dentry *wep_iv; |
e9f207f0 JB |
732 | struct dentry *statistics; |
733 | struct local_debugfsdentries_statsdentries { | |
734 | struct dentry *transmitted_fragment_count; | |
735 | struct dentry *multicast_transmitted_frame_count; | |
736 | struct dentry *failed_count; | |
737 | struct dentry *retry_count; | |
738 | struct dentry *multiple_retry_count; | |
739 | struct dentry *frame_duplicate_count; | |
740 | struct dentry *received_fragment_count; | |
741 | struct dentry *multicast_received_frame_count; | |
742 | struct dentry *transmitted_frame_count; | |
743 | struct dentry *wep_undecryptable_count; | |
744 | struct dentry *num_scans; | |
745 | #ifdef CONFIG_MAC80211_DEBUG_COUNTERS | |
746 | struct dentry *tx_handlers_drop; | |
747 | struct dentry *tx_handlers_queued; | |
748 | struct dentry *tx_handlers_drop_unencrypted; | |
749 | struct dentry *tx_handlers_drop_fragment; | |
750 | struct dentry *tx_handlers_drop_wep; | |
751 | struct dentry *tx_handlers_drop_not_assoc; | |
752 | struct dentry *tx_handlers_drop_unauth_port; | |
753 | struct dentry *rx_handlers_drop; | |
754 | struct dentry *rx_handlers_queued; | |
755 | struct dentry *rx_handlers_drop_nullfunc; | |
756 | struct dentry *rx_handlers_drop_defrag; | |
757 | struct dentry *rx_handlers_drop_short; | |
758 | struct dentry *rx_handlers_drop_passive_scan; | |
759 | struct dentry *tx_expand_skb_head; | |
760 | struct dentry *tx_expand_skb_head_cloned; | |
761 | struct dentry *rx_expand_skb_head; | |
762 | struct dentry *rx_expand_skb_head2; | |
763 | struct dentry *rx_handlers_fragments; | |
764 | struct dentry *tx_status_drop; | |
e9f207f0 JB |
765 | #endif |
766 | struct dentry *dot11ACKFailureCount; | |
767 | struct dentry *dot11RTSFailureCount; | |
768 | struct dentry *dot11FCSErrorCount; | |
769 | struct dentry *dot11RTSSuccessCount; | |
770 | } stats; | |
771 | struct dentry *stations; | |
772 | struct dentry *keys; | |
773 | } debugfs; | |
774 | #endif | |
f0706e82 JB |
775 | }; |
776 | ||
eadc8d9e RR |
777 | /* this struct represents 802.11n's RA/TID combination */ |
778 | struct ieee80211_ra_tid { | |
779 | u8 ra[ETH_ALEN]; | |
780 | u16 tid; | |
781 | }; | |
782 | ||
ee385855 LCC |
783 | /* Parsed Information Elements */ |
784 | struct ieee802_11_elems { | |
785 | /* pointers to IEs */ | |
786 | u8 *ssid; | |
787 | u8 *supp_rates; | |
788 | u8 *fh_params; | |
789 | u8 *ds_params; | |
790 | u8 *cf_params; | |
791 | u8 *tim; | |
792 | u8 *ibss_params; | |
793 | u8 *challenge; | |
794 | u8 *wpa; | |
795 | u8 *rsn; | |
796 | u8 *erp_info; | |
797 | u8 *ext_supp_rates; | |
798 | u8 *wmm_info; | |
799 | u8 *wmm_param; | |
800 | u8 *ht_cap_elem; | |
801 | u8 *ht_info_elem; | |
802 | u8 *mesh_config; | |
803 | u8 *mesh_id; | |
804 | u8 *peer_link; | |
805 | u8 *preq; | |
806 | u8 *prep; | |
807 | u8 *perr; | |
808 | ||
809 | /* length of them, respectively */ | |
810 | u8 ssid_len; | |
811 | u8 supp_rates_len; | |
812 | u8 fh_params_len; | |
813 | u8 ds_params_len; | |
814 | u8 cf_params_len; | |
815 | u8 tim_len; | |
816 | u8 ibss_params_len; | |
817 | u8 challenge_len; | |
818 | u8 wpa_len; | |
819 | u8 rsn_len; | |
820 | u8 erp_info_len; | |
821 | u8 ext_supp_rates_len; | |
822 | u8 wmm_info_len; | |
823 | u8 wmm_param_len; | |
824 | u8 ht_cap_elem_len; | |
825 | u8 ht_info_elem_len; | |
826 | u8 mesh_config_len; | |
827 | u8 mesh_id_len; | |
828 | u8 peer_link_len; | |
829 | u8 preq_len; | |
830 | u8 prep_len; | |
831 | u8 perr_len; | |
832 | }; | |
833 | ||
f0706e82 JB |
834 | static inline struct ieee80211_local *hw_to_local( |
835 | struct ieee80211_hw *hw) | |
836 | { | |
837 | return container_of(hw, struct ieee80211_local, hw); | |
838 | } | |
839 | ||
840 | static inline struct ieee80211_hw *local_to_hw( | |
841 | struct ieee80211_local *local) | |
842 | { | |
843 | return &local->hw; | |
844 | } | |
845 | ||
846 | enum ieee80211_link_state_t { | |
847 | IEEE80211_LINK_STATE_XOFF = 0, | |
848 | IEEE80211_LINK_STATE_PENDING, | |
849 | }; | |
850 | ||
851 | struct sta_attribute { | |
852 | struct attribute attr; | |
853 | ssize_t (*show)(const struct sta_info *, char *buf); | |
854 | ssize_t (*store)(struct sta_info *, const char *buf, size_t count); | |
855 | }; | |
856 | ||
571ecf67 JB |
857 | static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr) |
858 | { | |
859 | return compare_ether_addr(raddr, addr) == 0 || | |
860 | is_broadcast_ether_addr(raddr); | |
861 | } | |
862 | ||
863 | ||
f0706e82 JB |
864 | /* ieee80211.c */ |
865 | int ieee80211_hw_config(struct ieee80211_local *local); | |
866 | int ieee80211_if_config(struct net_device *dev); | |
867 | int ieee80211_if_config_beacon(struct net_device *dev); | |
5cf121c3 | 868 | void ieee80211_tx_set_protected(struct ieee80211_tx_data *tx); |
f0706e82 | 869 | void ieee80211_if_setup(struct net_device *dev); |
38668c05 TW |
870 | u32 ieee80211_handle_ht(struct ieee80211_local *local, int enable_ht, |
871 | struct ieee80211_ht_info *req_ht_cap, | |
872 | struct ieee80211_ht_bss_info *req_bss_cap); | |
f0706e82 JB |
873 | |
874 | /* ieee80211_ioctl.c */ | |
875 | extern const struct iw_handler_def ieee80211_iw_handler_def; | |
876 | ||
f0706e82 JB |
877 | |
878 | /* Least common multiple of the used rates (in 100 kbps). This is used to | |
879 | * calculate rate_inv values for each rate so that only integers are needed. */ | |
880 | #define CHAN_UTIL_RATE_LCM 95040 | |
881 | /* 1 usec is 1/8 * (95040/10) = 1188 */ | |
882 | #define CHAN_UTIL_PER_USEC 1188 | |
883 | /* Amount of bits to shift the result right to scale the total utilization | |
884 | * to values that will not wrap around 32-bit integers. */ | |
885 | #define CHAN_UTIL_SHIFT 9 | |
886 | /* Theoretical maximum of channel utilization counter in 10 ms (stat_time=1): | |
887 | * (CHAN_UTIL_PER_USEC * 10000) >> CHAN_UTIL_SHIFT = 23203. So dividing the | |
888 | * raw value with about 23 should give utilization in 10th of a percentage | |
889 | * (1/1000). However, utilization is only estimated and not all intervals | |
890 | * between frames etc. are calculated. 18 seems to give numbers that are closer | |
891 | * to the real maximum. */ | |
892 | #define CHAN_UTIL_PER_10MS 18 | |
893 | #define CHAN_UTIL_HDR_LONG (202 * CHAN_UTIL_PER_USEC) | |
894 | #define CHAN_UTIL_HDR_SHORT (40 * CHAN_UTIL_PER_USEC) | |
895 | ||
896 | ||
897 | /* ieee80211_ioctl.c */ | |
8318d78a | 898 | int ieee80211_set_freq(struct ieee80211_local *local, int freq); |
f0706e82 JB |
899 | /* ieee80211_sta.c */ |
900 | void ieee80211_sta_timer(unsigned long data); | |
901 | void ieee80211_sta_work(struct work_struct *work); | |
902 | void ieee80211_sta_scan_work(struct work_struct *work); | |
903 | void ieee80211_sta_rx_mgmt(struct net_device *dev, struct sk_buff *skb, | |
904 | struct ieee80211_rx_status *rx_status); | |
905 | int ieee80211_sta_set_ssid(struct net_device *dev, char *ssid, size_t len); | |
906 | int ieee80211_sta_get_ssid(struct net_device *dev, char *ssid, size_t *len); | |
907 | int ieee80211_sta_set_bssid(struct net_device *dev, u8 *bssid); | |
908 | int ieee80211_sta_req_scan(struct net_device *dev, u8 *ssid, size_t ssid_len); | |
909 | void ieee80211_sta_req_auth(struct net_device *dev, | |
910 | struct ieee80211_if_sta *ifsta); | |
911 | int ieee80211_sta_scan_results(struct net_device *dev, char *buf, size_t len); | |
9ae54c84 JB |
912 | ieee80211_rx_result ieee80211_sta_rx_scan( |
913 | struct net_device *dev, struct sk_buff *skb, | |
914 | struct ieee80211_rx_status *rx_status); | |
f0706e82 JB |
915 | void ieee80211_rx_bss_list_init(struct net_device *dev); |
916 | void ieee80211_rx_bss_list_deinit(struct net_device *dev); | |
917 | int ieee80211_sta_set_extra_ie(struct net_device *dev, char *ie, size_t len); | |
988c0f72 JB |
918 | struct sta_info *ieee80211_ibss_add_sta(struct net_device *dev, |
919 | struct sk_buff *skb, u8 *bssid, | |
920 | u8 *addr); | |
f0706e82 JB |
921 | int ieee80211_sta_deauthenticate(struct net_device *dev, u16 reason); |
922 | int ieee80211_sta_disassociate(struct net_device *dev, u16 reason); | |
471b3efd JB |
923 | void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata, |
924 | u32 changed); | |
d9430a32 | 925 | void ieee80211_reset_erp_info(struct net_device *dev); |
c7153508 RR |
926 | int ieee80211_ht_cap_ie_to_ht_info(struct ieee80211_ht_cap *ht_cap_ie, |
927 | struct ieee80211_ht_info *ht_info); | |
928 | int ieee80211_ht_addt_info_ie_to_ht_bss_info( | |
929 | struct ieee80211_ht_addt_info *ht_add_info_ie, | |
930 | struct ieee80211_ht_bss_info *bss_info); | |
eadc8d9e RR |
931 | void ieee80211_send_addba_request(struct net_device *dev, const u8 *da, |
932 | u16 tid, u8 dialog_token, u16 start_seq_num, | |
933 | u16 agg_size, u16 timeout); | |
934 | void ieee80211_send_delba(struct net_device *dev, const u8 *da, u16 tid, | |
935 | u16 initiator, u16 reason_code); | |
85249e5f | 936 | |
07db2183 RR |
937 | void ieee80211_sta_stop_rx_ba_session(struct net_device *dev, u8 *da, |
938 | u16 tid, u16 initiator, u16 reason); | |
eadc8d9e | 939 | void sta_addba_resp_timer_expired(unsigned long data); |
85249e5f | 940 | void ieee80211_sta_tear_down_BA_sessions(struct net_device *dev, u8 *addr); |
ee385855 LCC |
941 | u64 ieee80211_sta_get_rates(struct ieee80211_local *local, |
942 | struct ieee802_11_elems *elems, | |
943 | enum ieee80211_band band); | |
ee385855 LCC |
944 | void ieee80211_sta_tx(struct net_device *dev, struct sk_buff *skb, |
945 | int encrypt); | |
946 | void ieee802_11_parse_elems(u8 *start, size_t len, | |
947 | struct ieee802_11_elems *elems); | |
948 | ||
902acc78 JB |
949 | #ifdef CONFIG_MAC80211_MESH |
950 | void ieee80211_start_mesh(struct net_device *dev); | |
951 | #else | |
952 | static inline void ieee80211_start_mesh(struct net_device *dev) | |
953 | {} | |
954 | #endif | |
ee385855 | 955 | |
f0706e82 JB |
956 | /* ieee80211_iface.c */ |
957 | int ieee80211_if_add(struct net_device *dev, const char *name, | |
ee385855 LCC |
958 | struct net_device **new_dev, int type, |
959 | struct vif_params *params); | |
f0706e82 JB |
960 | void ieee80211_if_set_type(struct net_device *dev, int type); |
961 | void ieee80211_if_reinit(struct net_device *dev); | |
962 | void __ieee80211_if_del(struct ieee80211_local *local, | |
963 | struct ieee80211_sub_if_data *sdata); | |
964 | int ieee80211_if_remove(struct net_device *dev, const char *name, int id); | |
965 | void ieee80211_if_free(struct net_device *dev); | |
966 | void ieee80211_if_sdata_init(struct ieee80211_sub_if_data *sdata); | |
f0706e82 | 967 | |
e2ebc74d | 968 | /* tx handling */ |
e2ebc74d JB |
969 | void ieee80211_clear_tx_pending(struct ieee80211_local *local); |
970 | void ieee80211_tx_pending(unsigned long data); | |
971 | int ieee80211_master_start_xmit(struct sk_buff *skb, struct net_device *dev); | |
972 | int ieee80211_monitor_start_xmit(struct sk_buff *skb, struct net_device *dev); | |
973 | int ieee80211_subif_start_xmit(struct sk_buff *skb, struct net_device *dev); | |
e2ebc74d | 974 | |
c2d1560a JB |
975 | /* utility functions/constants */ |
976 | extern void *mac80211_wiphy_privid; /* for wiphy privid */ | |
977 | extern const unsigned char rfc1042_header[6]; | |
978 | extern const unsigned char bridge_tunnel_header[6]; | |
71364716 RR |
979 | u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len, |
980 | enum ieee80211_if_types type); | |
c2d1560a JB |
981 | int ieee80211_frame_duration(struct ieee80211_local *local, size_t len, |
982 | int rate, int erp, int short_preamble); | |
eb063c17 JB |
983 | void mac80211_ev_michael_mic_failure(struct net_device *dev, int keyidx, |
984 | struct ieee80211_hdr *hdr); | |
f0706e82 JB |
985 | |
986 | #endif /* IEEE80211_I_H */ |