summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwadesong <wadesong@codeaurora.org>2016-11-18 16:32:53 +0800
committerqcabuildsw <qcabuildsw@localhost>2016-11-29 16:07:50 -0800
commit5e0f365f7fb0d40ecb36f32e8feecc563a87b193 (patch)
tree5897973aff8c4f22412e9ea637b0f0f86c333fa5
parent360db327dbdfbee5a4337d4e7cc6dfe559332963 (diff)
qcacld-3.0: Fix a racing condition in BSS starting path
qcacld-2.0 to qcacld-3.0 propagation 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/cds/src/cds_concurrency.c1
-rw-r--r--core/hdd/inc/wlan_hdd_main.h1
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c8
-rw-r--r--core/hdd/src/wlan_hdd_hostapd.c10
-rw-r--r--core/hdd/src/wlan_hdd_main.c1
5 files changed, 16 insertions, 5 deletions
diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c
index 0940968ed4cb..aa92c0a244ec 100644
--- a/core/cds/src/cds_concurrency.c
+++ b/core/cds/src/cds_concurrency.c
@@ -7837,6 +7837,7 @@ void cds_restart_sap(hdd_adapter_t *ap_adapter)
goto end;
}
+ qdf_event_reset(&hostapd_state->qdf_event);
if (wlansap_start_bss(sap_ctx, hdd_hostapd_sap_event_cb,
sap_config,
ap_adapter->dev) != QDF_STATUS_SUCCESS) {
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h
index 3a6574c1d434..48095e422e44 100644
--- a/core/hdd/inc/wlan_hdd_main.h
+++ b/core/hdd/inc/wlan_hdd_main.h
@@ -699,6 +699,7 @@ typedef struct hdd_hostapd_state_s {
int bssState;
qdf_event_t qdf_event;
qdf_event_t qdf_stop_bss_event;
+ qdf_event_t qdf_sta_disassoc_event;
QDF_STATUS qdf_status;
bool bCommit;
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 63b2b2d3dc3f..74d44d0076db 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -13609,7 +13609,7 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
DFS_CAC_IN_PROGRESS)
goto fn_end;
- qdf_event_reset(&hapd_state->qdf_event);
+ qdf_event_reset(&hapd_state->qdf_sta_disassoc_event);
hdd_softap_sta_disassoc(pAdapter,
pDelStaParams);
qdf_status =
@@ -13620,7 +13620,7 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
isDeauthInProgress = true;
qdf_status =
qdf_wait_single_event(
- &hapd_state->qdf_event,
+ &hapd_state->qdf_sta_disassoc_event,
1000);
if (!QDF_IS_STATUS_SUCCESS(
qdf_status))
@@ -13668,7 +13668,7 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
if (pHddCtx->dev_dfs_cac_status == DFS_CAC_IN_PROGRESS)
goto fn_end;
- qdf_event_reset(&hapd_state->qdf_event);
+ qdf_event_reset(&hapd_state->qdf_sta_disassoc_event);
sme_send_disassoc_req_frame(WLAN_HDD_GET_HAL_CTX
(pAdapter), pAdapter->sessionId,
(uint8_t *)&pDelStaParams->peerMacAddr,
@@ -13684,7 +13684,7 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
return -ENOENT;
} else {
qdf_status = qdf_wait_single_event(
- &hapd_state->qdf_event,
+ &hapd_state->qdf_sta_disassoc_event,
1000);
if (!QDF_IS_STATUS_SUCCESS(qdf_status))
hdd_err("Deauth wait time expired");
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c
index 2f2746951e51..44b40e4aa2c5 100644
--- a/core/hdd/src/wlan_hdd_hostapd.c
+++ b/core/hdd/src/wlan_hdd_hostapd.c
@@ -1677,7 +1677,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
hdd_notice(" disassociated " MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(wrqu.addr.sa_data));
- qdf_status = qdf_event_set(&pHostapdState->qdf_event);
+ qdf_status = qdf_event_set(&pHostapdState->qdf_sta_disassoc_event);
if (!QDF_IS_STATUS_SUCCESS(qdf_status))
hdd_err("ERR: Station Deauth event Set failed");
@@ -5801,6 +5801,14 @@ QDF_STATUS hdd_init_ap_mode(hdd_adapter_t *pAdapter)
return qdf_status;
}
+ qdf_status = qdf_event_create(&phostapdBuf->qdf_sta_disassoc_event);
+ if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
+ hdd_err("ERROR: Hostapd HDD sta disassoc event init failed!!");
+ wlansap_close(sapContext);
+ pAdapter->sessionCtx.ap.sapContext = NULL;
+ return qdf_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 9d5317e0cbb9..defb2448f34f 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -8982,6 +8982,7 @@ void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter)
goto end;
}
+ qdf_event_reset(&hostapd_state->qdf_event);
if (wlansap_start_bss(hdd_ap_ctx->sapContext, hdd_hostapd_sap_event_cb,
&hdd_ap_ctx->sapConfig,
ap_adapter->dev)