diff options
| author | Padma, Santhosh Kumar <skpadma@codeaurora.org> | 2016-12-19 13:25:49 +0530 |
|---|---|---|
| committer | Ashish kumar goswami <agoswa@codeaurora.org> | 2016-12-21 19:33:56 +0530 |
| commit | 93eb1744f7af2efb0eec9911c751f6e666b34ac4 (patch) | |
| tree | 57816cca376be59ab0dd37d68532c9c5b8813026 | |
| parent | a172c24c714b118cd15a5295d11e992216785a82 (diff) | |
qcacld-2.0: Avoid waiting if driver is not in connecting stage
prima to qcacld-2.0 propagation
If disconnect is already in progress because of deauth received
from AP when disconnect is also received from supplicant, there
is a possibility that completion variable disconnect_comp_var
gets reset in hdd_DisConnectHandler because of disconnection
in progress from AP before completion variable disconnect_comp_var
gets initialized in wlan_hdd_disconnect to handle disconnect from
supplicant. This can cause a delay of 5 seconds eventhough disconnect
was already happened. This waiting is not required when previous
connection status was not eConnectionState_Connecting. Fix this delay
by adding a check to avoid waiting when previous connection status was
not eConnectionState_Connecting.
Change-Id: I58ac638622c5164fa1e9fe45c52ebf60fab2340f
CRs-Fixed: 1093562
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index ce8901f5c41b..eed598d8ba50 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -21472,6 +21472,7 @@ int wlan_hdd_disconnect( hdd_adapter_t *pAdapter, u16 reason ) unsigned long rc; hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + eConnectionState prev_conn_state; ENTER(); @@ -21479,6 +21480,8 @@ int wlan_hdd_disconnect( hdd_adapter_t *pAdapter, u16 reason ) if (0 != status) return status; + prev_conn_state = pHddStaCtx->conn_info.connState; + /*stop tx queues*/ hddLog(LOG1, FL("Disabling queues")); wlan_hdd_netif_queue_control(pAdapter, WLAN_NETIF_TX_DISABLE_N_CARRIER, @@ -21492,13 +21495,20 @@ int wlan_hdd_disconnect( hdd_adapter_t *pAdapter, u16 reason ) status = sme_RoamDisconnect( WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, reason); + if ((eHAL_STATUS_CMD_NOT_QUEUED == status) && + prev_conn_state != eConnectionState_Connecting) { + hddLog(LOG1, + FL("status = %d, already disconnected"), status); + result = 0; + goto disconnected; + } /* * Wait here instead of returning directly, this will block the next * connect command and allow processing of the scan for ssid and * the previous connect command in CSR. Else we might hit some * race conditions leading to SME and HDD out of sync. */ - if (eHAL_STATUS_CMD_NOT_QUEUED == status) { + else if (eHAL_STATUS_CMD_NOT_QUEUED == status) { hddLog(LOG1, FL("Already disconnected or connect was in sme/roam pending list and removed by disconnect")); } else if (0 != status) { |
