소스 검색

qcacld-3.0: Don't allow change iface during ACS

Change iface is trying to open session before
closing the previous session when ACS is in progress.
This is causing assert in firmware due to duplicate
vdev with same mac address.

Send failure response to userspace when ACS is in
progress.

Change-Id: Ib49931c60935723c503b60334b7f299caf98f5b0
CRs-Fixed: 2030851
Sandeep Puligilla 8 년 전
부모
커밋
1e6da364dc
1개의 변경된 파일9개의 추가작업 그리고 6개의 파일을 삭제
  1. 9 6
      core/hdd/src/wlan_hdd_cfg80211.c

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

@@ -11287,7 +11287,7 @@ static int wlan_hdd_change_client_iface_to_new_mode(struct net_device *ndev,
 
 	if (test_bit(ACS_IN_PROGRESS, &hdd_ctx->g_event_flags)) {
 		hdd_warn("ACS is in progress, don't change iface!");
-		return 0;
+		return -EBUSY;
 	}
 
 	wdev = ndev->ieee80211_ptr;
@@ -11319,7 +11319,8 @@ static int wlan_hdd_change_client_iface_to_new_mode(struct net_device *ndev,
 			hdd_cfg_xlate_to_csr_phy_mode(config->dot11Mode);
 	}
 	EXIT();
-	return status;
+
+	return qdf_status_to_os_return(status);
 }
 
 static int wlan_hdd_cfg80211_change_bss(struct wiphy *wiphy,
@@ -11367,7 +11368,6 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
 	tCsrRoamProfile *pRoamProfile = NULL;
 	eCsrRoamBssType LastBSSType;
 	struct hdd_config *pConfig = NULL;
-	QDF_STATUS vstatus;
 	int status;
 
 	ENTER();
@@ -11430,10 +11430,13 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
 				hdd_deregister_tx_flow_control(pAdapter);
 				hdd_debug("Setting interface Type to ADHOC");
 			}
-			vstatus = wlan_hdd_change_client_iface_to_new_mode(ndev,
+			status = wlan_hdd_change_client_iface_to_new_mode(ndev,
 					type);
-			if (vstatus != QDF_STATUS_SUCCESS)
-				return -EINVAL;
+			if (status) {
+				hdd_err("Failed to change iface to new mode:%d status %d",
+						type, status);
+				return status;
+			}
 			if (hdd_start_adapter(pAdapter)) {
 				hdd_err("Failed to start adapter :%d",
 						pAdapter->device_mode);