Johannes Berg | 007e5dd | 2008-11-27 23:13:38 +0100 | [diff] [blame] | 1 | /* |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017 Intel Deutschland GmbH |
Johannes Berg | 2ff5e52 | 2019-02-06 13:17:11 +0200 | [diff] [blame] | 3 | * Copyright (c) 2018-2019 Intel Corporation |
James Ketrenos | 3905ec4 | 2005-09-21 11:56:42 -0500 | [diff] [blame] | 4 | * |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 5 | * Permission to use, copy, modify, and/or distribute this software for any |
| 6 | * purpose with or without fee is hereby granted, provided that the above |
| 7 | * copyright notice and this permission notice appear in all copies. |
James Ketrenos | 3905ec4 | 2005-09-21 11:56:42 -0500 | [diff] [blame] | 8 | * |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
James Ketrenos | 3905ec4 | 2005-09-21 11:56:42 -0500 | [diff] [blame] | 16 | */ |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 17 | #ifndef __RADIOTAP_H |
| 18 | #define __RADIOTAP_H |
James Ketrenos | 3905ec4 | 2005-09-21 11:56:42 -0500 | [diff] [blame] | 19 | |
James Ketrenos | 3905ec4 | 2005-09-21 11:56:42 -0500 | [diff] [blame] | 20 | #include <linux/kernel.h> |
Andy Green | dfe6e81 | 2007-07-27 15:43:24 +0200 | [diff] [blame] | 21 | #include <asm/unaligned.h> |
James Ketrenos | 3905ec4 | 2005-09-21 11:56:42 -0500 | [diff] [blame] | 22 | |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 23 | /** |
| 24 | * struct ieee82011_radiotap_header - base radiotap header |
Pavel Roskin | a0d69f2 | 2007-03-10 22:54:22 -0500 | [diff] [blame] | 25 | */ |
James Ketrenos | 3905ec4 | 2005-09-21 11:56:42 -0500 | [diff] [blame] | 26 | struct ieee80211_radiotap_header { |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 27 | /** |
| 28 | * @it_version: radiotap version, always 0 |
| 29 | */ |
| 30 | uint8_t it_version; |
| 31 | |
| 32 | /** |
| 33 | * @it_pad: padding (or alignment) |
| 34 | */ |
| 35 | uint8_t it_pad; |
| 36 | |
| 37 | /** |
| 38 | * @it_len: overall radiotap header length |
| 39 | */ |
| 40 | __le16 it_len; |
| 41 | |
| 42 | /** |
| 43 | * @it_present: (first) present word |
| 44 | */ |
| 45 | __le32 it_present; |
Johannes Berg | 6a86b9c | 2009-10-28 09:58:52 +0100 | [diff] [blame] | 46 | } __packed; |
James Ketrenos | 3905ec4 | 2005-09-21 11:56:42 -0500 | [diff] [blame] | 47 | |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 48 | /* version is always 0 */ |
| 49 | #define PKTHDR_RADIOTAP_VERSION 0 |
| 50 | |
| 51 | /* see the radiotap website for the descriptions */ |
| 52 | enum ieee80211_radiotap_presence { |
James Ketrenos | 3905ec4 | 2005-09-21 11:56:42 -0500 | [diff] [blame] | 53 | IEEE80211_RADIOTAP_TSFT = 0, |
| 54 | IEEE80211_RADIOTAP_FLAGS = 1, |
| 55 | IEEE80211_RADIOTAP_RATE = 2, |
| 56 | IEEE80211_RADIOTAP_CHANNEL = 3, |
| 57 | IEEE80211_RADIOTAP_FHSS = 4, |
| 58 | IEEE80211_RADIOTAP_DBM_ANTSIGNAL = 5, |
| 59 | IEEE80211_RADIOTAP_DBM_ANTNOISE = 6, |
| 60 | IEEE80211_RADIOTAP_LOCK_QUALITY = 7, |
| 61 | IEEE80211_RADIOTAP_TX_ATTENUATION = 8, |
| 62 | IEEE80211_RADIOTAP_DB_TX_ATTENUATION = 9, |
| 63 | IEEE80211_RADIOTAP_DBM_TX_POWER = 10, |
| 64 | IEEE80211_RADIOTAP_ANTENNA = 11, |
| 65 | IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12, |
| 66 | IEEE80211_RADIOTAP_DB_ANTNOISE = 13, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 67 | IEEE80211_RADIOTAP_RX_FLAGS = 14, |
| 68 | IEEE80211_RADIOTAP_TX_FLAGS = 15, |
| 69 | IEEE80211_RADIOTAP_RTS_RETRIES = 16, |
| 70 | IEEE80211_RADIOTAP_DATA_RETRIES = 17, |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 71 | /* 18 is XChannel, but it's not defined yet */ |
Johannes Berg | 6d744ba | 2011-01-27 14:13:17 +0100 | [diff] [blame] | 72 | IEEE80211_RADIOTAP_MCS = 19, |
Johannes Berg | 48613ec | 2012-07-05 11:32:16 +0200 | [diff] [blame] | 73 | IEEE80211_RADIOTAP_AMPDU_STATUS = 20, |
Johannes Berg | 5164892 | 2012-11-22 23:00:18 +0100 | [diff] [blame] | 74 | IEEE80211_RADIOTAP_VHT = 21, |
Johannes Berg | 99ee7ca | 2016-08-29 23:25:17 +0300 | [diff] [blame] | 75 | IEEE80211_RADIOTAP_TIMESTAMP = 22, |
Luca Coelho | 95a28ee | 2018-06-09 09:14:43 +0300 | [diff] [blame] | 76 | IEEE80211_RADIOTAP_HE = 23, |
| 77 | IEEE80211_RADIOTAP_HE_MU = 24, |
Shaul Triebitz | c3d1f87 | 2018-09-05 08:06:06 +0300 | [diff] [blame] | 78 | IEEE80211_RADIOTAP_ZERO_LEN_PSDU = 26, |
Shaul Triebitz | d1332e7 | 2018-08-31 11:31:20 +0300 | [diff] [blame] | 79 | IEEE80211_RADIOTAP_LSIG = 27, |
Johannes Berg | 6d744ba | 2011-01-27 14:13:17 +0100 | [diff] [blame] | 80 | |
Johannes Berg | 33e5a2f | 2010-02-03 10:24:30 +0100 | [diff] [blame] | 81 | /* valid in every it_present bitmap, even vendor namespaces */ |
| 82 | IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE = 29, |
| 83 | IEEE80211_RADIOTAP_VENDOR_NAMESPACE = 30, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 84 | IEEE80211_RADIOTAP_EXT = 31 |
James Ketrenos | 3905ec4 | 2005-09-21 11:56:42 -0500 | [diff] [blame] | 85 | }; |
| 86 | |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 87 | /* for IEEE80211_RADIOTAP_FLAGS */ |
| 88 | enum ieee80211_radiotap_flags { |
| 89 | IEEE80211_RADIOTAP_F_CFP = 0x01, |
| 90 | IEEE80211_RADIOTAP_F_SHORTPRE = 0x02, |
| 91 | IEEE80211_RADIOTAP_F_WEP = 0x04, |
| 92 | IEEE80211_RADIOTAP_F_FRAG = 0x08, |
| 93 | IEEE80211_RADIOTAP_F_FCS = 0x10, |
| 94 | IEEE80211_RADIOTAP_F_DATAPAD = 0x20, |
| 95 | IEEE80211_RADIOTAP_F_BADFCS = 0x40, |
| 96 | }; |
James Ketrenos | 3905ec4 | 2005-09-21 11:56:42 -0500 | [diff] [blame] | 97 | |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 98 | /* for IEEE80211_RADIOTAP_CHANNEL */ |
| 99 | enum ieee80211_radiotap_channel_flags { |
| 100 | IEEE80211_CHAN_CCK = 0x0020, |
| 101 | IEEE80211_CHAN_OFDM = 0x0040, |
| 102 | IEEE80211_CHAN_2GHZ = 0x0080, |
| 103 | IEEE80211_CHAN_5GHZ = 0x0100, |
| 104 | IEEE80211_CHAN_DYN = 0x0400, |
| 105 | IEEE80211_CHAN_HALF = 0x4000, |
| 106 | IEEE80211_CHAN_QUARTER = 0x8000, |
| 107 | }; |
Johannes Berg | aae8983 | 2009-03-13 12:52:10 +0100 | [diff] [blame] | 108 | |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 109 | /* for IEEE80211_RADIOTAP_RX_FLAGS */ |
| 110 | enum ieee80211_radiotap_rx_flags { |
| 111 | IEEE80211_RADIOTAP_F_RX_BADPLCP = 0x0002, |
| 112 | }; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 113 | |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 114 | /* for IEEE80211_RADIOTAP_TX_FLAGS */ |
| 115 | enum ieee80211_radiotap_tx_flags { |
| 116 | IEEE80211_RADIOTAP_F_TX_FAIL = 0x0001, |
| 117 | IEEE80211_RADIOTAP_F_TX_CTS = 0x0002, |
| 118 | IEEE80211_RADIOTAP_F_TX_RTS = 0x0004, |
| 119 | IEEE80211_RADIOTAP_F_TX_NOACK = 0x0008, |
Mathy Vanhoef | e02281e | 2020-07-23 14:01:49 +0400 | [diff] [blame] | 120 | IEEE80211_RADIOTAP_F_TX_NOSEQNO = 0x0010, |
Mathy Vanhoef | 30df813 | 2020-11-04 10:18:19 +0400 | [diff] [blame] | 121 | IEEE80211_RADIOTAP_F_TX_ORDER = 0x0020, |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 122 | }; |
James Ketrenos | 3905ec4 | 2005-09-21 11:56:42 -0500 | [diff] [blame] | 123 | |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 124 | /* for IEEE80211_RADIOTAP_MCS "have" flags */ |
| 125 | enum ieee80211_radiotap_mcs_have { |
| 126 | IEEE80211_RADIOTAP_MCS_HAVE_BW = 0x01, |
| 127 | IEEE80211_RADIOTAP_MCS_HAVE_MCS = 0x02, |
| 128 | IEEE80211_RADIOTAP_MCS_HAVE_GI = 0x04, |
| 129 | IEEE80211_RADIOTAP_MCS_HAVE_FMT = 0x08, |
| 130 | IEEE80211_RADIOTAP_MCS_HAVE_FEC = 0x10, |
| 131 | IEEE80211_RADIOTAP_MCS_HAVE_STBC = 0x20, |
| 132 | }; |
Johannes Berg | 6d744ba | 2011-01-27 14:13:17 +0100 | [diff] [blame] | 133 | |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 134 | enum ieee80211_radiotap_mcs_flags { |
| 135 | IEEE80211_RADIOTAP_MCS_BW_MASK = 0x03, |
| 136 | IEEE80211_RADIOTAP_MCS_BW_20 = 0, |
| 137 | IEEE80211_RADIOTAP_MCS_BW_40 = 1, |
| 138 | IEEE80211_RADIOTAP_MCS_BW_20L = 2, |
| 139 | IEEE80211_RADIOTAP_MCS_BW_20U = 3, |
Johannes Berg | 6d744ba | 2011-01-27 14:13:17 +0100 | [diff] [blame] | 140 | |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 141 | IEEE80211_RADIOTAP_MCS_SGI = 0x04, |
| 142 | IEEE80211_RADIOTAP_MCS_FMT_GF = 0x08, |
| 143 | IEEE80211_RADIOTAP_MCS_FEC_LDPC = 0x10, |
| 144 | IEEE80211_RADIOTAP_MCS_STBC_MASK = 0x60, |
| 145 | IEEE80211_RADIOTAP_MCS_STBC_1 = 1, |
| 146 | IEEE80211_RADIOTAP_MCS_STBC_2 = 2, |
| 147 | IEEE80211_RADIOTAP_MCS_STBC_3 = 3, |
| 148 | IEEE80211_RADIOTAP_MCS_STBC_SHIFT = 5, |
| 149 | }; |
Oleksij Rempel | 786677d | 2013-05-24 12:05:45 +0200 | [diff] [blame] | 150 | |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 151 | /* for IEEE80211_RADIOTAP_AMPDU_STATUS */ |
| 152 | enum ieee80211_radiotap_ampdu_flags { |
| 153 | IEEE80211_RADIOTAP_AMPDU_REPORT_ZEROLEN = 0x0001, |
| 154 | IEEE80211_RADIOTAP_AMPDU_IS_ZEROLEN = 0x0002, |
| 155 | IEEE80211_RADIOTAP_AMPDU_LAST_KNOWN = 0x0004, |
| 156 | IEEE80211_RADIOTAP_AMPDU_IS_LAST = 0x0008, |
| 157 | IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_ERR = 0x0010, |
| 158 | IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_KNOWN = 0x0020, |
Johannes Berg | 7299d6f | 2018-02-19 14:48:39 +0200 | [diff] [blame] | 159 | IEEE80211_RADIOTAP_AMPDU_EOF = 0x0040, |
| 160 | IEEE80211_RADIOTAP_AMPDU_EOF_KNOWN = 0x0080, |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 161 | }; |
Johannes Berg | 6d744ba | 2011-01-27 14:13:17 +0100 | [diff] [blame] | 162 | |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 163 | /* for IEEE80211_RADIOTAP_VHT */ |
| 164 | enum ieee80211_radiotap_vht_known { |
| 165 | IEEE80211_RADIOTAP_VHT_KNOWN_STBC = 0x0001, |
| 166 | IEEE80211_RADIOTAP_VHT_KNOWN_TXOP_PS_NA = 0x0002, |
| 167 | IEEE80211_RADIOTAP_VHT_KNOWN_GI = 0x0004, |
| 168 | IEEE80211_RADIOTAP_VHT_KNOWN_SGI_NSYM_DIS = 0x0008, |
| 169 | IEEE80211_RADIOTAP_VHT_KNOWN_LDPC_EXTRA_OFDM_SYM = 0x0010, |
| 170 | IEEE80211_RADIOTAP_VHT_KNOWN_BEAMFORMED = 0x0020, |
| 171 | IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH = 0x0040, |
| 172 | IEEE80211_RADIOTAP_VHT_KNOWN_GROUP_ID = 0x0080, |
| 173 | IEEE80211_RADIOTAP_VHT_KNOWN_PARTIAL_AID = 0x0100, |
| 174 | }; |
Johannes Berg | 6d744ba | 2011-01-27 14:13:17 +0100 | [diff] [blame] | 175 | |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 176 | enum ieee80211_radiotap_vht_flags { |
| 177 | IEEE80211_RADIOTAP_VHT_FLAG_STBC = 0x01, |
| 178 | IEEE80211_RADIOTAP_VHT_FLAG_TXOP_PS_NA = 0x02, |
| 179 | IEEE80211_RADIOTAP_VHT_FLAG_SGI = 0x04, |
| 180 | IEEE80211_RADIOTAP_VHT_FLAG_SGI_NSYM_M10_9 = 0x08, |
| 181 | IEEE80211_RADIOTAP_VHT_FLAG_LDPC_EXTRA_OFDM_SYM = 0x10, |
| 182 | IEEE80211_RADIOTAP_VHT_FLAG_BEAMFORMED = 0x20, |
| 183 | }; |
Johannes Berg | 5164892 | 2012-11-22 23:00:18 +0100 | [diff] [blame] | 184 | |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 185 | enum ieee80211_radiotap_vht_coding { |
| 186 | IEEE80211_RADIOTAP_CODING_LDPC_USER0 = 0x01, |
| 187 | IEEE80211_RADIOTAP_CODING_LDPC_USER1 = 0x02, |
| 188 | IEEE80211_RADIOTAP_CODING_LDPC_USER2 = 0x04, |
| 189 | IEEE80211_RADIOTAP_CODING_LDPC_USER3 = 0x08, |
| 190 | }; |
Johannes Berg | 5164892 | 2012-11-22 23:00:18 +0100 | [diff] [blame] | 191 | |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 192 | /* for IEEE80211_RADIOTAP_TIMESTAMP */ |
| 193 | enum ieee80211_radiotap_timestamp_unit_spos { |
| 194 | IEEE80211_RADIOTAP_TIMESTAMP_UNIT_MASK = 0x000F, |
| 195 | IEEE80211_RADIOTAP_TIMESTAMP_UNIT_MS = 0x0000, |
| 196 | IEEE80211_RADIOTAP_TIMESTAMP_UNIT_US = 0x0001, |
| 197 | IEEE80211_RADIOTAP_TIMESTAMP_UNIT_NS = 0x0003, |
| 198 | IEEE80211_RADIOTAP_TIMESTAMP_SPOS_MASK = 0x00F0, |
| 199 | IEEE80211_RADIOTAP_TIMESTAMP_SPOS_BEGIN_MDPU = 0x0000, |
| 200 | IEEE80211_RADIOTAP_TIMESTAMP_SPOS_PLCP_SIG_ACQ = 0x0010, |
| 201 | IEEE80211_RADIOTAP_TIMESTAMP_SPOS_EO_PPDU = 0x0020, |
| 202 | IEEE80211_RADIOTAP_TIMESTAMP_SPOS_EO_MPDU = 0x0030, |
| 203 | IEEE80211_RADIOTAP_TIMESTAMP_SPOS_UNKNOWN = 0x00F0, |
| 204 | }; |
Johannes Berg | 5164892 | 2012-11-22 23:00:18 +0100 | [diff] [blame] | 205 | |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 206 | enum ieee80211_radiotap_timestamp_flags { |
| 207 | IEEE80211_RADIOTAP_TIMESTAMP_FLAG_64BIT = 0x00, |
| 208 | IEEE80211_RADIOTAP_TIMESTAMP_FLAG_32BIT = 0x01, |
| 209 | IEEE80211_RADIOTAP_TIMESTAMP_FLAG_ACCURACY = 0x02, |
| 210 | }; |
Johannes Berg | 99ee7ca | 2016-08-29 23:25:17 +0300 | [diff] [blame] | 211 | |
Luca Coelho | 95a28ee | 2018-06-09 09:14:43 +0300 | [diff] [blame] | 212 | struct ieee80211_radiotap_he { |
| 213 | __le16 data1, data2, data3, data4, data5, data6; |
| 214 | }; |
| 215 | |
| 216 | enum ieee80211_radiotap_he_bits { |
| 217 | IEEE80211_RADIOTAP_HE_DATA1_FORMAT_MASK = 3, |
| 218 | IEEE80211_RADIOTAP_HE_DATA1_FORMAT_SU = 0, |
| 219 | IEEE80211_RADIOTAP_HE_DATA1_FORMAT_EXT_SU = 1, |
| 220 | IEEE80211_RADIOTAP_HE_DATA1_FORMAT_MU = 2, |
| 221 | IEEE80211_RADIOTAP_HE_DATA1_FORMAT_TRIG = 3, |
| 222 | |
| 223 | IEEE80211_RADIOTAP_HE_DATA1_BSS_COLOR_KNOWN = 0x0004, |
| 224 | IEEE80211_RADIOTAP_HE_DATA1_BEAM_CHANGE_KNOWN = 0x0008, |
| 225 | IEEE80211_RADIOTAP_HE_DATA1_UL_DL_KNOWN = 0x0010, |
| 226 | IEEE80211_RADIOTAP_HE_DATA1_DATA_MCS_KNOWN = 0x0020, |
| 227 | IEEE80211_RADIOTAP_HE_DATA1_DATA_DCM_KNOWN = 0x0040, |
| 228 | IEEE80211_RADIOTAP_HE_DATA1_CODING_KNOWN = 0x0080, |
| 229 | IEEE80211_RADIOTAP_HE_DATA1_LDPC_XSYMSEG_KNOWN = 0x0100, |
| 230 | IEEE80211_RADIOTAP_HE_DATA1_STBC_KNOWN = 0x0200, |
| 231 | IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE_KNOWN = 0x0400, |
| 232 | IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE2_KNOWN = 0x0800, |
| 233 | IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE3_KNOWN = 0x1000, |
| 234 | IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE4_KNOWN = 0x2000, |
| 235 | IEEE80211_RADIOTAP_HE_DATA1_BW_RU_ALLOC_KNOWN = 0x4000, |
| 236 | IEEE80211_RADIOTAP_HE_DATA1_DOPPLER_KNOWN = 0x8000, |
| 237 | |
| 238 | IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_KNOWN = 0x0001, |
| 239 | IEEE80211_RADIOTAP_HE_DATA2_GI_KNOWN = 0x0002, |
| 240 | IEEE80211_RADIOTAP_HE_DATA2_NUM_LTF_SYMS_KNOWN = 0x0004, |
| 241 | IEEE80211_RADIOTAP_HE_DATA2_PRE_FEC_PAD_KNOWN = 0x0008, |
| 242 | IEEE80211_RADIOTAP_HE_DATA2_TXBF_KNOWN = 0x0010, |
| 243 | IEEE80211_RADIOTAP_HE_DATA2_PE_DISAMBIG_KNOWN = 0x0020, |
| 244 | IEEE80211_RADIOTAP_HE_DATA2_TXOP_KNOWN = 0x0040, |
| 245 | IEEE80211_RADIOTAP_HE_DATA2_MIDAMBLE_KNOWN = 0x0080, |
| 246 | IEEE80211_RADIOTAP_HE_DATA2_RU_OFFSET = 0x3f00, |
| 247 | IEEE80211_RADIOTAP_HE_DATA2_RU_OFFSET_KNOWN = 0x4000, |
| 248 | IEEE80211_RADIOTAP_HE_DATA2_PRISEC_80_SEC = 0x8000, |
| 249 | |
| 250 | IEEE80211_RADIOTAP_HE_DATA3_BSS_COLOR = 0x003f, |
| 251 | IEEE80211_RADIOTAP_HE_DATA3_BEAM_CHANGE = 0x0040, |
| 252 | IEEE80211_RADIOTAP_HE_DATA3_UL_DL = 0x0080, |
| 253 | IEEE80211_RADIOTAP_HE_DATA3_DATA_MCS = 0x0f00, |
| 254 | IEEE80211_RADIOTAP_HE_DATA3_DATA_DCM = 0x1000, |
| 255 | IEEE80211_RADIOTAP_HE_DATA3_CODING = 0x2000, |
| 256 | IEEE80211_RADIOTAP_HE_DATA3_LDPC_XSYMSEG = 0x4000, |
| 257 | IEEE80211_RADIOTAP_HE_DATA3_STBC = 0x8000, |
| 258 | |
| 259 | IEEE80211_RADIOTAP_HE_DATA4_SU_MU_SPTL_REUSE = 0x000f, |
| 260 | IEEE80211_RADIOTAP_HE_DATA4_MU_STA_ID = 0x7ff0, |
| 261 | IEEE80211_RADIOTAP_HE_DATA4_TB_SPTL_REUSE1 = 0x000f, |
| 262 | IEEE80211_RADIOTAP_HE_DATA4_TB_SPTL_REUSE2 = 0x00f0, |
| 263 | IEEE80211_RADIOTAP_HE_DATA4_TB_SPTL_REUSE3 = 0x0f00, |
| 264 | IEEE80211_RADIOTAP_HE_DATA4_TB_SPTL_REUSE4 = 0xf000, |
| 265 | |
| 266 | IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC = 0x000f, |
| 267 | IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_20MHZ = 0, |
| 268 | IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_40MHZ = 1, |
| 269 | IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_80MHZ = 2, |
| 270 | IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_160MHZ = 3, |
| 271 | IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_26T = 4, |
| 272 | IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_52T = 5, |
| 273 | IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_106T = 6, |
| 274 | IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_242T = 7, |
| 275 | IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_484T = 8, |
| 276 | IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_996T = 9, |
| 277 | IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC_2x996T = 10, |
| 278 | |
| 279 | IEEE80211_RADIOTAP_HE_DATA5_GI = 0x0030, |
| 280 | IEEE80211_RADIOTAP_HE_DATA5_GI_0_8 = 0, |
| 281 | IEEE80211_RADIOTAP_HE_DATA5_GI_1_6 = 1, |
| 282 | IEEE80211_RADIOTAP_HE_DATA5_GI_3_2 = 2, |
| 283 | |
| 284 | IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE = 0x00c0, |
| 285 | IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_UNKNOWN = 0, |
| 286 | IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_1X = 1, |
| 287 | IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_2X = 2, |
| 288 | IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_4X = 3, |
| 289 | IEEE80211_RADIOTAP_HE_DATA5_NUM_LTF_SYMS = 0x0700, |
| 290 | IEEE80211_RADIOTAP_HE_DATA5_PRE_FEC_PAD = 0x3000, |
| 291 | IEEE80211_RADIOTAP_HE_DATA5_TXBF = 0x4000, |
| 292 | IEEE80211_RADIOTAP_HE_DATA5_PE_DISAMBIG = 0x8000, |
| 293 | |
| 294 | IEEE80211_RADIOTAP_HE_DATA6_NSTS = 0x000f, |
| 295 | IEEE80211_RADIOTAP_HE_DATA6_DOPPLER = 0x0010, |
Johannes Berg | 74cf15c | 2018-12-03 15:59:40 +0100 | [diff] [blame] | 296 | IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW_KNOWN = 0x0020, |
| 297 | IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW = 0x00c0, |
| 298 | IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW_20MHZ = 0, |
| 299 | IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW_40MHZ = 1, |
| 300 | IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW_80MHZ = 2, |
| 301 | IEEE80211_RADIOTAP_HE_DATA6_TB_PPDU_BW_160MHZ = 3, |
Luca Coelho | 95a28ee | 2018-06-09 09:14:43 +0300 | [diff] [blame] | 302 | IEEE80211_RADIOTAP_HE_DATA6_TXOP = 0x7f00, |
| 303 | IEEE80211_RADIOTAP_HE_DATA6_MIDAMBLE_PDCTY = 0x8000, |
| 304 | }; |
| 305 | |
| 306 | struct ieee80211_radiotap_he_mu { |
| 307 | __le16 flags1, flags2; |
| 308 | u8 ru_ch1[4]; |
| 309 | u8 ru_ch2[4]; |
| 310 | }; |
| 311 | |
| 312 | enum ieee80211_radiotap_he_mu_bits { |
| 313 | IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_MCS = 0x000f, |
| 314 | IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_MCS_KNOWN = 0x0010, |
| 315 | IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_DCM = 0x0020, |
| 316 | IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_DCM_KNOWN = 0x0040, |
| 317 | IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH2_CTR_26T_RU_KNOWN = 0x0080, |
| 318 | IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH1_RU_KNOWN = 0x0100, |
| 319 | IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH2_RU_KNOWN = 0x0200, |
| 320 | IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH1_CTR_26T_RU_KNOWN = 0x1000, |
| 321 | IEEE80211_RADIOTAP_HE_MU_FLAGS1_CH1_CTR_26T_RU = 0x2000, |
| 322 | IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_COMP_KNOWN = 0x4000, |
| 323 | IEEE80211_RADIOTAP_HE_MU_FLAGS1_SIG_B_SYMS_USERS_KNOWN = 0x8000, |
| 324 | |
| 325 | IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW = 0x0003, |
| 326 | IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_20MHZ = 0x0000, |
| 327 | IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_40MHZ = 0x0001, |
| 328 | IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_80MHZ = 0x0002, |
| 329 | IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_160MHZ = 0x0003, |
| 330 | IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_KNOWN = 0x0004, |
| 331 | IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_COMP = 0x0008, |
| 332 | IEEE80211_RADIOTAP_HE_MU_FLAGS2_SIG_B_SYMS_USERS = 0x00f0, |
| 333 | IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW = 0x0300, |
| 334 | IEEE80211_RADIOTAP_HE_MU_FLAGS2_PUNC_FROM_SIG_A_BW_KNOWN= 0x0400, |
| 335 | IEEE80211_RADIOTAP_HE_MU_FLAGS2_CH2_CTR_26T_RU = 0x0800, |
| 336 | }; |
| 337 | |
Shaul Triebitz | d1332e7 | 2018-08-31 11:31:20 +0300 | [diff] [blame] | 338 | enum ieee80211_radiotap_lsig_data1 { |
| 339 | IEEE80211_RADIOTAP_LSIG_DATA1_RATE_KNOWN = 0x0001, |
| 340 | IEEE80211_RADIOTAP_LSIG_DATA1_LENGTH_KNOWN = 0x0002, |
| 341 | }; |
| 342 | |
| 343 | enum ieee80211_radiotap_lsig_data2 { |
| 344 | IEEE80211_RADIOTAP_LSIG_DATA2_RATE = 0x000f, |
| 345 | IEEE80211_RADIOTAP_LSIG_DATA2_LENGTH = 0xfff0, |
| 346 | }; |
| 347 | |
| 348 | struct ieee80211_radiotap_lsig { |
| 349 | __le16 data1, data2; |
| 350 | }; |
| 351 | |
Shaul Triebitz | c3d1f87 | 2018-09-05 08:06:06 +0300 | [diff] [blame] | 352 | enum ieee80211_radiotap_zero_len_psdu_type { |
| 353 | IEEE80211_RADIOTAP_ZERO_LEN_PSDU_SOUNDING = 0, |
Johannes Berg | 2ff5e52 | 2019-02-06 13:17:11 +0200 | [diff] [blame] | 354 | IEEE80211_RADIOTAP_ZERO_LEN_PSDU_NOT_CAPTURED = 1, |
Shaul Triebitz | c3d1f87 | 2018-09-05 08:06:06 +0300 | [diff] [blame] | 355 | IEEE80211_RADIOTAP_ZERO_LEN_PSDU_VENDOR = 0xff, |
| 356 | }; |
| 357 | |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 358 | /** |
| 359 | * ieee80211_get_radiotap_len - get radiotap header length |
| 360 | */ |
| 361 | static inline u16 ieee80211_get_radiotap_len(const char *data) |
Johannes Berg | 571ecf6 | 2007-07-27 15:43:22 +0200 | [diff] [blame] | 362 | { |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 363 | struct ieee80211_radiotap_header *hdr = (void *)data; |
Johannes Berg | 571ecf6 | 2007-07-27 15:43:22 +0200 | [diff] [blame] | 364 | |
Harvey Harrison | 8b5ac31 | 2008-07-25 01:45:26 -0700 | [diff] [blame] | 365 | return get_unaligned_le16(&hdr->it_len); |
Johannes Berg | 571ecf6 | 2007-07-27 15:43:22 +0200 | [diff] [blame] | 366 | } |
| 367 | |
Johannes Berg | 42f82e2 | 2017-01-25 15:36:57 +0100 | [diff] [blame] | 368 | #endif /* __RADIOTAP_H */ |