diff --git a/dp/wifi3.0/be/dp_be_tx.c b/dp/wifi3.0/be/dp_be_tx.c index 5fbe25d7dc..05a9d843e3 100644 --- a/dp/wifi3.0/be/dp_be_tx.c +++ b/dp/wifi3.0/be/dp_be_tx.c @@ -945,6 +945,40 @@ int dp_ppeds_tx_comp_handler(struct dp_soc_be *be_soc, uint32_t quota) } #endif +#if defined(QCA_SUPPORT_WDS_EXTENDED) +static inline void +dp_get_peer_from_tx_exc_meta(struct dp_soc *soc, uint32_t *hal_tx_desc_cached, + struct cdp_tx_exception_metadata *tx_exc_metadata, + uint16_t *ast_idx, uint16_t *ast_hash) +{ + struct dp_peer *peer = NULL; + + if (tx_exc_metadata->is_wds_extended) { + peer = dp_peer_get_ref_by_id(soc, tx_exc_metadata->peer_id, + DP_MOD_ID_TX); + if (peer) { + *ast_idx = peer->ast_idx; + *ast_hash = peer->ast_hash; + hal_tx_desc_set_index_lookup_override + (soc->hal_soc, + hal_tx_desc_cached, + 0x1); + dp_peer_unref_delete(peer, DP_MOD_ID_TX); + } + } else { + return; + } +} + +#else +static inline void +dp_get_peer_from_tx_exc_meta(struct dp_soc *soc, uint32_t *hal_tx_desc_cached, + struct cdp_tx_exception_metadata *tx_exc_metadata, + uint16_t *ast_idx, uint16_t *ast_hash) +{ +} +#endif + QDF_STATUS dp_tx_hw_enqueue_be(struct dp_soc *soc, struct dp_vdev *vdev, struct dp_tx_desc_s *tx_desc, uint16_t fw_metadata, @@ -963,6 +997,8 @@ dp_tx_hw_enqueue_be(struct dp_soc *soc, struct dp_vdev *vdev, hal_ring_handle_t hal_ring_hdl = NULL; QDF_STATUS status = QDF_STATUS_E_RESOURCES; uint8_t num_desc_bytes = HAL_TX_DESC_LEN_BYTES; + uint16_t ast_idx = vdev->bss_ast_idx; + uint16_t ast_hash = vdev->bss_ast_hash; be_vdev = dp_get_be_vdev_from_dp_vdev(vdev); @@ -982,6 +1018,9 @@ dp_tx_hw_enqueue_be(struct dp_soc *soc, struct dp_vdev *vdev, CDP_INVALID_SEC_TYPE) || tx_exc_metadata->sec_type == vdev->sec_type); + dp_get_peer_from_tx_exc_meta(soc, (void *)cached_desc, + tx_exc_metadata, + &ast_idx, &ast_hash); } hal_tx_desc_cached = (void *)cached_desc; @@ -999,14 +1038,14 @@ dp_tx_hw_enqueue_be(struct dp_soc *soc, struct dp_vdev *vdev, vdev->lmac_id); hal_tx_desc_set_search_index_be(soc->hal_soc, hal_tx_desc_cached, - vdev->bss_ast_idx); + ast_idx); /* * Bank_ID is used as DSCP_TABLE number in beryllium * So there is no explicit field used for DSCP_TID_TABLE_NUM. */ hal_tx_desc_set_cache_set_num(soc->hal_soc, hal_tx_desc_cached, - (vdev->bss_ast_hash & 0xF)); + (ast_hash & 0xF)); hal_tx_desc_set_fw_metadata(hal_tx_desc_cached, fw_metadata); hal_tx_desc_set_buf_length(hal_tx_desc_cached, tx_desc->length); diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 0ef8bc1f6e..14a6cbc07e 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -16924,6 +16924,7 @@ static void dp_soc_cfg_init(struct dp_soc *soc) wlan_cfg_set_txmon_hw_support(soc->wlan_cfg_ctx, true); soc->host_ast_db_enable = cfg_get(soc->ctrl_psoc, CFG_DP_HOST_AST_DB_ENABLE); + soc->features.wds_ext_ast_override_enable = true; break; case TARGET_TYPE_QCA5332: soc->ast_override_support = 1; @@ -16939,6 +16940,7 @@ static void dp_soc_cfg_init(struct dp_soc *soc) wlan_cfg_set_txmon_hw_support(soc->wlan_cfg_ctx, true); soc->host_ast_db_enable = cfg_get(soc->ctrl_psoc, CFG_DP_HOST_AST_DB_ENABLE); + soc->features.wds_ext_ast_override_enable = true; break; default: qdf_print("%s: Unknown tgt type %d\n", __func__, target_type); diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index 7fab2e8fab..9267b1cbbe 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -1110,6 +1110,26 @@ dp_tx_send_msdu_single_wrapper(struct dp_vdev *vdev, qdf_nbuf_t nbuf, } #endif +#if defined(QCA_SUPPORT_WDS_EXTENDED) +static bool +dp_tx_is_wds_ast_override_en(struct dp_soc *soc, + struct cdp_tx_exception_metadata *tx_exc_metadata) +{ + if (soc->features.wds_ext_ast_override_enable && + tx_exc_metadata && tx_exc_metadata->is_wds_extended) + return true; + + return false; +} +#else +static bool +dp_tx_is_wds_ast_override_en(struct dp_soc *soc, + struct cdp_tx_exception_metadata *tx_exc_metadata) +{ + return false; +} +#endif + /** * dp_tx_desc_prepare_single - Allocate and prepare Tx descriptor * @vdev: DP vdev handle @@ -1172,6 +1192,13 @@ struct dp_tx_desc_s *dp_tx_prepare_desc_single(struct dp_vdev *vdev, /* Packets marked by upper layer (OS-IF) to be sent to FW */ if (dp_tx_is_nbuf_marked_exception(soc, nbuf)) is_exception = 1; + + /* for BE chipsets if wds extension was enbled will not mark FW + * in desc will mark ast index based search for ast index. + */ + if (dp_tx_is_wds_ast_override_en(soc, tx_exc_metadata)) + return tx_desc; + /* * For special modes (vdev_type == ocb or mesh), data frames should be * transmitted using varying transmit parameters (tx spec) which include diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 432a9f1b03..aac9d51857 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -2059,6 +2059,7 @@ struct dp_soc_features { dmac_cmn_src_rxbuf_ring_enabled:1; bool rssi_dbm_conv_support; bool umac_hw_reset_support; + bool wds_ext_ast_override_enable; }; enum sysfs_printing_mode { diff --git a/hal/wifi3.0/be/hal_be_tx.h b/hal/wifi3.0/be/hal_be_tx.h index 5621b173cc..5a6a9d60a5 100644 --- a/hal/wifi3.0/be/hal_be_tx.h +++ b/hal/wifi3.0/be/hal_be_tx.h @@ -487,6 +487,21 @@ hal_tx_desc_set_cache_set_num(hal_soc_handle_t hal_soc_hdl, void *desc, HAL_TX_SM(TCL_DATA_CMD, CACHE_SET_NUM, cache_num); } +/** + * hal_tx_desc_set_lookup_override_num - set lookup override num + * to the descriptor to Hardware + * @hal_soc_hdl: hal soc handle + * @hal_tx_des_cached: Cached descriptor that software maintains + * @cache_num: set numbernumber + */ +static inline void +hal_tx_desc_set_index_lookup_override(hal_soc_handle_t hal_soc_hdl, + void *desc, uint8_t num) +{ + HAL_SET_FLD(desc, TCL_DATA_CMD, INDEX_LOOKUP_OVERRIDE) |= + HAL_TX_SM(TCL_DATA_CMD, INDEX_LOOKUP_OVERRIDE, num); +} + /*--------------------------------------------------------------------------- * WBM Descriptor accessor APIs for Tx completions * ---------------------------------------------------------------------------