2 * Copyright (c) 2001 Atsushi Onoe
3 * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
17 * Alternatively, this software may be distributed under the terms of the
18 * GNU General Public License ("GPL") version 2 as published by the Free
19 * Software Foundation.
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 * $FreeBSD: src/sys/net80211/ieee80211.h,v 1.12 2006/12/01 18:40:51 imp Exp $
34 #ifndef _NET80211_IEEE80211_H_
35 #define _NET80211_IEEE80211_H_
38 * 802.11 protocol definitions.
41 #define IEEE80211_ADDR_LEN 6 /* size of 802.11 address */
42 /* is 802.11 address multicast/broadcast? */
43 #define IEEE80211_IS_MULTICAST(_a) (*(_a) & 0x01)
45 /* IEEE 802.11 PLCP header */
46 struct ieee80211_plcp_hdr
55 #define IEEE80211_PLCP_SFD 0xF3A0
56 #define IEEE80211_PLCP_SERVICE 0x00
59 * generic definitions for IEEE 802.11 frames
61 struct ieee80211_frame
65 u_int8_t i_addr1[IEEE80211_ADDR_LEN];
66 u_int8_t i_addr2[IEEE80211_ADDR_LEN];
67 u_int8_t i_addr3[IEEE80211_ADDR_LEN];
69 /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */
73 struct ieee80211_qosframe
77 u_int8_t i_addr1[IEEE80211_ADDR_LEN];
78 u_int8_t i_addr2[IEEE80211_ADDR_LEN];
79 u_int8_t i_addr3[IEEE80211_ADDR_LEN];
82 /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */
86 struct ieee80211_qoscntl
91 struct ieee80211_frame_addr4
95 u_int8_t i_addr1[IEEE80211_ADDR_LEN];
96 u_int8_t i_addr2[IEEE80211_ADDR_LEN];
97 u_int8_t i_addr3[IEEE80211_ADDR_LEN];
99 u_int8_t i_addr4[IEEE80211_ADDR_LEN];
103 struct ieee80211_qosframe_addr4
107 u_int8_t i_addr1[IEEE80211_ADDR_LEN];
108 u_int8_t i_addr2[IEEE80211_ADDR_LEN];
109 u_int8_t i_addr3[IEEE80211_ADDR_LEN];
111 u_int8_t i_addr4[IEEE80211_ADDR_LEN];
115 #define IEEE80211_FC0_VERSION_MASK 0x03
116 #define IEEE80211_FC0_VERSION_SHIFT 0
117 #define IEEE80211_FC0_VERSION_0 0x00
118 #define IEEE80211_FC0_TYPE_MASK 0x0c
119 #define IEEE80211_FC0_TYPE_SHIFT 2
120 #define IEEE80211_FC0_TYPE_MGT 0x00
121 #define IEEE80211_FC0_TYPE_CTL 0x04
122 #define IEEE80211_FC0_TYPE_DATA 0x08
124 #define IEEE80211_FC0_SUBTYPE_MASK 0xf0
125 #define IEEE80211_FC0_SUBTYPE_SHIFT 4
127 #define IEEE80211_FC0_SUBTYPE_ASSOC_REQ 0x00
128 #define IEEE80211_FC0_SUBTYPE_ASSOC_RESP 0x10
129 #define IEEE80211_FC0_SUBTYPE_REASSOC_REQ 0x20
130 #define IEEE80211_FC0_SUBTYPE_REASSOC_RESP 0x30
131 #define IEEE80211_FC0_SUBTYPE_PROBE_REQ 0x40
132 #define IEEE80211_FC0_SUBTYPE_PROBE_RESP 0x50
133 #define IEEE80211_FC0_SUBTYPE_BEACON 0x80
134 #define IEEE80211_FC0_SUBTYPE_ATIM 0x90
135 #define IEEE80211_FC0_SUBTYPE_DISASSOC 0xa0
136 #define IEEE80211_FC0_SUBTYPE_AUTH 0xb0
137 #define IEEE80211_FC0_SUBTYPE_DEAUTH 0xc0
139 #define IEEE80211_FC0_SUBTYPE_PS_POLL 0xa0
140 #define IEEE80211_FC0_SUBTYPE_RTS 0xb0
141 #define IEEE80211_FC0_SUBTYPE_CTS 0xc0
142 #define IEEE80211_FC0_SUBTYPE_ACK 0xd0
143 #define IEEE80211_FC0_SUBTYPE_CF_END 0xe0
144 #define IEEE80211_FC0_SUBTYPE_CF_END_ACK 0xf0
145 /* for TYPE_DATA (bit combination) */
146 #define IEEE80211_FC0_SUBTYPE_DATA 0x00
147 #define IEEE80211_FC0_SUBTYPE_CF_ACK 0x10
148 #define IEEE80211_FC0_SUBTYPE_CF_POLL 0x20
149 #define IEEE80211_FC0_SUBTYPE_CF_ACPL 0x30
150 #define IEEE80211_FC0_SUBTYPE_NODATA 0x40
151 #define IEEE80211_FC0_SUBTYPE_CFACK 0x50
152 #define IEEE80211_FC0_SUBTYPE_CFPOLL 0x60
153 #define IEEE80211_FC0_SUBTYPE_CF_ACK_CF_ACK 0x70
154 #define IEEE80211_FC0_SUBTYPE_QOS 0x80
155 #define IEEE80211_FC0_SUBTYPE_QOS_NULL 0xc0
157 #define IEEE80211_FC1_DIR_MASK 0x03
158 #define IEEE80211_FC1_DIR_NODS 0x00 /* STA->STA */
159 #define IEEE80211_FC1_DIR_TODS 0x01 /* STA->AP */
160 #define IEEE80211_FC1_DIR_FROMDS 0x02 /* AP ->STA */
161 #define IEEE80211_FC1_DIR_DSTODS 0x03 /* AP ->AP */
163 #define IEEE80211_FC1_MORE_FRAG 0x04
164 #define IEEE80211_FC1_RETRY 0x08
165 #define IEEE80211_FC1_PWR_MGT 0x10
166 #define IEEE80211_FC1_MORE_DATA 0x20
167 #define IEEE80211_FC1_WEP 0x40
168 #define IEEE80211_FC1_ORDER 0x80
170 #define IEEE80211_SEQ_FRAG_MASK 0x000f
171 #define IEEE80211_SEQ_FRAG_SHIFT 0
172 #define IEEE80211_SEQ_SEQ_MASK 0xfff0
173 #define IEEE80211_SEQ_SEQ_SHIFT 4
175 #define IEEE80211_NWID_LEN 32
177 #define IEEE80211_QOS_TXOP 0x00ff
178 /* bit 8 is reserved */
179 #define IEEE80211_QOS_ACKPOLICY 0x60
180 #define IEEE80211_QOS_ACKPOLICY_S 5
181 #define IEEE80211_QOS_ESOP 0x10
182 #define IEEE80211_QOS_ESOP_S 4
183 #define IEEE80211_QOS_TID 0x0f
185 /* does frame have QoS sequence control data */
186 #define IEEE80211_QOS_HAS_SEQ(wh) \
188 (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_QOS)) == \
189 (IEEE80211_FC0_TYPE_DATA | IEEE80211_FC0_SUBTYPE_QOS))
192 * WME/802.11e information element.
194 struct ieee80211_wme_info
196 u_int8_t wme_id; /* IEEE80211_ELEMID_VENDOR */
197 u_int8_t wme_len; /* length in bytes */
198 u_int8_t wme_oui[3]; /* 0x00, 0x50, 0xf2 */
199 u_int8_t wme_type; /* OUI type */
200 u_int8_t wme_subtype; /* OUI subtype */
201 u_int8_t wme_version; /* spec revision */
202 u_int8_t wme_info; /* QoS info */
206 * WME/802.11e Tspec Element
208 struct ieee80211_wme_tspec
213 u_int8_t ts_oui_type;
214 u_int8_t ts_oui_subtype;
216 u_int8_t ts_tsinfo[3];
217 u_int8_t ts_nom_msdu[2];
218 u_int8_t ts_max_msdu[2];
219 u_int8_t ts_min_svc[4];
220 u_int8_t ts_max_svc[4];
221 u_int8_t ts_inactv_intv[4];
222 u_int8_t ts_susp_intv[4];
223 u_int8_t ts_start_svc[4];
224 u_int8_t ts_min_rate[4];
225 u_int8_t ts_mean_rate[4];
226 u_int8_t ts_max_burst[4];
227 u_int8_t ts_min_phy[4];
228 u_int8_t ts_peak_rate[4];
229 u_int8_t ts_delay[4];
230 u_int8_t ts_surplus[2];
231 u_int8_t ts_medium_time[2];
235 * WME AC parameter field
237 struct ieee80211_wme_acparams
239 u_int8_t acp_aci_aifsn;
240 u_int8_t acp_logcwminmax;
244 #define WME_NUM_AC 4 /* 4 AC categories */
246 #define WME_PARAM_ACI 0x60 /* Mask for ACI field */
247 #define WME_PARAM_ACI_S 5 /* Shift for ACI field */
248 #define WME_PARAM_ACM 0x10 /* Mask for ACM bit */
249 #define WME_PARAM_ACM_S 4 /* Shift for ACM bit */
250 #define WME_PARAM_AIFSN 0x0f /* Mask for aifsn field */
251 #define WME_PARAM_AIFSN_S 0 /* Shift for aifsn field */
252 #define WME_PARAM_LOGCWMIN 0x0f /* Mask for CwMin field (in log) */
253 #define WME_PARAM_LOGCWMIN_S 0 /* Shift for CwMin field */
254 #define WME_PARAM_LOGCWMAX 0xf0 /* Mask for CwMax field (in log) */
255 #define WME_PARAM_LOGCWMAX_S 4 /* Shift for CwMax field */
257 #define WME_AC_TO_TID(_ac) ( \
258 ((_ac) == WME_AC_VO) ? 6 : \
259 ((_ac) == WME_AC_VI) ? 5 : \
260 ((_ac) == WME_AC_BK) ? 1 : \
263 #define TID_TO_WME_AC(_tid) ( \
264 ((_tid) < 1) ? WME_AC_BE : \
265 ((_tid) < 3) ? WME_AC_BK : \
266 ((_tid) < 6) ? WME_AC_VI : \
270 * WME Parameter Element
272 struct ieee80211_wme_param
276 u_int8_t param_oui[3];
277 u_int8_t param_oui_type;
278 u_int8_t param_oui_sybtype;
279 u_int8_t param_version;
280 u_int8_t param_qosInfo;
281 #define WME_QOSINFO_COUNT 0x0f /* Mask for param count field */
282 u_int8_t param_reserved;
283 struct ieee80211_wme_acparams params_acParams[WME_NUM_AC];
287 * Management Notification Frame
291 u_int8_t mnf_category;
297 #define MNF_SETUP_REQ 0
298 #define MNF_SETUP_RESP 1
299 #define MNF_TEARDOWN 2
304 struct ieee80211_frame_min
308 u_int8_t i_addr1[IEEE80211_ADDR_LEN];
309 u_int8_t i_addr2[IEEE80211_ADDR_LEN];
313 struct ieee80211_frame_rts
317 u_int8_t i_ra[IEEE80211_ADDR_LEN];
318 u_int8_t i_ta[IEEE80211_ADDR_LEN];
322 struct ieee80211_frame_cts
326 u_int8_t i_ra[IEEE80211_ADDR_LEN];
330 struct ieee80211_frame_ack
334 u_int8_t i_ra[IEEE80211_ADDR_LEN];
338 struct ieee80211_frame_pspoll
342 u_int8_t i_bssid[IEEE80211_ADDR_LEN];
343 u_int8_t i_ta[IEEE80211_ADDR_LEN];
347 struct ieee80211_frame_cfend
348 { /* NB: also CF-End+CF-Ack */
350 u_int8_t i_dur[2]; /* should be zero */
351 u_int8_t i_ra[IEEE80211_ADDR_LEN];
352 u_int8_t i_bssid[IEEE80211_ADDR_LEN];
357 * BEACON management packets
360 * octet beacon interval[2]
361 * octet capability information[2]
362 * information element
365 * octet information[length]
368 typedef u_int8_t *ieee80211_mgt_beacon_t;
370 #define IEEE80211_BEACON_INTERVAL(beacon) \
371 ((beacon)[8] | ((beacon)[9] << 8))
372 #define IEEE80211_BEACON_CAPABILITY(beacon) \
373 ((beacon)[10] | ((beacon)[11] << 8))
375 #define IEEE80211_CAPINFO_ESS 0x0001
376 #define IEEE80211_CAPINFO_IBSS 0x0002
377 #define IEEE80211_CAPINFO_CF_POLLABLE 0x0004
378 #define IEEE80211_CAPINFO_CF_POLLREQ 0x0008
379 #define IEEE80211_CAPINFO_PRIVACY 0x0010
380 #define IEEE80211_CAPINFO_SHORT_PREAMBLE 0x0020
381 #define IEEE80211_CAPINFO_PBCC 0x0040
382 #define IEEE80211_CAPINFO_CHNL_AGILITY 0x0080
383 /* bits 8-9 are reserved */
384 #define IEEE80211_CAPINFO_SHORT_SLOTTIME 0x0400
385 #define IEEE80211_CAPINFO_RSN 0x0800
386 /* bit 12 is reserved */
387 #define IEEE80211_CAPINFO_DSSSOFDM 0x2000
388 /* bits 14-15 are reserved */
391 * 802.11i/WPA information element (maximally sized).
393 struct ieee80211_ie_wpa
395 u_int8_t wpa_id; /* IEEE80211_ELEMID_VENDOR */
396 u_int8_t wpa_len; /* length in bytes */
397 u_int8_t wpa_oui[3]; /* 0x00, 0x50, 0xf2 */
398 u_int8_t wpa_type; /* OUI type */
399 u_int16_t wpa_version; /* spec revision */
400 u_int32_t wpa_mcipher[1]; /* multicast/group key cipher */
401 u_int16_t wpa_uciphercnt; /* # pairwise key ciphers */
402 u_int32_t wpa_uciphers[8]; /* ciphers */
403 u_int16_t wpa_authselcnt; /* authentication selector cnt */
404 u_int32_t wpa_authsels[8]; /* selectors */
405 u_int16_t wpa_caps; /* 802.11i capabilities */
406 u_int16_t wpa_pmkidcnt; /* 802.11i pmkid count */
407 u_int16_t wpa_pmkids[8]; /* 802.11i pmkids */
411 * Management information element payloads.
416 IEEE80211_ELEMID_SSID = 0,
417 IEEE80211_ELEMID_RATES = 1,
418 IEEE80211_ELEMID_FHPARMS = 2,
419 IEEE80211_ELEMID_DSPARMS = 3,
420 IEEE80211_ELEMID_CFPARMS = 4,
421 IEEE80211_ELEMID_TIM = 5,
422 IEEE80211_ELEMID_IBSSPARMS = 6,
423 IEEE80211_ELEMID_COUNTRY = 7,
424 IEEE80211_ELEMID_CHALLENGE = 16,
425 /* 17-31 reserved for challenge text extension */
426 IEEE80211_ELEMID_ERP = 42,
427 IEEE80211_ELEMID_RSN = 48,
428 IEEE80211_ELEMID_XRATES = 50,
429 IEEE80211_ELEMID_TPC = 150,
430 IEEE80211_ELEMID_CCKM = 156,
431 IEEE80211_ELEMID_VENDOR = 221, /* vendor private */
434 struct ieee80211_tim_ie
436 u_int8_t tim_ie; /* IEEE80211_ELEMID_TIM */
438 u_int8_t tim_count; /* DTIM count */
439 u_int8_t tim_period; /* DTIM period */
440 u_int8_t tim_bitctl; /* bitmap control */
441 u_int8_t tim_bitmap[1]; /* variable-length bitmap */
444 struct ieee80211_country_ie
446 u_int8_t ie; /* IEEE80211_ELEMID_COUNTRY */
448 u_int8_t cc[3]; /* ISO CC+(I)ndoor/(O)utdoor */
451 u_int8_t schan; /* starting channel */
452 u_int8_t nchan; /* number channels */
453 u_int8_t maxtxpwr; /* tx power cap */
454 } GNUNET_PACKED band[4]; /* up to 4 sub bands */
457 #define IEEE80211_CHALLENGE_LEN 128
459 #define IEEE80211_RATE_BASIC 0x80
460 #define IEEE80211_RATE_VAL 0x7f
462 /* EPR information element flags */
463 #define IEEE80211_ERP_NON_ERP_PRESENT 0x01
464 #define IEEE80211_ERP_USE_PROTECTION 0x02
465 #define IEEE80211_ERP_LONG_PREAMBLE 0x04
467 /* Atheros private advanced capabilities info */
468 #define ATHEROS_CAP_TURBO_PRIME 0x01
469 #define ATHEROS_CAP_COMPRESSION 0x02
470 #define ATHEROS_CAP_FAST_FRAME 0x04
471 /* bits 3-6 reserved */
472 #define ATHEROS_CAP_BOOST 0x80
474 #define ATH_OUI 0x7f0300 /* Atheros OUI */
475 #define ATH_OUI_TYPE 0x01
476 #define ATH_OUI_VERSION 0x01
478 #define WPA_OUI 0xf25000
479 #define WPA_OUI_TYPE 0x01
480 #define WPA_VERSION 1 /* current supported version */
482 #define WPA_CSE_NULL 0x00
483 #define WPA_CSE_WEP40 0x01
484 #define WPA_CSE_TKIP 0x02
485 #define WPA_CSE_CCMP 0x04
486 #define WPA_CSE_WEP104 0x05
488 #define WPA_ASE_NONE 0x00
489 #define WPA_ASE_8021X_UNSPEC 0x01
490 #define WPA_ASE_8021X_PSK 0x02
492 #define RSN_OUI 0xac0f00
493 #define RSN_VERSION 1 /* current supported version */
495 #define RSN_CSE_NULL 0x00
496 #define RSN_CSE_WEP40 0x01
497 #define RSN_CSE_TKIP 0x02
498 #define RSN_CSE_WRAP 0x03
499 #define RSN_CSE_CCMP 0x04
500 #define RSN_CSE_WEP104 0x05
502 #define RSN_ASE_NONE 0x00
503 #define RSN_ASE_8021X_UNSPEC 0x01
504 #define RSN_ASE_8021X_PSK 0x02
506 #define RSN_CAP_PREAUTH 0x01
508 #define WME_OUI 0xf25000
509 #define WME_OUI_TYPE 0x02
510 #define WME_INFO_OUI_SUBTYPE 0x00
511 #define WME_PARAM_OUI_SUBTYPE 0x01
512 #define WME_VERSION 1
514 /* WME stream classes */
515 #define WME_AC_BE 0 /* best effort */
516 #define WME_AC_BK 1 /* background */
517 #define WME_AC_VI 2 /* video */
518 #define WME_AC_VO 3 /* voice */
521 * AUTH management packets
528 * octet chal.text[253]
531 typedef u_int8_t *ieee80211_mgt_auth_t;
533 #define IEEE80211_AUTH_ALGORITHM(auth) \
534 ((auth)[0] | ((auth)[1] << 8))
535 #define IEEE80211_AUTH_TRANSACTION(auth) \
536 ((auth)[2] | ((auth)[3] << 8))
537 #define IEEE80211_AUTH_STATUS(auth) \
538 ((auth)[4] | ((auth)[5] << 8))
540 #define IEEE80211_AUTH_ALG_OPEN 0x0000
541 #define IEEE80211_AUTH_ALG_SHARED 0x0001
542 #define IEEE80211_AUTH_ALG_LEAP 0x0080
546 IEEE80211_AUTH_OPEN_REQUEST = 1,
547 IEEE80211_AUTH_OPEN_RESPONSE = 2,
552 IEEE80211_AUTH_SHARED_REQUEST = 1,
553 IEEE80211_AUTH_SHARED_CHALLENGE = 2,
554 IEEE80211_AUTH_SHARED_RESPONSE = 3,
555 IEEE80211_AUTH_SHARED_PASS = 4,
561 * Unlisted codes are reserved
566 IEEE80211_REASON_UNSPECIFIED = 1,
567 IEEE80211_REASON_AUTH_EXPIRE = 2,
568 IEEE80211_REASON_AUTH_LEAVE = 3,
569 IEEE80211_REASON_ASSOC_EXPIRE = 4,
570 IEEE80211_REASON_ASSOC_TOOMANY = 5,
571 IEEE80211_REASON_NOT_AUTHED = 6,
572 IEEE80211_REASON_NOT_ASSOCED = 7,
573 IEEE80211_REASON_ASSOC_LEAVE = 8,
574 IEEE80211_REASON_ASSOC_NOT_AUTHED = 9,
576 IEEE80211_REASON_RSN_REQUIRED = 11,
577 IEEE80211_REASON_RSN_INCONSISTENT = 12,
578 IEEE80211_REASON_IE_INVALID = 13,
579 IEEE80211_REASON_MIC_FAILURE = 14,
581 IEEE80211_STATUS_SUCCESS = 0,
582 IEEE80211_STATUS_UNSPECIFIED = 1,
583 IEEE80211_STATUS_CAPINFO = 10,
584 IEEE80211_STATUS_NOT_ASSOCED = 11,
585 IEEE80211_STATUS_OTHER = 12,
586 IEEE80211_STATUS_ALG = 13,
587 IEEE80211_STATUS_SEQUENCE = 14,
588 IEEE80211_STATUS_CHALLENGE = 15,
589 IEEE80211_STATUS_TIMEOUT = 16,
590 IEEE80211_STATUS_TOOMANY = 17,
591 IEEE80211_STATUS_BASIC_RATE = 18,
592 IEEE80211_STATUS_SP_REQUIRED = 19,
593 IEEE80211_STATUS_PBCC_REQUIRED = 20,
594 IEEE80211_STATUS_CA_REQUIRED = 21,
595 IEEE80211_STATUS_TOO_MANY_STATIONS = 22,
596 IEEE80211_STATUS_RATES = 23,
597 IEEE80211_STATUS_SHORTSLOT_REQUIRED = 25,
598 IEEE80211_STATUS_DSSSOFDM_REQUIRED = 26,
601 #define IEEE80211_WEP_KEYLEN 5 /* 40bit */
602 #define IEEE80211_WEP_IVLEN 3 /* 24bit */
603 #define IEEE80211_WEP_KIDLEN 1 /* 1 octet */
604 #define IEEE80211_WEP_CRCLEN 4 /* CRC-32 */
605 #define IEEE80211_WEP_NKID 4 /* number of key ids */
608 * 802.11i defines an extended IV for use with non-WEP ciphers.
609 * When the EXTIV bit is set in the key id byte an additional
610 * 4 bytes immediately follow the IV for TKIP. For CCMP the
611 * EXTIV bit is likewise set but the 8 bytes represent the
612 * CCMP header rather than IV+extended-IV.
614 #define IEEE80211_WEP_EXTIV 0x20
615 #define IEEE80211_WEP_EXTIVLEN 4 /* extended IV length */
616 #define IEEE80211_WEP_MICLEN 8 /* trailing MIC */
618 #define IEEE80211_CRC_LEN 4
621 * Maximum acceptable MTU is:
622 * IEEE80211_MAX_LEN - WEP overhead - CRC -
623 * QoS overhead - RSN/WPA overhead
624 * Min is arbitrarily chosen > IEEE80211_MIN_LEN. The default
625 * mtu is Ethernet-compatible; it's set by ether_ifattach.
627 #define IEEE80211_MTU_MAX 2290
628 #define IEEE80211_MTU_MIN 32
630 #define IEEE80211_MAX_LEN (2300 + IEEE80211_CRC_LEN + \
631 (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + IEEE80211_WEP_CRCLEN))
632 #define IEEE80211_ACK_LEN \
633 (sizeof(struct ieee80211_frame_ack) + IEEE80211_CRC_LEN)
634 #define IEEE80211_MIN_LEN \
635 (sizeof(struct ieee80211_frame_min) + IEEE80211_CRC_LEN)
638 * The 802.11 spec says at most 2007 stations may be
639 * associated at once. For most AP's this is way more
640 * than is feasible so we use a default of 128. This
641 * number may be overridden by the driver and/or by
642 * user configuration.
644 #define IEEE80211_AID_MAX 2007
645 #define IEEE80211_AID_DEF 128
647 #define IEEE80211_AID(b) ((b) &~ 0xc000)
650 * RTS frame length parameters. The default is specified in
651 * the 802.11 spec as 512; we treat it as implementation-dependent
652 * so it's defined in ieee80211_var.h. The max may be wrong
655 #define IEEE80211_RTS_MIN 1
656 #define IEEE80211_RTS_MAX 2346
659 * TX fragmentation parameters. As above for RTS, we treat
660 * default as implementation-dependent so define it elsewhere.
662 #define IEEE80211_FRAG_MIN 256
663 #define IEEE80211_FRAG_MAX 2346
666 * Beacon interval (TU's). Min+max come from WiFi requirements.
667 * As above, we treat default as implementation-dependent so
668 * define it elsewhere.
670 #define IEEE80211_BINTVAL_MAX 1000 /* max beacon interval (TU's) */
671 #define IEEE80211_BINTVAL_MIN 25 /* min beacon interval (TU's) */
674 * DTIM period (beacons). Min+max are not really defined
675 * by the protocol but we want them publicly visible so
678 #define IEEE80211_DTIM_MAX 15 /* max DTIM period */
679 #define IEEE80211_DTIM_MIN 1 /* min DTIM period */
682 * Beacon miss threshold (beacons). As for DTIM, we define
683 * them here to be publicly visible. Note the max may be
684 * clamped depending on device capabilities.
686 #define IEEE80211_HWBMISS_MIN 1
687 #define IEEE80211_HWBMISS_MAX 255
689 #endif /* _NET80211_IEEE80211_H_ */