From 1e6da364dcd5711e7a76c7302912f16da6776d8f Mon Sep 17 00:00:00 2001 From: Sandeep Puligilla Date: Fri, 7 Apr 2017 14:16:03 -0700 Subject: [PATCH] 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 --- core/hdd/src/wlan_hdd_cfg80211.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 9dc6a6331bf2..00172a3d8aae 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/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);