diff --git a/dp/wifi3.0/be/dp_be.c b/dp/wifi3.0/be/dp_be.c index c270fab5c7..f67495babe 100644 --- a/dp/wifi3.0/be/dp_be.c +++ b/dp/wifi3.0/be/dp_be.c @@ -2948,6 +2948,61 @@ dp_primary_link_migration(struct dp_soc *soc, void *cb_ctxt, qdf_mem_free(pr_peer_info); } +#ifdef WLAN_SUPPORT_PPEDS +static QDF_STATUS dp_get_ppe_info_for_vap(struct cdp_soc_t *cdp_soc, + struct dp_soc *mld_soc, + struct dp_peer *pr_peer, + uint16_t *src_info) +{ + struct dp_soc_be *be_soc_mld = NULL; + struct cdp_ds_vp_params vp_params = {0}; + struct dp_ppe_vp_profile *ppe_vp_profile; + QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; + + /* + * Extract the VP profile from the VAP + */ + if (!cdp_soc->ol_ops->get_ppeds_profile_info_for_vap) { + dp_err("%pK: Register get ppeds profile info first", cdp_soc); + return QDF_STATUS_E_NULL_VALUE; + } + + /* + * Check if PPE DS routing is enabled on the associated vap. + */ + qdf_status = cdp_soc->ol_ops->get_ppeds_profile_info_for_vap( + mld_soc->ctrl_psoc, + pr_peer->vdev->vdev_id, + &vp_params); + + if (QDF_IS_STATUS_ERROR(qdf_status)) { + dp_err("Could not find ppeds profile info"); + return QDF_STATUS_E_NULL_VALUE; + } + + /* Check if PPE DS routing is enabled on + * the associated vap. + */ + if (vp_params.ppe_vp_type != PPE_VP_USER_TYPE_DS) + return qdf_status; + + be_soc_mld = dp_get_be_soc_from_dp_soc(mld_soc); + ppe_vp_profile = &be_soc_mld->ppe_vp_profile[ + vp_params.ppe_vp_profile_idx]; + *src_info = ppe_vp_profile->vp_num; + + return qdf_status; +} +#else +static QDF_STATUS dp_get_ppe_info_for_vap(struct cdp_soc_t *cdp_soc, + struct dp_soc *mld_soc, + struct dp_peer *pr_peer, + uint16_t *src_info) +{ + return QDF_STATUS_E_NOSUPPORT; +} +#endif + QDF_STATUS dp_htt_reo_migration(struct dp_soc *soc, uint16_t peer_id, uint16_t ml_peer_id, uint16_t vdev_id, uint8_t pdev_id, uint8_t chip_id) @@ -2965,12 +3020,8 @@ QDF_STATUS dp_htt_reo_migration(struct dp_soc *soc, uint16_t peer_id, struct dp_peer *current_pr_peer = NULL; struct dp_peer_info *peer_info; struct dp_vdev_be *be_vdev; - struct cdp_ds_vp_params vp_params = {0}; struct cdp_soc_t *cdp_soc; - struct dp_soc_be *be_soc_mld = NULL; - struct dp_ppe_vp_profile *ppe_vp_profile; - QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; - uint16_t src_info; + uint16_t src_info = 0; QDF_STATUS status; if (!dp_mlo) { @@ -3014,36 +3065,12 @@ QDF_STATUS dp_htt_reo_migration(struct dp_soc *soc, uint16_t peer_id, mld_soc = mld_peer->vdev->pdev->soc; cdp_soc = &mld_soc->cdp_soc; - /* - * Extract the VP profile from the VAP - */ - if (!cdp_soc->ol_ops->get_ppeds_profile_info_for_vap) { - dp_err("%pK: Register get ppeds profile info first\n", cdp_soc); - return QDF_STATUS_E_NULL_VALUE; + status = dp_get_ppe_info_for_vap(cdp_soc, mld_soc, pr_peer, &src_info); + if (status == QDF_STATUS_E_NULL_VALUE) { + dp_htt_err("Invalid ppe info for the vdev"); + return QDF_STATUS_E_FAILURE; } - /* - * Check if PPE DS routing is enabled on the associated vap. - */ - qdf_status = cdp_soc->ol_ops->get_ppeds_profile_info_for_vap( - mld_soc->ctrl_psoc, - pr_peer->vdev->vdev_id, - &vp_params); - if (qdf_status == QDF_STATUS_E_NULL_VALUE) { - dp_err("%pK: Could not find ppeds profile info \n", be_vdev); - return QDF_STATUS_E_NULL_VALUE; - } - /* Check if PPE DS routing is enabled on - * the associated vap. - */ - if (vp_params.ppe_vp_type != PPE_VP_USER_TYPE_DS) - return qdf_status; - - be_soc_mld = dp_get_be_soc_from_dp_soc(mld_soc); - ppe_vp_profile = &be_soc_mld->ppe_vp_profile[ - vp_params.ppe_vp_profile_idx]; - src_info = ppe_vp_profile->vp_num; - current_pr_soc = current_pr_peer->vdev->pdev->soc; /* Making existing primary peer as non primary */ current_pr_peer->primary_link = 0; diff --git a/dp/wifi3.0/dp_htt.c b/dp/wifi3.0/dp_htt.c index f451774daf..9a6150b1a2 100644 --- a/dp/wifi3.0/dp_htt.c +++ b/dp/wifi3.0/dp_htt.c @@ -2421,7 +2421,7 @@ dp_h2t_ptqm_migration_msg_send(struct dp_soc *dp_soc, uint16_t vdev_id, msg = qdf_nbuf_alloc( soc->osdev, - HTT_MSG_BUF_SIZE(HTT_H2T_REO_MIGRATION_RESP_MSG_SZ), + HTT_MSG_BUF_SIZE(sizeof(htt_h2t_primary_link_peer_migrate_resp_t)), HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4, TRUE); if (!msg) @@ -2433,7 +2433,7 @@ dp_h2t_ptqm_migration_msg_send(struct dp_soc *dp_soc, uint16_t vdev_id, * 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_H2T_REO_MIGRATION_RESP_MSG_SZ) + if (qdf_nbuf_put_tail(msg, sizeof(htt_h2t_primary_link_peer_migrate_resp_t)) == NULL) { dp_htt_err("Failed to expand head for" "HTT_H2T_MSG_TYPE_PRIMARY_LINK_PEER_MIGRATE_RESP"); @@ -2442,7 +2442,7 @@ dp_h2t_ptqm_migration_msg_send(struct dp_soc *dp_soc, uint16_t vdev_id, } msg_word = (uint32_t *)qdf_nbuf_data(msg); - memset(msg_word, 0, HTT_H2T_REO_MIGRATION_RESP_MSG_SZ); + memset(msg_word, 0, sizeof(htt_h2t_primary_link_peer_migrate_resp_t)); qdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING); htt_logger_bufp = (uint8_t *)msg_word; @@ -2464,8 +2464,8 @@ dp_h2t_ptqm_migration_msg_send(struct dp_soc *dp_soc, uint16_t vdev_id, /* word 1 */ msg_word++; *msg_word = 0; - HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRCINFO_SET(*msg_word, - src_info); + HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_SRC_INFO_SET(*msg_word, + src_info); HTT_H2T_PRIMARY_LINK_PEER_MIGRATE_STATUS_SET(*msg_word, status);