Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
0002 /*
0003  * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
0004  */
0005 #ifndef ATH11K_RX_DESC_H
0006 #define ATH11K_RX_DESC_H
0007 
0008 enum rx_desc_rxpcu_filter {
0009     RX_DESC_RXPCU_FILTER_PASS,
0010     RX_DESC_RXPCU_FILTER_MONITOR_CLIENT,
0011     RX_DESC_RXPCU_FILTER_MONITOR_OTHER,
0012 };
0013 
0014 /* rxpcu_filter_pass
0015  *      This MPDU passed the normal frame filter programming of rxpcu.
0016  *
0017  * rxpcu_filter_monitor_client
0018  *       This MPDU did not pass the regular frame filter and would
0019  *       have been dropped, were it not for the frame fitting into the
0020  *       'monitor_client' category.
0021  *
0022  * rxpcu_filter_monitor_other
0023  *      This MPDU did not pass the regular frame filter and also did
0024  *      not pass the rxpcu_monitor_client filter. It would have been
0025  *      dropped accept that it did pass the 'monitor_other' category.
0026  */
0027 
0028 #define RX_DESC_INFO0_RXPCU_MPDU_FITLER GENMASK(1, 0)
0029 #define RX_DESC_INFO0_SW_FRAME_GRP_ID   GENMASK(8, 2)
0030 
0031 enum rx_desc_sw_frame_grp_id {
0032     RX_DESC_SW_FRAME_GRP_ID_NDP_FRAME,
0033     RX_DESC_SW_FRAME_GRP_ID_MCAST_DATA,
0034     RX_DESC_SW_FRAME_GRP_ID_UCAST_DATA,
0035     RX_DESC_SW_FRAME_GRP_ID_NULL_DATA,
0036     RX_DESC_SW_FRAME_GRP_ID_MGMT_0000,
0037     RX_DESC_SW_FRAME_GRP_ID_MGMT_0001,
0038     RX_DESC_SW_FRAME_GRP_ID_MGMT_0010,
0039     RX_DESC_SW_FRAME_GRP_ID_MGMT_0011,
0040     RX_DESC_SW_FRAME_GRP_ID_MGMT_0100,
0041     RX_DESC_SW_FRAME_GRP_ID_MGMT_0101,
0042     RX_DESC_SW_FRAME_GRP_ID_MGMT_0110,
0043     RX_DESC_SW_FRAME_GRP_ID_MGMT_0111,
0044     RX_DESC_SW_FRAME_GRP_ID_MGMT_1000,
0045     RX_DESC_SW_FRAME_GRP_ID_MGMT_1001,
0046     RX_DESC_SW_FRAME_GRP_ID_MGMT_1010,
0047     RX_DESC_SW_FRAME_GRP_ID_MGMT_1011,
0048     RX_DESC_SW_FRAME_GRP_ID_MGMT_1100,
0049     RX_DESC_SW_FRAME_GRP_ID_MGMT_1101,
0050     RX_DESC_SW_FRAME_GRP_ID_MGMT_1110,
0051     RX_DESC_SW_FRAME_GRP_ID_MGMT_1111,
0052     RX_DESC_SW_FRAME_GRP_ID_CTRL_0000,
0053     RX_DESC_SW_FRAME_GRP_ID_CTRL_0001,
0054     RX_DESC_SW_FRAME_GRP_ID_CTRL_0010,
0055     RX_DESC_SW_FRAME_GRP_ID_CTRL_0011,
0056     RX_DESC_SW_FRAME_GRP_ID_CTRL_0100,
0057     RX_DESC_SW_FRAME_GRP_ID_CTRL_0101,
0058     RX_DESC_SW_FRAME_GRP_ID_CTRL_0110,
0059     RX_DESC_SW_FRAME_GRP_ID_CTRL_0111,
0060     RX_DESC_SW_FRAME_GRP_ID_CTRL_1000,
0061     RX_DESC_SW_FRAME_GRP_ID_CTRL_1001,
0062     RX_DESC_SW_FRAME_GRP_ID_CTRL_1010,
0063     RX_DESC_SW_FRAME_GRP_ID_CTRL_1011,
0064     RX_DESC_SW_FRAME_GRP_ID_CTRL_1100,
0065     RX_DESC_SW_FRAME_GRP_ID_CTRL_1101,
0066     RX_DESC_SW_FRAME_GRP_ID_CTRL_1110,
0067     RX_DESC_SW_FRAME_GRP_ID_CTRL_1111,
0068     RX_DESC_SW_FRAME_GRP_ID_UNSUPPORTED,
0069     RX_DESC_SW_FRAME_GRP_ID_PHY_ERR,
0070 };
0071 
0072 enum rx_desc_decap_type {
0073     RX_DESC_DECAP_TYPE_RAW,
0074     RX_DESC_DECAP_TYPE_NATIVE_WIFI,
0075     RX_DESC_DECAP_TYPE_ETHERNET2_DIX,
0076     RX_DESC_DECAP_TYPE_8023,
0077 };
0078 
0079 enum rx_desc_decrypt_status_code {
0080     RX_DESC_DECRYPT_STATUS_CODE_OK,
0081     RX_DESC_DECRYPT_STATUS_CODE_UNPROTECTED_FRAME,
0082     RX_DESC_DECRYPT_STATUS_CODE_DATA_ERR,
0083     RX_DESC_DECRYPT_STATUS_CODE_KEY_INVALID,
0084     RX_DESC_DECRYPT_STATUS_CODE_PEER_ENTRY_INVALID,
0085     RX_DESC_DECRYPT_STATUS_CODE_OTHER,
0086 };
0087 
0088 #define RX_ATTENTION_INFO1_FIRST_MPDU       BIT(0)
0089 #define RX_ATTENTION_INFO1_RSVD_1A      BIT(1)
0090 #define RX_ATTENTION_INFO1_MCAST_BCAST      BIT(2)
0091 #define RX_ATTENTION_INFO1_AST_IDX_NOT_FOUND    BIT(3)
0092 #define RX_ATTENTION_INFO1_AST_IDX_TIMEDOUT BIT(4)
0093 #define RX_ATTENTION_INFO1_POWER_MGMT       BIT(5)
0094 #define RX_ATTENTION_INFO1_NON_QOS      BIT(6)
0095 #define RX_ATTENTION_INFO1_NULL_DATA        BIT(7)
0096 #define RX_ATTENTION_INFO1_MGMT_TYPE        BIT(8)
0097 #define RX_ATTENTION_INFO1_CTRL_TYPE        BIT(9)
0098 #define RX_ATTENTION_INFO1_MORE_DATA        BIT(10)
0099 #define RX_ATTENTION_INFO1_EOSP         BIT(11)
0100 #define RX_ATTENTION_INFO1_A_MSDU_ERROR     BIT(12)
0101 #define RX_ATTENTION_INFO1_FRAGMENT     BIT(13)
0102 #define RX_ATTENTION_INFO1_ORDER        BIT(14)
0103 #define RX_ATTENTION_INFO1_CCE_MATCH        BIT(15)
0104 #define RX_ATTENTION_INFO1_OVERFLOW_ERR     BIT(16)
0105 #define RX_ATTENTION_INFO1_MSDU_LEN_ERR     BIT(17)
0106 #define RX_ATTENTION_INFO1_TCP_UDP_CKSUM_FAIL   BIT(18)
0107 #define RX_ATTENTION_INFO1_IP_CKSUM_FAIL    BIT(19)
0108 #define RX_ATTENTION_INFO1_SA_IDX_INVALID   BIT(20)
0109 #define RX_ATTENTION_INFO1_DA_IDX_INVALID   BIT(21)
0110 #define RX_ATTENTION_INFO1_RSVD_1B      BIT(22)
0111 #define RX_ATTENTION_INFO1_RX_IN_TX_DECRYPT_BYP BIT(23)
0112 #define RX_ATTENTION_INFO1_ENCRYPT_REQUIRED BIT(24)
0113 #define RX_ATTENTION_INFO1_DIRECTED     BIT(25)
0114 #define RX_ATTENTION_INFO1_BUFFER_FRAGMENT  BIT(26)
0115 #define RX_ATTENTION_INFO1_MPDU_LEN_ERR     BIT(27)
0116 #define RX_ATTENTION_INFO1_TKIP_MIC_ERR     BIT(28)
0117 #define RX_ATTENTION_INFO1_DECRYPT_ERR      BIT(29)
0118 #define RX_ATTENTION_INFO1_UNDECRYPT_FRAME_ERR  BIT(30)
0119 #define RX_ATTENTION_INFO1_FCS_ERR      BIT(31)
0120 
0121 #define RX_ATTENTION_INFO2_FLOW_IDX_TIMEOUT BIT(0)
0122 #define RX_ATTENTION_INFO2_FLOW_IDX_INVALID BIT(1)
0123 #define RX_ATTENTION_INFO2_WIFI_PARSER_ERR  BIT(2)
0124 #define RX_ATTENTION_INFO2_AMSDU_PARSER_ERR BIT(3)
0125 #define RX_ATTENTION_INFO2_SA_IDX_TIMEOUT   BIT(4)
0126 #define RX_ATTENTION_INFO2_DA_IDX_TIMEOUT   BIT(5)
0127 #define RX_ATTENTION_INFO2_MSDU_LIMIT_ERR   BIT(6)
0128 #define RX_ATTENTION_INFO2_DA_IS_VALID      BIT(7)
0129 #define RX_ATTENTION_INFO2_DA_IS_MCBC       BIT(8)
0130 #define RX_ATTENTION_INFO2_SA_IS_VALID      BIT(9)
0131 #define RX_ATTENTION_INFO2_DCRYPT_STATUS_CODE   GENMASK(12, 10)
0132 #define RX_ATTENTION_INFO2_RX_BITMAP_NOT_UPDED  BIT(13)
0133 #define RX_ATTENTION_INFO2_MSDU_DONE        BIT(31)
0134 
0135 struct rx_attention {
0136     __le16 info0;
0137     __le16 phy_ppdu_id;
0138     __le32 info1;
0139     __le32 info2;
0140 } __packed;
0141 
0142 /* rx_attention
0143  *
0144  * rxpcu_mpdu_filter_in_category
0145  *      Field indicates what the reason was that this mpdu frame
0146  *      was allowed to come into the receive path by rxpcu. Values
0147  *      are defined in enum %RX_DESC_RXPCU_FILTER_*.
0148  *
0149  * sw_frame_group_id
0150  *      SW processes frames based on certain classifications. Values
0151  *      are defined in enum %RX_DESC_SW_FRAME_GRP_ID_*.
0152  *
0153  * phy_ppdu_id
0154  *      A ppdu counter value that PHY increments for every PPDU
0155  *      received. The counter value wraps around.
0156  *
0157  * first_mpdu
0158  *      Indicates the first MSDU of the PPDU.  If both first_mpdu
0159  *      and last_mpdu are set in the MSDU then this is a not an
0160  *      A-MPDU frame but a stand alone MPDU.  Interior MPDU in an
0161  *      A-MPDU shall have both first_mpdu and last_mpdu bits set to
0162  *      0.  The PPDU start status will only be valid when this bit
0163  *      is set.
0164  *
0165  * mcast_bcast
0166  *      Multicast / broadcast indicator.  Only set when the MAC
0167  *      address 1 bit 0 is set indicating mcast/bcast and the BSSID
0168  *      matches one of the 4 BSSID registers. Only set when
0169  *      first_msdu is set.
0170  *
0171  * ast_index_not_found
0172  *      Only valid when first_msdu is set. Indicates no AST matching
0173  *      entries within the max search count.
0174  *
0175  * ast_index_timeout
0176  *      Only valid when first_msdu is set. Indicates an unsuccessful
0177  *      search in the address search table due to timeout.
0178  *
0179  * power_mgmt
0180  *      Power management bit set in the 802.11 header.  Only set
0181  *      when first_msdu is set.
0182  *
0183  * non_qos
0184  *      Set if packet is not a non-QoS data frame.  Only set when
0185  *      first_msdu is set.
0186  *
0187  * null_data
0188  *      Set if frame type indicates either null data or QoS null
0189  *      data format.  Only set when first_msdu is set.
0190  *
0191  * mgmt_type
0192  *      Set if packet is a management packet.  Only set when
0193  *      first_msdu is set.
0194  *
0195  * ctrl_type
0196  *      Set if packet is a control packet.  Only set when first_msdu
0197  *      is set.
0198  *
0199  * more_data
0200  *      Set if more bit in frame control is set.  Only set when
0201  *      first_msdu is set.
0202  *
0203  * eosp
0204  *      Set if the EOSP (end of service period) bit in the QoS
0205  *      control field is set.  Only set when first_msdu is set.
0206  *
0207  * a_msdu_error
0208  *      Set if number of MSDUs in A-MSDU is above a threshold or if the
0209  *      size of the MSDU is invalid. This receive buffer will contain
0210  *      all of the remainder of MSDUs in this MPDU w/o decapsulation.
0211  *
0212  * fragment
0213  *      Indicates that this is an 802.11 fragment frame.  This is
0214  *      set when either the more_frag bit is set in the frame
0215  *      control or the fragment number is not zero.  Only set when
0216  *      first_msdu is set.
0217  *
0218  * order
0219  *      Set if the order bit in the frame control is set.  Only set
0220  *      when first_msdu is set.
0221  *
0222  * cce_match
0223  *      Indicates that this status has a corresponding MSDU that
0224  *      requires FW processing. The OLE will have classification
0225  *      ring mask registers which will indicate the ring(s) for
0226  *      packets and descriptors which need FW attention.
0227  *
0228  * overflow_err
0229  *      PCU Receive FIFO does not have enough space to store the
0230  *      full receive packet.  Enough space is reserved in the
0231  *      receive FIFO for the status is written.  This MPDU remaining
0232  *      packets in the PPDU will be filtered and no Ack response
0233  *      will be transmitted.
0234  *
0235  * msdu_length_err
0236  *      Indicates that the MSDU length from the 802.3 encapsulated
0237  *      length field extends beyond the MPDU boundary.
0238  *
0239  * tcp_udp_chksum_fail
0240  *      Indicates that the computed checksum (tcp_udp_chksum) did
0241  *      not match the checksum in the TCP/UDP header.
0242  *
0243  * ip_chksum_fail
0244  *      Indicates that the computed checksum did not match the
0245  *      checksum in the IP header.
0246  *
0247  * sa_idx_invalid
0248  *      Indicates no matching entry was found in the address search
0249  *      table for the source MAC address.
0250  *
0251  * da_idx_invalid
0252  *      Indicates no matching entry was found in the address search
0253  *      table for the destination MAC address.
0254  *
0255  * rx_in_tx_decrypt_byp
0256  *      Indicates that RX packet is not decrypted as Crypto is busy
0257  *      with TX packet processing.
0258  *
0259  * encrypt_required
0260  *      Indicates that this data type frame is not encrypted even if
0261  *      the policy for this MPDU requires encryption as indicated in
0262  *      the peer table key type.
0263  *
0264  * directed
0265  *      MPDU is a directed packet which means that the RA matched
0266  *      our STA addresses.  In proxySTA it means that the TA matched
0267  *      an entry in our address search table with the corresponding
0268  *      'no_ack' bit is the address search entry cleared.
0269  *
0270  * buffer_fragment
0271  *      Indicates that at least one of the rx buffers has been
0272  *      fragmented.  If set the FW should look at the rx_frag_info
0273  *      descriptor described below.
0274  *
0275  * mpdu_length_err
0276  *      Indicates that the MPDU was pre-maturely terminated
0277  *      resulting in a truncated MPDU.  Don't trust the MPDU length
0278  *      field.
0279  *
0280  * tkip_mic_err
0281  *      Indicates that the MPDU Michael integrity check failed
0282  *
0283  * decrypt_err
0284  *      Indicates that the MPDU decrypt integrity check failed
0285  *
0286  * fcs_err
0287  *      Indicates that the MPDU FCS check failed
0288  *
0289  * flow_idx_timeout
0290  *      Indicates an unsuccessful flow search due to the expiring of
0291  *      the search timer.
0292  *
0293  * flow_idx_invalid
0294  *      flow id is not valid.
0295  *
0296  * amsdu_parser_error
0297  *      A-MSDU could not be properly de-agregated.
0298  *
0299  * sa_idx_timeout
0300  *      Indicates an unsuccessful search for the source MAC address
0301  *      due to the expiring of the search timer.
0302  *
0303  * da_idx_timeout
0304  *      Indicates an unsuccessful search for the destination MAC
0305  *      address due to the expiring of the search timer.
0306  *
0307  * msdu_limit_error
0308  *      Indicates that the MSDU threshold was exceeded and thus
0309  *      all the rest of the MSDUs will not be scattered and will not
0310  *      be decasulated but will be DMA'ed in RAW format as a single
0311  *      MSDU buffer.
0312  *
0313  * da_is_valid
0314  *      Indicates that OLE found a valid DA entry.
0315  *
0316  * da_is_mcbc
0317  *      Field Only valid if da_is_valid is set. Indicates the DA address
0318  *      was a Multicast or Broadcast address.
0319  *
0320  * sa_is_valid
0321  *      Indicates that OLE found a valid SA entry.
0322  *
0323  * decrypt_status_code
0324  *      Field provides insight into the decryption performed. Values are
0325  *      defined in enum %RX_DESC_DECRYPT_STATUS_CODE*.
0326  *
0327  * rx_bitmap_not_updated
0328  *      Frame is received, but RXPCU could not update the receive bitmap
0329  *      due to (temporary) fifo constraints.
0330  *
0331  * msdu_done
0332  *      If set indicates that the RX packet data, RX header data, RX
0333  *      PPDU start descriptor, RX MPDU start/end descriptor, RX MSDU
0334  *      start/end descriptors and RX Attention descriptor are all
0335  *      valid.  This bit must be in the last octet of the
0336  *      descriptor.
0337  */
0338 
0339 #define RX_MPDU_START_INFO0_NDP_FRAME       BIT(9)
0340 #define RX_MPDU_START_INFO0_PHY_ERR     BIT(10)
0341 #define RX_MPDU_START_INFO0_PHY_ERR_MPDU_HDR    BIT(11)
0342 #define RX_MPDU_START_INFO0_PROTO_VER_ERR   BIT(12)
0343 #define RX_MPDU_START_INFO0_AST_LOOKUP_VALID    BIT(13)
0344 
0345 #define RX_MPDU_START_INFO1_MPDU_FCTRL_VALID    BIT(0)
0346 #define RX_MPDU_START_INFO1_MPDU_DUR_VALID  BIT(1)
0347 #define RX_MPDU_START_INFO1_MAC_ADDR1_VALID BIT(2)
0348 #define RX_MPDU_START_INFO1_MAC_ADDR2_VALID BIT(3)
0349 #define RX_MPDU_START_INFO1_MAC_ADDR3_VALID BIT(4)
0350 #define RX_MPDU_START_INFO1_MAC_ADDR4_VALID BIT(5)
0351 #define RX_MPDU_START_INFO1_MPDU_SEQ_CTRL_VALID BIT(6)
0352 #define RX_MPDU_START_INFO1_MPDU_QOS_CTRL_VALID BIT(7)
0353 #define RX_MPDU_START_INFO1_MPDU_HT_CTRL_VALID  BIT(8)
0354 #define RX_MPDU_START_INFO1_ENCRYPT_INFO_VALID  BIT(9)
0355 #define RX_MPDU_START_INFO1_MPDU_FRAG_NUMBER    GENMASK(13, 10)
0356 #define RX_MPDU_START_INFO1_MORE_FRAG_FLAG  BIT(14)
0357 #define RX_MPDU_START_INFO1_FROM_DS     BIT(16)
0358 #define RX_MPDU_START_INFO1_TO_DS       BIT(17)
0359 #define RX_MPDU_START_INFO1_ENCRYPTED       BIT(18)
0360 #define RX_MPDU_START_INFO1_MPDU_RETRY      BIT(19)
0361 #define RX_MPDU_START_INFO1_MPDU_SEQ_NUM    GENMASK(31, 20)
0362 
0363 #define RX_MPDU_START_INFO2_EPD_EN      BIT(0)
0364 #define RX_MPDU_START_INFO2_ALL_FRAME_ENCPD BIT(1)
0365 #define RX_MPDU_START_INFO2_ENC_TYPE        GENMASK(5, 2)
0366 #define RX_MPDU_START_INFO2_VAR_WEP_KEY_WIDTH   GENMASK(7, 6)
0367 #define RX_MPDU_START_INFO2_MESH_STA        BIT(8)
0368 #define RX_MPDU_START_INFO2_BSSID_HIT       BIT(9)
0369 #define RX_MPDU_START_INFO2_BSSID_NUM       GENMASK(13, 10)
0370 #define RX_MPDU_START_INFO2_TID         GENMASK(17, 14)
0371 #define RX_MPDU_START_INFO2_TID_WCN6855     GENMASK(18, 15)
0372 
0373 #define RX_MPDU_START_INFO3_REO_DEST_IND        GENMASK(4, 0)
0374 #define RX_MPDU_START_INFO3_FLOW_ID_TOEPLITZ        BIT(7)
0375 #define RX_MPDU_START_INFO3_PKT_SEL_FP_UCAST_DATA   BIT(8)
0376 #define RX_MPDU_START_INFO3_PKT_SEL_FP_MCAST_DATA   BIT(9)
0377 #define RX_MPDU_START_INFO3_PKT_SEL_FP_CTRL_BAR     BIT(10)
0378 #define RX_MPDU_START_INFO3_RXDMA0_SRC_RING_SEL     GENMASK(12, 11)
0379 #define RX_MPDU_START_INFO3_RXDMA0_DST_RING_SEL     GENMASK(14, 13)
0380 
0381 #define RX_MPDU_START_INFO4_REO_QUEUE_DESC_HI   GENMASK(7, 0)
0382 #define RX_MPDU_START_INFO4_RECV_QUEUE_NUM  GENMASK(23, 8)
0383 #define RX_MPDU_START_INFO4_PRE_DELIM_ERR_WARN  BIT(24)
0384 #define RX_MPDU_START_INFO4_FIRST_DELIM_ERR BIT(25)
0385 
0386 #define RX_MPDU_START_INFO5_KEY_ID      GENMASK(7, 0)
0387 #define RX_MPDU_START_INFO5_NEW_PEER_ENTRY  BIT(8)
0388 #define RX_MPDU_START_INFO5_DECRYPT_NEEDED  BIT(9)
0389 #define RX_MPDU_START_INFO5_DECAP_TYPE      GENMASK(11, 10)
0390 #define RX_MPDU_START_INFO5_VLAN_TAG_C_PADDING  BIT(12)
0391 #define RX_MPDU_START_INFO5_VLAN_TAG_S_PADDING  BIT(13)
0392 #define RX_MPDU_START_INFO5_STRIP_VLAN_TAG_C    BIT(14)
0393 #define RX_MPDU_START_INFO5_STRIP_VLAN_TAG_S    BIT(15)
0394 #define RX_MPDU_START_INFO5_PRE_DELIM_COUNT GENMASK(27, 16)
0395 #define RX_MPDU_START_INFO5_AMPDU_FLAG      BIT(28)
0396 #define RX_MPDU_START_INFO5_BAR_FRAME       BIT(29)
0397 
0398 #define RX_MPDU_START_INFO6_MPDU_LEN        GENMASK(13, 0)
0399 #define RX_MPDU_START_INFO6_FIRST_MPDU      BIT(14)
0400 #define RX_MPDU_START_INFO6_MCAST_BCAST     BIT(15)
0401 #define RX_MPDU_START_INFO6_AST_IDX_NOT_FOUND   BIT(16)
0402 #define RX_MPDU_START_INFO6_AST_IDX_TIMEOUT BIT(17)
0403 #define RX_MPDU_START_INFO6_POWER_MGMT      BIT(18)
0404 #define RX_MPDU_START_INFO6_NON_QOS     BIT(19)
0405 #define RX_MPDU_START_INFO6_NULL_DATA       BIT(20)
0406 #define RX_MPDU_START_INFO6_MGMT_TYPE       BIT(21)
0407 #define RX_MPDU_START_INFO6_CTRL_TYPE       BIT(22)
0408 #define RX_MPDU_START_INFO6_MORE_DATA       BIT(23)
0409 #define RX_MPDU_START_INFO6_EOSP        BIT(24)
0410 #define RX_MPDU_START_INFO6_FRAGMENT        BIT(25)
0411 #define RX_MPDU_START_INFO6_ORDER       BIT(26)
0412 #define RX_MPDU_START_INFO6_UAPSD_TRIGGER   BIT(27)
0413 #define RX_MPDU_START_INFO6_ENCRYPT_REQUIRED    BIT(28)
0414 #define RX_MPDU_START_INFO6_DIRECTED        BIT(29)
0415 
0416 #define RX_MPDU_START_RAW_MPDU          BIT(0)
0417 
0418 struct rx_mpdu_start_ipq8074 {
0419     __le16 info0;
0420     __le16 phy_ppdu_id;
0421     __le16 ast_index;
0422     __le16 sw_peer_id;
0423     __le32 info1;
0424     __le32 info2;
0425     __le32 pn[4];
0426     __le32 peer_meta_data;
0427     __le32 info3;
0428     __le32 reo_queue_desc_lo;
0429     __le32 info4;
0430     __le32 info5;
0431     __le32 info6;
0432     __le16 frame_ctrl;
0433     __le16 duration;
0434     u8 addr1[ETH_ALEN];
0435     u8 addr2[ETH_ALEN];
0436     u8 addr3[ETH_ALEN];
0437     __le16 seq_ctrl;
0438     u8 addr4[ETH_ALEN];
0439     __le16 qos_ctrl;
0440     __le32 ht_ctrl;
0441     __le32 raw;
0442 } __packed;
0443 
0444 #define RX_MPDU_START_INFO7_REO_DEST_IND        GENMASK(4, 0)
0445 #define RX_MPDU_START_INFO7_LMAC_PEER_ID_MSB        GENMASK(6, 5)
0446 #define RX_MPDU_START_INFO7_FLOW_ID_TOEPLITZ        BIT(7)
0447 #define RX_MPDU_START_INFO7_PKT_SEL_FP_UCAST_DATA   BIT(8)
0448 #define RX_MPDU_START_INFO7_PKT_SEL_FP_MCAST_DATA   BIT(9)
0449 #define RX_MPDU_START_INFO7_PKT_SEL_FP_CTRL_BAR     BIT(10)
0450 #define RX_MPDU_START_INFO7_RXDMA0_SRC_RING_SEL     GENMASK(12, 11)
0451 #define RX_MPDU_START_INFO7_RXDMA0_DST_RING_SEL     GENMASK(14, 13)
0452 
0453 #define RX_MPDU_START_INFO8_REO_QUEUE_DESC_HI       GENMASK(7, 0)
0454 #define RX_MPDU_START_INFO8_RECV_QUEUE_NUM      GENMASK(23, 8)
0455 #define RX_MPDU_START_INFO8_PRE_DELIM_ERR_WARN      BIT(24)
0456 #define RX_MPDU_START_INFO8_FIRST_DELIM_ERR     BIT(25)
0457 
0458 #define RX_MPDU_START_INFO9_EPD_EN          BIT(0)
0459 #define RX_MPDU_START_INFO9_ALL_FRAME_ENCPD     BIT(1)
0460 #define RX_MPDU_START_INFO9_ENC_TYPE            GENMASK(5, 2)
0461 #define RX_MPDU_START_INFO9_VAR_WEP_KEY_WIDTH       GENMASK(7, 6)
0462 #define RX_MPDU_START_INFO9_MESH_STA            GENMASK(9, 8)
0463 #define RX_MPDU_START_INFO9_BSSID_HIT           BIT(10)
0464 #define RX_MPDU_START_INFO9_BSSID_NUM           GENMASK(14, 11)
0465 #define RX_MPDU_START_INFO9_TID             GENMASK(18, 15)
0466 
0467 #define RX_MPDU_START_INFO10_RXPCU_MPDU_FLTR        GENMASK(1, 0)
0468 #define RX_MPDU_START_INFO10_SW_FRAME_GRP_ID        GENMASK(8, 2)
0469 #define RX_MPDU_START_INFO10_NDP_FRAME          BIT(9)
0470 #define RX_MPDU_START_INFO10_PHY_ERR            BIT(10)
0471 #define RX_MPDU_START_INFO10_PHY_ERR_MPDU_HDR       BIT(11)
0472 #define RX_MPDU_START_INFO10_PROTO_VER_ERR      BIT(12)
0473 #define RX_MPDU_START_INFO10_AST_LOOKUP_VALID       BIT(13)
0474 
0475 #define RX_MPDU_START_INFO11_MPDU_FCTRL_VALID       BIT(0)
0476 #define RX_MPDU_START_INFO11_MPDU_DUR_VALID     BIT(1)
0477 #define RX_MPDU_START_INFO11_MAC_ADDR1_VALID        BIT(2)
0478 #define RX_MPDU_START_INFO11_MAC_ADDR2_VALID        BIT(3)
0479 #define RX_MPDU_START_INFO11_MAC_ADDR3_VALID        BIT(4)
0480 #define RX_MPDU_START_INFO11_MAC_ADDR4_VALID        BIT(5)
0481 #define RX_MPDU_START_INFO11_MPDU_SEQ_CTRL_VALID    BIT(6)
0482 #define RX_MPDU_START_INFO11_MPDU_QOS_CTRL_VALID    BIT(7)
0483 #define RX_MPDU_START_INFO11_MPDU_HT_CTRL_VALID     BIT(8)
0484 #define RX_MPDU_START_INFO11_ENCRYPT_INFO_VALID     BIT(9)
0485 #define RX_MPDU_START_INFO11_MPDU_FRAG_NUMBER       GENMASK(13, 10)
0486 #define RX_MPDU_START_INFO11_MORE_FRAG_FLAG     BIT(14)
0487 #define RX_MPDU_START_INFO11_FROM_DS            BIT(16)
0488 #define RX_MPDU_START_INFO11_TO_DS          BIT(17)
0489 #define RX_MPDU_START_INFO11_ENCRYPTED          BIT(18)
0490 #define RX_MPDU_START_INFO11_MPDU_RETRY         BIT(19)
0491 #define RX_MPDU_START_INFO11_MPDU_SEQ_NUM       GENMASK(31, 20)
0492 
0493 #define RX_MPDU_START_INFO12_KEY_ID         GENMASK(7, 0)
0494 #define RX_MPDU_START_INFO12_NEW_PEER_ENTRY     BIT(8)
0495 #define RX_MPDU_START_INFO12_DECRYPT_NEEDED     BIT(9)
0496 #define RX_MPDU_START_INFO12_DECAP_TYPE         GENMASK(11, 10)
0497 #define RX_MPDU_START_INFO12_VLAN_TAG_C_PADDING     BIT(12)
0498 #define RX_MPDU_START_INFO12_VLAN_TAG_S_PADDING     BIT(13)
0499 #define RX_MPDU_START_INFO12_STRIP_VLAN_TAG_C       BIT(14)
0500 #define RX_MPDU_START_INFO12_STRIP_VLAN_TAG_S       BIT(15)
0501 #define RX_MPDU_START_INFO12_PRE_DELIM_COUNT        GENMASK(27, 16)
0502 #define RX_MPDU_START_INFO12_AMPDU_FLAG         BIT(28)
0503 #define RX_MPDU_START_INFO12_BAR_FRAME          BIT(29)
0504 #define RX_MPDU_START_INFO12_RAW_MPDU           BIT(30)
0505 
0506 #define RX_MPDU_START_INFO13_MPDU_LEN           GENMASK(13, 0)
0507 #define RX_MPDU_START_INFO13_FIRST_MPDU         BIT(14)
0508 #define RX_MPDU_START_INFO13_MCAST_BCAST        BIT(15)
0509 #define RX_MPDU_START_INFO13_AST_IDX_NOT_FOUND      BIT(16)
0510 #define RX_MPDU_START_INFO13_AST_IDX_TIMEOUT        BIT(17)
0511 #define RX_MPDU_START_INFO13_POWER_MGMT         BIT(18)
0512 #define RX_MPDU_START_INFO13_NON_QOS            BIT(19)
0513 #define RX_MPDU_START_INFO13_NULL_DATA          BIT(20)
0514 #define RX_MPDU_START_INFO13_MGMT_TYPE          BIT(21)
0515 #define RX_MPDU_START_INFO13_CTRL_TYPE          BIT(22)
0516 #define RX_MPDU_START_INFO13_MORE_DATA          BIT(23)
0517 #define RX_MPDU_START_INFO13_EOSP           BIT(24)
0518 #define RX_MPDU_START_INFO13_FRAGMENT           BIT(25)
0519 #define RX_MPDU_START_INFO13_ORDER          BIT(26)
0520 #define RX_MPDU_START_INFO13_UAPSD_TRIGGER      BIT(27)
0521 #define RX_MPDU_START_INFO13_ENCRYPT_REQUIRED       BIT(28)
0522 #define RX_MPDU_START_INFO13_DIRECTED           BIT(29)
0523 #define RX_MPDU_START_INFO13_AMSDU_PRESENT      BIT(30)
0524 
0525 struct rx_mpdu_start_qcn9074 {
0526     __le32 info7;
0527     __le32 reo_queue_desc_lo;
0528     __le32 info8;
0529     __le32 pn[4];
0530     __le32 info9;
0531     __le32 peer_meta_data;
0532     __le16 info10;
0533     __le16 phy_ppdu_id;
0534     __le16 ast_index;
0535     __le16 sw_peer_id;
0536     __le32 info11;
0537     __le32 info12;
0538     __le32 info13;
0539     __le16 frame_ctrl;
0540     __le16 duration;
0541     u8 addr1[ETH_ALEN];
0542     u8 addr2[ETH_ALEN];
0543     u8 addr3[ETH_ALEN];
0544     __le16 seq_ctrl;
0545     u8 addr4[ETH_ALEN];
0546     __le16 qos_ctrl;
0547     __le32 ht_ctrl;
0548 } __packed;
0549 
0550 struct rx_mpdu_start_wcn6855 {
0551     __le32 info3;
0552     __le32 reo_queue_desc_lo;
0553     __le32 info4;
0554     __le32 pn[4];
0555     __le32 info2;
0556     __le32 peer_meta_data;
0557     __le16 info0;
0558     __le16 phy_ppdu_id;
0559     __le16 ast_index;
0560     __le16 sw_peer_id;
0561     __le32 info1;
0562     __le32 info5;
0563     __le32 info6;
0564     __le16 frame_ctrl;
0565     __le16 duration;
0566     u8 addr1[ETH_ALEN];
0567     u8 addr2[ETH_ALEN];
0568     u8 addr3[ETH_ALEN];
0569     __le16 seq_ctrl;
0570     u8 addr4[ETH_ALEN];
0571     __le16 qos_ctrl;
0572     __le32 ht_ctrl;
0573 } __packed;
0574 
0575 /* rx_mpdu_start
0576  *
0577  * rxpcu_mpdu_filter_in_category
0578  *      Field indicates what the reason was that this mpdu frame
0579  *      was allowed to come into the receive path by rxpcu. Values
0580  *      are defined in enum %RX_DESC_RXPCU_FILTER_*.
0581  *      Note: for ndp frame, if it was expected because the preceding
0582  *      NDPA was filter_pass, the setting rxpcu_filter_pass will be
0583  *      used. This setting will also be used for every ndp frame in
0584  *      case Promiscuous mode is enabled.
0585  *
0586  * sw_frame_group_id
0587  *      SW processes frames based on certain classifications. Values
0588  *      are defined in enum %RX_DESC_SW_FRAME_GRP_ID_*.
0589  *
0590  * ndp_frame
0591  *      Indicates that the received frame was an NDP frame.
0592  *
0593  * phy_err
0594  *      Indicates that PHY error was received before MAC received data.
0595  *
0596  * phy_err_during_mpdu_header
0597  *      PHY error was received before MAC received the complete MPDU
0598  *      header which was needed for proper decoding.
0599  *
0600  * protocol_version_err
0601  *      RXPCU detected a version error in the frame control field.
0602  *
0603  * ast_based_lookup_valid
0604  *      AST based lookup for this frame has found a valid result.
0605  *
0606  * phy_ppdu_id
0607  *      A ppdu counter value that PHY increments for every PPDU
0608  *      received. The counter value wraps around.
0609  *
0610  * ast_index
0611  *      This field indicates the index of the AST entry corresponding
0612  *      to this MPDU. It is provided by the GSE module instantiated in
0613  *      RXPCU. A value of 0xFFFF indicates an invalid AST index.
0614  *
0615  * sw_peer_id
0616  *      This field indicates a unique peer identifier. It is set equal
0617  *      to field 'sw_peer_id' from the AST entry.
0618  *
0619  * mpdu_frame_control_valid, mpdu_duration_valid, mpdu_qos_control_valid,
0620  * mpdu_ht_control_valid, frame_encryption_info_valid
0621  *      Indicates that each fields have valid entries.
0622  *
0623  * mac_addr_adx_valid
0624  *      Corresponding mac_addr_adx_{lo/hi} has valid entries.
0625  *
0626  * from_ds, to_ds
0627  *      Valid only when mpdu_frame_control_valid is set. Indicates that
0628  *      frame is received from DS and sent to DS.
0629  *
0630  * encrypted
0631  *      Protected bit from the frame control.
0632  *
0633  * mpdu_retry
0634  *      Retry bit from frame control. Only valid when first_msdu is set.
0635  *
0636  * mpdu_sequence_number
0637  *      The sequence number from the 802.11 header.
0638  *
0639  * epd_en
0640  *      If set, use EPD instead of LPD.
0641  *
0642  * all_frames_shall_be_encrypted
0643  *      If set, all frames (data only?) shall be encrypted. If not,
0644  *      RX CRYPTO shall set an error flag.
0645  *
0646  * encrypt_type
0647  *      Values are defined in enum %HAL_ENCRYPT_TYPE_.
0648  *
0649  * mesh_sta
0650  *      Indicates a Mesh (11s) STA.
0651  *
0652  * bssid_hit
0653  *       BSSID of the incoming frame matched one of the 8 BSSID
0654  *       register values.
0655  *
0656  * bssid_number
0657  *      This number indicates which one out of the 8 BSSID register
0658  *      values matched the incoming frame.
0659  *
0660  * tid
0661  *      TID field in the QoS control field
0662  *
0663  * pn
0664  *      The PN number.
0665  *
0666  * peer_meta_data
0667  *      Meta data that SW has programmed in the Peer table entry
0668  *      of the transmitting STA.
0669  *
0670  * rx_reo_queue_desc_addr_lo
0671  *      Address (lower 32 bits) of the REO queue descriptor.
0672  *
0673  * rx_reo_queue_desc_addr_hi
0674  *      Address (upper 8 bits) of the REO queue descriptor.
0675  *
0676  * receive_queue_number
0677  *      Indicates the MPDU queue ID to which this MPDU link
0678  *      descriptor belongs.
0679  *
0680  * pre_delim_err_warning
0681  *      Indicates that a delimiter FCS error was found in between the
0682  *      previous MPDU and this MPDU. Note that this is just a warning,
0683  *      and does not mean that this MPDU is corrupted in any way. If
0684  *      it is, there will be other errors indicated such as FCS or
0685  *      decrypt errors.
0686  *
0687  * first_delim_err
0688  *      Indicates that the first delimiter had a FCS failure.
0689  *
0690  * key_id
0691  *      The key ID octet from the IV.
0692  *
0693  * new_peer_entry
0694  *      Set if new RX_PEER_ENTRY TLV follows. If clear, RX_PEER_ENTRY
0695  *      doesn't follow so RX DECRYPTION module either uses old peer
0696  *      entry or not decrypt.
0697  *
0698  * decrypt_needed
0699  *      When RXPCU sets bit 'ast_index_not_found or ast_index_timeout',
0700  *      RXPCU will also ensure that this bit is NOT set. CRYPTO for that
0701  *      reason only needs to evaluate this bit and non of the other ones
0702  *
0703  * decap_type
0704  *      Used by the OLE during decapsulation. Values are defined in
0705  *      enum %MPDU_START_DECAP_TYPE_*.
0706  *
0707  * rx_insert_vlan_c_tag_padding
0708  * rx_insert_vlan_s_tag_padding
0709  *      Insert 4 byte of all zeros as VLAN tag or double VLAN tag if
0710  *      the rx payload does not have VLAN.
0711  *
0712  * strip_vlan_c_tag_decap
0713  * strip_vlan_s_tag_decap
0714  *      Strip VLAN or double VLAN during decapsulation.
0715  *
0716  * pre_delim_count
0717  *      The number of delimiters before this MPDU. Note that this
0718  *      number is cleared at PPDU start. If this MPDU is the first
0719  *      received MPDU in the PPDU and this MPDU gets filtered-in,
0720  *      this field will indicate the number of delimiters located
0721  *      after the last MPDU in the previous PPDU.
0722  *
0723  *      If this MPDU is located after the first received MPDU in
0724  *      an PPDU, this field will indicate the number of delimiters
0725  *      located between the previous MPDU and this MPDU.
0726  *
0727  * ampdu_flag
0728  *      Received frame was part of an A-MPDU.
0729  *
0730  * bar_frame
0731  *      Received frame is a BAR frame
0732  *
0733  * mpdu_length
0734  *      MPDU length before decapsulation.
0735  *
0736  * first_mpdu..directed
0737  *      See definition in RX attention descriptor
0738  *
0739  */
0740 
0741 enum rx_msdu_start_pkt_type {
0742     RX_MSDU_START_PKT_TYPE_11A,
0743     RX_MSDU_START_PKT_TYPE_11B,
0744     RX_MSDU_START_PKT_TYPE_11N,
0745     RX_MSDU_START_PKT_TYPE_11AC,
0746     RX_MSDU_START_PKT_TYPE_11AX,
0747 };
0748 
0749 enum rx_msdu_start_sgi {
0750     RX_MSDU_START_SGI_0_8_US,
0751     RX_MSDU_START_SGI_0_4_US,
0752     RX_MSDU_START_SGI_1_6_US,
0753     RX_MSDU_START_SGI_3_2_US,
0754 };
0755 
0756 enum rx_msdu_start_recv_bw {
0757     RX_MSDU_START_RECV_BW_20MHZ,
0758     RX_MSDU_START_RECV_BW_40MHZ,
0759     RX_MSDU_START_RECV_BW_80MHZ,
0760     RX_MSDU_START_RECV_BW_160MHZ,
0761 };
0762 
0763 enum rx_msdu_start_reception_type {
0764     RX_MSDU_START_RECEPTION_TYPE_SU,
0765     RX_MSDU_START_RECEPTION_TYPE_DL_MU_MIMO,
0766     RX_MSDU_START_RECEPTION_TYPE_DL_MU_OFDMA,
0767     RX_MSDU_START_RECEPTION_TYPE_DL_MU_OFDMA_MIMO,
0768     RX_MSDU_START_RECEPTION_TYPE_UL_MU_MIMO,
0769     RX_MSDU_START_RECEPTION_TYPE_UL_MU_OFDMA,
0770     RX_MSDU_START_RECEPTION_TYPE_UL_MU_OFDMA_MIMO,
0771 };
0772 
0773 #define RX_MSDU_START_INFO1_MSDU_LENGTH     GENMASK(13, 0)
0774 #define RX_MSDU_START_INFO1_RSVD_1A     BIT(14)
0775 #define RX_MSDU_START_INFO1_IPSEC_ESP       BIT(15)
0776 #define RX_MSDU_START_INFO1_L3_OFFSET       GENMASK(22, 16)
0777 #define RX_MSDU_START_INFO1_IPSEC_AH        BIT(23)
0778 #define RX_MSDU_START_INFO1_L4_OFFSET       GENMASK(31, 24)
0779 
0780 #define RX_MSDU_START_INFO2_MSDU_NUMBER     GENMASK(7, 0)
0781 #define RX_MSDU_START_INFO2_DECAP_TYPE      GENMASK(9, 8)
0782 #define RX_MSDU_START_INFO2_IPV4        BIT(10)
0783 #define RX_MSDU_START_INFO2_IPV6        BIT(11)
0784 #define RX_MSDU_START_INFO2_TCP         BIT(12)
0785 #define RX_MSDU_START_INFO2_UDP         BIT(13)
0786 #define RX_MSDU_START_INFO2_IP_FRAG     BIT(14)
0787 #define RX_MSDU_START_INFO2_TCP_ONLY_ACK    BIT(15)
0788 #define RX_MSDU_START_INFO2_DA_IS_BCAST_MCAST   BIT(16)
0789 #define RX_MSDU_START_INFO2_SELECTED_TOEPLITZ_HASH  GENMASK(18, 17)
0790 #define RX_MSDU_START_INFO2_IP_FIXED_HDR_VALID      BIT(19)
0791 #define RX_MSDU_START_INFO2_IP_EXTN_HDR_VALID       BIT(20)
0792 #define RX_MSDU_START_INFO2_IP_TCP_UDP_HDR_VALID    BIT(21)
0793 #define RX_MSDU_START_INFO2_MESH_CTRL_PRESENT       BIT(22)
0794 #define RX_MSDU_START_INFO2_LDPC            BIT(23)
0795 #define RX_MSDU_START_INFO2_IP4_IP6_NXT_HDR     GENMASK(31, 24)
0796 #define RX_MSDU_START_INFO2_DECAP_FORMAT        GENMASK(9, 8)
0797 
0798 #define RX_MSDU_START_INFO3_USER_RSSI       GENMASK(7, 0)
0799 #define RX_MSDU_START_INFO3_PKT_TYPE        GENMASK(11, 8)
0800 #define RX_MSDU_START_INFO3_STBC        BIT(12)
0801 #define RX_MSDU_START_INFO3_SGI         GENMASK(14, 13)
0802 #define RX_MSDU_START_INFO3_RATE_MCS        GENMASK(18, 15)
0803 #define RX_MSDU_START_INFO3_RECV_BW     GENMASK(20, 19)
0804 #define RX_MSDU_START_INFO3_RECEPTION_TYPE  GENMASK(23, 21)
0805 #define RX_MSDU_START_INFO3_MIMO_SS_BITMAP  GENMASK(31, 24)
0806 
0807 struct rx_msdu_start_ipq8074 {
0808     __le16 info0;
0809     __le16 phy_ppdu_id;
0810     __le32 info1;
0811     __le32 info2;
0812     __le32 toeplitz_hash;
0813     __le32 flow_id_toeplitz;
0814     __le32 info3;
0815     __le32 ppdu_start_timestamp;
0816     __le32 phy_meta_data;
0817 } __packed;
0818 
0819 struct rx_msdu_start_qcn9074 {
0820     __le16 info0;
0821     __le16 phy_ppdu_id;
0822     __le32 info1;
0823     __le32 info2;
0824     __le32 toeplitz_hash;
0825     __le32 flow_id_toeplitz;
0826     __le32 info3;
0827     __le32 ppdu_start_timestamp;
0828     __le32 phy_meta_data;
0829     __le16 vlan_ctag_c1;
0830     __le16 vlan_stag_c1;
0831 } __packed;
0832 
0833 struct rx_msdu_start_wcn6855 {
0834     __le16 info0;
0835     __le16 phy_ppdu_id;
0836     __le32 info1;
0837     __le32 info2;
0838     __le32 toeplitz_hash;
0839     __le32 flow_id_toeplitz;
0840     __le32 info3;
0841     __le32 ppdu_start_timestamp;
0842     __le32 phy_meta_data;
0843     __le16 vlan_ctag_ci;
0844     __le16 vlan_stag_ci;
0845 } __packed;
0846 
0847 /* rx_msdu_start
0848  *
0849  * rxpcu_mpdu_filter_in_category
0850  *      Field indicates what the reason was that this mpdu frame
0851  *      was allowed to come into the receive path by rxpcu. Values
0852  *      are defined in enum %RX_DESC_RXPCU_FILTER_*.
0853  *
0854  * sw_frame_group_id
0855  *      SW processes frames based on certain classifications. Values
0856  *      are defined in enum %RX_DESC_SW_FRAME_GRP_ID_*.
0857  *
0858  * phy_ppdu_id
0859  *      A ppdu counter value that PHY increments for every PPDU
0860  *      received. The counter value wraps around.
0861  *
0862  * msdu_length
0863  *      MSDU length in bytes after decapsulation.
0864  *
0865  * ipsec_esp
0866  *      Set if IPv4/v6 packet is using IPsec ESP.
0867  *
0868  * l3_offset
0869  *      Depending upon mode bit, this field either indicates the
0870  *      L3 offset in bytes from the start of the RX_HEADER or the IP
0871  *      offset in bytes from the start of the packet after
0872  *      decapsulation. The latter is only valid if ipv4_proto or
0873  *      ipv6_proto is set.
0874  *
0875  * ipsec_ah
0876  *      Set if IPv4/v6 packet is using IPsec AH
0877  *
0878  * l4_offset
0879  *      Depending upon mode bit, this field either indicates the
0880  *      L4 offset nin bytes from the start of RX_HEADER (only valid
0881  *      if either ipv4_proto or ipv6_proto is set to 1) or indicates
0882  *      the offset in bytes to the start of TCP or UDP header from
0883  *      the start of the IP header after decapsulation (Only valid if
0884  *      tcp_proto or udp_proto is set). The value 0 indicates that
0885  *      the offset is longer than 127 bytes.
0886  *
0887  * msdu_number
0888  *      Indicates the MSDU number within a MPDU.  This value is
0889  *      reset to zero at the start of each MPDU.  If the number of
0890  *      MSDU exceeds 255 this number will wrap using modulo 256.
0891  *
0892  * decap_type
0893  *      Indicates the format after decapsulation. Values are defined in
0894  *      enum %MPDU_START_DECAP_TYPE_*.
0895  *
0896  * ipv4_proto
0897  *      Set if L2 layer indicates IPv4 protocol.
0898  *
0899  * ipv6_proto
0900  *      Set if L2 layer indicates IPv6 protocol.
0901  *
0902  * tcp_proto
0903  *      Set if the ipv4_proto or ipv6_proto are set and the IP protocol
0904  *      indicates TCP.
0905  *
0906  * udp_proto
0907  *      Set if the ipv4_proto or ipv6_proto are set and the IP protocol
0908  *      indicates UDP.
0909  *
0910  * ip_frag
0911  *      Indicates that either the IP More frag bit is set or IP frag
0912  *      number is non-zero.  If set indicates that this is a fragmented
0913  *      IP packet.
0914  *
0915  * tcp_only_ack
0916  *      Set if only the TCP Ack bit is set in the TCP flags and if
0917  *      the TCP payload is 0.
0918  *
0919  * da_is_bcast_mcast
0920  *      The destination address is broadcast or multicast.
0921  *
0922  * toeplitz_hash
0923  *      Actual chosen Hash.
0924  *      0 - Toeplitz hash of 2-tuple (IP source address, IP
0925  *          destination address)
0926  *      1 - Toeplitz hash of 4-tuple (IP source address,
0927  *          IP destination address, L4 (TCP/UDP) source port,
0928  *          L4 (TCP/UDP) destination port)
0929  *      2 - Toeplitz of flow_id
0930  *      3 - Zero is used
0931  *
0932  * ip_fixed_header_valid
0933  *      Fixed 20-byte IPv4 header or 40-byte IPv6 header parsed
0934  *      fully within first 256 bytes of the packet
0935  *
0936  * ip_extn_header_valid
0937  *      IPv6/IPv6 header, including IPv4 options and
0938  *      recognizable extension headers parsed fully within first 256
0939  *      bytes of the packet
0940  *
0941  * tcp_udp_header_valid
0942  *      Fixed 20-byte TCP (excluding TCP options) or 8-byte UDP
0943  *      header parsed fully within first 256 bytes of the packet
0944  *
0945  * mesh_control_present
0946  *      When set, this MSDU includes the 'Mesh Control' field
0947  *
0948  * ldpc
0949  *
0950  * ip4_protocol_ip6_next_header
0951  *      For IPv4, this is the 8 bit protocol field set). For IPv6 this
0952  *      is the 8 bit next_header field.
0953  *
0954  * toeplitz_hash_2_or_4
0955  *      Controlled by RxOLE register - If register bit set to 0,
0956  *      Toeplitz hash is computed over 2-tuple IPv4 or IPv6 src/dest
0957  *      addresses; otherwise, toeplitz hash is computed over 4-tuple
0958  *      IPv4 or IPv6 src/dest addresses and src/dest ports.
0959  *
0960  * flow_id_toeplitz
0961  *      Toeplitz hash of 5-tuple
0962  *      {IP source address, IP destination address, IP source port, IP
0963  *      destination port, L4 protocol}  in case of non-IPSec.
0964  *
0965  *      In case of IPSec - Toeplitz hash of 4-tuple
0966  *      {IP source address, IP destination address, SPI, L4 protocol}
0967  *
0968  *      The relevant Toeplitz key registers are provided in RxOLE's
0969  *      instance of common parser module. These registers are separate
0970  *      from the Toeplitz keys used by ASE/FSE modules inside RxOLE.
0971  *      The actual value will be passed on from common parser module
0972  *      to RxOLE in one of the WHO_* TLVs.
0973  *
0974  * user_rssi
0975  *      RSSI for this user
0976  *
0977  * pkt_type
0978  *      Values are defined in enum %RX_MSDU_START_PKT_TYPE_*.
0979  *
0980  * stbc
0981  *      When set, use STBC transmission rates.
0982  *
0983  * sgi
0984  *      Field only valid when pkt type is HT, VHT or HE. Values are
0985  *      defined in enum %RX_MSDU_START_SGI_*.
0986  *
0987  * rate_mcs
0988  *      MCS Rate used.
0989  *
0990  * receive_bandwidth
0991  *      Full receive Bandwidth. Values are defined in enum
0992  *      %RX_MSDU_START_RECV_*.
0993  *
0994  * reception_type
0995  *      Indicates what type of reception this is and defined in enum
0996  *      %RX_MSDU_START_RECEPTION_TYPE_*.
0997  *
0998  * mimo_ss_bitmap
0999  *      Field only valid when
1000  *      Reception_type is RX_MSDU_START_RECEPTION_TYPE_DL_MU_MIMO or
1001  *      RX_MSDU_START_RECEPTION_TYPE_DL_MU_OFDMA_MIMO.
1002  *
1003  *      Bitmap, with each bit indicating if the related spatial
1004  *      stream is used for this STA
1005  *
1006  *      LSB related to SS 0
1007  *
1008  *      0 - spatial stream not used for this reception
1009  *      1 - spatial stream used for this reception
1010  *
1011  * ppdu_start_timestamp
1012  *      Timestamp that indicates when the PPDU that contained this MPDU
1013  *      started on the medium.
1014  *
1015  * phy_meta_data
1016  *      SW programmed Meta data provided by the PHY. Can be used for SW
1017  *      to indicate the channel the device is on.
1018  */
1019 
1020 #define RX_MSDU_END_INFO0_RXPCU_MPDU_FITLER GENMASK(1, 0)
1021 #define RX_MSDU_END_INFO0_SW_FRAME_GRP_ID   GENMASK(8, 2)
1022 
1023 #define RX_MSDU_END_INFO1_KEY_ID        GENMASK(7, 0)
1024 #define RX_MSDU_END_INFO1_CCE_SUPER_RULE    GENMASK(13, 8)
1025 #define RX_MSDU_END_INFO1_CCND_TRUNCATE     BIT(14)
1026 #define RX_MSDU_END_INFO1_CCND_CCE_DIS      BIT(15)
1027 #define RX_MSDU_END_INFO1_EXT_WAPI_PN       GENMASK(31, 16)
1028 
1029 #define RX_MSDU_END_INFO2_REPORTED_MPDU_LEN GENMASK(13, 0)
1030 #define RX_MSDU_END_INFO2_FIRST_MSDU        BIT(14)
1031 #define RX_MSDU_END_INFO2_FIRST_MSDU_WCN6855    BIT(28)
1032 #define RX_MSDU_END_INFO2_LAST_MSDU     BIT(15)
1033 #define RX_MSDU_END_INFO2_LAST_MSDU_WCN6855 BIT(29)
1034 #define RX_MSDU_END_INFO2_SA_IDX_TIMEOUT    BIT(16)
1035 #define RX_MSDU_END_INFO2_DA_IDX_TIMEOUT    BIT(17)
1036 #define RX_MSDU_END_INFO2_MSDU_LIMIT_ERR    BIT(18)
1037 #define RX_MSDU_END_INFO2_FLOW_IDX_TIMEOUT  BIT(19)
1038 #define RX_MSDU_END_INFO2_FLOW_IDX_INVALID  BIT(20)
1039 #define RX_MSDU_END_INFO2_WIFI_PARSER_ERR   BIT(21)
1040 #define RX_MSDU_END_INFO2_AMSDU_PARSET_ERR  BIT(22)
1041 #define RX_MSDU_END_INFO2_SA_IS_VALID       BIT(23)
1042 #define RX_MSDU_END_INFO2_DA_IS_VALID       BIT(24)
1043 #define RX_MSDU_END_INFO2_DA_IS_MCBC        BIT(25)
1044 #define RX_MSDU_END_INFO2_L3_HDR_PADDING    GENMASK(27, 26)
1045 
1046 #define RX_MSDU_END_INFO3_TCP_FLAG      GENMASK(8, 0)
1047 #define RX_MSDU_END_INFO3_LRO_ELIGIBLE      BIT(9)
1048 
1049 #define RX_MSDU_END_INFO4_DA_OFFSET     GENMASK(5, 0)
1050 #define RX_MSDU_END_INFO4_SA_OFFSET     GENMASK(11, 6)
1051 #define RX_MSDU_END_INFO4_DA_OFFSET_VALID   BIT(12)
1052 #define RX_MSDU_END_INFO4_SA_OFFSET_VALID   BIT(13)
1053 #define RX_MSDU_END_INFO4_L3_TYPE       GENMASK(31, 16)
1054 
1055 #define RX_MSDU_END_INFO5_MSDU_DROP     BIT(0)
1056 #define RX_MSDU_END_INFO5_REO_DEST_IND      GENMASK(5, 1)
1057 #define RX_MSDU_END_INFO5_FLOW_IDX      GENMASK(25, 6)
1058 
1059 struct rx_msdu_end_ipq8074 {
1060     __le16 info0;
1061     __le16 phy_ppdu_id;
1062     __le16 ip_hdr_cksum;
1063     __le16 tcp_udp_cksum;
1064     __le32 info1;
1065     __le32 ext_wapi_pn[2];
1066     __le32 info2;
1067     __le32 ipv6_options_crc;
1068     __le32 tcp_seq_num;
1069     __le32 tcp_ack_num;
1070     __le16 info3;
1071     __le16 window_size;
1072     __le32 info4;
1073     __le32 rule_indication[2];
1074     __le16 sa_idx;
1075     __le16 da_idx;
1076     __le32 info5;
1077     __le32 fse_metadata;
1078     __le16 cce_metadata;
1079     __le16 sa_sw_peer_id;
1080 } __packed;
1081 
1082 struct rx_msdu_end_wcn6855 {
1083     __le16 info0;
1084     __le16 phy_ppdu_id;
1085     __le16 ip_hdr_cksum;
1086     __le16 reported_mpdu_len;
1087     __le32 info1;
1088     __le32 ext_wapi_pn[2];
1089     __le32 info4;
1090     __le32 ipv6_options_crc;
1091     __le32 tcp_seq_num;
1092     __le32 tcp_ack_num;
1093     __le16 info3;
1094     __le16 window_size;
1095     __le32 info2;
1096     __le16 sa_idx;
1097     __le16 da_idx;
1098     __le32 info5;
1099     __le32 fse_metadata;
1100     __le16 cce_metadata;
1101     __le16 sa_sw_peer_id;
1102     __le32 rule_indication[2];
1103     __le32 info6;
1104     __le32 info7;
1105 } __packed;
1106 
1107 #define RX_MSDU_END_MPDU_LENGTH_INFO        GENMASK(13, 0)
1108 
1109 #define RX_MSDU_END_INFO2_DA_OFFSET     GENMASK(5, 0)
1110 #define RX_MSDU_END_INFO2_SA_OFFSET     GENMASK(11, 6)
1111 #define RX_MSDU_END_INFO2_DA_OFFSET_VALID   BIT(12)
1112 #define RX_MSDU_END_INFO2_SA_OFFSET_VALID   BIT(13)
1113 #define RX_MSDU_END_INFO2_L3_TYPE       GENMASK(31, 16)
1114 
1115 #define RX_MSDU_END_INFO4_SA_IDX_TIMEOUT    BIT(0)
1116 #define RX_MSDU_END_INFO4_DA_IDX_TIMEOUT    BIT(1)
1117 #define RX_MSDU_END_INFO4_MSDU_LIMIT_ERR    BIT(2)
1118 #define RX_MSDU_END_INFO4_FLOW_IDX_TIMEOUT  BIT(3)
1119 #define RX_MSDU_END_INFO4_FLOW_IDX_INVALID  BIT(4)
1120 #define RX_MSDU_END_INFO4_WIFI_PARSER_ERR   BIT(5)
1121 #define RX_MSDU_END_INFO4_AMSDU_PARSER_ERR  BIT(6)
1122 #define RX_MSDU_END_INFO4_SA_IS_VALID       BIT(7)
1123 #define RX_MSDU_END_INFO4_DA_IS_VALID       BIT(8)
1124 #define RX_MSDU_END_INFO4_DA_IS_MCBC        BIT(9)
1125 #define RX_MSDU_END_INFO4_L3_HDR_PADDING    GENMASK(11, 10)
1126 #define RX_MSDU_END_INFO4_FIRST_MSDU        BIT(12)
1127 #define RX_MSDU_END_INFO4_LAST_MSDU     BIT(13)
1128 
1129 #define RX_MSDU_END_INFO6_AGGR_COUNT        GENMASK(7, 0)
1130 #define RX_MSDU_END_INFO6_FLOW_AGGR_CONTN   BIT(8)
1131 #define RX_MSDU_END_INFO6_FISA_TIMEOUT      BIT(9)
1132 
1133 struct rx_msdu_end_qcn9074 {
1134     __le16 info0;
1135     __le16 phy_ppdu_id;
1136     __le16 ip_hdr_cksum;
1137     __le16 mpdu_length_info;
1138     __le32 info1;
1139     __le32 rule_indication[2];
1140     __le32 info2;
1141     __le32 ipv6_options_crc;
1142     __le32 tcp_seq_num;
1143     __le32 tcp_ack_num;
1144     __le16 info3;
1145     __le16 window_size;
1146     __le16 tcp_udp_cksum;
1147     __le16 info4;
1148     __le16 sa_idx;
1149     __le16 da_idx;
1150     __le32 info5;
1151     __le32 fse_metadata;
1152     __le16 cce_metadata;
1153     __le16 sa_sw_peer_id;
1154     __le32 info6;
1155     __le16 cum_l4_cksum;
1156     __le16 cum_ip_length;
1157 } __packed;
1158 
1159 /* rx_msdu_end
1160  *
1161  * rxpcu_mpdu_filter_in_category
1162  *      Field indicates what the reason was that this mpdu frame
1163  *      was allowed to come into the receive path by rxpcu. Values
1164  *      are defined in enum %RX_DESC_RXPCU_FILTER_*.
1165  *
1166  * sw_frame_group_id
1167  *      SW processes frames based on certain classifications. Values
1168  *      are defined in enum %RX_DESC_SW_FRAME_GRP_ID_*.
1169  *
1170  * phy_ppdu_id
1171  *      A ppdu counter value that PHY increments for every PPDU
1172  *      received. The counter value wraps around.
1173  *
1174  * ip_hdr_cksum
1175  *      This can include the IP header checksum or the pseudo
1176  *      header checksum used by TCP/UDP checksum.
1177  *
1178  * tcp_udp_chksum
1179  *      The value of the computed TCP/UDP checksum.  A mode bit
1180  *      selects whether this checksum is the full checksum or the
1181  *      partial checksum which does not include the pseudo header.
1182  *
1183  * key_id
1184  *      The key ID octet from the IV. Only valid when first_msdu is set.
1185  *
1186  * cce_super_rule
1187  *      Indicates the super filter rule.
1188  *
1189  * cce_classify_not_done_truncate
1190  *      Classification failed due to truncated frame.
1191  *
1192  * cce_classify_not_done_cce_dis
1193  *      Classification failed due to CCE global disable
1194  *
1195  * ext_wapi_pn*
1196  *      Extension PN (packet number) which is only used by WAPI.
1197  *
1198  * reported_mpdu_length
1199  *      MPDU length before decapsulation. Only valid when first_msdu is
1200  *      set. This field is taken directly from the length field of the
1201  *      A-MPDU delimiter or the preamble length field for non-A-MPDU
1202  *      frames.
1203  *
1204  * first_msdu
1205  *      Indicates the first MSDU of A-MSDU. If both first_msdu and
1206  *      last_msdu are set in the MSDU then this is a non-aggregated MSDU
1207  *      frame: normal MPDU. Interior MSDU in an A-MSDU shall have both
1208  *      first_mpdu and last_mpdu bits set to 0.
1209  *
1210  * last_msdu
1211  *      Indicates the last MSDU of the A-MSDU. MPDU end status is only
1212  *      valid when last_msdu is set.
1213  *
1214  * sa_idx_timeout
1215  *      Indicates an unsuccessful MAC source address search due to the
1216  *      expiring of the search timer.
1217  *
1218  * da_idx_timeout
1219  *      Indicates an unsuccessful MAC destination address search due to
1220  *      the expiring of the search timer.
1221  *
1222  * msdu_limit_error
1223  *      Indicates that the MSDU threshold was exceeded and thus all the
1224  *      rest of the MSDUs will not be scattered and will not be
1225  *      decapsulated but will be DMA'ed in RAW format as a single MSDU.
1226  *
1227  * flow_idx_timeout
1228  *      Indicates an unsuccessful flow search due to the expiring of
1229  *      the search timer.
1230  *
1231  * flow_idx_invalid
1232  *      flow id is not valid.
1233  *
1234  * amsdu_parser_error
1235  *      A-MSDU could not be properly de-agregated.
1236  *
1237  * sa_is_valid
1238  *      Indicates that OLE found a valid SA entry.
1239  *
1240  * da_is_valid
1241  *      Indicates that OLE found a valid DA entry.
1242  *
1243  * da_is_mcbc
1244  *      Field Only valid if da_is_valid is set. Indicates the DA address
1245  *      was a Multicast of Broadcast address.
1246  *
1247  * l3_header_padding
1248  *      Number of bytes padded  to make sure that the L3 header will
1249  *      always start of a Dword boundary.
1250  *
1251  * ipv6_options_crc
1252  *      32 bit CRC computed out of  IP v6 extension headers.
1253  *
1254  * tcp_seq_number
1255  *      TCP sequence number.
1256  *
1257  * tcp_ack_number
1258  *      TCP acknowledge number.
1259  *
1260  * tcp_flag
1261  *      TCP flags {NS, CWR, ECE, URG, ACK, PSH, RST, SYN, FIN}.
1262  *
1263  * lro_eligible
1264  *      Computed out of TCP and IP fields to indicate that this
1265  *      MSDU is eligible for LRO.
1266  *
1267  * window_size
1268  *      TCP receive window size.
1269  *
1270  * da_offset
1271  *      Offset into MSDU buffer for DA.
1272  *
1273  * sa_offset
1274  *      Offset into MSDU buffer for SA.
1275  *
1276  * da_offset_valid
1277  *      da_offset field is valid. This will be set to 0 in case
1278  *      of a dynamic A-MSDU when DA is compressed.
1279  *
1280  * sa_offset_valid
1281  *      sa_offset field is valid. This will be set to 0 in case
1282  *      of a dynamic A-MSDU when SA is compressed.
1283  *
1284  * l3_type
1285  *      The 16-bit type value indicating the type of L3 later
1286  *      extracted from LLC/SNAP, set to zero if SNAP is not
1287  *      available.
1288  *
1289  * rule_indication
1290  *      Bitmap indicating which of rules have matched.
1291  *
1292  * sa_idx
1293  *      The offset in the address table which matches MAC source address
1294  *
1295  * da_idx
1296  *      The offset in the address table which matches MAC destination
1297  *      address.
1298  *
1299  * msdu_drop
1300  *      REO shall drop this MSDU and not forward it to any other ring.
1301  *
1302  * reo_destination_indication
1303  *      The id of the reo exit ring where the msdu frame shall push
1304  *      after (MPDU level) reordering has finished. Values are defined
1305  *      in enum %HAL_RX_MSDU_DESC_REO_DEST_IND_.
1306  *
1307  * flow_idx
1308  *      Flow table index.
1309  *
1310  * fse_metadata
1311  *      FSE related meta data.
1312  *
1313  * cce_metadata
1314  *      CCE related meta data.
1315  *
1316  * sa_sw_peer_id
1317  *      sw_peer_id from the address search entry corresponding to the
1318  *      source address of the MSDU.
1319  */
1320 
1321 enum rx_mpdu_end_rxdma_dest_ring {
1322     RX_MPDU_END_RXDMA_DEST_RING_RELEASE,
1323     RX_MPDU_END_RXDMA_DEST_RING_FW,
1324     RX_MPDU_END_RXDMA_DEST_RING_SW,
1325     RX_MPDU_END_RXDMA_DEST_RING_REO,
1326 };
1327 
1328 #define RX_MPDU_END_INFO1_UNSUP_KTYPE_SHORT_FRAME   BIT(11)
1329 #define RX_MPDU_END_INFO1_RX_IN_TX_DECRYPT_BYT      BIT(12)
1330 #define RX_MPDU_END_INFO1_OVERFLOW_ERR          BIT(13)
1331 #define RX_MPDU_END_INFO1_MPDU_LEN_ERR          BIT(14)
1332 #define RX_MPDU_END_INFO1_TKIP_MIC_ERR          BIT(15)
1333 #define RX_MPDU_END_INFO1_DECRYPT_ERR           BIT(16)
1334 #define RX_MPDU_END_INFO1_UNENCRYPTED_FRAME_ERR     BIT(17)
1335 #define RX_MPDU_END_INFO1_PN_FIELDS_VALID       BIT(18)
1336 #define RX_MPDU_END_INFO1_FCS_ERR           BIT(19)
1337 #define RX_MPDU_END_INFO1_MSDU_LEN_ERR          BIT(20)
1338 #define RX_MPDU_END_INFO1_RXDMA0_DEST_RING      GENMASK(22, 21)
1339 #define RX_MPDU_END_INFO1_RXDMA1_DEST_RING      GENMASK(24, 23)
1340 #define RX_MPDU_END_INFO1_DECRYPT_STATUS_CODE       GENMASK(27, 25)
1341 #define RX_MPDU_END_INFO1_RX_BITMAP_NOT_UPD     BIT(28)
1342 
1343 struct rx_mpdu_end {
1344     __le16 info0;
1345     __le16 phy_ppdu_id;
1346     __le32 info1;
1347 } __packed;
1348 
1349 /* rx_mpdu_end
1350  *
1351  * rxpcu_mpdu_filter_in_category
1352  *      Field indicates what the reason was that this mpdu frame
1353  *      was allowed to come into the receive path by rxpcu. Values
1354  *      are defined in enum %RX_DESC_RXPCU_FILTER_*.
1355  *
1356  * sw_frame_group_id
1357  *      SW processes frames based on certain classifications. Values
1358  *      are defined in enum %RX_DESC_SW_FRAME_GRP_ID_*.
1359  *
1360  * phy_ppdu_id
1361  *      A ppdu counter value that PHY increments for every PPDU
1362  *      received. The counter value wraps around.
1363  *
1364  * unsup_ktype_short_frame
1365  *      This bit will be '1' when WEP or TKIP or WAPI key type is
1366  *      received for 11ah short frame. Crypto will bypass the received
1367  *      packet without decryption to RxOLE after setting this bit.
1368  *
1369  * rx_in_tx_decrypt_byp
1370  *      Indicates that RX packet is not decrypted as Crypto is
1371  *      busy with TX packet processing.
1372  *
1373  * overflow_err
1374  *      RXPCU Receive FIFO ran out of space to receive the full MPDU.
1375  *      Therefore this MPDU is terminated early and is thus corrupted.
1376  *
1377  *      This MPDU will not be ACKed.
1378  *
1379  *      RXPCU might still be able to correctly receive the following
1380  *      MPDUs in the PPDU if enough fifo space became available in time.
1381  *
1382  * mpdu_length_err
1383  *      Set by RXPCU if the expected MPDU length does not correspond
1384  *      with the actually received number of bytes in the MPDU.
1385  *
1386  * tkip_mic_err
1387  *      Set by Rx crypto when crypto detected a TKIP MIC error for
1388  *      this MPDU.
1389  *
1390  * decrypt_err
1391  *      Set by RX CRYPTO when CRYPTO detected a decrypt error for this
1392  *      MPDU or CRYPTO received an encrypted frame, but did not get a
1393  *      valid corresponding key id in the peer entry.
1394  *
1395  * unencrypted_frame_err
1396  *      Set by RX CRYPTO when CRYPTO detected an unencrypted frame while
1397  *      in the peer entry field 'All_frames_shall_be_encrypted' is set.
1398  *
1399  * pn_fields_contain_valid_info
1400  *      Set by RX CRYPTO to indicate that there is a valid PN field
1401  *      present in this MPDU.
1402  *
1403  * fcs_err
1404  *      Set by RXPCU when there is an FCS error detected for this MPDU.
1405  *
1406  * msdu_length_err
1407  *      Set by RXOLE when there is an msdu length error detected
1408  *      in at least 1 of the MSDUs embedded within the MPDU.
1409  *
1410  * rxdma0_destination_ring
1411  * rxdma1_destination_ring
1412  *      The ring to which RXDMA0/1 shall push the frame, assuming
1413  *      no MPDU level errors are detected. In case of MPDU level
1414  *      errors, RXDMA0/1 might change the RXDMA0/1 destination. Values
1415  *      are defined in %enum RX_MPDU_END_RXDMA_DEST_RING_*.
1416  *
1417  * decrypt_status_code
1418  *      Field provides insight into the decryption performed. Values
1419  *      are defined in enum %RX_DESC_DECRYPT_STATUS_CODE_*.
1420  *
1421  * rx_bitmap_not_updated
1422  *      Frame is received, but RXPCU could not update the receive bitmap
1423  *      due to (temporary) fifo constraints.
1424  */
1425 
1426 /* Padding bytes to avoid TLV's spanning across 128 byte boundary */
1427 #define HAL_RX_DESC_PADDING0_BYTES  4
1428 #define HAL_RX_DESC_PADDING1_BYTES  16
1429 
1430 #define HAL_RX_DESC_HDR_STATUS_LEN  120
1431 
1432 struct hal_rx_desc_ipq8074 {
1433     __le32 msdu_end_tag;
1434     struct rx_msdu_end_ipq8074 msdu_end;
1435     __le32 rx_attn_tag;
1436     struct rx_attention attention;
1437     __le32 msdu_start_tag;
1438     struct rx_msdu_start_ipq8074 msdu_start;
1439     u8 rx_padding0[HAL_RX_DESC_PADDING0_BYTES];
1440     __le32 mpdu_start_tag;
1441     struct rx_mpdu_start_ipq8074 mpdu_start;
1442     __le32 mpdu_end_tag;
1443     struct rx_mpdu_end mpdu_end;
1444     u8 rx_padding1[HAL_RX_DESC_PADDING1_BYTES];
1445     __le32 hdr_status_tag;
1446     __le32 phy_ppdu_id;
1447     u8 hdr_status[HAL_RX_DESC_HDR_STATUS_LEN];
1448     u8 msdu_payload[];
1449 } __packed;
1450 
1451 struct hal_rx_desc_qcn9074 {
1452     __le32 msdu_end_tag;
1453     struct rx_msdu_end_qcn9074 msdu_end;
1454     __le32 rx_attn_tag;
1455     struct rx_attention attention;
1456     __le32 msdu_start_tag;
1457     struct rx_msdu_start_qcn9074 msdu_start;
1458     u8 rx_padding0[HAL_RX_DESC_PADDING0_BYTES];
1459     __le32 mpdu_start_tag;
1460     struct rx_mpdu_start_qcn9074 mpdu_start;
1461     __le32 mpdu_end_tag;
1462     struct rx_mpdu_end mpdu_end;
1463     u8 rx_padding1[HAL_RX_DESC_PADDING1_BYTES];
1464     __le32 hdr_status_tag;
1465     __le32 phy_ppdu_id;
1466     u8 hdr_status[HAL_RX_DESC_HDR_STATUS_LEN];
1467     u8 msdu_payload[];
1468 } __packed;
1469 
1470 struct hal_rx_desc_wcn6855 {
1471     __le32 msdu_end_tag;
1472     struct rx_msdu_end_wcn6855 msdu_end;
1473     __le32 rx_attn_tag;
1474     struct rx_attention attention;
1475     __le32 msdu_start_tag;
1476     struct rx_msdu_start_wcn6855 msdu_start;
1477     u8 rx_padding0[HAL_RX_DESC_PADDING0_BYTES];
1478     __le32 mpdu_start_tag;
1479     struct rx_mpdu_start_wcn6855 mpdu_start;
1480     __le32 mpdu_end_tag;
1481     struct rx_mpdu_end mpdu_end;
1482     u8 rx_padding1[HAL_RX_DESC_PADDING1_BYTES];
1483     __le32 hdr_status_tag;
1484     __le32 phy_ppdu_id;
1485     u8 hdr_status[HAL_RX_DESC_HDR_STATUS_LEN];
1486     u8 msdu_payload[];
1487 } __packed;
1488 
1489 struct hal_rx_desc {
1490     union {
1491         struct hal_rx_desc_ipq8074 ipq8074;
1492         struct hal_rx_desc_qcn9074 qcn9074;
1493         struct hal_rx_desc_wcn6855 wcn6855;
1494     } u;
1495 } __packed;
1496 
1497 #define HAL_RX_RU_ALLOC_TYPE_MAX 6
1498 #define RU_26  1
1499 #define RU_52  2
1500 #define RU_106 4
1501 #define RU_242 9
1502 #define RU_484 18
1503 #define RU_996 37
1504 
1505 #endif /* ATH11K_RX_DESC_H */