xref: /linux/include/net/ieee80211_radiotap.h (revision 8c89f7b3d3f2880c57b0bc96c72ccd98fe354399)
1007e5dddSJohannes Berg /*
242f82e2eSJohannes Berg  * Copyright (c) 2017		Intel Deutschland GmbH
32ff5e52eSJohannes Berg  * Copyright (c) 2018-2019	Intel Corporation
43905ec45SJames Ketrenos  *
542f82e2eSJohannes Berg  * Permission to use, copy, modify, and/or distribute this software for any
642f82e2eSJohannes Berg  * purpose with or without fee is hereby granted, provided that the above
742f82e2eSJohannes Berg  * copyright notice and this permission notice appear in all copies.
83905ec45SJames Ketrenos  *
942f82e2eSJohannes Berg  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
1042f82e2eSJohannes Berg  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1142f82e2eSJohannes Berg  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
1242f82e2eSJohannes Berg  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1342f82e2eSJohannes Berg  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1442f82e2eSJohannes Berg  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1542f82e2eSJohannes Berg  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
163905ec45SJames Ketrenos  */
1742f82e2eSJohannes Berg #ifndef __RADIOTAP_H
1842f82e2eSJohannes Berg #define __RADIOTAP_H
193905ec45SJames Ketrenos 
203905ec45SJames Ketrenos #include <linux/kernel.h>
21dfe6e81dSAndy Green #include <asm/unaligned.h>
223905ec45SJames Ketrenos 
2342f82e2eSJohannes Berg /**
2442f82e2eSJohannes Berg  * struct ieee82011_radiotap_header - base radiotap header
25a0d69f22SPavel Roskin  */
263905ec45SJames Ketrenos struct ieee80211_radiotap_header {
2742f82e2eSJohannes Berg 	/**
2842f82e2eSJohannes Berg 	 * @it_version: radiotap version, always 0
293905ec45SJames Ketrenos 	 */
3042f82e2eSJohannes Berg 	uint8_t it_version;
3142f82e2eSJohannes Berg 
3242f82e2eSJohannes Berg 	/**
3342f82e2eSJohannes Berg 	 * @it_pad: padding (or alignment)
343905ec45SJames Ketrenos 	 */
3542f82e2eSJohannes Berg 	uint8_t it_pad;
3642f82e2eSJohannes Berg 
3742f82e2eSJohannes Berg 	/**
3842f82e2eSJohannes Berg 	 * @it_len: overall radiotap header length
393905ec45SJames Ketrenos 	 */
4042f82e2eSJohannes Berg 	__le16 it_len;
4142f82e2eSJohannes Berg 
4242f82e2eSJohannes Berg 	/**
4342f82e2eSJohannes Berg 	 * @it_present: (first) present word
4442f82e2eSJohannes Berg 	 */
4542f82e2eSJohannes Berg 	__le32 it_present;
46*8c89f7b3SKees Cook 
47*8c89f7b3SKees Cook 	/**
48*8c89f7b3SKees Cook 	 * @it_optional: all remaining presence bitmaps
49*8c89f7b3SKees Cook 	 */
50*8c89f7b3SKees Cook 	__le32 it_optional[];
516a86b9c7SJohannes Berg } __packed;
523905ec45SJames Ketrenos 
5342f82e2eSJohannes Berg /* version is always 0 */
5442f82e2eSJohannes Berg #define PKTHDR_RADIOTAP_VERSION	0
5542f82e2eSJohannes Berg 
5642f82e2eSJohannes Berg /* see the radiotap website for the descriptions */
5742f82e2eSJohannes Berg enum ieee80211_radiotap_presence {
583905ec45SJames Ketrenos 	IEEE80211_RADIOTAP_TSFT = 0,
593905ec45SJames Ketrenos 	IEEE80211_RADIOTAP_FLAGS = 1,
603905ec45SJames Ketrenos 	IEEE80211_RADIOTAP_RATE = 2,
613905ec45SJames Ketrenos 	IEEE80211_RADIOTAP_CHANNEL = 3,
623905ec45SJames Ketrenos 	IEEE80211_RADIOTAP_FHSS = 4,
633905ec45SJames Ketrenos 	IEEE80211_RADIOTAP_DBM_ANTSIGNAL = 5,
643905ec45SJames Ketrenos 	IEEE80211_RADIOTAP_DBM_ANTNOISE = 6,
653905ec45SJames Ketrenos 	IEEE80211_RADIOTAP_LOCK_QUALITY = 7,
663905ec45SJames Ketrenos 	IEEE80211_RADIOTAP_TX_ATTENUATION = 8,
673905ec45SJames Ketrenos 	IEEE80211_RADIOTAP_DB_TX_ATTENUATION = 9,
683905ec45SJames Ketrenos 	IEEE80211_RADIOTAP_DBM_TX_POWER = 10,
693905ec45SJames Ketrenos 	IEEE80211_RADIOTAP_ANTENNA = 11,
703905ec45SJames Ketrenos 	IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12,
713905ec45SJames Ketrenos 	IEEE80211_RADIOTAP_DB_ANTNOISE = 13,
72876c9d3aSMarcelo Tosatti 	IEEE80211_RADIOTAP_RX_FLAGS = 14,
73876c9d3aSMarcelo Tosatti 	IEEE80211_RADIOTAP_TX_FLAGS = 15,
74876c9d3aSMarcelo Tosatti 	IEEE80211_RADIOTAP_RTS_RETRIES = 16,
75876c9d3aSMarcelo Tosatti 	IEEE80211_RADIOTAP_DATA_RETRIES = 17,
7642f82e2eSJohannes Berg 	/* 18 is XChannel, but it's not defined yet */
776d744bacSJohannes Berg 	IEEE80211_RADIOTAP_MCS = 19,
7848613eceSJohannes Berg 	IEEE80211_RADIOTAP_AMPDU_STATUS = 20,
7951648921SJohannes Berg 	IEEE80211_RADIOTAP_VHT = 21,
8099ee7caeSJohannes Berg 	IEEE80211_RADIOTAP_TIMESTAMP = 22,
8195a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE = 23,
8295a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_MU = 24,
83c3d1f875SShaul Triebitz 	IEEE80211_RADIOTAP_ZERO_LEN_PSDU = 26,
84d1332e7bSShaul Triebitz 	IEEE80211_RADIOTAP_LSIG = 27,
856d744bacSJohannes Berg 
8633e5a2f7SJohannes Berg 	/* valid in every it_present bitmap, even vendor namespaces */
8733e5a2f7SJohannes Berg 	IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE = 29,
8833e5a2f7SJohannes Berg 	IEEE80211_RADIOTAP_VENDOR_NAMESPACE = 30,
89876c9d3aSMarcelo Tosatti 	IEEE80211_RADIOTAP_EXT = 31
903905ec45SJames Ketrenos };
913905ec45SJames Ketrenos 
9242f82e2eSJohannes Berg /* for IEEE80211_RADIOTAP_FLAGS */
9342f82e2eSJohannes Berg enum ieee80211_radiotap_flags {
9442f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_F_CFP = 0x01,
9542f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_F_SHORTPRE = 0x02,
9642f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_F_WEP = 0x04,
9742f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_F_FRAG = 0x08,
9842f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_F_FCS = 0x10,
9942f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_F_DATAPAD = 0x20,
10042f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_F_BADFCS = 0x40,
10142f82e2eSJohannes Berg };
1023905ec45SJames Ketrenos 
10342f82e2eSJohannes Berg /* for IEEE80211_RADIOTAP_CHANNEL */
10442f82e2eSJohannes Berg enum ieee80211_radiotap_channel_flags {
10542f82e2eSJohannes Berg 	IEEE80211_CHAN_CCK = 0x0020,
10642f82e2eSJohannes Berg 	IEEE80211_CHAN_OFDM = 0x0040,
10742f82e2eSJohannes Berg 	IEEE80211_CHAN_2GHZ = 0x0080,
10842f82e2eSJohannes Berg 	IEEE80211_CHAN_5GHZ = 0x0100,
10942f82e2eSJohannes Berg 	IEEE80211_CHAN_DYN = 0x0400,
11042f82e2eSJohannes Berg 	IEEE80211_CHAN_HALF = 0x4000,
11142f82e2eSJohannes Berg 	IEEE80211_CHAN_QUARTER = 0x8000,
11242f82e2eSJohannes Berg };
11342f82e2eSJohannes Berg 
11442f82e2eSJohannes Berg /* for IEEE80211_RADIOTAP_RX_FLAGS */
11542f82e2eSJohannes Berg enum ieee80211_radiotap_rx_flags {
11642f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_F_RX_BADPLCP = 0x0002,
11742f82e2eSJohannes Berg };
11842f82e2eSJohannes Berg 
11942f82e2eSJohannes Berg /* for IEEE80211_RADIOTAP_TX_FLAGS */
12042f82e2eSJohannes Berg enum ieee80211_radiotap_tx_flags {
12142f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_F_TX_FAIL = 0x0001,
12242f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_F_TX_CTS = 0x0002,
12342f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_F_TX_RTS = 0x0004,
12442f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_F_TX_NOACK = 0x0008,
125e02281e7SMathy Vanhoef 	IEEE80211_RADIOTAP_F_TX_NOSEQNO = 0x0010,
12630df8130SMathy Vanhoef 	IEEE80211_RADIOTAP_F_TX_ORDER = 0x0020,
12742f82e2eSJohannes Berg };
12842f82e2eSJohannes Berg 
12942f82e2eSJohannes Berg /* for IEEE80211_RADIOTAP_MCS "have" flags */
13042f82e2eSJohannes Berg enum ieee80211_radiotap_mcs_have {
13142f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_MCS_HAVE_BW = 0x01,
13242f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_MCS_HAVE_MCS = 0x02,
13342f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_MCS_HAVE_GI = 0x04,
13442f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_MCS_HAVE_FMT = 0x08,
13542f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_MCS_HAVE_FEC = 0x10,
13642f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_MCS_HAVE_STBC = 0x20,
13742f82e2eSJohannes Berg };
13842f82e2eSJohannes Berg 
13942f82e2eSJohannes Berg enum ieee80211_radiotap_mcs_flags {
14042f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_MCS_BW_MASK = 0x03,
14142f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_MCS_BW_20 = 0,
14242f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_MCS_BW_40 = 1,
14342f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_MCS_BW_20L = 2,
14442f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_MCS_BW_20U = 3,
14542f82e2eSJohannes Berg 
14642f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_MCS_SGI = 0x04,
14742f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_MCS_FMT_GF = 0x08,
14842f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_MCS_FEC_LDPC = 0x10,
14942f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_MCS_STBC_MASK = 0x60,
15042f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_MCS_STBC_1 = 1,
15142f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_MCS_STBC_2 = 2,
15242f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_MCS_STBC_3 = 3,
15342f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_MCS_STBC_SHIFT = 5,
15442f82e2eSJohannes Berg };
15542f82e2eSJohannes Berg 
15642f82e2eSJohannes Berg /* for IEEE80211_RADIOTAP_AMPDU_STATUS */
15742f82e2eSJohannes Berg enum ieee80211_radiotap_ampdu_flags {
15842f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_AMPDU_REPORT_ZEROLEN = 0x0001,
15942f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_AMPDU_IS_ZEROLEN = 0x0002,
16042f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_AMPDU_LAST_KNOWN = 0x0004,
16142f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_AMPDU_IS_LAST = 0x0008,
16242f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_ERR = 0x0010,
16342f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_KNOWN = 0x0020,
1647299d6f7SJohannes Berg 	IEEE80211_RADIOTAP_AMPDU_EOF = 0x0040,
1657299d6f7SJohannes Berg 	IEEE80211_RADIOTAP_AMPDU_EOF_KNOWN = 0x0080,
16642f82e2eSJohannes Berg };
16742f82e2eSJohannes Berg 
16842f82e2eSJohannes Berg /* for IEEE80211_RADIOTAP_VHT */
16942f82e2eSJohannes Berg enum ieee80211_radiotap_vht_known {
17042f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_VHT_KNOWN_STBC = 0x0001,
17142f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_VHT_KNOWN_TXOP_PS_NA = 0x0002,
17242f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_VHT_KNOWN_GI = 0x0004,
17342f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_VHT_KNOWN_SGI_NSYM_DIS = 0x0008,
17442f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_VHT_KNOWN_LDPC_EXTRA_OFDM_SYM = 0x0010,
17542f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_VHT_KNOWN_BEAMFORMED = 0x0020,
17642f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH = 0x0040,
17742f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_VHT_KNOWN_GROUP_ID = 0x0080,
17842f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_VHT_KNOWN_PARTIAL_AID = 0x0100,
17942f82e2eSJohannes Berg };
18042f82e2eSJohannes Berg 
18142f82e2eSJohannes Berg enum ieee80211_radiotap_vht_flags {
18242f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_VHT_FLAG_STBC = 0x01,
18342f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_VHT_FLAG_TXOP_PS_NA = 0x02,
18442f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_VHT_FLAG_SGI = 0x04,
18542f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_VHT_FLAG_SGI_NSYM_M10_9 = 0x08,
18642f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_VHT_FLAG_LDPC_EXTRA_OFDM_SYM = 0x10,
18742f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_VHT_FLAG_BEAMFORMED = 0x20,
18842f82e2eSJohannes Berg };
18942f82e2eSJohannes Berg 
19042f82e2eSJohannes Berg enum ieee80211_radiotap_vht_coding {
19142f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_CODING_LDPC_USER0 = 0x01,
19242f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_CODING_LDPC_USER1 = 0x02,
19342f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_CODING_LDPC_USER2 = 0x04,
19442f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_CODING_LDPC_USER3 = 0x08,
19542f82e2eSJohannes Berg };
19642f82e2eSJohannes Berg 
19742f82e2eSJohannes Berg /* for IEEE80211_RADIOTAP_TIMESTAMP */
19842f82e2eSJohannes Berg enum ieee80211_radiotap_timestamp_unit_spos {
19942f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_TIMESTAMP_UNIT_MASK = 0x000F,
20042f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_TIMESTAMP_UNIT_MS = 0x0000,
20142f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_TIMESTAMP_UNIT_US = 0x0001,
20242f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_TIMESTAMP_UNIT_NS = 0x0003,
20342f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_TIMESTAMP_SPOS_MASK = 0x00F0,
20442f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_TIMESTAMP_SPOS_BEGIN_MDPU = 0x0000,
20542f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_TIMESTAMP_SPOS_PLCP_SIG_ACQ = 0x0010,
20642f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_TIMESTAMP_SPOS_EO_PPDU = 0x0020,
20742f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_TIMESTAMP_SPOS_EO_MPDU = 0x0030,
20842f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_TIMESTAMP_SPOS_UNKNOWN = 0x00F0,
20942f82e2eSJohannes Berg };
21042f82e2eSJohannes Berg 
21142f82e2eSJohannes Berg enum ieee80211_radiotap_timestamp_flags {
21242f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_TIMESTAMP_FLAG_64BIT = 0x00,
21342f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_TIMESTAMP_FLAG_32BIT = 0x01,
21442f82e2eSJohannes Berg 	IEEE80211_RADIOTAP_TIMESTAMP_FLAG_ACCURACY = 0x02,
21542f82e2eSJohannes Berg };
21642f82e2eSJohannes Berg 
21795a28eeaSLuca Coelho struct ieee80211_radiotap_he {
21895a28eeaSLuca Coelho 	__le16 data1, data2, data3, data4, data5, data6;
21995a28eeaSLuca Coelho };
22095a28eeaSLuca Coelho 
22195a28eeaSLuca Coelho enum ieee80211_radiotap_he_bits {
22295a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA1_FORMAT_MASK		= 3,
22395a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA1_FORMAT_SU		= 0,
22495a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA1_FORMAT_EXT_SU	= 1,
22595a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA1_FORMAT_MU		= 2,
22695a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA1_FORMAT_TRIG		= 3,
22795a28eeaSLuca Coelho 
22895a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA1_BSS_COLOR_KNOWN	= 0x0004,
22995a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA1_BEAM_CHANGE_KNOWN	= 0x0008,
23095a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA1_UL_DL_KNOWN		= 0x0010,
23195a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA1_DATA_MCS_KNOWN	= 0x0020,
23295a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA1_DATA_DCM_KNOWN	= 0x0040,
23395a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA1_CODING_KNOWN	= 0x0080,
23495a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA1_LDPC_XSYMSEG_KNOWN	= 0x0100,
23595a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA1_STBC_KNOWN		= 0x0200,
23695a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE_KNOWN	= 0x0400,
23795a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE2_KNOWN	= 0x0800,
23895a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE3_KNOWN	= 0x1000,
23995a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE4_KNOWN	= 0x2000,
24095a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA1_BW_RU_ALLOC_KNOWN	= 0x4000,
24195a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA1_DOPPLER_KNOWN	= 0x8000,
24295a28eeaSLuca Coelho 
24395a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_KNOWN	= 0x0001,
24495a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA2_GI_KNOWN		= 0x0002,
24595a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA2_NUM_LTF_SYMS_KNOWN	= 0x0004,
24695a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA2_PRE_FEC_PAD_KNOWN	= 0x0008,
24795a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA2_TXBF_KNOWN		= 0x0010,
24895a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA2_PE_DISAMBIG_KNOWN	= 0x0020,
24995a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA2_TXOP_KNOWN		= 0x0040,
25095a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA2_MIDAMBLE_KNOWN	= 0x0080,
25195a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA2_RU_OFFSET		= 0x3f00,
25295a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA2_RU_OFFSET_KNOWN	= 0x4000,
25395a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_SEC	= 0x8000,
25495a28eeaSLuca Coelho 
25595a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA3_BSS_COLOR		= 0x003f,
25695a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA3_BEAM_CHANGE		= 0x0040,
25795a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA3_UL_DL		= 0x0080,
25895a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA3_DATA_MCS		= 0x0f00,
25995a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA3_DATA_DCM		= 0x1000,
26095a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA3_CODING		= 0x2000,
26195a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA3_LDPC_XSYMSEG	= 0x4000,
26295a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA3_STBC		= 0x8000,
26395a28eeaSLuca Coelho 
26495a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA4_SU_MU_SPTL_REUSE	= 0x000f,
26595a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA4_MU_STA_ID		= 0x7ff0,
26695a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA4_TB_SPTL_REUSE1	= 0x000f,
26795a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA4_TB_SPTL_REUSE2	= 0x00f0,
26895a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA4_TB_SPTL_REUSE3	= 0x0f00,
26995a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA4_TB_SPTL_REUSE4	= 0xf000,
27095a28eeaSLuca Coelho 
27195a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC	= 0x000f,
27295a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_20MHZ	= 0,
27395a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_40MHZ	= 1,
27495a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_80MHZ	= 2,
27595a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_160MHZ	= 3,
27695a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_26T	= 4,
27795a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_52T	= 5,
27895a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_106T	= 6,
27995a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_242T	= 7,
28095a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_484T	= 8,
28195a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_996T	= 9,
28295a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_2x996T	= 10,
28395a28eeaSLuca Coelho 
28495a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA5_GI			= 0x0030,
28595a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_DATA5_GI_0_8			= 0,
28695a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_DATA5_GI_1_6			= 1,
28795a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_DATA5_GI_3_2			= 2,
28895a28eeaSLuca Coelho 
28995a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE		= 0x00c0,
29095a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_UNKNOWN		= 0,
29195a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_1X			= 1,
29295a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_2X			= 2,
29395a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_4X			= 3,
29495a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA5_NUM_LTF_SYMS	= 0x0700,
29595a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA5_PRE_FEC_PAD		= 0x3000,
29695a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA5_TXBF		= 0x4000,
29795a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA5_PE_DISAMBIG		= 0x8000,
29895a28eeaSLuca Coelho 
29995a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA6_NSTS		= 0x000f,
30095a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA6_DOPPLER		= 0x0010,
30174cf15cbSJohannes Berg 	IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW_KNOWN	= 0x0020,
30274cf15cbSJohannes Berg 	IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW		= 0x00c0,
30374cf15cbSJohannes Berg 		IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW_20MHZ	= 0,
30474cf15cbSJohannes Berg 		IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW_40MHZ	= 1,
30574cf15cbSJohannes Berg 		IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW_80MHZ	= 2,
30674cf15cbSJohannes Berg 		IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW_160MHZ	= 3,
30795a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA6_TXOP		= 0x7f00,
30895a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_DATA6_MIDAMBLE_PDCTY	= 0x8000,
30995a28eeaSLuca Coelho };
31095a28eeaSLuca Coelho 
31195a28eeaSLuca Coelho struct ieee80211_radiotap_he_mu {
31295a28eeaSLuca Coelho 	__le16 flags1, flags2;
31395a28eeaSLuca Coelho 	u8 ru_ch1[4];
31495a28eeaSLuca Coelho 	u8 ru_ch2[4];
31595a28eeaSLuca Coelho };
31695a28eeaSLuca Coelho 
31795a28eeaSLuca Coelho enum ieee80211_radiotap_he_mu_bits {
31895a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_MCS		= 0x000f,
31995a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_MCS_KNOWN		= 0x0010,
32095a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_DCM		= 0x0020,
32195a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_DCM_KNOWN		= 0x0040,
32295a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH2_CTR_26T_RU_KNOWN	= 0x0080,
32395a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH1_RU_KNOWN		= 0x0100,
32495a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH2_RU_KNOWN		= 0x0200,
32595a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH1_CTR_26T_RU_KNOWN	= 0x1000,
32695a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH1_CTR_26T_RU		= 0x2000,
32795a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_COMP_KNOWN	= 0x4000,
32895a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_SYMS_USERS_KNOWN	= 0x8000,
32995a28eeaSLuca Coelho 
33095a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW	= 0x0003,
33195a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_20MHZ	= 0x0000,
33295a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_40MHZ	= 0x0001,
33395a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_80MHZ	= 0x0002,
33495a28eeaSLuca Coelho 		IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_160MHZ	= 0x0003,
33595a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_KNOWN	= 0x0004,
33695a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_COMP		= 0x0008,
33795a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_SYMS_USERS	= 0x00f0,
33895a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW	= 0x0300,
33995a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW_KNOWN= 0x0400,
34095a28eeaSLuca Coelho 	IEEE80211_RADIOTAP_HE_MU_FLAGS2_CH2_CTR_26T_RU		= 0x0800,
34195a28eeaSLuca Coelho };
34295a28eeaSLuca Coelho 
343d1332e7bSShaul Triebitz enum ieee80211_radiotap_lsig_data1 {
344d1332e7bSShaul Triebitz 	IEEE80211_RADIOTAP_LSIG_DATA1_RATE_KNOWN		= 0x0001,
345d1332e7bSShaul Triebitz 	IEEE80211_RADIOTAP_LSIG_DATA1_LENGTH_KNOWN		= 0x0002,
346d1332e7bSShaul Triebitz };
347d1332e7bSShaul Triebitz 
348d1332e7bSShaul Triebitz enum ieee80211_radiotap_lsig_data2 {
349d1332e7bSShaul Triebitz 	IEEE80211_RADIOTAP_LSIG_DATA2_RATE			= 0x000f,
350d1332e7bSShaul Triebitz 	IEEE80211_RADIOTAP_LSIG_DATA2_LENGTH			= 0xfff0,
351d1332e7bSShaul Triebitz };
352d1332e7bSShaul Triebitz 
353d1332e7bSShaul Triebitz struct ieee80211_radiotap_lsig {
354d1332e7bSShaul Triebitz 	__le16 data1, data2;
355d1332e7bSShaul Triebitz };
356d1332e7bSShaul Triebitz 
357c3d1f875SShaul Triebitz enum ieee80211_radiotap_zero_len_psdu_type {
358c3d1f875SShaul Triebitz 	IEEE80211_RADIOTAP_ZERO_LEN_PSDU_SOUNDING		= 0,
3592ff5e52eSJohannes Berg 	IEEE80211_RADIOTAP_ZERO_LEN_PSDU_NOT_CAPTURED		= 1,
360c3d1f875SShaul Triebitz 	IEEE80211_RADIOTAP_ZERO_LEN_PSDU_VENDOR			= 0xff,
361c3d1f875SShaul Triebitz };
362c3d1f875SShaul Triebitz 
36342f82e2eSJohannes Berg /**
36442f82e2eSJohannes Berg  * ieee80211_get_radiotap_len - get radiotap header length
3653905ec45SJames Ketrenos  */
36642f82e2eSJohannes Berg static inline u16 ieee80211_get_radiotap_len(const char *data)
367571ecf67SJohannes Berg {
36842f82e2eSJohannes Berg 	struct ieee80211_radiotap_header *hdr = (void *)data;
369571ecf67SJohannes Berg 
3708b5ac31eSHarvey Harrison 	return get_unaligned_le16(&hdr->it_len);
371571ecf67SJohannes Berg }
372571ecf67SJohannes Berg 
37342f82e2eSJohannes Berg #endif /* __RADIOTAP_H */
374