diff options
| author | Abhishek Singh <absingh@qti.qualcomm.com> | 2015-06-08 15:39:14 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2015-06-21 20:40:53 +0530 |
| commit | f14e42229ee806003f3a57b98dda7ff0a93baf07 (patch) | |
| tree | bb8828bea4877fc39f1683e560158bf39be6f34b | |
| parent | 958e98499edd5d086890a9d64b2a25b6e4ebb38d (diff) | |
qcacld-2.0: wlan: Deregister all the peers from TL during IBSS leave
This is prima to qcacld-2.0 propagation
If user change the BSSID/SSID and restart the IBSS network, during
IBSS leave the driver deletes only the 1st peer and all other
entries are not deleted. Now when the IBSS restarts and try to
register a sta with the staID which is already present in the
stale entries, the registeration fails and thus the BSSID values
in TL are not updated for all these stale peers. Due to this the
data to these peers uses the old BSSID.
This change take care of Deregistering all the active IBSS peers
during IBSS leave.
Change-Id: Id1ce0ffd880b8c2c8afd46414a59ba7bb87d5b6f
CRs-Fixed: 841565
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_assoc.c | 51 |
1 files changed, 39 insertions, 12 deletions
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c index 194b626bc9ff..6c30ca368875 100644 --- a/CORE/HDD/src/wlan_hdd_assoc.c +++ b/CORE/HDD/src/wlan_hdd_assoc.c @@ -1020,6 +1020,8 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * sme_FTReset(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId); #endif if (eCSR_ROAM_IBSS_LEAVE == roamStatus) { + v_U8_t i; + sta_id = IBSS_BROADCAST_STAID; vstatus = hdd_roamDeregisterSTA(pAdapter, sta_id); if (!VOS_IS_STATUS_SUCCESS(vstatus)) { @@ -1029,22 +1031,47 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * status = eHAL_STATUS_FAILURE; } pHddCtx->sta_to_adapter[sta_id] = NULL; - } - sta_id = pHddStaCtx->conn_info.staId[0]; - //We should clear all sta register with TL, for now, only one. - vstatus = hdd_roamDeregisterSTA( pAdapter, sta_id ); - if ( !VOS_IS_STATUS_SUCCESS(vstatus ) ) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "hdd_roamDeregisterSTA() failed to for staID %d. " - "Status= %d [0x%x]", - sta_id, status, status ); + /*Clear all the peer sta register with TL.*/ + for (i =0; i < HDD_MAX_NUM_IBSS_STA; i++) { + if (0 != pHddStaCtx->conn_info.staId[i]) { + sta_id = pHddStaCtx->conn_info.staId[i]; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL("Deregister StaID %d"),sta_id); + vstatus = hdd_roamDeregisterSTA( pAdapter, sta_id ); + if (!VOS_IS_STATUS_SUCCESS(vstatus)) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("hdd_roamDeregisterSTA() failed to for staID %d. " + "Status= %d [0x%x]"), + sta_id, status, status); + status = eHAL_STATUS_FAILURE; + } - status = eHAL_STATUS_FAILURE; + /*set the staid and peer mac as 0, all other reset are + * done in hdd_connRemoveConnectInfo. + */ + pHddStaCtx->conn_info.staId[i]= 0; + vos_mem_zero(&pHddStaCtx->conn_info.peerMacAddress[i], sizeof(v_MACADDR_t)); + if (sta_id < (WLAN_MAX_STA_COUNT + 3)) + pHddCtx->sta_to_adapter[sta_id] = NULL; + } + } + } else { + sta_id = pHddStaCtx->conn_info.staId[0]; + //We should clear all sta register with TL, for now, only one. + vstatus = hdd_roamDeregisterSTA( pAdapter, sta_id ); + if (!VOS_IS_STATUS_SUCCESS(vstatus)) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("hdd_roamDeregisterSTA() failed to for staID %d. " + "Status= %d [0x%x]"), + sta_id, status, status); + + status = eHAL_STATUS_FAILURE; + } + pHddCtx->sta_to_adapter[sta_id] = NULL; } - pHddCtx->sta_to_adapter[sta_id] = NULL; + // Clear saved connection information in HDD hdd_connRemoveConnectInfo( pHddStaCtx ); VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, |
