diff --git a/dp/wifi3.0/dp_rx_mon.h b/dp/wifi3.0/dp_rx_mon.h index 05034874bb..079c9eba00 100644 --- a/dp/wifi3.0/dp_rx_mon.h +++ b/dp/wifi3.0/dp_rx_mon.h @@ -73,6 +73,17 @@ QDF_STATUS dp_rx_pdev_mon_status_detach(struct dp_pdev *pdev, int mac_id) uint32_t dp_mon_process(struct dp_soc *soc, uint32_t mac_id, uint32_t quota); QDF_STATUS dp_rx_mon_deliver(struct dp_soc *soc, uint32_t mac_id, qdf_nbuf_t head_msdu, qdf_nbuf_t tail_msdu); +/* + * dp_rx_mon_deliver_non_std() - deliver frames for non standard path + * @soc: core txrx main contex + * @mac_id: MAC ID + * + * This function delivers the radio tap and dummy MSDU + * into user layer application for preamble only PPDU. + * + * Return: Operation status + */ +QDF_STATUS dp_rx_mon_deliver_non_std(struct dp_soc *soc, uint32_t mac_id); uint32_t dp_rxdma_err_process(struct dp_soc *soc, uint32_t mac_id, uint32_t quota); diff --git a/dp/wifi3.0/dp_rx_mon_dest.c b/dp/wifi3.0/dp_rx_mon_dest.c index fe198c57c6..3014367217 100644 --- a/dp/wifi3.0/dp_rx_mon_dest.c +++ b/dp/wifi3.0/dp_rx_mon_dest.c @@ -29,6 +29,8 @@ #include "wlan_cfg.h" #include "dp_internal.h" +/* The maxinum buffer length allocated for radio tap */ +#define MAX_MONITOR_HEADER (512) /** * dp_rx_mon_link_desc_return() - Return a MPDU link descriptor to HW * (WBM), following error handling @@ -525,7 +527,6 @@ qdf_nbuf_t dp_rx_mon_restitch_mpdu_from_msdus(struct dp_soc *soc, * status of the now decapped first msdu. Leave enough headroom for * accomodating any radio-tap /prism like PHY header */ -#define MAX_MONITOR_HEADER (512) mpdu_buf = qdf_nbuf_alloc(soc->osdev, MAX_MONITOR_HEADER + mpdu_buf_len, MAX_MONITOR_HEADER, 4, FALSE); @@ -730,6 +731,63 @@ mon_deliver_fail: return QDF_STATUS_E_INVAL; } +/** +* dp_rx_mon_deliver_non_std() +* @soc: core txrx main contex +* @mac_id: MAC ID +* +* This function delivers the radio tap and dummy MSDU +* into user layer application for preamble only PPDU. +* +* Return: QDF_STATUS +*/ +QDF_STATUS dp_rx_mon_deliver_non_std(struct dp_soc *soc, + uint32_t mac_id) +{ + struct dp_pdev *pdev = dp_get_pdev_for_mac_id(soc, mac_id); + ol_txrx_rx_mon_fp osif_rx_mon; + qdf_nbuf_t dummy_msdu; + + /* Sanity checking */ + if ((!pdev->monitor_vdev) || (!pdev->monitor_vdev->osif_rx_mon)) + goto mon_deliver_non_std_fail; + + /* Generate a dummy skb_buff */ + osif_rx_mon = pdev->monitor_vdev->osif_rx_mon; + dummy_msdu = qdf_nbuf_alloc(soc->osdev, MAX_MONITOR_HEADER, + MAX_MONITOR_HEADER, 4, FALSE); + if (!dummy_msdu) + goto allocate_dummy_msdu_fail; + + qdf_nbuf_set_pktlen(dummy_msdu, 0); + qdf_nbuf_set_next(dummy_msdu, NULL); + + pdev->ppdu_info.rx_status.ppdu_id = + pdev->ppdu_info.com_info.ppdu_id; + + /* Apply the radio header to this dummy skb */ + qdf_nbuf_update_radiotap(&pdev->ppdu_info.rx_status, + dummy_msdu, MAX_MONITOR_HEADER); + + /* deliver to the user layer application */ + osif_rx_mon(pdev->monitor_vdev->osif_vdev, + dummy_msdu, NULL); + + /* Clear rx_status*/ + qdf_mem_zero(&pdev->ppdu_info.rx_status, + sizeof(pdev->ppdu_info.rx_status)); + pdev->mon_ppdu_status = DP_PPDU_STATUS_START; + + return QDF_STATUS_SUCCESS; + +allocate_dummy_msdu_fail: + QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_DP, "[%s][%d] mon_skb=%pK ", + __func__, __LINE__, dummy_msdu); + +mon_deliver_non_std_fail: + return QDF_STATUS_E_INVAL; +} + /** * dp_rx_mon_dest_process() - Brain of the Rx processing functionality * Called from the bottom half (tasklet/NET_RX_SOFTIRQ) diff --git a/dp/wifi3.0/dp_rx_mon_status.c b/dp/wifi3.0/dp_rx_mon_status.c index 32569eba8e..73e579fd40 100644 --- a/dp/wifi3.0/dp_rx_mon_status.c +++ b/dp/wifi3.0/dp_rx_mon_status.c @@ -407,7 +407,9 @@ dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id, qdf_nbuf_free(status_nbuf); } - if (tlv_status == HAL_TLV_STATUS_PPDU_DONE) { + if (tlv_status == HAL_TLV_STATUS_PPDU_NON_STD_DONE) { + dp_rx_mon_deliver_non_std(soc, mac_id); + } else if (tlv_status == HAL_TLV_STATUS_PPDU_DONE) { rx_mon_stats->status_ppdu_done++; if (pdev->enhanced_stats_en || pdev->mcopy_mode) diff --git a/hal/wifi3.0/hal_api_mon.h b/hal/wifi3.0/hal_api_mon.h index 0cb1bfc6fb..5eec07bf01 100644 --- a/hal/wifi3.0/hal_api_mon.h +++ b/hal/wifi3.0/hal_api_mon.h @@ -73,6 +73,8 @@ #define HAL_TLV_STATUS_PPDU_NOT_DONE 0 #define HAL_TLV_STATUS_PPDU_DONE 1 #define HAL_TLV_STATUS_BUF_DONE 2 +#define HAL_TLV_STATUS_PPDU_NON_STD_DONE 3 + #define HAL_MAX_UL_MU_USERS 8