Merge tag 'asm-generic-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd...
[deliverable/linux.git] / drivers / net / wireless / intel / iwlwifi / mvm / fw-api-tx.h
1 /******************************************************************************
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 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of version 2 of the GNU General Public License as
12 * published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
22 * USA
23 *
24 * The full GNU General Public License is included in this distribution
25 * in the file called COPYING.
26 *
27 * Contact Information:
28 * Intel Linux Wireless <linuxwifi@intel.com>
29 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
30 *
31 * BSD LICENSE
32 *
33 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
34 * All rights reserved.
35 *
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
38 * are met:
39 *
40 * * Redistributions of source code must retain the above copyright
41 * notice, this list of conditions and the following disclaimer.
42 * * Redistributions in binary form must reproduce the above copyright
43 * notice, this list of conditions and the following disclaimer in
44 * the documentation and/or other materials provided with the
45 * distribution.
46 * * Neither the name Intel Corporation nor the names of its
47 * contributors may be used to endorse or promote products derived
48 * from this software without specific prior written permission.
49 *
50 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
51 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
52 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
53 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
54 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
55 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
56 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
57 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
58 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
59 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 *****************************************************************************/
62
63 #ifndef __fw_api_tx_h__
64 #define __fw_api_tx_h__
65
66 /**
67 * enum iwl_tx_flags - bitmasks for tx_flags in TX command
68 * @TX_CMD_FLG_PROT_REQUIRE: use RTS or CTS-to-self to protect the frame
69 * @TX_CMD_FLG_WRITE_TX_POWER: update current tx power value in the mgmt frame
70 * @TX_CMD_FLG_ACK: expect ACK from receiving station
71 * @TX_CMD_FLG_STA_RATE: use RS table with initial index from the TX command.
72 * Otherwise, use rate_n_flags from the TX command
73 * @TX_CMD_FLG_BAR: this frame is a BA request, immediate BAR is expected
74 * Must set TX_CMD_FLG_ACK with this flag.
75 * @TX_CMD_FLG_VHT_NDPA: mark frame is NDPA for VHT beamformer sequence
76 * @TX_CMD_FLG_HT_NDPA: mark frame is NDPA for HT beamformer sequence
77 * @TX_CMD_FLG_CSI_FDBK2HOST: mark to send feedback to host (only if good CRC)
78 * @TX_CMD_FLG_BT_PRIO_POS: the position of the BT priority (bit 11 is ignored
79 * on old firmwares).
80 * @TX_CMD_FLG_BT_DIS: disable BT priority for this frame
81 * @TX_CMD_FLG_SEQ_CTL: set if FW should override the sequence control.
82 * Should be set for mgmt, non-QOS data, mcast, bcast and in scan command
83 * @TX_CMD_FLG_MORE_FRAG: this frame is non-last MPDU
84 * @TX_CMD_FLG_TSF: FW should calculate and insert TSF in the frame
85 * Should be set for beacons and probe responses
86 * @TX_CMD_FLG_CALIB: activate PA TX power calibrations
87 * @TX_CMD_FLG_KEEP_SEQ_CTL: if seq_ctl is set, don't increase inner seq count
88 * @TX_CMD_FLG_MH_PAD: driver inserted 2 byte padding after MAC header.
89 * Should be set for 26/30 length MAC headers
90 * @TX_CMD_FLG_RESP_TO_DRV: zero this if the response should go only to FW
91 * @TX_CMD_FLG_CCMP_AGG: this frame uses CCMP for aggregation acceleration
92 * @TX_CMD_FLG_TKIP_MIC_DONE: FW already performed TKIP MIC calculation
93 * @TX_CMD_FLG_DUR: disable duration overwriting used in PS-Poll Assoc-id
94 * @TX_CMD_FLG_FW_DROP: FW should mark frame to be dropped
95 * @TX_CMD_FLG_EXEC_PAPD: execute PAPD
96 * @TX_CMD_FLG_PAPD_TYPE: 0 for reference power, 1 for nominal power
97 * @TX_CMD_FLG_HCCA_CHUNK: mark start of TSPEC chunk
98 */
99 enum iwl_tx_flags {
100 TX_CMD_FLG_PROT_REQUIRE = BIT(0),
101 TX_CMD_FLG_WRITE_TX_POWER = BIT(1),
102 TX_CMD_FLG_ACK = BIT(3),
103 TX_CMD_FLG_STA_RATE = BIT(4),
104 TX_CMD_FLG_BAR = BIT(6),
105 TX_CMD_FLG_TXOP_PROT = BIT(7),
106 TX_CMD_FLG_VHT_NDPA = BIT(8),
107 TX_CMD_FLG_HT_NDPA = BIT(9),
108 TX_CMD_FLG_CSI_FDBK2HOST = BIT(10),
109 TX_CMD_FLG_BT_PRIO_POS = 11,
110 TX_CMD_FLG_BT_DIS = BIT(12),
111 TX_CMD_FLG_SEQ_CTL = BIT(13),
112 TX_CMD_FLG_MORE_FRAG = BIT(14),
113 TX_CMD_FLG_TSF = BIT(16),
114 TX_CMD_FLG_CALIB = BIT(17),
115 TX_CMD_FLG_KEEP_SEQ_CTL = BIT(18),
116 TX_CMD_FLG_MH_PAD = BIT(20),
117 TX_CMD_FLG_RESP_TO_DRV = BIT(21),
118 TX_CMD_FLG_CCMP_AGG = BIT(22),
119 TX_CMD_FLG_TKIP_MIC_DONE = BIT(23),
120 TX_CMD_FLG_DUR = BIT(25),
121 TX_CMD_FLG_FW_DROP = BIT(26),
122 TX_CMD_FLG_EXEC_PAPD = BIT(27),
123 TX_CMD_FLG_PAPD_TYPE = BIT(28),
124 TX_CMD_FLG_HCCA_CHUNK = BIT(31)
125 }; /* TX_FLAGS_BITS_API_S_VER_1 */
126
127 /**
128 * enum iwl_tx_pm_timeouts - pm timeout values in TX command
129 * @PM_FRAME_NONE: no need to suspend sleep mode
130 * @PM_FRAME_MGMT: fw suspend sleep mode for 100TU
131 * @PM_FRAME_ASSOC: fw suspend sleep mode for 10sec
132 */
133 enum iwl_tx_pm_timeouts {
134 PM_FRAME_NONE = 0,
135 PM_FRAME_MGMT = 2,
136 PM_FRAME_ASSOC = 3,
137 };
138
139 /*
140 * TX command security control
141 */
142 #define TX_CMD_SEC_WEP 0x01
143 #define TX_CMD_SEC_CCM 0x02
144 #define TX_CMD_SEC_TKIP 0x03
145 #define TX_CMD_SEC_EXT 0x04
146 #define TX_CMD_SEC_MSK 0x07
147 #define TX_CMD_SEC_WEP_KEY_IDX_POS 6
148 #define TX_CMD_SEC_WEP_KEY_IDX_MSK 0xc0
149 #define TX_CMD_SEC_KEY128 0x08
150
151 /* TODO: how does these values are OK with only 16 bit variable??? */
152 /*
153 * TX command next frame info
154 *
155 * bits 0:2 - security control (TX_CMD_SEC_*)
156 * bit 3 - immediate ACK required
157 * bit 4 - rate is taken from STA table
158 * bit 5 - frame belongs to BA stream
159 * bit 6 - immediate BA response expected
160 * bit 7 - unused
161 * bits 8:15 - Station ID
162 * bits 16:31 - rate
163 */
164 #define TX_CMD_NEXT_FRAME_ACK_MSK (0x8)
165 #define TX_CMD_NEXT_FRAME_STA_RATE_MSK (0x10)
166 #define TX_CMD_NEXT_FRAME_BA_MSK (0x20)
167 #define TX_CMD_NEXT_FRAME_IMM_BA_RSP_MSK (0x40)
168 #define TX_CMD_NEXT_FRAME_FLAGS_MSK (0xf8)
169 #define TX_CMD_NEXT_FRAME_STA_ID_MSK (0xff00)
170 #define TX_CMD_NEXT_FRAME_STA_ID_POS (8)
171 #define TX_CMD_NEXT_FRAME_RATE_MSK (0xffff0000)
172 #define TX_CMD_NEXT_FRAME_RATE_POS (16)
173
174 /*
175 * TX command Frame life time in us - to be written in pm_frame_timeout
176 */
177 #define TX_CMD_LIFE_TIME_INFINITE 0xFFFFFFFF
178 #define TX_CMD_LIFE_TIME_DEFAULT 2000000 /* 2000 ms*/
179 #define TX_CMD_LIFE_TIME_PROBE_RESP 40000 /* 40 ms */
180 #define TX_CMD_LIFE_TIME_EXPIRED_FRAME 0
181
182 /*
183 * TID for non QoS frames - to be written in tid_tspec
184 */
185 #define IWL_TID_NON_QOS IWL_MAX_TID_COUNT
186
187 /*
188 * Limits on the retransmissions - to be written in {data,rts}_retry_limit
189 */
190 #define IWL_DEFAULT_TX_RETRY 15
191 #define IWL_MGMT_DFAULT_RETRY_LIMIT 3
192 #define IWL_RTS_DFAULT_RETRY_LIMIT 60
193 #define IWL_BAR_DFAULT_RETRY_LIMIT 60
194 #define IWL_LOW_RETRY_LIMIT 7
195
196 /* TODO: complete documentation for try_cnt and btkill_cnt */
197 /**
198 * struct iwl_tx_cmd - TX command struct to FW
199 * ( TX_CMD = 0x1c )
200 * @len: in bytes of the payload, see below for details
201 * @tx_flags: combination of TX_CMD_FLG_*
202 * @rate_n_flags: rate for *all* Tx attempts, if TX_CMD_FLG_STA_RATE_MSK is
203 * cleared. Combination of RATE_MCS_*
204 * @sta_id: index of destination station in FW station table
205 * @sec_ctl: security control, TX_CMD_SEC_*
206 * @initial_rate_index: index into the the rate table for initial TX attempt.
207 * Applied if TX_CMD_FLG_STA_RATE_MSK is set, normally 0 for data frames.
208 * @key: security key
209 * @next_frame_flags: TX_CMD_SEC_* and TX_CMD_NEXT_FRAME_*
210 * @life_time: frame life time (usecs??)
211 * @dram_lsb_ptr: Physical address of scratch area in the command (try_cnt +
212 * btkill_cnd + reserved), first 32 bits. "0" disables usage.
213 * @dram_msb_ptr: upper bits of the scratch physical address
214 * @rts_retry_limit: max attempts for RTS
215 * @data_retry_limit: max attempts to send the data packet
216 * @tid_spec: TID/tspec
217 * @pm_frame_timeout: PM TX frame timeout
218 *
219 * The byte count (both len and next_frame_len) includes MAC header
220 * (24/26/30/32 bytes)
221 * + 2 bytes pad if 26/30 header size
222 * + 8 byte IV for CCM or TKIP (not used for WEP)
223 * + Data payload
224 * + 8-byte MIC (not used for CCM/WEP)
225 * It does not include post-MAC padding, i.e.,
226 * MIC (CCM) 8 bytes, ICV (WEP/TKIP/CKIP) 4 bytes, CRC 4 bytes.
227 * Range of len: 14-2342 bytes.
228 *
229 * After the struct fields the MAC header is placed, plus any padding,
230 * and then the actial payload.
231 */
232 struct iwl_tx_cmd {
233 __le16 len;
234 __le16 next_frame_len;
235 __le32 tx_flags;
236 struct {
237 u8 try_cnt;
238 u8 btkill_cnt;
239 __le16 reserved;
240 } scratch; /* DRAM_SCRATCH_API_U_VER_1 */
241 __le32 rate_n_flags;
242 u8 sta_id;
243 u8 sec_ctl;
244 u8 initial_rate_index;
245 u8 reserved2;
246 u8 key[16];
247 __le32 reserved3;
248 __le32 life_time;
249 __le32 dram_lsb_ptr;
250 u8 dram_msb_ptr;
251 u8 rts_retry_limit;
252 u8 data_retry_limit;
253 u8 tid_tspec;
254 __le16 pm_frame_timeout;
255 __le16 reserved4;
256 u8 payload[0];
257 struct ieee80211_hdr hdr[0];
258 } __packed; /* TX_CMD_API_S_VER_3 */
259
260 /*
261 * TX response related data
262 */
263
264 /*
265 * enum iwl_tx_status - status that is returned by the fw after attempts to Tx
266 * @TX_STATUS_SUCCESS:
267 * @TX_STATUS_DIRECT_DONE:
268 * @TX_STATUS_POSTPONE_DELAY:
269 * @TX_STATUS_POSTPONE_FEW_BYTES:
270 * @TX_STATUS_POSTPONE_BT_PRIO:
271 * @TX_STATUS_POSTPONE_QUIET_PERIOD:
272 * @TX_STATUS_POSTPONE_CALC_TTAK:
273 * @TX_STATUS_FAIL_INTERNAL_CROSSED_RETRY:
274 * @TX_STATUS_FAIL_SHORT_LIMIT:
275 * @TX_STATUS_FAIL_LONG_LIMIT:
276 * @TX_STATUS_FAIL_UNDERRUN:
277 * @TX_STATUS_FAIL_DRAIN_FLOW:
278 * @TX_STATUS_FAIL_RFKILL_FLUSH:
279 * @TX_STATUS_FAIL_LIFE_EXPIRE:
280 * @TX_STATUS_FAIL_DEST_PS:
281 * @TX_STATUS_FAIL_HOST_ABORTED:
282 * @TX_STATUS_FAIL_BT_RETRY:
283 * @TX_STATUS_FAIL_STA_INVALID:
284 * @TX_TATUS_FAIL_FRAG_DROPPED:
285 * @TX_STATUS_FAIL_TID_DISABLE:
286 * @TX_STATUS_FAIL_FIFO_FLUSHED:
287 * @TX_STATUS_FAIL_SMALL_CF_POLL:
288 * @TX_STATUS_FAIL_FW_DROP:
289 * @TX_STATUS_FAIL_STA_COLOR_MISMATCH: mismatch between color of Tx cmd and
290 * STA table
291 * @TX_FRAME_STATUS_INTERNAL_ABORT:
292 * @TX_MODE_MSK:
293 * @TX_MODE_NO_BURST:
294 * @TX_MODE_IN_BURST_SEQ:
295 * @TX_MODE_FIRST_IN_BURST:
296 * @TX_QUEUE_NUM_MSK:
297 *
298 * Valid only if frame_count =1
299 * TODO: complete documentation
300 */
301 enum iwl_tx_status {
302 TX_STATUS_MSK = 0x000000ff,
303 TX_STATUS_SUCCESS = 0x01,
304 TX_STATUS_DIRECT_DONE = 0x02,
305 /* postpone TX */
306 TX_STATUS_POSTPONE_DELAY = 0x40,
307 TX_STATUS_POSTPONE_FEW_BYTES = 0x41,
308 TX_STATUS_POSTPONE_BT_PRIO = 0x42,
309 TX_STATUS_POSTPONE_QUIET_PERIOD = 0x43,
310 TX_STATUS_POSTPONE_CALC_TTAK = 0x44,
311 /* abort TX */
312 TX_STATUS_FAIL_INTERNAL_CROSSED_RETRY = 0x81,
313 TX_STATUS_FAIL_SHORT_LIMIT = 0x82,
314 TX_STATUS_FAIL_LONG_LIMIT = 0x83,
315 TX_STATUS_FAIL_UNDERRUN = 0x84,
316 TX_STATUS_FAIL_DRAIN_FLOW = 0x85,
317 TX_STATUS_FAIL_RFKILL_FLUSH = 0x86,
318 TX_STATUS_FAIL_LIFE_EXPIRE = 0x87,
319 TX_STATUS_FAIL_DEST_PS = 0x88,
320 TX_STATUS_FAIL_HOST_ABORTED = 0x89,
321 TX_STATUS_FAIL_BT_RETRY = 0x8a,
322 TX_STATUS_FAIL_STA_INVALID = 0x8b,
323 TX_STATUS_FAIL_FRAG_DROPPED = 0x8c,
324 TX_STATUS_FAIL_TID_DISABLE = 0x8d,
325 TX_STATUS_FAIL_FIFO_FLUSHED = 0x8e,
326 TX_STATUS_FAIL_SMALL_CF_POLL = 0x8f,
327 TX_STATUS_FAIL_FW_DROP = 0x90,
328 TX_STATUS_FAIL_STA_COLOR_MISMATCH = 0x91,
329 TX_STATUS_INTERNAL_ABORT = 0x92,
330 TX_MODE_MSK = 0x00000f00,
331 TX_MODE_NO_BURST = 0x00000000,
332 TX_MODE_IN_BURST_SEQ = 0x00000100,
333 TX_MODE_FIRST_IN_BURST = 0x00000200,
334 TX_QUEUE_NUM_MSK = 0x0001f000,
335 TX_NARROW_BW_MSK = 0x00060000,
336 TX_NARROW_BW_1DIV2 = 0x00020000,
337 TX_NARROW_BW_1DIV4 = 0x00040000,
338 TX_NARROW_BW_1DIV8 = 0x00060000,
339 };
340
341 /*
342 * enum iwl_tx_agg_status - TX aggregation status
343 * @AGG_TX_STATE_STATUS_MSK:
344 * @AGG_TX_STATE_TRANSMITTED:
345 * @AGG_TX_STATE_UNDERRUN:
346 * @AGG_TX_STATE_BT_PRIO:
347 * @AGG_TX_STATE_FEW_BYTES:
348 * @AGG_TX_STATE_ABORT:
349 * @AGG_TX_STATE_LAST_SENT_TTL:
350 * @AGG_TX_STATE_LAST_SENT_TRY_CNT:
351 * @AGG_TX_STATE_LAST_SENT_BT_KILL:
352 * @AGG_TX_STATE_SCD_QUERY:
353 * @AGG_TX_STATE_TEST_BAD_CRC32:
354 * @AGG_TX_STATE_RESPONSE:
355 * @AGG_TX_STATE_DUMP_TX:
356 * @AGG_TX_STATE_DELAY_TX:
357 * @AGG_TX_STATE_TRY_CNT_MSK: Retry count for 1st frame in aggregation (retries
358 * occur if tx failed for this frame when it was a member of a previous
359 * aggregation block). If rate scaling is used, retry count indicates the
360 * rate table entry used for all frames in the new agg.
361 *@ AGG_TX_STATE_SEQ_NUM_MSK: Command ID and sequence number of Tx command for
362 * this frame
363 *
364 * TODO: complete documentation
365 */
366 enum iwl_tx_agg_status {
367 AGG_TX_STATE_STATUS_MSK = 0x00fff,
368 AGG_TX_STATE_TRANSMITTED = 0x000,
369 AGG_TX_STATE_UNDERRUN = 0x001,
370 AGG_TX_STATE_BT_PRIO = 0x002,
371 AGG_TX_STATE_FEW_BYTES = 0x004,
372 AGG_TX_STATE_ABORT = 0x008,
373 AGG_TX_STATE_LAST_SENT_TTL = 0x010,
374 AGG_TX_STATE_LAST_SENT_TRY_CNT = 0x020,
375 AGG_TX_STATE_LAST_SENT_BT_KILL = 0x040,
376 AGG_TX_STATE_SCD_QUERY = 0x080,
377 AGG_TX_STATE_TEST_BAD_CRC32 = 0x0100,
378 AGG_TX_STATE_RESPONSE = 0x1ff,
379 AGG_TX_STATE_DUMP_TX = 0x200,
380 AGG_TX_STATE_DELAY_TX = 0x400,
381 AGG_TX_STATE_TRY_CNT_POS = 12,
382 AGG_TX_STATE_TRY_CNT_MSK = 0xf << AGG_TX_STATE_TRY_CNT_POS,
383 };
384
385 #define AGG_TX_STATE_LAST_SENT_MSK (AGG_TX_STATE_LAST_SENT_TTL| \
386 AGG_TX_STATE_LAST_SENT_TRY_CNT| \
387 AGG_TX_STATE_LAST_SENT_BT_KILL)
388
389 /*
390 * The mask below describes a status where we are absolutely sure that the MPDU
391 * wasn't sent. For BA/Underrun we cannot be that sure. All we know that we've
392 * written the bytes to the TXE, but we know nothing about what the DSP did.
393 */
394 #define AGG_TX_STAT_FRAME_NOT_SENT (AGG_TX_STATE_FEW_BYTES | \
395 AGG_TX_STATE_ABORT | \
396 AGG_TX_STATE_SCD_QUERY)
397
398 /*
399 * REPLY_TX = 0x1c (response)
400 *
401 * This response may be in one of two slightly different formats, indicated
402 * by the frame_count field:
403 *
404 * 1) No aggregation (frame_count == 1). This reports Tx results for a single
405 * frame. Multiple attempts, at various bit rates, may have been made for
406 * this frame.
407 *
408 * 2) Aggregation (frame_count > 1). This reports Tx results for two or more
409 * frames that used block-acknowledge. All frames were transmitted at
410 * same rate. Rate scaling may have been used if first frame in this new
411 * agg block failed in previous agg block(s).
412 *
413 * Note that, for aggregation, ACK (block-ack) status is not delivered
414 * here; block-ack has not been received by the time the device records
415 * this status.
416 * This status relates to reasons the tx might have been blocked or aborted
417 * within the device, rather than whether it was received successfully by
418 * the destination station.
419 */
420
421 /**
422 * struct agg_tx_status - per packet TX aggregation status
423 * @status: enum iwl_tx_agg_status
424 * @sequence: Sequence # for this frame's Tx cmd (not SSN!)
425 */
426 struct agg_tx_status {
427 __le16 status;
428 __le16 sequence;
429 } __packed;
430
431 /*
432 * definitions for initial rate index field
433 * bits [3:0] initial rate index
434 * bits [6:4] rate table color, used for the initial rate
435 * bit-7 invalid rate indication
436 */
437 #define TX_RES_INIT_RATE_INDEX_MSK 0x0f
438 #define TX_RES_RATE_TABLE_COLOR_MSK 0x70
439 #define TX_RES_INV_RATE_INDEX_MSK 0x80
440
441 #define IWL_MVM_TX_RES_GET_TID(_ra_tid) ((_ra_tid) & 0x0f)
442 #define IWL_MVM_TX_RES_GET_RA(_ra_tid) ((_ra_tid) >> 4)
443
444 /**
445 * struct iwl_mvm_tx_resp - notifies that fw is TXing a packet
446 * ( REPLY_TX = 0x1c )
447 * @frame_count: 1 no aggregation, >1 aggregation
448 * @bt_kill_count: num of times blocked by bluetooth (unused for agg)
449 * @failure_rts: num of failures due to unsuccessful RTS
450 * @failure_frame: num failures due to no ACK (unused for agg)
451 * @initial_rate: for non-agg: rate of the successful Tx. For agg: rate of the
452 * Tx of all the batch. RATE_MCS_*
453 * @wireless_media_time: for non-agg: RTS + CTS + frame tx attempts time + ACK.
454 * for agg: RTS + CTS + aggregation tx time + block-ack time.
455 * in usec.
456 * @pa_status: tx power info
457 * @pa_integ_res_a: tx power info
458 * @pa_integ_res_b: tx power info
459 * @pa_integ_res_c: tx power info
460 * @measurement_req_id: tx power info
461 * @tfd_info: TFD information set by the FH
462 * @seq_ctl: sequence control from the Tx cmd
463 * @byte_cnt: byte count from the Tx cmd
464 * @tlc_info: TLC rate info
465 * @ra_tid: bits [3:0] = ra, bits [7:4] = tid
466 * @frame_ctrl: frame control
467 * @status: for non-agg: frame status TX_STATUS_*
468 * for agg: status of 1st frame, AGG_TX_STATE_*; other frame status fields
469 * follow this one, up to frame_count.
470 *
471 * After the array of statuses comes the SSN of the SCD. Look at
472 * %iwl_mvm_get_scd_ssn for more details.
473 */
474 struct iwl_mvm_tx_resp {
475 u8 frame_count;
476 u8 bt_kill_count;
477 u8 failure_rts;
478 u8 failure_frame;
479 __le32 initial_rate;
480 __le16 wireless_media_time;
481
482 u8 pa_status;
483 u8 pa_integ_res_a[3];
484 u8 pa_integ_res_b[3];
485 u8 pa_integ_res_c[3];
486 __le16 measurement_req_id;
487 u8 reduced_tpc;
488 u8 reserved;
489
490 __le32 tfd_info;
491 __le16 seq_ctl;
492 __le16 byte_cnt;
493 u8 tlc_info;
494 u8 ra_tid;
495 __le16 frame_ctrl;
496
497 struct agg_tx_status status;
498 } __packed; /* TX_RSP_API_S_VER_3 */
499
500 /**
501 * struct iwl_mvm_ba_notif - notifies about reception of BA
502 * ( BA_NOTIF = 0xc5 )
503 * @sta_addr_lo32: lower 32 bits of the MAC address
504 * @sta_addr_hi16: upper 16 bits of the MAC address
505 * @sta_id: Index of recipient (BA-sending) station in fw's station table
506 * @tid: tid of the session
507 * @seq_ctl:
508 * @bitmap: the bitmap of the BA notification as seen in the air
509 * @scd_flow: the tx queue this BA relates to
510 * @scd_ssn: the index of the last contiguously sent packet
511 * @txed: number of Txed frames in this batch
512 * @txed_2_done: number of Acked frames in this batch
513 * @reduced_txp: power reduced according to TPC. This is the actual value and
514 * not a copy from the LQ command. Thus, if not the first rate was used
515 * for Tx-ing then this value will be set to 0 by FW.
516 */
517 struct iwl_mvm_ba_notif {
518 __le32 sta_addr_lo32;
519 __le16 sta_addr_hi16;
520 __le16 reserved;
521
522 u8 sta_id;
523 u8 tid;
524 __le16 seq_ctl;
525 __le64 bitmap;
526 __le16 scd_flow;
527 __le16 scd_ssn;
528 u8 txed;
529 u8 txed_2_done;
530 u8 reduced_txp;
531 u8 reserved1;
532 } __packed;
533
534 /*
535 * struct iwl_mac_beacon_cmd - beacon template command
536 * @tx: the tx commands associated with the beacon frame
537 * @template_id: currently equal to the mac context id of the coresponding
538 * mac.
539 * @tim_idx: the offset of the tim IE in the beacon
540 * @tim_size: the length of the tim IE
541 * @frame: the template of the beacon frame
542 */
543 struct iwl_mac_beacon_cmd {
544 struct iwl_tx_cmd tx;
545 __le32 template_id;
546 __le32 tim_idx;
547 __le32 tim_size;
548 struct ieee80211_hdr frame[0];
549 } __packed;
550
551 struct iwl_beacon_notif {
552 struct iwl_mvm_tx_resp beacon_notify_hdr;
553 __le64 tsf;
554 __le32 ibss_mgr_status;
555 } __packed;
556
557 /**
558 * struct iwl_extended_beacon_notif - notifies about beacon transmission
559 * @beacon_notify_hdr: tx response command associated with the beacon
560 * @tsf: last beacon tsf
561 * @ibss_mgr_status: whether IBSS is manager
562 * @gp2: last beacon time in gp2
563 */
564 struct iwl_extended_beacon_notif {
565 struct iwl_mvm_tx_resp beacon_notify_hdr;
566 __le64 tsf;
567 __le32 ibss_mgr_status;
568 __le32 gp2;
569 } __packed; /* BEACON_NTFY_API_S_VER_5 */
570
571 /**
572 * enum iwl_dump_control - dump (flush) control flags
573 * @DUMP_TX_FIFO_FLUSH: Dump MSDUs until the the FIFO is empty
574 * and the TFD queues are empty.
575 */
576 enum iwl_dump_control {
577 DUMP_TX_FIFO_FLUSH = BIT(1),
578 };
579
580 /**
581 * struct iwl_tx_path_flush_cmd -- queue/FIFO flush command
582 * @queues_ctl: bitmap of queues to flush
583 * @flush_ctl: control flags
584 * @reserved: reserved
585 */
586 struct iwl_tx_path_flush_cmd {
587 __le32 queues_ctl;
588 __le16 flush_ctl;
589 __le16 reserved;
590 } __packed; /* TX_PATH_FLUSH_CMD_API_S_VER_1 */
591
592 /**
593 * iwl_mvm_get_scd_ssn - returns the SSN of the SCD
594 * @tx_resp: the Tx response from the fw (agg or non-agg)
595 *
596 * When the fw sends an AMPDU, it fetches the MPDUs one after the other. Since
597 * it can't know that everything will go well until the end of the AMPDU, it
598 * can't know in advance the number of MPDUs that will be sent in the current
599 * batch. This is why it writes the agg Tx response while it fetches the MPDUs.
600 * Hence, it can't know in advance what the SSN of the SCD will be at the end
601 * of the batch. This is why the SSN of the SCD is written at the end of the
602 * whole struct at a variable offset. This function knows how to cope with the
603 * variable offset and returns the SSN of the SCD.
604 */
605 static inline u32 iwl_mvm_get_scd_ssn(struct iwl_mvm_tx_resp *tx_resp)
606 {
607 return le32_to_cpup((__le32 *)&tx_resp->status +
608 tx_resp->frame_count) & 0xfff;
609 }
610
611 /**
612 * struct iwl_scd_txq_cfg_cmd - New txq hw scheduler config command
613 * @token:
614 * @sta_id: station id
615 * @tid:
616 * @scd_queue: scheduler queue to confiug
617 * @enable: 1 queue enable, 0 queue disable
618 * @aggregate: 1 aggregated queue, 0 otherwise
619 * @tx_fifo: %enum iwl_mvm_tx_fifo
620 * @window: BA window size
621 * @ssn: SSN for the BA agreement
622 */
623 struct iwl_scd_txq_cfg_cmd {
624 u8 token;
625 u8 sta_id;
626 u8 tid;
627 u8 scd_queue;
628 u8 enable;
629 u8 aggregate;
630 u8 tx_fifo;
631 u8 window;
632 __le16 ssn;
633 __le16 reserved;
634 } __packed; /* SCD_QUEUE_CFG_CMD_API_S_VER_1 */
635
636 /**
637 * struct iwl_scd_txq_cfg_rsp
638 * @token: taken from the command
639 * @sta_id: station id from the command
640 * @tid: tid from the command
641 * @scd_queue: scd_queue from the command
642 */
643 struct iwl_scd_txq_cfg_rsp {
644 u8 token;
645 u8 sta_id;
646 u8 tid;
647 u8 scd_queue;
648 } __packed; /* SCD_QUEUE_CFG_RSP_API_S_VER_1 */
649
650 #endif /* __fw_api_tx_h__ */
This page took 0.059021 seconds and 6 git commands to generate.