diff --git a/dp/wifi3.0/monitor/1.0/dp_mon_filter_1.0.c b/dp/wifi3.0/monitor/1.0/dp_mon_filter_1.0.c index c8633beb4e..e0e30506ee 100644 --- a/dp/wifi3.0/monitor/1.0/dp_mon_filter_1.0.c +++ b/dp/wifi3.0/monitor/1.0/dp_mon_filter_1.0.c @@ -997,3 +997,92 @@ QDF_STATUS dp_mon_filter_update_1_0(struct dp_pdev *pdev) return status; } + +#if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE) +/* + * dp_cfr_filter_1_0() - Configure HOST RX monitor status ring for CFR + * + * @soc_hdl: Datapath soc handle + * @pdev_id: id of data path pdev handle + * @enable: Enable/Disable CFR + * @filter_val: Flag to select Filter for monitor mode + * + * Return: void + */ +static void dp_cfr_filter_1_0(struct cdp_soc_t *soc_hdl, + uint8_t pdev_id, + bool enable, + struct cdp_monitor_filter *filter_val) +{ + struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl); + struct dp_pdev *pdev = NULL; + struct htt_rx_ring_tlv_filter htt_tlv_filter = {0}; + int max_mac_rings; + uint8_t mac_id = 0; + struct dp_mon_pdev *mon_pdev; + + pdev = dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id); + if (!pdev) { + dp_mon_err("pdev is NULL"); + return; + } + + mon_pdev = pdev->monitor_pdev; + + if (mon_pdev->mvdev) { + dp_mon_info("No action is needed since mon mode is enabled\n"); + return; + } + + soc = pdev->soc; + pdev->cfr_rcc_mode = false; + max_mac_rings = wlan_cfg_get_num_mac_rings(pdev->wlan_cfg_ctx); + dp_update_num_mac_rings_for_dbs(soc, &max_mac_rings); + + dp_mon_debug("Max_mac_rings %d", max_mac_rings); + dp_mon_info("enable : %d, mode: 0x%x", enable, filter_val->mode); + + if (enable) { + pdev->cfr_rcc_mode = true; + + htt_tlv_filter.ppdu_start = 1; + htt_tlv_filter.ppdu_end = 1; + htt_tlv_filter.ppdu_end_user_stats = 1; + htt_tlv_filter.ppdu_end_user_stats_ext = 1; + htt_tlv_filter.ppdu_end_status_done = 1; + htt_tlv_filter.mpdu_start = 1; + htt_tlv_filter.offset_valid = false; + + htt_tlv_filter.enable_fp = + (filter_val->mode & MON_FILTER_PASS) ? 1 : 0; + htt_tlv_filter.enable_md = 0; + htt_tlv_filter.enable_mo = + (filter_val->mode & MON_FILTER_OTHER) ? 1 : 0; + htt_tlv_filter.fp_mgmt_filter = filter_val->fp_mgmt; + htt_tlv_filter.fp_ctrl_filter = filter_val->fp_ctrl; + htt_tlv_filter.fp_data_filter = filter_val->fp_data; + htt_tlv_filter.mo_mgmt_filter = filter_val->mo_mgmt; + htt_tlv_filter.mo_ctrl_filter = filter_val->mo_ctrl; + htt_tlv_filter.mo_data_filter = filter_val->mo_data; + } + + for (mac_id = 0; + mac_id < soc->wlan_cfg_ctx->num_rxdma_status_rings_per_pdev; + mac_id++) { + int mac_for_pdev = + dp_get_mac_id_for_pdev(mac_id, pdev->pdev_id); + + htt_h2t_rx_ring_cfg(soc->htt_handle, + mac_for_pdev, + soc->rxdma_mon_status_ring[mac_id].hal_srng, + RXDMA_MONITOR_STATUS, + RX_MON_STATUS_BUF_SIZE, + &htt_tlv_filter); + } +} + +void dp_cfr_filter_register_1_0(struct cdp_ops *ops) +{ + ops->cfr_ops->txrx_cfr_filter = dp_cfr_filter_1_0; +} +#endif diff --git a/dp/wifi3.0/monitor/2.0/dp_mon_filter_2.0.c b/dp/wifi3.0/monitor/2.0/dp_mon_filter_2.0.c index 7571f8371a..f757d6efb8 100644 --- a/dp/wifi3.0/monitor/2.0/dp_mon_filter_2.0.c +++ b/dp/wifi3.0/monitor/2.0/dp_mon_filter_2.0.c @@ -2974,3 +2974,92 @@ dp_mon_filter_setup_tx_lite_mon(struct dp_mon_pdev_be *be_mon_pdev) be_mon_pdev->filter_be[mode][srng_type] = filter; } #endif /* QCA_SUPPORT_LITE_MONITOR */ + +#if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE) +/** + * dp_cfr_filter_2_0() - Configure HOST monitor destination ring for CFR + * + * @soc_hdl: Datapath soc handle + * @pdev_id: id of data path pdev handle + * @enable: Enable/Disable CFR + * @filter_val: Flag to select Filter for monitor mode + * + * Return: void + */ +static void dp_cfr_filter_2_0(struct cdp_soc_t *soc_hdl, + uint8_t pdev_id, + bool enable, + struct cdp_monitor_filter *filter_val) +{ + struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl); + struct dp_pdev *pdev = NULL; + struct htt_rx_ring_tlv_filter htt_tlv_filter = {0}; + int max_mac_rings; + uint8_t mac_id = 0; + struct dp_mon_pdev *mon_pdev; + + pdev = dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id); + if (!pdev) { + dp_mon_err("pdev is NULL"); + return; + } + + mon_pdev = pdev->monitor_pdev; + + if (mon_pdev->mvdev) { + dp_mon_info("No action is needed since mon mode is enabled\n"); + return; + } + + soc = pdev->soc; + pdev->cfr_rcc_mode = false; + max_mac_rings = wlan_cfg_get_num_mac_rings(pdev->wlan_cfg_ctx); + dp_update_num_mac_rings_for_dbs(soc, &max_mac_rings); + + dp_mon_debug("Max_mac_rings %d", max_mac_rings); + dp_mon_info("enable : %d, mode: 0x%x", enable, filter_val->mode); + + if (enable) { + pdev->cfr_rcc_mode = true; + htt_tlv_filter.ppdu_start = 1; + htt_tlv_filter.ppdu_end = 1; + htt_tlv_filter.ppdu_end_user_stats = 1; + htt_tlv_filter.ppdu_end_user_stats_ext = 1; + htt_tlv_filter.ppdu_end_status_done = 1; + htt_tlv_filter.mpdu_start = 1; + htt_tlv_filter.offset_valid = false; + + htt_tlv_filter.enable_fp = + (filter_val->mode & MON_FILTER_PASS) ? 1 : 0; + htt_tlv_filter.enable_md = 0; + htt_tlv_filter.enable_mo = + (filter_val->mode & MON_FILTER_OTHER) ? 1 : 0; + htt_tlv_filter.fp_mgmt_filter = filter_val->fp_mgmt; + htt_tlv_filter.fp_ctrl_filter = filter_val->fp_ctrl; + htt_tlv_filter.fp_data_filter = filter_val->fp_data; + htt_tlv_filter.mo_mgmt_filter = filter_val->mo_mgmt; + htt_tlv_filter.mo_ctrl_filter = filter_val->mo_ctrl; + htt_tlv_filter.mo_data_filter = filter_val->mo_data; + } + + for (mac_id = 0; + mac_id < soc->wlan_cfg_ctx->num_rxdma_dst_rings_per_pdev; + mac_id++) { + int mac_for_pdev = + dp_get_mac_id_for_pdev(mac_id, pdev->pdev_id); + + if (soc->wlan_cfg_ctx->rxdma1_enable) { + htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev, + soc->rxdma_mon_dst_ring[mac_id] + .hal_srng, RXDMA_MONITOR_DST, + RX_DATA_BUFFER_SIZE, + &htt_tlv_filter); + } + } +} + +void dp_cfr_filter_register_2_0(struct cdp_ops *ops) +{ + ops->cfr_ops->txrx_cfr_filter = dp_cfr_filter_2_0; +} +#endif diff --git a/dp/wifi3.0/monitor/dp_mon.c b/dp/wifi3.0/monitor/dp_mon.c index 66f46a8252..3ec57f466e 100644 --- a/dp/wifi3.0/monitor/dp_mon.c +++ b/dp/wifi3.0/monitor/dp_mon.c @@ -1534,88 +1534,6 @@ dp_config_for_nac_rssi(struct cdp_soc_t *cdp_soc, } #endif -#if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE) -/* - * dp_cfr_filter() - Configure HOST RX monitor status ring for CFR - * @soc_hdl: Datapath soc handle - * @pdev_id: id of data path pdev handle - * @enable: Enable/Disable CFR - * @filter_val: Flag to select Filter for monitor mode - */ -static void dp_cfr_filter(struct cdp_soc_t *soc_hdl, - uint8_t pdev_id, - bool enable, - struct cdp_monitor_filter *filter_val) -{ - struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl); - struct dp_pdev *pdev = NULL; - struct htt_rx_ring_tlv_filter htt_tlv_filter = {0}; - int max_mac_rings; - uint8_t mac_id = 0; - struct dp_mon_pdev *mon_pdev; - - pdev = dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id); - if (!pdev) { - dp_mon_err("pdev is NULL"); - return; - } - - mon_pdev = pdev->monitor_pdev; - - if (mon_pdev->mvdev) { - dp_mon_info("No action is needed since mon mode is enabled\n"); - return; - } - soc = pdev->soc; - pdev->cfr_rcc_mode = false; - max_mac_rings = wlan_cfg_get_num_mac_rings(pdev->wlan_cfg_ctx); - dp_update_num_mac_rings_for_dbs(soc, &max_mac_rings); - - dp_mon_debug("Max_mac_rings %d", max_mac_rings); - dp_mon_info("enable : %d, mode: 0x%x", enable, filter_val->mode); - - if (enable) { - pdev->cfr_rcc_mode = true; - - htt_tlv_filter.ppdu_start = 1; - htt_tlv_filter.ppdu_end = 1; - htt_tlv_filter.ppdu_end_user_stats = 1; - htt_tlv_filter.ppdu_end_user_stats_ext = 1; - htt_tlv_filter.ppdu_end_status_done = 1; - htt_tlv_filter.mpdu_start = 1; - htt_tlv_filter.offset_valid = false; - - htt_tlv_filter.enable_fp = - (filter_val->mode & MON_FILTER_PASS) ? 1 : 0; - htt_tlv_filter.enable_md = 0; - htt_tlv_filter.enable_mo = - (filter_val->mode & MON_FILTER_OTHER) ? 1 : 0; - htt_tlv_filter.fp_mgmt_filter = filter_val->fp_mgmt; - htt_tlv_filter.fp_ctrl_filter = filter_val->fp_ctrl; - htt_tlv_filter.fp_data_filter = filter_val->fp_data; - htt_tlv_filter.mo_mgmt_filter = filter_val->mo_mgmt; - htt_tlv_filter.mo_ctrl_filter = filter_val->mo_ctrl; - htt_tlv_filter.mo_data_filter = filter_val->mo_data; - } - - for (mac_id = 0; - mac_id < soc->wlan_cfg_ctx->num_rxdma_status_rings_per_pdev; - mac_id++) { - int mac_for_pdev = - dp_get_mac_id_for_pdev(mac_id, - pdev->pdev_id); - - htt_h2t_rx_ring_cfg(soc->htt_handle, - mac_for_pdev, - soc->rxdma_mon_status_ring[mac_id] - .hal_srng, - RXDMA_MONITOR_STATUS, - RX_MON_STATUS_BUF_SIZE, - &htt_tlv_filter); - } -} -#endif - bool dp_enable_mon_reap_timer(struct cdp_soc_t *soc_hdl, enum cdp_mon_reap_source source, @@ -5658,6 +5576,9 @@ void dp_mon_cdp_ops_register(struct dp_soc *soc) ops->ctrl_ops->txrx_update_filter_neighbour_peers = dp_update_filter_neighbour_peers; #endif /* ATH_SUPPORT_NAC_RSSI || ATH_SUPPORT_NAC */ +#if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE) + dp_cfr_filter_register_1_0(ops); +#endif break; case TARGET_TYPE_QCN9224: #ifdef QCA_MONITOR_2_0_SUPPORT @@ -5672,7 +5593,10 @@ void dp_mon_cdp_ops_register(struct dp_soc *soc) ops->ctrl_ops->txrx_update_filter_neighbour_peers = dp_lite_mon_config_nac_peer; #endif /* ATH_SUPPORT_NAC_RSSI || ATH_SUPPORT_NAC */ +#if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE) + dp_cfr_filter_register_2_0(ops); #endif +#endif /* QCA_MONITOR_2_0_SUPPORT */ break; default: dp_mon_err("%s: Unknown tgt type %d", __func__, target_type); @@ -5680,9 +5604,6 @@ void dp_mon_cdp_ops_register(struct dp_soc *soc) break; } -#if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE) - ops->cfr_ops->txrx_cfr_filter = dp_cfr_filter; -#endif ops->cmn_drv_ops->txrx_set_monitor_mode = dp_vdev_set_monitor_mode; ops->cmn_drv_ops->txrx_get_mon_vdev_from_pdev = dp_get_mon_vdev_from_pdev_wifi3; diff --git a/dp/wifi3.0/monitor/dp_mon.h b/dp/wifi3.0/monitor/dp_mon.h index 5bc2bf37c1..8ee8d82d03 100644 --- a/dp/wifi3.0/monitor/dp_mon.h +++ b/dp/wifi3.0/monitor/dp_mon.h @@ -3966,6 +3966,16 @@ void dp_mon_ops_register_1_0(struct dp_mon_soc *mon_soc); */ void dp_mon_cdp_ops_register_1_0(struct cdp_ops *ops); +#if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE) +/** + * dp_cfr_filter_register_1_0(): register cfr filter setting API + * @ops: cdp ops handle + * + * return: void + */ +void dp_cfr_filter_register_1_0(struct cdp_ops *ops); +#endif + #ifdef QCA_MONITOR_2_0_SUPPORT /** * dp_mon_ops_register_2_0(): register monitor ops @@ -3982,6 +3992,16 @@ void dp_mon_ops_register_2_0(struct dp_mon_soc *mon_soc); * return: void */ void dp_mon_cdp_ops_register_2_0(struct cdp_ops *ops); + +#if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE) +/** + * dp_cfr_filter_register_2_0(): register cfr filter setting API + * @ops: cdp ops handle + * + * return: void + */ +void dp_cfr_filter_register_2_0(struct cdp_ops *ops); +#endif #endif /* QCA_MONITOR_2_0_SUPPORT */ /**