Commit e8c6f7a3 authored by Manikandan Mohan's avatar Manikandan Mohan Committed by Madan Mohan Koyyalamudi
Browse files

qcacld HDD: Wait Deauth response for sta deletion

When SAP is restarted, all connected station are disassociated
and deauthenticated. But Cfg80211 layer return immediately.
This result in some station not getting really disassociated.
This update fixes this situation by waiting for deauth completion
before proceeding with next station deauth.

Change-Id: I09551c813736c1b75a1b70ade73011ad0494875e
CRs-fixed: 767351
parent 842cca9c
......@@ -11561,7 +11561,8 @@ static int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
{
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
hdd_context_t *pHddCtx;
VOS_STATUS vos_status;
VOS_STATUS vos_status = VOS_STATUS_E_FAILURE;
hdd_hostapd_state_t *pHostapdState;
int status;
v_U8_t staId;
 
......@@ -11581,6 +11582,13 @@ static int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
 
if ((WLAN_HDD_SOFTAP == pAdapter->device_mode) ||
(WLAN_HDD_P2P_GO == pAdapter->device_mode)) {
pHostapdState = WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter);
if (!pHostapdState) {
hddLog(VOS_TRACE_LEVEL_FATAL,
"%s: pHostapdState is Null", __func__);
return 0;
}
if (NULL == mac) {
v_U16_t i;
for (i = 0; i < WLAN_MAX_STA_COUNT; i++) {
......@@ -11593,10 +11601,17 @@ static int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
__func__, MAC_ADDR_ARRAY(macAddr));
 
/* Send disassoc and deauth both to avoid some IOT issues */
vos_event_reset(&pHostapdState->vosEvent);
hdd_softap_sta_disassoc(pAdapter, macAddr);
vos_status = hdd_softap_sta_deauth(pAdapter, macAddr);
if (VOS_IS_STATUS_SUCCESS(vos_status))
if (VOS_IS_STATUS_SUCCESS(vos_status)) {
pAdapter->aStaInfo[i].isDeauthInProgress = TRUE;
vos_status = vos_wait_single_event(
&pHostapdState->vosEvent, 1000);
if (!VOS_IS_STATUS_SUCCESS(vos_status))
hddLog(VOS_TRACE_LEVEL_ERROR,
"!!%s: ERROR: Deauth wait expired!!", __func__);
}
}
}
} else {
......@@ -11626,6 +11641,7 @@ static int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
MAC_ADDR_ARRAY(mac));
 
/* Send disassoc and deauth both to avoid some IOT issues */
vos_event_reset(&pHostapdState->vosEvent);
hdd_softap_sta_disassoc(pAdapter, mac);
vos_status = hdd_softap_sta_deauth(pAdapter, mac);
if (!VOS_IS_STATUS_SUCCESS(vos_status)) {
......@@ -11636,6 +11652,12 @@ static int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
__func__,
MAC_ADDR_ARRAY(mac));
return -ENOENT;
} else {
vos_status = vos_wait_single_event(&pHostapdState->vosEvent,
1000);
if (!VOS_IS_STATUS_SUCCESS(vos_status))
hddLog(VOS_TRACE_LEVEL_ERROR,
"!!%s: ERROR: Deauth wait expired!!", __func__);
}
}
}
......
......@@ -1203,6 +1203,12 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa
memcpy(wrqu.addr.sa_data, &pSapEvent->sapevt.sapStationDisassocCompleteEvent.staMac,
sizeof(v_MACADDR_t));
hddLog(LOG1, " disassociated "MAC_ADDRESS_STR, MAC_ADDR_ARRAY(wrqu.addr.sa_data));
vos_status = vos_event_set(&pHostapdState->vosEvent);
if (!VOS_IS_STATUS_SUCCESS(vos_status))
hddLog(VOS_TRACE_LEVEL_ERROR,
"ERROR: Station deauth event reporting failed!!");
if (pSapEvent->sapevt.sapStationDisassocCompleteEvent.reason == eSAP_USR_INITATED_DISASSOC)
hddLog(LOG1," User initiated disassociation");
else
......
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