Browse Source

qcacld-3.0: Don't allow set_fast_roaming if roaming is in progress

When roaming/roam sync is in progress, the host receives a "disable
fast roaming" indication from the supplicant. Host process roaming
or roam sync indication in schedular thread and process disable
fast roaming process is in a supplicant thread. As both processes
are executed in different threads, there is a possibility in the
host that the roaming state gets changes from ROAM_SYNCH_IN_PROG
to RSO_STOPPED or ROAMING_IN_PROG to RSO_STOPPED in the middle of
roaming.

A state change in the middle of roaming can lead to multiple
issues.

To avoid this host should not process disable roaming indication
from userspace, if roaming is in progress.

Change-Id: I9b02683eab7db9b5be12ada6d922073e5267b8a5
CRs-Fixed: 2944303
abhinav kumar 3 years ago
parent
commit
5b8594d59a
1 changed files with 11 additions and 2 deletions
  1. 11 2
      core/hdd/src/wlan_hdd_cfg80211.c

+ 11 - 2
core/hdd/src/wlan_hdd_cfg80211.c

@@ -13853,7 +13853,6 @@ static int __wlan_hdd_cfg80211_set_fast_roaming(struct wiphy *wiphy,
 	int ret;
 	QDF_STATUS qdf_status;
 	unsigned long rc;
-	mac_handle_t mac_handle;
 	bool roaming_enabled;
 
 	hdd_enter_dev(dev);
@@ -13862,6 +13861,12 @@ static int __wlan_hdd_cfg80211_set_fast_roaming(struct wiphy *wiphy,
 	if (0 != ret)
 		return ret;
 
+	if (adapter->device_mode != QDF_STA_MODE) {
+		hdd_err_rl("command not allowed in %d mode, vdev_id: %d",
+			   adapter->device_mode, adapter->vdev_id);
+		return -EINVAL;
+	}
+
 	if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
 		hdd_err("Command not allowed in FTM mode");
 		return -EINVAL;
@@ -13885,6 +13890,11 @@ static int __wlan_hdd_cfg80211_set_fast_roaming(struct wiphy *wiphy,
 				tb[QCA_WLAN_VENDOR_ATTR_ROAMING_POLICY]);
 	hdd_debug("ROAM_CONFIG: isFastRoamEnabled %d", is_fast_roam_enabled);
 
+	if (sme_roaming_in_progress(hdd_ctx->mac_handle, adapter->vdev_id)) {
+		hdd_err_rl("Roaming in progress for vdev %d", adapter->vdev_id);
+		return -EAGAIN;
+	}
+
 	/*
 	 * Get current roaming state and decide whether to wait for RSO_STOP
 	 * response or not.
@@ -13893,7 +13903,6 @@ static int __wlan_hdd_cfg80211_set_fast_roaming(struct wiphy *wiphy,
 						  adapter->vdev_id);
 
 	/* Update roaming */
-	mac_handle = hdd_ctx->mac_handle;
 	qdf_status = ucfg_user_space_enable_disable_rso(hdd_ctx->pdev,
 							adapter->vdev_id,
 							is_fast_roam_enabled);