Commit 83bdc8ea authored by Yun Park's avatar Yun Park Committed by Madan Mohan Koyyalamudi
Browse files

cld: 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
parent c56e1c3e
......@@ -719,6 +719,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;
......
......@@ -5808,15 +5808,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!!"));
......
/*
* 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.
*
......@@ -1522,7 +1522,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 userspace that the BSS has stopped */
memset(&we_custom_event, '\0', sizeof(we_custom_event));
......@@ -4244,7 +4244,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
......@@ -4252,8 +4252,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,
......@@ -5415,6 +5415,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);
......
......@@ -603,7 +603,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
......@@ -612,8 +612,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;
......@@ -9340,7 +9340,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
......@@ -9351,8 +9351,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",
......
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