Procházet zdrojové kódy

qcacld-3.0: Don't return max connection error before doing disconnect

qcacld-2.0 to qcacld-3.0 propagation

In some cases, it is possible that driver get request for connection
from supplicant without getting disconnect for previous connection.
If there are two active session, driver will return the error.
Driver should do disconnect first followed by check for
max concurrency is allowed.

Change-Id: Ie7bf202c47d0282019730448096d91c7dc888e34
CRs-Fixed: 945566
Agrawal Ashish před 8 roky
rodič
revize
f156e94f6a
1 změnil soubory, kde provedl 10 přidání a 9 odebrání
  1. 10 9
      core/hdd/src/wlan_hdd_cfg80211.c

+ 10 - 9
core/hdd/src/wlan_hdd_cfg80211.c

@@ -11046,6 +11046,16 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
 	if (true == wlan_hdd_reassoc_bssid_hint(pAdapter, req, &status))
 		return status;
 
+	wlan_hdd_disable_roaming(pAdapter);
+
+	/* Try disconnecting if already in connected state */
+	status = wlan_hdd_try_disconnect(pAdapter);
+	if (0 > status) {
+		hdd_err("Failed to disconnect the existing connection");
+		return -EALREADY;
+	}
+
+	/* Check for max concurrent connections after doing disconnect if any */
 	if (req->channel) {
 		if (!cds_allow_concurrency(
 				cds_convert_device_mode_to_qdf_type(
@@ -11063,15 +11073,6 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
 		}
 	}
 
-	wlan_hdd_disable_roaming(pAdapter);
-
-	/*Try disconnecting if already in connected state */
-	status = wlan_hdd_try_disconnect(pAdapter);
-	if (0 > status) {
-		hdd_err("Failed to disconnect the existing connection");
-		return -EALREADY;
-	}
-
 	/*initialise security parameters */
 	status = wlan_hdd_cfg80211_set_privacy(pAdapter, req);