blob: 97d7eed326228bb018f85410bfb9b6641aeee675 [file] [log] [blame]
Johannes Berg8ca151b2013-01-24 14:25:36 +01001/******************************************************************************
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 *
Emmanuel Grumbach51368bf2013-12-30 13:15:54 +02008 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
Sara Sharonc47de662016-09-29 17:28:33 +03009 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
Johannes Berg8ca151b2013-01-24 14:25:36 +010010 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as
13 * published by the Free Software Foundation.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
23 * USA
24 *
25 * The full GNU General Public License is included in this distribution
Emmanuel Grumbach410dc5a2013-02-18 09:22:28 +020026 * in the file called COPYING.
Johannes Berg8ca151b2013-01-24 14:25:36 +010027 *
28 * Contact Information:
Emmanuel Grumbachd01c5362015-11-17 15:39:56 +020029 * Intel Linux Wireless <linuxwifi@intel.com>
Johannes Berg8ca151b2013-01-24 14:25:36 +010030 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
31 *
32 * BSD LICENSE
33 *
Emmanuel Grumbach51368bf2013-12-30 13:15:54 +020034 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
Sara Sharonc47de662016-09-29 17:28:33 +030035 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
Johannes Berg8ca151b2013-01-24 14:25:36 +010036 * All rights reserved.
37 *
38 * Redistribution and use in source and binary forms, with or without
39 * modification, are permitted provided that the following conditions
40 * are met:
41 *
42 * * Redistributions of source code must retain the above copyright
43 * notice, this list of conditions and the following disclaimer.
44 * * Redistributions in binary form must reproduce the above copyright
45 * notice, this list of conditions and the following disclaimer in
46 * the documentation and/or other materials provided with the
47 * distribution.
48 * * Neither the name Intel Corporation nor the names of its
49 * contributors may be used to endorse or promote products derived
50 * from this software without specific prior written permission.
51 *
52 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
53 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
54 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
55 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
56 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
57 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
58 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
59 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
60 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
61 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
62 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
63 *****************************************************************************/
64
65#ifndef __fw_api_tx_h__
66#define __fw_api_tx_h__
67
68/**
69 * enum iwl_tx_flags - bitmasks for tx_flags in TX command
70 * @TX_CMD_FLG_PROT_REQUIRE: use RTS or CTS-to-self to protect the frame
Andrei Otcheretianskif1daa002014-07-01 12:54:25 +030071 * @TX_CMD_FLG_WRITE_TX_POWER: update current tx power value in the mgmt frame
Johannes Berg8ca151b2013-01-24 14:25:36 +010072 * @TX_CMD_FLG_ACK: expect ACK from receiving station
73 * @TX_CMD_FLG_STA_RATE: use RS table with initial index from the TX command.
74 * Otherwise, use rate_n_flags from the TX command
Johannes Berg8ca151b2013-01-24 14:25:36 +010075 * @TX_CMD_FLG_BAR: this frame is a BA request, immediate BAR is expected
76 * Must set TX_CMD_FLG_ACK with this flag.
Johannes Berg3a07d362017-03-15 10:18:20 +010077 * @TX_CMD_FLG_TXOP_PROT: TXOP protection requested
Johannes Berg8ca151b2013-01-24 14:25:36 +010078 * @TX_CMD_FLG_VHT_NDPA: mark frame is NDPA for VHT beamformer sequence
79 * @TX_CMD_FLG_HT_NDPA: mark frame is NDPA for HT beamformer sequence
80 * @TX_CMD_FLG_CSI_FDBK2HOST: mark to send feedback to host (only if good CRC)
Emmanuel Grumbachee7bea52014-03-06 10:30:49 +020081 * @TX_CMD_FLG_BT_PRIO_POS: the position of the BT priority (bit 11 is ignored
82 * on old firmwares).
Johannes Berg8ca151b2013-01-24 14:25:36 +010083 * @TX_CMD_FLG_BT_DIS: disable BT priority for this frame
84 * @TX_CMD_FLG_SEQ_CTL: set if FW should override the sequence control.
85 * Should be set for mgmt, non-QOS data, mcast, bcast and in scan command
86 * @TX_CMD_FLG_MORE_FRAG: this frame is non-last MPDU
Johannes Berg8ca151b2013-01-24 14:25:36 +010087 * @TX_CMD_FLG_TSF: FW should calculate and insert TSF in the frame
88 * Should be set for beacons and probe responses
89 * @TX_CMD_FLG_CALIB: activate PA TX power calibrations
90 * @TX_CMD_FLG_KEEP_SEQ_CTL: if seq_ctl is set, don't increase inner seq count
Johannes Berg8ca151b2013-01-24 14:25:36 +010091 * @TX_CMD_FLG_MH_PAD: driver inserted 2 byte padding after MAC header.
92 * Should be set for 26/30 length MAC headers
93 * @TX_CMD_FLG_RESP_TO_DRV: zero this if the response should go only to FW
Johannes Berg8ca151b2013-01-24 14:25:36 +010094 * @TX_CMD_FLG_TKIP_MIC_DONE: FW already performed TKIP MIC calculation
Johannes Berg8ca151b2013-01-24 14:25:36 +010095 * @TX_CMD_FLG_DUR: disable duration overwriting used in PS-Poll Assoc-id
96 * @TX_CMD_FLG_FW_DROP: FW should mark frame to be dropped
97 * @TX_CMD_FLG_EXEC_PAPD: execute PAPD
98 * @TX_CMD_FLG_PAPD_TYPE: 0 for reference power, 1 for nominal power
99 * @TX_CMD_FLG_HCCA_CHUNK: mark start of TSPEC chunk
100 */
101enum iwl_tx_flags {
102 TX_CMD_FLG_PROT_REQUIRE = BIT(0),
Andrei Otcheretianskif1daa002014-07-01 12:54:25 +0300103 TX_CMD_FLG_WRITE_TX_POWER = BIT(1),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100104 TX_CMD_FLG_ACK = BIT(3),
105 TX_CMD_FLG_STA_RATE = BIT(4),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100106 TX_CMD_FLG_BAR = BIT(6),
107 TX_CMD_FLG_TXOP_PROT = BIT(7),
108 TX_CMD_FLG_VHT_NDPA = BIT(8),
109 TX_CMD_FLG_HT_NDPA = BIT(9),
110 TX_CMD_FLG_CSI_FDBK2HOST = BIT(10),
Emmanuel Grumbachee7bea52014-03-06 10:30:49 +0200111 TX_CMD_FLG_BT_PRIO_POS = 11,
Johannes Berg8ca151b2013-01-24 14:25:36 +0100112 TX_CMD_FLG_BT_DIS = BIT(12),
113 TX_CMD_FLG_SEQ_CTL = BIT(13),
114 TX_CMD_FLG_MORE_FRAG = BIT(14),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100115 TX_CMD_FLG_TSF = BIT(16),
116 TX_CMD_FLG_CALIB = BIT(17),
117 TX_CMD_FLG_KEEP_SEQ_CTL = BIT(18),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100118 TX_CMD_FLG_MH_PAD = BIT(20),
119 TX_CMD_FLG_RESP_TO_DRV = BIT(21),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100120 TX_CMD_FLG_TKIP_MIC_DONE = BIT(23),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100121 TX_CMD_FLG_DUR = BIT(25),
122 TX_CMD_FLG_FW_DROP = BIT(26),
123 TX_CMD_FLG_EXEC_PAPD = BIT(27),
124 TX_CMD_FLG_PAPD_TYPE = BIT(28),
125 TX_CMD_FLG_HCCA_CHUNK = BIT(31)
126}; /* TX_FLAGS_BITS_API_S_VER_1 */
127
Avri Altmanb084a352015-07-12 09:10:05 +0300128/**
Sara Sharonc47de662016-09-29 17:28:33 +0300129 * enum iwl_tx_cmd_flags - bitmasks for tx_flags in TX command for a000
130 * @IWL_TX_FLAGS_CMD_RATE: use rate from the TX command
131 * @IWL_TX_FLAGS_ENCRYPT_DIS: frame should not be encrypted, even if it belongs
132 * to a secured STA
133 * @IWL_TX_FLAGS_HIGH_PRI: high priority frame (like EAPOL) - can affect rate
134 * selection, retry limits and BT kill
135 */
136enum iwl_tx_cmd_flags {
137 IWL_TX_FLAGS_CMD_RATE = BIT(0),
138 IWL_TX_FLAGS_ENCRYPT_DIS = BIT(1),
139 IWL_TX_FLAGS_HIGH_PRI = BIT(2),
140}; /* TX_FLAGS_BITS_API_S_VER_3 */
141
142/**
Avri Altmanb084a352015-07-12 09:10:05 +0300143 * enum iwl_tx_pm_timeouts - pm timeout values in TX command
144 * @PM_FRAME_NONE: no need to suspend sleep mode
145 * @PM_FRAME_MGMT: fw suspend sleep mode for 100TU
146 * @PM_FRAME_ASSOC: fw suspend sleep mode for 10sec
147 */
148enum iwl_tx_pm_timeouts {
149 PM_FRAME_NONE = 0,
150 PM_FRAME_MGMT = 2,
151 PM_FRAME_ASSOC = 3,
152};
153
Emmanuel Grumbach4270b872013-05-06 10:41:03 +0300154#define TX_CMD_SEC_MSK 0x07
Johannes Berg8ca151b2013-01-24 14:25:36 +0100155#define TX_CMD_SEC_WEP_KEY_IDX_POS 6
156#define TX_CMD_SEC_WEP_KEY_IDX_MSK 0xc0
Ayala Beker2a53d162016-04-07 16:21:57 +0300157
158/**
159 * enum iwl_tx_cmd_sec_ctrl - bitmasks for security control in TX command
160 * @TX_CMD_SEC_WEP: WEP encryption algorithm.
161 * @TX_CMD_SEC_CCM: CCM encryption algorithm.
162 * @TX_CMD_SEC_TKIP: TKIP encryption algorithm.
163 * @TX_CMD_SEC_EXT: extended cipher algorithm.
164 * @TX_CMD_SEC_GCMP: GCMP encryption algorithm.
165 * @TX_CMD_SEC_KEY128: set for 104 bits WEP key.
Emmanuel Grumbach4dc65112016-09-13 22:59:27 +0300166 * @TX_CMD_SEC_KEY_FROM_TABLE: for a non-WEP key, set if the key should be taken
Ayala Beker2a53d162016-04-07 16:21:57 +0300167 * from the table instead of from the TX command.
168 * If the key is taken from the key table its index should be given by the
169 * first byte of the TX command key field.
170 */
171enum iwl_tx_cmd_sec_ctrl {
172 TX_CMD_SEC_WEP = 0x01,
173 TX_CMD_SEC_CCM = 0x02,
174 TX_CMD_SEC_TKIP = 0x03,
175 TX_CMD_SEC_EXT = 0x04,
176 TX_CMD_SEC_GCMP = 0x05,
177 TX_CMD_SEC_KEY128 = 0x08,
David Spinadel0f17e1b2017-01-04 09:30:24 +0200178 TX_CMD_SEC_KEY_FROM_TABLE = 0x10,
Ayala Beker2a53d162016-04-07 16:21:57 +0300179};
Johannes Berg8ca151b2013-01-24 14:25:36 +0100180
Johannes Berg8ca151b2013-01-24 14:25:36 +0100181/*
182 * TX command Frame life time in us - to be written in pm_frame_timeout
183 */
184#define TX_CMD_LIFE_TIME_INFINITE 0xFFFFFFFF
185#define TX_CMD_LIFE_TIME_DEFAULT 2000000 /* 2000 ms*/
186#define TX_CMD_LIFE_TIME_PROBE_RESP 40000 /* 40 ms */
187#define TX_CMD_LIFE_TIME_EXPIRED_FRAME 0
188
189/*
190 * TID for non QoS frames - to be written in tid_tspec
191 */
192#define IWL_TID_NON_QOS IWL_MAX_TID_COUNT
193
194/*
195 * Limits on the retransmissions - to be written in {data,rts}_retry_limit
196 */
197#define IWL_DEFAULT_TX_RETRY 15
198#define IWL_MGMT_DFAULT_RETRY_LIMIT 3
199#define IWL_RTS_DFAULT_RETRY_LIMIT 60
200#define IWL_BAR_DFAULT_RETRY_LIMIT 60
201#define IWL_LOW_RETRY_LIMIT 7
202
Sara Sharond8fe4842016-03-09 10:12:45 +0200203/**
204 * enum iwl_tx_offload_assist_flags_pos - set %iwl_tx_cmd offload_assist values
Johannes Berg3a07d362017-03-15 10:18:20 +0100205 * @TX_CMD_OFFLD_IP_HDR: offset to start of IP header (in words)
Sara Sharond8fe4842016-03-09 10:12:45 +0200206 * from mac header end. For normal case it is 4 words for SNAP.
207 * note: tx_cmd, mac header and pad are not counted in the offset.
208 * This is used to help the offload in case there is tunneling such as
209 * IPv6 in IPv4, in such case the ip header offset should point to the
210 * inner ip header and IPv4 checksum of the external header should be
211 * calculated by driver.
212 * @TX_CMD_OFFLD_L4_EN: enable TCP/UDP checksum
213 * @TX_CMD_OFFLD_L3_EN: enable IP header checksum
214 * @TX_CMD_OFFLD_MH_SIZE: size of the mac header in words. Includes the IV
215 * field. Doesn't include the pad.
216 * @TX_CMD_OFFLD_PAD: mark 2-byte pad was inserted after the mac header for
217 * alignment
218 * @TX_CMD_OFFLD_AMSDU: mark TX command is A-MSDU
219 */
220enum iwl_tx_offload_assist_flags_pos {
221 TX_CMD_OFFLD_IP_HDR = 0,
222 TX_CMD_OFFLD_L4_EN = 6,
223 TX_CMD_OFFLD_L3_EN = 7,
224 TX_CMD_OFFLD_MH_SIZE = 8,
225 TX_CMD_OFFLD_PAD = 13,
226 TX_CMD_OFFLD_AMSDU = 14,
227};
228
229#define IWL_TX_CMD_OFFLD_MH_MASK 0x1f
230#define IWL_TX_CMD_OFFLD_IP_HDR_MASK 0x3f
231
Johannes Berg8ca151b2013-01-24 14:25:36 +0100232/* TODO: complete documentation for try_cnt and btkill_cnt */
233/**
234 * struct iwl_tx_cmd - TX command struct to FW
235 * ( TX_CMD = 0x1c )
236 * @len: in bytes of the payload, see below for details
Sara Sharond8fe4842016-03-09 10:12:45 +0200237 * @offload_assist: TX offload configuration
Johannes Berg8ca151b2013-01-24 14:25:36 +0100238 * @tx_flags: combination of TX_CMD_FLG_*
Johannes Berg3a07d362017-03-15 10:18:20 +0100239 * @scratch: scratch buffer used by the device
Johannes Berg8ca151b2013-01-24 14:25:36 +0100240 * @rate_n_flags: rate for *all* Tx attempts, if TX_CMD_FLG_STA_RATE_MSK is
241 * cleared. Combination of RATE_MCS_*
242 * @sta_id: index of destination station in FW station table
243 * @sec_ctl: security control, TX_CMD_SEC_*
244 * @initial_rate_index: index into the the rate table for initial TX attempt.
245 * Applied if TX_CMD_FLG_STA_RATE_MSK is set, normally 0 for data frames.
Johannes Berg3a07d362017-03-15 10:18:20 +0100246 * @reserved2: reserved
Johannes Berg8ca151b2013-01-24 14:25:36 +0100247 * @key: security key
Johannes Bergb1e06c62017-03-15 09:53:13 +0100248 * @reserved3: reserved
Johannes Berg8ca151b2013-01-24 14:25:36 +0100249 * @life_time: frame life time (usecs??)
250 * @dram_lsb_ptr: Physical address of scratch area in the command (try_cnt +
251 * btkill_cnd + reserved), first 32 bits. "0" disables usage.
252 * @dram_msb_ptr: upper bits of the scratch physical address
253 * @rts_retry_limit: max attempts for RTS
254 * @data_retry_limit: max attempts to send the data packet
Johannes Berg3a07d362017-03-15 10:18:20 +0100255 * @tid_tspec: TID/tspec
Johannes Berg8ca151b2013-01-24 14:25:36 +0100256 * @pm_frame_timeout: PM TX frame timeout
Johannes Berg3a07d362017-03-15 10:18:20 +0100257 * @reserved4: reserved
258 * @payload: payload (same as @hdr)
259 * @hdr: 802.11 header (same as @payload)
Johannes Berg8ca151b2013-01-24 14:25:36 +0100260 *
261 * The byte count (both len and next_frame_len) includes MAC header
262 * (24/26/30/32 bytes)
263 * + 2 bytes pad if 26/30 header size
264 * + 8 byte IV for CCM or TKIP (not used for WEP)
265 * + Data payload
266 * + 8-byte MIC (not used for CCM/WEP)
267 * It does not include post-MAC padding, i.e.,
268 * MIC (CCM) 8 bytes, ICV (WEP/TKIP/CKIP) 4 bytes, CRC 4 bytes.
269 * Range of len: 14-2342 bytes.
270 *
271 * After the struct fields the MAC header is placed, plus any padding,
272 * and then the actial payload.
273 */
274struct iwl_tx_cmd {
275 __le16 len;
Sara Sharond8fe4842016-03-09 10:12:45 +0200276 __le16 offload_assist;
Johannes Berg8ca151b2013-01-24 14:25:36 +0100277 __le32 tx_flags;
Johannes Bergbc888f42013-06-10 15:58:13 +0200278 struct {
279 u8 try_cnt;
280 u8 btkill_cnt;
281 __le16 reserved;
282 } scratch; /* DRAM_SCRATCH_API_U_VER_1 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100283 __le32 rate_n_flags;
284 u8 sta_id;
285 u8 sec_ctl;
286 u8 initial_rate_index;
287 u8 reserved2;
288 u8 key[16];
Emmanuel Grumbach7f514f52014-07-02 12:00:51 +0300289 __le32 reserved3;
Johannes Berg8ca151b2013-01-24 14:25:36 +0100290 __le32 life_time;
291 __le32 dram_lsb_ptr;
292 u8 dram_msb_ptr;
293 u8 rts_retry_limit;
294 u8 data_retry_limit;
295 u8 tid_tspec;
296 __le16 pm_frame_timeout;
Emmanuel Grumbach7f514f52014-07-02 12:00:51 +0300297 __le16 reserved4;
Johannes Berg8ca151b2013-01-24 14:25:36 +0100298 u8 payload[0];
299 struct ieee80211_hdr hdr[0];
Sara Sharond8fe4842016-03-09 10:12:45 +0200300} __packed; /* TX_CMD_API_S_VER_6 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100301
Sara Sharonc47de662016-09-29 17:28:33 +0300302struct iwl_dram_sec_info {
303 __le32 pn_low;
304 __le16 pn_high;
305 __le16 aux_info;
306} __packed; /* DRAM_SEC_INFO_API_S_VER_1 */
307
308/**
309 * struct iwl_tx_cmd_gen2 - TX command struct to FW for a000 devices
310 * ( TX_CMD = 0x1c )
311 * @len: in bytes of the payload, see below for details
312 * @offload_assist: TX offload configuration
Johannes Berg3a07d362017-03-15 10:18:20 +0100313 * @flags: combination of &enum iwl_tx_cmd_flags
Sara Sharonc47de662016-09-29 17:28:33 +0300314 * @dram_info: FW internal DRAM storage
315 * @rate_n_flags: rate for *all* Tx attempts, if TX_CMD_FLG_STA_RATE_MSK is
316 * cleared. Combination of RATE_MCS_*
Johannes Berg3a07d362017-03-15 10:18:20 +0100317 * @hdr: 802.11 header
Sara Sharonc47de662016-09-29 17:28:33 +0300318 */
319struct iwl_tx_cmd_gen2 {
320 __le16 len;
321 __le16 offload_assist;
322 __le32 flags;
323 struct iwl_dram_sec_info dram_info;
324 __le32 rate_n_flags;
325 struct ieee80211_hdr hdr[0];
326} __packed; /* TX_CMD_API_S_VER_7 */
327
Johannes Berg8ca151b2013-01-24 14:25:36 +0100328/*
329 * TX response related data
330 */
331
332/*
333 * enum iwl_tx_status - status that is returned by the fw after attempts to Tx
334 * @TX_STATUS_SUCCESS:
335 * @TX_STATUS_DIRECT_DONE:
336 * @TX_STATUS_POSTPONE_DELAY:
337 * @TX_STATUS_POSTPONE_FEW_BYTES:
338 * @TX_STATUS_POSTPONE_BT_PRIO:
339 * @TX_STATUS_POSTPONE_QUIET_PERIOD:
340 * @TX_STATUS_POSTPONE_CALC_TTAK:
341 * @TX_STATUS_FAIL_INTERNAL_CROSSED_RETRY:
342 * @TX_STATUS_FAIL_SHORT_LIMIT:
343 * @TX_STATUS_FAIL_LONG_LIMIT:
344 * @TX_STATUS_FAIL_UNDERRUN:
345 * @TX_STATUS_FAIL_DRAIN_FLOW:
346 * @TX_STATUS_FAIL_RFKILL_FLUSH:
347 * @TX_STATUS_FAIL_LIFE_EXPIRE:
348 * @TX_STATUS_FAIL_DEST_PS:
349 * @TX_STATUS_FAIL_HOST_ABORTED:
350 * @TX_STATUS_FAIL_BT_RETRY:
351 * @TX_STATUS_FAIL_STA_INVALID:
352 * @TX_TATUS_FAIL_FRAG_DROPPED:
353 * @TX_STATUS_FAIL_TID_DISABLE:
354 * @TX_STATUS_FAIL_FIFO_FLUSHED:
355 * @TX_STATUS_FAIL_SMALL_CF_POLL:
356 * @TX_STATUS_FAIL_FW_DROP:
357 * @TX_STATUS_FAIL_STA_COLOR_MISMATCH: mismatch between color of Tx cmd and
358 * STA table
359 * @TX_FRAME_STATUS_INTERNAL_ABORT:
360 * @TX_MODE_MSK:
361 * @TX_MODE_NO_BURST:
362 * @TX_MODE_IN_BURST_SEQ:
363 * @TX_MODE_FIRST_IN_BURST:
364 * @TX_QUEUE_NUM_MSK:
365 *
366 * Valid only if frame_count =1
367 * TODO: complete documentation
368 */
369enum iwl_tx_status {
370 TX_STATUS_MSK = 0x000000ff,
371 TX_STATUS_SUCCESS = 0x01,
372 TX_STATUS_DIRECT_DONE = 0x02,
373 /* postpone TX */
374 TX_STATUS_POSTPONE_DELAY = 0x40,
375 TX_STATUS_POSTPONE_FEW_BYTES = 0x41,
376 TX_STATUS_POSTPONE_BT_PRIO = 0x42,
377 TX_STATUS_POSTPONE_QUIET_PERIOD = 0x43,
378 TX_STATUS_POSTPONE_CALC_TTAK = 0x44,
379 /* abort TX */
380 TX_STATUS_FAIL_INTERNAL_CROSSED_RETRY = 0x81,
381 TX_STATUS_FAIL_SHORT_LIMIT = 0x82,
382 TX_STATUS_FAIL_LONG_LIMIT = 0x83,
383 TX_STATUS_FAIL_UNDERRUN = 0x84,
384 TX_STATUS_FAIL_DRAIN_FLOW = 0x85,
385 TX_STATUS_FAIL_RFKILL_FLUSH = 0x86,
386 TX_STATUS_FAIL_LIFE_EXPIRE = 0x87,
387 TX_STATUS_FAIL_DEST_PS = 0x88,
388 TX_STATUS_FAIL_HOST_ABORTED = 0x89,
389 TX_STATUS_FAIL_BT_RETRY = 0x8a,
390 TX_STATUS_FAIL_STA_INVALID = 0x8b,
391 TX_STATUS_FAIL_FRAG_DROPPED = 0x8c,
392 TX_STATUS_FAIL_TID_DISABLE = 0x8d,
393 TX_STATUS_FAIL_FIFO_FLUSHED = 0x8e,
394 TX_STATUS_FAIL_SMALL_CF_POLL = 0x8f,
395 TX_STATUS_FAIL_FW_DROP = 0x90,
396 TX_STATUS_FAIL_STA_COLOR_MISMATCH = 0x91,
397 TX_STATUS_INTERNAL_ABORT = 0x92,
398 TX_MODE_MSK = 0x00000f00,
399 TX_MODE_NO_BURST = 0x00000000,
400 TX_MODE_IN_BURST_SEQ = 0x00000100,
401 TX_MODE_FIRST_IN_BURST = 0x00000200,
402 TX_QUEUE_NUM_MSK = 0x0001f000,
403 TX_NARROW_BW_MSK = 0x00060000,
404 TX_NARROW_BW_1DIV2 = 0x00020000,
405 TX_NARROW_BW_1DIV4 = 0x00040000,
406 TX_NARROW_BW_1DIV8 = 0x00060000,
407};
408
409/*
410 * enum iwl_tx_agg_status - TX aggregation status
411 * @AGG_TX_STATE_STATUS_MSK:
412 * @AGG_TX_STATE_TRANSMITTED:
413 * @AGG_TX_STATE_UNDERRUN:
414 * @AGG_TX_STATE_BT_PRIO:
415 * @AGG_TX_STATE_FEW_BYTES:
416 * @AGG_TX_STATE_ABORT:
417 * @AGG_TX_STATE_LAST_SENT_TTL:
418 * @AGG_TX_STATE_LAST_SENT_TRY_CNT:
419 * @AGG_TX_STATE_LAST_SENT_BT_KILL:
420 * @AGG_TX_STATE_SCD_QUERY:
421 * @AGG_TX_STATE_TEST_BAD_CRC32:
422 * @AGG_TX_STATE_RESPONSE:
423 * @AGG_TX_STATE_DUMP_TX:
424 * @AGG_TX_STATE_DELAY_TX:
425 * @AGG_TX_STATE_TRY_CNT_MSK: Retry count for 1st frame in aggregation (retries
426 * occur if tx failed for this frame when it was a member of a previous
427 * aggregation block). If rate scaling is used, retry count indicates the
428 * rate table entry used for all frames in the new agg.
429 *@ AGG_TX_STATE_SEQ_NUM_MSK: Command ID and sequence number of Tx command for
430 * this frame
431 *
432 * TODO: complete documentation
433 */
434enum iwl_tx_agg_status {
435 AGG_TX_STATE_STATUS_MSK = 0x00fff,
436 AGG_TX_STATE_TRANSMITTED = 0x000,
437 AGG_TX_STATE_UNDERRUN = 0x001,
438 AGG_TX_STATE_BT_PRIO = 0x002,
439 AGG_TX_STATE_FEW_BYTES = 0x004,
440 AGG_TX_STATE_ABORT = 0x008,
441 AGG_TX_STATE_LAST_SENT_TTL = 0x010,
442 AGG_TX_STATE_LAST_SENT_TRY_CNT = 0x020,
443 AGG_TX_STATE_LAST_SENT_BT_KILL = 0x040,
444 AGG_TX_STATE_SCD_QUERY = 0x080,
445 AGG_TX_STATE_TEST_BAD_CRC32 = 0x0100,
446 AGG_TX_STATE_RESPONSE = 0x1ff,
447 AGG_TX_STATE_DUMP_TX = 0x200,
448 AGG_TX_STATE_DELAY_TX = 0x400,
449 AGG_TX_STATE_TRY_CNT_POS = 12,
450 AGG_TX_STATE_TRY_CNT_MSK = 0xf << AGG_TX_STATE_TRY_CNT_POS,
451};
452
453#define AGG_TX_STATE_LAST_SENT_MSK (AGG_TX_STATE_LAST_SENT_TTL| \
454 AGG_TX_STATE_LAST_SENT_TRY_CNT| \
455 AGG_TX_STATE_LAST_SENT_BT_KILL)
456
457/*
458 * The mask below describes a status where we are absolutely sure that the MPDU
459 * wasn't sent. For BA/Underrun we cannot be that sure. All we know that we've
460 * written the bytes to the TXE, but we know nothing about what the DSP did.
461 */
462#define AGG_TX_STAT_FRAME_NOT_SENT (AGG_TX_STATE_FEW_BYTES | \
463 AGG_TX_STATE_ABORT | \
464 AGG_TX_STATE_SCD_QUERY)
465
466/*
467 * REPLY_TX = 0x1c (response)
468 *
469 * This response may be in one of two slightly different formats, indicated
470 * by the frame_count field:
471 *
472 * 1) No aggregation (frame_count == 1). This reports Tx results for a single
473 * frame. Multiple attempts, at various bit rates, may have been made for
474 * this frame.
475 *
476 * 2) Aggregation (frame_count > 1). This reports Tx results for two or more
477 * frames that used block-acknowledge. All frames were transmitted at
478 * same rate. Rate scaling may have been used if first frame in this new
479 * agg block failed in previous agg block(s).
480 *
481 * Note that, for aggregation, ACK (block-ack) status is not delivered
482 * here; block-ack has not been received by the time the device records
483 * this status.
484 * This status relates to reasons the tx might have been blocked or aborted
485 * within the device, rather than whether it was received successfully by
486 * the destination station.
487 */
488
489/**
490 * struct agg_tx_status - per packet TX aggregation status
Johannes Berg7b7cab72017-05-02 13:01:49 +0200491 * @status: See &enum iwl_tx_agg_status
Johannes Berg8ca151b2013-01-24 14:25:36 +0100492 * @sequence: Sequence # for this frame's Tx cmd (not SSN!)
493 */
494struct agg_tx_status {
495 __le16 status;
496 __le16 sequence;
497} __packed;
498
499/*
500 * definitions for initial rate index field
501 * bits [3:0] initial rate index
502 * bits [6:4] rate table color, used for the initial rate
503 * bit-7 invalid rate indication
504 */
505#define TX_RES_INIT_RATE_INDEX_MSK 0x0f
Gregory Greenmanea42d1c2017-03-06 11:15:41 +0200506#define TX_RES_RATE_TABLE_COLOR_POS 4
Johannes Berg8ca151b2013-01-24 14:25:36 +0100507#define TX_RES_RATE_TABLE_COLOR_MSK 0x70
508#define TX_RES_INV_RATE_INDEX_MSK 0x80
Gregory Greenmanea42d1c2017-03-06 11:15:41 +0200509#define TX_RES_RATE_TABLE_COL_GET(_f) (((_f) & TX_RES_RATE_TABLE_COLOR_MSK) >>\
510 TX_RES_RATE_TABLE_COLOR_POS)
Johannes Berg8ca151b2013-01-24 14:25:36 +0100511
512#define IWL_MVM_TX_RES_GET_TID(_ra_tid) ((_ra_tid) & 0x0f)
513#define IWL_MVM_TX_RES_GET_RA(_ra_tid) ((_ra_tid) >> 4)
514
515/**
Johannes Berga6a62192017-05-03 21:56:04 +0200516 * struct iwl_mvm_tx_resp_v3 - notifies that fw is TXing a packet
Johannes Berg8ca151b2013-01-24 14:25:36 +0100517 * ( REPLY_TX = 0x1c )
518 * @frame_count: 1 no aggregation, >1 aggregation
519 * @bt_kill_count: num of times blocked by bluetooth (unused for agg)
520 * @failure_rts: num of failures due to unsuccessful RTS
521 * @failure_frame: num failures due to no ACK (unused for agg)
522 * @initial_rate: for non-agg: rate of the successful Tx. For agg: rate of the
523 * Tx of all the batch. RATE_MCS_*
524 * @wireless_media_time: for non-agg: RTS + CTS + frame tx attempts time + ACK.
525 * for agg: RTS + CTS + aggregation tx time + block-ack time.
526 * in usec.
527 * @pa_status: tx power info
528 * @pa_integ_res_a: tx power info
529 * @pa_integ_res_b: tx power info
530 * @pa_integ_res_c: tx power info
531 * @measurement_req_id: tx power info
Johannes Berg3a07d362017-03-15 10:18:20 +0100532 * @reduced_tpc: transmit power reduction used
533 * @reserved: reserved
Johannes Berg8ca151b2013-01-24 14:25:36 +0100534 * @tfd_info: TFD information set by the FH
535 * @seq_ctl: sequence control from the Tx cmd
536 * @byte_cnt: byte count from the Tx cmd
537 * @tlc_info: TLC rate info
538 * @ra_tid: bits [3:0] = ra, bits [7:4] = tid
539 * @frame_ctrl: frame control
540 * @status: for non-agg: frame status TX_STATUS_*
541 * for agg: status of 1st frame, AGG_TX_STATE_*; other frame status fields
Johannes Berga6a62192017-05-03 21:56:04 +0200542 * follow this one, up to frame_count. Length in @frame_count.
543 *
544 * After the array of statuses comes the SSN of the SCD. Look at
545 * %iwl_mvm_get_scd_ssn for more details.
546 */
547struct iwl_mvm_tx_resp_v3 {
548 u8 frame_count;
549 u8 bt_kill_count;
550 u8 failure_rts;
551 u8 failure_frame;
552 __le32 initial_rate;
553 __le16 wireless_media_time;
554
555 u8 pa_status;
556 u8 pa_integ_res_a[3];
557 u8 pa_integ_res_b[3];
558 u8 pa_integ_res_c[3];
559 __le16 measurement_req_id;
560 u8 reduced_tpc;
561 u8 reserved;
562
563 __le32 tfd_info;
564 __le16 seq_ctl;
565 __le16 byte_cnt;
566 u8 tlc_info;
567 u8 ra_tid;
568 __le16 frame_ctrl;
569 struct agg_tx_status status[];
570} __packed; /* TX_RSP_API_S_VER_3 */
571
572/**
573 * struct iwl_mvm_tx_resp - notifies that fw is TXing a packet
574 * ( REPLY_TX = 0x1c )
575 * @frame_count: 1 no aggregation, >1 aggregation
576 * @bt_kill_count: num of times blocked by bluetooth (unused for agg)
577 * @failure_rts: num of failures due to unsuccessful RTS
578 * @failure_frame: num failures due to no ACK (unused for agg)
579 * @initial_rate: for non-agg: rate of the successful Tx. For agg: rate of the
580 * Tx of all the batch. RATE_MCS_*
581 * @wireless_media_time: for non-agg: RTS + CTS + frame tx attempts time + ACK.
582 * for agg: RTS + CTS + aggregation tx time + block-ack time.
583 * in usec.
584 * @pa_status: tx power info
585 * @pa_integ_res_a: tx power info
586 * @pa_integ_res_b: tx power info
587 * @pa_integ_res_c: tx power info
588 * @measurement_req_id: tx power info
589 * @reduced_tpc: transmit power reduction used
590 * @reserved: reserved
591 * @tfd_info: TFD information set by the FH
592 * @seq_ctl: sequence control from the Tx cmd
593 * @byte_cnt: byte count from the Tx cmd
594 * @tlc_info: TLC rate info
595 * @ra_tid: bits [3:0] = ra, bits [7:4] = tid
596 * @frame_ctrl: frame control
597 * @tx_queue: TX queue for this response
Johannes Berg358631b2017-05-16 15:14:19 +0200598 * @reserved2: reserved for padding/alignment
Johannes Berga6a62192017-05-03 21:56:04 +0200599 * @status: for non-agg: frame status TX_STATUS_*
Sara Sharon12db2942017-01-17 14:28:21 +0200600 * For version 6 TX response isn't received for aggregation at all.
Johannes Berg8ca151b2013-01-24 14:25:36 +0100601 *
602 * After the array of statuses comes the SSN of the SCD. Look at
603 * %iwl_mvm_get_scd_ssn for more details.
604 */
605struct iwl_mvm_tx_resp {
606 u8 frame_count;
607 u8 bt_kill_count;
608 u8 failure_rts;
609 u8 failure_frame;
610 __le32 initial_rate;
611 __le16 wireless_media_time;
612
613 u8 pa_status;
614 u8 pa_integ_res_a[3];
615 u8 pa_integ_res_b[3];
616 u8 pa_integ_res_c[3];
617 __le16 measurement_req_id;
Eliad Peller3a84b692014-03-12 15:05:06 +0200618 u8 reduced_tpc;
619 u8 reserved;
Johannes Berg8ca151b2013-01-24 14:25:36 +0100620
621 __le32 tfd_info;
622 __le16 seq_ctl;
623 __le16 byte_cnt;
624 u8 tlc_info;
625 u8 ra_tid;
626 __le16 frame_ctrl;
Johannes Berga6a62192017-05-03 21:56:04 +0200627 __le16 tx_queue;
628 __le16 reserved2;
629 struct agg_tx_status status;
Sara Sharon12db2942017-01-17 14:28:21 +0200630} __packed; /* TX_RSP_API_S_VER_6 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100631
632/**
633 * struct iwl_mvm_ba_notif - notifies about reception of BA
634 * ( BA_NOTIF = 0xc5 )
Johannes Berg3dc6dd92017-03-09 14:08:51 +0100635 * @sta_addr: MAC address
Johannes Berg31a658b2017-03-09 15:56:57 +0100636 * @reserved: reserved
Johannes Berg8ca151b2013-01-24 14:25:36 +0100637 * @sta_id: Index of recipient (BA-sending) station in fw's station table
638 * @tid: tid of the session
Johannes Berg31a658b2017-03-09 15:56:57 +0100639 * @seq_ctl: sequence control field
Johannes Berg8ca151b2013-01-24 14:25:36 +0100640 * @bitmap: the bitmap of the BA notification as seen in the air
641 * @scd_flow: the tx queue this BA relates to
642 * @scd_ssn: the index of the last contiguously sent packet
643 * @txed: number of Txed frames in this batch
644 * @txed_2_done: number of Acked frames in this batch
Gregory Greenman69c7fda2015-12-29 11:26:35 +0200645 * @reduced_txp: power reduced according to TPC. This is the actual value and
646 * not a copy from the LQ command. Thus, if not the first rate was used
647 * for Tx-ing then this value will be set to 0 by FW.
Johannes Berg31a658b2017-03-09 15:56:57 +0100648 * @reserved1: reserved
Johannes Berg8ca151b2013-01-24 14:25:36 +0100649 */
650struct iwl_mvm_ba_notif {
Johannes Berg3dc6dd92017-03-09 14:08:51 +0100651 u8 sta_addr[ETH_ALEN];
Johannes Berg8ca151b2013-01-24 14:25:36 +0100652 __le16 reserved;
653
654 u8 sta_id;
655 u8 tid;
656 __le16 seq_ctl;
657 __le64 bitmap;
658 __le16 scd_flow;
659 __le16 scd_ssn;
660 u8 txed;
661 u8 txed_2_done;
Gregory Greenman69c7fda2015-12-29 11:26:35 +0200662 u8 reduced_txp;
663 u8 reserved1;
Johannes Berg8ca151b2013-01-24 14:25:36 +0100664} __packed;
665
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +0200666/**
Sara Sharonc46e7722016-07-17 14:24:55 +0300667 * struct iwl_mvm_compressed_ba_tfd - progress of a TFD queue
668 * @q_num: TFD queue number
669 * @tfd_index: Index of first un-acked frame in the TFD queue
Sara Sharon12db2942017-01-17 14:28:21 +0200670 * @scd_queue: For debug only - the physical queue the TFD queue is bound to
Liad Kaufmancba46982017-04-13 17:10:33 +0300671 * @tid: TID of the queue (0-7)
Johannes Berg31a658b2017-03-09 15:56:57 +0100672 * @reserved: reserved for alignment
Sara Sharonc46e7722016-07-17 14:24:55 +0300673 */
674struct iwl_mvm_compressed_ba_tfd {
Sara Sharon12db2942017-01-17 14:28:21 +0200675 __le16 q_num;
Sara Sharonc46e7722016-07-17 14:24:55 +0300676 __le16 tfd_index;
Sara Sharon12db2942017-01-17 14:28:21 +0200677 u8 scd_queue;
Liad Kaufmancba46982017-04-13 17:10:33 +0300678 u8 tid;
679 u8 reserved[2];
Sara Sharonc46e7722016-07-17 14:24:55 +0300680} __packed; /* COMPRESSED_BA_TFD_API_S_VER_1 */
681
682/**
683 * struct iwl_mvm_compressed_ba_ratid - progress of a RA TID queue
684 * @q_num: RA TID queue number
685 * @tid: TID of the queue
686 * @ssn: BA window current SSN
687 */
688struct iwl_mvm_compressed_ba_ratid {
689 u8 q_num;
690 u8 tid;
691 __le16 ssn;
692} __packed; /* COMPRESSED_BA_RATID_API_S_VER_1 */
693
694/*
695 * enum iwl_mvm_ba_resp_flags - TX aggregation status
696 * @IWL_MVM_BA_RESP_TX_AGG: generated due to BA
697 * @IWL_MVM_BA_RESP_TX_BAR: generated due to BA after BAR
698 * @IWL_MVM_BA_RESP_TX_AGG_FAIL: aggregation didn't receive BA
699 * @IWL_MVM_BA_RESP_TX_UNDERRUN: aggregation got underrun
700 * @IWL_MVM_BA_RESP_TX_BT_KILL: aggregation got BT-kill
701 * @IWL_MVM_BA_RESP_TX_DSP_TIMEOUT: aggregation didn't finish within the
702 * expected time
703 */
704enum iwl_mvm_ba_resp_flags {
705 IWL_MVM_BA_RESP_TX_AGG,
706 IWL_MVM_BA_RESP_TX_BAR,
707 IWL_MVM_BA_RESP_TX_AGG_FAIL,
708 IWL_MVM_BA_RESP_TX_UNDERRUN,
709 IWL_MVM_BA_RESP_TX_BT_KILL,
710 IWL_MVM_BA_RESP_TX_DSP_TIMEOUT
711};
712
713/**
714 * struct iwl_mvm_compressed_ba_notif - notifies about reception of BA
715 * ( BA_NOTIF = 0xc5 )
716 * @flags: status flag, see the &iwl_mvm_ba_resp_flags
717 * @sta_id: Index of recipient (BA-sending) station in fw's station table
718 * @reduced_txp: power reduced according to TPC. This is the actual value and
719 * not a copy from the LQ command. Thus, if not the first rate was used
720 * for Tx-ing then this value will be set to 0 by FW.
721 * @initial_rate: TLC rate info, initial rate index, TLC table color
722 * @retry_cnt: retry count
723 * @query_byte_cnt: SCD query byte count
724 * @query_frame_cnt: SCD query frame count
725 * @txed: number of frames sent in the aggregation (all-TIDs)
726 * @done: number of frames that were Acked by the BA (all-TIDs)
Johannes Berg31a658b2017-03-09 15:56:57 +0100727 * @reserved: reserved (for alignment)
Sara Sharonc46e7722016-07-17 14:24:55 +0300728 * @wireless_time: Wireless-media time
729 * @tx_rate: the rate the aggregation was sent at
730 * @tfd_cnt: number of TFD-Q elements
731 * @ra_tid_cnt: number of RATID-Q elements
Johannes Berg31a658b2017-03-09 15:56:57 +0100732 * @tfd: array of TFD queue status updates. See &iwl_mvm_compressed_ba_tfd
Sara Sharon951cb312016-12-29 10:11:40 +0200733 * for details.
734 * @ra_tid: array of RA-TID queue status updates. For debug purposes only. See
735 * &iwl_mvm_compressed_ba_ratid for more details.
Sara Sharonc46e7722016-07-17 14:24:55 +0300736 */
737struct iwl_mvm_compressed_ba_notif {
738 __le32 flags;
739 u8 sta_id;
740 u8 reduced_txp;
741 u8 initial_rate;
742 u8 retry_cnt;
743 __le32 query_byte_cnt;
744 __le16 query_frame_cnt;
745 __le16 txed;
746 __le16 done;
Sara Sharon951cb312016-12-29 10:11:40 +0200747 __le16 reserved;
Sara Sharonc46e7722016-07-17 14:24:55 +0300748 __le32 wireless_time;
749 __le32 tx_rate;
750 __le16 tfd_cnt;
751 __le16 ra_tid_cnt;
752 struct iwl_mvm_compressed_ba_tfd tfd[1];
753 struct iwl_mvm_compressed_ba_ratid ra_tid[0];
754} __packed; /* COMPRESSED_BA_RES_API_S_VER_4 */
755
756/**
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +0200757 * struct iwl_mac_beacon_cmd_v6 - beacon template command
Johannes Berg8ca151b2013-01-24 14:25:36 +0100758 * @tx: the tx commands associated with the beacon frame
759 * @template_id: currently equal to the mac context id of the coresponding
760 * mac.
761 * @tim_idx: the offset of the tim IE in the beacon
762 * @tim_size: the length of the tim IE
763 * @frame: the template of the beacon frame
764 */
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +0200765struct iwl_mac_beacon_cmd_v6 {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100766 struct iwl_tx_cmd tx;
767 __le32 template_id;
768 __le32 tim_idx;
769 __le32 tim_size;
770 struct ieee80211_hdr frame[0];
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +0200771} __packed; /* BEACON_TEMPLATE_CMD_API_S_VER_6 */
772
773/**
Sara Sharon8364fbb2016-12-08 11:44:20 +0200774 * struct iwl_mac_beacon_cmd_data - data of beacon template with offloaded CSA
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +0200775 * @template_id: currently equal to the mac context id of the coresponding
776 * mac.
777 * @tim_idx: the offset of the tim IE in the beacon
778 * @tim_size: the length of the tim IE
779 * @ecsa_offset: offset to the ECSA IE if present
780 * @csa_offset: offset to the CSA IE if present
781 * @frame: the template of the beacon frame
782 */
Sara Sharon8364fbb2016-12-08 11:44:20 +0200783struct iwl_mac_beacon_cmd_data {
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +0200784 __le32 template_id;
785 __le32 tim_idx;
786 __le32 tim_size;
787 __le32 ecsa_offset;
788 __le32 csa_offset;
789 struct ieee80211_hdr frame[0];
Sara Sharon8364fbb2016-12-08 11:44:20 +0200790};
791
792/**
793 * struct iwl_mac_beacon_cmd_v7 - beacon template command with offloaded CSA
794 * @tx: the tx commands associated with the beacon frame
795 * @data: see &iwl_mac_beacon_cmd_data
796 */
797struct iwl_mac_beacon_cmd_v7 {
798 struct iwl_tx_cmd tx;
799 struct iwl_mac_beacon_cmd_data data;
Andrei Otcheretianskid3a108a2016-02-28 17:12:21 +0200800} __packed; /* BEACON_TEMPLATE_CMD_API_S_VER_7 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100801
Sara Sharon8364fbb2016-12-08 11:44:20 +0200802/**
803 * struct iwl_mac_beacon_cmd - beacon template command with offloaded CSA
804 * @byte_cnt: byte count of the beacon frame
805 * @flags: for future use
Johannes Berg31a658b2017-03-09 15:56:57 +0100806 * @reserved: reserved
Sara Sharon8364fbb2016-12-08 11:44:20 +0200807 * @data: see &iwl_mac_beacon_cmd_data
808 */
809struct iwl_mac_beacon_cmd {
810 __le16 byte_cnt;
811 __le16 flags;
812 __le64 reserved;
813 struct iwl_mac_beacon_cmd_data data;
814} __packed; /* BEACON_TEMPLATE_CMD_API_S_VER_8 */
815
Ilan Peer571765c2013-03-05 15:26:03 +0200816struct iwl_beacon_notif {
817 struct iwl_mvm_tx_resp beacon_notify_hdr;
818 __le64 tsf;
819 __le32 ibss_mgr_status;
820} __packed;
821
Johannes Berg8ca151b2013-01-24 14:25:36 +0100822/**
David Spinadel1c87bba2014-02-27 16:41:52 +0200823 * struct iwl_extended_beacon_notif - notifies about beacon transmission
824 * @beacon_notify_hdr: tx response command associated with the beacon
825 * @tsf: last beacon tsf
826 * @ibss_mgr_status: whether IBSS is manager
827 * @gp2: last beacon time in gp2
828 */
829struct iwl_extended_beacon_notif {
830 struct iwl_mvm_tx_resp beacon_notify_hdr;
831 __le64 tsf;
832 __le32 ibss_mgr_status;
833 __le32 gp2;
834} __packed; /* BEACON_NTFY_API_S_VER_5 */
835
836/**
Johannes Berg8ca151b2013-01-24 14:25:36 +0100837 * enum iwl_dump_control - dump (flush) control flags
838 * @DUMP_TX_FIFO_FLUSH: Dump MSDUs until the the FIFO is empty
839 * and the TFD queues are empty.
840 */
841enum iwl_dump_control {
842 DUMP_TX_FIFO_FLUSH = BIT(1),
843};
844
845/**
846 * struct iwl_tx_path_flush_cmd -- queue/FIFO flush command
847 * @queues_ctl: bitmap of queues to flush
848 * @flush_ctl: control flags
849 * @reserved: reserved
850 */
Mordechai Goodsteind167e812017-05-10 16:42:53 +0300851struct iwl_tx_path_flush_cmd_v1 {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100852 __le32 queues_ctl;
853 __le16 flush_ctl;
854 __le16 reserved;
855} __packed; /* TX_PATH_FLUSH_CMD_API_S_VER_1 */
856
Mordechai Goodsteind167e812017-05-10 16:42:53 +0300857/**
858 * struct iwl_tx_path_flush_cmd -- queue/FIFO flush command
859 * @sta_id: station ID to flush
860 * @tid_mask: TID mask to flush
861 * @reserved: reserved
862 */
863struct iwl_tx_path_flush_cmd {
864 __le32 sta_id;
865 __le16 tid_mask;
866 __le16 reserved;
867} __packed; /* TX_PATH_FLUSH_CMD_API_S_VER_2 */
868
Liad Kaufmanf7c692d2016-03-08 10:41:32 +0200869/* Available options for the SCD_QUEUE_CFG HCMD */
870enum iwl_scd_cfg_actions {
871 SCD_CFG_DISABLE_QUEUE = 0x0,
872 SCD_CFG_ENABLE_QUEUE = 0x1,
873 SCD_CFG_UPDATE_QUEUE_TID = 0x2,
874};
875
Emmanuel Grumbach0294d9e2015-01-05 16:52:55 +0200876/**
877 * struct iwl_scd_txq_cfg_cmd - New txq hw scheduler config command
Johannes Berg31a658b2017-03-09 15:56:57 +0100878 * @token: unused
Emmanuel Grumbach0294d9e2015-01-05 16:52:55 +0200879 * @sta_id: station id
Johannes Berg31a658b2017-03-09 15:56:57 +0100880 * @tid: TID
Emmanuel Grumbach0294d9e2015-01-05 16:52:55 +0200881 * @scd_queue: scheduler queue to confiug
Liad Kaufmanf7c692d2016-03-08 10:41:32 +0200882 * @action: 1 queue enable, 0 queue disable, 2 change txq's tid owner
Johannes Berg67625862017-03-14 11:01:27 +0100883 * Value is one of &enum iwl_scd_cfg_actions options
Emmanuel Grumbach0294d9e2015-01-05 16:52:55 +0200884 * @aggregate: 1 aggregated queue, 0 otherwise
Johannes Berg67625862017-03-14 11:01:27 +0100885 * @tx_fifo: &enum iwl_mvm_tx_fifo
Emmanuel Grumbach0294d9e2015-01-05 16:52:55 +0200886 * @window: BA window size
887 * @ssn: SSN for the BA agreement
Johannes Berg31a658b2017-03-09 15:56:57 +0100888 * @reserved: reserved
Emmanuel Grumbach0294d9e2015-01-05 16:52:55 +0200889 */
890struct iwl_scd_txq_cfg_cmd {
891 u8 token;
892 u8 sta_id;
893 u8 tid;
894 u8 scd_queue;
Liad Kaufmanf7c692d2016-03-08 10:41:32 +0200895 u8 action;
Emmanuel Grumbach0294d9e2015-01-05 16:52:55 +0200896 u8 aggregate;
897 u8 tx_fifo;
898 u8 window;
899 __le16 ssn;
900 __le16 reserved;
901} __packed; /* SCD_QUEUE_CFG_CMD_API_S_VER_1 */
902
903/**
904 * struct iwl_scd_txq_cfg_rsp
905 * @token: taken from the command
906 * @sta_id: station id from the command
907 * @tid: tid from the command
908 * @scd_queue: scd_queue from the command
909 */
910struct iwl_scd_txq_cfg_rsp {
911 u8 token;
912 u8 sta_id;
913 u8 tid;
914 u8 scd_queue;
915} __packed; /* SCD_QUEUE_CFG_RSP_API_S_VER_1 */
916
Johannes Berg8ca151b2013-01-24 14:25:36 +0100917#endif /* __fw_api_tx_h__ */