소스 검색

qcacld-3.0: Dont start the adapter from the change interface

With the latest android upgrade after the sap is turned off
change interface will switch netdev back to original mode and
starting the adapter in this state will create resources even
when the upper layer is not using the netdev.
Do not start the adapter from the change interface.

Change-Id: I763879ecc84dca4115bca0e4e805b8b4b6108bb8
CRs-Fixed: 2270730
Arunk Khandavalli 6 년 전
부모
커밋
a592bb6164
1개의 변경된 파일18개의 추가작업 그리고 9개의 파일을 삭제
  1. 18 9
      core/hdd/src/wlan_hdd_cfg80211.c

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

@@ -16117,6 +16117,7 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
 	eCsrRoamBssType LastBSSType;
 	struct hdd_config *pConfig = NULL;
 	int status;
+	bool iff_up = (ndev->flags & IFF_UP);
 
 	hdd_enter();
 
@@ -16186,10 +16187,12 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
 						type, status);
 				return status;
 			}
-			if (hdd_start_adapter(adapter)) {
-				hdd_err("Failed to start adapter :%d",
+			if (iff_up) {
+				if (hdd_start_adapter(adapter)) {
+					hdd_err("Failed to start adapter: %d",
 						adapter->device_mode);
-				return -EINVAL;
+					return -EINVAL;
+				}
 			}
 			goto done;
 		case NL80211_IFTYPE_AP:
@@ -16241,9 +16244,12 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
 
 			hdd_set_ap_ops(adapter->dev);
 
-			if (hdd_start_adapter(adapter)) {
-				hdd_err("Error initializing the ap mode");
-				return -EINVAL;
+			if (iff_up) {
+				if (hdd_start_adapter(adapter)) {
+					hdd_err("Failed to start adapter: %d",
+						adapter->device_mode);
+					return -EINVAL;
+				}
 			}
 			/* Interface type changed update in wiphy structure */
 			if (wdev) {
@@ -16269,10 +16275,13 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
 					type);
 			if (status != QDF_STATUS_SUCCESS)
 				return status;
-			if (hdd_start_adapter(adapter)) {
-				hdd_err("Failed to start adapter: %d",
+
+			if (iff_up) {
+				if (hdd_start_adapter(adapter)) {
+					hdd_err("Failed to start adapter: %d",
 						adapter->device_mode);
-				return -EINVAL;
+					return -EINVAL;
+				}
 			}
 			goto done;