_ieee80211.h revision 237871
11590Srgrimes/*- 21590Srgrimes * Copyright (c) 2001 Atsushi Onoe 31590Srgrimes * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting 41590Srgrimes * All rights reserved. 51590Srgrimes * 61590Srgrimes * Redistribution and use in source and binary forms, with or without 71590Srgrimes * modification, are permitted provided that the following conditions 81590Srgrimes * are met: 91590Srgrimes * 1. Redistributions of source code must retain the above copyright 101590Srgrimes * notice, this list of conditions and the following disclaimer. 111590Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 121590Srgrimes * notice, this list of conditions and the following disclaimer in the 131590Srgrimes * documentation and/or other materials provided with the distribution. 141590Srgrimes * 151590Srgrimes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 161590Srgrimes * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 171590Srgrimes * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 181590Srgrimes * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 191590Srgrimes * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 201590Srgrimes * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 211590Srgrimes * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 221590Srgrimes * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 231590Srgrimes * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 241590Srgrimes * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 251590Srgrimes * 261590Srgrimes * $FreeBSD: head/sys/net80211/_ieee80211.h 237871 2012-07-01 04:25:49Z adrian $ 271590Srgrimes */ 281590Srgrimes#ifndef _NET80211__IEEE80211_H_ 291590Srgrimes#define _NET80211__IEEE80211_H_ 301590Srgrimes 311590Srgrimes/* 321590Srgrimes * 802.11 implementation definitions. 331590Srgrimes * 341590Srgrimes * NB: this file is used by applications. 3558620Scharnier */ 361590Srgrimes 371590Srgrimes/* 381590Srgrimes * PHY type; mostly used to identify FH phys. 391590Srgrimes */ 401590Srgrimesenum ieee80211_phytype { 4195617Smarkm IEEE80211_T_DS, /* direct sequence spread spectrum */ 421590Srgrimes IEEE80211_T_FH, /* frequency hopping */ 431590Srgrimes IEEE80211_T_OFDM, /* frequency division multiplexing */ 4495617Smarkm IEEE80211_T_TURBO, /* high rate OFDM, aka turbo mode */ 4595617Smarkm IEEE80211_T_HT, /* high throughput */ 4695617Smarkm IEEE80211_T_OFDM_HALF, /* 1/2 rate OFDM */ 471590Srgrimes IEEE80211_T_OFDM_QUARTER, /* 1/4 rate OFDM */ 481590Srgrimes}; 491590Srgrimes#define IEEE80211_T_CCK IEEE80211_T_DS /* more common nomenclature */ 501590Srgrimes 511590Srgrimes/* 521590Srgrimes * PHY mode; this is not really a mode as multi-mode devices 531590Srgrimes * have multiple PHY's. Mode is mostly used as a shorthand 541590Srgrimes * for constraining which channels to consider in setting up 551590Srgrimes * operation. Modes used to be used more extensively when 561590Srgrimes * channels were identified as IEEE channel numbers. 571590Srgrimes */ 581590Srgrimesenum ieee80211_phymode { 591590Srgrimes IEEE80211_MODE_AUTO = 0, /* autoselect */ 601590Srgrimes IEEE80211_MODE_11A = 1, /* 5GHz, OFDM */ 611590Srgrimes IEEE80211_MODE_11B = 2, /* 2GHz, CCK */ 621590Srgrimes IEEE80211_MODE_11G = 3, /* 2GHz, OFDM */ 631590Srgrimes IEEE80211_MODE_FH = 4, /* 2GHz, GFSK */ 641590Srgrimes IEEE80211_MODE_TURBO_A = 5, /* 5GHz, OFDM, 2x clock */ 651590Srgrimes IEEE80211_MODE_TURBO_G = 6, /* 2GHz, OFDM, 2x clock */ 6619117Sscrappy IEEE80211_MODE_STURBO_A = 7, /* 5GHz, OFDM, 2x clock, static */ 671590Srgrimes IEEE80211_MODE_11NA = 8, /* 5GHz, w/ HT */ 681590Srgrimes IEEE80211_MODE_11NG = 9, /* 2GHz, w/ HT */ 691590Srgrimes IEEE80211_MODE_HALF = 10, /* OFDM, 1/2x clock */ 701590Srgrimes IEEE80211_MODE_QUARTER = 11, /* OFDM, 1/4x clock */ 711590Srgrimes}; 721590Srgrimes#define IEEE80211_MODE_MAX (IEEE80211_MODE_QUARTER+1) 73111714Sjmallett 741590Srgrimes/* 7592921Simp * Operating mode. Devices do not necessarily support 7695617Smarkm * all modes; they indicate which are supported in their 7792921Simp * capabilities. 7892921Simp */ 79111714Sjmallettenum ieee80211_opmode { 8092921Simp IEEE80211_M_IBSS = 0, /* IBSS (adhoc) station */ 8192921Simp IEEE80211_M_STA = 1, /* infrastructure station */ 8292921Simp IEEE80211_M_WDS = 2, /* WDS link */ 831590Srgrimes IEEE80211_M_AHDEMO = 3, /* Old lucent compatible adhoc demo */ 841590Srgrimes IEEE80211_M_HOSTAP = 4, /* Software Access Point */ 8595617Smarkm IEEE80211_M_MONITOR = 5, /* Monitor mode */ 861590Srgrimes IEEE80211_M_MBSS = 6, /* MBSS (Mesh Point) link */ 8792921Simp}; 88111714Sjmallett#define IEEE80211_OPMODE_MAX (IEEE80211_M_MBSS+1) 891590Srgrimes 901590Srgrimes/* 911590Srgrimes * 802.11g/802.11n protection mode. 9224360Simp */ 931590Srgrimesenum ieee80211_protmode { 941590Srgrimes IEEE80211_PROT_NONE = 0, /* no protection */ 951590Srgrimes IEEE80211_PROT_CTSONLY = 1, /* CTS to self */ 961590Srgrimes IEEE80211_PROT_RTSCTS = 2, /* RTS-CTS */ 971590Srgrimes}; 981590Srgrimes 991590Srgrimes/* 1001590Srgrimes * Authentication mode. The open and shared key authentication 1011590Srgrimes * modes are implemented within the 802.11 layer. 802.1x and 1021590Srgrimes * WPA/802.11i are implemented in user mode by setting the 1031590Srgrimes * 802.11 layer into IEEE80211_AUTH_8021X and deferring 1041590Srgrimes * authentication to user space programs. 1051590Srgrimes */ 1061590Srgrimesenum ieee80211_authmode { 1071590Srgrimes IEEE80211_AUTH_NONE = 0, 1081590Srgrimes IEEE80211_AUTH_OPEN = 1, /* open */ 1098874Srgrimes IEEE80211_AUTH_SHARED = 2, /* shared-key */ 1101590Srgrimes IEEE80211_AUTH_8021X = 3, /* 802.1x */ 1111590Srgrimes IEEE80211_AUTH_AUTO = 4, /* auto-select/accept */ 1121590Srgrimes /* NB: these are used only for ioctls */ 1131590Srgrimes IEEE80211_AUTH_WPA = 5, /* WPA/RSN w/ 802.1x/PSK */ 1141590Srgrimes}; 1151590Srgrimes 1161590Srgrimes/* 1171590Srgrimes * Roaming mode is effectively who controls the operation 118111714Sjmallett * of the 802.11 state machine when operating as a station. 119111714Sjmallett * State transitions are controlled either by the driver 120111714Sjmallett * (typically when management frames are processed by the 121111714Sjmallett * hardware/firmware), the host (auto/normal operation of 122111714Sjmallett * the 802.11 layer), or explicitly through ioctl requests 123111714Sjmallett * when applications like wpa_supplicant want control. 124111714Sjmallett */ 125111714Sjmallettenum ieee80211_roamingmode { 126111714Sjmallett IEEE80211_ROAMING_DEVICE= 0, /* driver/hardware control */ 127111714Sjmallett IEEE80211_ROAMING_AUTO = 1, /* 802.11 layer control */ 128111714Sjmallett IEEE80211_ROAMING_MANUAL= 2, /* application control */ 129111714Sjmallett}; 130111714Sjmallett 131111714Sjmallett/* 132111714Sjmallett * Channels are specified by frequency and attributes. 133111714Sjmallett */ 134111714Sjmallettstruct ieee80211_channel { 135111714Sjmallett uint32_t ic_flags; /* see below */ 136111714Sjmallett uint16_t ic_freq; /* setting in MHz */ 137111714Sjmallett uint8_t ic_ieee; /* IEEE channel number */ 138111714Sjmallett int8_t ic_maxregpower; /* maximum regulatory tx power in dBm */ 139111714Sjmallett int8_t ic_maxpower; /* maximum tx power in .5 dBm */ 140111714Sjmallett int8_t ic_minpower; /* minimum tx power in .5 dBm */ 141111714Sjmallett uint8_t ic_state; /* dynamic state */ 142111714Sjmallett uint8_t ic_extieee; /* HT40 extension channel number */ 143111714Sjmallett int8_t ic_maxantgain; /* maximum antenna gain in .5 dBm */ 144111714Sjmallett uint8_t ic_pad; 145111714Sjmallett uint16_t ic_devdata; /* opaque device/driver data */ 146111714Sjmallett}; 147111714Sjmallett 148111714Sjmallett#define IEEE80211_CHAN_MAX 256 149111714Sjmallett#define IEEE80211_CHAN_BYTES 32 /* howmany(IEEE80211_CHAN_MAX, NBBY) */ 150111714Sjmallett#define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */ 151111714Sjmallett#define IEEE80211_CHAN_ANYC \ 152111714Sjmallett ((struct ieee80211_channel *) IEEE80211_CHAN_ANY) 153111714Sjmallett 154111714Sjmallett/* channel attributes */ 155111714Sjmallett#define IEEE80211_CHAN_PRIV0 0x00000001 /* driver private bit 0 */ 156111714Sjmallett#define IEEE80211_CHAN_PRIV1 0x00000002 /* driver private bit 1 */ 157111714Sjmallett#define IEEE80211_CHAN_PRIV2 0x00000004 /* driver private bit 2 */ 158111714Sjmallett#define IEEE80211_CHAN_PRIV3 0x00000008 /* driver private bit 3 */ 159111714Sjmallett#define IEEE80211_CHAN_TURBO 0x00000010 /* Turbo channel */ 160111714Sjmallett#define IEEE80211_CHAN_CCK 0x00000020 /* CCK channel */ 161111714Sjmallett#define IEEE80211_CHAN_OFDM 0x00000040 /* OFDM channel */ 162111714Sjmallett#define IEEE80211_CHAN_2GHZ 0x00000080 /* 2 GHz spectrum channel. */ 163111714Sjmallett#define IEEE80211_CHAN_5GHZ 0x00000100 /* 5 GHz spectrum channel */ 164111714Sjmallett#define IEEE80211_CHAN_PASSIVE 0x00000200 /* Only passive scan allowed */ 165111714Sjmallett#define IEEE80211_CHAN_DYN 0x00000400 /* Dynamic CCK-OFDM channel */ 166111714Sjmallett#define IEEE80211_CHAN_GFSK 0x00000800 /* GFSK channel (FHSS PHY) */ 167111714Sjmallett#define IEEE80211_CHAN_GSM 0x00001000 /* 900 MHz spectrum channel */ 168111714Sjmallett#define IEEE80211_CHAN_STURBO 0x00002000 /* 11a static turbo channel only */ 169111714Sjmallett#define IEEE80211_CHAN_HALF 0x00004000 /* Half rate channel */ 170111714Sjmallett#define IEEE80211_CHAN_QUARTER 0x00008000 /* Quarter rate channel */ 171111714Sjmallett#define IEEE80211_CHAN_HT20 0x00010000 /* HT 20 channel */ 172111714Sjmallett#define IEEE80211_CHAN_HT40U 0x00020000 /* HT 40 channel w/ ext above */ 173111714Sjmallett#define IEEE80211_CHAN_HT40D 0x00040000 /* HT 40 channel w/ ext below */ 174111714Sjmallett#define IEEE80211_CHAN_DFS 0x00080000 /* DFS required */ 175111714Sjmallett#define IEEE80211_CHAN_4MSXMIT 0x00100000 /* 4ms limit on frame length */ 176111714Sjmallett#define IEEE80211_CHAN_NOADHOC 0x00200000 /* adhoc mode not allowed */ 177111714Sjmallett#define IEEE80211_CHAN_NOHOSTAP 0x00400000 /* hostap mode not allowed */ 178111714Sjmallett#define IEEE80211_CHAN_11D 0x00800000 /* 802.11d required */ 179111714Sjmallett 180111714Sjmallett#define IEEE80211_CHAN_HT40 (IEEE80211_CHAN_HT40U | IEEE80211_CHAN_HT40D) 181111714Sjmallett#define IEEE80211_CHAN_HT (IEEE80211_CHAN_HT20 | IEEE80211_CHAN_HT40) 182111714Sjmallett 183111714Sjmallett#define IEEE80211_CHAN_BITS \ 184111714Sjmallett "\20\1PRIV0\2PRIV2\3PRIV3\4PRIV4\5TURBO\6CCK\7OFDM\0102GHZ\0115GHZ" \ 185111714Sjmallett "\12PASSIVE\13DYN\14GFSK\15GSM\16STURBO\17HALF\20QUARTER\21HT20" \ 186111714Sjmallett "\22HT40U\23HT40D\24DFS\0254MSXMIT\26NOADHOC\27NOHOSTAP\03011D" 187111714Sjmallett 188111714Sjmallett/* 189111714Sjmallett * Useful combinations of channel characteristics. 190111714Sjmallett */ 191111714Sjmallett#define IEEE80211_CHAN_FHSS \ 192111714Sjmallett (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_GFSK) 1931590Srgrimes#define IEEE80211_CHAN_A \ 1941590Srgrimes (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM) 195111714Sjmallett#define IEEE80211_CHAN_B \ 1961590Srgrimes (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_CCK) 1971590Srgrimes#define IEEE80211_CHAN_PUREG \ 1981590Srgrimes (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM) 1991590Srgrimes#define IEEE80211_CHAN_G \ 2001590Srgrimes (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN) 2011590Srgrimes#define IEEE80211_CHAN_108A \ 2021590Srgrimes (IEEE80211_CHAN_A | IEEE80211_CHAN_TURBO) 203111714Sjmallett#define IEEE80211_CHAN_108G \ 204111714Sjmallett (IEEE80211_CHAN_PUREG | IEEE80211_CHAN_TURBO) 205111714Sjmallett#define IEEE80211_CHAN_ST \ 206111714Sjmallett (IEEE80211_CHAN_108A | IEEE80211_CHAN_STURBO) 207111714Sjmallett 2081590Srgrimes#define IEEE80211_CHAN_ALL \ 2091590Srgrimes (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_GFSK | \ 2101590Srgrimes IEEE80211_CHAN_CCK | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_DYN | \ 2111590Srgrimes IEEE80211_CHAN_HALF | IEEE80211_CHAN_QUARTER | \ 2121590Srgrimes IEEE80211_CHAN_HT) 2131590Srgrimes#define IEEE80211_CHAN_ALLTURBO \ 2141590Srgrimes (IEEE80211_CHAN_ALL | IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO) 2151590Srgrimes 2161590Srgrimes#define IEEE80211_IS_CHAN_FHSS(_c) \ 2171590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_FHSS) == IEEE80211_CHAN_FHSS) 2181590Srgrimes#define IEEE80211_IS_CHAN_A(_c) \ 2191590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_A) == IEEE80211_CHAN_A) 2201590Srgrimes#define IEEE80211_IS_CHAN_B(_c) \ 2211590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_B) == IEEE80211_CHAN_B) 2221590Srgrimes#define IEEE80211_IS_CHAN_PUREG(_c) \ 2231590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_PUREG) == IEEE80211_CHAN_PUREG) 2241590Srgrimes#define IEEE80211_IS_CHAN_G(_c) \ 2251590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G) 2261590Srgrimes#define IEEE80211_IS_CHAN_ANYG(_c) \ 2271590Srgrimes (IEEE80211_IS_CHAN_PUREG(_c) || IEEE80211_IS_CHAN_G(_c)) 2281590Srgrimes#define IEEE80211_IS_CHAN_ST(_c) \ 2291590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_ST) == IEEE80211_CHAN_ST) 2301590Srgrimes#define IEEE80211_IS_CHAN_108A(_c) \ 2311590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_108A) == IEEE80211_CHAN_108A) 2321590Srgrimes#define IEEE80211_IS_CHAN_108G(_c) \ 233111714Sjmallett (((_c)->ic_flags & IEEE80211_CHAN_108G) == IEEE80211_CHAN_108G) 234111714Sjmallett 235111714Sjmallett#define IEEE80211_IS_CHAN_2GHZ(_c) \ 236111714Sjmallett (((_c)->ic_flags & IEEE80211_CHAN_2GHZ) != 0) 237111714Sjmallett#define IEEE80211_IS_CHAN_5GHZ(_c) \ 238111714Sjmallett (((_c)->ic_flags & IEEE80211_CHAN_5GHZ) != 0) 2391590Srgrimes#define IEEE80211_IS_CHAN_PASSIVE(_c) \ 2401590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_PASSIVE) != 0) 2411590Srgrimes#define IEEE80211_IS_CHAN_OFDM(_c) \ 24295617Smarkm (((_c)->ic_flags & (IEEE80211_CHAN_OFDM | IEEE80211_CHAN_DYN)) != 0) 2431590Srgrimes#define IEEE80211_IS_CHAN_CCK(_c) \ 24419117Sscrappy (((_c)->ic_flags & (IEEE80211_CHAN_CCK | IEEE80211_CHAN_DYN)) != 0) 24519117Sscrappy#define IEEE80211_IS_CHAN_DYN(_c) \ 2461590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_DYN) == IEEE80211_CHAN_DYN) 2471590Srgrimes#define IEEE80211_IS_CHAN_GFSK(_c) \ 2481590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_GFSK) != 0) 2491590Srgrimes#define IEEE80211_IS_CHAN_TURBO(_c) \ 2501590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_TURBO) != 0) 2511590Srgrimes#define IEEE80211_IS_CHAN_STURBO(_c) \ 2521590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_STURBO) != 0) 2531590Srgrimes#define IEEE80211_IS_CHAN_DTURBO(_c) \ 2541590Srgrimes (((_c)->ic_flags & \ 2551590Srgrimes (IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO)) == IEEE80211_CHAN_TURBO) 2561590Srgrimes#define IEEE80211_IS_CHAN_HALF(_c) \ 2571590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_HALF) != 0) 2581590Srgrimes#define IEEE80211_IS_CHAN_QUARTER(_c) \ 2591590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_QUARTER) != 0) 2601590Srgrimes#define IEEE80211_IS_CHAN_FULL(_c) \ 2611590Srgrimes (((_c)->ic_flags & (IEEE80211_CHAN_QUARTER | IEEE80211_CHAN_HALF)) == 0) 2621590Srgrimes#define IEEE80211_IS_CHAN_GSM(_c) \ 2631590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_GSM) != 0) 264111714Sjmallett#define IEEE80211_IS_CHAN_HT(_c) \ 2651590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_HT) != 0) 266111714Sjmallett#define IEEE80211_IS_CHAN_HT20(_c) \ 267111714Sjmallett (((_c)->ic_flags & IEEE80211_CHAN_HT20) != 0) 2681590Srgrimes#define IEEE80211_IS_CHAN_HT40(_c) \ 2691590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_HT40) != 0) 2701590Srgrimes#define IEEE80211_IS_CHAN_HT40U(_c) \ 2711590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_HT40U) != 0) 27295617Smarkm#define IEEE80211_IS_CHAN_HT40D(_c) \ 2731590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_HT40D) != 0) 2741590Srgrimes#define IEEE80211_IS_CHAN_HTA(_c) \ 2751590Srgrimes (IEEE80211_IS_CHAN_5GHZ(_c) && \ 2761590Srgrimes ((_c)->ic_flags & IEEE80211_CHAN_HT) != 0) 2771590Srgrimes#define IEEE80211_IS_CHAN_HTG(_c) \ 2781590Srgrimes (IEEE80211_IS_CHAN_2GHZ(_c) && \ 2791590Srgrimes ((_c)->ic_flags & IEEE80211_CHAN_HT) != 0) 2801590Srgrimes#define IEEE80211_IS_CHAN_DFS(_c) \ 2811590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_DFS) != 0) 2821590Srgrimes#define IEEE80211_IS_CHAN_NOADHOC(_c) \ 2831590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_NOADHOC) != 0) 2841590Srgrimes#define IEEE80211_IS_CHAN_NOHOSTAP(_c) \ 2851590Srgrimes (((_c)->ic_flags & IEEE80211_CHAN_NOHOSTAP) != 0) 2861590Srgrimes#define IEEE80211_IS_CHAN_11D(_c) \ 28795617Smarkm (((_c)->ic_flags & IEEE80211_CHAN_11D) != 0) 2881590Srgrimes 2891590Srgrimes#define IEEE80211_CHAN2IEEE(_c) (_c)->ic_ieee 2901590Srgrimes 2911590Srgrimes/* dynamic state */ 2921590Srgrimes#define IEEE80211_CHANSTATE_RADAR 0x01 /* radar detected */ 2931590Srgrimes#define IEEE80211_CHANSTATE_CACDONE 0x02 /* CAC completed */ 2941590Srgrimes#define IEEE80211_CHANSTATE_CWINT 0x04 /* interference detected */ 2951590Srgrimes#define IEEE80211_CHANSTATE_NORADAR 0x10 /* post notify on radar clear */ 2961590Srgrimes 2971590Srgrimes#define IEEE80211_IS_CHAN_RADAR(_c) \ 2981590Srgrimes (((_c)->ic_state & IEEE80211_CHANSTATE_RADAR) != 0) 29995617Smarkm#define IEEE80211_IS_CHAN_CACDONE(_c) \ 3001590Srgrimes (((_c)->ic_state & IEEE80211_CHANSTATE_CACDONE) != 0) 3011590Srgrimes#define IEEE80211_IS_CHAN_CWINT(_c) \ 3021590Srgrimes (((_c)->ic_state & IEEE80211_CHANSTATE_CWINT) != 0) 3031590Srgrimes 304/* ni_chan encoding for FH phy */ 305#define IEEE80211_FH_CHANMOD 80 306#define IEEE80211_FH_CHAN(set,pat) (((set)-1)*IEEE80211_FH_CHANMOD+(pat)) 307#define IEEE80211_FH_CHANSET(chan) ((chan)/IEEE80211_FH_CHANMOD+1) 308#define IEEE80211_FH_CHANPAT(chan) ((chan)%IEEE80211_FH_CHANMOD) 309 310#define IEEE80211_TID_SIZE (WME_NUM_TID+1) /* WME TID's +1 for non-QoS */ 311#define IEEE80211_NONQOS_TID WME_NUM_TID /* index for non-QoS sta */ 312 313/* 314 * The 802.11 spec says at most 2007 stations may be 315 * associated at once. For most AP's this is way more 316 * than is feasible so we use a default of 128. This 317 * number may be overridden by the driver and/or by 318 * user configuration but may not be less than IEEE80211_AID_MIN. 319 */ 320#define IEEE80211_AID_DEF 128 321#define IEEE80211_AID_MIN 16 322 323/* 324 * 802.11 rate set. 325 */ 326#define IEEE80211_RATE_SIZE 8 /* 802.11 standard */ 327#define IEEE80211_RATE_MAXSIZE 15 /* max rates we'll handle */ 328 329struct ieee80211_rateset { 330 uint8_t rs_nrates; 331 uint8_t rs_rates[IEEE80211_RATE_MAXSIZE]; 332}; 333 334/* 335 * 802.11n variant of ieee80211_rateset. Instead of 336 * legacy rates the entries are MCS rates. We define 337 * the structure such that it can be used interchangeably 338 * with an ieee80211_rateset (modulo structure size). 339 */ 340#define IEEE80211_HTRATE_MAXSIZE 77 341 342struct ieee80211_htrateset { 343 uint8_t rs_nrates; 344 uint8_t rs_rates[IEEE80211_HTRATE_MAXSIZE]; 345}; 346 347#define IEEE80211_RATE_MCS 0x80 348 349/* 350 * Per-mode transmit parameters/controls visible to user space. 351 * These can be used to set fixed transmit rate for all operating 352 * modes or on a per-client basis according to the capabilities 353 * of the client (e.g. an 11b client associated to an 11g ap). 354 * 355 * MCS are distinguished from legacy rates by or'ing in 0x80. 356 */ 357struct ieee80211_txparam { 358 uint8_t ucastrate; /* ucast data rate (legacy/MCS|0x80) */ 359 uint8_t mgmtrate; /* mgmt frame rate (legacy/MCS|0x80) */ 360 uint8_t mcastrate; /* multicast rate (legacy/MCS|0x80) */ 361 uint8_t maxretry; /* max unicast data retry count */ 362}; 363 364/* 365 * Per-mode roaming state visible to user space. There are two 366 * thresholds that control whether roaming is considered; when 367 * either is exceeded the 802.11 layer will check the scan cache 368 * for another AP. If the cache is stale then a scan may be 369 * triggered. 370 */ 371struct ieee80211_roamparam { 372 int8_t rssi; /* rssi thresh (.5 dBm) */ 373 uint8_t rate; /* tx rate thresh (.5 Mb/s or MCS) */ 374 uint16_t pad; /* reserve */ 375}; 376 377/* 378 * Regulatory Information. 379 */ 380struct ieee80211_regdomain { 381 uint16_t regdomain; /* SKU */ 382 uint16_t country; /* ISO country code */ 383 uint8_t location; /* I (indoor), O (outdoor), other */ 384 uint8_t ecm; /* Extended Channel Mode */ 385 char isocc[2]; /* country code string */ 386 short pad[2]; 387}; 388 389/* 390 * MIMO antenna/radio state. 391 */ 392 393#define IEEE80211_MAX_CHAINS 3 394#define IEEE80211_MAX_EVM_PILOTS 6 395 396/* 397 * XXX This doesn't yet export both ctl/ext chain details 398 */ 399struct ieee80211_mimo_info { 400 int8_t rssi[IEEE80211_MAX_CHAINS]; /* per-antenna rssi */ 401 int8_t noise[IEEE80211_MAX_CHAINS]; /* per-antenna noise floor */ 402 uint8_t pad[2]; 403 uint32_t evm[3]; /* EVM data */ 404}; 405#endif /* _NET80211__IEEE80211_H_ */ 406