diff --git a/dp/inc/cdp_txrx_cmn.h b/dp/inc/cdp_txrx_cmn.h index 370c15c4c38a..0ac21fe05673 100644 --- a/dp/inc/cdp_txrx_cmn.h +++ b/dp/inc/cdp_txrx_cmn.h @@ -1380,6 +1380,56 @@ static inline void cdp_set_pdev_dscp_tid_map(ol_txrx_soc_handle soc, map_id, tos, tid); } +/** + * cdp_hmmc_tid_override_en(): Function to enable hmmc tid override. + * @soc : soc handle + * @pdev: pdev handle + * @val: hmmc-dscp flag value + * + * Return: void + */ +static inline void cdp_hmmc_tid_override_en(ol_txrx_soc_handle soc, + struct cdp_pdev *pdev, bool val) +{ + if (!soc || !soc->ops) { + QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, + "%s: Invalid Instance:", __func__); + QDF_BUG(0); + return; + } + + if (!soc->ops->cmn_drv_ops || + !soc->ops->cmn_drv_ops->hmmc_tid_override_en) + return; + + soc->ops->cmn_drv_ops->hmmc_tid_override_en(pdev, val); +} + +/** + * cdp_set_hmmc_tid_val(): Function to set hmmc tid value. + * @soc : soc handle + * @pdev: pdev handle + * @tid: tid value + * + * Return: void + */ +static inline void cdp_set_hmmc_tid_val(ol_txrx_soc_handle soc, + struct cdp_pdev *pdev, uint8_t tid) +{ + if (!soc || !soc->ops) { + QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, + "%s: Invalid Instance:", __func__); + QDF_BUG(0); + return; + } + + if (!soc->ops->cmn_drv_ops || + !soc->ops->cmn_drv_ops->set_hmmc_tid_val) + return; + + soc->ops->cmn_drv_ops->set_hmmc_tid_val(pdev, tid); +} + /** * cdp_flush_cache_rx_queue() - flush cache rx queue frame * diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index 68d9cc26d3f6..0e8ad45d7541 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -319,6 +319,8 @@ struct cdp_cmn_ops { void (*flush_cache_rx_queue)(void); void (*set_pdev_dscp_tid_map)(struct cdp_pdev *pdev, uint8_t map_id, uint8_t tos, uint8_t tid); + void (*hmmc_tid_override_en)(struct cdp_pdev *pdev, bool val); + void (*set_hmmc_tid_val)(struct cdp_pdev *pdev, uint8_t tid); QDF_STATUS (*txrx_stats_request)(struct cdp_vdev *vdev, struct cdp_txrx_stats_req *req); diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 737a327530fe..063b7420179a 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -7498,6 +7498,36 @@ static void dp_set_pdev_dscp_tid_map_wifi3(struct cdp_pdev *pdev_handle, return; } +/** + * dp_hmmc_tid_override_en_wifi3(): Function to enable hmmc tid override. + * @pdev_handle: pdev handle + * @val: hmmc-dscp flag value + * + * Return: void + */ +static void dp_hmmc_tid_override_en_wifi3(struct cdp_pdev *pdev_handle, + bool val) +{ + struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; + + pdev->hmmc_tid_override_en = val; +} + +/** + * dp_set_hmmc_tid_val_wifi3(): Function to set hmmc tid value. + * @pdev_handle: pdev handle + * @tid: tid value + * + * Return: void + */ +static void dp_set_hmmc_tid_val_wifi3(struct cdp_pdev *pdev_handle, + uint8_t tid) +{ + struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; + + pdev->hmmc_tid = tid; +} + /** * dp_fw_stats_process(): Process TxRX FW stats request * @vdev_handle: DP VDEV handle @@ -8313,6 +8343,8 @@ static struct cdp_cmn_ops dp_ops_cmn = { /* TODO: get API's for dscp-tid need to be added*/ .set_vdev_dscp_tid_map = dp_set_vdev_dscp_tid_map_wifi3, .set_pdev_dscp_tid_map = dp_set_pdev_dscp_tid_map_wifi3, + .hmmc_tid_override_en = dp_hmmc_tid_override_en_wifi3, + .set_hmmc_tid_val = dp_set_hmmc_tid_val_wifi3, .txrx_get_total_per = dp_get_total_per, .txrx_stats_request = dp_txrx_stats_request, .txrx_set_monitor_mode = dp_vdev_set_monitor_mode, diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index 0093ce62dd20..d9fd670746ca 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -3835,6 +3835,10 @@ dp_tx_me_send_convert_ucast(struct cdp_vdev *vdev_handle, qdf_nbuf_t nbuf, msdu_info.num_seg = new_mac_cnt; msdu_info.frm_type = dp_tx_frm_me; + if (qdf_unlikely(vdev->mcast_enhancement_en > 0) && + qdf_unlikely(pdev->hmmc_tid_override_en)) + msdu_info.tid = pdev->hmmc_tid; + DP_STATS_INC(vdev, tx_i.mcast_en.ucast, new_mac_cnt); dp_tx_send_msdu_multiple(vdev, nbuf, &msdu_info); diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index e87c56d49348..c00c1705f91c 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -1207,6 +1207,9 @@ struct dp_pdev { qdf_dma_mem_context(memctx); } me_buf; + bool hmmc_tid_override_en; + uint8_t hmmc_tid; + /* Number of VAPs with mcast enhancement enabled */ qdf_atomic_t mc_num_vap_attached;