summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwadesong <wadesong@codeaurora.org>2016-11-17 13:35:21 +0800
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2016-11-21 13:27:14 +0530
commitfa0ce7d6db651cccf6f5f1e2212b2225e821daa2 (patch)
tree075898fc85cab2c13db48e15843661c1e6f9bfb3
parent8fd4a57e4d47d7cc41b3f67b04e26f316082be60 (diff)
qcacld-2.0: Fix a racing condition in BSS starting path
1) BSS starting path and STA disassoc path should use different events to perform synchronization 2) BSS starting event object should be reset before BSS starting/restarting procedure is initiated Change-Id: I96efd052fa19227c55c4f3af96afa8d590037c2d CRs-Fixed: 1091108
-rw-r--r--CORE/HDD/inc/wlan_hdd_main.h1
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c10
-rw-r--r--CORE/HDD/src/wlan_hdd_hostapd.c13
-rw-r--r--CORE/HDD/src/wlan_hdd_main.c2
4 files changed, 20 insertions, 6 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index 45800ecc2bc0..d473f80657aa 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -773,6 +773,7 @@ typedef struct hdd_hostapd_state_s
int bssState;
vos_event_t vosEvent;
vos_event_t stop_bss_event;
+ vos_event_t sta_disassoc_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 c5a423d23d0a..16bddfb08ff3 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -23511,14 +23511,14 @@ static int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
goto fn_end;
/* Send disassoc and deauth both to avoid some IOT issues */
- vos_event_reset(&pHostapdState->vosEvent);
+ vos_event_reset(&pHostapdState->sta_disassoc_event);
hdd_softap_sta_disassoc(pAdapter, pDelStaParams);
vos_status = hdd_softap_sta_deauth(pAdapter, pDelStaParams);
if (VOS_IS_STATUS_SUCCESS(vos_status)) {
pAdapter->aStaInfo[i].isDeauthInProgress = TRUE;
vos_status = vos_wait_single_event(
- &pHostapdState->vosEvent, 1000);
+ &pHostapdState->sta_disassoc_event, 1000);
if (!VOS_IS_STATUS_SUCCESS(vos_status))
hddLog(VOS_TRACE_LEVEL_ERROR,
"!!%s: ERROR: Deauth wait expired!!", __func__);
@@ -23560,7 +23560,7 @@ static int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
goto fn_end;
/* Send disassoc and deauth both to avoid some IOT issues */
- vos_event_reset(&pHostapdState->vosEvent);
+ vos_event_reset(&pHostapdState->sta_disassoc_event);
sme_send_disassoc_req_frame(WLAN_HDD_GET_HAL_CTX(pAdapter),
pAdapter->sessionId,
(uint8_t *)pDelStaParams->peerMacAddr,
@@ -23574,8 +23574,8 @@ static int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
MAC_ADDR_ARRAY(pDelStaParams->peerMacAddr));
return -ENOENT;
} else {
- vos_status = vos_wait_single_event(&pHostapdState->vosEvent,
- 1000);
+ vos_status = vos_wait_single_event(
+ &pHostapdState->sta_disassoc_event, 1000);
if (!VOS_IS_STATUS_SUCCESS(vos_status))
hddLog(VOS_TRACE_LEVEL_ERROR,
"!!%s: ERROR: Deauth wait expired!!", __func__);
diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c
index e04e7e103b13..e7eea5d60d47 100644
--- a/CORE/HDD/src/wlan_hdd_hostapd.c
+++ b/CORE/HDD/src/wlan_hdd_hostapd.c
@@ -2097,7 +2097,7 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa
sizeof(v_MACADDR_t));
hddLog(LOG1, " disassociated "MAC_ADDRESS_STR, MAC_ADDR_ARRAY(wrqu.addr.sa_data));
- vos_status = vos_event_set(&pHostapdState->vosEvent);
+ vos_status = vos_event_set(&pHostapdState->sta_disassoc_event);
if (!VOS_IS_STATUS_SUCCESS(vos_status))
hddLog(VOS_TRACE_LEVEL_ERROR,
"ERROR: Station deauth event reporting failed!!");
@@ -6885,6 +6885,17 @@ VOS_STATUS hdd_init_ap_mode( hdd_adapter_t *pAdapter )
return status;
}
+ status = vos_event_init(&phostapdBuf->sta_disassoc_event);
+ if (!VOS_IS_STATUS_SUCCESS(status)) {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ "ERROR: Hostapd HDD sta disassoc event init failed!!");
+#ifdef WLAN_FEATURE_MBSSID
+ WLANSAP_Close(sapContext);
+ pAdapter->sessionCtx.ap.sapContext = NULL;
+#endif
+ return status;
+ }
+
sema_init(&(WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->semWpsPBCOverlapInd, 1);
// Register as a wireless device
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 5bb949d45f61..407be421ec1f 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -1036,6 +1036,7 @@ void wlan_hdd_restart_sap(hdd_adapter_t *ap_adapter)
goto end;
}
+ vos_event_reset(&pHostapdState->vosEvent);
if (WLANSAP_StartBss(p_sap_ctx, hdd_hostapd_SAPEventCB, pConfig,
(v_PVOID_t)ap_adapter->dev) != VOS_STATUS_SUCCESS) {
hddLog(LOGE, FL("SAP Start Bss fail"));
@@ -18060,6 +18061,7 @@ void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter)
goto end;
}
+ vos_event_reset(&hostapd_state->vosEvent);
if (WLANSAP_StartBss(hdd_ap_ctx->sapContext, hdd_hostapd_SAPEventCB,
&hdd_ap_ctx->sapConfig, (v_PVOID_t)ap_adapter->dev)
!= VOS_STATUS_SUCCESS) {