Home | History | Annotate | Line # | Download | only in net80211
_ieee80211.h revision 1.6.4.1
      1      1.1    dyoung /*-
      2      1.1    dyoung  * Copyright (c) 2001 Atsushi Onoe
      3  1.6.4.1     skrll  * Copyright (c) 2002-2007 Sam Leffler, Errno Consulting
      4      1.1    dyoung  * All rights reserved.
      5      1.1    dyoung  *
      6      1.1    dyoung  * Redistribution and use in source and binary forms, with or without
      7      1.1    dyoung  * modification, are permitted provided that the following conditions
      8      1.1    dyoung  * are met:
      9      1.1    dyoung  * 1. Redistributions of source code must retain the above copyright
     10      1.1    dyoung  *    notice, this list of conditions and the following disclaimer.
     11      1.1    dyoung  * 2. Redistributions in binary form must reproduce the above copyright
     12      1.1    dyoung  *    notice, this list of conditions and the following disclaimer in the
     13      1.1    dyoung  *    documentation and/or other materials provided with the distribution.
     14      1.1    dyoung  *
     15      1.1    dyoung  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     16      1.1    dyoung  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     17      1.1    dyoung  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     18      1.1    dyoung  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     19      1.1    dyoung  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     20      1.1    dyoung  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     21      1.1    dyoung  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     22      1.1    dyoung  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     23      1.1    dyoung  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     24      1.1    dyoung  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     25      1.1    dyoung  *
     26  1.6.4.1     skrll  * $FreeBSD: src/sys/net80211/_ieee80211.h,v 1.14 2007/09/18 20:46:36 sam Exp $
     27      1.1    dyoung  */
     28      1.1    dyoung #ifndef _NET80211__IEEE80211_H_
     29      1.1    dyoung #define _NET80211__IEEE80211_H_
     30      1.1    dyoung 
     31      1.1    dyoung enum ieee80211_phytype {
     32      1.1    dyoung 	IEEE80211_T_DS,			/* direct sequence spread spectrum */
     33      1.1    dyoung 	IEEE80211_T_FH,			/* frequency hopping */
     34      1.1    dyoung 	IEEE80211_T_OFDM,		/* frequency division multiplexing */
     35      1.1    dyoung 	IEEE80211_T_TURBO,		/* high rate OFDM, aka turbo mode */
     36  1.6.4.1     skrll 	IEEE80211_T_HT,			/* high throughput, full GI */
     37      1.1    dyoung };
     38      1.1    dyoung #define	IEEE80211_T_CCK	IEEE80211_T_DS	/* more common nomenclature */
     39      1.1    dyoung 
     40      1.1    dyoung /* XXX not really a mode; there are really multiple PHY's */
     41      1.1    dyoung enum ieee80211_phymode {
     42      1.1    dyoung 	IEEE80211_MODE_AUTO	= 0,	/* autoselect */
     43      1.1    dyoung 	IEEE80211_MODE_11A	= 1,	/* 5GHz, OFDM */
     44      1.1    dyoung 	IEEE80211_MODE_11B	= 2,	/* 2GHz, CCK */
     45      1.1    dyoung 	IEEE80211_MODE_11G	= 3,	/* 2GHz, OFDM */
     46      1.1    dyoung 	IEEE80211_MODE_FH	= 4,	/* 2GHz, GFSK */
     47      1.1    dyoung 	IEEE80211_MODE_TURBO_A	= 5,	/* 5GHz, OFDM, 2x clock */
     48      1.1    dyoung 	IEEE80211_MODE_TURBO_G	= 6,	/* 2GHz, OFDM, 2x clock */
     49  1.6.4.1     skrll 	IEEE80211_MODE_STURBO_A	= 7,	/* 5GHz, OFDM, 2x clock, static */
     50  1.6.4.1     skrll 	IEEE80211_MODE_11NA	= 8,	/* 5GHz, w/ HT */
     51  1.6.4.1     skrll 	IEEE80211_MODE_11NG	= 9,	/* 2GHz, w/ HT */
     52      1.1    dyoung };
     53  1.6.4.1     skrll #define	IEEE80211_MODE_MAX	(IEEE80211_MODE_11NG+1)
     54      1.1    dyoung 
     55      1.1    dyoung enum ieee80211_opmode {
     56      1.1    dyoung 	IEEE80211_M_STA		= 1,	/* infrastructure station */
     57      1.1    dyoung 	IEEE80211_M_IBSS 	= 0,	/* IBSS (adhoc) station */
     58      1.1    dyoung 	IEEE80211_M_AHDEMO	= 3,	/* Old lucent compatible adhoc demo */
     59      1.1    dyoung 	IEEE80211_M_HOSTAP	= 6,	/* Software Access Point */
     60  1.6.4.1     skrll 	IEEE80211_M_MONITOR	= 8,	/* Monitor mode */
     61  1.6.4.1     skrll 	IEEE80211_M_WDS		= 2	/* WDS link */
     62      1.1    dyoung };
     63  1.6.4.1     skrll #define	IEEE80211_OPMODE_MAX	(IEEE80211_M_MONITOR+1)
     64      1.1    dyoung 
     65      1.1    dyoung /*
     66  1.6.4.1     skrll  * 802.11g/802.11n protection mode.
     67      1.1    dyoung  */
     68      1.1    dyoung enum ieee80211_protmode {
     69      1.1    dyoung 	IEEE80211_PROT_NONE	= 0,	/* no protection */
     70      1.1    dyoung 	IEEE80211_PROT_CTSONLY	= 1,	/* CTS to self */
     71      1.1    dyoung 	IEEE80211_PROT_RTSCTS	= 2,	/* RTS-CTS */
     72      1.1    dyoung };
     73      1.1    dyoung 
     74      1.1    dyoung /*
     75      1.1    dyoung  * Authentication mode.
     76      1.1    dyoung  */
     77      1.1    dyoung enum ieee80211_authmode {
     78      1.1    dyoung 	IEEE80211_AUTH_NONE	= 0,
     79      1.1    dyoung 	IEEE80211_AUTH_OPEN	= 1,		/* open */
     80      1.1    dyoung 	IEEE80211_AUTH_SHARED	= 2,		/* shared-key */
     81      1.1    dyoung 	IEEE80211_AUTH_8021X	= 3,		/* 802.1x */
     82      1.1    dyoung 	IEEE80211_AUTH_AUTO	= 4,		/* auto-select/accept */
     83      1.1    dyoung 	/* NB: these are used only for ioctls */
     84      1.1    dyoung 	IEEE80211_AUTH_WPA	= 5,		/* WPA/RSN w/ 802.1x/PSK */
     85      1.1    dyoung };
     86      1.1    dyoung 
     87      1.1    dyoung /*
     88      1.1    dyoung  * Roaming mode is effectively who controls the operation
     89      1.1    dyoung  * of the 802.11 state machine when operating as a station.
     90      1.1    dyoung  * State transitions are controlled either by the driver
     91      1.1    dyoung  * (typically when management frames are processed by the
     92      1.1    dyoung  * hardware/firmware), the host (auto/normal operation of
     93      1.1    dyoung  * the 802.11 layer), or explicitly through ioctl requests
     94      1.1    dyoung  * when applications like wpa_supplicant want control.
     95      1.1    dyoung  */
     96      1.1    dyoung enum ieee80211_roamingmode {
     97      1.1    dyoung 	IEEE80211_ROAMING_DEVICE= 0,	/* driver/hardware control */
     98      1.1    dyoung 	IEEE80211_ROAMING_AUTO	= 1,	/* 802.11 layer control */
     99      1.1    dyoung 	IEEE80211_ROAMING_MANUAL= 2,	/* application control */
    100      1.1    dyoung };
    101      1.1    dyoung 
    102      1.1    dyoung /*
    103      1.1    dyoung  * Channels are specified by frequency and attributes.
    104      1.1    dyoung  */
    105      1.1    dyoung struct ieee80211_channel {
    106  1.6.4.1     skrll 	uint32_t	ic_flags;	/* see below */
    107  1.6.4.1     skrll 	uint16_t	ic_freq;	/* setting in Mhz */
    108  1.6.4.1     skrll 	uint8_t		ic_ieee;	/* IEEE channel number */
    109  1.6.4.1     skrll 	int8_t		ic_maxregpower;	/* maximum regulatory tx power in dBm */
    110  1.6.4.1     skrll 	int8_t		ic_maxpower;	/* maximum tx power in .5 dBm */
    111  1.6.4.1     skrll 	int8_t		ic_minpower;	/* minimum tx power in .5 dBm */
    112  1.6.4.1     skrll 	uint8_t		ic_state;	/* dynamic state */
    113  1.6.4.1     skrll 	uint8_t		ic_extieee;	/* HT40 extension channel number */
    114      1.1    dyoung };
    115      1.1    dyoung 
    116      1.1    dyoung #define	IEEE80211_CHAN_MAX	255
    117      1.1    dyoung #define	IEEE80211_CHAN_BYTES	32	/* howmany(IEEE80211_CHAN_MAX, NBBY) */
    118      1.1    dyoung #define	IEEE80211_CHAN_ANY	0xffff	/* token for ``any channel'' */
    119      1.1    dyoung #define	IEEE80211_CHAN_ANYC \
    120      1.2    dyoung 	((struct ieee80211_channel *) 0x1)
    121      1.1    dyoung 
    122      1.1    dyoung /* bits 0-3 are for private use by drivers */
    123      1.1    dyoung /* channel attributes */
    124  1.6.4.1     skrll #define	IEEE80211_CHAN_TURBO	0x00000010 /* Turbo channel */
    125  1.6.4.1     skrll #define	IEEE80211_CHAN_CCK	0x00000020 /* CCK channel */
    126  1.6.4.1     skrll #define	IEEE80211_CHAN_OFDM	0x00000040 /* OFDM channel */
    127  1.6.4.1     skrll #define	IEEE80211_CHAN_2GHZ	0x00000080 /* 2 GHz spectrum channel. */
    128  1.6.4.1     skrll #define	IEEE80211_CHAN_5GHZ	0x00000100 /* 5 GHz spectrum channel */
    129  1.6.4.1     skrll #define	IEEE80211_CHAN_PASSIVE	0x00000200 /* Only passive scan allowed */
    130  1.6.4.1     skrll #define	IEEE80211_CHAN_DYN	0x00000400 /* Dynamic CCK-OFDM channel */
    131  1.6.4.1     skrll #define	IEEE80211_CHAN_GFSK	0x00000800 /* GFSK channel (FHSS PHY) */
    132  1.6.4.1     skrll #define	IEEE80211_CHAN_GSM	0x00001000 /* 900 MHz spectrum channel */
    133  1.6.4.1     skrll #define	IEEE80211_CHAN_STURBO	0x00002000 /* 11a static turbo channel only */
    134  1.6.4.1     skrll #define	IEEE80211_CHAN_HALF	0x00004000 /* Half rate channel */
    135  1.6.4.1     skrll #define	IEEE80211_CHAN_QUARTER	0x00008000 /* Quarter rate channel */
    136  1.6.4.1     skrll #define	IEEE80211_CHAN_HT20	0x00010000 /* HT 20 channel */
    137  1.6.4.1     skrll #define	IEEE80211_CHAN_HT40U	0x00020000 /* HT 40 channel w/ ext above */
    138  1.6.4.1     skrll #define	IEEE80211_CHAN_HT40D	0x00040000 /* HT 40 channel w/ ext below */
    139  1.6.4.1     skrll #define	IEEE80211_CHAN_DFS	0x00080000 /* DFS required */
    140  1.6.4.1     skrll #define	IEEE80211_CHAN_4MSXMIT	0x00100000 /* 4ms limit on frame length */
    141  1.6.4.1     skrll #define	IEEE80211_CHAN_NOADHOC	0x00200000 /* adhoc mode not allowed */
    142  1.6.4.1     skrll #define	IEEE80211_CHAN_NOHOSTAP	0x00400000 /* hostap mode not allowed */
    143  1.6.4.1     skrll #define	IEEE80211_CHAN_11D	0x00800000 /* 802.11d required */
    144  1.6.4.1     skrll 
    145  1.6.4.1     skrll #define	IEEE80211_CHAN_HT40	(IEEE80211_CHAN_HT40U | IEEE80211_CHAN_HT40D)
    146  1.6.4.1     skrll #define	IEEE80211_CHAN_HT	(IEEE80211_CHAN_HT20 | IEEE80211_CHAN_HT40)
    147      1.1    dyoung 
    148      1.1    dyoung /*
    149      1.1    dyoung  * Useful combinations of channel characteristics.
    150      1.1    dyoung  */
    151      1.1    dyoung #define	IEEE80211_CHAN_FHSS \
    152      1.1    dyoung 	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_GFSK)
    153      1.1    dyoung #define	IEEE80211_CHAN_A \
    154      1.1    dyoung 	(IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM)
    155      1.1    dyoung #define	IEEE80211_CHAN_B \
    156      1.1    dyoung 	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_CCK)
    157      1.1    dyoung #define	IEEE80211_CHAN_PUREG \
    158      1.1    dyoung 	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM)
    159      1.1    dyoung #define	IEEE80211_CHAN_G \
    160      1.1    dyoung 	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN)
    161  1.6.4.1     skrll #define IEEE80211_CHAN_108A \
    162      1.1    dyoung 	(IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO)
    163      1.1    dyoung #define	IEEE80211_CHAN_108G \
    164      1.1    dyoung 	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO)
    165  1.6.4.1     skrll #define	IEEE80211_CHAN_ST \
    166  1.6.4.1     skrll 	(IEEE80211_CHAN_108A | IEEE80211_CHAN_STURBO)
    167      1.1    dyoung 
    168      1.4    dyoung #define	IEEE80211_CHAN_ALL \
    169      1.4    dyoung 	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_GFSK | \
    170  1.6.4.1     skrll 	 IEEE80211_CHAN_CCK | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_DYN | \
    171  1.6.4.1     skrll 	 IEEE80211_CHAN_HT)
    172      1.4    dyoung #define	IEEE80211_CHAN_ALLTURBO \
    173  1.6.4.1     skrll 	(IEEE80211_CHAN_ALL | IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO)
    174      1.4    dyoung 
    175      1.1    dyoung #define	IEEE80211_IS_CHAN_FHSS(_c) \
    176      1.1    dyoung 	(((_c)->ic_flags & IEEE80211_CHAN_FHSS) == IEEE80211_CHAN_FHSS)
    177      1.1    dyoung #define	IEEE80211_IS_CHAN_A(_c) \
    178      1.1    dyoung 	(((_c)->ic_flags & IEEE80211_CHAN_A) == IEEE80211_CHAN_A)
    179      1.1    dyoung #define	IEEE80211_IS_CHAN_B(_c) \
    180      1.1    dyoung 	(((_c)->ic_flags & IEEE80211_CHAN_B) == IEEE80211_CHAN_B)
    181      1.1    dyoung #define	IEEE80211_IS_CHAN_PUREG(_c) \
    182      1.1    dyoung 	(((_c)->ic_flags & IEEE80211_CHAN_PUREG) == IEEE80211_CHAN_PUREG)
    183      1.1    dyoung #define	IEEE80211_IS_CHAN_G(_c) \
    184      1.1    dyoung 	(((_c)->ic_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G)
    185      1.2    dyoung #define	IEEE80211_IS_CHAN_ANYG(_c) \
    186      1.2    dyoung 	(IEEE80211_IS_CHAN_PUREG(_c) || IEEE80211_IS_CHAN_G(_c))
    187  1.6.4.1     skrll #define	IEEE80211_IS_CHAN_ST(_c) \
    188  1.6.4.1     skrll 	(((_c)->ic_flags & IEEE80211_CHAN_ST) == IEEE80211_CHAN_ST)
    189  1.6.4.1     skrll #define	IEEE80211_IS_CHAN_108A(_c) \
    190  1.6.4.1     skrll 	(((_c)->ic_flags & IEEE80211_CHAN_108A) == IEEE80211_CHAN_108A)
    191      1.1    dyoung #define	IEEE80211_IS_CHAN_108G(_c) \
    192      1.1    dyoung 	(((_c)->ic_flags & IEEE80211_CHAN_108G) == IEEE80211_CHAN_108G)
    193      1.1    dyoung 
    194      1.1    dyoung #define	IEEE80211_IS_CHAN_2GHZ(_c) \
    195      1.1    dyoung 	(((_c)->ic_flags & IEEE80211_CHAN_2GHZ) != 0)
    196      1.1    dyoung #define	IEEE80211_IS_CHAN_5GHZ(_c) \
    197      1.1    dyoung 	(((_c)->ic_flags & IEEE80211_CHAN_5GHZ) != 0)
    198  1.6.4.1     skrll #define	IEEE80211_IS_CHAN_PASSIVE(_c) \
    199  1.6.4.1     skrll 	(((_c)->ic_flags & IEEE80211_CHAN_PASSIVE) != 0)
    200      1.1    dyoung #define	IEEE80211_IS_CHAN_OFDM(_c) \
    201      1.1    dyoung 	(((_c)->ic_flags & IEEE80211_CHAN_OFDM) != 0)
    202      1.1    dyoung #define	IEEE80211_IS_CHAN_CCK(_c) \
    203      1.1    dyoung 	(((_c)->ic_flags & IEEE80211_CHAN_CCK) != 0)
    204      1.1    dyoung #define	IEEE80211_IS_CHAN_GFSK(_c) \
    205      1.1    dyoung 	(((_c)->ic_flags & IEEE80211_CHAN_GFSK) != 0)
    206  1.6.4.1     skrll #define	IEEE80211_IS_CHAN_TURBO(_c) \
    207  1.6.4.1     skrll 	(((_c)->ic_flags & IEEE80211_CHAN_TURBO) != 0)
    208  1.6.4.1     skrll #define	IEEE80211_IS_CHAN_STURBO(_c) \
    209  1.6.4.1     skrll 	(((_c)->ic_flags & IEEE80211_CHAN_STURBO) != 0)
    210  1.6.4.1     skrll #define	IEEE80211_IS_CHAN_DTURBO(_c) \
    211  1.6.4.1     skrll 	(((_c)->ic_flags & \
    212  1.6.4.1     skrll 	(IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO)) == IEEE80211_CHAN_TURBO)
    213      1.6  degroote #define	IEEE80211_IS_CHAN_HALF(_c) \
    214      1.6  degroote 	(((_c)->ic_flags & IEEE80211_CHAN_HALF) != 0)
    215      1.6  degroote #define	IEEE80211_IS_CHAN_QUARTER(_c) \
    216      1.6  degroote 	(((_c)->ic_flags & IEEE80211_CHAN_QUARTER) != 0)
    217      1.6  degroote #define	IEEE80211_IS_CHAN_FULL(_c) \
    218      1.6  degroote 	(((_c)->ic_flags & (IEEE80211_CHAN_QUARTER | IEEE80211_CHAN_HALF)) == 0)
    219      1.6  degroote #define	IEEE80211_IS_CHAN_GSM(_c) \
    220      1.6  degroote 	(((_c)->ic_flags & IEEE80211_CHAN_GSM) != 0)
    221  1.6.4.1     skrll #define	IEEE80211_IS_CHAN_HT(_c) \
    222  1.6.4.1     skrll 	(((_c)->ic_flags & IEEE80211_CHAN_HT) != 0)
    223  1.6.4.1     skrll #define	IEEE80211_IS_CHAN_HT20(_c) \
    224  1.6.4.1     skrll 	(((_c)->ic_flags & IEEE80211_CHAN_HT20) != 0)
    225  1.6.4.1     skrll #define	IEEE80211_IS_CHAN_HT40(_c) \
    226  1.6.4.1     skrll 	(((_c)->ic_flags & IEEE80211_CHAN_HT40) != 0)
    227  1.6.4.1     skrll #define	IEEE80211_IS_CHAN_HT40U(_c) \
    228  1.6.4.1     skrll 	(((_c)->ic_flags & IEEE80211_CHAN_HT40U) != 0)
    229  1.6.4.1     skrll #define	IEEE80211_IS_CHAN_HT40D(_c) \
    230  1.6.4.1     skrll 	(((_c)->ic_flags & IEEE80211_CHAN_HT40D) != 0)
    231  1.6.4.1     skrll #define	IEEE80211_IS_CHAN_HTA(_c) \
    232  1.6.4.1     skrll 	(IEEE80211_IS_CHAN_5GHZ(_c) && \
    233  1.6.4.1     skrll 	 ((_c)->ic_flags & IEEE80211_CHAN_HT) != 0)
    234  1.6.4.1     skrll #define	IEEE80211_IS_CHAN_HTG(_c) \
    235  1.6.4.1     skrll 	(IEEE80211_IS_CHAN_2GHZ(_c) && \
    236  1.6.4.1     skrll 	 ((_c)->ic_flags & IEEE80211_CHAN_HT) != 0)
    237  1.6.4.1     skrll #define	IEEE80211_IS_CHAN_DFS(_c) \
    238  1.6.4.1     skrll 	(((_c)->ic_flags & IEEE80211_CHAN_DFS) != 0)
    239  1.6.4.1     skrll #define	IEEE80211_IS_CHAN_NOADHOC(_c) \
    240  1.6.4.1     skrll 	(((_c)->ic_flags & IEEE80211_CHAN_NOADHOC) != 0)
    241  1.6.4.1     skrll #define	IEEE80211_IS_CHAN_NOHOSTAP(_c) \
    242  1.6.4.1     skrll 	(((_c)->ic_flags & IEEE80211_CHAN_NOHOSTAP) != 0)
    243  1.6.4.1     skrll #define	IEEE80211_IS_CHAN_11D(_c) \
    244  1.6.4.1     skrll 	(((_c)->ic_flags & IEEE80211_CHAN_11D) != 0)
    245  1.6.4.1     skrll 
    246  1.6.4.1     skrll #define	IEEE80211_CHAN2IEEE(_c)		(_c)->ic_ieee
    247  1.6.4.1     skrll 
    248  1.6.4.1     skrll /* dynamic state */
    249  1.6.4.1     skrll #define	IEEE80211_CHANSTATE_RADAR	0x01	/* radar detected */
    250  1.6.4.1     skrll #define	IEEE80211_CHANSTATE_CACDONE	0x02	/* CAC completed */
    251  1.6.4.1     skrll #define	IEEE80211_CHANSTATE_NORADAR	0x10	/* post notify on radar clear */
    252  1.6.4.1     skrll 
    253  1.6.4.1     skrll #define	IEEE80211_IS_CHAN_RADAR(_c) \
    254  1.6.4.1     skrll 	(((_c)->ic_state & IEEE80211_CHANSTATE_RADAR) != 0)
    255  1.6.4.1     skrll #define	IEEE80211_IS_CHAN_CACDONE(_c) \
    256  1.6.4.1     skrll 	(((_c)->ic_state & IEEE80211_CHANSTATE_CACDONE) != 0)
    257      1.1    dyoung 
    258      1.1    dyoung /* ni_chan encoding for FH phy */
    259      1.1    dyoung #define	IEEE80211_FH_CHANMOD	80
    260      1.1    dyoung #define	IEEE80211_FH_CHAN(set,pat)	(((set)-1)*IEEE80211_FH_CHANMOD+(pat))
    261      1.1    dyoung #define	IEEE80211_FH_CHANSET(chan)	((chan)/IEEE80211_FH_CHANMOD+1)
    262      1.1    dyoung #define	IEEE80211_FH_CHANPAT(chan)	((chan)%IEEE80211_FH_CHANMOD)
    263      1.1    dyoung 
    264  1.6.4.1     skrll #define	IEEE80211_TID_SIZE	(WME_NUM_TID+1)	/* WME TID's +1 for non-QoS */
    265  1.6.4.1     skrll #define	IEEE80211_NONQOS_TID	WME_NUM_TID	/* index for non-QoS sta */
    266  1.6.4.1     skrll 
    267      1.1    dyoung /*
    268      1.1    dyoung  * 802.11 rate set.
    269      1.1    dyoung  */
    270      1.1    dyoung #define	IEEE80211_RATE_SIZE	8		/* 802.11 standard */
    271      1.1    dyoung #define	IEEE80211_RATE_MAXSIZE	15		/* max rates we'll handle */
    272      1.1    dyoung 
    273      1.1    dyoung struct ieee80211_rateset {
    274  1.6.4.1     skrll 	uint8_t			rs_nrates;
    275  1.6.4.1     skrll 	uint8_t			rs_rates[IEEE80211_RATE_MAXSIZE];
    276      1.1    dyoung };
    277      1.1    dyoung 
    278  1.6.4.1     skrll /*
    279  1.6.4.1     skrll  * 802.11n variant of ieee80211_rateset.  Instead
    280  1.6.4.1     skrll  * legacy rates the entries are MCS rates.  We define
    281  1.6.4.1     skrll  * the structure such that it can be used interchangeably
    282  1.6.4.1     skrll  * with an ieee80211_rateset (modulo structure size).
    283  1.6.4.1     skrll  */
    284  1.6.4.1     skrll #define	IEEE80211_HTRATE_MAXSIZE 127
    285  1.6.4.1     skrll 
    286  1.6.4.1     skrll struct ieee80211_htrateset {
    287  1.6.4.1     skrll 	uint8_t			rs_nrates;
    288  1.6.4.1     skrll 	uint8_t			rs_rates[IEEE80211_HTRATE_MAXSIZE];
    289  1.6.4.1     skrll };
    290  1.6.4.1     skrll 
    291  1.6.4.1     skrll #define	IEEE80211_RATE_MCS	0x80
    292  1.6.4.1     skrll 
    293  1.6.4.1     skrll /*
    294  1.6.4.1     skrll  * Roaming state visible to user space.  There are two
    295  1.6.4.1     skrll  * thresholds that control whether roaming is considered;
    296  1.6.4.1     skrll  * when either is exceeded the 802.11 layer will check
    297  1.6.4.1     skrll  * the scan cache for another AP.  If the cache is stale
    298  1.6.4.1     skrll  * then a scan may be triggered.
    299  1.6.4.1     skrll  */
    300  1.6.4.1     skrll struct ieee80211_roam {
    301  1.6.4.1     skrll 	int8_t			rssi11a;	/* rssi thresh for 11a bss */
    302  1.6.4.1     skrll 	int8_t			rssi11b;	/* for 11g sta in 11b bss */
    303  1.6.4.1     skrll 	int8_t			rssi11bOnly;	/* for 11b sta */
    304  1.6.4.1     skrll 	uint8_t			pad1;
    305  1.6.4.1     skrll 	uint8_t			rate11a;	/* rate thresh for 11a bss */
    306  1.6.4.1     skrll 	uint8_t			rate11b;	/* for 11g sta in 11b bss */
    307  1.6.4.1     skrll 	uint8_t			rate11bOnly;	/* for 11b sta */
    308  1.6.4.1     skrll 	uint8_t			pad2;
    309  1.6.4.1     skrll };
    310      1.3      elad #endif /* !_NET80211__IEEE80211_H_ */
    311