blob: 59038ade08d8da85fc25a11e907eab2ac68bf599 [file] [log] [blame]
Johannes Bergee6dbb22015-09-02 14:53:39 +02001/******************************************************************************
2 *
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
5 *
6 * GPL LICENSE SUMMARY
7 *
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
Johannes Berg6857df82017-03-15 14:06:53 +010010 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
Johannes Bergee6dbb22015-09-02 14:53:39 +020011 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of version 2 of the GNU General Public License as
14 * published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
24 * USA
25 *
26 * The full GNU General Public License is included in this distribution
27 * in the file called COPYING.
28 *
29 * Contact Information:
Emmanuel Grumbachcb2f8272015-11-17 15:39:56 +020030 * Intel Linux Wireless <linuxwifi@intel.com>
Johannes Bergee6dbb22015-09-02 14:53:39 +020031 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
32 *
33 * BSD LICENSE
34 *
35 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
36 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
Johannes Berg6857df82017-03-15 14:06:53 +010037 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
Johannes Bergee6dbb22015-09-02 14:53:39 +020038 * All rights reserved.
39 *
40 * Redistribution and use in source and binary forms, with or without
41 * modification, are permitted provided that the following conditions
42 * are met:
43 *
44 * * Redistributions of source code must retain the above copyright
45 * notice, this list of conditions and the following disclaimer.
46 * * Redistributions in binary form must reproduce the above copyright
47 * notice, this list of conditions and the following disclaimer in
48 * the documentation and/or other materials provided with the
49 * distribution.
50 * * Neither the name Intel Corporation nor the names of its
51 * contributors may be used to endorse or promote products derived
52 * from this software without specific prior written permission.
53 *
54 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
55 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
56 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
57 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
58 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
59 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
60 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
61 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
62 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
63 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
64 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
65 *
66 *****************************************************************************/
67
68#ifndef __fw_api_rx_h__
69#define __fw_api_rx_h__
70
Johannes Berg13555e82015-09-02 16:16:49 +020071/* API for pre-9000 hardware */
72
Johannes Bergee6dbb22015-09-02 14:53:39 +020073#define IWL_RX_INFO_PHY_CNT 8
74#define IWL_RX_INFO_ENERGY_ANT_ABC_IDX 1
75#define IWL_RX_INFO_ENERGY_ANT_A_MSK 0x000000ff
76#define IWL_RX_INFO_ENERGY_ANT_B_MSK 0x0000ff00
77#define IWL_RX_INFO_ENERGY_ANT_C_MSK 0x00ff0000
78#define IWL_RX_INFO_ENERGY_ANT_A_POS 0
79#define IWL_RX_INFO_ENERGY_ANT_B_POS 8
80#define IWL_RX_INFO_ENERGY_ANT_C_POS 16
81
Emmanuel Grumbachc8124072015-12-16 11:26:09 +020082enum iwl_mac_context_info {
83 MAC_CONTEXT_INFO_NONE,
84 MAC_CONTEXT_INFO_GSCAN,
85};
86
Johannes Bergee6dbb22015-09-02 14:53:39 +020087/**
88 * struct iwl_rx_phy_info - phy info
89 * (REPLY_RX_PHY_CMD = 0xc0)
90 * @non_cfg_phy_cnt: non configurable DSP phy data byte count
91 * @cfg_phy_cnt: configurable DSP phy data byte count
92 * @stat_id: configurable DSP phy data set ID
Johannes Bergacf91dd2017-05-16 16:15:42 +020093 * @reserved1: reserved
Johannes Bergee6dbb22015-09-02 14:53:39 +020094 * @system_timestamp: GP2 at on air rise
95 * @timestamp: TSF at on air rise
96 * @beacon_time_stamp: beacon at on-air rise
97 * @phy_flags: general phy flags: band, modulation, ...
98 * @channel: channel number
Johannes Berg83b03192017-05-16 13:28:53 +020099 * @non_cfg_phy: for various implementations of non_cfg_phy
Johannes Bergee6dbb22015-09-02 14:53:39 +0200100 * @rate_n_flags: RATE_MCS_*
101 * @byte_count: frame's byte-count
102 * @frame_time: frame's time on the air, based on byte count and frame rate
103 * calculation
104 * @mac_active_msk: what MACs were active when the frame was received
Emmanuel Grumbachc8124072015-12-16 11:26:09 +0200105 * @mac_context_info: additional info on the context in which the frame was
106 * received as defined in &enum iwl_mac_context_info
Johannes Bergee6dbb22015-09-02 14:53:39 +0200107 *
108 * Before each Rx, the device sends this data. It contains PHY information
109 * about the reception of the packet.
110 */
111struct iwl_rx_phy_info {
112 u8 non_cfg_phy_cnt;
113 u8 cfg_phy_cnt;
114 u8 stat_id;
115 u8 reserved1;
116 __le32 system_timestamp;
117 __le64 timestamp;
118 __le32 beacon_time_stamp;
119 __le16 phy_flags;
120 __le16 channel;
121 __le32 non_cfg_phy[IWL_RX_INFO_PHY_CNT];
122 __le32 rate_n_flags;
123 __le32 byte_count;
Emmanuel Grumbachc8124072015-12-16 11:26:09 +0200124 u8 mac_active_msk;
125 u8 mac_context_info;
Johannes Bergee6dbb22015-09-02 14:53:39 +0200126 __le16 frame_time;
127} __packed;
128
129/*
130 * TCP offload Rx assist info
131 *
132 * bits 0:3 - reserved
133 * bits 4:7 - MIC CRC length
134 * bits 8:12 - MAC header length
135 * bit 13 - Padding indication
136 * bit 14 - A-AMSDU indication
137 * bit 15 - Offload enabled
138 */
139enum iwl_csum_rx_assist_info {
140 CSUM_RXA_RESERVED_MASK = 0x000f,
141 CSUM_RXA_MICSIZE_MASK = 0x00f0,
142 CSUM_RXA_HEADERLEN_MASK = 0x1f00,
143 CSUM_RXA_PADD = BIT(13),
144 CSUM_RXA_AMSDU = BIT(14),
145 CSUM_RXA_ENA = BIT(15)
146};
147
148/**
149 * struct iwl_rx_mpdu_res_start - phy info
Johannes Berg31a658b2017-03-09 15:56:57 +0100150 * @byte_count: byte count of the frame
151 * @assist: see &enum iwl_csum_rx_assist_info
Johannes Bergee6dbb22015-09-02 14:53:39 +0200152 */
153struct iwl_rx_mpdu_res_start {
154 __le16 byte_count;
155 __le16 assist;
156} __packed; /* _RX_MPDU_RES_START_API_S_VER_2 */
157
158/**
159 * enum iwl_rx_phy_flags - to parse %iwl_rx_phy_info phy_flags
160 * @RX_RES_PHY_FLAGS_BAND_24: true if the packet was received on 2.4 band
Johannes Bergacf91dd2017-05-16 16:15:42 +0200161 * @RX_RES_PHY_FLAGS_MOD_CCK: modulation is CCK
Johannes Bergee6dbb22015-09-02 14:53:39 +0200162 * @RX_RES_PHY_FLAGS_SHORT_PREAMBLE: true if packet's preamble was short
Johannes Bergacf91dd2017-05-16 16:15:42 +0200163 * @RX_RES_PHY_FLAGS_NARROW_BAND: narrow band (<20 MHz) receive
Johannes Bergee6dbb22015-09-02 14:53:39 +0200164 * @RX_RES_PHY_FLAGS_ANTENNA: antenna on which the packet was received
Johannes Bergacf91dd2017-05-16 16:15:42 +0200165 * @RX_RES_PHY_FLAGS_ANTENNA_POS: antenna bit position
Johannes Bergee6dbb22015-09-02 14:53:39 +0200166 * @RX_RES_PHY_FLAGS_AGG: set if the packet was part of an A-MPDU
167 * @RX_RES_PHY_FLAGS_OFDM_HT: The frame was an HT frame
168 * @RX_RES_PHY_FLAGS_OFDM_GF: The frame used GF preamble
169 * @RX_RES_PHY_FLAGS_OFDM_VHT: The frame was a VHT frame
170 */
171enum iwl_rx_phy_flags {
172 RX_RES_PHY_FLAGS_BAND_24 = BIT(0),
173 RX_RES_PHY_FLAGS_MOD_CCK = BIT(1),
174 RX_RES_PHY_FLAGS_SHORT_PREAMBLE = BIT(2),
175 RX_RES_PHY_FLAGS_NARROW_BAND = BIT(3),
176 RX_RES_PHY_FLAGS_ANTENNA = (0x7 << 4),
177 RX_RES_PHY_FLAGS_ANTENNA_POS = 4,
178 RX_RES_PHY_FLAGS_AGG = BIT(7),
179 RX_RES_PHY_FLAGS_OFDM_HT = BIT(8),
180 RX_RES_PHY_FLAGS_OFDM_GF = BIT(9),
181 RX_RES_PHY_FLAGS_OFDM_VHT = BIT(10),
182};
183
184/**
185 * enum iwl_mvm_rx_status - written by fw for each Rx packet
186 * @RX_MPDU_RES_STATUS_CRC_OK: CRC is fine
187 * @RX_MPDU_RES_STATUS_OVERRUN_OK: there was no RXE overflow
Johannes Bergacf91dd2017-05-16 16:15:42 +0200188 * @RX_MPDU_RES_STATUS_SRC_STA_FOUND: station was found
189 * @RX_MPDU_RES_STATUS_KEY_VALID: key was valid
190 * @RX_MPDU_RES_STATUS_KEY_PARAM_OK: key parameters were usable
Johannes Bergee6dbb22015-09-02 14:53:39 +0200191 * @RX_MPDU_RES_STATUS_ICV_OK: ICV is fine, if not, the packet is destroyed
192 * @RX_MPDU_RES_STATUS_MIC_OK: used for CCM alg only. TKIP MIC is checked
193 * in the driver.
194 * @RX_MPDU_RES_STATUS_TTAK_OK: TTAK is fine
195 * @RX_MPDU_RES_STATUS_MNG_FRAME_REPLAY_ERR: valid for alg = CCM_CMAC or
196 * alg = CCM only. Checks replay attack for 11w frames. Relevant only if
197 * %RX_MPDU_RES_STATUS_ROBUST_MNG_FRAME is set.
198 * @RX_MPDU_RES_STATUS_SEC_NO_ENC: this frame is not encrypted
199 * @RX_MPDU_RES_STATUS_SEC_WEP_ENC: this frame is encrypted using WEP
200 * @RX_MPDU_RES_STATUS_SEC_CCM_ENC: this frame is encrypted using CCM
201 * @RX_MPDU_RES_STATUS_SEC_TKIP_ENC: this frame is encrypted using TKIP
Johannes Bergacf91dd2017-05-16 16:15:42 +0200202 * @RX_MPDU_RES_STATUS_SEC_EXT_ENC: this frame is encrypted using extension
203 * algorithm
Johannes Bergee6dbb22015-09-02 14:53:39 +0200204 * @RX_MPDU_RES_STATUS_SEC_CCM_CMAC_ENC: this frame is encrypted using CCM_CMAC
205 * @RX_MPDU_RES_STATUS_SEC_ENC_ERR: this frame couldn't be decrypted
206 * @RX_MPDU_RES_STATUS_SEC_ENC_MSK: bitmask of the encryption algorithm
207 * @RX_MPDU_RES_STATUS_DEC_DONE: this frame has been successfully decrypted
Johannes Bergacf91dd2017-05-16 16:15:42 +0200208 * @RX_MPDU_RES_STATUS_EXT_IV_BIT_CMP: extended IV (set with TKIP)
209 * @RX_MPDU_RES_STATUS_KEY_ID_CMP_BIT: key ID comparison done
Johannes Bergee6dbb22015-09-02 14:53:39 +0200210 * @RX_MPDU_RES_STATUS_ROBUST_MNG_FRAME: this frame is an 11w management frame
211 * @RX_MPDU_RES_STATUS_CSUM_DONE: checksum was done by the hw
212 * @RX_MPDU_RES_STATUS_CSUM_OK: checksum found no errors
Johannes Bergacf91dd2017-05-16 16:15:42 +0200213 * @RX_MPDU_RES_STATUS_STA_ID_MSK: station ID mask
214 * @RX_MDPU_RES_STATUS_STA_ID_SHIFT: station ID bit shift
215 * @RX_MPDU_RES_STATUS_FILTERING_MSK: filter status
216 * @RX_MPDU_RES_STATUS2_FILTERING_MSK: filter status 2
Johannes Bergee6dbb22015-09-02 14:53:39 +0200217 */
218enum iwl_mvm_rx_status {
219 RX_MPDU_RES_STATUS_CRC_OK = BIT(0),
220 RX_MPDU_RES_STATUS_OVERRUN_OK = BIT(1),
221 RX_MPDU_RES_STATUS_SRC_STA_FOUND = BIT(2),
222 RX_MPDU_RES_STATUS_KEY_VALID = BIT(3),
223 RX_MPDU_RES_STATUS_KEY_PARAM_OK = BIT(4),
224 RX_MPDU_RES_STATUS_ICV_OK = BIT(5),
225 RX_MPDU_RES_STATUS_MIC_OK = BIT(6),
226 RX_MPDU_RES_STATUS_TTAK_OK = BIT(7),
227 RX_MPDU_RES_STATUS_MNG_FRAME_REPLAY_ERR = BIT(7),
228 RX_MPDU_RES_STATUS_SEC_NO_ENC = (0 << 8),
229 RX_MPDU_RES_STATUS_SEC_WEP_ENC = (1 << 8),
230 RX_MPDU_RES_STATUS_SEC_CCM_ENC = (2 << 8),
231 RX_MPDU_RES_STATUS_SEC_TKIP_ENC = (3 << 8),
232 RX_MPDU_RES_STATUS_SEC_EXT_ENC = (4 << 8),
233 RX_MPDU_RES_STATUS_SEC_CCM_CMAC_ENC = (6 << 8),
234 RX_MPDU_RES_STATUS_SEC_ENC_ERR = (7 << 8),
235 RX_MPDU_RES_STATUS_SEC_ENC_MSK = (7 << 8),
236 RX_MPDU_RES_STATUS_DEC_DONE = BIT(11),
Johannes Bergee6dbb22015-09-02 14:53:39 +0200237 RX_MPDU_RES_STATUS_EXT_IV_BIT_CMP = BIT(13),
238 RX_MPDU_RES_STATUS_KEY_ID_CMP_BIT = BIT(14),
239 RX_MPDU_RES_STATUS_ROBUST_MNG_FRAME = BIT(15),
240 RX_MPDU_RES_STATUS_CSUM_DONE = BIT(16),
241 RX_MPDU_RES_STATUS_CSUM_OK = BIT(17),
Johannes Berga399f982015-09-24 18:29:00 +0200242 RX_MDPU_RES_STATUS_STA_ID_SHIFT = 24,
243 RX_MPDU_RES_STATUS_STA_ID_MSK = 0x1f << RX_MDPU_RES_STATUS_STA_ID_SHIFT,
Johannes Bergee6dbb22015-09-02 14:53:39 +0200244 RX_MPDU_RES_STATUS_FILTERING_MSK = (0xc00000),
245 RX_MPDU_RES_STATUS2_FILTERING_MSK = (0xc0000000),
246};
247
Johannes Berg13555e82015-09-02 16:16:49 +0200248/* 9000 series API */
249enum iwl_rx_mpdu_mac_flags1 {
250 IWL_RX_MDPU_MFLG1_ADDRTYPE_MASK = 0x03,
251 IWL_RX_MPDU_MFLG1_MIC_CRC_LEN_MASK = 0xf0,
252 /* shift should be 4, but the length is measured in 2-byte
253 * words, so shifting only by 3 gives a byte result
254 */
255 IWL_RX_MPDU_MFLG1_MIC_CRC_LEN_SHIFT = 3,
256};
257
258enum iwl_rx_mpdu_mac_flags2 {
259 /* in 2-byte words */
260 IWL_RX_MPDU_MFLG2_HDR_LEN_MASK = 0x1f,
261 IWL_RX_MPDU_MFLG2_PAD = 0x20,
262 IWL_RX_MPDU_MFLG2_AMSDU = 0x40,
263};
264
265enum iwl_rx_mpdu_amsdu_info {
Sara Sharon30d915c2016-03-03 16:49:05 +0200266 IWL_RX_MPDU_AMSDU_SUBFRAME_IDX_MASK = 0x7f,
267 IWL_RX_MPDU_AMSDU_LAST_SUBFRAME = 0x80,
Johannes Berg13555e82015-09-02 16:16:49 +0200268};
269
Sara Sharonb238be02016-03-16 13:57:50 +0200270enum iwl_rx_l3_proto_values {
271 IWL_RX_L3_TYPE_NONE,
272 IWL_RX_L3_TYPE_IPV4,
273 IWL_RX_L3_TYPE_IPV4_FRAG,
274 IWL_RX_L3_TYPE_IPV6_FRAG,
275 IWL_RX_L3_TYPE_IPV6,
276 IWL_RX_L3_TYPE_IPV6_IN_IPV4,
277 IWL_RX_L3_TYPE_ARP,
278 IWL_RX_L3_TYPE_EAPOL,
279};
280
281#define IWL_RX_L3_PROTO_POS 4
282
Johannes Berg13555e82015-09-02 16:16:49 +0200283enum iwl_rx_l3l4_flags {
284 IWL_RX_L3L4_IP_HDR_CSUM_OK = BIT(0),
285 IWL_RX_L3L4_TCP_UDP_CSUM_OK = BIT(1),
286 IWL_RX_L3L4_TCP_FIN_SYN_RST_PSH = BIT(2),
287 IWL_RX_L3L4_TCP_ACK = BIT(3),
Sara Sharonb238be02016-03-16 13:57:50 +0200288 IWL_RX_L3L4_L3_PROTO_MASK = 0xf << IWL_RX_L3_PROTO_POS,
Johannes Berg13555e82015-09-02 16:16:49 +0200289 IWL_RX_L3L4_L4_PROTO_MASK = 0xf << 8,
290 IWL_RX_L3L4_RSS_HASH_MASK = 0xf << 12,
291};
292
293enum iwl_rx_mpdu_status {
294 IWL_RX_MPDU_STATUS_CRC_OK = BIT(0),
295 IWL_RX_MPDU_STATUS_OVERRUN_OK = BIT(1),
296 IWL_RX_MPDU_STATUS_SRC_STA_FOUND = BIT(2),
297 IWL_RX_MPDU_STATUS_KEY_VALID = BIT(3),
Ayala Beker99980ec2016-06-01 11:46:20 +0300298 IWL_RX_MPDU_STATUS_KEY_PARAM_OK = BIT(4),
Johannes Berg13555e82015-09-02 16:16:49 +0200299 IWL_RX_MPDU_STATUS_ICV_OK = BIT(5),
300 IWL_RX_MPDU_STATUS_MIC_OK = BIT(6),
Johannes Berg780e87c2015-09-03 14:56:10 +0200301 IWL_RX_MPDU_RES_STATUS_TTAK_OK = BIT(7),
Johannes Berg13555e82015-09-02 16:16:49 +0200302 IWL_RX_MPDU_STATUS_SEC_MASK = 0x7 << 8,
303 IWL_RX_MPDU_STATUS_SEC_NONE = 0x0 << 8,
304 IWL_RX_MPDU_STATUS_SEC_WEP = 0x1 << 8,
305 IWL_RX_MPDU_STATUS_SEC_CCM = 0x2 << 8,
306 IWL_RX_MPDU_STATUS_SEC_TKIP = 0x3 << 8,
Johannes Berg780e87c2015-09-03 14:56:10 +0200307 IWL_RX_MPDU_STATUS_SEC_EXT_ENC = 0x4 << 8,
Johannes Berg780e87c2015-09-03 14:56:10 +0200308 IWL_RX_MPDU_STATUS_SEC_GCM = 0x5 << 8,
Johannes Berg13555e82015-09-02 16:16:49 +0200309 IWL_RX_MPDU_STATUS_DECRYPTED = BIT(11),
310 IWL_RX_MPDU_STATUS_WEP_MATCH = BIT(12),
311 IWL_RX_MPDU_STATUS_EXT_IV_MATCH = BIT(13),
312 IWL_RX_MPDU_STATUS_KEY_ID_MATCH = BIT(14),
Ayala Beker99980ec2016-06-01 11:46:20 +0300313 IWL_RX_MPDU_STATUS_ROBUST_MNG_FRAME = BIT(15),
Johannes Berg13555e82015-09-02 16:16:49 +0200314};
315
316enum iwl_rx_mpdu_hash_filter {
317 IWL_RX_MPDU_HF_A1_HASH_MASK = 0x3f,
318 IWL_RX_MPDU_HF_FILTER_STATUS_MASK = 0xc0,
319};
320
321enum iwl_rx_mpdu_sta_id_flags {
322 IWL_RX_MPDU_SIF_STA_ID_MASK = 0x1f,
323 IWL_RX_MPDU_SIF_RRF_ABORT = 0x20,
324 IWL_RX_MPDU_SIF_FILTER_STATUS_MASK = 0xc0,
325};
326
Sara Sharon585a6fc2015-12-01 13:48:18 +0200327#define IWL_RX_REORDER_DATA_INVALID_BAID 0x7f
328
Johannes Berg13555e82015-09-02 16:16:49 +0200329enum iwl_rx_mpdu_reorder_data {
330 IWL_RX_MPDU_REORDER_NSSN_MASK = 0x00000fff,
331 IWL_RX_MPDU_REORDER_SN_MASK = 0x00fff000,
332 IWL_RX_MPDU_REORDER_SN_SHIFT = 12,
333 IWL_RX_MPDU_REORDER_BAID_MASK = 0x7f000000,
334 IWL_RX_MPDU_REORDER_BAID_SHIFT = 24,
335 IWL_RX_MPDU_REORDER_BA_OLD_SN = 0x80000000,
336};
337
Sara Sharonfbe41122016-04-04 19:28:45 +0300338enum iwl_rx_mpdu_phy_info {
339 IWL_RX_MPDU_PHY_AMPDU = BIT(5),
340 IWL_RX_MPDU_PHY_AMPDU_TOGGLE = BIT(6),
341 IWL_RX_MPDU_PHY_SHORT_PREAMBLE = BIT(7),
342 IWL_RX_MPDU_PHY_TSF_OVERLOAD = BIT(8),
343};
344
345enum iwl_rx_mpdu_mac_info {
346 IWL_RX_MPDU_PHY_MAC_INDEX_MASK = 0x0f,
347 IWL_RX_MPDU_PHY_PHY_INDEX_MASK = 0xf0,
348};
349
Johannes Berg6857df82017-03-15 14:06:53 +0100350/**
351 * struct iwl_rx_mpdu_desc - RX MPDU descriptor
352 */
Johannes Berg13555e82015-09-02 16:16:49 +0200353struct iwl_rx_mpdu_desc {
354 /* DW2 */
Johannes Berg6857df82017-03-15 14:06:53 +0100355 /**
356 * @mpdu_len: MPDU length
357 */
Johannes Berg13555e82015-09-02 16:16:49 +0200358 __le16 mpdu_len;
Johannes Berg6857df82017-03-15 14:06:53 +0100359 /**
360 * @mac_flags1: &enum iwl_rx_mpdu_mac_flags1
361 */
Johannes Berg13555e82015-09-02 16:16:49 +0200362 u8 mac_flags1;
Johannes Berg6857df82017-03-15 14:06:53 +0100363 /**
364 * @mac_flags2: &enum iwl_rx_mpdu_mac_flags2
365 */
Johannes Berg13555e82015-09-02 16:16:49 +0200366 u8 mac_flags2;
367 /* DW3 */
Johannes Berg6857df82017-03-15 14:06:53 +0100368 /**
369 * @amsdu_info: &enum iwl_rx_mpdu_amsdu_info
370 */
Johannes Berg13555e82015-09-02 16:16:49 +0200371 u8 amsdu_info;
Johannes Berg6857df82017-03-15 14:06:53 +0100372 /**
373 * @phy_info: &enum iwl_rx_mpdu_phy_info
374 */
Sara Sharonfbe41122016-04-04 19:28:45 +0300375 __le16 phy_info;
Johannes Berg6857df82017-03-15 14:06:53 +0100376 /**
377 * @mac_phy_idx: MAC/PHY index
378 */
Johannes Berg13555e82015-09-02 16:16:49 +0200379 u8 mac_phy_idx;
Sara Sharonfbe41122016-04-04 19:28:45 +0300380 /* DW4 - carries csum data only when rpa_en == 1 */
Johannes Berg6857df82017-03-15 14:06:53 +0100381 /**
382 * @raw_csum: raw checksum (alledgedly unreliable)
383 */
384 __le16 raw_csum;
385 /**
386 * @l3l4_flags: &enum iwl_rx_l3l4_flags
387 */
Johannes Berg13555e82015-09-02 16:16:49 +0200388 __le16 l3l4_flags;
389 /* DW5 */
Johannes Berg6857df82017-03-15 14:06:53 +0100390 /**
391 * @status: &enum iwl_rx_mpdu_status
392 */
Johannes Berg13555e82015-09-02 16:16:49 +0200393 __le16 status;
Johannes Berg6857df82017-03-15 14:06:53 +0100394 /**
395 * @hash_filter: hash filter value
396 */
Johannes Berg13555e82015-09-02 16:16:49 +0200397 u8 hash_filter;
Johannes Berg6857df82017-03-15 14:06:53 +0100398 /**
399 * @sta_id_flags: &enum iwl_rx_mpdu_sta_id_flags
400 */
Johannes Berg13555e82015-09-02 16:16:49 +0200401 u8 sta_id_flags;
402 /* DW6 */
Johannes Berg6857df82017-03-15 14:06:53 +0100403 /**
404 * @reorder_data: &enum iwl_rx_mpdu_reorder_data
405 */
Johannes Berg13555e82015-09-02 16:16:49 +0200406 __le32 reorder_data;
Sara Sharonfbe41122016-04-04 19:28:45 +0300407 /* DW7 - carries rss_hash only when rpa_en == 1 */
Johannes Berg6857df82017-03-15 14:06:53 +0100408 /**
409 * @rss_hash: RSS hash value
410 */
Johannes Berg13555e82015-09-02 16:16:49 +0200411 __le32 rss_hash;
Sara Sharonfbe41122016-04-04 19:28:45 +0300412 /* DW8 - carries filter_match only when rpa_en == 1 */
Johannes Berg6857df82017-03-15 14:06:53 +0100413 /**
414 * @filter_match: filter match value
415 */
Johannes Berg13555e82015-09-02 16:16:49 +0200416 __le32 filter_match;
417 /* DW9 */
Johannes Berg6857df82017-03-15 14:06:53 +0100418 /**
419 * @rate_n_flags: RX rate/flags encoding
420 */
Johannes Berg13555e82015-09-02 16:16:49 +0200421 __le32 rate_n_flags;
Sara Sharond56a7802016-01-26 12:35:13 +0200422 /* DW10 */
Johannes Berg6857df82017-03-15 14:06:53 +0100423 /**
424 * @energy_a: energy chain A
425 */
426 u8 energy_a;
427 /**
428 * @energy_b: energy chain B
429 */
430 u8 energy_b;
431 /**
432 * @channel: channel number
433 */
434 u8 channel;
435 /**
436 * @mac_context: MAC context mask
437 */
438 u8 mac_context;
Johannes Berg13555e82015-09-02 16:16:49 +0200439 /* DW11 */
Johannes Berg6857df82017-03-15 14:06:53 +0100440 /**
441 * @gp2_on_air_rise: GP2 timer value on air rise (INA)
442 */
Sara Sharond56a7802016-01-26 12:35:13 +0200443 __le32 gp2_on_air_rise;
Johannes Berg6857df82017-03-15 14:06:53 +0100444 /* DW12 & DW13 */
445 /**
446 * @tsf_on_air_rise:
447 * TSF value on air rise (INA), only valid if
448 * %IWL_RX_MPDU_PHY_TSF_OVERLOAD isn't set
449 */
Johannes Berg13555e82015-09-02 16:16:49 +0200450 __le64 tsf_on_air_rise;
451} __packed;
452
453struct iwl_frame_release {
454 u8 baid;
455 u8 reserved;
456 __le16 nssn;
457};
458
Sara Sharon43413a92015-12-31 11:49:18 +0200459enum iwl_rss_hash_func_en {
460 IWL_RSS_HASH_TYPE_IPV4_TCP,
461 IWL_RSS_HASH_TYPE_IPV4_UDP,
462 IWL_RSS_HASH_TYPE_IPV4_PAYLOAD,
463 IWL_RSS_HASH_TYPE_IPV6_TCP,
464 IWL_RSS_HASH_TYPE_IPV6_UDP,
465 IWL_RSS_HASH_TYPE_IPV6_PAYLOAD,
466};
467
468#define IWL_RSS_HASH_KEY_CNT 10
469#define IWL_RSS_INDIRECTION_TABLE_SIZE 128
470#define IWL_RSS_ENABLE 1
471
472/**
473 * struct iwl_rss_config_cmd - RSS (Receive Side Scaling) configuration
474 *
475 * @flags: 1 - enable, 0 - disable
476 * @hash_mask: Type of RSS to use. Values are from %iwl_rss_hash_func_en
Johannes Bergacf91dd2017-05-16 16:15:42 +0200477 * @reserved: reserved
Sara Sharon43413a92015-12-31 11:49:18 +0200478 * @secret_key: 320 bit input of random key configuration from driver
479 * @indirection_table: indirection table
480 */
481struct iwl_rss_config_cmd {
482 __le32 flags;
483 u8 hash_mask;
484 u8 reserved[3];
485 __le32 secret_key[IWL_RSS_HASH_KEY_CNT];
486 u8 indirection_table[IWL_RSS_INDIRECTION_TABLE_SIZE];
487} __packed; /* RSS_CONFIG_CMD_API_S_VER_1 */
488
Sara Sharon94bb4482015-12-16 18:48:28 +0200489#define IWL_MULTI_QUEUE_SYNC_MSG_MAX_SIZE 128
490#define IWL_MULTI_QUEUE_SYNC_SENDER_POS 0
491#define IWL_MULTI_QUEUE_SYNC_SENDER_MSK 0xf
492
493/**
494 * struct iwl_rxq_sync_cmd - RXQ notification trigger
495 *
496 * @flags: flags of the notification. bit 0:3 are the sender queue
497 * @rxq_mask: rx queues to send the notification on
498 * @count: number of bytes in payload, should be DWORD aligned
499 * @payload: data to send to rx queues
500 */
501struct iwl_rxq_sync_cmd {
502 __le32 flags;
503 __le32 rxq_mask;
504 __le32 count;
505 u8 payload[];
506} __packed; /* MULTI_QUEUE_DRV_SYNC_HDR_CMD_API_S_VER_1 */
507
508/**
509 * struct iwl_rxq_sync_notification - Notification triggered by RXQ
510 * sync command
511 *
512 * @count: number of bytes in payload
513 * @payload: data to send to rx queues
514 */
515struct iwl_rxq_sync_notification {
516 __le32 count;
517 u8 payload[];
518} __packed; /* MULTI_QUEUE_DRV_SYNC_HDR_CMD_API_S_VER_1 */
519
520/**
Johannes Berg31a658b2017-03-09 15:56:57 +0100521 * enum iwl_mvm_rxq_notif_type - Internal message identifier
Johannes Berg7bde4c62016-04-13 14:31:40 +0200522 *
523 * @IWL_MVM_RXQ_EMPTY: empty sync notification
524 * @IWL_MVM_RXQ_NOTIF_DEL_BA: notify RSS queues of delBA
525 */
Sara Sharon94bb4482015-12-16 18:48:28 +0200526enum iwl_mvm_rxq_notif_type {
Sara Sharond0ff5d22016-03-23 16:31:43 +0200527 IWL_MVM_RXQ_EMPTY,
Sara Sharon94bb4482015-12-16 18:48:28 +0200528 IWL_MVM_RXQ_NOTIF_DEL_BA,
529};
530
531/**
Johannes Berg7bde4c62016-04-13 14:31:40 +0200532 * struct iwl_mvm_internal_rxq_notif - Internal representation of the data sent
533 * in &iwl_rxq_sync_cmd. Should be DWORD aligned.
534 * FW is agnostic to the payload, so there are no endianity requirements.
535 *
536 * @type: value from &iwl_mvm_rxq_notif_type
537 * @sync: ctrl path is waiting for all notifications to be received
538 * @cookie: internal cookie to identify old notifications
539 * @data: payload
540 */
Sara Sharon94bb4482015-12-16 18:48:28 +0200541struct iwl_mvm_internal_rxq_notif {
Sara Sharond0ff5d22016-03-23 16:31:43 +0200542 u16 type;
543 u16 sync;
Sara Sharon0636b932016-02-18 14:21:12 +0200544 u32 cookie;
Sara Sharon94bb4482015-12-16 18:48:28 +0200545 u8 data[];
546} __packed;
547
Johannes Berg65e25482016-04-13 14:24:22 +0200548/**
549 * enum iwl_mvm_pm_event - type of station PM event
550 * @IWL_MVM_PM_EVENT_AWAKE: station woke up
551 * @IWL_MVM_PM_EVENT_ASLEEP: station went to sleep
552 * @IWL_MVM_PM_EVENT_UAPSD: station sent uAPSD trigger
553 * @IWL_MVM_PM_EVENT_PS_POLL: station sent PS-Poll
554 */
555enum iwl_mvm_pm_event {
556 IWL_MVM_PM_EVENT_AWAKE,
557 IWL_MVM_PM_EVENT_ASLEEP,
558 IWL_MVM_PM_EVENT_UAPSD,
559 IWL_MVM_PM_EVENT_PS_POLL,
560}; /* PEER_PM_NTFY_API_E_VER_1 */
561
562/**
563 * struct iwl_mvm_pm_state_notification - station PM state notification
564 * @sta_id: station ID of the station changing state
Johannes Berg31a658b2017-03-09 15:56:57 +0100565 * @type: the new powersave state, see &enum iwl_mvm_pm_event
Johannes Berg65e25482016-04-13 14:24:22 +0200566 */
567struct iwl_mvm_pm_state_notification {
568 u8 sta_id;
569 u8 type;
570 /* private: */
Johannes Bergcecb43c2017-05-16 15:12:14 +0200571 __le16 reserved;
Johannes Berg65e25482016-04-13 14:24:22 +0200572} __packed; /* PEER_PM_NTFY_API_S_VER_1 */
573
Johannes Bergee6dbb22015-09-02 14:53:39 +0200574#endif /* __fw_api_rx_h__ */