Commit 477440a2 authored by Nirav Shah's avatar Nirav Shah Committed by Madan Mohan Koyyalamudi
Browse files

qcacld: Reset vosEvent before waiting for it.

Reset/Initialize vosEvent before issueing WLANSAP_StopBss
to wait for delete bss response to avoid race condition.

Change-Id: I50af469bc6b7dd96eabd35d6ee9431ef103a2ae3
CRs-fixed: 762382
parent 2ea0855e
......@@ -4242,6 +4242,9 @@ static int iw_softap_stopbss(struct net_device *dev,
if(test_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags))
{
hdd_hostapd_state_t *pHostapdState =
WLAN_HDD_GET_HOSTAP_STATE_PTR(pHostapdAdapter);
vos_event_reset(&pHostapdState->vosEvent);
#ifdef WLAN_FEATURE_MBSSID
status = WLANSAP_StopBss(WLAN_HDD_GET_SAP_CTX_PTR(pHostapdAdapter));
#else
......@@ -4249,8 +4252,6 @@ static int iw_softap_stopbss(struct net_device *dev,
#endif
if (VOS_IS_STATUS_SUCCESS(status))
{
hdd_hostapd_state_t *pHostapdState = WLAN_HDD_GET_HOSTAP_STATE_PTR(pHostapdAdapter);
status = vos_wait_single_event(&pHostapdState->vosEvent, 10000);
if (!VOS_IS_STATUS_SUCCESS(status))
......
......@@ -603,6 +603,8 @@ 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);
if ( VOS_STATUS_SUCCESS == WLANSAP_StopBss(
#ifdef WLAN_FEATURE_MBSSID
pHddApCtx->sapContext
......@@ -9336,6 +9338,9 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter,
{
VOS_STATUS status;
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);
//Stop Bss.
#ifdef WLAN_FEATURE_MBSSID
......@@ -9346,9 +9351,6 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter,
if (VOS_IS_STATUS_SUCCESS(status))
{
hdd_hostapd_state_t *pHostapdState =
WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter);
status = vos_wait_single_event(&pHostapdState->vosEvent, 10000);
if (!VOS_IS_STATUS_SUCCESS(status))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment