Home | History | Annotate | Line # | Download | only in net80211
_ieee80211.h revision 1.10.38.2
      1  1.10.38.2      phil /*	$NetBSD: _ieee80211.h,v 1.10.38.2 2018/06/28 21:23:01 phil Exp $ */
      2  1.10.38.2      phil 
      3        1.1    dyoung /*-
      4  1.10.38.1      phil  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
      5  1.10.38.1      phil  *
      6        1.1    dyoung  * Copyright (c) 2001 Atsushi Onoe
      7  1.10.38.1      phil  * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
      8        1.1    dyoung  * All rights reserved.
      9        1.1    dyoung  *
     10        1.1    dyoung  * Redistribution and use in source and binary forms, with or without
     11        1.1    dyoung  * modification, are permitted provided that the following conditions
     12        1.1    dyoung  * are met:
     13        1.1    dyoung  * 1. Redistributions of source code must retain the above copyright
     14        1.1    dyoung  *    notice, this list of conditions and the following disclaimer.
     15        1.1    dyoung  * 2. Redistributions in binary form must reproduce the above copyright
     16        1.1    dyoung  *    notice, this list of conditions and the following disclaimer in the
     17        1.1    dyoung  *    documentation and/or other materials provided with the distribution.
     18        1.1    dyoung  *
     19        1.1    dyoung  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     20        1.1    dyoung  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     21        1.1    dyoung  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     22        1.1    dyoung  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     23        1.1    dyoung  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     24        1.1    dyoung  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     25        1.1    dyoung  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     26        1.1    dyoung  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     27        1.1    dyoung  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     28        1.1    dyoung  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     29        1.1    dyoung  *
     30  1.10.38.1      phil  * $FreeBSD$
     31        1.1    dyoung  */
     32        1.1    dyoung #ifndef _NET80211__IEEE80211_H_
     33        1.1    dyoung #define _NET80211__IEEE80211_H_
     34        1.1    dyoung 
     35  1.10.38.1      phil /*
     36  1.10.38.1      phil  * 802.11 implementation definitions.
     37  1.10.38.1      phil  *
     38  1.10.38.1      phil  * NB: this file is used by applications.
     39  1.10.38.1      phil  */
     40  1.10.38.1      phil 
     41  1.10.38.1      phil /*
     42  1.10.38.1      phil  * PHY type; mostly used to identify FH phys.
     43  1.10.38.1      phil  */
     44        1.1    dyoung enum ieee80211_phytype {
     45        1.1    dyoung 	IEEE80211_T_DS,			/* direct sequence spread spectrum */
     46        1.1    dyoung 	IEEE80211_T_FH,			/* frequency hopping */
     47        1.1    dyoung 	IEEE80211_T_OFDM,		/* frequency division multiplexing */
     48  1.10.38.1      phil 	IEEE80211_T_TURBO,		/* high rate OFDM, aka turbo mode */
     49  1.10.38.1      phil 	IEEE80211_T_HT,			/* high throughput */
     50  1.10.38.1      phil 	IEEE80211_T_OFDM_HALF,		/* 1/2 rate OFDM */
     51  1.10.38.1      phil 	IEEE80211_T_OFDM_QUARTER,	/* 1/4 rate OFDM */
     52  1.10.38.1      phil 	IEEE80211_T_VHT,		/* VHT PHY */
     53        1.1    dyoung };
     54        1.1    dyoung #define	IEEE80211_T_CCK	IEEE80211_T_DS	/* more common nomenclature */
     55        1.1    dyoung 
     56  1.10.38.1      phil /*
     57  1.10.38.1      phil  * PHY mode; this is not really a mode as multi-mode devices
     58  1.10.38.1      phil  * have multiple PHY's.  Mode is mostly used as a shorthand
     59  1.10.38.1      phil  * for constraining which channels to consider in setting up
     60  1.10.38.1      phil  * operation.  Modes used to be used more extensively when
     61  1.10.38.1      phil  * channels were identified as IEEE channel numbers.
     62  1.10.38.1      phil  */
     63        1.1    dyoung enum ieee80211_phymode {
     64        1.1    dyoung 	IEEE80211_MODE_AUTO	= 0,	/* autoselect */
     65        1.1    dyoung 	IEEE80211_MODE_11A	= 1,	/* 5GHz, OFDM */
     66        1.1    dyoung 	IEEE80211_MODE_11B	= 2,	/* 2GHz, CCK */
     67        1.1    dyoung 	IEEE80211_MODE_11G	= 3,	/* 2GHz, OFDM */
     68        1.1    dyoung 	IEEE80211_MODE_FH	= 4,	/* 2GHz, GFSK */
     69        1.1    dyoung 	IEEE80211_MODE_TURBO_A	= 5,	/* 5GHz, OFDM, 2x clock */
     70  1.10.38.1      phil 	IEEE80211_MODE_TURBO_G	= 6,	/* 2GHz, OFDM, 2x clock */
     71  1.10.38.1      phil 	IEEE80211_MODE_STURBO_A	= 7,	/* 5GHz, OFDM, 2x clock, static */
     72  1.10.38.1      phil 	IEEE80211_MODE_11NA	= 8,	/* 5GHz, w/ HT */
     73  1.10.38.1      phil 	IEEE80211_MODE_11NG	= 9,	/* 2GHz, w/ HT */
     74  1.10.38.1      phil 	IEEE80211_MODE_HALF	= 10,	/* OFDM, 1/2x clock */
     75  1.10.38.1      phil 	IEEE80211_MODE_QUARTER	= 11,	/* OFDM, 1/4x clock */
     76  1.10.38.1      phil 	IEEE80211_MODE_VHT_2GHZ	= 12,	/* 2GHz, VHT */
     77  1.10.38.1      phil 	IEEE80211_MODE_VHT_5GHZ	= 13,	/* 5GHz, VHT */
     78        1.1    dyoung };
     79  1.10.38.1      phil #define	IEEE80211_MODE_MAX	(IEEE80211_MODE_VHT_5GHZ+1)
     80  1.10.38.1      phil #define	IEEE80211_MODE_BYTES	howmany(IEEE80211_MODE_MAX, NBBY)
     81        1.1    dyoung 
     82  1.10.38.1      phil /*
     83  1.10.38.1      phil  * Operating mode.  Devices do not necessarily support
     84  1.10.38.1      phil  * all modes; they indicate which are supported in their
     85  1.10.38.1      phil  * capabilities.
     86  1.10.38.1      phil  */
     87        1.1    dyoung enum ieee80211_opmode {
     88        1.1    dyoung 	IEEE80211_M_IBSS 	= 0,	/* IBSS (adhoc) station */
     89  1.10.38.1      phil 	IEEE80211_M_STA		= 1,	/* infrastructure station */
     90  1.10.38.1      phil 	IEEE80211_M_WDS		= 2,	/* WDS link */
     91        1.1    dyoung 	IEEE80211_M_AHDEMO	= 3,	/* Old lucent compatible adhoc demo */
     92  1.10.38.1      phil 	IEEE80211_M_HOSTAP	= 4,	/* Software Access Point */
     93  1.10.38.1      phil 	IEEE80211_M_MONITOR	= 5,	/* Monitor mode */
     94  1.10.38.1      phil 	IEEE80211_M_MBSS	= 6,	/* MBSS (Mesh Point) link */
     95        1.1    dyoung };
     96  1.10.38.1      phil #define	IEEE80211_OPMODE_MAX	(IEEE80211_M_MBSS+1)
     97        1.1    dyoung 
     98        1.1    dyoung /*
     99  1.10.38.1      phil  * 802.11g/802.11n protection mode.
    100        1.1    dyoung  */
    101        1.1    dyoung enum ieee80211_protmode {
    102        1.1    dyoung 	IEEE80211_PROT_NONE	= 0,	/* no protection */
    103        1.1    dyoung 	IEEE80211_PROT_CTSONLY	= 1,	/* CTS to self */
    104  1.10.38.1      phil 	IEEE80211_PROT_RTSCTS	= 2,	/* RTS-CTS */
    105        1.1    dyoung };
    106        1.1    dyoung 
    107        1.1    dyoung /*
    108  1.10.38.1      phil  * Authentication mode.  The open and shared key authentication
    109  1.10.38.1      phil  * modes are implemented within the 802.11 layer.  802.1x and
    110  1.10.38.1      phil  * WPA/802.11i are implemented in user mode by setting the
    111  1.10.38.1      phil  * 802.11 layer into IEEE80211_AUTH_8021X and deferring
    112  1.10.38.1      phil  * authentication to user space programs.
    113        1.1    dyoung  */
    114        1.1    dyoung enum ieee80211_authmode {
    115        1.1    dyoung 	IEEE80211_AUTH_NONE	= 0,
    116        1.1    dyoung 	IEEE80211_AUTH_OPEN	= 1,		/* open */
    117        1.1    dyoung 	IEEE80211_AUTH_SHARED	= 2,		/* shared-key */
    118        1.1    dyoung 	IEEE80211_AUTH_8021X	= 3,		/* 802.1x */
    119        1.1    dyoung 	IEEE80211_AUTH_AUTO	= 4,		/* auto-select/accept */
    120        1.1    dyoung 	/* NB: these are used only for ioctls */
    121  1.10.38.1      phil 	IEEE80211_AUTH_WPA	= 5,		/* WPA/RSN w/ 802.1x/PSK */
    122        1.1    dyoung };
    123        1.1    dyoung 
    124        1.1    dyoung /*
    125        1.1    dyoung  * Roaming mode is effectively who controls the operation
    126        1.1    dyoung  * of the 802.11 state machine when operating as a station.
    127        1.1    dyoung  * State transitions are controlled either by the driver
    128        1.1    dyoung  * (typically when management frames are processed by the
    129        1.1    dyoung  * hardware/firmware), the host (auto/normal operation of
    130        1.1    dyoung  * the 802.11 layer), or explicitly through ioctl requests
    131        1.1    dyoung  * when applications like wpa_supplicant want control.
    132        1.1    dyoung  */
    133        1.1    dyoung enum ieee80211_roamingmode {
    134        1.1    dyoung 	IEEE80211_ROAMING_DEVICE= 0,	/* driver/hardware control */
    135        1.1    dyoung 	IEEE80211_ROAMING_AUTO	= 1,	/* 802.11 layer control */
    136  1.10.38.1      phil 	IEEE80211_ROAMING_MANUAL= 2,	/* application control */
    137        1.1    dyoung };
    138        1.1    dyoung 
    139        1.1    dyoung /*
    140        1.1    dyoung  * Channels are specified by frequency and attributes.
    141        1.1    dyoung  */
    142        1.1    dyoung struct ieee80211_channel {
    143  1.10.38.1      phil 	uint32_t	ic_flags;	/* see below */
    144  1.10.38.1      phil 	uint16_t	ic_freq;	/* primary centre frequency in MHz */
    145  1.10.38.1      phil 	uint8_t		ic_ieee;	/* IEEE channel number */
    146  1.10.38.1      phil 	int8_t		ic_maxregpower;	/* maximum regulatory tx power in dBm */
    147  1.10.38.1      phil 	int8_t		ic_maxpower;	/* maximum tx power in .5 dBm */
    148  1.10.38.1      phil 	int8_t		ic_minpower;	/* minimum tx power in .5 dBm */
    149  1.10.38.1      phil 	uint8_t		ic_state;	/* dynamic state */
    150  1.10.38.1      phil 	uint8_t		ic_extieee;	/* HT40 extension channel number */
    151  1.10.38.1      phil 	int8_t		ic_maxantgain;	/* maximum antenna gain in .5 dBm */
    152  1.10.38.1      phil 	uint8_t		ic_pad;
    153  1.10.38.1      phil 	uint16_t	ic_devdata;	/* opaque device/driver data */
    154  1.10.38.1      phil 	uint8_t		ic_vht_ch_freq1; /* VHT primary freq1 IEEE value */
    155  1.10.38.1      phil 	uint8_t		ic_vht_ch_freq2; /* VHT secondary 80MHz freq2 IEEE value */
    156  1.10.38.1      phil 	uint16_t	ic_freq2;	/* VHT secondary 80MHz freq2 MHz */
    157        1.1    dyoung };
    158        1.1    dyoung 
    159  1.10.38.1      phil /*
    160  1.10.38.1      phil  * Note: for VHT operation we will need significantly more than
    161  1.10.38.1      phil  * IEEE80211_CHAN_MAX channels because of the combinations of
    162  1.10.38.1      phil  * VHT20, VHT40, VHT80, VHT80+80 and VHT160.
    163  1.10.38.1      phil  */
    164  1.10.38.1      phil #define	IEEE80211_CHAN_MAX	1024
    165  1.10.38.1      phil #define	IEEE80211_CHAN_BYTES	howmany(IEEE80211_CHAN_MAX, NBBY)
    166        1.1    dyoung #define	IEEE80211_CHAN_ANY	0xffff	/* token for ``any channel'' */
    167  1.10.38.1      phil #define	IEEE80211_CHAN_ANYC \
    168  1.10.38.1      phil 	((struct ieee80211_channel *) IEEE80211_CHAN_ANY)
    169        1.1    dyoung 
    170        1.1    dyoung /* channel attributes */
    171  1.10.38.1      phil #define	IEEE80211_CHAN_PRIV0	0x00000001 /* driver private bit 0 */
    172  1.10.38.1      phil #define	IEEE80211_CHAN_PRIV1	0x00000002 /* driver private bit 1 */
    173  1.10.38.1      phil #define	IEEE80211_CHAN_PRIV2	0x00000004 /* driver private bit 2 */
    174  1.10.38.1      phil #define	IEEE80211_CHAN_PRIV3	0x00000008 /* driver private bit 3 */
    175  1.10.38.1      phil #define	IEEE80211_CHAN_TURBO	0x00000010 /* Turbo channel */
    176  1.10.38.1      phil #define	IEEE80211_CHAN_CCK	0x00000020 /* CCK channel */
    177  1.10.38.1      phil #define	IEEE80211_CHAN_OFDM	0x00000040 /* OFDM channel */
    178  1.10.38.1      phil #define	IEEE80211_CHAN_2GHZ	0x00000080 /* 2 GHz spectrum channel. */
    179  1.10.38.1      phil #define	IEEE80211_CHAN_5GHZ	0x00000100 /* 5 GHz spectrum channel */
    180  1.10.38.1      phil #define	IEEE80211_CHAN_PASSIVE	0x00000200 /* Only passive scan allowed */
    181  1.10.38.1      phil #define	IEEE80211_CHAN_DYN	0x00000400 /* Dynamic CCK-OFDM channel */
    182  1.10.38.1      phil #define	IEEE80211_CHAN_GFSK	0x00000800 /* GFSK channel (FHSS PHY) */
    183  1.10.38.1      phil #define	IEEE80211_CHAN_GSM	0x00001000 /* 900 MHz spectrum channel */
    184  1.10.38.1      phil #define	IEEE80211_CHAN_STURBO	0x00002000 /* 11a static turbo channel only */
    185  1.10.38.1      phil #define	IEEE80211_CHAN_HALF	0x00004000 /* Half rate channel */
    186  1.10.38.1      phil #define	IEEE80211_CHAN_QUARTER	0x00008000 /* Quarter rate channel */
    187  1.10.38.1      phil #define	IEEE80211_CHAN_HT20	0x00010000 /* HT 20 channel */
    188  1.10.38.1      phil #define	IEEE80211_CHAN_HT40U	0x00020000 /* HT 40 channel w/ ext above */
    189  1.10.38.1      phil #define	IEEE80211_CHAN_HT40D	0x00040000 /* HT 40 channel w/ ext below */
    190  1.10.38.1      phil #define	IEEE80211_CHAN_DFS	0x00080000 /* DFS required */
    191  1.10.38.1      phil #define	IEEE80211_CHAN_4MSXMIT	0x00100000 /* 4ms limit on frame length */
    192  1.10.38.1      phil #define	IEEE80211_CHAN_NOADHOC	0x00200000 /* adhoc mode not allowed */
    193  1.10.38.1      phil #define	IEEE80211_CHAN_NOHOSTAP	0x00400000 /* hostap mode not allowed */
    194  1.10.38.1      phil #define	IEEE80211_CHAN_11D	0x00800000 /* 802.11d required */
    195  1.10.38.1      phil #define	IEEE80211_CHAN_VHT20	0x01000000 /* VHT20 channel */
    196  1.10.38.1      phil #define	IEEE80211_CHAN_VHT40U	0x02000000 /* VHT40 channel, ext above */
    197  1.10.38.1      phil #define	IEEE80211_CHAN_VHT40D	0x04000000 /* VHT40 channel, ext below */
    198  1.10.38.1      phil #define	IEEE80211_CHAN_VHT80	0x08000000 /* VHT80 channel */
    199  1.10.38.1      phil #define	IEEE80211_CHAN_VHT80_80	0x10000000 /* VHT80+80 channel */
    200  1.10.38.1      phil #define	IEEE80211_CHAN_VHT160	0x20000000 /* VHT160 channel */
    201  1.10.38.1      phil /* XXX note: 0x80000000 is used in src/sbin/ifconfig/ifieee80211.c :( */
    202  1.10.38.1      phil 
    203  1.10.38.1      phil #define	IEEE80211_CHAN_HT40	(IEEE80211_CHAN_HT40U | IEEE80211_CHAN_HT40D)
    204  1.10.38.1      phil #define	IEEE80211_CHAN_HT	(IEEE80211_CHAN_HT20 | IEEE80211_CHAN_HT40)
    205  1.10.38.1      phil 
    206  1.10.38.1      phil #define	IEEE80211_CHAN_VHT40	(IEEE80211_CHAN_VHT40U | IEEE80211_CHAN_VHT40D)
    207  1.10.38.1      phil #define	IEEE80211_CHAN_VHT	(IEEE80211_CHAN_VHT20 | IEEE80211_CHAN_VHT40 \
    208  1.10.38.1      phil 				| IEEE80211_CHAN_VHT80 | IEEE80211_CHAN_VHT80_80 \
    209  1.10.38.1      phil 				| IEEE80211_CHAN_VHT160)
    210  1.10.38.1      phil 
    211  1.10.38.1      phil #define	IEEE80211_CHAN_BITS \
    212  1.10.38.1      phil 	"\20\1PRIV0\2PRIV2\3PRIV3\4PRIV4\5TURBO\6CCK\7OFDM\0102GHZ\0115GHZ" \
    213  1.10.38.1      phil 	"\12PASSIVE\13DYN\14GFSK\15GSM\16STURBO\17HALF\20QUARTER\21HT20" \
    214  1.10.38.1      phil 	"\22HT40U\23HT40D\24DFS\0254MSXMIT\26NOADHOC\27NOHOSTAP\03011D" \
    215  1.10.38.1      phil 	"\031VHT20\032VHT40U\033VHT40D\034VHT80\035VHT80_80\036VHT160"
    216        1.1    dyoung 
    217        1.1    dyoung /*
    218        1.1    dyoung  * Useful combinations of channel characteristics.
    219        1.1    dyoung  */
    220        1.1    dyoung #define	IEEE80211_CHAN_FHSS \
    221        1.1    dyoung 	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_GFSK)
    222        1.1    dyoung #define	IEEE80211_CHAN_A \
    223        1.1    dyoung 	(IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM)
    224        1.1    dyoung #define	IEEE80211_CHAN_B \
    225        1.1    dyoung 	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_CCK)
    226        1.1    dyoung #define	IEEE80211_CHAN_PUREG \
    227        1.1    dyoung 	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM)
    228        1.1    dyoung #define	IEEE80211_CHAN_G \
    229        1.1    dyoung 	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN)
    230  1.10.38.1      phil #define IEEE80211_CHAN_108A \
    231  1.10.38.1      phil 	(IEEE80211_CHAN_A | IEEE80211_CHAN_TURBO)
    232        1.1    dyoung #define	IEEE80211_CHAN_108G \
    233  1.10.38.1      phil 	(IEEE80211_CHAN_PUREG | IEEE80211_CHAN_TURBO)
    234  1.10.38.1      phil #define	IEEE80211_CHAN_ST \
    235  1.10.38.1      phil 	(IEEE80211_CHAN_108A | IEEE80211_CHAN_STURBO)
    236        1.1    dyoung 
    237        1.4    dyoung #define	IEEE80211_CHAN_ALL \
    238        1.4    dyoung 	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_GFSK | \
    239  1.10.38.1      phil 	 IEEE80211_CHAN_CCK | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_DYN | \
    240  1.10.38.1      phil 	 IEEE80211_CHAN_HALF | IEEE80211_CHAN_QUARTER | \
    241  1.10.38.1      phil 	 IEEE80211_CHAN_HT | IEEE80211_CHAN_VHT)
    242        1.4    dyoung #define	IEEE80211_CHAN_ALLTURBO \
    243  1.10.38.1      phil 	(IEEE80211_CHAN_ALL | IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO)
    244        1.4    dyoung 
    245  1.10.38.1      phil #define	IEEE80211_IS_CHAN_FHSS(_c) \
    246  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_FHSS) == IEEE80211_CHAN_FHSS)
    247  1.10.38.1      phil #define	IEEE80211_IS_CHAN_A(_c) \
    248  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_A) == IEEE80211_CHAN_A)
    249  1.10.38.1      phil #define	IEEE80211_IS_CHAN_B(_c) \
    250  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_B) == IEEE80211_CHAN_B)
    251  1.10.38.1      phil #define	IEEE80211_IS_CHAN_PUREG(_c) \
    252  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_PUREG) == IEEE80211_CHAN_PUREG)
    253  1.10.38.1      phil #define	IEEE80211_IS_CHAN_G(_c) \
    254  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G)
    255  1.10.38.1      phil #define	IEEE80211_IS_CHAN_ANYG(_c) \
    256  1.10.38.1      phil 	(IEEE80211_IS_CHAN_PUREG(_c) || IEEE80211_IS_CHAN_G(_c))
    257  1.10.38.1      phil #define	IEEE80211_IS_CHAN_ST(_c) \
    258  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_ST) == IEEE80211_CHAN_ST)
    259  1.10.38.1      phil #define	IEEE80211_IS_CHAN_108A(_c) \
    260  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_108A) == IEEE80211_CHAN_108A)
    261  1.10.38.1      phil #define	IEEE80211_IS_CHAN_108G(_c) \
    262  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_108G) == IEEE80211_CHAN_108G)
    263  1.10.38.1      phil 
    264  1.10.38.1      phil #define	IEEE80211_IS_CHAN_2GHZ(_c) \
    265  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_2GHZ) != 0)
    266  1.10.38.1      phil #define	IEEE80211_IS_CHAN_5GHZ(_c) \
    267  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_5GHZ) != 0)
    268  1.10.38.1      phil #define	IEEE80211_IS_CHAN_PASSIVE(_c) \
    269  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_PASSIVE) != 0)
    270  1.10.38.1      phil #define	IEEE80211_IS_CHAN_OFDM(_c) \
    271  1.10.38.1      phil 	(((_c)->ic_flags & (IEEE80211_CHAN_OFDM | IEEE80211_CHAN_DYN)) != 0)
    272  1.10.38.1      phil #define	IEEE80211_IS_CHAN_CCK(_c) \
    273  1.10.38.1      phil 	(((_c)->ic_flags & (IEEE80211_CHAN_CCK | IEEE80211_CHAN_DYN)) != 0)
    274  1.10.38.1      phil #define	IEEE80211_IS_CHAN_DYN(_c) \
    275  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_DYN) == IEEE80211_CHAN_DYN)
    276  1.10.38.1      phil #define	IEEE80211_IS_CHAN_GFSK(_c) \
    277  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_GFSK) != 0)
    278  1.10.38.1      phil #define	IEEE80211_IS_CHAN_TURBO(_c) \
    279  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_TURBO) != 0)
    280  1.10.38.1      phil #define	IEEE80211_IS_CHAN_STURBO(_c) \
    281  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_STURBO) != 0)
    282  1.10.38.1      phil #define	IEEE80211_IS_CHAN_DTURBO(_c) \
    283  1.10.38.1      phil 	(((_c)->ic_flags & \
    284  1.10.38.1      phil 	(IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO)) == IEEE80211_CHAN_TURBO)
    285  1.10.38.1      phil #define	IEEE80211_IS_CHAN_HALF(_c) \
    286  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_HALF) != 0)
    287  1.10.38.1      phil #define	IEEE80211_IS_CHAN_QUARTER(_c) \
    288  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_QUARTER) != 0)
    289        1.6  degroote #define	IEEE80211_IS_CHAN_FULL(_c) \
    290  1.10.38.1      phil 	(((_c)->ic_flags & (IEEE80211_CHAN_QUARTER | IEEE80211_CHAN_HALF)) == 0)
    291  1.10.38.1      phil #define	IEEE80211_IS_CHAN_GSM(_c) \
    292  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_GSM) != 0)
    293  1.10.38.1      phil #define	IEEE80211_IS_CHAN_HT(_c) \
    294  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_HT) != 0)
    295  1.10.38.1      phil #define	IEEE80211_IS_CHAN_HT20(_c) \
    296  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_HT20) != 0)
    297  1.10.38.1      phil #define	IEEE80211_IS_CHAN_HT40(_c) \
    298  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_HT40) != 0)
    299  1.10.38.1      phil #define	IEEE80211_IS_CHAN_HT40U(_c) \
    300  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_HT40U) != 0)
    301  1.10.38.1      phil #define	IEEE80211_IS_CHAN_HT40D(_c) \
    302  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_HT40D) != 0)
    303  1.10.38.1      phil #define	IEEE80211_IS_CHAN_HTA(_c) \
    304  1.10.38.1      phil 	(IEEE80211_IS_CHAN_5GHZ(_c) && \
    305  1.10.38.1      phil 	 ((_c)->ic_flags & IEEE80211_CHAN_HT) != 0)
    306  1.10.38.1      phil #define	IEEE80211_IS_CHAN_HTG(_c) \
    307  1.10.38.1      phil 	(IEEE80211_IS_CHAN_2GHZ(_c) && \
    308  1.10.38.1      phil 	 ((_c)->ic_flags & IEEE80211_CHAN_HT) != 0)
    309  1.10.38.1      phil #define	IEEE80211_IS_CHAN_DFS(_c) \
    310  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_DFS) != 0)
    311  1.10.38.1      phil #define	IEEE80211_IS_CHAN_NOADHOC(_c) \
    312  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_NOADHOC) != 0)
    313  1.10.38.1      phil #define	IEEE80211_IS_CHAN_NOHOSTAP(_c) \
    314  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_NOHOSTAP) != 0)
    315  1.10.38.1      phil #define	IEEE80211_IS_CHAN_11D(_c) \
    316  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_11D) != 0)
    317  1.10.38.1      phil 
    318  1.10.38.1      phil #define	IEEE80211_IS_CHAN_VHT(_c) \
    319  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0)
    320  1.10.38.1      phil #define	IEEE80211_IS_CHAN_VHT_2GHZ(_c) \
    321  1.10.38.1      phil 	(IEEE80211_IS_CHAN_2GHZ(_c) && \
    322  1.10.38.1      phil 	 ((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0)
    323  1.10.38.1      phil #define	IEEE80211_IS_CHAN_VHT_5GHZ(_c) \
    324  1.10.38.1      phil 	(IEEE80211_IS_CHAN_5GHZ(_c) && \
    325  1.10.38.1      phil 	 ((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0)
    326  1.10.38.1      phil #define	IEEE80211_IS_CHAN_VHT20(_c) \
    327  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_VHT20) != 0)
    328  1.10.38.1      phil #define	IEEE80211_IS_CHAN_VHT40(_c) \
    329  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_VHT40) != 0)
    330  1.10.38.1      phil #define	IEEE80211_IS_CHAN_VHT40U(_c) \
    331  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_VHT40U) != 0)
    332  1.10.38.1      phil #define	IEEE80211_IS_CHAN_VHT40D(_c) \
    333  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_VHT40D) != 0)
    334  1.10.38.1      phil #define	IEEE80211_IS_CHAN_VHTA(_c) \
    335  1.10.38.1      phil 	(IEEE80211_IS_CHAN_5GHZ(_c) && \
    336  1.10.38.1      phil 	 ((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0)
    337  1.10.38.1      phil #define	IEEE80211_IS_CHAN_VHTG(_c) \
    338  1.10.38.1      phil 	(IEEE80211_IS_CHAN_2GHZ(_c) && \
    339  1.10.38.1      phil 	 ((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0)
    340  1.10.38.1      phil #define	IEEE80211_IS_CHAN_VHT80(_c) \
    341  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_VHT80) != 0)
    342  1.10.38.1      phil #define	IEEE80211_IS_CHAN_VHT80_80(_c) \
    343  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_VHT80_80) != 0)
    344  1.10.38.1      phil #define	IEEE80211_IS_CHAN_VHT160(_c) \
    345  1.10.38.1      phil 	(((_c)->ic_flags & IEEE80211_CHAN_VHT160) != 0)
    346  1.10.38.1      phil 
    347  1.10.38.1      phil #define	IEEE80211_CHAN2IEEE(_c)		(_c)->ic_ieee
    348  1.10.38.1      phil 
    349  1.10.38.1      phil /* dynamic state */
    350  1.10.38.1      phil #define	IEEE80211_CHANSTATE_RADAR	0x01	/* radar detected */
    351  1.10.38.1      phil #define	IEEE80211_CHANSTATE_CACDONE	0x02	/* CAC completed */
    352  1.10.38.1      phil #define	IEEE80211_CHANSTATE_CWINT	0x04	/* interference detected */
    353  1.10.38.1      phil #define	IEEE80211_CHANSTATE_NORADAR	0x10	/* post notify on radar clear */
    354  1.10.38.1      phil 
    355  1.10.38.1      phil #define	IEEE80211_IS_CHAN_RADAR(_c) \
    356  1.10.38.1      phil 	(((_c)->ic_state & IEEE80211_CHANSTATE_RADAR) != 0)
    357  1.10.38.1      phil #define	IEEE80211_IS_CHAN_CACDONE(_c) \
    358  1.10.38.1      phil 	(((_c)->ic_state & IEEE80211_CHANSTATE_CACDONE) != 0)
    359  1.10.38.1      phil #define	IEEE80211_IS_CHAN_CWINT(_c) \
    360  1.10.38.1      phil 	(((_c)->ic_state & IEEE80211_CHANSTATE_CWINT) != 0)
    361        1.1    dyoung 
    362        1.1    dyoung /* ni_chan encoding for FH phy */
    363        1.1    dyoung #define	IEEE80211_FH_CHANMOD	80
    364        1.1    dyoung #define	IEEE80211_FH_CHAN(set,pat)	(((set)-1)*IEEE80211_FH_CHANMOD+(pat))
    365        1.1    dyoung #define	IEEE80211_FH_CHANSET(chan)	((chan)/IEEE80211_FH_CHANMOD+1)
    366        1.1    dyoung #define	IEEE80211_FH_CHANPAT(chan)	((chan)%IEEE80211_FH_CHANMOD)
    367        1.1    dyoung 
    368  1.10.38.1      phil #define	IEEE80211_TID_SIZE	(WME_NUM_TID+1)	/* WME TID's +1 for non-QoS */
    369  1.10.38.1      phil #define	IEEE80211_NONQOS_TID	WME_NUM_TID	/* index for non-QoS sta */
    370  1.10.38.1      phil 
    371  1.10.38.1      phil /*
    372  1.10.38.1      phil  * The 802.11 spec says at most 2007 stations may be
    373  1.10.38.1      phil  * associated at once.  For most AP's this is way more
    374  1.10.38.1      phil  * than is feasible so we use a default of 128.  This
    375  1.10.38.1      phil  * number may be overridden by the driver and/or by
    376  1.10.38.1      phil  * user configuration but may not be less than IEEE80211_AID_MIN.
    377  1.10.38.1      phil  */
    378  1.10.38.1      phil #define	IEEE80211_AID_DEF		128
    379  1.10.38.1      phil #define	IEEE80211_AID_MIN		16
    380  1.10.38.1      phil 
    381        1.1    dyoung /*
    382        1.1    dyoung  * 802.11 rate set.
    383        1.1    dyoung  */
    384        1.1    dyoung #define	IEEE80211_RATE_SIZE	8		/* 802.11 standard */
    385        1.1    dyoung #define	IEEE80211_RATE_MAXSIZE	15		/* max rates we'll handle */
    386        1.1    dyoung 
    387        1.1    dyoung struct ieee80211_rateset {
    388  1.10.38.1      phil 	uint8_t		rs_nrates;
    389  1.10.38.1      phil 	uint8_t		rs_rates[IEEE80211_RATE_MAXSIZE];
    390        1.1    dyoung };
    391        1.1    dyoung 
    392  1.10.38.1      phil /*
    393  1.10.38.1      phil  * 802.11n variant of ieee80211_rateset.  Instead of
    394  1.10.38.1      phil  * legacy rates the entries are MCS rates.  We define
    395  1.10.38.1      phil  * the structure such that it can be used interchangeably
    396  1.10.38.1      phil  * with an ieee80211_rateset (modulo structure size).
    397  1.10.38.1      phil  */
    398  1.10.38.1      phil #define	IEEE80211_HTRATE_MAXSIZE	77
    399  1.10.38.1      phil 
    400  1.10.38.1      phil struct ieee80211_htrateset {
    401  1.10.38.1      phil 	uint8_t		rs_nrates;
    402  1.10.38.1      phil 	uint8_t		rs_rates[IEEE80211_HTRATE_MAXSIZE];
    403  1.10.38.1      phil };
    404  1.10.38.1      phil 
    405  1.10.38.1      phil #define	IEEE80211_RATE_MCS	0x80
    406  1.10.38.1      phil 
    407  1.10.38.1      phil /*
    408  1.10.38.1      phil  * Per-mode transmit parameters/controls visible to user space.
    409  1.10.38.1      phil  * These can be used to set fixed transmit rate for all operating
    410  1.10.38.1      phil  * modes or on a per-client basis according to the capabilities
    411  1.10.38.1      phil  * of the client (e.g. an 11b client associated to an 11g ap).
    412  1.10.38.1      phil  *
    413  1.10.38.1      phil  * MCS are distinguished from legacy rates by or'ing in 0x80.
    414  1.10.38.1      phil  */
    415  1.10.38.1      phil struct ieee80211_txparam {
    416  1.10.38.1      phil 	uint8_t		ucastrate;	/* ucast data rate (legacy/MCS|0x80) */
    417  1.10.38.1      phil 	uint8_t		mgmtrate;	/* mgmt frame rate (legacy/MCS|0x80) */
    418  1.10.38.1      phil 	uint8_t		mcastrate;	/* multicast rate (legacy/MCS|0x80) */
    419  1.10.38.1      phil 	uint8_t		maxretry;	/* max unicast data retry count */
    420  1.10.38.1      phil };
    421  1.10.38.1      phil 
    422  1.10.38.1      phil /*
    423  1.10.38.1      phil  * Per-mode roaming state visible to user space.  There are two
    424  1.10.38.1      phil  * thresholds that control whether roaming is considered; when
    425  1.10.38.1      phil  * either is exceeded the 802.11 layer will check the scan cache
    426  1.10.38.1      phil  * for another AP.  If the cache is stale then a scan may be
    427  1.10.38.1      phil  * triggered.
    428  1.10.38.1      phil  */
    429  1.10.38.1      phil struct ieee80211_roamparam {
    430  1.10.38.1      phil 	int8_t		rssi;		/* rssi thresh (.5 dBm) */
    431  1.10.38.1      phil 	uint8_t		rate;		/* tx rate thresh (.5 Mb/s or MCS) */
    432  1.10.38.1      phil 	uint16_t	pad;		/* reserve */
    433  1.10.38.1      phil };
    434  1.10.38.1      phil 
    435  1.10.38.1      phil /*
    436  1.10.38.1      phil  * Regulatory Information.
    437  1.10.38.1      phil  */
    438  1.10.38.1      phil struct ieee80211_regdomain {
    439  1.10.38.1      phil 	uint16_t	regdomain;	/* SKU */
    440  1.10.38.1      phil 	uint16_t	country;	/* ISO country code */
    441  1.10.38.1      phil 	uint8_t		location;	/* I (indoor), O (outdoor), other */
    442  1.10.38.1      phil 	uint8_t		ecm;		/* Extended Channel Mode */
    443  1.10.38.1      phil 	char		isocc[2];	/* country code string */
    444  1.10.38.1      phil 	short		pad[2];
    445  1.10.38.1      phil };
    446  1.10.38.1      phil 
    447  1.10.38.1      phil /*
    448  1.10.38.1      phil  * MIMO antenna/radio state.
    449  1.10.38.1      phil  */
    450  1.10.38.1      phil #define	IEEE80211_MAX_CHAINS		4
    451  1.10.38.1      phil /*
    452  1.10.38.1      phil  * This is the number of sub-channels for a channel.
    453  1.10.38.1      phil  * 0 - pri20
    454  1.10.38.1      phil  * 1 - sec20 (HT40, VHT40)
    455  1.10.38.1      phil  * 2 - sec40 (VHT80)
    456  1.10.38.1      phil  * 3 - sec80 (VHT80+80, VHT160)
    457  1.10.38.1      phil  */
    458  1.10.38.1      phil #define	IEEE80211_MAX_CHAIN_PRISEC	4
    459  1.10.38.1      phil #define	IEEE80211_MAX_EVM_DWORDS	16	/* 16 pilots, 4 chains */
    460  1.10.38.1      phil #define	IEEE80211_MAX_EVM_PILOTS	16	/* 468 subcarriers, 16 pilots */
    461  1.10.38.1      phil 
    462  1.10.38.1      phil struct ieee80211_mimo_chan_info {
    463  1.10.38.1      phil 	int8_t	rssi[IEEE80211_MAX_CHAIN_PRISEC];
    464  1.10.38.1      phil 	int8_t	noise[IEEE80211_MAX_CHAIN_PRISEC];
    465  1.10.38.1      phil };
    466  1.10.38.1      phil 
    467  1.10.38.1      phil struct ieee80211_mimo_info {
    468  1.10.38.1      phil 	struct ieee80211_mimo_chan_info ch[IEEE80211_MAX_CHAINS];
    469  1.10.38.1      phil 	uint32_t	evm[IEEE80211_MAX_EVM_DWORDS];
    470  1.10.38.1      phil };
    471  1.10.38.1      phil 
    472  1.10.38.1      phil /*
    473  1.10.38.1      phil  * ic_caps/iv_caps: device driver capabilities
    474  1.10.38.1      phil  */
    475  1.10.38.1      phil /* 0x2e available */
    476  1.10.38.1      phil #define	IEEE80211_C_STA		0x00000001	/* CAPABILITY: STA available */
    477  1.10.38.1      phil #define	IEEE80211_C_8023ENCAP	0x00000002	/* CAPABILITY: 802.3 encap */
    478  1.10.38.1      phil #define	IEEE80211_C_FF		0x00000040	/* CAPABILITY: ATH FF avail */
    479  1.10.38.1      phil #define	IEEE80211_C_TURBOP	0x00000080	/* CAPABILITY: ATH Turbo avail*/
    480  1.10.38.1      phil #define	IEEE80211_C_IBSS	0x00000100	/* CAPABILITY: IBSS available */
    481  1.10.38.1      phil #define	IEEE80211_C_PMGT	0x00000200	/* CAPABILITY: Power mgmt */
    482  1.10.38.1      phil #define	IEEE80211_C_HOSTAP	0x00000400	/* CAPABILITY: HOSTAP avail */
    483  1.10.38.1      phil #define	IEEE80211_C_AHDEMO	0x00000800	/* CAPABILITY: Old Adhoc Demo */
    484  1.10.38.1      phil #define	IEEE80211_C_SWRETRY	0x00001000	/* CAPABILITY: sw tx retry */
    485  1.10.38.1      phil #define	IEEE80211_C_TXPMGT	0x00002000	/* CAPABILITY: tx power mgmt */
    486  1.10.38.1      phil #define	IEEE80211_C_SHSLOT	0x00004000	/* CAPABILITY: short slottime */
    487  1.10.38.1      phil #define	IEEE80211_C_SHPREAMBLE	0x00008000	/* CAPABILITY: short preamble */
    488  1.10.38.1      phil #define	IEEE80211_C_MONITOR	0x00010000	/* CAPABILITY: monitor mode */
    489  1.10.38.1      phil #define	IEEE80211_C_DFS		0x00020000	/* CAPABILITY: DFS/radar avail*/
    490  1.10.38.1      phil #define	IEEE80211_C_MBSS	0x00040000	/* CAPABILITY: MBSS available */
    491  1.10.38.1      phil #define	IEEE80211_C_SWSLEEP	0x00080000	/* CAPABILITY: do sleep here */
    492  1.10.38.1      phil #define	IEEE80211_C_SWAMSDUTX	0x00100000	/* CAPABILITY: software A-MSDU TX */
    493  1.10.38.1      phil /* 0x7c0000 available */
    494  1.10.38.1      phil #define	IEEE80211_C_WPA1	0x00800000	/* CAPABILITY: WPA1 avail */
    495  1.10.38.1      phil #define	IEEE80211_C_WPA2	0x01000000	/* CAPABILITY: WPA2 avail */
    496  1.10.38.1      phil #define	IEEE80211_C_WPA		0x01800000	/* CAPABILITY: WPA1+WPA2 avail*/
    497  1.10.38.1      phil #define	IEEE80211_C_BURST	0x02000000	/* CAPABILITY: frame bursting */
    498  1.10.38.1      phil #define	IEEE80211_C_WME		0x04000000	/* CAPABILITY: WME avail */
    499  1.10.38.1      phil #define	IEEE80211_C_WDS		0x08000000	/* CAPABILITY: 4-addr support */
    500  1.10.38.1      phil /* 0x10000000 reserved */
    501  1.10.38.1      phil #define	IEEE80211_C_BGSCAN	0x20000000	/* CAPABILITY: bg scanning */
    502  1.10.38.1      phil #define	IEEE80211_C_TXFRAG	0x40000000	/* CAPABILITY: tx fragments */
    503  1.10.38.1      phil #define	IEEE80211_C_TDMA	0x80000000	/* CAPABILITY: TDMA avail */
    504  1.10.38.1      phil /* XXX protection/barker? */
    505  1.10.38.1      phil 
    506  1.10.38.1      phil #define	IEEE80211_C_OPMODE \
    507  1.10.38.1      phil 	(IEEE80211_C_STA | IEEE80211_C_IBSS | IEEE80211_C_HOSTAP | \
    508  1.10.38.1      phil 	 IEEE80211_C_AHDEMO | IEEE80211_C_MONITOR | IEEE80211_C_WDS | \
    509  1.10.38.1      phil 	 IEEE80211_C_TDMA | IEEE80211_C_MBSS)
    510  1.10.38.1      phil 
    511  1.10.38.1      phil #define	IEEE80211_C_BITS \
    512  1.10.38.1      phil 	"\20\1STA\002803ENCAP\7FF\10TURBOP\11IBSS\12PMGT" \
    513  1.10.38.1      phil 	"\13HOSTAP\14AHDEMO\15SWRETRY\16TXPMGT\17SHSLOT\20SHPREAMBLE" \
    514  1.10.38.1      phil 	"\21MONITOR\22DFS\23MBSS\30WPA1\31WPA2\32BURST\33WME\34WDS\36BGSCAN" \
    515  1.10.38.1      phil 	"\37TXFRAG\40TDMA"
    516  1.10.38.1      phil 
    517  1.10.38.1      phil /*
    518  1.10.38.1      phil  * ic_htcaps/iv_htcaps: HT-specific device/driver capabilities
    519  1.10.38.1      phil  *
    520  1.10.38.1      phil  * NB: the low 16-bits are the 802.11 definitions, the upper
    521  1.10.38.1      phil  *     16-bits are used to define s/w/driver capabilities.
    522  1.10.38.1      phil  */
    523  1.10.38.1      phil #define	IEEE80211_HTC_AMPDU	0x00010000	/* CAPABILITY: A-MPDU tx */
    524  1.10.38.1      phil #define	IEEE80211_HTC_AMSDU	0x00020000	/* CAPABILITY: A-MSDU tx */
    525  1.10.38.1      phil /* NB: HT40 is implied by IEEE80211_HTCAP_CHWIDTH40 */
    526  1.10.38.1      phil #define	IEEE80211_HTC_HT	0x00040000	/* CAPABILITY: HT operation */
    527  1.10.38.1      phil #define	IEEE80211_HTC_SMPS	0x00080000	/* CAPABILITY: MIMO power save*/
    528  1.10.38.1      phil #define	IEEE80211_HTC_RIFS	0x00100000	/* CAPABILITY: RIFS support */
    529  1.10.38.1      phil #define	IEEE80211_HTC_RXUNEQUAL	0x00200000	/* CAPABILITY: RX unequal MCS */
    530  1.10.38.1      phil #define	IEEE80211_HTC_RXMCS32	0x00400000	/* CAPABILITY: MCS32 support */
    531  1.10.38.1      phil #define	IEEE80211_HTC_TXUNEQUAL	0x00800000	/* CAPABILITY: TX unequal MCS */
    532  1.10.38.1      phil #define	IEEE80211_HTC_TXMCS32	0x01000000	/* CAPABILITY: MCS32 support */
    533  1.10.38.1      phil #define	IEEE80211_HTC_TXLDPC	0x02000000	/* CAPABILITY: TX using LDPC */
    534  1.10.38.1      phil 
    535  1.10.38.1      phil #define	IEEE80211_C_HTCAP_BITS \
    536  1.10.38.1      phil 	"\20\1LDPC\2CHWIDTH40\5GREENFIELD\6SHORTGI20\7SHORTGI40\10TXSTBC" \
    537  1.10.38.1      phil 	"\21AMPDU\22AMSDU\23HT\24SMPS\25RIFS\32TXLDPC"
    538  1.10.38.1      phil 
    539  1.10.38.1      phil /*
    540  1.10.38.1      phil  * RX status notification - which fields are valid.
    541  1.10.38.1      phil  */
    542  1.10.38.1      phil #define	IEEE80211_R_NF		0x00000001	/* global NF value valid */
    543  1.10.38.1      phil #define	IEEE80211_R_RSSI	0x00000002	/* global RSSI value valid */
    544  1.10.38.1      phil #define	IEEE80211_R_C_CHAIN	0x00000004	/* RX chain count valid */
    545  1.10.38.1      phil #define	IEEE80211_R_C_NF	0x00000008	/* per-chain NF value valid */
    546  1.10.38.1      phil #define	IEEE80211_R_C_RSSI	0x00000010	/* per-chain RSSI value valid */
    547  1.10.38.1      phil #define	IEEE80211_R_C_EVM	0x00000020	/* per-chain EVM valid */
    548  1.10.38.1      phil #define	IEEE80211_R_C_HT40	0x00000040	/* RX'ed packet is 40mhz, pilots 4,5 valid */
    549  1.10.38.1      phil #define	IEEE80211_R_FREQ	0x00000080	/* Freq value populated, MHz */
    550  1.10.38.1      phil #define	IEEE80211_R_IEEE	0x00000100	/* IEEE value populated */
    551  1.10.38.1      phil #define	IEEE80211_R_BAND	0x00000200	/* Frequency band populated */
    552  1.10.38.1      phil #define	IEEE80211_R_TSF32	0x00004000	/* 32 bit TSF */
    553  1.10.38.1      phil #define	IEEE80211_R_TSF64	0x00008000	/* 64 bit TSF */
    554  1.10.38.1      phil #define	IEEE80211_R_TSF_START	0x00010000	/* TSF is sampled at start of frame */
    555  1.10.38.1      phil #define	IEEE80211_R_TSF_END	0x00020000	/* TSF is sampled at end of frame */
    556  1.10.38.1      phil 
    557  1.10.38.1      phil /*
    558  1.10.38.1      phil  * RX status notification - describe the packet.
    559  1.10.38.1      phil  */
    560  1.10.38.1      phil #define	IEEE80211_RX_F_STBC		0x00000001
    561  1.10.38.1      phil #define	IEEE80211_RX_F_LDPC		0x00000002
    562  1.10.38.1      phil #define	IEEE80211_RX_F_AMSDU		0x00000004 /* This is the start of an decap AMSDU list */
    563  1.10.38.1      phil #define	IEEE80211_RX_F_AMSDU_MORE	0x00000008 /* This is another decap AMSDU frame in the batch */
    564  1.10.38.1      phil #define	IEEE80211_RX_F_AMPDU		0x00000010 /* This is the start of an decap AMPDU list */
    565  1.10.38.1      phil #define	IEEE80211_RX_F_AMPDU_MORE	0x00000020 /* This is another decap AMPDU frame in the batch */
    566  1.10.38.1      phil #define	IEEE80211_RX_F_FAIL_FCSCRC	0x00000040 /* Failed CRC/FCS */
    567  1.10.38.1      phil #define	IEEE80211_RX_F_FAIL_MIC		0x00000080 /* Failed MIC check */
    568  1.10.38.1      phil #define	IEEE80211_RX_F_DECRYPTED	0x00000100 /* Hardware decrypted */
    569  1.10.38.1      phil #define	IEEE80211_RX_F_IV_STRIP		0x00000200 /* Decrypted; IV stripped */
    570  1.10.38.1      phil #define	IEEE80211_RX_F_MMIC_STRIP	0x00000400 /* Decrypted; MMIC stripped */
    571  1.10.38.1      phil #define	IEEE80211_RX_F_SHORTGI		0x00000800 /* This is a short-GI frame */
    572  1.10.38.1      phil #define	IEEE80211_RX_F_CCK		0x00001000
    573  1.10.38.1      phil #define	IEEE80211_RX_F_OFDM		0x00002000
    574  1.10.38.1      phil #define	IEEE80211_RX_F_HT		0x00004000
    575  1.10.38.1      phil #define	IEEE80211_RX_F_VHT		0x00008000
    576  1.10.38.1      phil 
    577  1.10.38.1      phil /* Channel width */
    578  1.10.38.1      phil #define	IEEE80211_RX_FW_20MHZ		1
    579  1.10.38.1      phil #define	IEEE80211_RX_FW_40MHZ		2
    580  1.10.38.1      phil #define	IEEE80211_RX_FW_80MHZ		3
    581  1.10.38.1      phil 
    582  1.10.38.1      phil /* PHY type */
    583  1.10.38.1      phil #define	IEEE80211_RX_FP_11B		1
    584  1.10.38.1      phil #define	IEEE80211_RX_FP_11G		2
    585  1.10.38.1      phil #define	IEEE80211_RX_FP_11A		3
    586  1.10.38.1      phil #define	IEEE80211_RX_FP_11NA		4
    587  1.10.38.1      phil #define	IEEE80211_RX_FP_11NG		5
    588  1.10.38.1      phil 
    589  1.10.38.1      phil struct ieee80211_rx_stats {
    590  1.10.38.1      phil 	uint32_t r_flags;		/* IEEE80211_R_* flags */
    591  1.10.38.1      phil 	uint32_t c_pktflags;		/* IEEE80211_RX_F_* flags */
    592  1.10.38.1      phil 
    593  1.10.38.1      phil 	uint64_t c_rx_tsf;		/* 32 or 64 bit TSF */
    594  1.10.38.1      phil 
    595  1.10.38.1      phil 	/* All DWORD aligned */
    596  1.10.38.1      phil 	int16_t c_nf_ctl[IEEE80211_MAX_CHAINS];	/* per-chain NF */
    597  1.10.38.1      phil 	int16_t c_nf_ext[IEEE80211_MAX_CHAINS];	/* per-chain NF */
    598  1.10.38.1      phil 	int16_t c_rssi_ctl[IEEE80211_MAX_CHAINS];	/* per-chain RSSI */
    599  1.10.38.1      phil 	int16_t c_rssi_ext[IEEE80211_MAX_CHAINS];	/* per-chain RSSI */
    600  1.10.38.1      phil 
    601  1.10.38.1      phil 	/* 32 bits */
    602  1.10.38.1      phil 	uint8_t c_nf;			/* global NF */
    603  1.10.38.1      phil 	uint8_t c_rssi;			/* global RSSI */
    604  1.10.38.1      phil 	uint8_t c_chain;		/* number of RX chains involved */
    605  1.10.38.1      phil 	uint8_t c_rate;			/* legacy; 11n rate code; VHT MCS */
    606  1.10.38.1      phil 
    607  1.10.38.1      phil 	/* 32 bits */
    608  1.10.38.1      phil 	uint16_t c_freq;		/* Frequency, MHz */
    609  1.10.38.1      phil 	uint8_t c_ieee;			/* Channel */
    610  1.10.38.1      phil 	uint8_t c_width;		/* channel width, FW flags above */
    611  1.10.38.1      phil 
    612  1.10.38.1      phil 	/* Force alignment to DWORD */
    613  1.10.38.1      phil 	union {
    614  1.10.38.1      phil 		uint8_t evm[IEEE80211_MAX_CHAINS][IEEE80211_MAX_EVM_PILOTS];
    615  1.10.38.1      phil 		    /* per-chain, per-pilot EVM values */
    616  1.10.38.1      phil 		uint32_t __aln[8];
    617  1.10.38.1      phil 	} evm;
    618  1.10.38.1      phil 
    619  1.10.38.1      phil 	/* 32 bits */
    620  1.10.38.1      phil 	uint8_t c_phytype;		/* PHY type, FW flags above */
    621  1.10.38.1      phil 	uint8_t c_vhtnss;		/* VHT - number of spatial streams */
    622  1.10.38.1      phil 	uint8_t c_pad2[2];
    623  1.10.38.1      phil };
    624  1.10.38.1      phil 
    625  1.10.38.1      phil struct ieee80211_rx_params {
    626  1.10.38.1      phil 	struct ieee80211_rx_stats params;
    627  1.10.38.1      phil };
    628        1.8    cegger 
    629  1.10.38.1      phil #endif /* _NET80211__IEEE80211_H_ */
    630