diff --git a/dp/inc/cdp_txrx_stats_struct.h b/dp/inc/cdp_txrx_stats_struct.h index 1d9f2fe22d..a6c1a13177 100644 --- a/dp/inc/cdp_txrx_stats_struct.h +++ b/dp/inc/cdp_txrx_stats_struct.h @@ -1190,7 +1190,6 @@ struct cdp_htt_rx_pdev_stats { * protocol types */ #define RX_PROTOCOL_TAG_ALL 0xff - #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */ /* struct cdp_pdev_stats - pdev stats diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 30586bcd13..25418a9f4b 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -82,11 +82,11 @@ extern int con_mode_monitor; * Return: QDF_STATUS */ static QDF_STATUS -dp_config_enh_rx_capture(struct cdp_pdev *pdev_handle, int val) +dp_config_enh_rx_capture(struct cdp_pdev *pdev_handle, uint8_t val) { return QDF_STATUS_E_INVAL; } -#endif +#endif /* WLAN_RX_PKT_CAPTURE_ENH */ #ifdef WLAN_TX_PKT_CAPTURE_ENH #include "dp_tx_capture.h" @@ -6053,6 +6053,9 @@ QDF_STATUS dp_pdev_configure_monitor_rings(struct dp_pdev *pdev) CDP_RX_ENH_CAPTURE_MPDU_MSDU) { htt_tlv_filter.header_per_msdu = 1; htt_tlv_filter.enable_mo = 0; + if (pdev->is_rx_protocol_tagging_enabled || + pdev->is_rx_enh_capture_trailer_enabled) + htt_tlv_filter.msdu_end = 1; } } diff --git a/dp/wifi3.0/dp_rx_mon_status.c b/dp/wifi3.0/dp_rx_mon_status.c index 1ecb0841cb..f00306ffc8 100644 --- a/dp/wifi3.0/dp_rx_mon_status.c +++ b/dp/wifi3.0/dp_rx_mon_status.c @@ -46,8 +46,7 @@ static void dp_rx_mon_enh_capture_process(struct dp_pdev *pdev, uint32_t tlv_status, qdf_nbuf_t status_nbuf, struct hal_rx_ppdu_info *ppdu_info, - bool *nbuf_used, - uint32_t rx_enh_capture_mode) + bool *nbuf_used) { } #endif @@ -589,7 +588,7 @@ dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id, dp_rx_mon_enh_capture_process(pdev, tlv_status, status_nbuf, ppdu_info, - &nbuf_used, rx_enh_capture_mode); + &nbuf_used); rx_tlv = hal_rx_status_get_next_tlv(rx_tlv); @@ -598,7 +597,8 @@ dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id, } while ((tlv_status == HAL_TLV_STATUS_PPDU_NOT_DONE) || (tlv_status == HAL_TLV_STATUS_HEADER) || - (tlv_status == HAL_TLV_STATUS_MPDU_END)); + (tlv_status == HAL_TLV_STATUS_MPDU_END) || + (tlv_status == HAL_TLV_STATUS_MSDU_END)); } if (pdev->dp_peer_based_pktlog) { dp_rx_process_peer_based_pktlog(soc, ppdu_info, diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index b1cdfa33d6..32037e9fa5 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -1269,6 +1269,25 @@ struct dp_pdev_tx_capture { struct dp_peer_tx_capture { }; #endif +#ifdef WLAN_RX_PKT_CAPTURE_ENH +/* Template data to be set for Enhanced RX Monitor packets */ +#define RX_MON_CAP_ENH_TRAILER 0xdeadc0dedeadda7a + +/** + * struct dp_rx_mon_enh_trailer_data - Data structure to set a known pattern + * at end of each MSDU in monitor-lite mode + * @reserved1: reserved for future use + * @reserved2: reserved for future use + * @reserved3: reserved for future use + * @protocol_tag: protocol tag value read from skb->cb + */ +struct dp_rx_mon_enh_trailer_data { + uint16_t reserved1; + uint16_t reserved2; + uint16_t reserved3; + uint16_t protocol_tag; +}; +#endif /* WLAN_RX_PKT_CAPTURE_ENH */ /* PDEV level structure for data path */ struct dp_pdev { @@ -1441,7 +1460,9 @@ struct dp_pdev { /* per user 128 bytes msdu header list for MPDU */ struct msdu_list msdu_list[MAX_MU_USERS]; /* RX enhanced capture mode */ - uint32_t rx_enh_capture_mode; + uint8_t rx_enh_capture_mode; + /* RX enhanced capture trailer enable/disable flag */ + bool is_rx_enh_capture_trailer_enabled; #ifdef WLAN_RX_PKT_CAPTURE_ENH /* RX per MPDU/PPDU information */ struct cdp_rx_indication_mpdu mpdu_ind[MAX_MU_USERS]; @@ -1567,13 +1588,14 @@ struct dp_pdev { /* unique cookie required for peer session */ uint32_t next_peer_cookie; -#ifdef WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG + /* * Run time enabled when the first protocol tag is added, * run time disabled when the last protocol tag is deleted */ bool is_rx_protocol_tagging_enabled; +#ifdef WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG /* * The protocol type is used as array index to save * user provided tag info diff --git a/hal/wifi3.0/hal_api_mon.h b/hal/wifi3.0/hal_api_mon.h index 34fe236ec0..9103832898 100644 --- a/hal/wifi3.0/hal_api_mon.h +++ b/hal/wifi3.0/hal_api_mon.h @@ -405,17 +405,27 @@ struct hal_rx_msdu_payload_info { /** * struct hal_rx_nac_info - struct for neighbour info * @fc_valid: flag indicate if it has valid frame control information + * @frame_control: frame control from each MPDU * @to_ds_flag: flag indicate to_ds bit * @mac_addr2_valid: flag indicate if mac_addr2 is valid * @mac_addr2: mac address2 in wh */ struct hal_rx_nac_info { uint8_t fc_valid; + uint16_t frame_control; uint8_t to_ds_flag; uint8_t mac_addr2_valid; uint8_t mac_addr2[QDF_MAC_ADDR_SIZE]; }; +/** + * struct hal_rx_ppdu_msdu_info - struct for msdu info from HW TLVs + * @cce_metadata: cached metadata value received in the MSDU_END TLV + */ +struct hal_rx_ppdu_msdu_info { + uint16_t cce_metadata; +}; + struct hal_rx_ppdu_info { struct hal_rx_ppdu_common_info com_info; struct mon_rx_status rx_status; @@ -432,6 +442,7 @@ struct hal_rx_ppdu_info { uint32_t hdr_len; /* MPDU FCS error */ bool fcs_err; + struct hal_rx_ppdu_msdu_info rx_msdu_info[HAL_MAX_UL_MU_USERS]; }; static inline uint32_t diff --git a/hal/wifi3.0/hal_generic_api.h b/hal/wifi3.0/hal_generic_api.h index 86ac0523c9..531bf16667 100644 --- a/hal/wifi3.0/hal_generic_api.h +++ b/hal/wifi3.0/hal_generic_api.h @@ -1183,6 +1183,11 @@ hal_rx_status_get_tlv_info_generic(void *rx_tlv_hdr, void *ppduinfo, RX_MPDU_INFO_2, TO_DS); + ppdu_info->nac_info.frame_control = + HAL_RX_GET(rx_mpdu_start, + RX_MPDU_INFO_14, + MPDU_FRAME_CONTROL_FIELD); + ppdu_info->nac_info.mac_addr2_valid = HAL_RX_GET(rx_mpdu_start, RX_MPDU_INFO_2, @@ -1225,6 +1230,10 @@ hal_rx_status_get_tlv_info_generic(void *rx_tlv_hdr, void *ppduinfo, HAL_RX_GET(rx_tlv, RX_MPDU_END_1, FCS_ERR); return HAL_TLV_STATUS_MPDU_END; + case WIFIRX_MSDU_END_E: + ppdu_info->rx_msdu_info[user_id].cce_metadata = + HAL_RX_MSDU_END_CCE_METADATA_GET(rx_tlv); + return HAL_TLV_STATUS_MSDU_END; case 0: return HAL_TLV_STATUS_PPDU_DONE;