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
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 9dc6a63..00172a3 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -11287,7 +11287,7 @@
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 @@
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 @@
tCsrRoamProfile *pRoamProfile = NULL;
eCsrRoamBssType LastBSSType;
struct hdd_config *pConfig = NULL;
- QDF_STATUS vstatus;
int status;
ENTER();
@@ -11430,10 +11430,13 @@
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);