diff --git a/dp/wifi3.0/dp_htt.c b/dp/wifi3.0/dp_htt.c index 0a7aa6aa40..b2d9b68ce5 100644 --- a/dp/wifi3.0/dp_htt.c +++ b/dp/wifi3.0/dp_htt.c @@ -330,15 +330,61 @@ dp_htt_h2t_send_complete(void *context, HTC_PACKET *htc_pkt) #endif /* ENABLE_CE4_COMP_DISABLE_HTT_HTC_MISC_LIST */ -#ifdef WLAN_MCAST_MLO /* - * dp_htt_h2t_add_tcl_metadata_verg() - Add tcl_metadata verion + * dp_htt_h2t_add_tcl_metadata_ver_v1() - Add tcl_metadata verion V1 * @htt_soc: HTT SOC handle * @msg: Pointer to nbuf * * Return: 0 on success; error code on failure */ -static int dp_htt_h2t_add_tcl_metadata_ver(struct htt_soc *soc, qdf_nbuf_t *msg) +static int dp_htt_h2t_add_tcl_metadata_ver_v1(struct htt_soc *soc, + qdf_nbuf_t *msg) +{ + uint32_t *msg_word; + + *msg = qdf_nbuf_alloc( + soc->osdev, + HTT_MSG_BUF_SIZE(HTT_VER_REQ_BYTES), + /* reserve room for the HTC header */ + HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4, TRUE); + if (!*msg) + return QDF_STATUS_E_NOMEM; + + /* + * Set the length of the message. + * The contribution from the HTC_HDR_ALIGNMENT_PADDING is added + * separately during the below call to qdf_nbuf_push_head. + * The contribution from the HTC header is added separately inside HTC. + */ + if (!qdf_nbuf_put_tail(*msg, HTT_VER_REQ_BYTES)) { + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, + "%s: Failed to expand head for HTT_H2T_MSG_TYPE_VERSION_REQ msg", + __func__); + return QDF_STATUS_E_FAILURE; + } + + /* fill in the message contents */ + msg_word = (u_int32_t *)qdf_nbuf_data(*msg); + + /* rewind beyond alignment pad to get to the HTC header reserved area */ + qdf_nbuf_push_head(*msg, HTC_HDR_ALIGNMENT_PADDING); + + *msg_word = 0; + HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_VERSION_REQ); + + return QDF_STATUS_SUCCESS; +} + +#ifdef QCA_DP_TX_FW_METADATA_V2 +/* + * dp_htt_h2t_add_tcl_metadata_ver_v2() - Add tcl_metadata verion V2 + * @htt_soc: HTT SOC handle + * @msg: Pointer to nbuf + * + * Return: 0 on success; error code on failure + */ +static int dp_htt_h2t_add_tcl_metadata_ver_v2(struct htt_soc *soc, + qdf_nbuf_t *msg) { uint32_t *msg_word; @@ -383,9 +429,9 @@ static int dp_htt_h2t_add_tcl_metadata_ver(struct htt_soc *soc, qdf_nbuf_t *msg) return QDF_STATUS_SUCCESS; } -#else + /* - * dp_htt_h2t_add_tcl_metadata_verg() - Add tcl_metadata verion + * dp_htt_h2t_add_tcl_metadata_ver() - Add tcl_metadata verion * @htt_soc: HTT SOC handle * @msg: Pointer to nbuf * @@ -393,39 +439,16 @@ static int dp_htt_h2t_add_tcl_metadata_ver(struct htt_soc *soc, qdf_nbuf_t *msg) */ static int dp_htt_h2t_add_tcl_metadata_ver(struct htt_soc *soc, qdf_nbuf_t *msg) { - uint32_t *msg_word; - - *msg = qdf_nbuf_alloc( - soc->osdev, - HTT_MSG_BUF_SIZE(HTT_VER_REQ_BYTES), - /* reserve room for the HTC header */ - HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4, TRUE); - if (!*msg) - return QDF_STATUS_E_NOMEM; - - /* - * Set the length of the message. - * The contribution from the HTC_HDR_ALIGNMENT_PADDING is added - * separately during the below call to qdf_nbuf_push_head. - * The contribution from the HTC header is added separately inside HTC. - */ - if (!qdf_nbuf_put_tail(*msg, HTT_VER_REQ_BYTES)) { - QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, - "%s: Failed to expand head for HTT_H2T_MSG_TYPE_VERSION_REQ msg", - __func__); - return QDF_STATUS_E_FAILURE; - } - - /* fill in the message contents */ - msg_word = (u_int32_t *)qdf_nbuf_data(*msg); - - /* rewind beyond alignment pad to get to the HTC header reserved area */ - qdf_nbuf_push_head(*msg, HTC_HDR_ALIGNMENT_PADDING); - - *msg_word = 0; - HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_VERSION_REQ); - - return QDF_STATUS_SUCCESS; + /* Use tcl_metadata_v1 when NSS offload is enabled */ + if (wlan_cfg_get_dp_soc_nss_cfg(soc->dp_soc->wlan_cfg_ctx)) + return dp_htt_h2t_add_tcl_metadata_ver_v1(soc, msg); + else + return dp_htt_h2t_add_tcl_metadata_ver_v2(soc, msg); +} +#else +static int dp_htt_h2t_add_tcl_metadata_ver(struct htt_soc *soc, qdf_nbuf_t *msg) +{ + return dp_htt_h2t_add_tcl_metadata_ver_v1(soc, msg); } #endif diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index ebc6455fbc..d13e843107 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -120,7 +120,7 @@ cdp_dump_flow_pool_info(struct cdp_soc_t *soc) #define TXCOMP_RING4_NUM WBM2SW_TXCOMP_RING4_NUM #endif -#ifdef WLAN_MCAST_MLO +#ifdef QCA_DP_TX_FW_METADATA_V2 #define DP_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \ HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) #else diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index f4ae4b7b0f..3735073311 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -69,7 +69,7 @@ #define DP_RETRY_COUNT 7 -#ifdef WLAN_MCAST_MLO +#ifdef QCA_DP_TX_FW_METADATA_V2 #define DP_TX_TCL_METADATA_PDEV_ID_SET(_var, _val)\ HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) #define DP_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \