diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index b36ef6e874..51fd776938 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -1106,6 +1106,18 @@ QDF_STATUS wlan_mlme_set_primary_interface(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS wlan_mlme_set_default_primary_iface(struct wlan_objmgr_psoc *psoc); +/** + * wlan_mlme_is_primary_interface_configured() - Check if primary iface is set + * @psoc: pointer to psoc object + * + * Check if primary iface is configured from userspace through vendor command. + * Return true if it's configured. If it's not configured, default value would + * be 0xFF and return false then. + * + * Return: True or False + */ +bool wlan_mlme_is_primary_interface_configured(struct wlan_objmgr_psoc *psoc); + /** * wlan_mlme_get_mcc_duty_cycle_percentage() - Get primary STA iface duty * cycle percentage diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index 03e50eb8d6..6023d3e491 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -2651,6 +2651,15 @@ QDF_STATUS wlan_mlme_set_primary_interface(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +bool wlan_mlme_is_primary_interface_configured(struct wlan_objmgr_psoc *psoc) +{ + uint8_t dual_sta_config = 0xFF; + + wlan_mlme_get_dual_sta_policy(psoc, &dual_sta_config); + return (dual_sta_config == + QCA_WLAN_CONCURRENT_STA_POLICY_PREFER_PRIMARY); +} + int wlan_mlme_get_mcc_duty_cycle_percentage(struct wlan_objmgr_pdev *pdev) { struct wlan_objmgr_psoc *psoc = NULL; diff --git a/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c b/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c index 1ea219d39d..7793f63871 100644 --- a/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c +++ b/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c @@ -3644,7 +3644,6 @@ cm_roam_switch_to_init(struct wlan_objmgr_pdev *pdev, struct wlan_mlme_psoc_ext_obj *mlme_obj; struct dual_sta_policy *dual_sta_policy; struct wlan_objmgr_vdev *vdev; - bool is_vdev_primary = false; if (!psoc) return QDF_STATUS_E_FAILURE; @@ -3679,6 +3678,23 @@ cm_roam_switch_to_init(struct wlan_objmgr_pdev *pdev, mlme_info("STA + STA concurrency is in DBS"); break; } + + /* + * set_primary_vdev usecase is to use that + * interface(e.g. wlan0) over the other + * interface(i.e. wlan1) for data transfer. Non-primary + * vdev use case is to check the quality of that link + * and decide if data can be switched to it and make it + * primary. + * Enabling roaming on non-primary vdev also in this + * context would always helps to find better AP. + */ + if (wlan_mlme_is_primary_interface_configured(psoc) && + (reason != REASON_SUPPLICANT_INIT_ROAMING)) { + mlme_info("STA + STA concurrency with a primary iface, have roaming enabled on both interfaces"); + break; + } + /* * Disable roaming on the enabled sta if supplicant wants to * enable roaming on this vdev id @@ -3694,19 +3710,14 @@ cm_roam_switch_to_init(struct wlan_objmgr_pdev *pdev, * vdev id if it is not an explicit enable from * supplicant. */ - mlme_debug("Interface vdev_id: %d, roaming enabled on vdev_id: %d, primary vdev_id:%d, reason:%d", + mlme_debug("Interface vdev_id: %d, roaming enabled on vdev_id: %d, reason:%d", vdev_id, temp_vdev_id, - dual_sta_policy->primary_vdev_id, reason); + reason); - if (vdev_id == dual_sta_policy->primary_vdev_id) - is_vdev_primary = true; - - if (is_vdev_primary || - reason == REASON_SUPPLICANT_INIT_ROAMING) { + if (reason == REASON_SUPPLICANT_INIT_ROAMING) { cm_roam_state_change(pdev, temp_vdev_id, WLAN_ROAM_DEINIT, - is_vdev_primary ? - REASON_ROAM_SET_PRIMARY : reason, + reason, NULL, false); } else { mlme_info("CM_RSO: Roam module already initialized on vdev:[%d]",