/* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef _TX_FLUSH_REQ_H_ #define _TX_FLUSH_REQ_H_ #if !defined(__ASSEMBLER__) #endif #define NUM_OF_DWORDS_TX_FLUSH_REQ 2 #define NUM_OF_QWORDS_TX_FLUSH_REQ 1 struct tx_flush_req { #ifndef WIFI_BIT_ORDER_BIG_ENDIAN uint32_t flush_req_reason : 8, // [7:0] phytx_abort_reason : 8, // [15:8] flush_req_user_number_or_link_id : 6, // [21:16] mlo_abort_reason : 5, // [26:22] reserved_0a : 5; // [31:27] uint32_t tlv64_padding : 32; // [31:0] #else uint32_t reserved_0a : 5, // [31:27] mlo_abort_reason : 5, // [26:22] flush_req_user_number_or_link_id : 6, // [21:16] phytx_abort_reason : 8, // [15:8] flush_req_reason : 8; // [7:0] uint32_t tlv64_padding : 32; // [31:0] #endif }; /* Description FLUSH_REQ_REASON The reason why the flush request was generated. This is included for clean implementation and verification. This code should NOT be used during a valid FLUSH. It is used as a keeper value when flush logic is idle Flush request issued by TXPCU in case of a WCOEX abort. This is a corner case scenario. A situation where: a.A RX is just over and CCA indication is IDLE b.Crypt is still busy decrypting c.A TX just starts. The TX should be tried later. This situation may be rare. Just taking an extra precaution. This is the static BW failure happening right after start_tx for either RTS frame or data packet This is the static BW failure in the protection sequence (CTS). This is PDG signaling not enough TXOP for transmission When SW issues a flush WHICH CAUSES AN ONGOING FES to terminate Not enough TXOP remaining in either SW or HW mode. This checks if the remaining TXOP < a parameterized minimum time. Currently half SIFS duration (5 us). HWSCH flush when Parser engine encounters a header with all zeros in the DWORD Issued in case TLV transmission exceeds start_tx time SW mode abort. When HWSCH determines that none of the SW programmed (upto 3) BW times can fit into the current TXOP remaining Flush request issued by TXPCU in case none of the PPDU_ALLOW_BW_* fields are set in PCU_PPDU_SETUP TLV Flush request issued by TXPCU if RXPCU initiates a response generation for a MU reception even though MU reception was not expected Flush request issued by HWSCH when a coex event caused this transmit to be aborted Flush request issued by HWSCH when the PHY does not return the SVD_READY before a timeout expires Flush request issued by TXPCU when the number of MPDU counter for selected BW is zero Flush request issued by TXPCU if TXPCU receives TX_PKT_END with error_unsupported_cbf during CV transfer. Indicates TXPCU has not received PCU_PPDU_SETUP_INIT from PDG, by the time it received PRE_START_TX from HWSCH. Indicates TXPCU has not received PCU_PPDU_SETUP_START from PDG, by the time it received START_TX from HWSCH. Indicates TXPCU has not received TX_PHY_DESCRIPTOR within REQD_TLVS_WAIT_TIME after receiving START_TX from HWSCH. TXPCU did nor receive the CBF info TLVs from the PHY fast enough which resulted in a timeout. Indicates the total number of MPDUs that needs to be send out by TXDMA is less than the number indicated by PDG/TXPCU in the MPDU_LIMIT_STATUS Fragmentation is enabled in TX_FES_SETUP for an AMSDU or AMPDU more_frag bit in TX_FES_SETUP TLV is set for the last MPDU fragment Indicates TXPCU has detected a mismatch between BWs detected at PRE_START_TX and START_TX flush request and is asserted by TXPCU when the final negotiated BW from COEX is not allowed by SW flush request and is asserted by TXPCU when the final negotiated BW from COEX is not allowed by SW Fragmentation is enabled in raw mode buffer chaining mode. A1 and A2 set to MAC addresses for 11ah PV1 short frame which is an AMSDU An unsupported key_type is set for a PV1 frames. WEP, TKIP and WAPI are not supported for PV1 frames Unexpected Tx Mpdu length. Asserted if the MSDU PACKET TLV length is less than the expected WMAC header Asserted by PDG when COEX related logic in PDG requires a flush request. Full MSDU packet was not provided by TXDMA when checksum/TSO/fragmentation was enabled The length field in the incoming 802.3 ethernet frame doesn't match with the actual number of bytes in the data TLV. Non-QoS frames are queued as part of AMSDU Key type in peer table set to NO_CIPHER for protected frames This flush is initiated by scheduler when (if enabled) CCA goes busy in the middle of a PIFS burst This flush is initiated by TXPCU when a protection frame is send, but TXPCU has not received address fields in time. PDG generated this flush request because not one MPDU length info has been received at the required timeout (which is programmable) PDG generated this flush request because PHY issued an unexpected preamble request type The most desired BW was not available, and TXPCU would like to try the most optimal transmit BW again after a new BO period. LLC received incomplete frame PDG received a CTS frame that reduced the BW, As a result the MPDU does not fit in the previous reserved time, the thus this transmission is aborted PDG received a CTS frame that a reduced duration field. As a result the MPDU does not fit in the previous reserved time, the thus this transmission is aborted Note the duration field in CTS can be reduced as a result of COEX reasons HWSCH flush when Parser engine encounters a header whose length is greater than 511 dwords. This excludes DUMMY TLVs. HWSCH flush when Parser engine encounters a header whose TAG does not match the XML specified length. This check excludes zero length and variable length TLVs HWSCH flush when Parser engine encounters a non contiguous error check code, while reading SFM. This check is primarily to catch data write or read issues within the buffering process of scheduler TLV in SFM When HWSCH attempts to transmit a packet based on OBSS_PD non-SRG opportunity, a flush with this code is generated if "ReceivedRssi from RXPCU > Scheduler_cmd.RssiAltNonSrg". When HWSCH attempts to transmit a packet based on OBSS_PD non-SRG opportunity, a flush with this code is generated if "ReceivedRssi from RXPCU > Scheduler_cmd.RssiAltSrg". When HWSCH attempts to transmit a packet within an SRP opportunity window, a flush with this code is generated if "Scheduler_cmd.SrpAltPwr > SRP_less_RSSI". parse errors HWSCH flush when Parser engine encounters a header whose TAG is not listed in the XML TAG table An abort from PHY TX got received A soft from coex got received before even a single MPDU got transmitted. Therefor transmission is terminated. PDG was asked to start an MU transmission, but the number of users with actual data was less then the threshold (Min_users_with_data_count) PDG was asked to start an SU transmission, but the number of bytes that PDG has been informed about that can be transmitted is less then the required threshold (min_ppdu_bytes) PDG was asked to start an SU transmission, but the number of MPDUs that PDG has been informed about that can be transmitted is less then the required threshold (min_mpdus_in_ppdu) PDG uses this code when the min PPDU time to pad up to (pad_min_ppdu_time) can not be met due to other boundary conditions (e.g. FES time/TXOP time/TBTT) Flush request initiated by the ucode (M3) TXPCU uses this code on encountering an error condition (e.g. late MACTX_PHY_DESC or CV error) while generating a response. This flush code is used by HWSCH to indicate that during SIFS bursting, an SVD_READY timeout was detected, which resulted in the SIFS burst to be aborted. TXPCU has not been properly initialized when the first data request from the PHY has been seen. TXPCU found that the medium was not idle for the Carries Sense check that PDG indicated was needed for the triggered response frame. PDG found out that when trying to assign the RUs among the available users, the number of unused RUs remained above the allowed threshold This happens when Crypto receives TLVs for more TX users than it can support at that point of time This happens when Crypto receives unsupported Key types (WEP, TKIP) for MU CBF response generation by TXPCU ran into issues due to info not being available from the PHY TXPCU received a PHY NAP TLV from rxpcu while a transmission was ongoing. The transmission will be terminated with this abort reason. RXPCU found out that the trigger frame that was received and for which the TX path has been activated to generate a response, had an FCS error. Asserted by PDG when COEX indicated to PDG that the transmit request is NOT granted because a higher priority BT activity is ongoing. TXPCU detected a conflict between an FES transmission and a self-gen response transmission. This is when the PHY + RXPCU delays cause a self-gen to overlap with the pre-backoff time from HWSCH for the next FES. PDG received a MU-RTS trigger for which the CTS RU response setting is not valid PDG received a trigger based transmission request for an RU size that is blocked by SW. Asserted when PDG gets a TX_FES_SETUP with field "Fes_in_11ax_Trigger_response_config" not being in sync with what it was expecting. PDG received OFDMA_TRIGGER_DETAILS and the configuration in there (which RXPCU gets from the trigger frame has invalid field value combinations This flush request will be asserted if the length of a checksum enabled MSDU is more than 2400 bytes. This flush request will be asserted if mesh_enable is set for an MSDU subframe while its not set for another MSDU subframe in the same AMSDU This flush request will be asserted if mesh_enable is set for an ethernet frame Asserted when TXPCU gets a TX_FES_SETUP with field "ofdma_triggered_response" not being in sync with what it was expecting. PDG received an 11ax transmit set of parameters that is not allowed or not supported TXPCU generates this flush request because trigger response transmission setup info from the SCH was received too late When HWSCH attempts to transmit a packet having obss_pd disabled within an obss_pd opportunity window this flush code is generated When HWSCH attempts to transmit a packet having SRP disabled within an obss_pd opportunity window this flush code is generated In SRP SR, PDG will generate flush if receiving PDG_TX_REQ in a blocking window around SRP SR limit PDG generates when no data can be sent for the users specified by TX_FES_SETUP field "RBO_must_have_data_user_limit." Used by PDG for an MU-MIMO sounding plus steering burst when it did not receive CBF from any recipient STA PDG generates when encountering a 'HARD_NOTIFY' or a 'SEMI_HARD_NOTIFY' frame unless ignore_tx_notify_setting is set in 'PDG_FES_SETUP' PDG was asked to start a transmission, but the time required to transmit the PPDU is less than the required threshold (flush_min_ppdu_time) Used by TXPCU when Tx is complete and it is about to generate 'EXPECTED_RESPONSE' but it has not got any 'RXPCU_SETUP_COMPLETE' although 'rxpcu_setup_complete_present' was set in 'TX_FES_SETUP' Used by TXPCU when the 'RECEIVED_TRIGER_INFO' TLV is sent to SCH after the 'pre_phy_desc' timer has expired, if enabled Used by PDG when the first 'MPDU_INFO' is not available when sending 'PCU_PPDU_SETUP_START' so PDG has assumed a regular MPDU ('FW_tx_notify_frame = NO_TX_NOTIFY'), but later the MPDU turned out to be a notify frame, if enabled TXDMA generates this flush request when it gets 'MPDU_INFO's for a user that it is unable to write into SFM since its SFM allocation is full. Used in TXPCU for generating a flush request when 'PRE_PHY_DESC' is received late (determined by a timer) This flush request code is used by PDG if the trigger response MPDUs cannot be fit to avoid sending only null delimiters for e.g. unassociated UORA and colliding with another STA with valid data. Flush request used by PDG in case of unexpected 'TX_FES_SETUP' Flush request used by PDG in case of MLO constraints forcing an abort Flush request used by HWSCH if an MLO backoff truncation request resulted in a forced abort to avoid windows too close to transmissions Flush request used by TXOLE if fragmentation is requested but the settings are illegal Flush request used by TXPCU when required overwrite TLVs are not received from microcode, or when overwrite TLVs are dropped in MAC due to SFM full condition Flush request by TXPCU if PHY does not respond to 'MACRX_LMR_READ_REQUEST' or 'MACRX_LMR_DATA_REQUEST' on time Flush request by TXPCU if PHY sent 'PHYRX_LMR_TRANSFER_ABORT' or 'PHYRX_LMR_READ_REQUEST_ACK' with status anything other than OK Flush request by TXPCU on getting a mismatched TLV from RXPCU for 'RX_FRAME_*BITMAP_ACK' (1Kbit instead of 256-bit or vice versa) Flush request by TXPCU on getting an 'RX_RESPONSE_REQUIRED_INFO' with A-MPDU set, VHT Ack clear and 'response_ba*_cnt' zero, to avoid a system hang Flush request by TXPCU on not getting a 'MACTX_CBF_DONE' from RXPCU after sending 'RESPONSE_END_STATUS' TLV Flush request by TXPCU if SFM indicates 'user_fifo_full' PDG was asked to start an MU transmission, but one of the users' RU is such that within the PPDU time the PSDU length that can be fit is too low (based on a threshold in a PDG register) PDG was asked to start an OBSS PD SR transmission, but the time required to transmit the PPDU is less than the required threshold (flush_min_ppdu_time_obss_pd_sr) PDG was asked to start an OBSS PD SR transmission, but the time required for the FES is more than the OBSS PPDU duration (max_fes_time_obss_pd_sr) PDG timed out waiting for CV correlation TLVs from microcode Flush request from PDG if CV correlation is enabled and the 'PHYTX_CV_CORR_STATUS' from microcode indicates that the primary user's CBF has failed HWSCH-issued flush when the SFM availability check fails during a SIFS burst or when fetching part 2 TLVs PDG uses this code when the response time to pad up to (required_response_time) cannot be met due to the frame length in 'PDG_RESPONSE' exceeding the calculated padded length Flush request to terminate an FES when RXPCU aborted an UL MU reception early because at the end of the "early_termination_window," the required number of users with at least one valid MPDU delimiter was not reached. This is unsupported in Beryllium. Placeholder for future needs TXPCU uses this code when more than the configured maximum CTS2SELF are being sent. TXPCU uses this code when at the time of the main PPDU transmission, fewer than the configured minimum CTS2SELF were sent. Placeholder for future needs Placeholder for future needs Placeholder for future needs Placeholder for future needs Placeholder for future needs Placeholder for future needs Placeholder for future needs Placeholder for future needs Placeholder for future needs Placeholder for future needs Placeholder for future needs Used by SCH when it receives an undefined flush request reason code */ #define TX_FLUSH_REQ_FLUSH_REQ_REASON_OFFSET 0x0000000000000000 #define TX_FLUSH_REQ_FLUSH_REQ_REASON_LSB 0 #define TX_FLUSH_REQ_FLUSH_REQ_REASON_MSB 7 #define TX_FLUSH_REQ_FLUSH_REQ_REASON_MASK 0x00000000000000ff /* Description PHYTX_ABORT_REASON Field only valid when Flush_req_reason == TXPCU_PHYTX_ABORT_ERR This value is the default value the MAC will fill in the status TLV (when not PHY abort was received). Note that when PHY generates the PHYTX_ABORT_REQUEST, this value shall never be used. PHY ran out of transmit data due to transmit underrun - this field is user-specific (see user_number field) This used to be called 'error_illegal_nss.' This error indicates that CV prefetch command indicated a CV index that is not available. This error indicates that CV delete command indicated a CV index that did not contain any valid info Error found with the HE transmission parameters All FIFO read hang errors use this value. All FIFO no read errors use this value. This is the merged Rx/Tx CDC FIFO empty/full error code All 'error_txtd_chn' codes use this value as well. This code is used to abort the Tx when MAC Rx issues an abort request with code 05 "macrx_abort_too_much_bad_data." */ #define TX_FLUSH_REQ_PHYTX_ABORT_REASON_OFFSET 0x0000000000000000 #define TX_FLUSH_REQ_PHYTX_ABORT_REASON_LSB 8 #define TX_FLUSH_REQ_PHYTX_ABORT_REASON_MSB 15 #define TX_FLUSH_REQ_PHYTX_ABORT_REASON_MASK 0x000000000000ff00 /* Description FLUSH_REQ_USER_NUMBER_OR_LINK_ID Field only valid when Flush_req_reason == TXPCU_PHYTX_ABORT_ERR or PDG_FLREQ_CODE_{TXOP, MLO}_ABORT In case of TXPCU_PHYTX_ABORT_ERR, for some errors, the user for which this error was detected can be indicated in this field. In case of PDG_FLREQ_CODE_*_ABORT due to MLO, this field will carry the partner link ID and validity due to which the abort was initiated. Bit [5]: partner link ID valid Bits [4:3]: set to 0 Bits [2:0]: partner link ID */ #define TX_FLUSH_REQ_FLUSH_REQ_USER_NUMBER_OR_LINK_ID_OFFSET 0x0000000000000000 #define TX_FLUSH_REQ_FLUSH_REQ_USER_NUMBER_OR_LINK_ID_LSB 16 #define TX_FLUSH_REQ_FLUSH_REQ_USER_NUMBER_OR_LINK_ID_MSB 21 #define TX_FLUSH_REQ_FLUSH_REQ_USER_NUMBER_OR_LINK_ID_MASK 0x00000000003f0000 /* Description MLO_ABORT_REASON Field valid only when Flush_req_reason == PDG_FLREQ_CODE_{TXOP, MLO}_ABORT SW-specified block of the peer for self-link SW-specified block of the peer from a partner link Blocked due to RX ongoing in partner link MLO truncated CTS2SELF leading to abort Maximum padding exceeded Maximum overlap duration exceeded User collision threshold for MU exceeded SW-specified block due to VDEV ID collision with a non-MLO broadcast/multicast Blocked due to EMLSR black-out window T2 response changed in 'MLO_TX_RESP' PPDU duration zero in 'MLO_TX_RESP' PPDU duration bigger than allowed in non-response mode 'MLO_TX_RESP' PPDU in non-A-MPDU format cannot be padded PPDU duration truncated in response mode 'MLO_TX_RESP' flush generated due to TXOP abort flush generated due to TXOP abort as MPDU count is zero for all users in 'MPDU_QUEUE_OVERVIEW' flush generated due to MLO abort as 'MPDU_QUEUE_OVERVIEW' is not ready for all users at PPDU phase Trigger frame end-alignment cannot be met, e.g. due to LDPC extra symbol */ #define TX_FLUSH_REQ_MLO_ABORT_REASON_OFFSET 0x0000000000000000 #define TX_FLUSH_REQ_MLO_ABORT_REASON_LSB 22 #define TX_FLUSH_REQ_MLO_ABORT_REASON_MSB 26 #define TX_FLUSH_REQ_MLO_ABORT_REASON_MASK 0x0000000007c00000 /* Description RESERVED_0A */ #define TX_FLUSH_REQ_RESERVED_0A_OFFSET 0x0000000000000000 #define TX_FLUSH_REQ_RESERVED_0A_LSB 27 #define TX_FLUSH_REQ_RESERVED_0A_MSB 31 #define TX_FLUSH_REQ_RESERVED_0A_MASK 0x00000000f8000000 /* Description TLV64_PADDING Automatic DWORD padding inserted while converting TLV32 to TLV64 for 64 bit ARCH */ #define TX_FLUSH_REQ_TLV64_PADDING_OFFSET 0x0000000000000000 #define TX_FLUSH_REQ_TLV64_PADDING_LSB 32 #define TX_FLUSH_REQ_TLV64_PADDING_MSB 63 #define TX_FLUSH_REQ_TLV64_PADDING_MASK 0xffffffff00000000 #endif // TX_FLUSH_REQ