1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
3 * Copyright (C) 2012-2014, 2018-2020 Intel Corporation
4 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5 * Copyright (C) 2015-2017 Intel Deutschland GmbH
7 #ifndef __iwl_fw_api_rx_h__
8 #define __iwl_fw_api_rx_h__
10 /* API for pre-9000 hardware */
12 #define IWL_RX_INFO_PHY_CNT 8
13 #define IWL_RX_INFO_ENERGY_ANT_ABC_IDX 1
14 #define IWL_RX_INFO_ENERGY_ANT_A_MSK 0x000000ff
15 #define IWL_RX_INFO_ENERGY_ANT_B_MSK 0x0000ff00
16 #define IWL_RX_INFO_ENERGY_ANT_C_MSK 0x00ff0000
17 #define IWL_RX_INFO_ENERGY_ANT_A_POS 0
18 #define IWL_RX_INFO_ENERGY_ANT_B_POS 8
19 #define IWL_RX_INFO_ENERGY_ANT_C_POS 16
21 enum iwl_mac_context_info
{
22 MAC_CONTEXT_INFO_NONE
,
23 MAC_CONTEXT_INFO_GSCAN
,
27 * struct iwl_rx_phy_info - phy info
28 * (REPLY_RX_PHY_CMD = 0xc0)
29 * @non_cfg_phy_cnt: non configurable DSP phy data byte count
30 * @cfg_phy_cnt: configurable DSP phy data byte count
31 * @stat_id: configurable DSP phy data set ID
32 * @reserved1: reserved
33 * @system_timestamp: GP2 at on air rise
34 * @timestamp: TSF at on air rise
35 * @beacon_time_stamp: beacon at on-air rise
36 * @phy_flags: general phy flags: band, modulation, ...
37 * @channel: channel number
38 * @non_cfg_phy: for various implementations of non_cfg_phy
39 * @rate_n_flags: RATE_MCS_*
40 * @byte_count: frame's byte-count
41 * @frame_time: frame's time on the air, based on byte count and frame rate
43 * @mac_active_msk: what MACs were active when the frame was received
44 * @mac_context_info: additional info on the context in which the frame was
45 * received as defined in &enum iwl_mac_context_info
47 * Before each Rx, the device sends this data. It contains PHY information
48 * about the reception of the packet.
50 struct iwl_rx_phy_info
{
55 __le32 system_timestamp
;
57 __le32 beacon_time_stamp
;
60 __le32 non_cfg_phy
[IWL_RX_INFO_PHY_CNT
];
69 * TCP offload Rx assist info
72 * bits 4:7 - MIC CRC length
73 * bits 8:12 - MAC header length
74 * bit 13 - Padding indication
75 * bit 14 - A-AMSDU indication
76 * bit 15 - Offload enabled
78 enum iwl_csum_rx_assist_info
{
79 CSUM_RXA_RESERVED_MASK
= 0x000f,
80 CSUM_RXA_MICSIZE_MASK
= 0x00f0,
81 CSUM_RXA_HEADERLEN_MASK
= 0x1f00,
82 CSUM_RXA_PADD
= BIT(13),
83 CSUM_RXA_AMSDU
= BIT(14),
84 CSUM_RXA_ENA
= BIT(15)
88 * struct iwl_rx_mpdu_res_start - phy info
89 * @byte_count: byte count of the frame
90 * @assist: see &enum iwl_csum_rx_assist_info
92 struct iwl_rx_mpdu_res_start
{
95 } __packed
; /* _RX_MPDU_RES_START_API_S_VER_2 */
98 * enum iwl_rx_phy_flags - to parse %iwl_rx_phy_info phy_flags
99 * @RX_RES_PHY_FLAGS_BAND_24: true if the packet was received on 2.4 band
100 * @RX_RES_PHY_FLAGS_MOD_CCK: modulation is CCK
101 * @RX_RES_PHY_FLAGS_SHORT_PREAMBLE: true if packet's preamble was short
102 * @RX_RES_PHY_FLAGS_NARROW_BAND: narrow band (<20 MHz) receive
103 * @RX_RES_PHY_FLAGS_ANTENNA: antenna on which the packet was received
104 * @RX_RES_PHY_FLAGS_ANTENNA_POS: antenna bit position
105 * @RX_RES_PHY_FLAGS_AGG: set if the packet was part of an A-MPDU
106 * @RX_RES_PHY_FLAGS_OFDM_HT: The frame was an HT frame
107 * @RX_RES_PHY_FLAGS_OFDM_GF: The frame used GF preamble
108 * @RX_RES_PHY_FLAGS_OFDM_VHT: The frame was a VHT frame
110 enum iwl_rx_phy_flags
{
111 RX_RES_PHY_FLAGS_BAND_24
= BIT(0),
112 RX_RES_PHY_FLAGS_MOD_CCK
= BIT(1),
113 RX_RES_PHY_FLAGS_SHORT_PREAMBLE
= BIT(2),
114 RX_RES_PHY_FLAGS_NARROW_BAND
= BIT(3),
115 RX_RES_PHY_FLAGS_ANTENNA
= (0x7 << 4),
116 RX_RES_PHY_FLAGS_ANTENNA_POS
= 4,
117 RX_RES_PHY_FLAGS_AGG
= BIT(7),
118 RX_RES_PHY_FLAGS_OFDM_HT
= BIT(8),
119 RX_RES_PHY_FLAGS_OFDM_GF
= BIT(9),
120 RX_RES_PHY_FLAGS_OFDM_VHT
= BIT(10),
124 * enum iwl_mvm_rx_status - written by fw for each Rx packet
125 * @RX_MPDU_RES_STATUS_CRC_OK: CRC is fine
126 * @RX_MPDU_RES_STATUS_OVERRUN_OK: there was no RXE overflow
127 * @RX_MPDU_RES_STATUS_SRC_STA_FOUND: station was found
128 * @RX_MPDU_RES_STATUS_KEY_VALID: key was valid
129 * @RX_MPDU_RES_STATUS_KEY_PARAM_OK: key parameters were usable
130 * @RX_MPDU_RES_STATUS_ICV_OK: ICV is fine, if not, the packet is destroyed
131 * @RX_MPDU_RES_STATUS_MIC_OK: used for CCM alg only. TKIP MIC is checked
133 * @RX_MPDU_RES_STATUS_TTAK_OK: TTAK is fine
134 * @RX_MPDU_RES_STATUS_MNG_FRAME_REPLAY_ERR: valid for alg = CCM_CMAC or
135 * alg = CCM only. Checks replay attack for 11w frames. Relevant only if
136 * %RX_MPDU_RES_STATUS_ROBUST_MNG_FRAME is set.
137 * @RX_MPDU_RES_STATUS_SEC_NO_ENC: this frame is not encrypted
138 * @RX_MPDU_RES_STATUS_SEC_WEP_ENC: this frame is encrypted using WEP
139 * @RX_MPDU_RES_STATUS_SEC_CCM_ENC: this frame is encrypted using CCM
140 * @RX_MPDU_RES_STATUS_SEC_TKIP_ENC: this frame is encrypted using TKIP
141 * @RX_MPDU_RES_STATUS_SEC_EXT_ENC: this frame is encrypted using extension
143 * @RX_MPDU_RES_STATUS_SEC_CCM_CMAC_ENC: this frame is encrypted using CCM_CMAC
144 * @RX_MPDU_RES_STATUS_SEC_ENC_ERR: this frame couldn't be decrypted
145 * @RX_MPDU_RES_STATUS_SEC_ENC_MSK: bitmask of the encryption algorithm
146 * @RX_MPDU_RES_STATUS_DEC_DONE: this frame has been successfully decrypted
147 * @RX_MPDU_RES_STATUS_EXT_IV_BIT_CMP: extended IV (set with TKIP)
148 * @RX_MPDU_RES_STATUS_KEY_ID_CMP_BIT: key ID comparison done
149 * @RX_MPDU_RES_STATUS_ROBUST_MNG_FRAME: this frame is an 11w management frame
150 * @RX_MPDU_RES_STATUS_CSUM_DONE: checksum was done by the hw
151 * @RX_MPDU_RES_STATUS_CSUM_OK: checksum found no errors
152 * @RX_MPDU_RES_STATUS_STA_ID_MSK: station ID mask
153 * @RX_MDPU_RES_STATUS_STA_ID_SHIFT: station ID bit shift
155 enum iwl_mvm_rx_status
{
156 RX_MPDU_RES_STATUS_CRC_OK
= BIT(0),
157 RX_MPDU_RES_STATUS_OVERRUN_OK
= BIT(1),
158 RX_MPDU_RES_STATUS_SRC_STA_FOUND
= BIT(2),
159 RX_MPDU_RES_STATUS_KEY_VALID
= BIT(3),
160 RX_MPDU_RES_STATUS_KEY_PARAM_OK
= BIT(4),
161 RX_MPDU_RES_STATUS_ICV_OK
= BIT(5),
162 RX_MPDU_RES_STATUS_MIC_OK
= BIT(6),
163 RX_MPDU_RES_STATUS_TTAK_OK
= BIT(7),
164 RX_MPDU_RES_STATUS_MNG_FRAME_REPLAY_ERR
= BIT(7),
165 RX_MPDU_RES_STATUS_SEC_NO_ENC
= (0 << 8),
166 RX_MPDU_RES_STATUS_SEC_WEP_ENC
= (1 << 8),
167 RX_MPDU_RES_STATUS_SEC_CCM_ENC
= (2 << 8),
168 RX_MPDU_RES_STATUS_SEC_TKIP_ENC
= (3 << 8),
169 RX_MPDU_RES_STATUS_SEC_EXT_ENC
= (4 << 8),
170 RX_MPDU_RES_STATUS_SEC_CCM_CMAC_ENC
= (6 << 8),
171 RX_MPDU_RES_STATUS_SEC_ENC_ERR
= (7 << 8),
172 RX_MPDU_RES_STATUS_SEC_ENC_MSK
= (7 << 8),
173 RX_MPDU_RES_STATUS_DEC_DONE
= BIT(11),
174 RX_MPDU_RES_STATUS_EXT_IV_BIT_CMP
= BIT(13),
175 RX_MPDU_RES_STATUS_KEY_ID_CMP_BIT
= BIT(14),
176 RX_MPDU_RES_STATUS_ROBUST_MNG_FRAME
= BIT(15),
177 RX_MPDU_RES_STATUS_CSUM_DONE
= BIT(16),
178 RX_MPDU_RES_STATUS_CSUM_OK
= BIT(17),
179 RX_MDPU_RES_STATUS_STA_ID_SHIFT
= 24,
180 RX_MPDU_RES_STATUS_STA_ID_MSK
= 0x1f << RX_MDPU_RES_STATUS_STA_ID_SHIFT
,
183 /* 9000 series API */
184 enum iwl_rx_mpdu_mac_flags1
{
185 IWL_RX_MDPU_MFLG1_ADDRTYPE_MASK
= 0x03,
186 IWL_RX_MPDU_MFLG1_MIC_CRC_LEN_MASK
= 0xf0,
187 /* shift should be 4, but the length is measured in 2-byte
188 * words, so shifting only by 3 gives a byte result
190 IWL_RX_MPDU_MFLG1_MIC_CRC_LEN_SHIFT
= 3,
193 enum iwl_rx_mpdu_mac_flags2
{
194 /* in 2-byte words */
195 IWL_RX_MPDU_MFLG2_HDR_LEN_MASK
= 0x1f,
196 IWL_RX_MPDU_MFLG2_PAD
= 0x20,
197 IWL_RX_MPDU_MFLG2_AMSDU
= 0x40,
200 enum iwl_rx_mpdu_amsdu_info
{
201 IWL_RX_MPDU_AMSDU_SUBFRAME_IDX_MASK
= 0x7f,
202 IWL_RX_MPDU_AMSDU_LAST_SUBFRAME
= 0x80,
205 #define RX_MPDU_BAND_POS 6
206 #define RX_MPDU_BAND_MASK 0xC0
207 #define BAND_IN_RX_STATUS(_val) \
208 (((_val) & RX_MPDU_BAND_MASK) >> RX_MPDU_BAND_POS)
210 enum iwl_rx_l3_proto_values
{
213 IWL_RX_L3_TYPE_IPV4_FRAG
,
214 IWL_RX_L3_TYPE_IPV6_FRAG
,
216 IWL_RX_L3_TYPE_IPV6_IN_IPV4
,
218 IWL_RX_L3_TYPE_EAPOL
,
221 #define IWL_RX_L3_PROTO_POS 4
223 enum iwl_rx_l3l4_flags
{
224 IWL_RX_L3L4_IP_HDR_CSUM_OK
= BIT(0),
225 IWL_RX_L3L4_TCP_UDP_CSUM_OK
= BIT(1),
226 IWL_RX_L3L4_TCP_FIN_SYN_RST_PSH
= BIT(2),
227 IWL_RX_L3L4_TCP_ACK
= BIT(3),
228 IWL_RX_L3L4_L3_PROTO_MASK
= 0xf << IWL_RX_L3_PROTO_POS
,
229 IWL_RX_L3L4_L4_PROTO_MASK
= 0xf << 8,
230 IWL_RX_L3L4_RSS_HASH_MASK
= 0xf << 12,
233 enum iwl_rx_mpdu_status
{
234 IWL_RX_MPDU_STATUS_CRC_OK
= BIT(0),
235 IWL_RX_MPDU_STATUS_OVERRUN_OK
= BIT(1),
236 IWL_RX_MPDU_STATUS_SRC_STA_FOUND
= BIT(2),
237 IWL_RX_MPDU_STATUS_KEY_VALID
= BIT(3),
238 IWL_RX_MPDU_STATUS_KEY_PARAM_OK
= BIT(4),
239 IWL_RX_MPDU_STATUS_ICV_OK
= BIT(5),
240 IWL_RX_MPDU_STATUS_MIC_OK
= BIT(6),
241 IWL_RX_MPDU_RES_STATUS_TTAK_OK
= BIT(7),
242 IWL_RX_MPDU_STATUS_SEC_MASK
= 0x7 << 8,
243 IWL_RX_MPDU_STATUS_SEC_UNKNOWN
= IWL_RX_MPDU_STATUS_SEC_MASK
,
244 IWL_RX_MPDU_STATUS_SEC_NONE
= 0x0 << 8,
245 IWL_RX_MPDU_STATUS_SEC_WEP
= 0x1 << 8,
246 IWL_RX_MPDU_STATUS_SEC_CCM
= 0x2 << 8,
247 IWL_RX_MPDU_STATUS_SEC_TKIP
= 0x3 << 8,
248 IWL_RX_MPDU_STATUS_SEC_EXT_ENC
= 0x4 << 8,
249 IWL_RX_MPDU_STATUS_SEC_GCM
= 0x5 << 8,
250 IWL_RX_MPDU_STATUS_DECRYPTED
= BIT(11),
251 IWL_RX_MPDU_STATUS_WEP_MATCH
= BIT(12),
252 IWL_RX_MPDU_STATUS_EXT_IV_MATCH
= BIT(13),
253 IWL_RX_MPDU_STATUS_KEY_ID_MATCH
= BIT(14),
254 IWL_RX_MPDU_STATUS_ROBUST_MNG_FRAME
= BIT(15),
256 IWL_RX_MPDU_STATUS_KEY
= 0x3f0000,
257 IWL_RX_MPDU_STATUS_DUPLICATE
= BIT(22),
259 IWL_RX_MPDU_STATUS_STA_ID
= 0x1f000000,
262 #define IWL_RX_REORDER_DATA_INVALID_BAID 0x7f
264 enum iwl_rx_mpdu_reorder_data
{
265 IWL_RX_MPDU_REORDER_NSSN_MASK
= 0x00000fff,
266 IWL_RX_MPDU_REORDER_SN_MASK
= 0x00fff000,
267 IWL_RX_MPDU_REORDER_SN_SHIFT
= 12,
268 IWL_RX_MPDU_REORDER_BAID_MASK
= 0x7f000000,
269 IWL_RX_MPDU_REORDER_BAID_SHIFT
= 24,
270 IWL_RX_MPDU_REORDER_BA_OLD_SN
= 0x80000000,
273 enum iwl_rx_mpdu_phy_info
{
274 IWL_RX_MPDU_PHY_AMPDU
= BIT(5),
275 IWL_RX_MPDU_PHY_AMPDU_TOGGLE
= BIT(6),
276 IWL_RX_MPDU_PHY_SHORT_PREAMBLE
= BIT(7),
277 /* short preamble is only for CCK, for non-CCK overridden by this */
278 IWL_RX_MPDU_PHY_NCCK_ADDTL_NTFY
= BIT(7),
279 IWL_RX_MPDU_PHY_TSF_OVERLOAD
= BIT(8),
282 enum iwl_rx_mpdu_mac_info
{
283 IWL_RX_MPDU_PHY_MAC_INDEX_MASK
= 0x0f,
284 IWL_RX_MPDU_PHY_PHY_INDEX_MASK
= 0xf0,
287 /* TSF overload low dword */
288 enum iwl_rx_phy_data0
{
289 /* info type: HE any */
290 IWL_RX_PHY_DATA0_HE_BEAM_CHNG
= 0x00000001,
291 IWL_RX_PHY_DATA0_HE_UPLINK
= 0x00000002,
292 IWL_RX_PHY_DATA0_HE_BSS_COLOR_MASK
= 0x000000fc,
293 IWL_RX_PHY_DATA0_HE_SPATIAL_REUSE_MASK
= 0x00000f00,
295 IWL_RX_PHY_DATA0_HE_TXOP_DUR_MASK
= 0x000fe000,
296 IWL_RX_PHY_DATA0_HE_LDPC_EXT_SYM
= 0x00100000,
297 IWL_RX_PHY_DATA0_HE_PRE_FEC_PAD_MASK
= 0x00600000,
298 IWL_RX_PHY_DATA0_HE_PE_DISAMBIG
= 0x00800000,
299 IWL_RX_PHY_DATA0_HE_DOPPLER
= 0x01000000,
300 /* 6 bits reserved */
301 IWL_RX_PHY_DATA0_HE_DELIM_EOF
= 0x80000000,
304 enum iwl_rx_phy_info_type
{
305 IWL_RX_PHY_INFO_TYPE_NONE
= 0,
306 IWL_RX_PHY_INFO_TYPE_CCK
= 1,
307 IWL_RX_PHY_INFO_TYPE_OFDM_LGCY
= 2,
308 IWL_RX_PHY_INFO_TYPE_HT
= 3,
309 IWL_RX_PHY_INFO_TYPE_VHT_SU
= 4,
310 IWL_RX_PHY_INFO_TYPE_VHT_MU
= 5,
311 IWL_RX_PHY_INFO_TYPE_HE_SU
= 6,
312 IWL_RX_PHY_INFO_TYPE_HE_MU
= 7,
313 IWL_RX_PHY_INFO_TYPE_HE_TB
= 8,
314 IWL_RX_PHY_INFO_TYPE_HE_MU_EXT
= 9,
315 IWL_RX_PHY_INFO_TYPE_HE_TB_EXT
= 10,
318 /* TSF overload high dword */
319 enum iwl_rx_phy_data1
{
321 * check this first - if TSF overload is set,
322 * see &enum iwl_rx_phy_info_type
324 IWL_RX_PHY_DATA1_INFO_TYPE_MASK
= 0xf0000000,
326 /* info type: HT/VHT/HE any */
327 IWL_RX_PHY_DATA1_LSIG_LEN_MASK
= 0x0fff0000,
329 /* info type: HE MU/MU-EXT */
330 IWL_RX_PHY_DATA1_HE_MU_SIGB_COMPRESSION
= 0x00000001,
331 IWL_RX_PHY_DATA1_HE_MU_SIBG_SYM_OR_USER_NUM_MASK
= 0x0000001e,
333 /* info type: HE any */
334 IWL_RX_PHY_DATA1_HE_LTF_NUM_MASK
= 0x000000e0,
335 IWL_RX_PHY_DATA1_HE_RU_ALLOC_SEC80
= 0x00000100,
336 /* trigger encoded */
337 IWL_RX_PHY_DATA1_HE_RU_ALLOC_MASK
= 0x0000fe00,
339 /* info type: HE TB/TX-EXT */
340 IWL_RX_PHY_DATA1_HE_TB_PILOT_TYPE
= 0x00000001,
341 IWL_RX_PHY_DATA1_HE_TB_LOW_SS_MASK
= 0x0000000e,
344 /* goes into Metadata DW 7 */
345 enum iwl_rx_phy_data2
{
346 /* info type: HE MU-EXT */
347 /* the a1/a2/... is what the PHY/firmware calls the values */
348 IWL_RX_PHY_DATA2_HE_MU_EXT_CH1_RU0
= 0x000000ff, /* a1 */
349 IWL_RX_PHY_DATA2_HE_MU_EXT_CH1_RU2
= 0x0000ff00, /* a2 */
350 IWL_RX_PHY_DATA2_HE_MU_EXT_CH2_RU0
= 0x00ff0000, /* b1 */
351 IWL_RX_PHY_DATA2_HE_MU_EXT_CH2_RU2
= 0xff000000, /* b2 */
353 /* info type: HE TB-EXT */
354 IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE1
= 0x0000000f,
355 IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE2
= 0x000000f0,
356 IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE3
= 0x00000f00,
357 IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE4
= 0x0000f000,
360 /* goes into Metadata DW 8 */
361 enum iwl_rx_phy_data3
{
362 /* info type: HE MU-EXT */
363 IWL_RX_PHY_DATA3_HE_MU_EXT_CH1_RU1
= 0x000000ff, /* c1 */
364 IWL_RX_PHY_DATA3_HE_MU_EXT_CH1_RU3
= 0x0000ff00, /* c2 */
365 IWL_RX_PHY_DATA3_HE_MU_EXT_CH2_RU1
= 0x00ff0000, /* d1 */
366 IWL_RX_PHY_DATA3_HE_MU_EXT_CH2_RU3
= 0xff000000, /* d2 */
369 /* goes into Metadata DW 4 high 16 bits */
370 enum iwl_rx_phy_data4
{
371 /* info type: HE MU-EXT */
372 IWL_RX_PHY_DATA4_HE_MU_EXT_CH1_CTR_RU
= 0x0001,
373 IWL_RX_PHY_DATA4_HE_MU_EXT_CH2_CTR_RU
= 0x0002,
374 IWL_RX_PHY_DATA4_HE_MU_EXT_CH1_CRC_OK
= 0x0004,
375 IWL_RX_PHY_DATA4_HE_MU_EXT_CH2_CRC_OK
= 0x0008,
376 IWL_RX_PHY_DATA4_HE_MU_EXT_SIGB_MCS_MASK
= 0x00f0,
377 IWL_RX_PHY_DATA4_HE_MU_EXT_SIGB_DCM
= 0x0100,
378 IWL_RX_PHY_DATA4_HE_MU_EXT_PREAMBLE_PUNC_TYPE_MASK
= 0x0600,
382 * struct iwl_rx_mpdu_desc_v1 - RX MPDU descriptor
384 struct iwl_rx_mpdu_desc_v1
{
385 /* DW7 - carries rss_hash only when rpa_en == 1 */
388 * @rss_hash: RSS hash value
393 * @phy_data2: depends on info type (see @phy_data1)
398 /* DW8 - carries filter_match only when rpa_en == 1 */
401 * @filter_match: filter match value
406 * @phy_data3: depends on info type (see @phy_data1)
413 * @rate_n_flags: RX rate/flags encoding
418 * @energy_a: energy chain A
422 * @energy_b: energy chain B
426 * @channel: channel number
430 * @mac_context: MAC context mask
435 * @gp2_on_air_rise: GP2 timer value on air rise (INA)
437 __le32 gp2_on_air_rise
;
442 * TSF value on air rise (INA), only valid if
443 * %IWL_RX_MPDU_PHY_TSF_OVERLOAD isn't set
445 __le64 tsf_on_air_rise
;
449 * @phy_data0: depends on info_type, see @phy_data1
453 * @phy_data1: valid only if
454 * %IWL_RX_MPDU_PHY_TSF_OVERLOAD is set,
455 * see &enum iwl_rx_phy_data1.
463 * struct iwl_rx_mpdu_desc_v3 - RX MPDU descriptor
465 struct iwl_rx_mpdu_desc_v3
{
466 /* DW7 - carries filter_match only when rpa_en == 1 */
469 * @filter_match: filter match value
474 * @phy_data3: depends on info type (see @phy_data1)
479 /* DW8 - carries rss_hash only when rpa_en == 1 */
482 * @rss_hash: RSS hash value
487 * @phy_data2: depends on info type (see @phy_data1)
493 * @partial_hash: 31:0 ip/tcp header hash
494 * w/o some fields (such as IP SRC addr)
499 * @raw_xsum: raw xsum value
503 * @reserved_xsum: reserved high bits in the raw checksum
505 __le16 reserved_xsum
;
508 * @rate_n_flags: RX rate/flags encoding
513 * @energy_a: energy chain A
517 * @energy_b: energy chain B
521 * @channel: channel number
525 * @mac_context: MAC context mask
530 * @gp2_on_air_rise: GP2 timer value on air rise (INA)
532 __le32 gp2_on_air_rise
;
537 * TSF value on air rise (INA), only valid if
538 * %IWL_RX_MPDU_PHY_TSF_OVERLOAD isn't set
540 __le64 tsf_on_air_rise
;
544 * @phy_data0: depends on info_type, see @phy_data1
548 * @phy_data1: valid only if
549 * %IWL_RX_MPDU_PHY_TSF_OVERLOAD is set,
550 * see &enum iwl_rx_phy_data1.
557 * @reserved: reserved
560 } __packed
; /* RX_MPDU_RES_START_API_S_VER_3 */
563 * struct iwl_rx_mpdu_desc - RX MPDU descriptor
565 struct iwl_rx_mpdu_desc
{
568 * @mpdu_len: MPDU length
572 * @mac_flags1: &enum iwl_rx_mpdu_mac_flags1
576 * @mac_flags2: &enum iwl_rx_mpdu_mac_flags2
581 * @amsdu_info: &enum iwl_rx_mpdu_amsdu_info
585 * @phy_info: &enum iwl_rx_mpdu_phy_info
589 * @mac_phy_idx: MAC/PHY index
592 /* DW4 - carries csum data only when rpa_en == 1 */
594 * @raw_csum: raw checksum (alledgedly unreliable)
600 * @l3l4_flags: &enum iwl_rx_l3l4_flags
605 * @phy_data4: depends on info type, see phy_data1
611 * @status: &enum iwl_rx_mpdu_status
617 * @reorder_data: &enum iwl_rx_mpdu_reorder_data
622 struct iwl_rx_mpdu_desc_v1 v1
;
623 struct iwl_rx_mpdu_desc_v3 v3
;
625 } __packed
; /* RX_MPDU_RES_START_API_S_VER_3 */
627 #define IWL_RX_DESC_SIZE_V1 offsetofend(struct iwl_rx_mpdu_desc, v1)
629 #define RX_NO_DATA_CHAIN_A_POS 0
630 #define RX_NO_DATA_CHAIN_A_MSK (0xff << RX_NO_DATA_CHAIN_A_POS)
631 #define RX_NO_DATA_CHAIN_B_POS 8
632 #define RX_NO_DATA_CHAIN_B_MSK (0xff << RX_NO_DATA_CHAIN_B_POS)
633 #define RX_NO_DATA_CHANNEL_POS 16
634 #define RX_NO_DATA_CHANNEL_MSK (0xff << RX_NO_DATA_CHANNEL_POS)
636 #define RX_NO_DATA_INFO_TYPE_POS 0
637 #define RX_NO_DATA_INFO_TYPE_MSK (0xff << RX_NO_DATA_INFO_TYPE_POS)
638 #define RX_NO_DATA_INFO_TYPE_NONE 0
639 #define RX_NO_DATA_INFO_TYPE_RX_ERR 1
640 #define RX_NO_DATA_INFO_TYPE_NDP 2
641 #define RX_NO_DATA_INFO_TYPE_MU_UNMATCHED 3
642 #define RX_NO_DATA_INFO_TYPE_HE_TB_UNMATCHED 4
644 #define RX_NO_DATA_INFO_ERR_POS 8
645 #define RX_NO_DATA_INFO_ERR_MSK (0xff << RX_NO_DATA_INFO_ERR_POS)
646 #define RX_NO_DATA_INFO_ERR_NONE 0
647 #define RX_NO_DATA_INFO_ERR_BAD_PLCP 1
648 #define RX_NO_DATA_INFO_ERR_UNSUPPORTED_RATE 2
649 #define RX_NO_DATA_INFO_ERR_NO_DELIM 3
650 #define RX_NO_DATA_INFO_ERR_BAD_MAC_HDR 4
652 #define RX_NO_DATA_FRAME_TIME_POS 0
653 #define RX_NO_DATA_FRAME_TIME_MSK (0xfffff << RX_NO_DATA_FRAME_TIME_POS)
655 #define RX_NO_DATA_RX_VEC0_HE_NSTS_MSK 0x03800000
656 #define RX_NO_DATA_RX_VEC0_VHT_NSTS_MSK 0x38000000
659 * struct iwl_rx_no_data - RX no data descriptor
660 * @info: 7:0 frame type, 15:8 RX error type
661 * @rssi: 7:0 energy chain-A,
662 * 15:8 chain-B, measured at FINA time (FINA_ENERGY), 16:23 channel
663 * @on_air_rise_time: GP2 during on air rise
664 * @fr_time: frame time
665 * @rate: rate/mcs of frame
666 * @phy_info: &enum iwl_rx_phy_data0 and &enum iwl_rx_phy_info_type
667 * @rx_vec: DW-12:9 raw RX vectors from DSP according to modulation type.
668 * for VHT: OFDM_RX_VECTOR_SIGA1_OUT, OFDM_RX_VECTOR_SIGA2_OUT
669 * for HE: OFDM_RX_VECTOR_HE_SIGA1_OUT, OFDM_RX_VECTOR_HE_SIGA2_OUT
671 struct iwl_rx_no_data
{
674 __le32 on_air_rise_time
;
679 } __packed
; /* RX_NO_DATA_NTFY_API_S_VER_1 */
681 struct iwl_frame_release
{
688 * enum iwl_bar_frame_release_sta_tid - STA/TID information for BAR release
689 * @IWL_BAR_FRAME_RELEASE_TID_MASK: TID mask
690 * @IWL_BAR_FRAME_RELEASE_STA_MASK: STA mask
692 enum iwl_bar_frame_release_sta_tid
{
693 IWL_BAR_FRAME_RELEASE_TID_MASK
= 0x0000000f,
694 IWL_BAR_FRAME_RELEASE_STA_MASK
= 0x000001f0,
698 * enum iwl_bar_frame_release_ba_info - BA information for BAR release
699 * @IWL_BAR_FRAME_RELEASE_NSSN_MASK: NSSN mask
700 * @IWL_BAR_FRAME_RELEASE_SN_MASK: SN mask (ignored by driver)
701 * @IWL_BAR_FRAME_RELEASE_BAID_MASK: BAID mask
703 enum iwl_bar_frame_release_ba_info
{
704 IWL_BAR_FRAME_RELEASE_NSSN_MASK
= 0x00000fff,
705 IWL_BAR_FRAME_RELEASE_SN_MASK
= 0x00fff000,
706 IWL_BAR_FRAME_RELEASE_BAID_MASK
= 0x3f000000,
710 * struct iwl_bar_frame_release - frame release from BAR info
711 * @sta_tid: STA & TID information, see &enum iwl_bar_frame_release_sta_tid.
712 * @ba_info: BA information, see &enum iwl_bar_frame_release_ba_info.
714 struct iwl_bar_frame_release
{
717 } __packed
; /* RX_BAR_TO_FRAME_RELEASE_API_S_VER_1 */
719 enum iwl_rss_hash_func_en
{
720 IWL_RSS_HASH_TYPE_IPV4_TCP
,
721 IWL_RSS_HASH_TYPE_IPV4_UDP
,
722 IWL_RSS_HASH_TYPE_IPV4_PAYLOAD
,
723 IWL_RSS_HASH_TYPE_IPV6_TCP
,
724 IWL_RSS_HASH_TYPE_IPV6_UDP
,
725 IWL_RSS_HASH_TYPE_IPV6_PAYLOAD
,
728 #define IWL_RSS_HASH_KEY_CNT 10
729 #define IWL_RSS_INDIRECTION_TABLE_SIZE 128
730 #define IWL_RSS_ENABLE 1
733 * struct iwl_rss_config_cmd - RSS (Receive Side Scaling) configuration
735 * @flags: 1 - enable, 0 - disable
736 * @hash_mask: Type of RSS to use. Values are from %iwl_rss_hash_func_en
737 * @reserved: reserved
738 * @secret_key: 320 bit input of random key configuration from driver
739 * @indirection_table: indirection table
741 struct iwl_rss_config_cmd
{
745 __le32 secret_key
[IWL_RSS_HASH_KEY_CNT
];
746 u8 indirection_table
[IWL_RSS_INDIRECTION_TABLE_SIZE
];
747 } __packed
; /* RSS_CONFIG_CMD_API_S_VER_1 */
749 #define IWL_MULTI_QUEUE_SYNC_SENDER_POS 0
750 #define IWL_MULTI_QUEUE_SYNC_SENDER_MSK 0xf
753 * struct iwl_rxq_sync_cmd - RXQ notification trigger
755 * @flags: flags of the notification. bit 0:3 are the sender queue
756 * @rxq_mask: rx queues to send the notification on
757 * @count: number of bytes in payload, should be DWORD aligned
758 * @payload: data to send to rx queues
760 struct iwl_rxq_sync_cmd
{
765 } __packed
; /* MULTI_QUEUE_DRV_SYNC_HDR_CMD_API_S_VER_1 */
768 * struct iwl_rxq_sync_notification - Notification triggered by RXQ
771 * @count: number of bytes in payload
772 * @payload: data to send to rx queues
774 struct iwl_rxq_sync_notification
{
777 } __packed
; /* MULTI_QUEUE_DRV_SYNC_HDR_CMD_API_S_VER_1 */
780 * enum iwl_mvm_rxq_notif_type - Internal message identifier
782 * @IWL_MVM_RXQ_EMPTY: empty sync notification
783 * @IWL_MVM_RXQ_NOTIF_DEL_BA: notify RSS queues of delBA
784 * @IWL_MVM_RXQ_NSSN_SYNC: notify all the RSS queues with the new NSSN
786 enum iwl_mvm_rxq_notif_type
{
788 IWL_MVM_RXQ_NOTIF_DEL_BA
,
789 IWL_MVM_RXQ_NSSN_SYNC
,
793 * struct iwl_mvm_internal_rxq_notif - Internal representation of the data sent
794 * in &iwl_rxq_sync_cmd. Should be DWORD aligned.
795 * FW is agnostic to the payload, so there are no endianity requirements.
797 * @type: value from &iwl_mvm_rxq_notif_type
798 * @sync: ctrl path is waiting for all notifications to be received
799 * @cookie: internal cookie to identify old notifications
802 struct iwl_mvm_internal_rxq_notif
{
810 * enum iwl_mvm_pm_event - type of station PM event
811 * @IWL_MVM_PM_EVENT_AWAKE: station woke up
812 * @IWL_MVM_PM_EVENT_ASLEEP: station went to sleep
813 * @IWL_MVM_PM_EVENT_UAPSD: station sent uAPSD trigger
814 * @IWL_MVM_PM_EVENT_PS_POLL: station sent PS-Poll
816 enum iwl_mvm_pm_event
{
817 IWL_MVM_PM_EVENT_AWAKE
,
818 IWL_MVM_PM_EVENT_ASLEEP
,
819 IWL_MVM_PM_EVENT_UAPSD
,
820 IWL_MVM_PM_EVENT_PS_POLL
,
821 }; /* PEER_PM_NTFY_API_E_VER_1 */
824 * struct iwl_mvm_pm_state_notification - station PM state notification
825 * @sta_id: station ID of the station changing state
826 * @type: the new powersave state, see &enum iwl_mvm_pm_event
828 struct iwl_mvm_pm_state_notification
{
833 } __packed
; /* PEER_PM_NTFY_API_S_VER_1 */
835 #define BA_WINDOW_STREAMS_MAX 16
836 #define BA_WINDOW_STATUS_TID_MSK 0x000F
837 #define BA_WINDOW_STATUS_STA_ID_POS 4
838 #define BA_WINDOW_STATUS_STA_ID_MSK 0x01F0
839 #define BA_WINDOW_STATUS_VALID_MSK BIT(9)
842 * struct iwl_ba_window_status_notif - reordering window's status notification
843 * @bitmap: bitmap of received frames [start_seq_num + 0]..[start_seq_num + 63]
844 * @ra_tid: bit 3:0 - TID, bit 8:4 - STA_ID, bit 9 - valid
845 * @start_seq_num: the start sequence number of the bitmap
846 * @mpdu_rx_count: the number of received MPDUs since entering D0i3
848 struct iwl_ba_window_status_notif
{
849 __le64 bitmap
[BA_WINDOW_STREAMS_MAX
];
850 __le16 ra_tid
[BA_WINDOW_STREAMS_MAX
];
851 __le32 start_seq_num
[BA_WINDOW_STREAMS_MAX
];
852 __le16 mpdu_rx_count
[BA_WINDOW_STREAMS_MAX
];
853 } __packed
; /* BA_WINDOW_STATUS_NTFY_API_S_VER_1 */
856 * struct iwl_rfh_queue_config - RX queue configuration
858 * @enable: enable queue
859 * @reserved: alignment
860 * @urbd_stts_wrptr: DMA address of urbd_stts_wrptr
861 * @fr_bd_cb: DMA address of freeRB table
862 * @ur_bd_cb: DMA address of used RB table
863 * @fr_bd_wid: Initial index of the free table
865 struct iwl_rfh_queue_data
{
869 __le64 urbd_stts_wrptr
;
873 } __packed
; /* RFH_QUEUE_CONFIG_S_VER_1 */
876 * struct iwl_rfh_queue_config - RX queue configuration
877 * @num_queues: number of queues configured
878 * @reserved: alignment
879 * @data: DMA addresses per-queue
881 struct iwl_rfh_queue_config
{
884 struct iwl_rfh_queue_data data
[];
885 } __packed
; /* RFH_QUEUE_CONFIG_API_S_VER_1 */
887 #endif /* __iwl_fw_api_rx_h__ */