wlan: Fix for reject scan when connection in progress.
Scan request will return EBUSY when connection in progress.
Change-Id: Id869f88f218d47d67e58c320b1ef169a2c533861
CR-Fixed: 418188
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index e921703..acc5533 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -3731,11 +3731,21 @@
hddLog(VOS_TRACE_LEVEL_INFO, "%s: device_mode = %d\n",
__func__,pAdapter->device_mode);
+
+ if( (WLAN_HDD_INFRA_STATION == pAdapter->device_mode) &&
+ (eConnectionState_Connecting ==
+ (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState) )
+ {
+ hddLog(VOS_TRACE_LEVEL_ERROR,
+ "%s: Connection in progress: Scan request denied (EBUSY)", __func__);
+ return -EBUSY;
+ }
+
#ifdef WLAN_BTAMP_FEATURE
//Scan not supported when AMP traffic is on.
- if( VOS_TRUE == WLANBAP_AmpSessionOn() )
+ if( VOS_TRUE == WLANBAP_AmpSessionOn() )
{
- hddLog(VOS_TRACE_LEVEL_ERROR,
+ hddLog(VOS_TRACE_LEVEL_ERROR,
"%s: No scanning when AMP is on", __func__);
return -EOPNOTSUPP;
}
@@ -4200,7 +4210,14 @@
hddLog(VOS_TRACE_LEVEL_ERROR, "%s: No valid Roam profile", __func__);
return -EINVAL;
}
- EXIT();
+
+ if( WLAN_HDD_INFRA_STATION == pAdapter->device_mode )
+ {
+ (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState =
+ eConnectionState_Connecting;
+ }
+
+ EXIT();
return status;
}