diff --git a/dp/wifi3.0/be/dp_be.c b/dp/wifi3.0/be/dp_be.c index 5c261ab624..522454aa8d 100644 --- a/dp/wifi3.0/be/dp_be.c +++ b/dp/wifi3.0/be/dp_be.c @@ -899,6 +899,23 @@ static QDF_STATUS dp_soc_srng_init_be(struct dp_soc *soc) return dp_soc_ppe_srng_init(soc); } +#ifdef DP_TX_IMPLICIT_RBM_MAPPING +static void dp_tx_implicit_rbm_set_be(struct dp_soc *soc, + uint8_t tx_ring_id, + uint8_t bm_id) +{ + hal_tx_config_rbm_mapping_be(soc->hal_soc, + soc->tcl_data_ring[tx_ring_id].hal_srng, + bm_id); +} +#else +static void dp_tx_implicit_rbm_set_be(struct dp_soc *soc, + uint8_t tx_ring_id, + uint8_t bm_id) +{ +} +#endif + void dp_initialize_arch_ops_be(struct dp_arch_ops *arch_ops) { #ifndef QCA_HOST_MODE_WIFI_DISABLED @@ -931,6 +948,7 @@ void dp_initialize_arch_ops_be(struct dp_arch_ops *arch_ops) arch_ops->txrx_vdev_detach = dp_vdev_detach_be; arch_ops->dp_rxdma_ring_sel_cfg = dp_rxdma_ring_sel_cfg_be; arch_ops->soc_cfg_attach = dp_soc_cfg_attach_be; + arch_ops->tx_implicit_rbm_set = dp_tx_implicit_rbm_set_be; dp_init_near_full_arch_ops_be(arch_ops); } diff --git a/dp/wifi3.0/be/dp_be_tx.c b/dp/wifi3.0/be/dp_be_tx.c index 9ba0012463..89c3e008b1 100644 --- a/dp/wifi3.0/be/dp_be_tx.c +++ b/dp/wifi3.0/be/dp_be_tx.c @@ -72,6 +72,7 @@ void dp_tx_comp_get_params_from_hal_desc_be(struct dp_soc *soc, #endif /* DP_FEATURE_HW_COOKIE_CONVERSION */ #ifdef QCA_OL_TX_MULTIQ_SUPPORT +#ifdef DP_TX_IMPLICIT_RBM_MAPPING /* * dp_tx_get_rbm_id()- Get the RBM ID for data transmission completion. * @dp_soc - DP soc structure pointer @@ -79,13 +80,19 @@ void dp_tx_comp_get_params_from_hal_desc_be(struct dp_soc *soc, * * Return - RBM ID corresponding to TCL ring_id */ +static inline uint8_t dp_tx_get_rbm_id_be(struct dp_soc *soc, + uint8_t ring_id) +{ + return 0; +} +#else static inline uint8_t dp_tx_get_rbm_id_be(struct dp_soc *soc, uint8_t ring_id) { return (ring_id ? soc->wbm_sw0_bm_id + (ring_id - 1) : HAL_WBM_SW2_BM_ID(soc->wbm_sw0_bm_id)); } - +#endif /*DP_TX_IMPLICIT_RBM_MAPPING*/ #else static inline uint8_t dp_tx_get_rbm_id_be(struct dp_soc *soc, uint8_t tcl_index) diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index bc8bf662cf..2516de2e2f 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -4259,6 +4259,7 @@ static QDF_STATUS dp_init_tx_ring_pair_by_index(struct dp_soc *soc, uint8_t index) { int tcl_ring_num, wbm_ring_num; + uint8_t bm_id; if (index >= MAX_TCL_DATA_RINGS) { dp_err("unexpected index!"); @@ -4294,6 +4295,9 @@ static QDF_STATUS dp_init_tx_ring_pair_by_index(struct dp_soc *soc, goto fail1; } + bm_id = wlan_cfg_get_rbm_id_for_index(soc->wlan_cfg_ctx, tcl_ring_num); + + soc->arch_ops.tx_implicit_rbm_set(soc, tcl_ring_num, bm_id); wlan_minidump_log(soc->tx_comp_ring[index].base_vaddr_unaligned, soc->tx_comp_ring[index].alloc_size, soc->ctrl_psoc, diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 7d8909db8a..b729795bbc 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -1632,6 +1632,8 @@ struct dp_arch_ops { int (*dp_srng_test_and_update_nf_params)(struct dp_soc *soc, struct dp_srng *dp_srng, int *max_reap_limit); + void (*tx_implicit_rbm_set)(struct dp_soc *soc, uint8_t tx_ring_id, + uint8_t bm_id); }; /** diff --git a/dp/wifi3.0/li/dp_li.c b/dp/wifi3.0/li/dp_li.c index 3d05a74eda..75b2797247 100644 --- a/dp/wifi3.0/li/dp_li.c +++ b/dp/wifi3.0/li/dp_li.c @@ -291,6 +291,12 @@ static QDF_STATUS dp_soc_srng_init_li(struct dp_soc *soc) return QDF_STATUS_SUCCESS; } +static void dp_tx_implicit_rbm_set_li(struct dp_soc *soc, + uint8_t tx_ring_id, + uint8_t bm_id) +{ +} + void dp_initialize_arch_ops_li(struct dp_arch_ops *arch_ops) { #ifndef QCA_HOST_MODE_WIFI_DISABLED @@ -325,5 +331,6 @@ void dp_initialize_arch_ops_li(struct dp_arch_ops *arch_ops) dp_rx_desc_cookie_2_va_li; arch_ops->dp_rxdma_ring_sel_cfg = dp_rxdma_ring_sel_cfg_li; arch_ops->soc_cfg_attach = dp_soc_cfg_attach_li; + arch_ops->tx_implicit_rbm_set = dp_tx_implicit_rbm_set_li; } diff --git a/hal/wifi3.0/be/hal_be_tx.h b/hal/wifi3.0/be/hal_be_tx.h index 2580109282..a1b7690049 100644 --- a/hal/wifi3.0/be/hal_be_tx.h +++ b/hal/wifi3.0/be/hal_be_tx.h @@ -537,11 +537,12 @@ hal_tx_populate_bank_register(hal_soc_handle_t hal_soc_hdl, * Return: void */ static inline void -hal_tx_config_rbm_mapping_be(struct hal_soc *hal_soc, +hal_tx_config_rbm_mapping_be(hal_soc_handle_t hal_soc_hdl, hal_ring_handle_t hal_ring_hdl, uint8_t rbm_id) { struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; + struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl; uint32_t reg_addr = 0; uint32_t reg_val = 0; uint32_t val = 0; @@ -550,7 +551,7 @@ hal_tx_config_rbm_mapping_be(struct hal_soc *hal_soc, ring_type = srng->ring_type; ring_num = hal_soc->hw_srng_table[ring_type].start_ring_id; - ring_num = ring_num - srng->ring_id; + ring_num = srng->ring_id - ring_num; reg_addr = HWIO_TCL_R0_RBM_MAPPING0_ADDR(MAC_TCL_REG_REG_BASE); @@ -573,7 +574,7 @@ hal_tx_config_rbm_mapping_be(struct hal_soc *hal_soc, } #else static inline void -hal_tx_config_rbm_mapping_be(struct hal_soc *hal_soc, +hal_tx_config_rbm_mapping_be(hal_soc_handle_t hal_soc_hdl, hal_ring_handle_t hal_ring_hdl, uint8_t rbm_id) {