diff --git a/dp/inc/cdp_txrx_cmn.h b/dp/inc/cdp_txrx_cmn.h index 1532a65c9aa8..370c15c4c38a 100644 --- a/dp/inc/cdp_txrx_cmn.h +++ b/dp/inc/cdp_txrx_cmn.h @@ -40,19 +40,19 @@ #define dp_info(params...) QDF_TRACE_INFO(QDF_MODULE_ID_DP, params) #define dp_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_DP, params) -static inline int +static inline QDF_STATUS cdp_soc_attach_target(ol_txrx_soc_handle soc) { if (!soc || !soc->ops) { QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, "%s: Invalid Instance:", __func__); QDF_BUG(0); - return 0; + return QDF_STATUS_E_INVAL; } if (!soc->ops->cmn_drv_ops || !soc->ops->cmn_drv_ops->txrx_soc_attach_target) - return 0; + return QDF_STATUS_SUCCESS; return soc->ops->cmn_drv_ops->txrx_soc_attach_target(soc); diff --git a/dp/inc/cdp_txrx_mon.h b/dp/inc/cdp_txrx_mon.h index d78cbeba0267..3595cc2abe5a 100644 --- a/dp/inc/cdp_txrx_mon.h +++ b/dp/inc/cdp_txrx_mon.h @@ -133,7 +133,7 @@ static inline bool cdp_monitor_get_filter_non_data (vdev_txrx_handle); } -static inline int cdp_reset_monitor_mode +static inline QDF_STATUS cdp_reset_monitor_mode (ol_txrx_soc_handle soc, struct cdp_pdev *pdev) { if (!soc || !soc->ops) { diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index 3c93ea0f3269..264af2015124 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -61,7 +61,7 @@ enum cdp_nac_param_cmd { struct cdp_cmn_ops { - int (*txrx_soc_attach_target)(ol_txrx_soc_handle soc); + QDF_STATUS (*txrx_soc_attach_target)(ol_txrx_soc_handle soc); int (*txrx_pdev_attach_target)(struct cdp_pdev *pdev); @@ -147,8 +147,8 @@ struct cdp_cmn_ops { void (*txrx_peer_delete)(void *peer, uint32_t bitmap); - int (*txrx_set_monitor_mode)(struct cdp_vdev *vdev, - uint8_t smart_monitor); + QDF_STATUS (*txrx_set_monitor_mode)(struct cdp_vdev *vdev, + uint8_t smart_monitor); uint8_t (*txrx_get_pdev_id_frm_pdev)(struct cdp_pdev *pdev); @@ -607,10 +607,10 @@ struct cdp_mon_ops { (struct cdp_vdev *vdev_txrx_handle); bool (*txrx_monitor_get_filter_non_data) (struct cdp_vdev *vdev_txrx_handle); - int (*txrx_reset_monitor_mode)(struct cdp_pdev *pdev); + QDF_STATUS (*txrx_reset_monitor_mode)(struct cdp_pdev *pdev); /* HK advance monitor filter support */ - int (*txrx_set_advance_monitor_filter) + QDF_STATUS (*txrx_set_advance_monitor_filter) (struct cdp_pdev *pdev, struct cdp_monitor_filter *filter_val); }; diff --git a/dp/wifi3.0/dp_htt.c b/dp/wifi3.0/dp_htt.c index 84b4c01f33f5..bccaa09f4ac5 100644 --- a/dp/wifi3.0/dp_htt.c +++ b/dp/wifi3.0/dp_htt.c @@ -795,13 +795,8 @@ int htt_h2t_rx_ring_cfg(void *htt_soc, int pdev_id, void *hal_srng, switch (hal_ring_type) { case RXDMA_BUF: -#if QCA_HOST2FW_RXBUF_RING - htt_ring_id = HTT_HOST1_TO_FW_RXBUF_RING; - htt_ring_type = HTT_SW_TO_SW_RING; -#else htt_ring_id = HTT_RXDMA_HOST_BUF_RING; htt_ring_type = HTT_SW_TO_HW_RING; -#endif break; case RXDMA_MONITOR_BUF: htt_ring_id = HTT_RXDMA_MONITOR_BUF_RING; diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 9e27824afb93..df31a3a7affd 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -54,10 +54,9 @@ cdp_dump_flow_pool_info(struct cdp_soc_t *soc) } #endif #include "dp_ipa.h" - #include "dp_cal_client_api.h" - #ifdef CONFIG_MCL +extern int con_mode_monitor; #ifndef REMOVE_PKT_LOG #include #include @@ -1215,6 +1214,7 @@ static uint32_t dp_service_srngs(void *dp_ctx, uint32_t dp_budget) remaining_quota = budget; } } + for (ring = 0; ring < MAX_RX_MAC_RINGS; ring++) { work_done = dp_rxdma_err_process(soc, ring, remaining_quota); @@ -1299,14 +1299,14 @@ static void dp_interrupt_timer(void *arg) } /* - * dp_soc_interrupt_attach_poll() - Register handlers for DP interrupts + * dp_soc_attach_poll() - Register handlers for DP interrupts * @txrx_soc: DP SOC handle * * Host driver will register for “DP_NUM_INTERRUPT_CONTEXTS” number of NAPI * contexts. Each NAPI context will have a tx_ring_mask , rx_ring_mask ,and * rx_monitor_ring mask to indicate the rings that are processed by the handler. * - * Return: 0 for success. nonzero for failure. + * Return: 0 for success, nonzero for failure. */ static QDF_STATUS dp_soc_attach_poll(void *txrx_soc) { @@ -1344,7 +1344,6 @@ static QDF_STATUS dp_soc_attach_poll(void *txrx_soc) static QDF_STATUS dp_soc_interrupt_attach(void *txrx_soc); #if defined(CONFIG_MCL) -extern int con_mode_monitor; /* * dp_soc_interrupt_attach_wrapper() - Register handlers for DP interrupts * @txrx_soc: DP SOC handle @@ -2756,7 +2755,14 @@ static void dp_cleanup_ipa_rx_refill_buf_ring(struct dp_soc *soc, } #endif -#if !defined(QCA_WIFI_QCA6390) && !defined(DISABLE_MON_CONFIG) +#if !defined(DISABLE_MON_CONFIG) +/** + * dp_mon_rings_setup() - Initialize Monitor rings based on target + * @soc: soc handle + * @pdev: physical device handle + * + * Return: nonzero on failure and zero on success + */ static QDF_STATUS dp_mon_rings_setup(struct dp_soc *soc, struct dp_pdev *pdev) { @@ -2770,46 +2776,74 @@ QDF_STATUS dp_mon_rings_setup(struct dp_soc *soc, struct dp_pdev *pdev) for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) { int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev_id); - entries = wlan_cfg_get_dma_mon_buf_ring_size(pdev_cfg_ctx); - if (dp_srng_setup(soc, &pdev->rxdma_mon_buf_ring[mac_id], - RXDMA_MONITOR_BUF, 0, mac_for_pdev, - entries)) { - QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, - FL(RNG_ERR "rxdma_mon_buf_ring ")); - return QDF_STATUS_E_NOMEM; - } + if (soc->wlan_cfg_ctx->rxdma1_enable) { + entries = + wlan_cfg_get_dma_mon_buf_ring_size(pdev_cfg_ctx); + if (dp_srng_setup(soc, + &pdev->rxdma_mon_buf_ring[mac_id], + RXDMA_MONITOR_BUF, 0, mac_for_pdev, + entries)) { + QDF_TRACE(QDF_MODULE_ID_DP, + QDF_TRACE_LEVEL_ERROR, + FL(RNG_ERR "rxdma_mon_buf_ring ")); + return QDF_STATUS_E_NOMEM; + } - entries = wlan_cfg_get_dma_mon_dest_ring_size(pdev_cfg_ctx); - if (dp_srng_setup(soc, &pdev->rxdma_mon_dst_ring[mac_id], - RXDMA_MONITOR_DST, 0, mac_for_pdev, - entries)) { - QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, - FL(RNG_ERR "rxdma_mon_dst_ring")); - return QDF_STATUS_E_NOMEM; - } + entries = + wlan_cfg_get_dma_mon_dest_ring_size(pdev_cfg_ctx); + if (dp_srng_setup(soc, + &pdev->rxdma_mon_dst_ring[mac_id], + RXDMA_MONITOR_DST, 0, mac_for_pdev, + entries)) { + QDF_TRACE(QDF_MODULE_ID_DP, + QDF_TRACE_LEVEL_ERROR, + FL(RNG_ERR "rxdma_mon_dst_ring")); + return QDF_STATUS_E_NOMEM; + } - entries = wlan_cfg_get_dma_mon_stat_ring_size(pdev_cfg_ctx); - if (dp_srng_setup(soc, &pdev->rxdma_mon_status_ring[mac_id], - RXDMA_MONITOR_STATUS, 0, mac_for_pdev, - entries)) { - QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, - FL(RNG_ERR "rxdma_mon_status_ring")); - return QDF_STATUS_E_NOMEM; - } + entries = + wlan_cfg_get_dma_mon_stat_ring_size(pdev_cfg_ctx); + if (dp_srng_setup(soc, + &pdev->rxdma_mon_status_ring[mac_id], + RXDMA_MONITOR_STATUS, 0, mac_for_pdev, + entries)) { + QDF_TRACE(QDF_MODULE_ID_DP, + QDF_TRACE_LEVEL_ERROR, + FL(RNG_ERR "rxdma_mon_status_ring")); + return QDF_STATUS_E_NOMEM; + } - entries = wlan_cfg_get_dma_mon_desc_ring_size(pdev_cfg_ctx); - if (dp_srng_setup(soc, &pdev->rxdma_mon_desc_ring[mac_id], - RXDMA_MONITOR_DESC, 0, mac_for_pdev, - entries)) { - QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, - FL(RNG_ERR "rxdma_mon_desc_ring")); - return QDF_STATUS_E_NOMEM; + entries = + wlan_cfg_get_dma_mon_desc_ring_size(pdev_cfg_ctx); + if (dp_srng_setup(soc, + &pdev->rxdma_mon_desc_ring[mac_id], + RXDMA_MONITOR_DESC, 0, mac_for_pdev, + entries)) { + QDF_TRACE(QDF_MODULE_ID_DP, + QDF_TRACE_LEVEL_ERROR, + FL(RNG_ERR "rxdma_mon_desc_ring")); + return QDF_STATUS_E_NOMEM; + } + } else { + entries = + wlan_cfg_get_dma_mon_stat_ring_size(pdev_cfg_ctx); + if (dp_srng_setup(soc, + &pdev->rxdma_mon_status_ring[mac_id], + RXDMA_MONITOR_STATUS, 0, mac_for_pdev, + entries)) { + QDF_TRACE(QDF_MODULE_ID_DP, + QDF_TRACE_LEVEL_ERROR, + FL(RNG_ERR "rxdma_mon_status_ring")); + return QDF_STATUS_E_NOMEM; + } } } + return QDF_STATUS_SUCCESS; } #else -static QDF_STATUS dp_mon_rings_setup(struct dp_soc *soc, struct dp_pdev *pdev) +static +QDF_STATUS dp_mon_rings_setup(struct dp_soc *soc, struct dp_pdev *pdev) { return QDF_STATUS_SUCCESS; } @@ -3003,9 +3037,10 @@ static struct cdp_pdev *dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc, /* Rx specific init */ if (dp_rx_pdev_attach(pdev)) { QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, - FL("dp_rx_pdev_attach failed")); - goto fail0; + FL("dp_rx_pdev_attach failed")); + goto fail1; } + DP_STATS_INIT(pdev); /* Monitor filter init */ @@ -3024,7 +3059,7 @@ static struct cdp_pdev *dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc, /* Rx monitor mode specific init */ if (dp_rx_pdev_mon_attach(pdev)) { QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, - "dp_rx_pdev_attach failed"); + "dp_rx_pdev_mon_attach failed"); goto fail1; } @@ -3135,23 +3170,50 @@ static void dp_htt_ppdu_stats_detach(struct dp_pdev *pdev) } } -#if !defined(QCA_WIFI_QCA6390) && !defined(DISABLE_MON_CONFIG) +#if !defined(DISABLE_MON_CONFIG) +/** + * dp_mon_ring_deinit() - Cleanup Monitor rings + * + * @soc: soc handle + * @pdev: datapath physical dev handle + * @mac_id: mac number + * + * Return: None + */ static void dp_mon_ring_deinit(struct dp_soc *soc, struct dp_pdev *pdev, int mac_id) { - dp_srng_cleanup(soc, &pdev->rxdma_mon_buf_ring[mac_id], - RXDMA_MONITOR_BUF, 0); - dp_srng_cleanup(soc, &pdev->rxdma_mon_dst_ring[mac_id], - RXDMA_MONITOR_DST, 0); + if (soc->wlan_cfg_ctx->rxdma1_enable) { + dp_srng_cleanup(soc, + &pdev->rxdma_mon_buf_ring[mac_id], + RXDMA_MONITOR_BUF, 0); - dp_srng_cleanup(soc, &pdev->rxdma_mon_status_ring[mac_id], - RXDMA_MONITOR_STATUS, 0); + dp_srng_cleanup(soc, + &pdev->rxdma_mon_dst_ring[mac_id], + RXDMA_MONITOR_DST, 0); + + dp_srng_cleanup(soc, + &pdev->rxdma_mon_status_ring[mac_id], + RXDMA_MONITOR_STATUS, 0); + + dp_srng_cleanup(soc, + &pdev->rxdma_mon_desc_ring[mac_id], + RXDMA_MONITOR_DESC, 0); + + dp_srng_cleanup(soc, + &pdev->rxdma_err_dst_ring[mac_id], + RXDMA_DST, 0); + } else { + dp_srng_cleanup(soc, + &pdev->rxdma_mon_status_ring[mac_id], + RXDMA_MONITOR_STATUS, 0); + + dp_srng_cleanup(soc, + &pdev->rxdma_err_dst_ring[mac_id], + RXDMA_DST, 0); + } - dp_srng_cleanup(soc, &pdev->rxdma_mon_desc_ring[mac_id], - RXDMA_MONITOR_DESC, 0); - dp_srng_cleanup(soc, &pdev->rxdma_err_dst_ring[mac_id], - RXDMA_DST, 0); } #else static void dp_mon_ring_deinit(struct dp_soc *soc, struct dp_pdev *pdev, @@ -3354,36 +3416,88 @@ static void dp_soc_detach_wifi3(void *txrx_soc) qdf_mem_free(soc); } -#if !defined(QCA_WIFI_QCA6390) && !defined(DISABLE_MON_CONFIG) -static void dp_mon_htt_srng_setup(struct dp_soc *soc, - struct dp_pdev *pdev, - int mac_id, - int mac_for_pdev) +#if !defined(DISABLE_MON_CONFIG) +/** + * dp_mon_htt_srng_setup() - Prepare HTT messages for Monitor rings + * @soc: soc handle + * @pdev: physical device handle + * @mac_id: ring number + * @mac_for_pdev: mac_id + * + * Return: non-zero for failure, zero for success + */ +static QDF_STATUS dp_mon_htt_srng_setup(struct dp_soc *soc, + struct dp_pdev *pdev, + int mac_id, + int mac_for_pdev) { - htt_srng_setup(soc->htt_handle, mac_for_pdev, - pdev->rxdma_mon_buf_ring[mac_id].hal_srng, - RXDMA_MONITOR_BUF); + QDF_STATUS status = QDF_STATUS_SUCCESS; - htt_srng_setup(soc->htt_handle, mac_for_pdev, - pdev->rxdma_mon_dst_ring[mac_id].hal_srng, - RXDMA_MONITOR_DST); + if (soc->wlan_cfg_ctx->rxdma1_enable) { + status = htt_srng_setup(soc->htt_handle, mac_for_pdev, + pdev->rxdma_mon_buf_ring[mac_id] + .hal_srng, + RXDMA_MONITOR_BUF); - htt_srng_setup(soc->htt_handle, mac_for_pdev, - pdev->rxdma_mon_status_ring[mac_id].hal_srng, - RXDMA_MONITOR_STATUS); + if (status != QDF_STATUS_SUCCESS) { + dp_err("Failed to send htt srng setup message for Rxdma mon buf ring"); + return status; + } + + status = htt_srng_setup(soc->htt_handle, mac_for_pdev, + pdev->rxdma_mon_dst_ring[mac_id] + .hal_srng, + RXDMA_MONITOR_DST); + + if (status != QDF_STATUS_SUCCESS) { + dp_err("Failed to send htt srng setup message for Rxdma mon dst ring"); + return status; + } + + status = htt_srng_setup(soc->htt_handle, mac_for_pdev, + pdev->rxdma_mon_status_ring[mac_id] + .hal_srng, + RXDMA_MONITOR_STATUS); + + if (status != QDF_STATUS_SUCCESS) { + dp_err("Failed to send htt srng setup message for Rxdma mon status ring"); + return status; + } + + status = htt_srng_setup(soc->htt_handle, mac_for_pdev, + pdev->rxdma_mon_desc_ring[mac_id] + .hal_srng, + RXDMA_MONITOR_DESC); + + if (status != QDF_STATUS_SUCCESS) { + dp_err("Failed to send htt srng message for Rxdma mon desc ring"); + return status; + } + } else { + status = htt_srng_setup(soc->htt_handle, mac_for_pdev, + pdev->rxdma_mon_status_ring[mac_id] + .hal_srng, + RXDMA_MONITOR_STATUS); + + if (status != QDF_STATUS_SUCCESS) { + dp_err("Failed to send htt srng setup message for Rxdma mon status ring"); + return status; + } + } + + return status; - htt_srng_setup(soc->htt_handle, mac_for_pdev, - pdev->rxdma_mon_desc_ring[mac_id].hal_srng, - RXDMA_MONITOR_DESC); } #else -static void dp_mon_htt_srng_setup(struct dp_soc *soc, - struct dp_pdev *pdev, - int mac_id, - int mac_for_pdev) +static QDF_STATUS dp_mon_htt_srng_setup(struct dp_soc *soc, + struct dp_pdev *pdev, + int mac_id, + int mac_for_pdev) { + return QDF_STATUS_SUCCESS; } #endif + /* * dp_rxdma_ring_config() - configure the RX DMA rings * @@ -3394,13 +3508,13 @@ static void dp_mon_htt_srng_setup(struct dp_soc *soc, * * @soc: data path SoC handle * - * Return: void + * Return: zero on success, non-zero on failure */ #ifdef QCA_HOST2FW_RXBUF_RING -static void dp_rxdma_ring_config(struct dp_soc *soc) +static QDF_STATUS dp_rxdma_ring_config(struct dp_soc *soc) { int i; - + QDF_STATUS status = QDF_STATUS_SUCCESS; for (i = 0; i < MAX_PDEV_CNT; i++) { struct dp_pdev *pdev = soc->pdev_list[i]; @@ -3450,6 +3564,7 @@ static void dp_rxdma_ring_config(struct dp_soc *soc) QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, FL("mac_id %d"), mac_for_pdev); + htt_srng_setup(soc->htt_handle, mac_for_pdev, pdev->rx_mac_buf_ring[mac_id] .hal_srng, @@ -3460,8 +3575,13 @@ static void dp_rxdma_ring_config(struct dp_soc *soc) RXDMA_DST); /* Configure monitor mode rings */ - dp_mon_htt_srng_setup(soc, pdev, mac_id, - mac_for_pdev); + status = dp_mon_htt_srng_setup(soc, pdev, + mac_id, + mac_for_pdev); + if (status != QDF_STATUS_SUCCESS) { + dp_err("Failed to send htt monitor messages to target"); + return status; + } } } @@ -3475,13 +3595,15 @@ static void dp_rxdma_ring_config(struct dp_soc *soc) dp_service_mon_rings, (void *)soc, QDF_TIMER_TYPE_WAKE_APPS); soc->reap_timer_init = 1; + return status; } #else /* This is only for WIN */ -static void dp_rxdma_ring_config(struct dp_soc *soc) +static QDF_STATUS dp_rxdma_ring_config(struct dp_soc *soc) { int i; int mac_id; + QDF_STATUS status = QDF_STATUS_SUCCESS; for (i = 0; i < MAX_PDEV_CNT; i++) { struct dp_pdev *pdev = soc->pdev_list[i]; @@ -3513,27 +3635,36 @@ static void dp_rxdma_ring_config(struct dp_soc *soc) RXDMA_DST); } } + return status; } #endif /* * dp_soc_attach_target_wifi3() - SOC initialization in the target - * @txrx_soc: Datapath SOC handle + * @cdp_soc: Opaque Datapath SOC handle + * + * Return: zero on success, non-zero on failure */ -static int dp_soc_attach_target_wifi3(struct cdp_soc_t *cdp_soc) +static QDF_STATUS +dp_soc_attach_target_wifi3(struct cdp_soc_t *cdp_soc) { struct dp_soc *soc = (struct dp_soc *)cdp_soc; + QDF_STATUS status = QDF_STATUS_SUCCESS; htt_soc_attach_target(soc->htt_handle); - dp_rxdma_ring_config(soc); + status = dp_rxdma_ring_config(soc); + if (status != QDF_STATUS_SUCCESS) { + dp_err("Failed to send htt srng setup messages to target"); + return status; + } DP_STATS_INIT(soc); /* initialize work queue for stats processing */ qdf_create_work(0, &soc->htt_stats.work, htt_t2h_stats_handler, soc); - return 0; + return QDF_STATUS_SUCCESS; } /* @@ -4728,19 +4859,54 @@ static struct cdp_cfg *dp_get_ctrl_pdev_from_vdev_wifi3(struct cdp_vdev *pvdev) return (struct cdp_cfg *)pdev->wlan_cfg_ctx; } +/** + * dp_monitor_mode_ring_config() - Send the tlv config to fw for monitor buffer + * ring based on target + * @soc: soc handle + * @mac_for_pdev: pdev_id + * @pdev: physical device handle + * @ring_num: mac id + * @htt_tlv_filter: tlv filter + * + * Return: zero on success, non-zero on failure + */ +static inline +QDF_STATUS dp_monitor_mode_ring_config(struct dp_soc *soc, uint8_t mac_for_pdev, + struct dp_pdev *pdev, uint8_t ring_num, + struct htt_rx_ring_tlv_filter htt_tlv_filter) +{ + QDF_STATUS status; + + if (soc->wlan_cfg_ctx->rxdma1_enable) + status = htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev, + pdev->rxdma_mon_buf_ring[ring_num] + .hal_srng, + RXDMA_MONITOR_BUF, RX_BUFFER_SIZE, + &htt_tlv_filter); + else + status = htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev, + pdev->rx_mac_buf_ring[ring_num] + .hal_srng, + RXDMA_BUF, RX_BUFFER_SIZE, + &htt_tlv_filter); + + return status; +} + /** * dp_reset_monitor_mode() - Disable monitor mode * @pdev_handle: Datapath PDEV handle * * Return: 0 on success, not 0 on failure */ -static int dp_reset_monitor_mode(struct cdp_pdev *pdev_handle) +static QDF_STATUS dp_reset_monitor_mode(struct cdp_pdev *pdev_handle) { struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; struct htt_rx_ring_tlv_filter htt_tlv_filter; struct dp_soc *soc = pdev->soc; uint8_t pdev_id; int mac_id; + QDF_STATUS status = QDF_STATUS_SUCCESS; pdev_id = pdev->pdev_id; soc = pdev->soc; @@ -4752,20 +4918,26 @@ static int dp_reset_monitor_mode(struct cdp_pdev *pdev_handle) for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) { int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev_id); - htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev, - pdev->rxdma_mon_buf_ring[mac_id].hal_srng, - RXDMA_MONITOR_BUF, RX_BUFFER_SIZE, &htt_tlv_filter); + status = dp_monitor_mode_ring_config(soc, mac_for_pdev, + pdev, mac_id, + htt_tlv_filter); + + if (status != QDF_STATUS_SUCCESS) { + dp_err("Failed to send tlv filter for monitor mode rings"); + return status; + } htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev, - pdev->rxdma_mon_status_ring[mac_id].hal_srng, - RXDMA_MONITOR_STATUS, RX_BUFFER_SIZE, &htt_tlv_filter); + pdev->rxdma_mon_status_ring[mac_id].hal_srng, + RXDMA_MONITOR_STATUS, RX_BUFFER_SIZE, + &htt_tlv_filter); } pdev->monitor_vdev = NULL; qdf_spin_unlock_bh(&pdev->mon_lock); - return 0; + return QDF_STATUS_SUCCESS; } /** @@ -4825,8 +4997,8 @@ static void dp_get_peer_mac_from_peer_id(struct cdp_pdev *pdev_handle, * * Return: 0 on success, not 0 on failure */ -static int dp_vdev_set_monitor_mode(struct cdp_vdev *vdev_handle, - uint8_t smart_monitor) +static QDF_STATUS dp_vdev_set_monitor_mode(struct cdp_vdev *vdev_handle, + uint8_t smart_monitor) { /* Many monitor VAPs can exists in a system but only one can be up at * anytime @@ -4837,6 +5009,7 @@ static int dp_vdev_set_monitor_mode(struct cdp_vdev *vdev_handle, struct dp_soc *soc; uint8_t pdev_id; int mac_id; + QDF_STATUS status = QDF_STATUS_SUCCESS; qdf_assert(vdev); @@ -4897,9 +5070,14 @@ static int dp_vdev_set_monitor_mode(struct cdp_vdev *vdev_handle, for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) { int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev_id); - htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev, - pdev->rxdma_mon_buf_ring[mac_id].hal_srng, - RXDMA_MONITOR_BUF, RX_BUFFER_SIZE, &htt_tlv_filter); + status = dp_monitor_mode_ring_config(soc, mac_for_pdev, + pdev, mac_id, + htt_tlv_filter); + + if (status != QDF_STATUS_SUCCESS) { + dp_err("Failed to send tlv filter for monitor mode rings"); + return status; + } } qdf_mem_set(&(htt_tlv_filter), sizeof(htt_tlv_filter), 0x0); @@ -4946,8 +5124,9 @@ static int dp_vdev_set_monitor_mode(struct cdp_vdev *vdev_handle, * @filter_val: Flag to select Filter for monitor mode * Return: 0 on success, not 0 on failure */ -static int dp_pdev_set_advance_monitor_filter(struct cdp_pdev *pdev_handle, - struct cdp_monitor_filter *filter_val) +static QDF_STATUS +dp_pdev_set_advance_monitor_filter(struct cdp_pdev *pdev_handle, + struct cdp_monitor_filter *filter_val) { /* Many monitor VAPs can exists in a system but only one can be up at * anytime @@ -4958,6 +5137,7 @@ static int dp_pdev_set_advance_monitor_filter(struct cdp_pdev *pdev_handle, struct dp_soc *soc; uint8_t pdev_id; int mac_id; + QDF_STATUS status = QDF_STATUS_SUCCESS; pdev_id = pdev->pdev_id; soc = pdev->soc; @@ -4994,9 +5174,14 @@ static int dp_pdev_set_advance_monitor_filter(struct cdp_pdev *pdev_handle, for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) { int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev_id); - htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev, - pdev->rxdma_mon_buf_ring[mac_id].hal_srng, - RXDMA_MONITOR_BUF, RX_BUFFER_SIZE, &htt_tlv_filter); + status = dp_monitor_mode_ring_config(soc, mac_for_pdev, + pdev, mac_id, + htt_tlv_filter); + + if (status != QDF_STATUS_SUCCESS) { + dp_err("Failed to send tlv filter for monitor mode rings"); + return status; + } htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev, pdev->rxdma_mon_status_ring[mac_id].hal_srng, @@ -5031,9 +5216,14 @@ static int dp_pdev_set_advance_monitor_filter(struct cdp_pdev *pdev_handle, for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) { int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev_id); - htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev, - pdev->rxdma_mon_buf_ring[mac_id].hal_srng, - RXDMA_MONITOR_BUF, RX_BUFFER_SIZE, &htt_tlv_filter); + status = dp_monitor_mode_ring_config(soc, mac_for_pdev, + pdev, mac_id, + htt_tlv_filter); + + if (status != QDF_STATUS_SUCCESS) { + dp_err("Failed to send tlv filter for monitor mode rings"); + return status; + } } qdf_mem_set(&(htt_tlv_filter), sizeof(htt_tlv_filter), 0x0); @@ -5813,6 +6003,34 @@ dp_print_ring_stat_from_hal(struct dp_soc *soc, struct dp_srng *srng, } } +/** + * dp_print_mon_ring_stats_from_hal() - Print stat for monitor rings based + * on target + * @pdev: physical device handle + * @mac_id: mac id + * + * Return: void + */ +static inline +void dp_print_mon_ring_stat_from_hal(struct dp_pdev *pdev, uint8_t mac_id) +{ + if (pdev->soc->wlan_cfg_ctx->rxdma1_enable) { + dp_print_ring_stat_from_hal(pdev->soc, + &pdev->rxdma_mon_buf_ring[mac_id], + "Rxdma Mon Buf Ring"); + dp_print_ring_stat_from_hal(pdev->soc, + &pdev->rxdma_mon_dst_ring[mac_id], + "Rxdma Mon Dst Ring"); + dp_print_ring_stat_from_hal(pdev->soc, + &pdev->rxdma_mon_desc_ring[mac_id], + "Rxdma mon desc Ring"); + } + + dp_print_ring_stat_from_hal(pdev->soc, + &pdev->rxdma_mon_status_ring[mac_id], + "Rxdma Mon Status Ring"); +} + /** * dp_print_ring_stats(): Print tail and head pointer * @pdev: DP_PDEV handle @@ -5878,18 +6096,7 @@ dp_print_ring_stats(struct dp_pdev *pdev) "Second Rx Refill Buf Ring"); for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) { - dp_print_ring_stat_from_hal(pdev->soc, - &pdev->rxdma_mon_buf_ring[mac_id], - "Rxdma Mon Buf Ring"); - dp_print_ring_stat_from_hal(pdev->soc, - &pdev->rxdma_mon_dst_ring[mac_id], - "Rxdma Mon Dst Ring"); - dp_print_ring_stat_from_hal(pdev->soc, - &pdev->rxdma_mon_status_ring[mac_id], - "Rxdma Mon Status Ring"); - dp_print_ring_stat_from_hal(pdev->soc, - &pdev->rxdma_mon_desc_ring[mac_id], - "Rxdma mon desc Ring"); + dp_print_mon_ring_stat_from_hal(pdev, mac_id); } for (i = 0; i < NUM_RXDMA_RINGS_PER_PDEV; i++) { @@ -8181,6 +8388,7 @@ void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle, { struct dp_soc *soc = qdf_mem_malloc(sizeof(*soc)); int target_type; + int int_ctx; if (!soc) { QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, @@ -8188,6 +8396,7 @@ void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle, goto fail0; } + int_ctx = 0; soc->device_id = device_id; soc->cdp_soc.ops = &dp_txrx_ops; soc->cdp_soc.ol_ops = ol_ops; @@ -8225,6 +8434,13 @@ void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle, REO_DST_RING_SIZE_QCA6290); wlan_cfg_set_raw_mode_war(soc->wlan_cfg_ctx, true); soc->ast_override_support = 1; + if (con_mode_monitor == QDF_GLOBAL_MONITOR_MODE) { + for (int_ctx = 0; int_ctx < WLAN_CFG_INT_NUM_CONTEXTS; int_ctx++) { + soc->wlan_cfg_ctx->int_rx_ring_mask[int_ctx] = 0; + soc->wlan_cfg_ctx->int_rxdma2host_ring_mask[int_ctx] = 0; + } + } + soc->wlan_cfg_ctx->rxdma1_enable = 0; break; #endif case TARGET_TYPE_QCA8074: diff --git a/dp/wifi3.0/dp_rx_mon.h b/dp/wifi3.0/dp_rx_mon.h index 079c9eba0006..2c3fb134f650 100644 --- a/dp/wifi3.0/dp_rx_mon.h +++ b/dp/wifi3.0/dp_rx_mon.h @@ -38,36 +38,10 @@ void dp_rx_mon_dest_process(struct dp_soc *soc, uint32_t mac_id, uint32_t quota); -#ifndef QCA_WIFI_QCA6390 QDF_STATUS dp_rx_pdev_mon_attach(struct dp_pdev *pdev); QDF_STATUS dp_rx_pdev_mon_detach(struct dp_pdev *pdev); QDF_STATUS dp_rx_pdev_mon_status_attach(struct dp_pdev *pdev, int mac_id); QDF_STATUS dp_rx_pdev_mon_status_detach(struct dp_pdev *pdev, int mac_id); -#else -static inline -QDF_STATUS dp_rx_pdev_mon_attach(struct dp_pdev *pdev) -{ - return QDF_STATUS_SUCCESS; -} - -static inline -QDF_STATUS dp_rx_pdev_mon_detach(struct dp_pdev *pdev) -{ - return QDF_STATUS_SUCCESS; -} - -static inline -QDF_STATUS dp_rx_pdev_mon_status_attach(struct dp_pdev *pdev, int mac_id) -{ - return QDF_STATUS_SUCCESS; -} - -static inline -QDF_STATUS dp_rx_pdev_mon_status_detach(struct dp_pdev *pdev, int mac_id) -{ - return QDF_STATUS_SUCCESS; -} -#endif uint32_t dp_mon_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 6988a4a07dbe..ded2efb10d0e 100644 --- a/dp/wifi3.0/dp_rx_mon_dest.c +++ b/dp/wifi3.0/dp_rx_mon_dest.c @@ -117,6 +117,118 @@ uint32_t *frag_len) } } +/** + * dp_rx_cookie_2_mon_link_desc() - Retrieve Link descriptor based on target + * @pdev: core physical device context + * @hal_buf_info: structure holding the buffer info + * mac_id: mac number + * + * Return: link descriptor address + */ +static inline +void *dp_rx_cookie_2_mon_link_desc(struct dp_pdev *pdev, + struct hal_buf_info buf_info, + uint8_t mac_id) +{ + if (pdev->soc->wlan_cfg_ctx->rxdma1_enable) + return dp_rx_cookie_2_mon_link_desc_va(pdev, &buf_info, + mac_id); + + return dp_rx_cookie_2_link_desc_va(pdev->soc, &buf_info); +} + +/** + * dp_rx_monitor_link_desc_return() - Return Link descriptor based on target + * @pdev: core physical device context + * @p_last_buf_addr_info: MPDU Link descriptor + * mac_id: mac number + * + * Return: QDF_STATUS + */ +static inline +QDF_STATUS dp_rx_monitor_link_desc_return(struct dp_pdev *pdev, + void *p_last_buf_addr_info, + uint8_t mac_id, uint8_t bm_action) +{ + if (pdev->soc->wlan_cfg_ctx->rxdma1_enable) + return dp_rx_mon_link_desc_return(pdev, p_last_buf_addr_info, + mac_id); + + return dp_rx_link_desc_return(pdev->soc, p_last_buf_addr_info, + bm_action); +} + +/** + * dp_rxdma_get_mon_dst_ring() - Return the pointer to rxdma_err_dst_ring + * or mon_dst_ring based on the target + * @pdev: core physical device context + * @mac_for_pdev: mac_id number + * + * Return: ring address + */ +static inline +void *dp_rxdma_get_mon_dst_ring(struct dp_pdev *pdev, + uint8_t mac_for_pdev) +{ + if (pdev->soc->wlan_cfg_ctx->rxdma1_enable) + return pdev->rxdma_mon_dst_ring[mac_for_pdev].hal_srng; + + return pdev->rxdma_err_dst_ring[mac_for_pdev].hal_srng; +} + +/** + * dp_rxdma_get_mon_buf_ring() - Return monitor buf ring address + * based on target + * @pdev: core physical device context + * @mac_for_pdev: mac id number + * + * Return: ring address + */ +static inline +struct dp_srng *dp_rxdma_get_mon_buf_ring(struct dp_pdev *pdev, + uint8_t mac_for_pdev) +{ + if (pdev->soc->wlan_cfg_ctx->rxdma1_enable) + return &pdev->rxdma_mon_buf_ring[mac_for_pdev]; + + return &pdev->rx_refill_buf_ring; +} + +/** + * dp_rx_get_desc_pool() - Return monitor descriptor pool + * based on target + * @soc: soc handle + * @mac_id: mac id number + * + * Return: descriptor pool address + */ +static inline +struct rx_desc_pool *dp_rx_get_desc_pool(struct dp_soc *soc, + uint8_t mac_id) +{ + if (soc->wlan_cfg_ctx->rxdma1_enable) + return &soc->rx_desc_mon[mac_id]; + + return &soc->rx_desc_buf[mac_id]; +} + +/** + * dp_rx_get_mon_desc() - Return Rx descriptor based on target + * @soc: soc handle + * @cookie: cookie value + * + * Return: Rx descriptor + */ +static inline +struct dp_rx_desc *dp_rx_get_mon_desc(struct dp_soc *soc, + uint32_t cookie) +{ + if (soc->wlan_cfg_ctx->rxdma1_enable) + return dp_rx_cookie_2_va_mon_buf(soc, cookie); + + return dp_rx_cookie_2_va_rxdma_buf(soc, cookie); +} + /** * dp_rx_mon_mpdu_pop() - Return a MPDU link descriptor to HW * (WBM), following error handling @@ -157,6 +269,7 @@ dp_rx_mon_mpdu_pop(struct dp_soc *soc, uint32_t mac_id, uint32_t total_frag_len = 0, frag_len = 0; bool is_frag, is_first_msdu; bool drop_mpdu = false; + uint8_t bm_action = HAL_BM_ACTION_PUT_IN_IDLE_LIST; msdu = 0; @@ -183,8 +296,8 @@ dp_rx_mon_mpdu_pop(struct dp_soc *soc, uint32_t mac_id, do { rx_msdu_link_desc = - dp_rx_cookie_2_mon_link_desc_va(dp_pdev, &buf_info, - mac_id); + dp_rx_cookie_2_mon_link_desc(dp_pdev, + buf_info, mac_id); qdf_assert(rx_msdu_link_desc); @@ -194,10 +307,11 @@ dp_rx_mon_mpdu_pop(struct dp_soc *soc, uint32_t mac_id, for (i = 0; i < num_msdus; i++) { uint32_t l2_hdr_offset; struct dp_rx_desc *rx_desc = - dp_rx_cookie_2_va_mon_buf(soc, - msdu_list.sw_cookie[i]); + dp_rx_get_mon_desc(soc, + msdu_list.sw_cookie[i]); + + qdf_assert_always(rx_desc); - qdf_assert(rx_desc); msdu = rx_desc->nbuf; if (rx_desc->unmapped == 0) { @@ -352,10 +466,13 @@ next_msdu: hal_rx_mon_next_link_desc_get(rx_msdu_link_desc, &buf_info, &p_buf_addr_info); - if (dp_rx_mon_link_desc_return(dp_pdev, p_last_buf_addr_info, - mac_id) != QDF_STATUS_SUCCESS) + if (dp_rx_monitor_link_desc_return(dp_pdev, + p_last_buf_addr_info, + mac_id, + bm_action) + != QDF_STATUS_SUCCESS) QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, - "dp_rx_mon_link_desc_return failed"); + "dp_rx_monitor_link_desc_return failed"); p_last_buf_addr_info = p_buf_addr_info; @@ -839,7 +956,7 @@ void dp_rx_mon_dest_process(struct dp_soc *soc, uint32_t mac_id, uint32_t quota) int mac_for_pdev = dp_get_mac_id_for_mac(soc, mac_id); struct cdp_pdev_mon_stats *rx_mon_stats; - mon_dst_srng = pdev->rxdma_mon_dst_ring[mac_for_pdev].hal_srng; + mon_dst_srng = dp_rxdma_get_mon_dst_ring(pdev, mac_for_pdev); if (!mon_dst_srng || !hal_srng_initialized(mon_dst_srng)) { QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, @@ -904,12 +1021,21 @@ void dp_rx_mon_dest_process(struct dp_soc *soc, uint32_t mac_id, uint32_t quota) if (rx_bufs_used) { rx_mon_stats->dest_ppdu_done++; dp_rx_buffers_replenish(soc, mac_id, - &pdev->rxdma_mon_buf_ring[mac_for_pdev], - &soc->rx_desc_mon[mac_id], rx_bufs_used, &head, &tail); + dp_rxdma_get_mon_buf_ring(pdev, mac_for_pdev), + dp_rx_get_desc_pool(soc, mac_id), + rx_bufs_used, &head, &tail); } } #ifndef QCA_WIFI_QCA6390 +/** + * dp_rx_pdev_mon_buf_attach() - Allocate the monitor descriptor pool + * + * @pdev: physical device handle + * @mac_id: mac id + * + * Return: QDF_STATUS + */ static QDF_STATUS dp_rx_pdev_mon_buf_attach(struct dp_pdev *pdev, int mac_id) { uint8_t pdev_id = pdev->pdev_id; @@ -975,9 +1101,15 @@ dp_rx_pdev_mon_buf_detach(struct dp_pdev *pdev, int mac_id) return QDF_STATUS_SUCCESS; } -/* - * Allocate and setup link descriptor pool that will be used by HW for - * various link and queue descriptors and managed by WBM +/** + * dp_mon_link_desc_pool_setup(): Allocate and setup link descriptor pool + * that will be used by HW for various link + * and queue descriptorsand managed by WBM + * + * @soc: soc handle + * @mac_id: mac id + * + * Return: QDF_STATUS */ static QDF_STATUS dp_mon_link_desc_pool_setup(struct dp_soc *soc, uint32_t mac_id) @@ -1202,6 +1334,30 @@ void dp_mon_link_desc_pool_cleanup(struct dp_soc *soc, uint32_t mac_id) } } } +#else +static +QDF_STATUS dp_mon_link_desc_pool_setup(struct dp_soc *soc, uint32_t mac_id) +{ + return QDF_STATUS_SUCCESS; +} + +static QDF_STATUS +dp_rx_pdev_mon_buf_attach(struct dp_pdev *pdev, int mac_id) +{ + return QDF_STATUS_SUCCESS; +} + +static +void dp_mon_link_desc_pool_cleanup(struct dp_soc *soc, uint32_t mac_id) +{ +} + +static QDF_STATUS +dp_rx_pdev_mon_buf_detach(struct dp_pdev *pdev, int mac_id) +{ + return QDF_STATUS_SUCCESS; +} +#endif /** * dp_rx_pdev_mon_attach() - attach DP RX for monitor mode @@ -1230,9 +1386,10 @@ dp_rx_pdev_mon_attach(struct dp_pdev *pdev) { status = dp_rx_pdev_mon_buf_attach(pdev, mac_for_pdev); if (!QDF_IS_STATUS_SUCCESS(status)) { - QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, - "%s: dp_rx_pdev_mon_buf_attach() failed", - __func__); + QDF_TRACE(QDF_MODULE_ID_DP, + QDF_TRACE_LEVEL_ERROR, + "%s: dp_rx_pdev_mon_buf_attach() failed\n", + __func__); return status; } @@ -1255,12 +1412,6 @@ dp_rx_pdev_mon_attach(struct dp_pdev *pdev) { qdf_spinlock_create(&pdev->mon_lock); return QDF_STATUS_SUCCESS; } -#else -QDF_STATUS -dp_rx_pdev_mon_attach(struct dp_pdev *pdev) { - return QDF_STATUS_SUCCESS; -} -#endif /** * dp_rx_pdev_mon_detach() - detach dp rx for monitor mode @@ -1273,7 +1424,6 @@ dp_rx_pdev_mon_attach(struct dp_pdev *pdev) { * Return: QDF_STATUS_SUCCESS: success * QDF_STATUS_E_RESOURCES: Error return */ -#ifndef DISABLE_MON_CONFIG QDF_STATUS dp_rx_pdev_mon_detach(struct dp_pdev *pdev) { uint8_t pdev_id = pdev->pdev_id; @@ -1292,9 +1442,13 @@ dp_rx_pdev_mon_detach(struct dp_pdev *pdev) { return QDF_STATUS_SUCCESS; } #else +QDF_STATUS +dp_rx_pdev_mon_attach(struct dp_pdev *pdev) { + return QDF_STATUS_SUCCESS; +} + QDF_STATUS dp_rx_pdev_mon_detach(struct dp_pdev *pdev) { return QDF_STATUS_SUCCESS; } #endif /* DISABLE_MON_CONFIG */ -#endif diff --git a/dp/wifi3.0/dp_rx_mon_status.c b/dp/wifi3.0/dp_rx_mon_status.c index 113ef4aeb886..1de74a149c65 100644 --- a/dp/wifi3.0/dp_rx_mon_status.c +++ b/dp/wifi3.0/dp_rx_mon_status.c @@ -738,7 +738,7 @@ dp_mon_process(struct dp_soc *soc, uint32_t mac_id, uint32_t quota) { } /** - * dp_rx_pdev_mon_detach() - detach dp rx for status ring + * dp_rx_pdev_mon_status_detach() - detach dp rx for status ring * @pdev: core txrx pdev context * @mac_id: mac_id/pdev_id correspondinggly for MCL and WIN * @@ -749,7 +749,6 @@ dp_mon_process(struct dp_soc *soc, uint32_t mac_id, uint32_t quota) { * Return: QDF_STATUS_SUCCESS: success * QDF_STATUS_E_RESOURCES: Error return */ -#ifndef QCA_WIFI_QCA6390 QDF_STATUS dp_rx_pdev_mon_status_detach(struct dp_pdev *pdev, int mac_id) { @@ -762,7 +761,6 @@ dp_rx_pdev_mon_status_detach(struct dp_pdev *pdev, int mac_id) return QDF_STATUS_SUCCESS; } -#endif /* * dp_rx_buffers_replenish() - replenish monitor status ring with @@ -924,14 +922,13 @@ QDF_STATUS dp_rx_mon_status_buffers_replenish(struct dp_soc *dp_soc, /** * dp_rx_pdev_mon_status_attach() - attach DP RX monitor status ring * @pdev: core txrx pdev context - * + * @ring_id: ring number * This function will attach a DP RX monitor status ring into pDEV * and replenish monitor status ring with buffer. * * Return: QDF_STATUS_SUCCESS: success * QDF_STATUS_E_RESOURCES: Error return */ -#ifndef QCA_WIFI_QCA6390 QDF_STATUS dp_rx_pdev_mon_status_attach(struct dp_pdev *pdev, int ring_id) { struct dp_soc *soc = pdev->soc; @@ -990,4 +987,3 @@ dp_rx_pdev_mon_status_attach(struct dp_pdev *pdev, int ring_id) { return QDF_STATUS_SUCCESS; } -#endif diff --git a/utils/pktlog/pktlog_internal.c b/utils/pktlog/pktlog_internal.c index b3a158eeaad3..4b9b1695edd3 100644 --- a/utils/pktlog/pktlog_internal.c +++ b/utils/pktlog/pktlog_internal.c @@ -1332,7 +1332,7 @@ A_STATUS process_rate_update(void *pdev, void *data) } #endif -#ifdef QCA_WIFI_QCA6290 +#if defined(QCA_WIFI_QCA6290) || defined(QCA_WIFI_QCA6390) int process_rx_desc_remote(void *pdev, void *data) { struct pktlog_dev_t *pl_dev = get_pktlog_handle(); diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index f40432409787..6c3b68a6a510 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -128,6 +128,15 @@ static const int host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { 0, 0, 0}; + +static const int rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { + WLAN_CFG_RXDMA2HOST_RING_MASK_0, + WLAN_CFG_RXDMA2HOST_RING_MASK_1, + WLAN_CFG_RXDMA2HOST_RING_MASK_2, + WLAN_CFG_RXDMA2HOST_RING_MASK_3, + 0, + 0, + 0}; #else static const int tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { WLAN_CFG_TX_RING_MASK_0, @@ -155,6 +164,12 @@ static const int host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { WLAN_CFG_HOST2RXDMA_RING_MASK_1, WLAN_CFG_HOST2RXDMA_RING_MASK_2, WLAN_CFG_HOST2RXDMA_RING_MASK_3}; + +static const int rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { + WLAN_CFG_RXDMA2HOST_RING_MASK_0, + WLAN_CFG_RXDMA2HOST_RING_MASK_1, + WLAN_CFG_RXDMA2HOST_RING_MASK_2, + WLAN_CFG_RXDMA2HOST_RING_MASK_3}; #endif static const int rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { @@ -175,12 +190,6 @@ static const int reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { WLAN_CFG_REO_STATUS_RING_MASK_2, WLAN_CFG_REO_STATUS_RING_MASK_3}; -static const int rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { - WLAN_CFG_RXDMA2HOST_RING_MASK_0, - WLAN_CFG_RXDMA2HOST_RING_MASK_1, - WLAN_CFG_RXDMA2HOST_RING_MASK_2, - WLAN_CFG_RXDMA2HOST_RING_MASK_3}; - /** * struct wlan_cfg_dp_pdev_ctxt - Configuration parameters for pdev (radio) * @rx_dma_buf_ring_size - Size of RxDMA buffer ring @@ -214,6 +223,7 @@ struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach(void *psoc) if (wlan_cfg_ctx == NULL) return NULL; + wlan_cfg_ctx->rxdma1_enable = WLAN_CFG_RXDMA1_ENABLE; wlan_cfg_ctx->num_int_ctxts = WLAN_CFG_INT_NUM_CONTEXTS; wlan_cfg_ctx->max_clients = cfg_get(psoc, CFG_DP_MAX_CLIENTS); wlan_cfg_ctx->max_alloc_size = cfg_get(psoc, CFG_DP_MAX_ALLOC_SIZE); diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index 24c440e0a3fa..c15cbcd676ec 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/wlan_cfg/wlan_cfg.h @@ -26,6 +26,7 @@ #if defined(CONFIG_MCL) #define MAX_PDEV_CNT 1 #define WLAN_CFG_INT_NUM_CONTEXTS 7 +#define WLAN_CFG_RXDMA1_ENABLE 1 /* * This mask defines how many transmit frames account for 1 NAPI work unit * 0 means each tx completion is 1 unit @@ -39,6 +40,7 @@ #else #define MAX_PDEV_CNT 3 #define WLAN_CFG_INT_NUM_CONTEXTS 7 +#define WLAN_CFG_RXDMA1_ENABLE 1 /* * This mask defines how many transmit frames account for 1 NAPI work unit * 0xFFFF means each 64K tx frame completions account for 1 unit of NAPI budget @@ -198,12 +200,12 @@ struct wlan_cfg_dp_soc_ctxt { int reo_exception_ring; int reo_cmd_ring; int reo_status_ring; - int rxdma_refill_ring; int rxdma_err_dst_ring; bool raw_mode_war; bool enable_data_stall_detection; bool disable_intra_bss_fwd; + bool rxdma1_enable; }; /**