1611 lines · c
1/* SPDX-License-Identifier: BSD-3-Clause-Clear */2/*3 * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.4 * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.5 */6#ifndef ATH12K_RX_DESC_H7#define ATH12K_RX_DESC_H8 9enum rx_desc_decap_type {10 RX_DESC_DECAP_TYPE_RAW,11 RX_DESC_DECAP_TYPE_NATIVE_WIFI,12 RX_DESC_DECAP_TYPE_ETHERNET2_DIX,13 RX_DESC_DECAP_TYPE_8023,14};15 16enum rx_desc_decrypt_status_code {17 RX_DESC_DECRYPT_STATUS_CODE_OK,18 RX_DESC_DECRYPT_STATUS_CODE_UNPROTECTED_FRAME,19 RX_DESC_DECRYPT_STATUS_CODE_DATA_ERR,20 RX_DESC_DECRYPT_STATUS_CODE_KEY_INVALID,21 RX_DESC_DECRYPT_STATUS_CODE_PEER_ENTRY_INVALID,22 RX_DESC_DECRYPT_STATUS_CODE_OTHER,23};24 25#define RX_MPDU_START_INFO0_REO_DEST_IND GENMASK(4, 0)26#define RX_MPDU_START_INFO0_LMAC_PEER_ID_MSB GENMASK(6, 5)27#define RX_MPDU_START_INFO0_FLOW_ID_TOEPLITZ BIT(7)28#define RX_MPDU_START_INFO0_PKT_SEL_FP_UCAST_DATA BIT(8)29#define RX_MPDU_START_INFO0_PKT_SEL_FP_MCAST_DATA BIT(9)30#define RX_MPDU_START_INFO0_PKT_SEL_FP_CTRL_BAR BIT(10)31#define RX_MPDU_START_INFO0_RXDMA0_SRC_RING_SEL GENMASK(13, 11)32#define RX_MPDU_START_INFO0_RXDMA0_DST_RING_SEL GENMASK(16, 14)33#define RX_MPDU_START_INFO0_MCAST_ECHO_DROP_EN BIT(17)34#define RX_MPDU_START_INFO0_WDS_LEARN_DETECT_EN BIT(18)35#define RX_MPDU_START_INFO0_INTRA_BSS_CHECK_EN BIT(19)36#define RX_MPDU_START_INFO0_USE_PPE BIT(20)37#define RX_MPDU_START_INFO0_PPE_ROUTING_EN BIT(21)38 39#define RX_MPDU_START_INFO1_REO_QUEUE_DESC_HI GENMASK(7, 0)40#define RX_MPDU_START_INFO1_RECV_QUEUE_NUM GENMASK(23, 8)41#define RX_MPDU_START_INFO1_PRE_DELIM_ERR_WARN BIT(24)42#define RX_MPDU_START_INFO1_FIRST_DELIM_ERR BIT(25)43 44#define RX_MPDU_START_INFO2_EPD_EN BIT(0)45#define RX_MPDU_START_INFO2_ALL_FRAME_ENCPD BIT(1)46#define RX_MPDU_START_INFO2_ENC_TYPE GENMASK(5, 2)47#define RX_MPDU_START_INFO2_VAR_WEP_KEY_WIDTH GENMASK(7, 6)48#define RX_MPDU_START_INFO2_MESH_STA GENMASK(9, 8)49#define RX_MPDU_START_INFO2_BSSID_HIT BIT(10)50#define RX_MPDU_START_INFO2_BSSID_NUM GENMASK(14, 11)51#define RX_MPDU_START_INFO2_TID GENMASK(18, 15)52 53#define RX_MPDU_START_INFO3_RXPCU_MPDU_FLTR GENMASK(1, 0)54#define RX_MPDU_START_INFO3_SW_FRAME_GRP_ID GENMASK(8, 2)55#define RX_MPDU_START_INFO3_NDP_FRAME BIT(9)56#define RX_MPDU_START_INFO3_PHY_ERR BIT(10)57#define RX_MPDU_START_INFO3_PHY_ERR_MPDU_HDR BIT(11)58#define RX_MPDU_START_INFO3_PROTO_VER_ERR BIT(12)59#define RX_MPDU_START_INFO3_AST_LOOKUP_VALID BIT(13)60#define RX_MPDU_START_INFO3_RANGING BIT(14)61 62#define RX_MPDU_START_INFO4_MPDU_FCTRL_VALID BIT(0)63#define RX_MPDU_START_INFO4_MPDU_DUR_VALID BIT(1)64#define RX_MPDU_START_INFO4_MAC_ADDR1_VALID BIT(2)65#define RX_MPDU_START_INFO4_MAC_ADDR2_VALID BIT(3)66#define RX_MPDU_START_INFO4_MAC_ADDR3_VALID BIT(4)67#define RX_MPDU_START_INFO4_MAC_ADDR4_VALID BIT(5)68#define RX_MPDU_START_INFO4_MPDU_SEQ_CTRL_VALID BIT(6)69#define RX_MPDU_START_INFO4_MPDU_QOS_CTRL_VALID BIT(7)70#define RX_MPDU_START_INFO4_MPDU_HT_CTRL_VALID BIT(8)71#define RX_MPDU_START_INFO4_ENCRYPT_INFO_VALID BIT(9)72#define RX_MPDU_START_INFO4_MPDU_FRAG_NUMBER GENMASK(13, 10)73#define RX_MPDU_START_INFO4_MORE_FRAG_FLAG BIT(14)74#define RX_MPDU_START_INFO4_FROM_DS BIT(16)75#define RX_MPDU_START_INFO4_TO_DS BIT(17)76#define RX_MPDU_START_INFO4_ENCRYPTED BIT(18)77#define RX_MPDU_START_INFO4_MPDU_RETRY BIT(19)78#define RX_MPDU_START_INFO4_MPDU_SEQ_NUM GENMASK(31, 20)79 80#define RX_MPDU_START_INFO5_KEY_ID GENMASK(7, 0)81#define RX_MPDU_START_INFO5_NEW_PEER_ENTRY BIT(8)82#define RX_MPDU_START_INFO5_DECRYPT_NEEDED BIT(9)83#define RX_MPDU_START_INFO5_DECAP_TYPE GENMASK(11, 10)84#define RX_MPDU_START_INFO5_VLAN_TAG_C_PADDING BIT(12)85#define RX_MPDU_START_INFO5_VLAN_TAG_S_PADDING BIT(13)86#define RX_MPDU_START_INFO5_STRIP_VLAN_TAG_C BIT(14)87#define RX_MPDU_START_INFO5_STRIP_VLAN_TAG_S BIT(15)88#define RX_MPDU_START_INFO5_PRE_DELIM_COUNT GENMASK(27, 16)89#define RX_MPDU_START_INFO5_AMPDU_FLAG BIT(28)90#define RX_MPDU_START_INFO5_BAR_FRAME BIT(29)91#define RX_MPDU_START_INFO5_RAW_MPDU BIT(30)92 93#define RX_MPDU_START_INFO6_MPDU_LEN GENMASK(13, 0)94#define RX_MPDU_START_INFO6_FIRST_MPDU BIT(14)95#define RX_MPDU_START_INFO6_MCAST_BCAST BIT(15)96#define RX_MPDU_START_INFO6_AST_IDX_NOT_FOUND BIT(16)97#define RX_MPDU_START_INFO6_AST_IDX_TIMEOUT BIT(17)98#define RX_MPDU_START_INFO6_POWER_MGMT BIT(18)99#define RX_MPDU_START_INFO6_NON_QOS BIT(19)100#define RX_MPDU_START_INFO6_NULL_DATA BIT(20)101#define RX_MPDU_START_INFO6_MGMT_TYPE BIT(21)102#define RX_MPDU_START_INFO6_CTRL_TYPE BIT(22)103#define RX_MPDU_START_INFO6_MORE_DATA BIT(23)104#define RX_MPDU_START_INFO6_EOSP BIT(24)105#define RX_MPDU_START_INFO6_FRAGMENT BIT(25)106#define RX_MPDU_START_INFO6_ORDER BIT(26)107#define RX_MPDU_START_INFO6_UAPSD_TRIGGER BIT(27)108#define RX_MPDU_START_INFO6_ENCRYPT_REQUIRED BIT(28)109#define RX_MPDU_START_INFO6_DIRECTED BIT(29)110#define RX_MPDU_START_INFO6_AMSDU_PRESENT BIT(30)111 112#define RX_MPDU_START_INFO7_VDEV_ID GENMASK(7, 0)113#define RX_MPDU_START_INFO7_SERVICE_CODE GENMASK(16, 8)114#define RX_MPDU_START_INFO7_PRIORITY_VALID BIT(17)115#define RX_MPDU_START_INFO7_SRC_INFO GENMASK(29, 18)116 117#define RX_MPDU_START_INFO8_AUTH_TO_SEND_WDS BIT(0)118 119struct rx_mpdu_start_qcn9274 {120 __le32 info0;121 __le32 reo_queue_desc_lo;122 __le32 info1;123 __le32 pn[4];124 __le32 info2;125 __le32 peer_meta_data;126 __le16 info3;127 __le16 phy_ppdu_id;128 __le16 ast_index;129 __le16 sw_peer_id;130 __le32 info4;131 __le32 info5;132 __le32 info6;133 __le16 frame_ctrl;134 __le16 duration;135 u8 addr1[ETH_ALEN];136 u8 addr2[ETH_ALEN];137 u8 addr3[ETH_ALEN];138 __le16 seq_ctrl;139 u8 addr4[ETH_ALEN];140 __le16 qos_ctrl;141 __le32 ht_ctrl;142 __le32 info7;143 u8 multi_link_addr1[ETH_ALEN];144 u8 multi_link_addr2[ETH_ALEN];145 __le32 info8;146 __le32 res0;147 __le32 res1;148} __packed;149 150#define QCN9274_MPDU_START_SELECT_MPDU_START_TAG BIT(0)151#define QCN9274_MPDU_START_SELECT_INFO0_REO_QUEUE_DESC_LO BIT(1)152#define QCN9274_MPDU_START_SELECT_INFO1_PN_31_0 BIT(2)153#define QCN9274_MPDU_START_SELECT_PN_95_32 BIT(3)154#define QCN9274_MPDU_START_SELECT_PN_127_96_INFO2 BIT(4)155#define QCN9274_MPDU_START_SELECT_PEER_MDATA_INFO3_PHY_PPDU_ID BIT(5)156#define QCN9274_MPDU_START_SELECT_AST_IDX_SW_PEER_ID_INFO4 BIT(6)157#define QCN9274_MPDU_START_SELECT_INFO5_INFO6 BIT(7)158#define QCN9274_MPDU_START_SELECT_FRAME_CTRL_DURATION_ADDR1_31_0 BIT(8)159#define QCN9274_MPDU_START_SELECT_ADDR2_47_0_ADDR1_47_32 BIT(9)160#define QCN9274_MPDU_START_SELECT_ADDR3_47_0_SEQ_CTRL BIT(10)161#define QCN9274_MPDU_START_SELECT_ADDR4_47_0_QOS_CTRL BIT(11)162#define QCN9274_MPDU_START_SELECT_HT_CTRL_INFO7 BIT(12)163#define QCN9274_MPDU_START_SELECT_ML_ADDR1_47_0_ML_ADDR2_15_0 BIT(13)164#define QCN9274_MPDU_START_SELECT_ML_ADDR2_47_16_INFO8 BIT(14)165#define QCN9274_MPDU_START_SELECT_RES_0_RES_1 BIT(15)166 167#define QCN9274_MPDU_START_WMASK (QCN9274_MPDU_START_SELECT_INFO1_PN_31_0 | \168 QCN9274_MPDU_START_SELECT_PN_95_32 | \169 QCN9274_MPDU_START_SELECT_PN_127_96_INFO2 | \170 QCN9274_MPDU_START_SELECT_PEER_MDATA_INFO3_PHY_PPDU_ID | \171 QCN9274_MPDU_START_SELECT_AST_IDX_SW_PEER_ID_INFO4 | \172 QCN9274_MPDU_START_SELECT_INFO5_INFO6 | \173 QCN9274_MPDU_START_SELECT_FRAME_CTRL_DURATION_ADDR1_31_0 | \174 QCN9274_MPDU_START_SELECT_ADDR2_47_0_ADDR1_47_32 | \175 QCN9274_MPDU_START_SELECT_ADDR3_47_0_SEQ_CTRL | \176 QCN9274_MPDU_START_SELECT_ADDR4_47_0_QOS_CTRL)177 178/* The below rx_mpdu_start_qcn9274_compact structure is tied with the mask179 * value QCN9274_MPDU_START_WMASK. If the mask value changes the structure180 * will also change.181 */182 183struct rx_mpdu_start_qcn9274_compact {184 __le32 info1;185 __le32 pn[4];186 __le32 info2;187 __le32 peer_meta_data;188 __le16 info3;189 __le16 phy_ppdu_id;190 __le16 ast_index;191 __le16 sw_peer_id;192 __le32 info4;193 __le32 info5;194 __le32 info6;195 __le16 frame_ctrl;196 __le16 duration;197 u8 addr1[ETH_ALEN];198 u8 addr2[ETH_ALEN];199 u8 addr3[ETH_ALEN];200 __le16 seq_ctrl;201 u8 addr4[ETH_ALEN];202 __le16 qos_ctrl;203} __packed;204 205/* rx_mpdu_start206 *207 * reo_destination_indication208 * The id of the reo exit ring where the msdu frame shall push209 * after (MPDU level) reordering has finished. Values are defined210 * in enum %HAL_RX_MSDU_DESC_REO_DEST_IND_.211 *212 * lmac_peer_id_msb213 *214 * If use_flow_id_toeplitz_clfy is set and lmac_peer_id_'sb215 * is 2'b00, Rx OLE uses a REO destination indicati'n of {1'b1,216 * hash[3:0]} using the chosen Toeplitz hash from Common Parser217 * if flow search fails.218 * If use_flow_id_toeplitz_clfy is set and lmac_peer_id_msb219 * 's not 2'b00, Rx OLE uses a REO destination indication of220 * {lmac_peer_id_msb, hash[2:0]} using the chosen Toeplitz221 * hash from Common Parser if flow search fails.222 *223 * use_flow_id_toeplitz_clfy224 * Indication to Rx OLE to enable REO destination routing based225 * on the chosen Toeplitz hash from Common Parser, in case226 * flow search fails227 *228 * pkt_selection_fp_ucast_data229 * Filter pass Unicast data frame (matching rxpcu_filter_pass230 * and sw_frame_group_Unicast_data) routing selection231 *232 * pkt_selection_fp_mcast_data233 * Filter pass Multicast data frame (matching rxpcu_filter_pass234 * and sw_frame_group_Multicast_data) routing selection235 *236 * pkt_selection_fp_ctrl_bar237 * Filter pass BAR frame (matching rxpcu_filter_pass238 * and sw_frame_group_ctrl_1000) routing selection239 *240 * rxdma0_src_ring_selection241 * Field only valid when for the received frame type the corresponding242 * pkt_selection_fp_... bit is set243 *244 * rxdma0_dst_ring_selection245 * Field only valid when for the received frame type the corresponding246 * pkt_selection_fp_... bit is set247 *248 * mcast_echo_drop_enable249 * If set, for multicast packets, multicast echo check (i.e.250 * SA search with mcast_echo_check = 1) shall be performed251 * by RXOLE, and any multicast echo packets should be indicated252 * to RXDMA for release to WBM253 *254 * wds_learning_detect_en255 * If set, WDS learning detection based on SA search and notification256 * to FW (using RXDMA0 status ring) is enabled and the "timestamp"257 * field in address search failure cache-only entry should258 * be used to avoid multiple WDS learning notifications.259 *260 * intrabss_check_en261 * If set, intra-BSS routing detection is enabled262 *263 * use_ppe264 * Indicates to RXDMA to ignore the REO_destination_indication265 * and use a programmed value corresponding to the REO2PPE266 * ring267 * This override to REO2PPE for packets requiring multiple268 * buffers shall be disabled based on an RXDMA configuration,269 * as PPE may not support such packets.270 *271 * Supported only in full AP chips, not in client/soft272 * chips273 *274 * ppe_routing_enable275 * Global enable/disable bit for routing to PPE, used to disable276 * PPE routing even if RXOLE CCE or flow search indicate 'Use_PPE'277 * This is set by SW for peers which are being handled by a278 * host SW/accelerator subsystem that also handles packet279 * buffer management for WiFi-to-PPE routing.280 *281 * This is cleared by SW for peers which are being handled282 * by a different subsystem, completely disabling WiFi-to-PPE283 * routing for such peers.284 *285 * rx_reo_queue_desc_addr_lo286 * Address (lower 32 bits) of the REO queue descriptor.287 *288 * rx_reo_queue_desc_addr_hi289 * Address (upper 8 bits) of the REO queue descriptor.290 *291 * receive_queue_number292 * Indicates the MPDU queue ID to which this MPDU link293 * descriptor belongs.294 *295 * pre_delim_err_warning296 * Indicates that a delimiter FCS error was found in between the297 * previous MPDU and this MPDU. Note that this is just a warning,298 * and does not mean that this MPDU is corrupted in any way. If299 * it is, there will be other errors indicated such as FCS or300 * decrypt errors.301 *302 * first_delim_err303 * Indicates that the first delimiter had a FCS failure.304 *305 * pn306 * The PN number.307 *308 * epd_en309 * Field only valid when AST_based_lookup_valid == 1.310 * In case of ndp or phy_err or AST_based_lookup_valid == 0,311 * this field will be set to 0312 * If set to one use EPD instead of LPD313 * In case of ndp or phy_err, this field will never be set.314 *315 * all_frames_shall_be_encrypted316 * In case of ndp or phy_err or AST_based_lookup_valid == 0,317 * this field will be set to 0318 *319 * When set, all frames (data only ?) shall be encrypted. If320 * not, RX CRYPTO shall set an error flag.321 *322 *323 * encrypt_type324 * In case of ndp or phy_err or AST_based_lookup_valid == 0,325 * this field will be set to 0326 *327 * Indicates type of decrypt cipher used (as defined in the328 * peer entry)329 *330 * wep_key_width_for_variable_key331 *332 * Field only valid when key_type is set to wep_varied_width.333 *334 * mesh_sta335 *336 * bssid_hit337 * When set, the BSSID of the incoming frame matched one of338 * the 8 BSSID register values339 * bssid_number340 * Field only valid when bssid_hit is set.341 * This number indicates which one out of the 8 BSSID register342 * values matched the incoming frame343 *344 * tid345 * Field only valid when mpdu_qos_control_valid is set346 * The TID field in the QoS control field347 *348 * peer_meta_data349 * Meta data that SW has programmed in the Peer table entry350 * of the transmitting STA.351 *352 * rxpcu_mpdu_filter_in_category353 * Field indicates what the reason was that this mpdu frame354 * was allowed to come into the receive path by rxpcu. Values355 * are defined in enum %RX_DESC_RXPCU_FILTER_*.356 *357 * sw_frame_group_id358 * SW processes frames based on certain classifications. Values359 * are defined in enum %RX_DESC_SW_FRAME_GRP_ID_*.360 *361 * ndp_frame362 * When set, the received frame was an NDP frame, and thus363 * there will be no MPDU data.364 * phy_err365 * When set, a PHY error was received before MAC received any366 * data, and thus there will be no MPDU data.367 *368 * phy_err_during_mpdu_header369 * When set, a PHY error was received before MAC received the370 * complete MPDU header which was needed for proper decoding371 *372 * protocol_version_err373 * Set when RXPCU detected a version error in the Frame control374 * field375 *376 * ast_based_lookup_valid377 * When set, AST based lookup for this frame has found a valid378 * result.379 *380 * ranging381 * When set, a ranging NDPA or a ranging NDP was received.382 *383 * phy_ppdu_id384 * A ppdu counter value that PHY increments for every PPDU385 * received. The counter value wraps around.386 *387 * ast_index388 *389 * This field indicates the index of the AST entry corresponding390 * to this MPDU. It is provided by the GSE module instantiated391 * in RXPCU.392 * A value of 0xFFFF indicates an invalid AST index, meaning393 * that No AST entry was found or NO AST search was performed394 *395 * sw_peer_id396 * In case of ndp or phy_err or AST_based_lookup_valid == 0,397 * this field will be set to 0398 * This field indicates a unique peer identifier. It is set399 * equal to field 'sw_peer_id' from the AST entry400 *401 * frame_control_valid402 * When set, the field Mpdu_Frame_control_field has valid information403 *404 * frame_duration_valid405 * When set, the field Mpdu_duration_field has valid information406 *407 * mac_addr_ad1..4_valid408 * When set, the fields mac_addr_adx_..... have valid information409 *410 * mpdu_seq_ctrl_valid411 *412 * When set, the fields mpdu_sequence_control_field and mpdu_sequence_number413 * have valid information as well as field414 * For MPDUs without a sequence control field, this field will415 * not be set.416 *417 * mpdu_qos_ctrl_valid, mpdu_ht_ctrl_valid418 *419 * When set, the field mpdu_qos_control_field, mpdu_ht_control has valid420 * information, For MPDUs without a QoS,HT control field, this field421 * will not be set.422 *423 * frame_encryption_info_valid424 *425 * When set, the encryption related info fields, like IV and426 * PN are valid427 * For MPDUs that are not encrypted, this will not be set.428 *429 * mpdu_fragment_number430 *431 * Field only valid when Mpdu_sequence_control_valid is set432 * AND Fragment_flag is set. The fragment number from the 802.11 header433 *434 * more_fragment_flag435 *436 * The More Fragment bit setting from the MPDU header of the437 * received frame438 *439 * fr_ds440 *441 * Field only valid when Mpdu_frame_control_valid is set442 * Set if the from DS bit is set in the frame control.443 *444 * to_ds445 *446 * Field only valid when Mpdu_frame_control_valid is set447 * Set if the to DS bit is set in the frame control.448 *449 * encrypted450 *451 * Field only valid when Mpdu_frame_control_valid is set.452 * Protected bit from the frame control.453 *454 * mpdu_retry455 * Field only valid when Mpdu_frame_control_valid is set.456 * Retry bit from the frame control. Only valid when first_msdu is set457 *458 * mpdu_sequence_number459 * Field only valid when Mpdu_sequence_control_valid is set.460 *461 * The sequence number from the 802.11 header.462 * key_id463 * The key ID octet from the IV.464 * Field only valid when Frame_encryption_info_valid is set465 *466 * new_peer_entry467 * Set if new RX_PEER_ENTRY TLV follows. If clear, RX_PEER_ENTRY468 * doesn't follow so RX DECRYPTION module either uses old peer469 * entry or not decrypt.470 *471 * decrypt_needed472 * When RXPCU sets bit 'ast_index_not_found or ast_index_timeout',473 * RXPCU will also ensure that this bit is NOT set. CRYPTO for that474 * reason only needs to evaluate this bit and non of the other ones475 *476 * decap_type477 * Used by the OLE during decapsulation. Values are defined in478 * enum %MPDU_START_DECAP_TYPE_*.479 *480 * rx_insert_vlan_c_tag_padding481 * rx_insert_vlan_s_tag_padding482 * Insert 4 byte of all zeros as VLAN tag or double VLAN tag if483 * the rx payload does not have VLAN.484 *485 * strip_vlan_c_tag_decap486 * strip_vlan_s_tag_decap487 * Strip VLAN or double VLAN during decapsulation.488 *489 * pre_delim_count490 * The number of delimiters before this MPDU. Note that this491 * number is cleared at PPDU start. If this MPDU is the first492 * received MPDU in the PPDU and this MPDU gets filtered-in,493 * this field will indicate the number of delimiters located494 * after the last MPDU in the previous PPDU.495 *496 * If this MPDU is located after the first received MPDU in497 * an PPDU, this field will indicate the number of delimiters498 * located between the previous MPDU and this MPDU.499 *500 * ampdu_flag501 * Received frame was part of an A-MPDU.502 *503 * bar_frame504 * Received frame is a BAR frame505 *506 * raw_mpdu507 * Set when no 802.11 to nwifi/ethernet hdr conversion is done508 *509 * mpdu_length510 * MPDU length before decapsulation.511 *512 * first_mpdu513 * Indicates the first MSDU of the PPDU. If both first_mpdu514 * and last_mpdu are set in the MSDU then this is a not an515 * A-MPDU frame but a stand alone MPDU. Interior MPDU in an516 * A-MPDU shall have both first_mpdu and last_mpdu bits set to517 * 0. The PPDU start status will only be valid when this bit518 * is set.519 *520 * mcast_bcast521 * Multicast / broadcast indicator. Only set when the MAC522 * address 1 bit 0 is set indicating mcast/bcast and the BSSID523 * matches one of the 4 BSSID registers. Only set when524 * first_msdu is set.525 *526 * ast_index_not_found527 * Only valid when first_msdu is set. Indicates no AST matching528 * entries within the max search count.529 *530 * ast_index_timeout531 * Only valid when first_msdu is set. Indicates an unsuccessful532 * search in the address search table due to timeout.533 *534 * power_mgmt535 * Power management bit set in the 802.11 header. Only set536 * when first_msdu is set.537 *538 * non_qos539 * Set if packet is not a non-QoS data frame. Only set when540 * first_msdu is set.541 *542 * null_data543 * Set if frame type indicates either null data or QoS null544 * data format. Only set when first_msdu is set.545 *546 * mgmt_type547 * Set if packet is a management packet. Only set when548 * first_msdu is set.549 *550 * ctrl_type551 * Set if packet is a control packet. Only set when first_msdu552 * is set.553 *554 * more_data555 * Set if more bit in frame control is set. Only set when556 * first_msdu is set.557 *558 * eosp559 * Set if the EOSP (end of service period) bit in the QoS560 * control field is set. Only set when first_msdu is set.561 *562 *563 * fragment_flag564 * Fragment indication565 *566 * order567 * Set if the order bit in the frame control is set. Only568 * set when first_msdu is set.569 *570 * u_apsd_trigger571 * U-APSD trigger frame572 *573 * encrypt_required574 * Indicates that this data type frame is not encrypted even if575 * the policy for this MPDU requires encryption as indicated in576 * the peer table key type.577 *578 * directed579 * MPDU is a directed packet which means that the RA matched580 * our STA addresses. In proxySTA it means that the TA matched581 * an entry in our address search table with the corresponding582 * 'no_ack' bit is the address search entry cleared.583 * amsdu_present584 * AMSDU present585 *586 * mpdu_frame_control_field587 * Frame control field in header. Only valid when the field is marked valid.588 *589 * mpdu_duration_field590 * Duration field in header. Only valid when the field is marked valid.591 *592 * mac_addr_adx593 * MAC addresses in the received frame. Only valid when corresponding594 * address valid bit is set595 *596 * mpdu_qos_control_field, mpdu_ht_control_field597 * QoS/HT control fields from header. Valid only when corresponding fields598 * are marked valid599 *600 * vdev_id601 * Virtual device associated with this peer602 * RXOLE uses this to determine intra-BSS routing.603 *604 * service_code605 * Opaque service code between PPE and Wi-Fi606 * This field gets passed on by REO to PPE in the EDMA descriptor607 * ('REO_TO_PPE_RING').608 *609 * priority_valid610 * This field gets passed on by REO to PPE in the EDMA descriptor611 * ('REO_TO_PPE_RING').612 *613 * src_info614 * Source (virtual) device/interface info. associated with615 * this peer616 * This field gets passed on by REO to PPE in the EDMA descriptor617 * ('REO_TO_PPE_RING').618 *619 * multi_link_addr_ad1_ad2_valid620 * If set, Rx OLE shall convert Address1 and Address2 of received621 * data frames to multi-link addresses during decapsulation to eth/nwifi622 *623 * multi_link_addr_ad1,ad2624 * Multi-link receiver address1,2. Only valid when corresponding625 * valid bit is set626 *627 * authorize_to_send_wds628 * If not set, RXDMA shall perform error-routing for WDS packets629 * as the sender is not authorized and might misuse WDS frame630 * format to inject packets with arbitrary DA/SA.631 *632 */633 634enum rx_msdu_start_pkt_type {635 RX_MSDU_START_PKT_TYPE_11A,636 RX_MSDU_START_PKT_TYPE_11B,637 RX_MSDU_START_PKT_TYPE_11N,638 RX_MSDU_START_PKT_TYPE_11AC,639 RX_MSDU_START_PKT_TYPE_11AX,640};641 642enum rx_msdu_start_sgi {643 RX_MSDU_START_SGI_0_8_US,644 RX_MSDU_START_SGI_0_4_US,645 RX_MSDU_START_SGI_1_6_US,646 RX_MSDU_START_SGI_3_2_US,647};648 649enum rx_msdu_start_recv_bw {650 RX_MSDU_START_RECV_BW_20MHZ,651 RX_MSDU_START_RECV_BW_40MHZ,652 RX_MSDU_START_RECV_BW_80MHZ,653 RX_MSDU_START_RECV_BW_160MHZ,654};655 656enum rx_msdu_start_reception_type {657 RX_MSDU_START_RECEPTION_TYPE_SU,658 RX_MSDU_START_RECEPTION_TYPE_DL_MU_MIMO,659 RX_MSDU_START_RECEPTION_TYPE_DL_MU_OFDMA,660 RX_MSDU_START_RECEPTION_TYPE_DL_MU_OFDMA_MIMO,661 RX_MSDU_START_RECEPTION_TYPE_UL_MU_MIMO,662 RX_MSDU_START_RECEPTION_TYPE_UL_MU_OFDMA,663 RX_MSDU_START_RECEPTION_TYPE_UL_MU_OFDMA_MIMO,664};665 666#define RX_MSDU_END_64_TLV_SRC_LINK_ID GENMASK(24, 22)667 668#define RX_MSDU_END_INFO0_RXPCU_MPDU_FITLER GENMASK(1, 0)669#define RX_MSDU_END_INFO0_SW_FRAME_GRP_ID GENMASK(8, 2)670 671#define RX_MSDU_END_INFO1_REPORTED_MPDU_LENGTH GENMASK(13, 0)672 673#define RX_MSDU_END_INFO2_CCE_SUPER_RULE GENMASK(13, 8)674#define RX_MSDU_END_INFO2_CCND_TRUNCATE BIT(14)675#define RX_MSDU_END_INFO2_CCND_CCE_DIS BIT(15)676 677#define RX_MSDU_END_INFO3_DA_OFFSET GENMASK(5, 0)678#define RX_MSDU_END_INFO3_SA_OFFSET GENMASK(11, 6)679#define RX_MSDU_END_INFO3_DA_OFFSET_VALID BIT(12)680#define RX_MSDU_END_INFO3_SA_OFFSET_VALID BIT(13)681 682#define RX_MSDU_END_INFO4_TCP_FLAG GENMASK(8, 0)683#define RX_MSDU_END_INFO4_LRO_ELIGIBLE BIT(9)684 685#define RX_MSDU_END_INFO5_SA_IDX_TIMEOUT BIT(0)686#define RX_MSDU_END_INFO5_DA_IDX_TIMEOUT BIT(1)687#define RX_MSDU_END_INFO5_SA_IS_VALID BIT(7)688#define RX_MSDU_END_INFO5_DA_IS_VALID BIT(8)689#define RX_MSDU_END_INFO5_DA_IS_MCBC BIT(9)690#define RX_MSDU_END_INFO5_L3_HDR_PADDING GENMASK(11, 10)691#define RX_MSDU_END_INFO5_FIRST_MSDU BIT(12)692#define RX_MSDU_END_INFO5_LAST_MSDU BIT(13)693#define RX_MSDU_END_INFO5_IP_CHKSUM_FAIL_COPY BIT(15)694 695#define RX_MSDU_END_QCN9274_INFO5_TO_DS BIT(2)696#define RX_MSDU_END_QCN9274_INFO5_TID GENMASK(6, 3)697#define RX_MSDU_END_QCN9274_INFO5_FROM_DS BIT(14)698 699#define RX_MSDU_END_INFO6_MSDU_DROP BIT(0)700#define RX_MSDU_END_INFO6_REO_DEST_IND GENMASK(5, 1)701#define RX_MSDU_END_INFO6_FLOW_IDX GENMASK(25, 6)702#define RX_MSDU_END_INFO6_USE_PPE BIT(26)703#define RX_MSDU_END_INFO6_MESH_STA GENMASK(28, 27)704#define RX_MSDU_END_INFO6_VLAN_CTAG_STRIPPED BIT(29)705#define RX_MSDU_END_INFO6_VLAN_STAG_STRIPPED BIT(30)706#define RX_MSDU_END_INFO6_FRAGMENT_FLAG BIT(31)707 708#define RX_MSDU_END_INFO7_AGGR_COUNT GENMASK(7, 0)709#define RX_MSDU_END_INFO7_FLOW_AGGR_CONTN BIT(8)710#define RX_MSDU_END_INFO7_FISA_TIMEOUT BIT(9)711 712#define RX_MSDU_END_QCN9274_INFO7_TCPUDP_CSUM_FAIL_CPY BIT(10)713#define RX_MSDU_END_QCN9274_INFO7_MSDU_LIMIT_ERROR BIT(11)714#define RX_MSDU_END_QCN9274_INFO7_FLOW_IDX_TIMEOUT BIT(12)715#define RX_MSDU_END_QCN9274_INFO7_FLOW_IDX_INVALID BIT(13)716#define RX_MSDU_END_QCN9274_INFO7_CCE_MATCH BIT(14)717#define RX_MSDU_END_QCN9274_INFO7_AMSDU_PARSER_ERR BIT(15)718 719#define RX_MSDU_END_QCN9274_INFO8_KEY_ID GENMASK(7, 0)720 721#define RX_MSDU_END_INFO9_SERVICE_CODE GENMASK(14, 6)722#define RX_MSDU_END_INFO9_PRIORITY_VALID BIT(15)723#define RX_MSDU_END_INFO9_INRA_BSS BIT(16)724#define RX_MSDU_END_INFO9_DEST_CHIP_ID GENMASK(18, 17)725#define RX_MSDU_END_INFO9_MCAST_ECHO BIT(19)726#define RX_MSDU_END_INFO9_WDS_LEARN_EVENT BIT(20)727#define RX_MSDU_END_INFO9_WDS_ROAM_EVENT BIT(21)728#define RX_MSDU_END_INFO9_WDS_KEEP_ALIVE_EVENT BIT(22)729 730#define RX_MSDU_END_INFO10_MSDU_LENGTH GENMASK(13, 0)731#define RX_MSDU_END_INFO10_STBC BIT(14)732#define RX_MSDU_END_INFO10_IPSEC_ESP BIT(15)733#define RX_MSDU_END_INFO10_L3_OFFSET GENMASK(22, 16)734#define RX_MSDU_END_INFO10_IPSEC_AH BIT(23)735#define RX_MSDU_END_INFO10_L4_OFFSET GENMASK(31, 24)736 737#define RX_MSDU_END_INFO11_MSDU_NUMBER GENMASK(7, 0)738#define RX_MSDU_END_INFO11_DECAP_FORMAT GENMASK(9, 8)739#define RX_MSDU_END_INFO11_IPV4 BIT(10)740#define RX_MSDU_END_INFO11_IPV6 BIT(11)741#define RX_MSDU_END_INFO11_TCP BIT(12)742#define RX_MSDU_END_INFO11_UDP BIT(13)743#define RX_MSDU_END_INFO11_IP_FRAG BIT(14)744#define RX_MSDU_END_INFO11_TCP_ONLY_ACK BIT(15)745#define RX_MSDU_END_INFO11_DA_IS_BCAST_MCAST BIT(16)746#define RX_MSDU_END_INFO11_SEL_TOEPLITZ_HASH GENMASK(18, 17)747#define RX_MSDU_END_INFO11_IP_FIXED_HDR_VALID BIT(19)748#define RX_MSDU_END_INFO11_IP_EXTN_HDR_VALID BIT(20)749#define RX_MSDU_END_INFO11_IP_TCP_UDP_HDR_VALID BIT(21)750#define RX_MSDU_END_INFO11_MESH_CTRL_PRESENT BIT(22)751#define RX_MSDU_END_INFO11_LDPC BIT(23)752#define RX_MSDU_END_INFO11_IP4_IP6_NXT_HDR GENMASK(31, 24)753 754#define RX_MSDU_END_INFO12_USER_RSSI GENMASK(7, 0)755#define RX_MSDU_END_INFO12_PKT_TYPE GENMASK(11, 8)756#define RX_MSDU_END_INFO12_SGI GENMASK(13, 12)757#define RX_MSDU_END_INFO12_RATE_MCS GENMASK(17, 14)758#define RX_MSDU_END_INFO12_RECV_BW GENMASK(20, 18)759#define RX_MSDU_END_INFO12_RECEPTION_TYPE GENMASK(23, 21)760 761#define RX_MSDU_END_QCN9274_INFO12_MIMO_SS_BITMAP GENMASK(30, 24)762#define RX_MSDU_END_QCN9274_INFO12_MIMO_DONE_COPY BIT(31)763 764#define RX_MSDU_END_INFO13_FIRST_MPDU BIT(0)765#define RX_MSDU_END_INFO13_MCAST_BCAST BIT(2)766#define RX_MSDU_END_INFO13_AST_IDX_NOT_FOUND BIT(3)767#define RX_MSDU_END_INFO13_AST_IDX_TIMEDOUT BIT(4)768#define RX_MSDU_END_INFO13_POWER_MGMT BIT(5)769#define RX_MSDU_END_INFO13_NON_QOS BIT(6)770#define RX_MSDU_END_INFO13_NULL_DATA BIT(7)771#define RX_MSDU_END_INFO13_MGMT_TYPE BIT(8)772#define RX_MSDU_END_INFO13_CTRL_TYPE BIT(9)773#define RX_MSDU_END_INFO13_MORE_DATA BIT(10)774#define RX_MSDU_END_INFO13_EOSP BIT(11)775#define RX_MSDU_END_INFO13_A_MSDU_ERROR BIT(12)776#define RX_MSDU_END_INFO13_ORDER BIT(14)777#define RX_MSDU_END_INFO13_OVERFLOW_ERR BIT(16)778#define RX_MSDU_END_INFO13_MSDU_LEN_ERR BIT(17)779#define RX_MSDU_END_INFO13_TCP_UDP_CKSUM_FAIL BIT(18)780#define RX_MSDU_END_INFO13_IP_CKSUM_FAIL BIT(19)781#define RX_MSDU_END_INFO13_SA_IDX_INVALID BIT(20)782#define RX_MSDU_END_INFO13_DA_IDX_INVALID BIT(21)783#define RX_MSDU_END_INFO13_AMSDU_ADDR_MISMATCH BIT(22)784#define RX_MSDU_END_INFO13_RX_IN_TX_DECRYPT_BYP BIT(23)785#define RX_MSDU_END_INFO13_ENCRYPT_REQUIRED BIT(24)786#define RX_MSDU_END_INFO13_DIRECTED BIT(25)787#define RX_MSDU_END_INFO13_BUFFER_FRAGMENT BIT(26)788#define RX_MSDU_END_INFO13_MPDU_LEN_ERR BIT(27)789#define RX_MSDU_END_INFO13_TKIP_MIC_ERR BIT(28)790#define RX_MSDU_END_INFO13_DECRYPT_ERR BIT(29)791#define RX_MSDU_END_INFO13_UNDECRYPT_FRAME_ERR BIT(30)792#define RX_MSDU_END_INFO13_FCS_ERR BIT(31)793 794#define RX_MSDU_END_QCN9274_INFO13_WIFI_PARSER_ERR BIT(15)795 796#define RX_MSDU_END_INFO14_DECRYPT_STATUS_CODE GENMASK(12, 10)797#define RX_MSDU_END_INFO14_RX_BITMAP_NOT_UPDED BIT(13)798#define RX_MSDU_END_INFO14_MSDU_DONE BIT(31)799 800struct rx_msdu_end_qcn9274 {801 __le16 info0;802 __le16 phy_ppdu_id;803 __le16 ip_hdr_cksum;804 __le16 info1;805 __le16 info2;806 __le16 cumulative_l3_checksum;807 __le32 rule_indication0;808 __le32 ipv6_options_crc;809 __le16 info3;810 __le16 l3_type;811 __le32 rule_indication1;812 __le32 tcp_seq_num;813 __le32 tcp_ack_num;814 __le16 info4;815 __le16 window_size;816 __le16 sa_sw_peer_id;817 __le16 info5;818 __le16 sa_idx;819 __le16 da_idx_or_sw_peer_id;820 __le32 info6;821 __le32 fse_metadata;822 __le16 cce_metadata;823 __le16 tcp_udp_cksum;824 __le16 info7;825 __le16 cumulative_ip_length;826 __le32 info8;827 __le32 info9;828 __le32 info10;829 __le32 info11;830 __le16 vlan_ctag_ci;831 __le16 vlan_stag_ci;832 __le32 peer_meta_data;833 __le32 info12;834 __le32 flow_id_toeplitz;835 __le32 ppdu_start_timestamp_63_32;836 __le32 phy_meta_data;837 __le32 ppdu_start_timestamp_31_0;838 __le32 toeplitz_hash_2_or_4;839 __le16 res0;840 __le16 sa_15_0;841 __le32 sa_47_16;842 __le32 info13;843 __le32 info14;844} __packed;845 846#define QCN9274_MSDU_END_SELECT_MSDU_END_TAG BIT(0)847#define QCN9274_MSDU_END_SELECT_INFO0_PHY_PPDUID_IP_HDR_CSUM_INFO1 BIT(1)848#define QCN9274_MSDU_END_SELECT_INFO2_CUMULATIVE_CSUM_RULE_IND_0 BIT(2)849#define QCN9274_MSDU_END_SELECT_IPV6_OP_CRC_INFO3_TYPE13 BIT(3)850#define QCN9274_MSDU_END_SELECT_RULE_IND_1_TCP_SEQ_NUM BIT(4)851#define QCN9274_MSDU_END_SELECT_TCP_ACK_NUM_INFO4_WINDOW_SIZE BIT(5)852#define QCN9274_MSDU_END_SELECT_SA_SW_PER_ID_INFO5_SA_DA_ID BIT(6)853#define QCN9274_MSDU_END_SELECT_INFO6_FSE_METADATA BIT(7)854#define QCN9274_MSDU_END_SELECT_CCE_MDATA_TCP_UDP_CSUM_INFO7_IP_LEN BIT(8)855#define QCN9274_MSDU_END_SELECT_INFO8_INFO9 BIT(9)856#define QCN9274_MSDU_END_SELECT_INFO10_INFO11 BIT(10)857#define QCN9274_MSDU_END_SELECT_VLAN_CTAG_STAG_CI_PEER_MDATA BIT(11)858#define QCN9274_MSDU_END_SELECT_INFO12_AND_FLOW_ID_TOEPLITZ BIT(12)859#define QCN9274_MSDU_END_SELECT_PPDU_START_TS_63_32_PHY_MDATA BIT(13)860#define QCN9274_MSDU_END_SELECT_PPDU_START_TS_31_0_TOEPLITZ_HASH_2_4 BIT(14)861#define QCN9274_MSDU_END_SELECT_RES0_SA_47_0 BIT(15)862#define QCN9274_MSDU_END_SELECT_INFO13_INFO14 BIT(16)863 864#define QCN9274_MSDU_END_WMASK (QCN9274_MSDU_END_SELECT_MSDU_END_TAG | \865 QCN9274_MSDU_END_SELECT_SA_SW_PER_ID_INFO5_SA_DA_ID | \866 QCN9274_MSDU_END_SELECT_INFO10_INFO11 | \867 QCN9274_MSDU_END_SELECT_INFO12_AND_FLOW_ID_TOEPLITZ | \868 QCN9274_MSDU_END_SELECT_PPDU_START_TS_63_32_PHY_MDATA | \869 QCN9274_MSDU_END_SELECT_INFO13_INFO14)870 871/* The below rx_msdu_end_qcn9274_compact structure is tied with the mask value872 * QCN9274_MSDU_END_WMASK. If the mask value changes the structure will also873 * change.874 */875 876struct rx_msdu_end_qcn9274_compact {877 __le64 msdu_end_tag;878 __le16 sa_sw_peer_id;879 __le16 info5;880 __le16 sa_idx;881 __le16 da_idx_or_sw_peer_id;882 __le32 info10;883 __le32 info11;884 __le32 info12;885 __le32 flow_id_toeplitz;886 __le32 ppdu_start_timestamp_63_32;887 __le32 phy_meta_data;888 __le32 info13;889 __le32 info14;890} __packed;891 892/* These macro definitions are only used for WCN7850 */893#define RX_MSDU_END_WCN7850_INFO2_KEY_ID BIT(7, 0)894 895#define RX_MSDU_END_WCN7850_INFO5_MSDU_LIMIT_ERR BIT(2)896#define RX_MSDU_END_WCN7850_INFO5_IDX_TIMEOUT BIT(3)897#define RX_MSDU_END_WCN7850_INFO5_IDX_INVALID BIT(4)898#define RX_MSDU_END_WCN7850_INFO5_WIFI_PARSE_ERR BIT(5)899#define RX_MSDU_END_WCN7850_INFO5_AMSDU_PARSER_ERR BIT(6)900#define RX_MSDU_END_WCN7850_INFO5_TCPUDP_CSUM_FAIL_CPY BIT(14)901 902#define RX_MSDU_END_WCN7850_INFO12_MIMO_SS_BITMAP GENMASK(31, 24)903 904#define RX_MSDU_END_WCN7850_INFO13_FRAGMENT_FLAG BIT(13)905#define RX_MSDU_END_WCN7850_INFO13_CCE_MATCH BIT(15)906 907struct rx_msdu_end_wcn7850 {908 __le16 info0;909 __le16 phy_ppdu_id;910 __le16 ip_hdr_cksum;911 __le16 info1;912 __le16 info2;913 __le16 cumulative_l3_checksum;914 __le32 rule_indication0;915 __le32 rule_indication1;916 __le16 info3;917 __le16 l3_type;918 __le32 ipv6_options_crc;919 __le32 tcp_seq_num;920 __le32 tcp_ack_num;921 __le16 info4;922 __le16 window_size;923 __le16 tcp_udp_chksum;924 __le16 info5;925 __le16 sa_idx;926 __le16 da_idx_or_sw_peer_id;927 __le32 info6;928 __le32 fse_metadata;929 __le16 cce_metadata;930 __le16 sa_sw_peer_id;931 __le16 info7;932 __le16 rsvd0;933 __le16 cumulative_l4_checksum;934 __le16 cumulative_ip_length;935 __le32 info9;936 __le32 info10;937 __le32 info11;938 __le32 toeplitz_hash_2_or_4;939 __le32 flow_id_toeplitz;940 __le32 info12;941 __le32 ppdu_start_timestamp_31_0;942 __le32 ppdu_start_timestamp_63_32;943 __le32 phy_meta_data;944 __le16 vlan_ctag_ci;945 __le16 vlan_stag_ci;946 __le32 rsvd[3];947 __le32 info13;948 __le32 info14;949} __packed;950 951/* rx_msdu_end952 *953 * rxpcu_mpdu_filter_in_category954 * Field indicates what the reason was that this mpdu frame955 * was allowed to come into the receive path by rxpcu. Values956 * are defined in enum %RX_DESC_RXPCU_FILTER_*.957 *958 * sw_frame_group_id959 * SW processes frames based on certain classifications. Values960 * are defined in enum %RX_DESC_SW_FRAME_GRP_ID_*.961 *962 * phy_ppdu_id963 * A ppdu counter value that PHY increments for every PPDU964 * received. The counter value wraps around.965 *966 * ip_hdr_cksum967 * This can include the IP header checksum or the pseudo968 * header checksum used by TCP/UDP checksum.969 *970 * reported_mpdu_length971 * MPDU length before decapsulation. Only valid when first_msdu is972 * set. This field is taken directly from the length field of the973 * A-MPDU delimiter or the preamble length field for non-A-MPDU974 * frames.975 *976 * cce_super_rule977 * Indicates the super filter rule.978 *979 * cce_classify_not_done_truncate980 * Classification failed due to truncated frame.981 *982 * cce_classify_not_done_cce_dis983 * Classification failed due to CCE global disable984 *985 * cumulative_l3_checksum986 * FISA: IP header checksum including the total MSDU length987 * that is part of this flow aggregated so far, reported if988 * 'RXOLE_R0_FISA_CTRL. CHKSUM_CUM_IP_LEN_EN' is set989 *990 * rule_indication991 * Bitmap indicating which of rules have matched.992 *993 * ipv6_options_crc994 * 32 bit CRC computed out of IP v6 extension headers.995 *996 * da_offset997 * Offset into MSDU buffer for DA.998 *999 * sa_offset1000 * Offset into MSDU buffer for SA.1001 *1002 * da_offset_valid1003 * da_offset field is valid. This will be set to 0 in case1004 * of a dynamic A-MSDU when DA is compressed.1005 *1006 * sa_offset_valid1007 * sa_offset field is valid. This will be set to 0 in case1008 * of a dynamic A-MSDU when SA is compressed.1009 *1010 * l3_type1011 * The 16-bit type value indicating the type of L3 later1012 * extracted from LLC/SNAP, set to zero if SNAP is not1013 * available.1014 *1015 * tcp_seq_number1016 * TCP sequence number.1017 *1018 * tcp_ack_number1019 * TCP acknowledge number.1020 *1021 * tcp_flag1022 * TCP flags {NS, CWR, ECE, URG, ACK, PSH, RST, SYN, FIN}.1023 *1024 * lro_eligible1025 * Computed out of TCP and IP fields to indicate that this1026 * MSDU is eligible for LRO.1027 *1028 * window_size1029 * TCP receive window size.1030 *1031 * sa_sw_peer_id1032 * sw_peer_id from the address search entry corresponding to the1033 * source address of the MSDU.1034 *1035 * sa_idx_timeout1036 * Indicates an unsuccessful MAC source address search due to the1037 * expiring of the search timer.1038 *1039 * da_idx_timeout1040 * Indicates an unsuccessful MAC destination address search due to1041 * the expiring of the search timer.1042 *1043 * to_ds1044 * Set if the to DS bit is set in the frame control.1045 *1046 * tid1047 * TID field in the QoS control field1048 *1049 * sa_is_valid1050 * Indicates that OLE found a valid SA entry.1051 *1052 * da_is_valid1053 * Indicates that OLE found a valid DA entry.1054 *1055 * da_is_mcbc1056 * Field Only valid if da_is_valid is set. Indicates the DA address1057 * was a Multicast of Broadcast address.1058 *1059 * l3_header_padding1060 * Number of bytes padded to make sure that the L3 header will1061 * always start of a Dword boundary.1062 *1063 * first_msdu1064 * Indicates the first MSDU of A-MSDU. If both first_msdu and1065 * last_msdu are set in the MSDU then this is a non-aggregated MSDU1066 * frame: normal MPDU. Interior MSDU in an A-MSDU shall have both1067 * first_mpdu and last_mpdu bits set to 0.1068 *1069 * last_msdu1070 * Indicates the last MSDU of the A-MSDU. MPDU end status is only1071 * valid when last_msdu is set.1072 *1073 * fr_ds1074 * Set if the from DS bit is set in the frame control.1075 *1076 * ip_chksum_fail_copy1077 * Indicates that the computed checksum did not match the1078 * checksum in the IP header.1079 *1080 * sa_idx1081 * The offset in the address table which matches the MAC source1082 * address.1083 *1084 * da_idx_or_sw_peer_id1085 * Based on a register configuration in RXOLE, this field will1086 * contain:1087 * The offset in the address table which matches the MAC destination1088 * address1089 * OR:1090 * sw_peer_id from the address search entry corresponding to1091 * the destination address of the MSDU1092 *1093 * msdu_drop1094 * REO shall drop this MSDU and not forward it to any other ring.1095 *1096 * The id of the reo exit ring where the msdu frame shall push1097 * after (MPDU level) reordering has finished. Values are defined1098 * in enum %HAL_RX_MSDU_DESC_REO_DEST_IND_.1099 *1100 * flow_idx1101 * Flow table index.1102 *1103 * use_ppe1104 * Indicates to RXDMA to ignore the REO_destination_indication1105 * and use a programmed value corresponding to the REO2PPE1106 * ring1107 *1108 * mesh_sta1109 * When set, this is a Mesh (11s) STA.1110 *1111 * vlan_ctag_stripped1112 * Set by RXOLE if it stripped 4-bytes of C-VLAN Tag from the1113 * packet1114 *1115 * vlan_stag_stripped1116 * Set by RXOLE if it stripped 4-bytes of S-VLAN Tag from the1117 * packet1118 *1119 * fragment_flag1120 * Indicates that this is an 802.11 fragment frame. This is1121 * set when either the more_frag bit is set in the frame control1122 * or the fragment number is not zero. Only set when first_msdu1123 * is set.1124 *1125 * fse_metadata1126 * FSE related meta data.1127 *1128 * cce_metadata1129 * CCE related meta data.1130 *1131 * tcp_udp_chksum1132 * The value of the computed TCP/UDP checksum. A mode bit1133 * selects whether this checksum is the full checksum or the1134 * partial checksum which does not include the pseudo header.1135 *1136 * aggregation_count1137 * Number of MSDU's aggregated so far1138 *1139 * flow_aggregation_continuation1140 * To indicate that this MSDU can be aggregated with1141 * the previous packet with the same flow id1142 *1143 * fisa_timeout1144 * To indicate that the aggregation has restarted for1145 * this flow due to timeout1146 *1147 * tcp_udp_chksum_fail1148 * Indicates that the computed checksum (tcp_udp_chksum) did1149 * not match the checksum in the TCP/UDP header.1150 *1151 * msdu_limit_error1152 * Indicates that the MSDU threshold was exceeded and thus all the1153 * rest of the MSDUs will not be scattered and will not be1154 * decapsulated but will be DMA'ed in RAW format as a single MSDU.1155 *1156 * flow_idx_timeout1157 * Indicates an unsuccessful flow search due to the expiring of1158 * the search timer.1159 *1160 * flow_idx_invalid1161 * flow id is not valid.1162 *1163 * cce_match1164 * Indicates that this status has a corresponding MSDU that1165 * requires FW processing. The OLE will have classification1166 * ring mask registers which will indicate the ring(s) for1167 * packets and descriptors which need FW attention.1168 *1169 * amsdu_parser_error1170 * A-MSDU could not be properly de-agregated.1171 *1172 * cumulative_ip_length1173 * Total MSDU length that is part of this flow aggregated1174 * so far1175 *1176 * key_id1177 * The key ID octet from the IV. Only valid when first_msdu is set.1178 *1179 * service_code1180 * Opaque service code between PPE and Wi-Fi1181 *1182 * priority_valid1183 * This field gets passed on by REO to PPE in the EDMA descriptor1184 *1185 * intra_bss1186 * This packet needs intra-BSS routing by SW as the 'vdev_id'1187 * for the destination is the same as 'vdev_id' (from 'RX_MPDU_PCU_START')1188 * that this MSDU was got in.1189 *1190 * dest_chip_id1191 * If intra_bss is set, copied by RXOLE from 'ADDR_SEARCH_ENTRY'1192 * to support intra-BSS routing with multi-chip multi-link1193 * operation. This indicates into which chip's TCL the packet should be1194 * queueued1195 *1196 * multicast_echo1197 * If set, this packet is a multicast echo, i.e. the DA is1198 * multicast and Rx OLE SA search with mcast_echo_check = 11199 * passed. RXDMA should release such packets to WBM.1200 *1201 * wds_learning_event1202 * If set, this packet has an SA search failure with WDS learning1203 * enabled for the peer. RXOLE should route this TLV to the1204 * RXDMA0 status ring to notify FW.1205 *1206 * wds_roaming_event1207 * If set, this packet's SA 'Sw_peer_id' mismatches the 'Sw_peer_id'1208 * of the peer through which the packet was got, indicating1209 * the SA node has roamed. RXOLE should route this TLV to1210 * the RXDMA0 status ring to notify FW.1211 *1212 * wds_keep_alive_event1213 * If set, the AST timestamp for this packet's SA is older1214 * than the current timestamp by more than a threshold programmed1215 * in RXOLE. RXOLE should route this TLV to the RXDMA0 status1216 * ring to notify FW to keep the AST entry for the SA alive.1217 *1218 * msdu_length1219 * MSDU length in bytes after decapsulation.1220 * This field is still valid for MPDU frames without A-MSDU.1221 * It still represents MSDU length after decapsulation1222 *1223 * stbc1224 * When set, use STBC transmission rates.1225 *1226 * ipsec_esp1227 * Set if IPv4/v6 packet is using IPsec ESP.1228 *1229 * l3_offset1230 * Depending upon mode bit, this field either indicates the1231 * L3 offset in bytes from the start of the RX_HEADER or the IP1232 * offset in bytes from the start of the packet after1233 * decapsulation. The latter is only valid if ipv4_proto or1234 * ipv6_proto is set.1235 *1236 * ipsec_ah1237 * Set if IPv4/v6 packet is using IPsec AH1238 *1239 * l4_offset1240 * Depending upon mode bit, this field either indicates the1241 * L4 offset in bytes from the start of RX_HEADER (only valid1242 * if either ipv4_proto or ipv6_proto is set to 1) or indicates1243 * the offset in bytes to the start of TCP or UDP header from1244 * the start of the IP header after decapsulation (Only valid if1245 * tcp_proto or udp_proto is set). The value 0 indicates that1246 * the offset is longer than 127 bytes.1247 *1248 * msdu_number1249 * Indicates the MSDU number within a MPDU. This value is1250 * reset to zero at the start of each MPDU. If the number of1251 * MSDU exceeds 255 this number will wrap using modulo 256.1252 *1253 * decap_type1254 * Indicates the format after decapsulation. Values are defined in1255 * enum %MPDU_START_DECAP_TYPE_*.1256 *1257 * ipv4_proto1258 * Set if L2 layer indicates IPv4 protocol.1259 *1260 * ipv6_proto1261 * Set if L2 layer indicates IPv6 protocol.1262 *1263 * tcp_proto1264 * Set if the ipv4_proto or ipv6_proto are set and the IP protocol1265 * indicates TCP.1266 *1267 * udp_proto1268 * Set if the ipv4_proto or ipv6_proto are set and the IP protocol1269 * indicates UDP.1270 *1271 * ip_frag1272 * Indicates that either the IP More frag bit is set or IP frag1273 * number is non-zero. If set indicates that this is a fragmented1274 * IP packet.1275 *1276 * tcp_only_ack1277 * Set if only the TCP Ack bit is set in the TCP flags and if1278 * the TCP payload is 0.1279 *1280 * da_is_bcast_mcast1281 * The destination address is broadcast or multicast.1282 *1283 * toeplitz_hash1284 * Actual chosen Hash.1285 * 0 - Toeplitz hash of 2-tuple (IP source address, IP1286 * destination address)1287 * 1 - Toeplitz hash of 4-tuple (IP source address,1288 * IP destination address, L4 (TCP/UDP) source port,1289 * L4 (TCP/UDP) destination port)1290 * 2 - Toeplitz of flow_id1291 * 3 - Zero is used1292 *1293 * ip_fixed_header_valid1294 * Fixed 20-byte IPv4 header or 40-byte IPv6 header parsed1295 * fully within first 256 bytes of the packet1296 *1297 * ip_extn_header_valid1298 * IPv6/IPv6 header, including IPv4 options and1299 * recognizable extension headers parsed fully within first 2561300 * bytes of the packet1301 *1302 * tcp_udp_header_valid1303 * Fixed 20-byte TCP (excluding TCP options) or 8-byte UDP1304 * header parsed fully within first 256 bytes of the packet1305 *1306 * mesh_control_present1307 * When set, this MSDU includes the 'Mesh Control' field1308 *1309 * ldpc1310 *1311 * ip4_protocol_ip6_next_header1312 * For IPv4, this is the 8 bit protocol field set). For IPv6 this1313 * is the 8 bit next_header field.1314 *1315 *1316 * vlan_ctag_ci1317 * 2 bytes of C-VLAN Tag Control Information from WHO_L2_LLC1318 *1319 * vlan_stag_ci1320 * 2 bytes of S-VLAN Tag Control Information from WHO_L2_LLC1321 * in case of double VLAN1322 *1323 * peer_meta_data1324 * Meta data that SW has programmed in the Peer table entry1325 * of the transmitting STA.1326 *1327 * user_rssi1328 * RSSI for this user1329 *1330 * pkt_type1331 * Values are defined in enum %RX_MSDU_START_PKT_TYPE_*.1332 *1333 * sgi1334 * Field only valid when pkt type is HT, VHT or HE. Values are1335 * defined in enum %RX_MSDU_START_SGI_*.1336 *1337 * rate_mcs1338 * MCS Rate used.1339 *1340 * receive_bandwidth1341 * Full receive Bandwidth. Values are defined in enum1342 * %RX_MSDU_START_RECV_*.1343 *1344 * reception_type1345 * Indicates what type of reception this is and defined in enum1346 * %RX_MSDU_START_RECEPTION_TYPE_*.1347 *1348 * mimo_ss_bitmap1349 * Field only valid when1350 * Reception_type is RX_MSDU_START_RECEPTION_TYPE_DL_MU_MIMO or1351 * RX_MSDU_START_RECEPTION_TYPE_DL_MU_OFDMA_MIMO.1352 *1353 * Bitmap, with each bit indicating if the related spatial1354 * stream is used for this STA1355 *1356 * LSB related to SS 01357 *1358 * 0 - spatial stream not used for this reception1359 * 1 - spatial stream used for this reception1360 *1361 * msdu_done_copy1362 * If set indicates that the RX packet data, RX header data,1363 * RX PPDU start descriptor, RX MPDU start/end descriptor,1364 * RX MSDU start/end descriptors and RX Attention descriptor1365 * are all valid. This bit is in the last 64-bit of the descriptor1366 * expected to be subscribed in future hardware.1367 *1368 * flow_id_toeplitz1369 * Toeplitz hash of 5-tuple1370 * {IP source address, IP destination address, IP source port, IP1371 * destination port, L4 protocol} in case of non-IPSec.1372 *1373 * In case of IPSec - Toeplitz hash of 4-tuple1374 * {IP source address, IP destination address, SPI, L4 protocol}1375 *1376 * The relevant Toeplitz key registers are provided in RxOLE's1377 * instance of common parser module. These registers are separate1378 * from the Toeplitz keys used by ASE/FSE modules inside RxOLE.1379 * The actual value will be passed on from common parser module1380 * to RxOLE in one of the WHO_* TLVs.1381 *1382 * ppdu_start_timestamp1383 * Timestamp that indicates when the PPDU that contained this MPDU1384 * started on the medium.1385 *1386 * phy_meta_data1387 * SW programmed Meta data provided by the PHY. Can be used for SW1388 * to indicate the channel the device is on.1389 *1390 * toeplitz_hash_2_or_41391 * Controlled by multiple RxOLE registers for TCP/UDP over1392 * IPv4/IPv6 - Either, Toeplitz hash computed over 2-tuple1393 * IPv4 or IPv6 src/dest addresses is reported; or, Toeplitz1394 * hash computed over 4-tuple IPv4 or IPv6 src/dest addresses1395 * and src/dest ports is reported. The Flow_id_toeplitz hash1396 * can also be reported here. Usually the hash reported here1397 * is the one used for hash-based REO routing (see use_flow_id_toeplitz_clfy1398 * in 'RXPT_CLASSIFY_INFO').1399 *1400 * sa1401 * Source MAC address1402 *1403 * first_mpdu1404 * Indicates the first MSDU of the PPDU. If both first_mpdu1405 * and last_mpdu are set in the MSDU then this is a not an1406 * A-MPDU frame but a stand alone MPDU. Interior MPDU in an1407 * A-MPDU shall have both first_mpdu and last_mpdu bits set to1408 * 0. The PPDU start status will only be valid when this bit1409 * is set.1410 *1411 * mcast_bcast1412 * Multicast / broadcast indicator. Only set when the MAC1413 * address 1 bit 0 is set indicating mcast/bcast and the BSSID1414 * matches one of the 4 BSSID registers. Only set when1415 * first_msdu is set.1416 *1417 * ast_index_not_found1418 * Only valid when first_msdu is set. Indicates no AST matching1419 * entries within the max search count.1420 *1421 * ast_index_timeout1422 * Only valid when first_msdu is set. Indicates an unsuccessful1423 * search in the address search table due to timeout.1424 *1425 * power_mgmt1426 * Power management bit set in the 802.11 header. Only set1427 * when first_msdu is set.1428 *1429 * non_qos1430 * Set if packet is not a non-QoS data frame. Only set when1431 * first_msdu is set.1432 *1433 * null_data1434 * Set if frame type indicates either null data or QoS null1435 * data format. Only set when first_msdu is set.1436 *1437 * mgmt_type1438 * Set if packet is a management packet. Only set when1439 * first_msdu is set.1440 *1441 * ctrl_type1442 * Set if packet is a control packet. Only set when first_msdu1443 * is set.1444 *1445 * more_data1446 * Set if more bit in frame control is set. Only set when1447 * first_msdu is set.1448 *1449 * eosp1450 * Set if the EOSP (end of service period) bit in the QoS1451 * control field is set. Only set when first_msdu is set.1452 *1453 * a_msdu_error1454 * Set if number of MSDUs in A-MSDU is above a threshold or if the1455 * size of the MSDU is invalid. This receive buffer will contain1456 * all of the remainder of MSDUs in this MPDU w/o decapsulation.1457 *1458 * order1459 * Set if the order bit in the frame control is set. Only1460 * set when first_msdu is set.1461 *1462 * wifi_parser_error1463 * Indicates that the WiFi frame has one of the following errors1464 *1465 * overflow_err1466 * RXPCU Receive FIFO ran out of space to receive the full MPDU.1467 * Therefore this MPDU is terminated early and is thus corrupted.1468 *1469 * This MPDU will not be ACKed.1470 *1471 * RXPCU might still be able to correctly receive the following1472 * MPDUs in the PPDU if enough fifo space became available in time.1473 *1474 * mpdu_length_err1475 * Set by RXPCU if the expected MPDU length does not correspond1476 * with the actually received number of bytes in the MPDU.1477 *1478 * tcp_udp_chksum_fail1479 * Indicates that the computed checksum (tcp_udp_chksum) did1480 * not match the checksum in the TCP/UDP header.1481 *1482 * ip_chksum_fail1483 * Indicates that the computed checksum did not match the1484 * checksum in the IP header.1485 *1486 * sa_idx_invalid1487 * Indicates no matching entry was found in the address search1488 * table for the source MAC address.1489 *1490 * da_idx_invalid1491 * Indicates no matching entry was found in the address search1492 * table for the destination MAC address.1493 *1494 * amsdu_addr_mismatch1495 * Indicates that an A-MSDU with 'from DS = 0' had an SA mismatching1496 * TA or an A-MDU with 'to DS = 0' had a DA mismatching RA1497 *1498 * rx_in_tx_decrypt_byp1499 * Indicates that RX packet is not decrypted as Crypto is busy1500 * with TX packet processing.1501 *1502 * encrypt_required1503 * Indicates that this data type frame is not encrypted even if1504 * the policy for this MPDU requires encryption as indicated in1505 * the peer table key type.1506 *1507 * directed1508 * MPDU is a directed packet which means that the RA matched1509 * our STA addresses. In proxySTA it means that the TA matched1510 * an entry in our address search table with the corresponding1511 * 'no_ack' bit is the address search entry cleared.1512 *1513 * buffer_fragment1514 * Indicates that at least one of the rx buffers has been1515 * fragmented. If set the FW should look at the rx_frag_info1516 * descriptor described below.1517 *1518 * mpdu_length_err1519 * Indicates that the MPDU was pre-maturely terminated1520 * resulting in a truncated MPDU. Don't trust the MPDU length1521 * field.1522 *1523 * tkip_mic_err1524 * Indicates that the MPDU Michael integrity check failed1525 *1526 * decrypt_err1527 * Indicates that the MPDU decrypt integrity check failed1528 *1529 * fcs_err1530 * Indicates that the MPDU FCS check failed1531 *1532 * flow_idx_timeout1533 * Indicates an unsuccessful flow search due to the expiring of1534 * the search timer.1535 *1536 * flow_idx_invalid1537 * flow id is not valid.1538 *1539 * decrypt_status_code1540 * Field provides insight into the decryption performed. Values1541 * are defined in enum %RX_DESC_DECRYPT_STATUS_CODE_*.1542 *1543 * rx_bitmap_not_updated1544 * Frame is received, but RXPCU could not update the receive bitmap1545 * due to (temporary) fifo constraints.1546 *1547 * msdu_done1548 * If set indicates that the RX packet data, RX header data, RX1549 * PPDU start descriptor, RX MPDU start/end descriptor, RX MSDU1550 * start/end descriptors and RX Attention descriptor are all1551 * valid. This bit must be in the last octet of the1552 * descriptor.1553 *1554 */1555 1556struct hal_rx_desc_qcn9274 {1557 struct rx_msdu_end_qcn9274 msdu_end;1558 struct rx_mpdu_start_qcn9274 mpdu_start;1559 u8 msdu_payload[];1560} __packed;1561 1562struct hal_rx_desc_qcn9274_compact {1563 struct rx_msdu_end_qcn9274_compact msdu_end;1564 struct rx_mpdu_start_qcn9274_compact mpdu_start;1565 u8 msdu_payload[];1566} __packed;1567 1568#define RX_BE_PADDING0_BYTES 81569#define RX_BE_PADDING1_BYTES 81570 1571#define HAL_RX_BE_PKT_HDR_TLV_LEN 1121572 1573struct rx_pkt_hdr_tlv {1574 __le64 tag;1575 __le64 phy_ppdu_id;1576 u8 rx_pkt_hdr[HAL_RX_BE_PKT_HDR_TLV_LEN];1577};1578 1579struct hal_rx_desc_wcn7850 {1580 __le64 msdu_end_tag;1581 struct rx_msdu_end_wcn7850 msdu_end;1582 u8 rx_padding0[RX_BE_PADDING0_BYTES];1583 __le64 mpdu_start_tag;1584 struct rx_mpdu_start_qcn9274 mpdu_start;1585 struct rx_pkt_hdr_tlv pkt_hdr_tlv;1586 u8 msdu_payload[];1587};1588 1589struct hal_rx_desc {1590 union {1591 struct hal_rx_desc_qcn9274 qcn9274;1592 struct hal_rx_desc_qcn9274_compact qcn9274_compact;1593 struct hal_rx_desc_wcn7850 wcn7850;1594 } u;1595} __packed;1596 1597#define MAX_USER_POS 81598#define MAX_MU_GROUP_ID 641599#define MAX_MU_GROUP_SHOW 161600#define MAX_MU_GROUP_LENGTH (6 * MAX_MU_GROUP_SHOW)1601 1602#define HAL_RX_RU_ALLOC_TYPE_MAX 61603#define RU_26 11604#define RU_52 21605#define RU_106 41606#define RU_242 91607#define RU_484 181608#define RU_996 371609 1610#endif /* ATH12K_RX_DESC_H */1611