summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaveen Rawat <nrawat@qca.qualcomm.com>2015-01-20 14:40:36 -0800
committerAnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com>2015-01-21 15:26:39 +0530
commitf8a36e423b73cb3af98951de762562ca6e1bb92d (patch)
treeeee93d9c7a33bc9c99b6d77c010db496dd3b326d
parent546554095e40eb41596f894b4620a7d81f996b19 (diff)
qcacld: fix for clients not being able to connect after SAP restart
pHostapdState->vosEvent is a shared event for StartBss, StopBss and Sta_Disassoc completion. When hdd calls WLANSAP_StopBss it waits on this event assuming, StopBss completion will trigger the event. But: 1) DISASSOC event from one of the earlier STA comes late and falsely trigger the event (even before WLANSAP_StopBss complete). 2) This causes SAP restart sequence to be messed up and 3) followed by inconsistent vdev_id between host and firmware. 4) Because of this FW is then dropping MGMT packets sent from host and 5) hence clients are not able to connect to SAP. Change-Id: Ib1f670ee0ab9dff7fab25f4402bbd278f014bea2 CRs-Fixed: 767351
-rw-r--r--CORE/HDD/inc/wlan_hdd_main.h1
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c6
-rw-r--r--CORE/HDD/src/wlan_hdd_hostapd.c22
-rwxr-xr-xCORE/HDD/src/wlan_hdd_main.c15
4 files changed, 29 insertions, 15 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index d6d16553819e..ed999a8f954e 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -682,6 +682,7 @@ typedef struct hdd_hostapd_state_s
{
int bssState;
vos_event_t vosEvent;
+ vos_event_t stop_bss_event;
VOS_STATUS vosStatus;
v_BOOL_t bCommit;
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 413bd51ece1d..d71813c248d5 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -7640,15 +7640,15 @@ static int wlan_hdd_cfg80211_stop_ap (struct wiphy *wiphy,
hdd_hostapd_state_t *pHostapdState =
WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter);
- vos_event_reset(&pHostapdState->vosEvent);
+ vos_event_reset(&pHostapdState->stop_bss_event);
#ifdef WLAN_FEATURE_MBSSID
status = WLANSAP_StopBss(WLAN_HDD_GET_SAP_CTX_PTR(pAdapter));
#else
status = WLANSAP_StopBss(pHddCtx->pvosContext);
#endif
if (VOS_IS_STATUS_SUCCESS(status)) {
- status = vos_wait_single_event(&pHostapdState->vosEvent, 10000);
-
+ status = vos_wait_single_event(&pHostapdState->stop_bss_event,
+ 10000);
if (!VOS_IS_STATUS_SUCCESS(status)) {
hddLog(VOS_TRACE_LEVEL_ERROR,
FL("HDD vos wait for single_event failed!!"));
diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c
index 45b04f2e2de9..9dae97a42907 100644
--- a/CORE/HDD/src/wlan_hdd_hostapd.c
+++ b/CORE/HDD/src/wlan_hdd_hostapd.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -1686,7 +1686,7 @@ stopbss :
* not be touched since they are now subject to being deleted
* by another thread */
if (eSAP_STOP_BSS_EVENT == sapEvent)
- vos_event_set(&pHostapdState->vosEvent);
+ vos_event_set(&pHostapdState->stop_bss_event);
/* Notify user space that the BSS has stopped */
memset(&we_custom_event, '\0', sizeof(we_custom_event));
@@ -4363,7 +4363,7 @@ static int iw_softap_stopbss(struct net_device *dev,
{
hdd_hostapd_state_t *pHostapdState =
WLAN_HDD_GET_HOSTAP_STATE_PTR(pHostapdAdapter);
- vos_event_reset(&pHostapdState->vosEvent);
+ vos_event_reset(&pHostapdState->stop_bss_event);
#ifdef WLAN_FEATURE_MBSSID
status = WLANSAP_StopBss(WLAN_HDD_GET_SAP_CTX_PTR(pHostapdAdapter));
#else
@@ -4371,8 +4371,8 @@ static int iw_softap_stopbss(struct net_device *dev,
#endif
if (VOS_IS_STATUS_SUCCESS(status))
{
- status = vos_wait_single_event(&pHostapdState->vosEvent, 10000);
-
+ status = vos_wait_single_event(&pHostapdState->stop_bss_event,
+ 10000);
if (!VOS_IS_STATUS_SUCCESS(status))
{
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
@@ -5232,6 +5232,18 @@ VOS_STATUS hdd_init_ap_mode( hdd_adapter_t *pAdapter )
return status;
}
+ status = vos_event_init(&phostapdBuf->stop_bss_event);
+ if (!VOS_IS_STATUS_SUCCESS(status))
+ {
+ VOS_TRACE(VOS_MODULE_ID_HDD,
+ VOS_TRACE_LEVEL_ERROR,
+ "ERROR: Hostapd HDD stop bss event init failed!!");
+#ifdef WLAN_FEATURE_MBSSID
+ WLANSAP_Close(sapContext);
+#endif
+ return status;
+ }
+
init_completion(&pAdapter->session_close_comp_var);
init_completion(&pAdapter->session_open_comp_var);
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 6506dedc5c2a..82f5bfc481a8 100755
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -978,7 +978,7 @@ static void wlan_hdd_restart_sap(hdd_adapter_t *ap_adapter)
hdd_cleanup_actionframe(pHddCtx, ap_adapter);
pHostapdState = WLAN_HDD_GET_HOSTAP_STATE_PTR(ap_adapter);
- vos_event_reset(&pHostapdState->vosEvent);
+ vos_event_reset(&pHostapdState->stop_bss_event);
if ( VOS_STATUS_SUCCESS == WLANSAP_StopBss(
#ifdef WLAN_FEATURE_MBSSID
@@ -987,8 +987,8 @@ static void wlan_hdd_restart_sap(hdd_adapter_t *ap_adapter)
(WLAN_HDD_GET_CTX(ap_adapter))->pvosContext
#endif
)) {
- vos_status = vos_wait_single_event(&pHostapdState->vosEvent, 10000);
-
+ vos_status = vos_wait_single_event(&pHostapdState->stop_bss_event,
+ 10000);
if (!VOS_IS_STATUS_SUCCESS(vos_status)) {
hddLog(LOGE, FL("SAP Stop Failed"));
goto end;
@@ -10104,7 +10104,7 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter,
hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
hdd_hostapd_state_t *pHostapdState =
WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter);
- vos_event_reset(&pHostapdState->vosEvent);
+ vos_event_reset(&pHostapdState->stop_bss_event);
//Stop Bss.
#ifdef WLAN_FEATURE_MBSSID
@@ -10115,8 +10115,8 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter,
if (VOS_IS_STATUS_SUCCESS(status))
{
- status = vos_wait_single_event(&pHostapdState->vosEvent, 10000);
-
+ status = vos_wait_single_event(&pHostapdState->stop_bss_event,
+ 10000);
if (!VOS_IS_STATUS_SUCCESS(status))
{
hddLog(LOGE, "%s: failure waiting for WLANSAP_StopBss %d",
@@ -14795,7 +14795,8 @@ void wlan_hdd_stop_sap(hdd_adapter_t *ap_adapter)
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH,
FL("Now doing SAP STOPBSS"));
if (VOS_STATUS_SUCCESS == WLANSAP_StopBss(hdd_ap_ctx->sapContext)) {
- vos_status = vos_wait_single_event(&hostapd_state->vosEvent, 10000);
+ vos_status = vos_wait_single_event(&hostapd_state->stop_bss_event,
+ 10000);
if (!VOS_IS_STATUS_SUCCESS(vos_status)) {
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
FL("SAP Stop Failed"));