Path: blob/main/sys/contrib/dev/iwlwifi/fw/api/tx.h
48425 views
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */1/*2* Copyright (C) 2012-2014, 2018-2025 Intel Corporation3* Copyright (C) 2016-2017 Intel Deutschland GmbH4*/5#ifndef __iwl_fw_api_tx_h__6#define __iwl_fw_api_tx_h__7#include <linux/ieee80211.h>89/**10* enum iwl_tx_flags - bitmasks for tx_flags in TX command11* @TX_CMD_FLG_PROT_REQUIRE: use RTS or CTS-to-self to protect the frame12* @TX_CMD_FLG_WRITE_TX_POWER: update current tx power value in the mgmt frame13* @TX_CMD_FLG_ACK: expect ACK from receiving station14* @TX_CMD_FLG_STA_RATE: use RS table with initial index from the TX command.15* Otherwise, use rate_n_flags from the TX command16* @TX_CMD_FLG_BAR: this frame is a BA request, immediate BAR is expected17* Must set TX_CMD_FLG_ACK with this flag.18* @TX_CMD_FLG_TXOP_PROT: TXOP protection requested19* @TX_CMD_FLG_VHT_NDPA: mark frame is NDPA for VHT beamformer sequence20* @TX_CMD_FLG_HT_NDPA: mark frame is NDPA for HT beamformer sequence21* @TX_CMD_FLG_CSI_FDBK2HOST: mark to send feedback to host (only if good CRC)22* @TX_CMD_FLG_BT_PRIO_MASK: BT priority value23* @TX_CMD_FLG_BT_PRIO_POS: the position of the BT priority (bit 11 is ignored24* on old firmwares).25* @TX_CMD_FLG_BT_DIS: disable BT priority for this frame26* @TX_CMD_FLG_SEQ_CTL: set if FW should override the sequence control.27* Should be set for mgmt, non-QOS data, mcast, bcast and in scan command28* @TX_CMD_FLG_MORE_FRAG: this frame is non-last MPDU29* @TX_CMD_FLG_TSF: FW should calculate and insert TSF in the frame30* Should be set for beacons and probe responses31* @TX_CMD_FLG_CALIB: activate PA TX power calibrations32* @TX_CMD_FLG_KEEP_SEQ_CTL: if seq_ctl is set, don't increase inner seq count33* @TX_CMD_FLG_MH_PAD: driver inserted 2 byte padding after MAC header.34* Should be set for 26/30 length MAC headers35* @TX_CMD_FLG_RESP_TO_DRV: zero this if the response should go only to FW36* @TX_CMD_FLG_TKIP_MIC_DONE: FW already performed TKIP MIC calculation37* @TX_CMD_FLG_DUR: disable duration overwriting used in PS-Poll Assoc-id38* @TX_CMD_FLG_FW_DROP: FW should mark frame to be dropped39* @TX_CMD_FLG_EXEC_PAPD: execute PAPD40* @TX_CMD_FLG_PAPD_TYPE: 0 for reference power, 1 for nominal power41* @TX_CMD_FLG_HCCA_CHUNK: mark start of TSPEC chunk42*/43enum iwl_tx_flags {44TX_CMD_FLG_PROT_REQUIRE = BIT(0),45TX_CMD_FLG_WRITE_TX_POWER = BIT(1),46TX_CMD_FLG_ACK = BIT(3),47TX_CMD_FLG_STA_RATE = BIT(4),48TX_CMD_FLG_BAR = BIT(6),49TX_CMD_FLG_TXOP_PROT = BIT(7),50TX_CMD_FLG_VHT_NDPA = BIT(8),51TX_CMD_FLG_HT_NDPA = BIT(9),52TX_CMD_FLG_CSI_FDBK2HOST = BIT(10),53TX_CMD_FLG_BT_PRIO_POS = 11,54TX_CMD_FLG_BT_PRIO_MASK = BIT(11) | BIT(12),55TX_CMD_FLG_BT_DIS = BIT(12),56TX_CMD_FLG_SEQ_CTL = BIT(13),57TX_CMD_FLG_MORE_FRAG = BIT(14),58TX_CMD_FLG_TSF = BIT(16),59TX_CMD_FLG_CALIB = BIT(17),60TX_CMD_FLG_KEEP_SEQ_CTL = BIT(18),61TX_CMD_FLG_MH_PAD = BIT(20),62TX_CMD_FLG_RESP_TO_DRV = BIT(21),63TX_CMD_FLG_TKIP_MIC_DONE = BIT(23),64TX_CMD_FLG_DUR = BIT(25),65TX_CMD_FLG_FW_DROP = BIT(26),66TX_CMD_FLG_EXEC_PAPD = BIT(27),67TX_CMD_FLG_PAPD_TYPE = BIT(28),68TX_CMD_FLG_HCCA_CHUNK = BIT(31)69}; /* TX_FLAGS_BITS_API_S_VER_1 */7071/**72* enum iwl_tx_cmd_flags - bitmasks for tx_flags in TX command for 2200073* @IWL_TX_FLAGS_CMD_RATE: use rate from the TX command74* @IWL_TX_FLAGS_ENCRYPT_DIS: frame should not be encrypted, even if it belongs75* to a secured STA76* @IWL_TX_FLAGS_HIGH_PRI: high priority frame (like EAPOL) - can affect rate77* selection, retry limits and BT kill78* @IWL_TX_FLAGS_RTS: firmware used an RTS79* @IWL_TX_FLAGS_CTS: firmware used CTS-to-self80*/81enum iwl_tx_cmd_flags {82IWL_TX_FLAGS_CMD_RATE = BIT(0),83IWL_TX_FLAGS_ENCRYPT_DIS = BIT(1),84IWL_TX_FLAGS_HIGH_PRI = BIT(2),85/* Use these flags only from86* TX_FLAGS_BITS_API_S_VER_4 and above */87IWL_TX_FLAGS_RTS = BIT(3),88IWL_TX_FLAGS_CTS = BIT(4),89}; /* TX_FLAGS_BITS_API_S_VER_3 */9091/**92* enum iwl_tx_pm_timeouts - pm timeout values in TX command93* @PM_FRAME_NONE: no need to suspend sleep mode94* @PM_FRAME_MGMT: fw suspend sleep mode for 100TU95* @PM_FRAME_ASSOC: fw suspend sleep mode for 10sec96*/97enum iwl_tx_pm_timeouts {98PM_FRAME_NONE = 0,99PM_FRAME_MGMT = 2,100PM_FRAME_ASSOC = 3,101};102103#define TX_CMD_SEC_MSK 0x07104#define TX_CMD_SEC_WEP_KEY_IDX_POS 6105#define TX_CMD_SEC_WEP_KEY_IDX_MSK 0xc0106107/**108* enum iwl_tx_cmd_sec_ctrl - bitmasks for security control in TX command109* @TX_CMD_SEC_WEP: WEP encryption algorithm.110* @TX_CMD_SEC_CCM: CCM encryption algorithm.111* @TX_CMD_SEC_TKIP: TKIP encryption algorithm.112* @TX_CMD_SEC_EXT: extended cipher algorithm.113* @TX_CMD_SEC_GCMP: GCMP encryption algorithm.114* @TX_CMD_SEC_KEY128: set for 104 bits WEP key.115* @TX_CMD_SEC_KEY_FROM_TABLE: for a non-WEP key, set if the key should be taken116* from the table instead of from the TX command.117* If the key is taken from the key table its index should be given by the118* first byte of the TX command key field.119*/120enum iwl_tx_cmd_sec_ctrl {121TX_CMD_SEC_WEP = 0x01,122TX_CMD_SEC_CCM = 0x02,123TX_CMD_SEC_TKIP = 0x03,124TX_CMD_SEC_EXT = 0x04,125TX_CMD_SEC_GCMP = 0x05,126TX_CMD_SEC_KEY128 = 0x08,127TX_CMD_SEC_KEY_FROM_TABLE = 0x10,128};129130/*131* TX command Frame life time in us - to be written in pm_frame_timeout132*/133#define TX_CMD_LIFE_TIME_INFINITE 0xFFFFFFFF134#define TX_CMD_LIFE_TIME_DEFAULT 2000000 /* 2000 ms*/135#define TX_CMD_LIFE_TIME_PROBE_RESP 40000 /* 40 ms */136#define TX_CMD_LIFE_TIME_EXPIRED_FRAME 0137138/*139* TID for non QoS frames - to be written in tid_tspec140*/141#define IWL_TID_NON_QOS 0142143/*144* Limits on the retransmissions - to be written in {data,rts}_retry_limit145*/146#define IWL_DEFAULT_TX_RETRY 15147#define IWL_MGMT_DFAULT_RETRY_LIMIT 3148#define IWL_RTS_DFAULT_RETRY_LIMIT 60149#define IWL_BAR_DFAULT_RETRY_LIMIT 60150#define IWL_LOW_RETRY_LIMIT 7151152/**153* enum iwl_tx_offload_assist_flags_pos - set %iwl_tx_cmd_v6 offload_assist values154* @TX_CMD_OFFLD_IP_HDR: offset to start of IP header (in words)155* from mac header end. For normal case it is 4 words for SNAP.156* note: tx_cmd, mac header and pad are not counted in the offset.157* This is used to help the offload in case there is tunneling such as158* IPv6 in IPv4, in such case the ip header offset should point to the159* inner ip header and IPv4 checksum of the external header should be160* calculated by driver.161* @TX_CMD_OFFLD_L4_EN: enable TCP/UDP checksum162* @TX_CMD_OFFLD_L3_EN: enable IP header checksum163* @TX_CMD_OFFLD_MH_SIZE: size of the mac header in words. Includes the IV164* field. Doesn't include the pad.165* @TX_CMD_OFFLD_PAD: mark 2-byte pad was inserted after the mac header for166* alignment167* @TX_CMD_OFFLD_AMSDU: mark TX command is A-MSDU168*/169enum iwl_tx_offload_assist_flags_pos {170TX_CMD_OFFLD_IP_HDR = 0,171TX_CMD_OFFLD_L4_EN = 6,172TX_CMD_OFFLD_L3_EN = 7,173TX_CMD_OFFLD_MH_SIZE = 8,174TX_CMD_OFFLD_PAD = 13,175TX_CMD_OFFLD_AMSDU = 14,176};177178#define IWL_TX_CMD_OFFLD_MH_MASK 0x1f179#define IWL_TX_CMD_OFFLD_IP_HDR_MASK 0x3f180181/* TODO: complete documentation for try_cnt and btkill_cnt */182/**183* struct iwl_tx_cmd_v6_params - parameters of the TX184*185* @len: in bytes of the payload, see below for details186* @offload_assist: TX offload configuration187* @tx_flags: combination of TX_CMD_FLG_*, see &enum iwl_tx_flags188* @scratch: scratch buffer used by the device189* @rate_n_flags: rate for *all* Tx attempts, if TX_CMD_FLG_STA_RATE_MSK is190* cleared. Combination of RATE_MCS_*191* @sta_id: index of destination station in FW station table192* @sec_ctl: security control, TX_CMD_SEC_*193* @initial_rate_index: index into the rate table for initial TX attempt.194* Applied if TX_CMD_FLG_STA_RATE_MSK is set, normally 0 for data frames.195* @reserved2: reserved196* @key: security key197* @reserved3: reserved198* @life_time: frame life time (usecs??)199* @dram_lsb_ptr: Physical address of scratch area in the command (try_cnt +200* btkill_cnd + reserved), first 32 bits. "0" disables usage.201* @dram_msb_ptr: upper bits of the scratch physical address202* @rts_retry_limit: max attempts for RTS203* @data_retry_limit: max attempts to send the data packet204* @tid_tspec: TID/tspec205* @pm_frame_timeout: PM TX frame timeout206* @reserved4: reserved207*208* The byte count (both len and next_frame_len) includes MAC header209* (24/26/30/32 bytes)210* + 2 bytes pad if 26/30 header size211* + 8 byte IV for CCM or TKIP (not used for WEP)212* + Data payload213* + 8-byte MIC (not used for CCM/WEP)214* It does not include post-MAC padding, i.e.,215* MIC (CCM) 8 bytes, ICV (WEP/TKIP/CKIP) 4 bytes, CRC 4 bytes.216* Range of len: 14-2342 bytes.217*/218struct iwl_tx_cmd_v6_params {219__le16 len;220__le16 offload_assist;221__le32 tx_flags;222struct {223u8 try_cnt;224u8 btkill_cnt;225__le16 reserved;226} scratch; /* DRAM_SCRATCH_API_U_VER_1 */227__le32 rate_n_flags;228u8 sta_id;229u8 sec_ctl;230u8 initial_rate_index;231u8 reserved2;232u8 key[16];233__le32 reserved3;234__le32 life_time;235__le32 dram_lsb_ptr;236u8 dram_msb_ptr;237u8 rts_retry_limit;238u8 data_retry_limit;239u8 tid_tspec;240__le16 pm_frame_timeout;241__le16 reserved4;242} __packed; /* TX_CMD_API_S_VER_6 */243244/**245* struct iwl_tx_cmd_v6 - TX command struct to FW246* ( TX_CMD = 0x1c )247* @params: parameters of the TX, see &struct iwl_tx_cmd_v6_tx_params248* @hdr: 802.11 header249*250* After ¶ms, the MAC header is placed, plus any padding,251* and then the actual payload.252*/253struct iwl_tx_cmd_v6 {254struct iwl_tx_cmd_v6_params params;255struct ieee80211_hdr hdr[];256} __packed; /* TX_CMD_API_S_VER_6 */257258struct iwl_dram_sec_info {259__le32 pn_low;260__le16 pn_high;261__le16 aux_info;262} __packed; /* DRAM_SEC_INFO_API_S_VER_1 */263264/**265* struct iwl_tx_cmd_v9 - TX command struct to FW for 22000 devices266* ( TX_CMD = 0x1c )267* @len: in bytes of the payload, see below for details268* @offload_assist: TX offload configuration269* @flags: combination of &enum iwl_tx_cmd_flags270* @dram_info: FW internal DRAM storage271* @rate_n_flags: rate for *all* Tx attempts, if TX_CMD_FLG_STA_RATE_MSK is272* cleared. Combination of RATE_MCS_*273* @hdr: 802.11 header274*/275struct iwl_tx_cmd_v9 {276__le16 len;277__le16 offload_assist;278__le32 flags;279struct iwl_dram_sec_info dram_info;280__le32 rate_n_flags;281struct ieee80211_hdr hdr[];282} __packed; /* TX_CMD_API_S_VER_7,283TX_CMD_API_S_VER_9 */284285/**286* struct iwl_tx_cmd - TX command struct to FW for AX210+ devices287* ( TX_CMD = 0x1c )288* @len: in bytes of the payload, see below for details289* @flags: combination of &enum iwl_tx_cmd_flags290* @offload_assist: TX offload configuration291* @dram_info: FW internal DRAM storage292* @rate_n_flags: rate for *all* Tx attempts, if TX_CMD_FLG_STA_RATE_MSK is293* cleared. Combination of RATE_MCS_*; format depends on version294* @reserved: reserved295* @hdr: 802.11 header296*/297struct iwl_tx_cmd {298__le16 len;299__le16 flags;300__le32 offload_assist;301struct iwl_dram_sec_info dram_info;302__le32 rate_n_flags;303u8 reserved[8];304struct ieee80211_hdr hdr[];305} __packed; /* TX_CMD_API_S_VER_10,306* TX_CMD_API_S_VER_11307*/308309/*310* TX response related data311*/312313/*314* enum iwl_tx_status - status that is returned by the fw after attempts to Tx315* @TX_STATUS_SUCCESS:316* @TX_STATUS_DIRECT_DONE:317* @TX_STATUS_POSTPONE_DELAY:318* @TX_STATUS_POSTPONE_FEW_BYTES:319* @TX_STATUS_POSTPONE_BT_PRIO:320* @TX_STATUS_POSTPONE_QUIET_PERIOD:321* @TX_STATUS_POSTPONE_CALC_TTAK:322* @TX_STATUS_FAIL_INTERNAL_CROSSED_RETRY:323* @TX_STATUS_FAIL_SHORT_LIMIT:324* @TX_STATUS_FAIL_LONG_LIMIT:325* @TX_STATUS_FAIL_UNDERRUN:326* @TX_STATUS_FAIL_DRAIN_FLOW:327* @TX_STATUS_FAIL_RFKILL_FLUSH:328* @TX_STATUS_FAIL_LIFE_EXPIRE:329* @TX_STATUS_FAIL_DEST_PS:330* @TX_STATUS_FAIL_HOST_ABORTED:331* @TX_STATUS_FAIL_BT_RETRY:332* @TX_STATUS_FAIL_STA_INVALID:333* @TX_TATUS_FAIL_FRAG_DROPPED:334* @TX_STATUS_FAIL_TID_DISABLE:335* @TX_STATUS_FAIL_FIFO_FLUSHED:336* @TX_STATUS_FAIL_SMALL_CF_POLL:337* @TX_STATUS_FAIL_FW_DROP:338* @TX_STATUS_FAIL_STA_COLOR_MISMATCH: mismatch between color of Tx cmd and339* STA table340* @TX_FRAME_STATUS_INTERNAL_ABORT:341* @TX_MODE_MSK:342* @TX_MODE_NO_BURST:343* @TX_MODE_IN_BURST_SEQ:344* @TX_MODE_FIRST_IN_BURST:345* @TX_QUEUE_NUM_MSK:346*347* Valid only if frame_count =1348* TODO: complete documentation349*/350enum iwl_tx_status {351TX_STATUS_MSK = 0x000000ff,352TX_STATUS_SUCCESS = 0x01,353TX_STATUS_DIRECT_DONE = 0x02,354/* postpone TX */355TX_STATUS_POSTPONE_DELAY = 0x40,356TX_STATUS_POSTPONE_FEW_BYTES = 0x41,357TX_STATUS_POSTPONE_BT_PRIO = 0x42,358TX_STATUS_POSTPONE_QUIET_PERIOD = 0x43,359TX_STATUS_POSTPONE_CALC_TTAK = 0x44,360/* abort TX */361TX_STATUS_FAIL_INTERNAL_CROSSED_RETRY = 0x81,362TX_STATUS_FAIL_SHORT_LIMIT = 0x82,363TX_STATUS_FAIL_LONG_LIMIT = 0x83,364TX_STATUS_FAIL_UNDERRUN = 0x84,365TX_STATUS_FAIL_DRAIN_FLOW = 0x85,366TX_STATUS_FAIL_RFKILL_FLUSH = 0x86,367TX_STATUS_FAIL_LIFE_EXPIRE = 0x87,368TX_STATUS_FAIL_DEST_PS = 0x88,369TX_STATUS_FAIL_HOST_ABORTED = 0x89,370TX_STATUS_FAIL_BT_RETRY = 0x8a,371TX_STATUS_FAIL_STA_INVALID = 0x8b,372TX_STATUS_FAIL_FRAG_DROPPED = 0x8c,373TX_STATUS_FAIL_TID_DISABLE = 0x8d,374TX_STATUS_FAIL_FIFO_FLUSHED = 0x8e,375TX_STATUS_FAIL_SMALL_CF_POLL = 0x8f,376TX_STATUS_FAIL_FW_DROP = 0x90,377TX_STATUS_FAIL_STA_COLOR_MISMATCH = 0x91,378TX_STATUS_INTERNAL_ABORT = 0x92,379TX_MODE_MSK = 0x00000f00,380TX_MODE_NO_BURST = 0x00000000,381TX_MODE_IN_BURST_SEQ = 0x00000100,382TX_MODE_FIRST_IN_BURST = 0x00000200,383TX_QUEUE_NUM_MSK = 0x0001f000,384TX_NARROW_BW_MSK = 0x00060000,385TX_NARROW_BW_1DIV2 = 0x00020000,386TX_NARROW_BW_1DIV4 = 0x00040000,387TX_NARROW_BW_1DIV8 = 0x00060000,388};389390/*391* enum iwl_tx_agg_status - TX aggregation status392* @AGG_TX_STATE_STATUS_MSK:393* @AGG_TX_STATE_TRANSMITTED:394* @AGG_TX_STATE_UNDERRUN:395* @AGG_TX_STATE_BT_PRIO:396* @AGG_TX_STATE_FEW_BYTES:397* @AGG_TX_STATE_ABORT:398* @AGG_TX_STATE_TX_ON_AIR_DROP: TX_ON_AIR signal drop without underrun or399* BT detection400* @AGG_TX_STATE_LAST_SENT_TRY_CNT:401* @AGG_TX_STATE_LAST_SENT_BT_KILL:402* @AGG_TX_STATE_SCD_QUERY:403* @AGG_TX_STATE_TEST_BAD_CRC32:404* @AGG_TX_STATE_RESPONSE:405* @AGG_TX_STATE_DUMP_TX:406* @AGG_TX_STATE_DELAY_TX:407* @AGG_TX_STATE_TRY_CNT_MSK: Retry count for 1st frame in aggregation (retries408* occur if tx failed for this frame when it was a member of a previous409* aggregation block). If rate scaling is used, retry count indicates the410* rate table entry used for all frames in the new agg.411* @AGG_TX_STATE_SEQ_NUM_MSK: Command ID and sequence number of Tx command for412* this frame413*414* TODO: complete documentation415*/416enum iwl_tx_agg_status {417AGG_TX_STATE_STATUS_MSK = 0x00fff,418AGG_TX_STATE_TRANSMITTED = 0x000,419AGG_TX_STATE_UNDERRUN = 0x001,420AGG_TX_STATE_BT_PRIO = 0x002,421AGG_TX_STATE_FEW_BYTES = 0x004,422AGG_TX_STATE_ABORT = 0x008,423AGG_TX_STATE_TX_ON_AIR_DROP = 0x010,424AGG_TX_STATE_LAST_SENT_TRY_CNT = 0x020,425AGG_TX_STATE_LAST_SENT_BT_KILL = 0x040,426AGG_TX_STATE_SCD_QUERY = 0x080,427AGG_TX_STATE_TEST_BAD_CRC32 = 0x0100,428AGG_TX_STATE_RESPONSE = 0x1ff,429AGG_TX_STATE_DUMP_TX = 0x200,430AGG_TX_STATE_DELAY_TX = 0x400,431AGG_TX_STATE_TRY_CNT_POS = 12,432AGG_TX_STATE_TRY_CNT_MSK = 0xf << AGG_TX_STATE_TRY_CNT_POS,433};434435/*436* The mask below describes a status where we are absolutely sure that the MPDU437* wasn't sent. For BA/Underrun we cannot be that sure. All we know that we've438* written the bytes to the TXE, but we know nothing about what the DSP did.439*/440#define AGG_TX_STAT_FRAME_NOT_SENT (AGG_TX_STATE_FEW_BYTES | \441AGG_TX_STATE_ABORT | \442AGG_TX_STATE_SCD_QUERY)443444/*445* REPLY_TX = 0x1c (response)446*447* This response may be in one of two slightly different formats, indicated448* by the frame_count field:449*450* 1) No aggregation (frame_count == 1). This reports Tx results for a single451* frame. Multiple attempts, at various bit rates, may have been made for452* this frame.453*454* 2) Aggregation (frame_count > 1). This reports Tx results for two or more455* frames that used block-acknowledge. All frames were transmitted at456* same rate. Rate scaling may have been used if first frame in this new457* agg block failed in previous agg block(s).458*459* Note that, for aggregation, ACK (block-ack) status is not delivered460* here; block-ack has not been received by the time the device records461* this status.462* This status relates to reasons the tx might have been blocked or aborted463* within the device, rather than whether it was received successfully by464* the destination station.465*/466467/**468* struct agg_tx_status - per packet TX aggregation status469* @status: See &enum iwl_tx_agg_status470* @sequence: Sequence # for this frame's Tx cmd (not SSN!)471*/472struct agg_tx_status {473__le16 status;474__le16 sequence;475} __packed;476477/*478* definitions for initial rate index field479* bits [3:0] initial rate index480* bits [6:4] rate table color, used for the initial rate481* bit-7 invalid rate indication482*/483#define TX_RES_INIT_RATE_INDEX_MSK 0x0f484#define TX_RES_RATE_TABLE_COLOR_POS 4485#define TX_RES_RATE_TABLE_COLOR_MSK 0x70486#define TX_RES_INV_RATE_INDEX_MSK 0x80487#define TX_RES_RATE_TABLE_COL_GET(_f) (((_f) & TX_RES_RATE_TABLE_COLOR_MSK) >>\488TX_RES_RATE_TABLE_COLOR_POS)489490#define IWL_TX_RES_GET_TID(_ra_tid) ((_ra_tid) & 0x0f)491#define IWL_TX_RES_GET_RA(_ra_tid) ((_ra_tid) >> 4)492493/**494* struct iwl_tx_resp_v3 - notifies that fw is TXing a packet495* ( REPLY_TX = 0x1c )496* @frame_count: 1 no aggregation, >1 aggregation497* @bt_kill_count: num of times blocked by bluetooth (unused for agg)498* @failure_rts: num of failures due to unsuccessful RTS499* @failure_frame: num failures due to no ACK (unused for agg)500* @initial_rate: for non-agg: rate of the successful Tx. For agg: rate of the501* Tx of all the batch. RATE_MCS_*502* @wireless_media_time: for non-agg: RTS + CTS + frame tx attempts time + ACK.503* for agg: RTS + CTS + aggregation tx time + block-ack time.504* in usec.505* @pa_status: tx power info506* @pa_integ_res_a: tx power info507* @pa_integ_res_b: tx power info508* @pa_integ_res_c: tx power info509* @measurement_req_id: tx power info510* @reduced_tpc: transmit power reduction used511* @reserved: reserved512* @tfd_info: TFD information set by the FH513* @seq_ctl: sequence control from the Tx cmd514* @byte_cnt: byte count from the Tx cmd515* @tlc_info: TLC rate info516* @ra_tid: bits [3:0] = ra, bits [7:4] = tid517* @frame_ctrl: frame control518* @status: for non-agg: frame status TX_STATUS_*519* for agg: status of 1st frame, AGG_TX_STATE_*; other frame status fields520* follow this one, up to frame_count. Length in @frame_count.521*522* After the array of statuses comes the SSN of the SCD. Look at523* %iwl_mvm_get_scd_ssn for more details.524*/525struct iwl_tx_resp_v3 {526u8 frame_count;527u8 bt_kill_count;528u8 failure_rts;529u8 failure_frame;530__le32 initial_rate;531__le16 wireless_media_time;532533u8 pa_status;534u8 pa_integ_res_a[3];535u8 pa_integ_res_b[3];536u8 pa_integ_res_c[3];537__le16 measurement_req_id;538u8 reduced_tpc;539u8 reserved;540541__le32 tfd_info;542__le16 seq_ctl;543__le16 byte_cnt;544u8 tlc_info;545u8 ra_tid;546__le16 frame_ctrl;547struct agg_tx_status status[];548} __packed; /* TX_RSP_API_S_VER_3 */549550/**551* struct iwl_tx_resp - notifies that fw is TXing a packet552* ( REPLY_TX = 0x1c )553* @frame_count: 1 no aggregation, >1 aggregation554* @bt_kill_count: num of times blocked by bluetooth (unused for agg)555* @failure_rts: num of failures due to unsuccessful RTS556* @failure_frame: num failures due to no ACK (unused for agg)557* @initial_rate: for non-agg: rate of the successful Tx. For agg: rate of the558* Tx of all the batch. RATE_MCS_*; format depends on command version559* @wireless_media_time: for non-agg: RTS + CTS + frame tx attempts time + ACK.560* for agg: RTS + CTS + aggregation tx time + block-ack time.561* in usec.562* @pa_status: tx power info563* @pa_integ_res_a: tx power info564* @pa_integ_res_b: tx power info565* @pa_integ_res_c: tx power info566* @measurement_req_id: tx power info567* @reduced_tpc: transmit power reduction used568* @reserved: reserved569* @tfd_info: TFD information set by the FH570* @seq_ctl: sequence control from the Tx cmd571* @byte_cnt: byte count from the Tx cmd572* @tlc_info: TLC rate info573* @ra_tid: bits [3:0] = ra, bits [7:4] = tid574* @frame_ctrl: frame control575* @tx_queue: TX queue for this response576* @reserved2: reserved for padding/alignment577* @status: for non-agg: frame status TX_STATUS_*578* For version 6 TX response isn't received for aggregation at all.579*580* After the array of statuses comes the SSN of the SCD. Look at581* %iwl_mvm_get_scd_ssn for more details.582*/583struct iwl_tx_resp {584u8 frame_count;585u8 bt_kill_count;586u8 failure_rts;587u8 failure_frame;588__le32 initial_rate;589__le16 wireless_media_time;590591u8 pa_status;592u8 pa_integ_res_a[3];593u8 pa_integ_res_b[3];594u8 pa_integ_res_c[3];595__le16 measurement_req_id;596u8 reduced_tpc;597u8 reserved;598599__le32 tfd_info;600__le16 seq_ctl;601__le16 byte_cnt;602u8 tlc_info;603u8 ra_tid;604__le16 frame_ctrl;605__le16 tx_queue;606__le16 reserved2;607struct agg_tx_status status;608} __packed; /* TX_RSP_API_S_VER_6,609* TX_RSP_API_S_VER_7,610* TX_RSP_API_S_VER_8,611* TX_RSP_API_S_VER_9612*/613614/**615* struct iwl_mvm_ba_notif - notifies about reception of BA616* ( BA_NOTIF = 0xc5 )617* @sta_addr: MAC address618* @reserved: reserved619* @sta_id: Index of recipient (BA-sending) station in fw's station table620* @tid: tid of the session621* @seq_ctl: sequence control field622* @bitmap: the bitmap of the BA notification as seen in the air623* @scd_flow: the tx queue this BA relates to624* @scd_ssn: the index of the last contiguously sent packet625* @txed: number of Txed frames in this batch626* @txed_2_done: number of Acked frames in this batch627* @reduced_txp: power reduced according to TPC. This is the actual value and628* not a copy from the LQ command. Thus, if not the first rate was used629* for Tx-ing then this value will be set to 0 by FW.630* @reserved1: reserved631*/632struct iwl_mvm_ba_notif {633u8 sta_addr[ETH_ALEN];634__le16 reserved;635636u8 sta_id;637u8 tid;638__le16 seq_ctl;639__le64 bitmap;640__le16 scd_flow;641__le16 scd_ssn;642u8 txed;643u8 txed_2_done;644u8 reduced_txp;645u8 reserved1;646} __packed;647648/**649* struct iwl_compressed_ba_tfd - progress of a TFD queue650* @q_num: TFD queue number651* @tfd_index: Index of first un-acked frame in the TFD queue652* @scd_queue: For debug only - the physical queue the TFD queue is bound to653* @tid: TID of the queue (0-7)654* @reserved: reserved for alignment655*/656struct iwl_compressed_ba_tfd {657__le16 q_num;658__le16 tfd_index;659u8 scd_queue;660u8 tid;661u8 reserved[2];662} __packed; /* COMPRESSED_BA_TFD_API_S_VER_1 */663664/**665* struct iwl_compressed_ba_ratid - progress of a RA TID queue666* @q_num: RA TID queue number667* @tid: TID of the queue668* @ssn: BA window current SSN669*/670struct iwl_compressed_ba_ratid {671u8 q_num;672u8 tid;673__le16 ssn;674} __packed; /* COMPRESSED_BA_RATID_API_S_VER_1 */675676/*677* enum iwl_mvm_ba_resp_flags - TX aggregation status678* @IWL_MVM_BA_RESP_TX_AGG: generated due to BA679* @IWL_MVM_BA_RESP_TX_BAR: generated due to BA after BAR680* @IWL_MVM_BA_RESP_TX_AGG_FAIL: aggregation didn't receive BA681* @IWL_MVM_BA_RESP_TX_UNDERRUN: aggregation got underrun682* @IWL_MVM_BA_RESP_TX_BT_KILL: aggregation got BT-kill683* @IWL_MVM_BA_RESP_TX_DSP_TIMEOUT: aggregation didn't finish within the684* expected time685*/686enum iwl_mvm_ba_resp_flags {687IWL_MVM_BA_RESP_TX_AGG,688IWL_MVM_BA_RESP_TX_BAR,689IWL_MVM_BA_RESP_TX_AGG_FAIL,690IWL_MVM_BA_RESP_TX_UNDERRUN,691IWL_MVM_BA_RESP_TX_BT_KILL,692IWL_MVM_BA_RESP_TX_DSP_TIMEOUT693};694695/**696* struct iwl_compressed_ba_notif - notifies about reception of BA697* ( BA_NOTIF = 0xc5 )698* @flags: status flag, see the &iwl_mvm_ba_resp_flags699* @sta_id: Index of recipient (BA-sending) station in fw's station table700* @reduced_txp: power reduced according to TPC. This is the actual value and701* not a copy from the LQ command. Thus, if not the first rate was used702* for Tx-ing then this value will be set to 0 by FW.703* @tlc_rate_info: TLC rate info, initial rate index, TLC table color704* @retry_cnt: retry count705* @query_byte_cnt: SCD query byte count706* @query_frame_cnt: SCD query frame count707* @txed: number of frames sent in the aggregation (all-TIDs)708* @done: number of frames that were Acked by the BA (all-TIDs)709* @rts_retry_cnt: RTS retry count710* @reserved: reserved (for alignment)711* @wireless_time: Wireless-media time712* @tx_rate: the rate the aggregation was sent at. Format depends on command713* version.714* @tfd_cnt: number of TFD-Q elements715* @ra_tid_cnt: number of RATID-Q elements716* @tfd: array of TFD queue status updates. See &iwl_compressed_ba_tfd717* for details. Length in @tfd_cnt.718* @ra_tid: array of RA-TID queue status updates. For debug purposes only. See719* &iwl_compressed_ba_ratid for more details. Length in @ra_tid_cnt.720*/721struct iwl_compressed_ba_notif {722__le32 flags;723u8 sta_id;724u8 reduced_txp;725u8 tlc_rate_info;726u8 retry_cnt;727__le32 query_byte_cnt;728__le16 query_frame_cnt;729__le16 txed;730__le16 done;731u8 rts_retry_cnt;732u8 reserved;733__le32 wireless_time;734__le32 tx_rate;735__le16 tfd_cnt;736__le16 ra_tid_cnt;737union {738DECLARE_FLEX_ARRAY(struct iwl_compressed_ba_ratid, ra_tid);739DECLARE_FLEX_ARRAY(struct iwl_compressed_ba_tfd, tfd);740};741} __packed; /* COMPRESSED_BA_RES_API_S_VER_4,742COMPRESSED_BA_RES_API_S_VER_6,743COMPRESSED_BA_RES_API_S_VER_7 */744745/**746* struct iwl_mac_beacon_cmd_v6 - beacon template command747* @tx: the tx commands associated with the beacon frame748* @template_id: currently equal to the mac context id of the coresponding749* mac.750* @tim_idx: the offset of the tim IE in the beacon751* @tim_size: the length of the tim IE752* @frame: the template of the beacon frame753*/754struct iwl_mac_beacon_cmd_v6 {755struct iwl_tx_cmd_v6_params tx;756__le32 template_id;757__le32 tim_idx;758__le32 tim_size;759struct ieee80211_hdr frame[];760} __packed; /* BEACON_TEMPLATE_CMD_API_S_VER_6 */761762/**763* struct iwl_mac_beacon_cmd_v7 - beacon template command with offloaded CSA764* @tx: the tx commands associated with the beacon frame765* @template_id: currently equal to the mac context id of the coresponding766* mac.767* @tim_idx: the offset of the tim IE in the beacon768* @tim_size: the length of the tim IE769* @ecsa_offset: offset to the ECSA IE if present770* @csa_offset: offset to the CSA IE if present771* @frame: the template of the beacon frame772*/773struct iwl_mac_beacon_cmd_v7 {774struct iwl_tx_cmd_v6_params tx;775__le32 template_id;776__le32 tim_idx;777__le32 tim_size;778__le32 ecsa_offset;779__le32 csa_offset;780struct ieee80211_hdr frame[];781} __packed; /* BEACON_TEMPLATE_CMD_API_S_VER_7 */782783/* Bit flags for BEACON_TEMPLATE_CMD_API until version 10 */784enum iwl_mac_beacon_flags_v1 {785IWL_MAC_BEACON_CCK_V1 = BIT(8),786IWL_MAC_BEACON_ANT_A_V1 = BIT(9),787IWL_MAC_BEACON_ANT_B_V1 = BIT(10),788IWL_MAC_BEACON_FILS_V1 = BIT(12),789};790791/* Bit flags for BEACON_TEMPLATE_CMD_API version 11 and above */792enum iwl_mac_beacon_flags {793IWL_MAC_BEACON_CCK = BIT(5),794IWL_MAC_BEACON_ANT_A = BIT(6),795IWL_MAC_BEACON_ANT_B = BIT(7),796IWL_MAC_BEACON_FILS = BIT(8),797};798799/**800* struct iwl_mac_beacon_cmd - beacon template command with offloaded CSA801* @byte_cnt: byte count of the beacon frame.802* @flags: least significant byte for rate code. The most significant byte803* is &enum iwl_mac_beacon_flags.804* @short_ssid: Short SSID805* @reserved: reserved806* @link_id: the firmware id of the link that will use this beacon807* @tim_idx: the offset of the tim IE in the beacon808* @tim_size: the length of the tim IE (version < 14)809* @btwt_offset: offset to the broadcast TWT IE if present (version >= 14)810* @ecsa_offset: offset to the ECSA IE if present811* @csa_offset: offset to the CSA IE if present812* @frame: the template of the beacon frame813*/814struct iwl_mac_beacon_cmd {815__le16 byte_cnt;816__le16 flags;817__le32 short_ssid;818__le32 reserved;819__le32 link_id;820__le32 tim_idx;821union {822__le32 tim_size;823__le32 btwt_offset;824};825__le32 ecsa_offset;826__le32 csa_offset;827struct ieee80211_hdr frame[];828} __packed; /* BEACON_TEMPLATE_CMD_API_S_VER_10,829* BEACON_TEMPLATE_CMD_API_S_VER_11,830* BEACON_TEMPLATE_CMD_API_S_VER_12,831* BEACON_TEMPLATE_CMD_API_S_VER_13,832* BEACON_TEMPLATE_CMD_API_S_VER_14833*/834835struct iwl_beacon_notif {836struct iwl_tx_resp beacon_notify_hdr;837__le64 tsf;838__le32 ibss_mgr_status;839} __packed;840841/**842* struct iwl_extended_beacon_notif_v5 - notifies about beacon transmission843* @beacon_notify_hdr: tx response command associated with the beacon844* @tsf: last beacon tsf845* @ibss_mgr_status: whether IBSS is manager846* @gp2: last beacon time in gp2847*/848struct iwl_extended_beacon_notif_v5 {849struct iwl_tx_resp beacon_notify_hdr;850__le64 tsf;851__le32 ibss_mgr_status;852__le32 gp2;853} __packed; /* BEACON_NTFY_API_S_VER_5 */854855/**856* struct iwl_extended_beacon_notif - notifies about beacon transmission857* @status: the status of the Tx response of the beacon858* @tsf: last beacon tsf859* @ibss_mgr_status: whether IBSS is manager860* @gp2: last beacon time in gp2861*/862struct iwl_extended_beacon_notif {863__le32 status;864__le64 tsf;865__le32 ibss_mgr_status;866__le32 gp2;867} __packed; /* BEACON_NTFY_API_S_VER_6_ */868869/**870* enum iwl_dump_control - dump (flush) control flags871* @DUMP_TX_FIFO_FLUSH: Dump MSDUs until the FIFO is empty872* and the TFD queues are empty.873*/874enum iwl_dump_control {875DUMP_TX_FIFO_FLUSH = BIT(1),876};877878/**879* struct iwl_tx_path_flush_cmd_v1 -- queue/FIFO flush command880* @queues_ctl: bitmap of queues to flush881* @flush_ctl: control flags882* @reserved: reserved883*/884struct iwl_tx_path_flush_cmd_v1 {885__le32 queues_ctl;886__le16 flush_ctl;887__le16 reserved;888} __packed; /* TX_PATH_FLUSH_CMD_API_S_VER_1 */889890/**891* struct iwl_tx_path_flush_cmd -- queue/FIFO flush command892* @sta_id: station ID to flush893* @tid_mask: TID mask to flush894* @reserved: reserved895*/896struct iwl_tx_path_flush_cmd {897__le32 sta_id;898__le16 tid_mask;899__le16 reserved;900} __packed; /* TX_PATH_FLUSH_CMD_API_S_VER_2 */901902#define IWL_TX_FLUSH_QUEUE_RSP 16903904/**905* struct iwl_flush_queue_info - virtual flush queue info906* @tid: the tid to flush907* @queue_num: virtual queue id908* @read_before_flush: read pointer before flush909* @read_after_flush: read pointer after flush910*/911struct iwl_flush_queue_info {912__le16 tid;913__le16 queue_num;914__le16 read_before_flush;915__le16 read_after_flush;916} __packed; /* TFDQ_FLUSH_INFO_API_S_VER_1 */917918/**919* struct iwl_tx_path_flush_cmd_rsp -- queue/FIFO flush command response920* @sta_id: the station for which the queue was flushed921* @num_flushed_queues: number of queues in queues array922* @queues: all flushed queues923*/924struct iwl_tx_path_flush_cmd_rsp {925__le16 sta_id;926__le16 num_flushed_queues;927struct iwl_flush_queue_info queues[IWL_TX_FLUSH_QUEUE_RSP];928} __packed; /* TX_PATH_FLUSH_CMD_RSP_API_S_VER_1 */929930/* Available options for the SCD_QUEUE_CFG HCMD */931enum iwl_scd_cfg_actions {932SCD_CFG_DISABLE_QUEUE = 0x0,933SCD_CFG_ENABLE_QUEUE = 0x1,934SCD_CFG_UPDATE_QUEUE_TID = 0x2,935};936937/**938* struct iwl_scd_txq_cfg_cmd - New txq hw scheduler config command939* @token: unused940* @sta_id: station id941* @tid: TID942* @scd_queue: scheduler queue to confiug943* @action: 1 queue enable, 0 queue disable, 2 change txq's tid owner944* Value is one of &enum iwl_scd_cfg_actions options945* @aggregate: 1 aggregated queue, 0 otherwise946* @tx_fifo: &enum iwl_mvm_tx_fifo947* @window: BA window size948* @ssn: SSN for the BA agreement949* @reserved: reserved950*/951struct iwl_scd_txq_cfg_cmd {952u8 token;953u8 sta_id;954u8 tid;955u8 scd_queue;956u8 action;957u8 aggregate;958u8 tx_fifo;959u8 window;960__le16 ssn;961__le16 reserved;962} __packed; /* SCD_QUEUE_CFG_CMD_API_S_VER_1 */963964/**965* struct iwl_scd_txq_cfg_rsp966* @token: taken from the command967* @sta_id: station id from the command968* @tid: tid from the command969* @scd_queue: scd_queue from the command970*/971struct iwl_scd_txq_cfg_rsp {972u8 token;973u8 sta_id;974u8 tid;975u8 scd_queue;976} __packed; /* SCD_QUEUE_CFG_RSP_API_S_VER_1 */977978#endif /* __iwl_fw_api_tx_h__ */979980981