diff options
| author | Akash Patel <akashp@codeaurora.org> | 2014-07-25 12:07:42 -0700 |
|---|---|---|
| committer | Akash Patel <akashp@codeaurora.org> | 2014-07-25 12:09:49 -0700 |
| commit | 7526f0018f1bf73afbdd4f4868c33a0bbc02e2c2 (patch) | |
| tree | 0c7898d9f270cabc51961b7a4c990dd0c85828c7 | |
| parent | 7638c5c017eeffa6497fac12867b3938cdb3e97c (diff) | |
| parent | 7a72bda3b98e4255ef0fb3ed560f1135d6671e28 (diff) | |
Release 1.0.0.155 QCACLD WLAN Driver
Merge remote-tracking branch 'origin/caf/caf-wlan/master'
* origin/caf/caf-wlan/master:
Cafstaging Release 1.0.0.155
qcacld: Fix for driver crash when invalid country code is set
qcacld: dont send connect result to kernel,if HDD's discon is pending
qcacld: Abort scan for SSID if deauth is received from supplicant.
qcacld: From HDD remove the logic to try shared auth if open fails.
qcacld: [HIF] host crash during the test for BT BNEP profile
qcacld: [HIF] Unable to download firmware during SU DevTest auto test
qcacld-new: FW crash triggers kernel panic and saves full ram dump
QCACLD: Store ACS channel config in SAP context
qca-cld: tx pause event handle with tasklet context
qcacld: DFS: Fix channel bonding mode during vdev restart request.
qcacld: Remove references to CSR session Id
qcacld: HDD_VOSS: STA+STA roaming sessionization
qcacld: WMA_TLSHIM: Roaming sessionization
qcacld: UMAC: Neighbor roam sessionization
qcacld: UMAC: Provide fix for sessionizing Fast Transition
qcacld: HDD: Provide fix for sessionizing Fast Transition
qcacld: WMA: Provide fix for sessionizing Fast Transition
qca-cld:cld_txrx: Fix static analysis issues in tl_shim.c
qcacld: Cleanup UNII-1 band channel assignment.
Change-Id: I3cdea2344eecd24802479541c15d7d0dae0865ad
77 files changed, 5338 insertions, 3601 deletions
diff --git a/CORE/CLD_TXRX/TLSHIM/tl_shim.c b/CORE/CLD_TXRX/TLSHIM/tl_shim.c index 31407d8cf24d..517c1a6bff3e 100644 --- a/CORE/CLD_TXRX/TLSHIM/tl_shim.c +++ b/CORE/CLD_TXRX/TLSHIM/tl_shim.c @@ -516,6 +516,12 @@ is_ccmp_pn_replay_attack(void *vos_ctx, struct ieee80211_frame *wh, peer = ol_txrx_find_peer_by_addr_and_vdev(pdev, vdev, wh->i_addr2, &peer_id); + if (NULL == peer) { + TLSHIM_LOGE( + "%s: Failed to find peer, Not able to validate PN", __func__); + return true; + } + new_pn = tl_shim_extract_ccmp_pn(ccmp_ptr); last_pn_valid = &peer->last_rmf_pn_valid; last_pn = &peer->last_rmf_pn; @@ -616,6 +622,7 @@ static int tlshim_mgmt_rx_process(void *context, u_int8_t *data, * was found. */ rx_pkt->pkt_meta.roamCandidateInd = saved_beacon ? 1 : 0; + rx_pkt->pkt_meta.sessionId = vdev_id; /* Why not just use rx_event->hdr.buf_len? */ wbuf = adf_nbuf_alloc(NULL, roundup(hdr->buf_len, 4), @@ -1237,6 +1244,10 @@ adf_nbuf_t WLANTL_SendIPA_DataFrame(void *vos_ctx, void *vdev, adf_nbuf_t ret; ENTER(); + if (NULL == tl_shim) { + TLSHIM_LOGW("INVALID TL SHIM CONTEXT"); + return skb; + } if (!adf_os_atomic_read(&tl_shim->vdev_active[interface_id])) { TLSHIM_LOGW("INACTIVE VDEV"); @@ -2620,6 +2631,11 @@ void WLANTL_RegisterOPCbFnc(void *vos_ctx, } tl_shim = vos_get_context(VOS_MODULE_ID_TL, vos_ctx); + if (NULL == tl_shim) { + TLSHIM_LOGW("Invalid TL Shim context"); + return; + } + tl_shim->fw_op_cb = func; wdi_in_ipa_uc_register_op_cb(((pVosContextType)vos_ctx)->pdev_txrx_ctx, WLANTL_IpaUcOpEventHandler, (void *)tl_shim); diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h index 81b8861fb870..570823d02c0b 100644 --- a/CORE/HDD/inc/wlan_hdd_main.h +++ b/CORE/HDD/inc/wlan_hdd_main.h @@ -102,7 +102,6 @@ #define WLAN_WAIT_TIME_STATS 800 #define WLAN_WAIT_TIME_POWER 800 #define WLAN_WAIT_TIME_COUNTRY 1000 -#define WLAN_WAIT_TIME_CHANNEL_UPDATE 600 /* Amount of time to wait for sme close session callback. This value should be larger than the timeout used by WDI to wait for a response from WCNSS */ @@ -1300,11 +1299,6 @@ struct hdd_context_s struct completion driver_crda_req; #endif - /* Completion variable to indicate updation of channel */ - struct completion wiphy_channel_update_event; - - v_BOOL_t nEnableStrictRegulatoryForFCC; - v_BOOL_t isWlanSuspended; v_BOOL_t isTxThreadSuspended; @@ -1323,6 +1317,8 @@ struct hdd_context_s v_BOOL_t isUnloadInProgress; + v_BOOL_t isCleanUpDone; + /**Track whether driver has been suspended.*/ hdd_ps_state_t hdd_ps_state; @@ -1733,4 +1729,8 @@ void wlan_hdd_cfg80211_link_layer_stats_init(hdd_context_t *pHddCtx); #endif void hdd_update_macaddr(hdd_config_t *cfg_ini, v_MACADDR_t hw_macaddr); +#if defined(FEATURE_WLAN_LFR) && defined(WLAN_FEATURE_ROAM_SCAN_OFFLOAD) +void wlan_hdd_disable_roaming(hdd_adapter_t *pAdapter); +void wlan_hdd_enable_roaming(hdd_adapter_t *pAdapter); +#endif #endif // end #if !defined( WLAN_HDD_MAIN_H ) diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c index 7cabad88f76b..ecb660c7b30a 100644 --- a/CORE/HDD/src/wlan_hdd_assoc.c +++ b/CORE/HDD/src/wlan_hdd_assoc.c @@ -438,7 +438,7 @@ void hdd_SendFTEvent(hdd_adapter_t *pAdapter) vos_mem_zero(ftIe, DOT11F_IE_FTINFO_MAX_LEN); vos_mem_zero(ricIe, DOT11F_IE_RICDESCRIPTOR_MAX_LEN); - sme_GetRICIEs( pHddCtx->hHal, (u8 *)ricIe, + sme_GetRICIEs( pHddCtx->hHal, pAdapter->sessionId, (u8 *)ricIe, DOT11F_IE_FTINFO_MAX_LEN, &ric_ies_length ); if (ric_ies_length == 0) { @@ -451,7 +451,7 @@ void hdd_SendFTEvent(hdd_adapter_t *pAdapter) ftEvent.ric_ies_len = ric_ies_length; hddLog(LOG1, "%s: RIC IEs is of length %d", __func__, (int)ric_ies_length); - sme_GetFTPreAuthResponse(pHddCtx->hHal, (u8 *)ftIe, + sme_GetFTPreAuthResponse(pHddCtx->hHal, pAdapter->sessionId, (u8 *)ftIe, DOT11F_IE_FTINFO_MAX_LEN, &auth_resp_len); if (auth_resp_len == 0) @@ -460,7 +460,7 @@ void hdd_SendFTEvent(hdd_adapter_t *pAdapter) return; } - sme_SetFTPreAuthState(pHddCtx->hHal, TRUE); + sme_SetFTPreAuthState(pHddCtx->hHal, pAdapter->sessionId, VOS_TRUE); ftEvent.target_ap = ftIe; @@ -489,7 +489,7 @@ void hdd_SendFTEvent(hdd_adapter_t *pAdapter) // Sme needs to send the RIC IEs first str_len = strlcpy(buff, "RIC=", IW_CUSTOM_MAX); - sme_GetRICIEs( pHddCtx->hHal, (u8 *)&(buff[str_len]), + sme_GetRICIEs( pHddCtx->hHal, pAdapter->sessionId, (u8 *)&(buff[str_len]), (IW_CUSTOM_MAX - str_len), &ric_ies_length ); if (ric_ies_length == 0) { @@ -506,8 +506,10 @@ void hdd_SendFTEvent(hdd_adapter_t *pAdapter) // Sme needs to provide the Auth Resp vos_mem_zero(buff, IW_CUSTOM_MAX); str_len = strlcpy(buff, "AUTH=", IW_CUSTOM_MAX); - sme_GetFTPreAuthResponse(pHddCtx->hHal, (u8 *)&buff[str_len], - (IW_CUSTOM_MAX - str_len), &auth_resp_len); + sme_GetFTPreAuthResponse(pHddCtx->hHal, pAdapter->sessionId, + (u8 *)&buff[str_len], + (IW_CUSTOM_MAX - str_len), + &auth_resp_len); if (auth_resp_len == 0) { @@ -750,6 +752,10 @@ static void hdd_SendAssociationEvent(struct net_device *dev,tCsrRoamInfo *pCsrRo pr_info("wlan: disconnected\n"); type = WLAN_STA_DISASSOC_DONE_IND; memset(wrqu.ap_addr.sa_data,'\0',ETH_ALEN); + wlan_hdd_decr_active_session(pHddCtx, pAdapter->device_mode); +#if defined(FEATURE_WLAN_LFR) && defined(WLAN_FEATURE_ROAM_SCAN_OFFLOAD) + wlan_hdd_enable_roaming(pAdapter); +#endif #ifdef IPA_OFFLOAD if (hdd_ipa_is_enabled(pHddCtx)) @@ -876,6 +882,7 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); v_U8_t sta_id; + v_BOOL_t sendDisconInd = TRUE; // Sanity check if(dev == NULL) @@ -906,6 +913,17 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * } #endif /* QCA_PKT_PROTO_TRACE */ + /* HDD has initiated disconnect, do not send disconnect indication + * to kernel as it will be handled by __cfg80211_disconnect. + */ + if ( eConnectionState_Disconnecting == pHddStaCtx->conn_info.connState ) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL(" HDD has initiated a disconnect, no need to send" + " disconnect indication to kernel")); + sendDisconInd = FALSE; + } + if(pHddStaCtx->conn_info.connState != eConnectionState_Disconnecting) { INIT_COMPLETION(pAdapter->disconnect_comp_var); @@ -922,7 +940,6 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * pHddCtx->isAmpAllowed = VOS_TRUE; } hdd_clearRoamProfileIe( pAdapter ); - wlan_hdd_decr_active_session(pHddCtx, pAdapter->device_mode); hdd_wmm_init( pAdapter ); // indicate 'disconnect' status to wpa_supplicant... @@ -956,16 +973,19 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * } #endif - /* To avoid wpa_supplicant sending "HANGED" CMD to ICS UI */ - if( eCSR_ROAM_LOSTLINK == roamStatus ) - { - cfg80211_disconnected(dev, pRoamInfo->reasonCode, NULL, 0, GFP_KERNEL); - } - else + /*Only send indication to kernel if not initiated by kernel*/ + if ( sendDisconInd ) { - cfg80211_disconnected(dev, WLAN_REASON_UNSPECIFIED, NULL, 0, GFP_KERNEL); + /* To avoid wpa_supplicant sending "HANGED" CMD to ICS UI */ + if( eCSR_ROAM_LOSTLINK == roamStatus ) + { + cfg80211_disconnected(dev, pRoamInfo->reasonCode, NULL, 0, GFP_KERNEL); + } + else + { + cfg80211_disconnected(dev, WLAN_REASON_UNSPECIFIED, NULL, 0, GFP_KERNEL); + } } - //If the Device Mode is Station // and the P2P Client is Connected //Enable BMPS @@ -1013,7 +1033,7 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * } hdd_wmm_adapter_clear(pAdapter); #if defined(WLAN_FEATURE_VOWIFI_11R) - sme_FTReset(WLAN_HDD_GET_HAL_CTX(pAdapter)); + sme_FTReset(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId); #endif //We should clear all sta register with TL, for now, only one. vstatus = hdd_roamDeregisterSTA( pAdapter, sta_id ); @@ -1359,26 +1379,44 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs struct net_device *dev = pAdapter->dev; hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - VOS_STATUS vosStatus; + VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE; v_U8_t reqRsnIe[DOT11F_IE_RSN_MAX_LEN]; tANI_U32 reqRsnLength = DOT11F_IE_RSN_MAX_LEN; #if defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) || defined (WLAN_FEATURE_VOWIFI_11R) int ft_carrier_on = FALSE; #endif int status; + v_BOOL_t hddDisconInProgress = FALSE; + #ifdef WLAN_FEATURE_ROAM_OFFLOAD if (pRoamInfo && pRoamInfo->roamSynchInProgress) { /* change logging before release */ hddLog(VOS_TRACE_LEVEL_DEBUG, "LFR3:hdd_AssociationCompletionHandler"); } #endif - if ( eCSR_ROAM_RESULT_ASSOCIATED == roamResult ) + + /* HDD has initiated disconnect, do not send connect result indication + * to kernel as it will be handled by __cfg80211_disconnect. + */ + if(( eConnectionState_Disconnecting == pHddStaCtx->conn_info.connState) && + (( eCSR_ROAM_RESULT_ASSOCIATED == roamResult) || + ( eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus)) ) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "%s: Set HDD connState to eConnectionState_Associated", - __func__); - hdd_connSetConnectionState( pHddStaCtx, eConnectionState_Associated ); - pAdapter->maxRateFlags = pRoamInfo->maxRateFlags; + FL(" Disconnect from HDD in progress ")); + hddDisconInProgress = TRUE; + } + + if ( eCSR_ROAM_RESULT_ASSOCIATED == roamResult ) + { + if ( !hddDisconInProgress ) + { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + "%s: Set HDD connState to eConnectionState_Associated", + __func__); + hdd_connSetConnectionState( pHddStaCtx, eConnectionState_Associated ); + pAdapter->maxRateFlags = pRoamInfo->maxRateFlags; + } // Save the connection info from CSR... hdd_connSaveConnectInfo( pAdapter, pRoamInfo, eCSR_BSS_TYPE_INFRASTRUCTURE ); @@ -1547,18 +1585,23 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs if(ft_carrier_on) { - hddLog(LOG1, "%s ft_carrier_on is %d, sending roamed " - "indication", __FUNCTION__, ft_carrier_on); - chan = ieee80211_get_channel(pAdapter->wdev.wiphy, - (int)pRoamInfo->pBssDesc->channelId); - hddLog(LOG1, "assocReqlen %d assocRsplen %d", assocReqlen, - assocRsplen); - cfg80211_roamed(dev,chan, pRoamInfo->bssid, - pFTAssocReq, assocReqlen, pFTAssocRsp, assocRsplen, - GFP_KERNEL); - if (sme_GetFTPTKState(WLAN_HDD_GET_HAL_CTX(pAdapter))) + if ( !hddDisconInProgress ) { - sme_SetFTPTKState(WLAN_HDD_GET_HAL_CTX(pAdapter), FALSE); + hddLog(LOG1, "%s ft_carrier_on is %d, sending roamed " + "indication", __FUNCTION__, ft_carrier_on); + chan = ieee80211_get_channel(pAdapter->wdev.wiphy, + (int)pRoamInfo->pBssDesc->channelId); + hddLog(LOG1, "assocReqlen %d assocRsplen %d", assocReqlen, + assocRsplen); + cfg80211_roamed(dev,chan, pRoamInfo->bssid, + pFTAssocReq, assocReqlen, pFTAssocRsp, assocRsplen, + GFP_KERNEL); + } + if (sme_GetFTPTKState(WLAN_HDD_GET_HAL_CTX(pAdapter), + pAdapter->sessionId)) + { + sme_SetFTPTKState(WLAN_HDD_GET_HAL_CTX(pAdapter), + pAdapter->sessionId, FALSE); pRoamInfo->fAuthRequired = FALSE; vos_mem_copy(pHddStaCtx->roam_info.bssid, @@ -1572,7 +1615,7 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs pHddStaCtx->roam_info.deferKeyComplete = TRUE; } } - else + else if ( !hddDisconInProgress ) { hddLog(LOG1, "%s ft_carrier_on is %d, sending connect " "indication", __FUNCTION__, ft_carrier_on); @@ -1596,46 +1639,52 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs pAdapter->sessionId, &rspRsnLength, rspRsnIe); + if ( !hddDisconInProgress ) + { #if defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) - if(ft_carrier_on) - hdd_SendReAssocEvent(dev, pAdapter, pRoamInfo, reqRsnIe, reqRsnLength); - else + if(ft_carrier_on) + hdd_SendReAssocEvent(dev, pAdapter, pRoamInfo, reqRsnIe, reqRsnLength); + else #endif /* FEATURE_WLAN_ESE */ - { - hddLog(VOS_TRACE_LEVEL_INFO, - "%s: sending connect indication to nl80211:for bssid " MAC_ADDRESS_STR " reason:%d and Status:%d", - __func__, MAC_ADDR_ARRAY(pRoamInfo->bssid), - roamResult, roamStatus); - - /* inform connect result to nl80211 */ - cfg80211_connect_result(dev, pRoamInfo->bssid, - reqRsnIe, reqRsnLength, - rspRsnIe, rspRsnLength, - WLAN_STATUS_SUCCESS, - GFP_KERNEL); + { + hddLog(VOS_TRACE_LEVEL_INFO, + "%s: sending connect indication to nl80211:for bssid " MAC_ADDRESS_STR " reason:%d and Status:%d", + __func__, MAC_ADDR_ARRAY(pRoamInfo->bssid), + roamResult, roamStatus); + + /* inform connect result to nl80211 */ + cfg80211_connect_result(dev, pRoamInfo->bssid, + reqRsnIe, reqRsnLength, + rspRsnIe, rspRsnLength, + WLAN_STATUS_SUCCESS, + GFP_KERNEL); + } } } - cfg80211_put_bss( + if ( !hddDisconInProgress ) + { + cfg80211_put_bss( #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) - pHddCtx->wiphy, + pHddCtx->wiphy, #endif - bss); - - // perform any WMM-related association processing - hdd_wmm_assoc(pAdapter, pRoamInfo, eCSR_BSS_TYPE_INFRASTRUCTURE); + bss); - /* Start the Queue - Start tx queues before hdd_roamRegisterSTA, - since hdd_roamRegisterSTA will flush any cached data frames - immediately */ - netif_tx_wake_all_queues(dev); + // perform any WMM-related association processing + hdd_wmm_assoc(pAdapter, pRoamInfo, eCSR_BSS_TYPE_INFRASTRUCTURE); - // Register the Station with TL after associated... - vosStatus = hdd_roamRegisterSTA( pAdapter, - pRoamInfo, - pHddStaCtx->conn_info.staId[ 0 ], - NULL, - pRoamInfo->pBssDesc ); + /* Start the Queue - Start tx queues before hdd_roamRegisterSTA, + since hdd_roamRegisterSTA will flush any cached data frames + immediately */ + netif_tx_wake_all_queues(dev); + + // Register the Station with TL after associated... + vosStatus = hdd_roamRegisterSTA( pAdapter, + pRoamInfo, + pHddStaCtx->conn_info.staId[ 0 ], + NULL, + pRoamInfo->pBssDesc ); + } } else { @@ -1723,11 +1772,11 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs /* Set connection state to eConnectionState_NotConnected only when CSR * has completed operation - with a ASSOCIATION_FAILURE status */ - if ( eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus ) + if ( eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus && !hddDisconInProgress ) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "%s: Set HDD connState to eConnectionState_NotConnected", - __func__); + "%s: Set HDD connState to eConnectionState_NotConnected", + __func__); hdd_connSetConnectionState( pHddStaCtx, eConnectionState_NotConnected); } if((pHddCtx->concurrency_mode <= 1) && @@ -1774,7 +1823,7 @@ static eHalStatus hdd_AssociationCompletionHandler( hdd_adapter_t *pAdapter, tCs /* CR465478: Only send up a connection failure result when CSR has * completed operation - with a ASSOCIATION_FAILURE status.*/ - if (eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus) + if ( eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus && !hddDisconInProgress ) { if (pRoamInfo) hddLog(VOS_TRACE_LEVEL_ERROR, @@ -3103,36 +3152,16 @@ eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, tANI_U3 case eCSR_ROAM_ASSOCIATION_COMPLETION: VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "****eCSR_ROAM_ASSOCIATION_COMPLETION****"); - if ( (roamResult != eCSR_ROAM_RESULT_ASSOCIATED) && - ( (pWextState->roamProfile.EncryptionType.encryptionType[0] == - eCSR_ENCRYPT_TYPE_WEP40) || - (pWextState->roamProfile.EncryptionType.encryptionType[0] == - eCSR_ENCRYPT_TYPE_WEP104) - ) && - (eCSR_AUTH_TYPE_SHARED_KEY != pWextState->roamProfile.AuthType.authType[0]) - ) + // To Do - address probable memory leak with WEP encryption upon successful association + if (eCSR_ROAM_RESULT_ASSOCIATED != roamResult) { - v_U32_t roamId = 0; - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, - "****WEP open authentication failed, trying with shared authentication****"); - (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.authType = eCSR_AUTH_TYPE_SHARED_KEY; - pWextState->roamProfile.AuthType.authType[0] = (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.authType; - pWextState->roamProfile.csrPersona = pAdapter->device_mode; - halStatus = sme_RoamConnect( WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, &(pWextState->roamProfile), &roamId); - } - else - { - // To Do - address probable memory leak with WEP encryption upon successful association - if (eCSR_ROAM_RESULT_ASSOCIATED != roamResult) - { - //Clear saved connection information in HDD - hdd_connRemoveConnectInfo( WLAN_HDD_GET_STATION_CTX_PTR(pAdapter) ); - } - halStatus = hdd_AssociationCompletionHandler( pAdapter, pRoamInfo, roamId, roamStatus, roamResult ); + //Clear saved connection information in HDD + hdd_connRemoveConnectInfo( WLAN_HDD_GET_STATION_CTX_PTR(pAdapter) ); } #ifdef WLAN_FEATURE_ROAM_OFFLOAD pRoamInfo->roamSynchInProgress = VOS_FALSE; #endif + halStatus = hdd_AssociationCompletionHandler( pAdapter, pRoamInfo, roamId, roamStatus, roamResult ); break; case eCSR_ROAM_ASSOCIATION_FAILURE: halStatus = hdd_AssociationCompletionHandler( pAdapter, diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index f0dbbc09677f..19020c4ea313 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -61,196 +61,254 @@ #include <wlan_hdd_misc.h> #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) -static void cbNotifySetRoamPrefer5GHz(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +cbNotifySetRoamPrefer5GHz(hdd_context_t *pHddCtx, unsigned long NotifyId) { - sme_UpdateRoamPrefer5GHz((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->nRoamPrefer5GHz); + sme_UpdateRoamPrefer5GHz(pHddCtx->hHal, pHddCtx->cfg_ini->nRoamPrefer5GHz); } -static void cbNotifySetImmediateRoamRssiDiff(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +cbNotifySetImmediateRoamRssiDiff(hdd_context_t *pHddCtx, unsigned long NotifyId) { - sme_UpdateImmediateRoamRssiDiff((tHalHandle)(pHddCtx->hHal), - pHddCtx->cfg_ini->nImmediateRoamRssiDiff); + sme_UpdateImmediateRoamRssiDiff(pHddCtx->hHal, + pHddCtx->cfg_ini->nImmediateRoamRssiDiff, + 0); } -static void cbNotifySetRoamRssiDiff(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +cbNotifySetRoamRssiDiff(hdd_context_t *pHddCtx, unsigned long NotifyId) { - sme_UpdateRoamRssiDiff((tHalHandle)(pHddCtx->hHal), - pHddCtx->cfg_ini->RoamRssiDiff); + sme_UpdateRoamRssiDiff(pHddCtx->hHal, + 0, + pHddCtx->cfg_ini->RoamRssiDiff); } -static void cbNotifySetFastTransitionEnabled(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +cbNotifySetFastTransitionEnabled(hdd_context_t *pHddCtx, unsigned long NotifyId) { - sme_UpdateFastTransitionEnabled((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->isFastTransitionEnabled); + sme_UpdateFastTransitionEnabled(pHddCtx->hHal, + pHddCtx->cfg_ini->isFastTransitionEnabled); } -static void cbNotifySetRoamIntraBand(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +cbNotifySetRoamIntraBand(hdd_context_t *pHddCtx, unsigned long NotifyId) { - sme_setRoamIntraBand((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->nRoamIntraBand); + sme_setRoamIntraBand(pHddCtx->hHal, pHddCtx->cfg_ini->nRoamIntraBand); } -static void cbNotifySetWESMode(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +cbNotifySetWESMode(hdd_context_t *pHddCtx, unsigned long NotifyId) { - // at the point this routine is called, the value in the cfg_ini table has already been updated - sme_UpdateWESMode((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->isWESModeEnabled); + /* At the point this routine is called, the value in the cfg_ini + table has already been updated */ + sme_UpdateWESMode(pHddCtx->hHal, + pHddCtx->cfg_ini->isWESModeEnabled, + 0); } -static void cbNotifySetRoamScanNProbes(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +cbNotifySetRoamScanNProbes(hdd_context_t *pHddCtx, unsigned long NotifyId) { - sme_UpdateRoamScanNProbes((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->nProbes); + sme_UpdateRoamScanNProbes(pHddCtx->hHal, 0, + pHddCtx->cfg_ini->nProbes); } -static void cbNotifySetRoamScanHomeAwayTime(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +cbNotifySetRoamScanHomeAwayTime(hdd_context_t *pHddCtx, unsigned long NotifyId) { - sme_UpdateRoamScanHomeAwayTime((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->nRoamScanHomeAwayTime, eANI_BOOLEAN_TRUE); + sme_UpdateRoamScanHomeAwayTime(pHddCtx->hHal, 0, + pHddCtx->cfg_ini->nRoamScanHomeAwayTime, + eANI_BOOLEAN_TRUE); } #endif #ifdef FEATURE_WLAN_OKC -static void cbNotifySetOkcFeatureEnabled(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +cbNotifySetOkcFeatureEnabled(hdd_context_t *pHddCtx, unsigned long NotifyId) { - // at the point this routine is called, the value in the cfg_ini table has already been updated + /* At the point this routine is called, the value in the cfg_ini + table has already been updated */ } #endif #ifdef FEATURE_WLAN_LFR -static void NotifyIsFastRoamIniFeatureEnabled(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +NotifyIsFastRoamIniFeatureEnabled(hdd_context_t *pHddCtx, + unsigned long NotifyId) { - // at the point this routine is called, the value in the cfg_ini table has already been updated - sme_UpdateIsFastRoamIniFeatureEnabled((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->isFastRoamIniFeatureEnabled ); + /* At the point this routine is called, the value in the cfg_ini + table has already been updated */ + sme_UpdateIsFastRoamIniFeatureEnabled(pHddCtx->hHal, 0, + pHddCtx->cfg_ini->isFastRoamIniFeatureEnabled ); } -static void NotifyIsMAWCIniFeatureEnabled(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +NotifyIsMAWCIniFeatureEnabled(hdd_context_t *pHddCtx, unsigned long NotifyId) { - /* at the point this routine is called, the value in the cfg_ini table has already been updated */ - sme_UpdateIsMAWCIniFeatureEnabled((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->MAWCEnabled ); + /* At the point this routine is called, the value in the cfg_ini + table has already been updated */ + sme_UpdateIsMAWCIniFeatureEnabled(pHddCtx->hHal, + pHddCtx->cfg_ini->MAWCEnabled ); } #endif #ifdef FEATURE_WLAN_ESE -static void cbNotifySetEseFeatureEnabled(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +cbNotifySetEseFeatureEnabled(hdd_context_t *pHddCtx, unsigned long NotifyId) { - // at the point this routine is called, the value in the cfg_ini table has already been updated - sme_UpdateIsEseFeatureEnabled((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->isEseIniFeatureEnabled ); + /* At the point this routine is called, the value in the cfg_ini + table has already been updated */ + sme_UpdateIsEseFeatureEnabled(pHddCtx->hHal, + pHddCtx->cfg_ini->isEseIniFeatureEnabled ); } #endif -static void cbNotifySetFwRssiMonitoring(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +cbNotifySetFwRssiMonitoring(hdd_context_t *pHddCtx, unsigned long NotifyId) { - // at the point this routine is called, the value in the cfg_ini table has already been updated - sme_UpdateConfigFwRssiMonitoring((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->fEnableFwRssiMonitoring ); + /* At the point this routine is called, the value in the cfg_ini + table has already been updated */ + sme_UpdateConfigFwRssiMonitoring(pHddCtx->hHal, + pHddCtx->cfg_ini->fEnableFwRssiMonitoring); } #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING static void cbNotifySetOpportunisticScanThresholdDiff(hdd_context_t *pHddCtx, unsigned long NotifyId) { - /* - * at the point this routine is called, the value in the cfg_ini table - * has already been updated - */ - sme_SetRoamOpportunisticScanThresholdDiff((tHalHandle)(pHddCtx->hHal), + /* At the point this routine is called, the value in the cfg_ini + table has already been updated */ + sme_SetRoamOpportunisticScanThresholdDiff(pHddCtx->hHal, 0, pHddCtx->cfg_ini->nOpportunisticThresholdDiff ); } static void cbNotifySetRoamRescanRssiDiff(hdd_context_t *pHddCtx, unsigned long NotifyId) { - /* - * at the point this routine is called, the value in the cfg_ini table - * has already been updated - */ - sme_SetRoamRescanRssiDiff((tHalHandle)(pHddCtx->hHal), + /* At the point this routine is called, the value in the cfg_ini + table has already been updated */ + sme_SetRoamRescanRssiDiff(pHddCtx->hHal, + 0, pHddCtx->cfg_ini->nRoamRescanRssiDiff); } -static void cbNotifySetNeighborLookupRssiThreshold(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +cbNotifySetNeighborLookupRssiThreshold(hdd_context_t *pHddCtx, + unsigned long NotifyId) { - // at the point this routine is called, the value in the cfg_ini table has already been updated - sme_setNeighborLookupRssiThreshold((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->nNeighborLookupRssiThreshold ); + /* At the point this routine is called, the value in the cfg_ini + table has already been updated */ + sme_setNeighborLookupRssiThreshold(pHddCtx->hHal, 0, + pHddCtx->cfg_ini->nNeighborLookupRssiThreshold); } -static void cbNotifySetNeighborScanPeriod(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +cbNotifySetNeighborScanPeriod(hdd_context_t *pHddCtx, unsigned long NotifyId) { - // at the point this routine is called, the value in the cfg_ini table has already been updated - sme_setNeighborScanPeriod((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->nNeighborScanPeriod ); + /* At the point this routine is called, the value in the cfg_ini + table has already been updated */ + sme_setNeighborScanPeriod(pHddCtx->hHal, 0, + pHddCtx->cfg_ini->nNeighborScanPeriod ); } -static void cbNotifySetNeighborResultsRefreshPeriod(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +cbNotifySetNeighborResultsRefreshPeriod(hdd_context_t *pHddCtx, + unsigned long NotifyId) { - // at the point this routine is called, the value in the cfg_ini table has already been updated - sme_setNeighborScanRefreshPeriod((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->nNeighborResultsRefreshPeriod ); + /* At the point this routine is called, the value in the cfg_ini + table has already been updated */ + sme_setNeighborScanRefreshPeriod(pHddCtx->hHal, 0, + pHddCtx->cfg_ini->nNeighborResultsRefreshPeriod); } -static void cbNotifySetEmptyScanRefreshPeriod(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +cbNotifySetEmptyScanRefreshPeriod(hdd_context_t *pHddCtx, + unsigned long NotifyId) { - // at the point this routine is called, the value in the cfg_ini table has already been updated - sme_UpdateEmptyScanRefreshPeriod((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->nEmptyScanRefreshPeriod); + /* At the point this routine is called, the value in the cfg_ini + table has already been updated */ + sme_UpdateEmptyScanRefreshPeriod(pHddCtx->hHal, 0, + pHddCtx->cfg_ini->nEmptyScanRefreshPeriod); } -static void cbNotifySetNeighborScanMinChanTime(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +cbNotifySetNeighborScanMinChanTime(hdd_context_t *pHddCtx, + unsigned long NotifyId) { - // at the point this routine is called, the value in the cfg_ini table has already been updated - sme_setNeighborScanMinChanTime((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->nNeighborScanMinChanTime); + /* At the point this routine is called, the value in the cfg_ini + table has already been updated */ + sme_setNeighborScanMinChanTime(pHddCtx->hHal, + pHddCtx->cfg_ini->nNeighborScanMinChanTime, + 0); } -static void cbNotifySetNeighborScanMaxChanTime(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +cbNotifySetNeighborScanMaxChanTime(hdd_context_t *pHddCtx, + unsigned long NotifyId) { - sme_setNeighborScanMaxChanTime((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->nNeighborScanMaxChanTime); + sme_setNeighborScanMaxChanTime(pHddCtx->hHal, 0, + pHddCtx->cfg_ini->nNeighborScanMaxChanTime); } static void cbNotifySetRoamBmissFirstBcnt(hdd_context_t *pHddCtx, unsigned long NotifyId) { - /* - * at the point this routine is called, the value in the cfg_ini table - * has already been updated - */ - sme_SetRoamBmissFirstBcnt((tHalHandle)(pHddCtx->hHal), + /* At the point this routine is called, the value in the cfg_ini + table has already been updated */ + sme_SetRoamBmissFirstBcnt(pHddCtx->hHal, + 0, pHddCtx->cfg_ini->nRoamBmissFirstBcnt); } static void cbNotifySetRoamBmissFinalBcnt(hdd_context_t *pHddCtx, unsigned long NotifyId) { - sme_SetRoamBmissFinalBcnt((tHalHandle)(pHddCtx->hHal), + sme_SetRoamBmissFinalBcnt(pHddCtx->hHal, 0, pHddCtx->cfg_ini->nRoamBmissFinalBcnt); } static void cbNotifySetRoamBeaconRssiWeight(hdd_context_t *pHddCtx, unsigned long NotifyId) { - sme_SetRoamBeaconRssiWeight((tHalHandle)(pHddCtx->hHal), + sme_SetRoamBeaconRssiWeight(pHddCtx->hHal, 0, pHddCtx->cfg_ini->nRoamBeaconRssiWeight); } + +static void +cbNotifySetDFSScanMode(hdd_context_t *pHddCtx, unsigned long NotifyId) +{ + /* At the point this routine is called, the value in the cfg_ini + table has already been updated */ + sme_UpdateDFSScanMode(pHddCtx->hHal, 0, + pHddCtx->cfg_ini->allowDFSChannelRoam); +} + #endif static void cbNotifySetEnableSSR(hdd_context_t *pHddCtx, unsigned long NotifyId) { - sme_UpdateEnableSSR((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->enableSSR); + sme_UpdateEnableSSR(pHddCtx->hHal, pHddCtx->cfg_ini->enableSSR); } #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD -static void cbNotifyUpdateRoamScanOffloadEnabled(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +cbNotifyUpdateRoamScanOffloadEnabled(hdd_context_t *pHddCtx, + unsigned long NotifyId) { - sme_UpdateRoamScanOffloadEnabled((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->isRoamOffloadScanEnabled); - if (0 == pHddCtx->cfg_ini->isRoamOffloadScanEnabled) - { + sme_UpdateRoamScanOffloadEnabled(pHddCtx->hHal, + pHddCtx->cfg_ini->isRoamOffloadScanEnabled); + if (0 == pHddCtx->cfg_ini->isRoamOffloadScanEnabled) { pHddCtx->cfg_ini->bFastRoamInConIniFeatureEnabled = 0; - sme_UpdateEnableFastRoamInConcurrency((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->bFastRoamInConIniFeatureEnabled ); + sme_UpdateEnableFastRoamInConcurrency(pHddCtx->hHal, + pHddCtx->cfg_ini->bFastRoamInConIniFeatureEnabled); } } -static void cbNotifySetEnableFastRoamInConcurrency(hdd_context_t *pHddCtx, unsigned long NotifyId) +static void +cbNotifySetEnableFastRoamInConcurrency(hdd_context_t *pHddCtx, + unsigned long NotifyId) { - sme_UpdateEnableFastRoamInConcurrency((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->bFastRoamInConIniFeatureEnabled ); -} - -static void cbNotifySetDFSScanMode(hdd_context_t *pHddCtx, unsigned long NotifyId) -{ - /* at the point this routine is called, the value in the cfg_ini table has - * already been updated - */ - sme_UpdateDFSScanMode((tHalHandle)(pHddCtx->hHal), - pHddCtx->cfg_ini->allowDFSChannelRoam); + sme_UpdateEnableFastRoamInConcurrency(pHddCtx->hHal, + pHddCtx->cfg_ini->bFastRoamInConIniFeatureEnabled); } #endif diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 30c37fb58dcb..a676b17f3c48 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -5301,9 +5301,15 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, pHostapdAdapter->sap_dyn_ini_cfg.acsBandSwitchThreshold; pConfig->apAutoChannelSelection = pHostapdAdapter->sap_dyn_ini_cfg.apAutoChannelSelection; + pConfig->apStartChannelNum = + pHostapdAdapter->sap_dyn_ini_cfg.apStartChannelNum; + pConfig->apEndChannelNum = + pHostapdAdapter->sap_dyn_ini_cfg.apEndChannelNum; #else pConfig->acsBandSwitchThreshold = iniConfig->acsBandSwitchThreshold; pConfig->apAutoChannelSelection = iniConfig->apAutoChannelSelection; + pConfig->apStartChannelNum = iniConfig->apStartChannelNum; + pConfig->apEndChannelNum = iniConfig->apEndChannelNum; #endif pSapEventCallback = hdd_hostapd_SAPEventCB; @@ -7013,7 +7019,8 @@ static int __wlan_hdd_cfg80211_add_key( struct wiphy *wiphy, /* The supplicant may attempt to set the PTK once pre-authentication is done. Save the key in the UMAC and include it in the ADD BSS request */ - halStatus = sme_FTUpdateKey( WLAN_HDD_GET_HAL_CTX(pAdapter), &setKey); + halStatus = sme_FTUpdateKey( WLAN_HDD_GET_HAL_CTX(pAdapter), + pAdapter->sessionId, &setKey); if ( halStatus == eHAL_STATUS_FT_PREAUTH_KEY_SUCCESS ) { hddLog(VOS_TRACE_LEVEL_INFO_MED, @@ -8088,7 +8095,10 @@ VOS_STATUS wlan_hdd_cfg80211_roam_metrics_handover(hdd_adapter_t * pAdapter, * */ static eHalStatus hdd_cfg80211_scan_done_callback(tHalHandle halHandle, - void *pContext, tANI_U32 scanId, eCsrScanStatus status) + void *pContext, + tANI_U8 sessionId, + tANI_U32 scanId, + eCsrScanStatus status) { struct net_device *dev = (struct net_device *) pContext; //struct wireless_dev *wdev = dev->ieee80211_ptr; @@ -9727,6 +9737,10 @@ static int __wlan_hdd_cfg80211_connect( struct wiphy *wiphy, return -ECONNREFUSED; } +#if defined(FEATURE_WLAN_LFR) && defined(WLAN_FEATURE_ROAM_SCAN_OFFLOAD) + wlan_hdd_disable_roaming(pAdapter); +#endif + #ifdef WLAN_BTAMP_FEATURE //Infra connect not supported when AMP traffic is on. if (VOS_TRUE == WLANBAP_AmpSessionOn()) { @@ -9835,6 +9849,7 @@ int wlan_hdd_disconnect( hdd_adapter_t *pAdapter, u16 reason ) int status; hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + long ret; status = wlan_hdd_validate_context(pHddCtx); @@ -9859,8 +9874,13 @@ int wlan_hdd_disconnect( hdd_adapter_t *pAdapter, u16 reason ) status = sme_RoamDisconnect( WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, reason); - - if ( 0 != status ) + if(eHAL_STATUS_CMD_NOT_QUEUED == status) + { + hddLog(VOS_TRACE_LEVEL_INFO, + FL("status = %d, already disconnected"), + (int)status ); + } + else if ( 0 != status ) { hddLog(VOS_TRACE_LEVEL_ERROR, "%s csrRoamDisconnect failure, returned %d", @@ -9868,23 +9888,25 @@ int wlan_hdd_disconnect( hdd_adapter_t *pAdapter, u16 reason ) pHddStaCtx->staDebugState = status; return -EINVAL; } - status = wait_for_completion_interruptible_timeout( + ret = wait_for_completion_interruptible_timeout( &pAdapter->disconnect_comp_var, msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT)); - pHddStaCtx->conn_info.connState = eConnectionState_NotConnected; - - if (!status) + if (!ret && ( eHAL_STATUS_CMD_NOT_QUEUED != status )) { hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Failed to disconnect, timed out", __func__); return -ETIMEDOUT; - } else if (status == -ERESTARTSYS) + } + else if (ret == -ERESTARTSYS) { hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Failed to disconnect, wait interrupted", __func__); - return status; + return ret; } + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + FL("Set HDD connState to eConnectionState_NotConnected")); + pHddStaCtx->conn_info.connState = eConnectionState_NotConnected; return 0; } @@ -13730,12 +13752,6 @@ int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, return -EAGAIN; } - if (sme_staInMiddleOfRoaming(pHddCtx->hHal)) { - hddLog(VOS_TRACE_LEVEL_DEBUG, FL("Roaming in progress " - "Do not allow suspend")); - return -EAGAIN; - } - /* If RADAR detection is in progress (HDD), prevent suspend. The flag * "dfs_cac_block_tx" is set to TRUE when RADAR is found and stay TRUE until * CAC is done for a SoftAP which is in started state. @@ -13763,6 +13779,10 @@ int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, pAdapter = pAdapterNode->pAdapter; pScanInfo = &pAdapter->scan_info; + if (sme_staInMiddleOfRoaming(pHddCtx->hHal, pAdapter->sessionId)) { + hddLog(LOG1, FL("Roaming in progress, do not allow suspend")); + return -EAGAIN; + } if (pScanInfo->mScanPending && pAdapter->request) { INIT_COMPLETION(pScanInfo->abortscan_event_var); diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c index d3d3be549f08..53fcfa54c8ef 100644 --- a/CORE/HDD/src/wlan_hdd_hostapd.c +++ b/CORE/HDD/src/wlan_hdd_hostapd.c @@ -3077,10 +3077,8 @@ int iw_softap_get_channel_list(struct net_device *dev, v_U8_t i = 0; v_U8_t bandStartChannel = RF_CHAN_1; v_U8_t bandEndChannel = RF_CHAN_165; - v_U32_t temp_num_channels = 0; hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev)); tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter); - v_REGDOMAIN_t domainIdCurrentSoftap; tpChannelListInfo channel_list = (tpChannelListInfo) extra; eCsrBand curBand = eCSR_BAND_ALL; @@ -3116,33 +3114,6 @@ int iw_softap_get_channel_list(struct net_device *dev, } } - /* remove indoor channels if the domain is FCC, channels 36 - 48 */ - - temp_num_channels = num_channels; - - if(eHAL_STATUS_SUCCESS != sme_getSoftApDomain(hHal,(v_REGDOMAIN_t *) &domainIdCurrentSoftap)) - { - hddLog(LOGE,FL("Failed to get Domain ID, %d "),domainIdCurrentSoftap); - return -EIO; - } - - if(REGDOMAIN_FCC == domainIdCurrentSoftap) - { - for(i = 0; i < temp_num_channels; i++) - { - - if((channel_list->channels[i] > 35) && - (channel_list->channels[i] < 49)) - { - vos_mem_move(&channel_list->channels[i], - &channel_list->channels[i+1], - temp_num_channels - (i-1)); - num_channels--; - temp_num_channels--; - i--; - } - } - } hddLog(LOG1,FL(" number of channels %d"), num_channels); diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 98c90bd547ea..b368854b4e48 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -2472,7 +2472,7 @@ hdd_reassoc(hdd_adapter_t *pAdapter, const tANI_U8 *bssid, const tANI_U8 channel handoffInfo.src = REASSOC; #endif memcpy(handoffInfo.bssid, bssid, sizeof(tSirMacAddr)); - sme_HandoffRequest(pHddCtx->hHal, &handoffInfo); + sme_HandoffRequest(pHddCtx->hHal, pAdapter->sessionId, &handoffInfo); } #endif exit: @@ -2665,7 +2665,7 @@ hdd_sendactionframe(hdd_adapter_t *pAdapter, const tANI_U8 *bssid, * roaming scans. Otherwise large dwell times may cause long * delays in sending action frames. */ - sme_abortRoamScan(pHddCtx->hHal); + sme_abortRoamScan(pHddCtx->hHal, pAdapter->sessionId); } else { /* 0 is accepted as current home channel, delayed * transmission of action frame is ok. @@ -2897,8 +2897,8 @@ hdd_parse_set_roam_scan_channels_v1(hdd_adapter_t *pAdapter, goto exit; } - status = sme_ChangeRoamScanChannelList(pHddCtx->hHal, channel_list, - num_chan); + status = sme_ChangeRoamScanChannelList(pHddCtx->hHal, pAdapter->sessionId, + channel_list, num_chan); if (eHAL_STATUS_SUCCESS != status) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: Failed to update channel list information", __func__); @@ -2968,8 +2968,8 @@ hdd_parse_set_roam_scan_channels_v2(hdd_adapter_t *pAdapter, } channel_list[i] = channel; } - status = sme_ChangeRoamScanChannelList(pHddCtx->hHal, channel_list, - num_chan); + status = sme_ChangeRoamScanChannelList(pHddCtx->hHal, pAdapter->sessionId, + channel_list, num_chan); if (eHAL_STATUS_SUCCESS != status) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: Failed to update channel list information", __func__); @@ -3879,7 +3879,9 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, " (Neighbor lookup threshold) = %d", __func__, lookUpThreshold); pHddCtx->cfg_ini->nNeighborLookupRssiThreshold = lookUpThreshold; - status = sme_setNeighborLookupRssiThreshold((tHalHandle)(pHddCtx->hHal), lookUpThreshold); + status = sme_setNeighborLookupRssiThreshold(pHddCtx->hHal, + pAdapter->sessionId, + lookUpThreshold); if (eHAL_STATUS_SUCCESS != status) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -3889,11 +3891,14 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, } /* Set Reassoc threshold to (lookup rssi threshold + 5 dBm) */ - sme_setNeighborReassocRssiThreshold((tHalHandle)(pHddCtx->hHal), lookUpThreshold + 5); + sme_setNeighborReassocRssiThreshold(pHddCtx->hHal, + pAdapter->sessionId, + lookUpThreshold + 5); } else if (strncmp(command, "GETROAMTRIGGER", 14) == 0) { - tANI_U8 lookUpThreshold = sme_getNeighborLookupRssiThreshold((tHalHandle)(pHddCtx->hHal)); + tANI_U8 lookUpThreshold = + sme_getNeighborLookupRssiThreshold(pHddCtx->hHal); int rssi = (-1) * lookUpThreshold; char extra[32]; tANI_U8 len = 0; @@ -3954,11 +3959,14 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, " (Empty Scan refresh period) = %d", __func__, roamScanPeriod); pHddCtx->cfg_ini->nEmptyScanRefreshPeriod = neighborEmptyScanRefreshPeriod; - sme_UpdateEmptyScanRefreshPeriod((tHalHandle)(pHddCtx->hHal), neighborEmptyScanRefreshPeriod); + sme_UpdateEmptyScanRefreshPeriod(pHddCtx->hHal, + pAdapter->sessionId, + neighborEmptyScanRefreshPeriod); } else if (strncmp(command, "GETROAMSCANPERIOD", 17) == 0) { - tANI_U16 nEmptyScanRefreshPeriod = sme_getEmptyScanRefreshPeriod((tHalHandle)(pHddCtx->hHal)); + tANI_U16 nEmptyScanRefreshPeriod = + sme_getEmptyScanRefreshPeriod(pHddCtx->hHal); char extra[32]; tANI_U8 len = 0; @@ -4019,11 +4027,13 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, " (Scan refresh period) = %d", __func__, roamScanRefreshPeriod); pHddCtx->cfg_ini->nNeighborResultsRefreshPeriod = neighborScanRefreshPeriod; - sme_setNeighborScanRefreshPeriod((tHalHandle)(pHddCtx->hHal), neighborScanRefreshPeriod); + sme_setNeighborScanRefreshPeriod(pHddCtx->hHal, + pAdapter->sessionId, + neighborScanRefreshPeriod); } else if (strncmp(command, "GETROAMSCANREFRESHPERIOD", 24) == 0) { - tANI_U16 value = sme_getNeighborScanRefreshPeriod((tHalHandle)(pHddCtx->hHal)); + tANI_U16 value = sme_getNeighborScanRefreshPeriod(pHddCtx->hHal); char extra[32]; tANI_U8 len = 0; @@ -4088,12 +4098,14 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, roamMode = CFG_LFR_FEATURE_ENABLED_MIN; /* Roam disable */ pHddCtx->cfg_ini->isFastRoamIniFeatureEnabled = roamMode; - sme_UpdateIsFastRoamIniFeatureEnabled((tHalHandle)(pHddCtx->hHal), roamMode); + sme_UpdateIsFastRoamIniFeatureEnabled(pHddCtx->hHal, + pAdapter->sessionId, + roamMode); } /* GETROAMMODE */ else if (strncmp(priv_data.buf, "GETROAMMODE", SIZE_OF_GETROAMMODE) == 0) { - tANI_BOOLEAN roamMode = sme_getIsLfrFeatureEnabled((tHalHandle)(pHddCtx->hHal)); + tANI_BOOLEAN roamMode = sme_getIsLfrFeatureEnabled(pHddCtx->hHal); char extra[32]; tANI_U8 len = 0; @@ -4154,11 +4166,12 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, "%s: Received Command to Set roam rssi diff = %d", __func__, roamRssiDiff); pHddCtx->cfg_ini->RoamRssiDiff = roamRssiDiff; - sme_UpdateRoamRssiDiff((tHalHandle)(pHddCtx->hHal), roamRssiDiff); + sme_UpdateRoamRssiDiff(pHddCtx->hHal, + pAdapter->sessionId, roamRssiDiff); } else if (strncmp(priv_data.buf, "GETROAMDELTA", 12) == 0) { - tANI_U8 roamRssiDiff = sme_getRoamRssiDiff((tHalHandle)(pHddCtx->hHal)); + tANI_U8 roamRssiDiff = sme_getRoamRssiDiff(pHddCtx->hHal); char extra[32]; tANI_U8 len = 0; @@ -4208,8 +4221,11 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, char extra[128] = {0}; int len; - if (eHAL_STATUS_SUCCESS != sme_getRoamScanChannelList( (tHalHandle)(pHddCtx->hHal), - ChannelList, &numChannels )) + if (eHAL_STATUS_SUCCESS != sme_getRoamScanChannelList( + pHddCtx->hHal, + ChannelList, + &numChannels, + pAdapter->sessionId)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s: failed to get roam scan channel list", __func__); @@ -4239,7 +4255,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, } else if (strncmp(command, "GETCCXMODE", 10) == 0) { - tANI_BOOLEAN eseMode = sme_getIsEseFeatureEnabled((tHalHandle)(pHddCtx->hHal)); + tANI_BOOLEAN eseMode = sme_getIsEseFeatureEnabled(pHddCtx->hHal); char extra[32]; tANI_U8 len = 0; @@ -4247,7 +4263,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, then this operation is not permitted (return FAILURE) */ if (eseMode && hdd_is_okc_mode_enabled(pHddCtx) && - sme_getIsFtFeatureEnabled((tHalHandle)(pHddCtx->hHal))) + sme_getIsFtFeatureEnabled(pHddCtx->hHal)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, "%s: OKC/ESE/11R are supported simultaneously" @@ -4275,8 +4291,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, /* Check if the features OKC/ESE/11R are supported simultaneously, then this operation is not permitted (return FAILURE) */ if (okcMode && - sme_getIsEseFeatureEnabled((tHalHandle)(pHddCtx->hHal)) && - sme_getIsFtFeatureEnabled((tHalHandle)(pHddCtx->hHal))) + sme_getIsEseFeatureEnabled(pHddCtx->hHal) && + sme_getIsFtFeatureEnabled(pHddCtx->hHal)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, "%s: OKC/ESE/11R are supported simultaneously" @@ -4297,7 +4313,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, } else if (strncmp(command, "GETFASTROAM", 11) == 0) { - tANI_BOOLEAN lfrMode = sme_getIsLfrFeatureEnabled((tHalHandle)(pHddCtx->hHal)); + tANI_BOOLEAN lfrMode = sme_getIsLfrFeatureEnabled(pHddCtx->hHal); char extra[32]; tANI_U8 len = 0; @@ -4313,7 +4329,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, } else if (strncmp(command, "GETFASTTRANSITION", 17) == 0) { - tANI_BOOLEAN ft = sme_getIsFtFeatureEnabled((tHalHandle)(pHddCtx->hHal)); + tANI_BOOLEAN ft = sme_getIsFtFeatureEnabled(pHddCtx->hHal); char extra[32]; tANI_U8 len = 0; @@ -4366,7 +4382,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, "%s: Received Command to change channel min time = %d", __func__, minTime); pHddCtx->cfg_ini->nNeighborScanMinChanTime = minTime; - sme_setNeighborScanMinChanTime((tHalHandle)(pHddCtx->hHal), minTime); + sme_setNeighborScanMinChanTime(pHddCtx->hHal, + minTime, pAdapter->sessionId); } else if (strncmp(command, "SENDACTIONFRAME", 15) == 0) { @@ -4374,7 +4391,9 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, } else if (strncmp(command, "GETROAMSCANCHANNELMINTIME", 25) == 0) { - tANI_U16 val = sme_getNeighborScanMinChanTime((tHalHandle)(pHddCtx->hHal)); + tANI_U16 val = sme_getNeighborScanMinChanTime( + pHddCtx->hHal, + pAdapter->sessionId); char extra[32]; tANI_U8 len = 0; @@ -4429,11 +4448,13 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, "%s: Received Command to change channel max time = %d", __func__, maxTime); pHddCtx->cfg_ini->nNeighborScanMaxChanTime = maxTime; - sme_setNeighborScanMaxChanTime((tHalHandle)(pHddCtx->hHal), maxTime); + sme_setNeighborScanMaxChanTime(pHddCtx->hHal, + pAdapter->sessionId, maxTime); } else if (strncmp(command, "GETSCANCHANNELTIME", 18) == 0) { - tANI_U16 val = sme_getNeighborScanMaxChanTime((tHalHandle)(pHddCtx->hHal)); + tANI_U16 val = sme_getNeighborScanMaxChanTime(pHddCtx->hHal, + pAdapter->sessionId); char extra[32]; tANI_U8 len = 0; @@ -4485,11 +4506,13 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, "%s: Received Command to change scan home time = %d", __func__, val); pHddCtx->cfg_ini->nNeighborScanPeriod = val; - sme_setNeighborScanPeriod((tHalHandle)(pHddCtx->hHal), val); + sme_setNeighborScanPeriod(pHddCtx->hHal, + pAdapter->sessionId, val); } else if (strncmp(command, "GETSCANHOMETIME", 15) == 0) { - tANI_U16 val = sme_getNeighborScanPeriod((tHalHandle)(pHddCtx->hHal)); + tANI_U16 val = sme_getNeighborScanPeriod(pHddCtx->hHal, + pAdapter->sessionId); char extra[32]; tANI_U8 len = 0; @@ -4540,11 +4563,11 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, "%s: Received Command to change intra band = %d", __func__, val); pHddCtx->cfg_ini->nRoamIntraBand = val; - sme_setRoamIntraBand((tHalHandle)(pHddCtx->hHal), val); + sme_setRoamIntraBand(pHddCtx->hHal, val); } else if (strncmp(command, "GETROAMINTRABAND", 16) == 0) { - tANI_U16 val = sme_getRoamIntraBand((tHalHandle)(pHddCtx->hHal)); + tANI_U16 val = sme_getRoamIntraBand(pHddCtx->hHal); char extra[32]; tANI_U8 len = 0; @@ -4596,11 +4619,12 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, "%s: Received Command to Set nProbes = %d", __func__, nProbes); pHddCtx->cfg_ini->nProbes = nProbes; - sme_UpdateRoamScanNProbes((tHalHandle)(pHddCtx->hHal), nProbes); + sme_UpdateRoamScanNProbes(pHddCtx->hHal, pAdapter->sessionId, + nProbes); } else if (strncmp(priv_data.buf, "GETSCANNPROBES", 14) == 0) { - tANI_U8 val = sme_getRoamScanNProbes((tHalHandle)(pHddCtx->hHal)); + tANI_U8 val = sme_getRoamScanNProbes(pHddCtx->hHal); char extra[32]; tANI_U8 len = 0; @@ -4652,12 +4676,14 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, if (pHddCtx->cfg_ini->nRoamScanHomeAwayTime != homeAwayTime) { pHddCtx->cfg_ini->nRoamScanHomeAwayTime = homeAwayTime; - sme_UpdateRoamScanHomeAwayTime((tHalHandle)(pHddCtx->hHal), homeAwayTime, eANI_BOOLEAN_TRUE); + sme_UpdateRoamScanHomeAwayTime(pHddCtx->hHal, + pAdapter->sessionId, + homeAwayTime, eANI_BOOLEAN_TRUE); } } else if (strncmp(priv_data.buf, "GETSCANHOMEAWAYTIME", 19) == 0) { - tANI_U16 val = sme_getRoamScanHomeAwayTime((tHalHandle)(pHddCtx->hHal)); + tANI_U16 val = sme_getRoamScanHomeAwayTime(pHddCtx->hHal); char extra[32]; tANI_U8 len = 0; @@ -4710,11 +4736,11 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, "%s: Received Command to Set WES Mode rssi diff = %d", __func__, wesMode); pHddCtx->cfg_ini->isWESModeEnabled = wesMode; - sme_UpdateWESMode((tHalHandle)(pHddCtx->hHal), wesMode); + sme_UpdateWESMode(pHddCtx->hHal, wesMode, pAdapter->sessionId); } else if (strncmp(priv_data.buf, "GETWESMODE", 10) == 0) { - tANI_BOOLEAN wesMode = sme_GetWESMode((tHalHandle)(pHddCtx->hHal)); + tANI_BOOLEAN wesMode = sme_GetWESMode(pHddCtx->hHal); char extra[32]; tANI_U8 len = 0; @@ -4749,14 +4775,16 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: Received Command to Set Opportunistic Threshold diff = %d", __func__, - nOpportunisticThresholdDiff); + nOpportunisticThresholdDiff); - sme_SetRoamOpportunisticScanThresholdDiff((tHalHandle)(pHddCtx->hHal), - nOpportunisticThresholdDiff); + sme_SetRoamOpportunisticScanThresholdDiff(pHddCtx->hHal, + pAdapter->sessionId, + nOpportunisticThresholdDiff); } else if (strncmp(priv_data.buf, "GETOPPORTUNISTICRSSIDIFF", 24) == 0) { - tANI_S8 val = sme_GetRoamOpportunisticScanThresholdDiff((tHalHandle)(pHddCtx->hHal)); + tANI_S8 val = sme_GetRoamOpportunisticScanThresholdDiff( + pHddCtx->hHal); char extra[32]; tANI_U8 len = 0; @@ -4792,12 +4820,13 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, "%s: Received Command to Set Roam Rescan RSSI Diff = %d", __func__, nRoamRescanRssiDiff); - sme_SetRoamRescanRssiDiff((tHalHandle)(pHddCtx->hHal), + sme_SetRoamRescanRssiDiff(pHddCtx->hHal, + pAdapter->sessionId, nRoamRescanRssiDiff); } else if (strncmp(priv_data.buf, "GETROAMRESCANRSSIDIFF", 21) == 0) { - tANI_U8 val = sme_GetRoamRescanRssiDiff((tHalHandle)(pHddCtx->hHal)); + tANI_U8 val = sme_GetRoamRescanRssiDiff(pHddCtx->hHal); char extra[32]; tANI_U8 len = 0; @@ -4849,7 +4878,9 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, "%s: Received Command to change lfr mode = %d", __func__, lfrMode); pHddCtx->cfg_ini->isFastRoamIniFeatureEnabled = lfrMode; - sme_UpdateIsFastRoamIniFeatureEnabled((tHalHandle)(pHddCtx->hHal), lfrMode); + sme_UpdateIsFastRoamIniFeatureEnabled(pHddCtx->hHal, + pAdapter->sessionId, + lfrMode); } #endif #ifdef WLAN_FEATURE_VOWIFI_11R @@ -4890,7 +4921,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, "%s: Received Command to change ft mode = %d", __func__, ft); pHddCtx->cfg_ini->isFastTransitionEnabled = ft; - sme_UpdateFastTransitionEnabled((tHalHandle)(pHddCtx->hHal), ft); + sme_UpdateFastTransitionEnabled(pHddCtx->hHal, ft); } else if (strncmp(command, "FASTREASSOC", 11) == 0) @@ -4946,7 +4977,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, handoffInfo.channel = channel; handoffInfo.src = FASTREASSOC; vos_mem_copy(handoffInfo.bssid, targetApBssid, sizeof(tSirMacAddr)); - sme_HandoffRequest(pHddCtx->hHal, &handoffInfo); + sme_HandoffRequest(pHddCtx->hHal, pAdapter->sessionId, &handoffInfo); #endif #else tANI_U8 *value = command; @@ -4987,7 +5018,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, /* Proceed with scan/roam */ smeIssueFastRoamNeighborAPEvent(WLAN_HDD_GET_HAL_CTX(pAdapter), &targetApBssid[0], - (tSmeFastRoamTrigger)(trigger)); + (tSmeFastRoamTrigger)(trigger), + pAdapter->sessionId); #endif } #endif @@ -5013,7 +5045,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, } pPlmRequest->sessionId = pAdapter->sessionId; - status = sme_SetPlmRequest((tHalHandle)(pHddCtx->hHal), pPlmRequest); + status = sme_SetPlmRequest(pHddCtx->hHal, pPlmRequest); if (eHAL_STATUS_SUCCESS != status) { vos_mem_free(pPlmRequest); @@ -5031,9 +5063,9 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, /* Check if the features OKC/ESE/11R are supported simultaneously, then this operation is not permitted (return FAILURE) */ - if (sme_getIsEseFeatureEnabled((tHalHandle)(pHddCtx->hHal)) && + if (sme_getIsEseFeatureEnabled(pHddCtx->hHal) && hdd_is_okc_mode_enabled(pHddCtx) && - sme_getIsFtFeatureEnabled((tHalHandle)(pHddCtx->hHal))) + sme_getIsFtFeatureEnabled(pHddCtx->hHal)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, "%s: OKC/ESE/11R are supported simultaneously" @@ -5072,7 +5104,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, "%s: Received Command to change ese mode = %d", __func__, eseMode); pHddCtx->cfg_ini->isEseIniFeatureEnabled = eseMode; - sme_UpdateIsEseFeatureEnabled((tHalHandle)(pHddCtx->hHal), eseMode); + sme_UpdateIsEseFeatureEnabled(pHddCtx->hHal, eseMode); } #endif else if (strncmp(command, "SETROAMSCANCONTROL", 18) == 0) @@ -5103,7 +5135,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, goto exit; } - sme_SetRoamScanControl((tHalHandle)(pHddCtx->hHal), roamScanControl); + sme_SetRoamScanControl(pHddCtx->hHal, + pAdapter->sessionId, roamScanControl); } #ifdef FEATURE_WLAN_OKC else if (strncmp(command, "SETOKCMODE", 10) == 0) @@ -5113,9 +5146,9 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, /* Check if the features OKC/ESE/11R are supported simultaneously, then this operation is not permitted (return FAILURE) */ - if (sme_getIsEseFeatureEnabled((tHalHandle)(pHddCtx->hHal)) && + if (sme_getIsEseFeatureEnabled(pHddCtx->hHal) && hdd_is_okc_mode_enabled(pHddCtx) && - sme_getIsFtFeatureEnabled((tHalHandle)(pHddCtx->hHal))) + sme_getIsFtFeatureEnabled(pHddCtx->hHal)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, "%s: OKC/ESE/11R are supported simultaneously" @@ -5160,7 +5193,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, #endif /* FEATURE_WLAN_OKC */ else if (strncmp(priv_data.buf, "GETROAMSCANCONTROL", 18) == 0) { - tANI_BOOLEAN roamScanControl = sme_GetRoamScanControl((tHalHandle)(pHddCtx->hHal)); + tANI_BOOLEAN roamScanControl = sme_GetRoamScanControl(pHddCtx->hHal); char extra[32]; tANI_U8 len = 0; @@ -5380,7 +5413,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, ret = -EINVAL; goto exit; } - status = sme_SetEseRoamScanChannelList((tHalHandle)(pHddCtx->hHal), + status = sme_SetEseRoamScanChannelList(pHddCtx->hHal, + pAdapter->sessionId, ChannelList, numChannels); if (eHAL_STATUS_SUCCESS != status) @@ -5524,10 +5558,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, ret = -EINVAL; goto exit; } - sme_SetCCKMIe((tHalHandle)(pHddCtx->hHal), - pAdapter->sessionId, - cckmIe, - cckmIeLen); + sme_SetCCKMIe(pHddCtx->hHal, pAdapter->sessionId, cckmIe, cckmIeLen); if (NULL != cckmIe) { vos_mem_free(cckmIe); @@ -5558,7 +5589,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, goto exit; } - status = sme_SetEseBeaconRequest((tHalHandle)(pHddCtx->hHal), + status = sme_SetEseBeaconRequest(pHddCtx->hHal, pAdapter->sessionId, &eseBcnReq); @@ -5678,12 +5709,12 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, __func__, dfsScanMode); pHddCtx->cfg_ini->allowDFSChannelRoam = dfsScanMode; - sme_UpdateDFSScanMode((tHalHandle)(pHddCtx->hHal), dfsScanMode); + sme_UpdateDFSScanMode(pHddCtx->hHal, pAdapter->sessionId, + dfsScanMode); } else if (strncmp(command, "GETDFSSCANMODE", 14) == 0) { - tANI_U8 dfsScanMode = - sme_GetDFSScanMode((tHalHandle)(pHddCtx->hHal)); + tANI_U8 dfsScanMode = sme_GetDFSScanMode(pHddCtx->hHal); char extra[32]; tANI_U8 len = 0; @@ -10747,8 +10778,21 @@ void __hdd_wlan_exit(void) wlan_hdd_send_status_pkg(NULL, NULL, 0, 0); #endif - //Do all the cleanup before deregistering the driver - hdd_wlan_exit(pHddCtx); + if (pHddCtx->isCleanUpDone == FALSE ) { + /* Do all the cleanup before deregistering the driver */ + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Cleaning up before driver deregistration", + __func__); + hdd_wlan_exit(pHddCtx); + } else { + /* This means driver loading has failed. Major cleanup + * is already done as part of driver load failure. + */ + struct wiphy *wiphy = pHddCtx->wiphy; + hdd_close_all_adapters( pHddCtx ); + wiphy_free(wiphy); + } + EXIT(); } #endif /* QCA_WIFI_2_0 && !QCA_WIFI_ISOC */ @@ -11359,7 +11403,8 @@ static int hdd_generate_iface_mac_addr_auto(hdd_context_t *pHddCtx, --------------------------------------------------------------------------*/ static eHalStatus hdd_11d_scan_done(tHalHandle halHandle, void *pContext, - tANI_U32 scanId, eCsrScanStatus status) + tANI_U8 sessionId, tANI_U32 scanId, + eCsrScanStatus status) { ENTER(); @@ -11437,6 +11482,7 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) pHddCtx->wiphy = wiphy; hdd_prevent_suspend(); pHddCtx->isLoadInProgress = TRUE; + pHddCtx->isCleanUpDone = FALSE; pHddCtx->ioctl_scan_mode = eSIR_ACTIVE_SCAN; vos_set_load_unload_in_progress(VOS_MODULE_ID_VOSS, TRUE); @@ -11461,7 +11507,6 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) init_completion(&pHddCtx->full_pwr_comp_var); init_completion(&pHddCtx->standby_comp_var); init_completion(&pHddCtx->req_bmps_comp_var); - init_completion(&pHddCtx->wiphy_channel_update_event); #ifdef CONFIG_ENABLE_LINUX_REG init_completion(&pHddCtx->linux_reg_req); @@ -11502,7 +11547,6 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) ((VosContextType*)(pVosContext))->adf_ctx = adf_ctx; #endif /* QCA_WIFI_2_0 */ - pHddCtx->nEnableStrictRegulatoryForFCC = FALSE; // Load all config first as TL config is needed during vos_open pHddCtx->cfg_ini = (hdd_config_t*) kmalloc(sizeof(hdd_config_t), GFP_KERNEL); if(pHddCtx->cfg_ini == NULL) @@ -12419,6 +12463,8 @@ err_free_hdd_context: } hdd_set_ssr_required (VOS_FALSE); + pHddCtx->isCleanUpDone = TRUE; + return -EIO; success: @@ -13009,8 +13055,8 @@ tVOS_CONCURRENCY_MODE hdd_get_concurrency_mode ( void ) v_BOOL_t hdd_is_apps_power_collapse_allowed(hdd_context_t* pHddCtx) { tPmcState pmcState = pmcGetPmcState(pHddCtx->hHal); - tANI_BOOLEAN scanRspPending = csrNeighborRoamScanRspPending(pHddCtx->hHal); - tANI_BOOLEAN inMiddleOfRoaming = csrNeighborMiddleOfRoaming(pHddCtx->hHal); + tANI_BOOLEAN scanRspPending; + tANI_BOOLEAN inMiddleOfRoaming; hdd_config_t *pConfig = pHddCtx->cfg_ini; hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL; hdd_adapter_t *pAdapter = NULL; @@ -13037,6 +13083,10 @@ v_BOOL_t hdd_is_apps_power_collapse_allowed(hdd_context_t* pHddCtx) if ( (WLAN_HDD_INFRA_STATION == pAdapter->device_mode) || (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) ) { + scanRspPending = csrNeighborRoamScanRspPending(pHddCtx->hHal, + pAdapter->sessionId); + inMiddleOfRoaming = csrNeighborMiddleOfRoaming(pHddCtx->hHal, + pAdapter->sessionId); if (((pConfig->fIsImpsEnabled || pConfig->fIsBmpsEnabled) && (pmcState != IMPS && pmcState != BMPS && pmcState != STOPPED && pmcState != STANDBY)) || @@ -13632,6 +13682,110 @@ int wlan_hdd_gen_wlan_version_pack(struct wlan_version_data *data, } #endif +#if defined(FEATURE_WLAN_LFR) && defined(WLAN_FEATURE_ROAM_SCAN_OFFLOAD) +/**--------------------------------------------------------------------------- + + \brief wlan_hdd_disable_roaming() + + This function loop through each adapter and disable roaming on each STA + device mode except the input adapter. + Note: On the input adapter roaming is not enabled yet hence no need to + disable. + + \param - pAdapter HDD adapter pointer + + \return - None + + --------------------------------------------------------------------------*/ +void wlan_hdd_disable_roaming(hdd_adapter_t *pAdapter) +{ + hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + hdd_adapter_t *pAdapterIdx = NULL; + hdd_adapter_list_node_t *pAdapterNode = NULL; + hdd_adapter_list_node_t *pNext = NULL; + VOS_STATUS status; + + if (pHddCtx->cfg_ini->isFastRoamIniFeatureEnabled && + pHddCtx->cfg_ini->isRoamOffloadScanEnabled && + WLAN_HDD_INFRA_STATION == pAdapter->device_mode && + vos_is_sta_active_connection_exists()) { + hddLog(LOG1, FL("Connect received on STA sessionId(%d)"), + pAdapter->sessionId); + /* Loop through adapter and disable roaming for each STA device mode + except the input adapter. */ + + status = hdd_get_front_adapter (pHddCtx, &pAdapterNode); + + while (NULL != pAdapterNode && VOS_STATUS_SUCCESS == status) { + pAdapterIdx = pAdapterNode->pAdapter; + + if (WLAN_HDD_INFRA_STATION == pAdapterIdx->device_mode && + pAdapter->sessionId != pAdapterIdx->sessionId) { + hddLog(LOG1, FL("Disable Roaming on sessionId(%d)"), + pAdapterIdx->sessionId); + sme_stopRoaming(WLAN_HDD_GET_HAL_CTX(pAdapterIdx), + pAdapterIdx->sessionId, 0); + } + + status = hdd_get_next_adapter(pHddCtx, pAdapterNode, &pNext); + pAdapterNode = pNext; + } + } +} + +/**--------------------------------------------------------------------------- + + \brief wlan_hdd_enable_roaming() + + This function loop through each adapter and enable roaming on each STA + device mode except the input adapter. + Note: On the input adapter no need to enable roaming because link got + disconnected on this. + + \param - pAdapter HDD adapter pointer + + \return - None + + --------------------------------------------------------------------------*/ +void wlan_hdd_enable_roaming(hdd_adapter_t *pAdapter) +{ + hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + hdd_adapter_t *pAdapterIdx = NULL; + hdd_adapter_list_node_t *pAdapterNode = NULL; + hdd_adapter_list_node_t *pNext = NULL; + VOS_STATUS status; + + if (pHddCtx->cfg_ini->isFastRoamIniFeatureEnabled && + pHddCtx->cfg_ini->isRoamOffloadScanEnabled && + WLAN_HDD_INFRA_STATION == pAdapter->device_mode && + vos_is_sta_active_connection_exists()) { + hddLog(LOG1, FL("Disconnect received on STA sessionId(%d)"), + pAdapter->sessionId); + /* Loop through adapter and enable roaming for each STA device mode + except the input adapter. */ + + status = hdd_get_front_adapter (pHddCtx, &pAdapterNode); + + while (NULL != pAdapterNode && VOS_STATUS_SUCCESS == status) { + pAdapterIdx = pAdapterNode->pAdapter; + + if (WLAN_HDD_INFRA_STATION == pAdapterIdx->device_mode && + pAdapter->sessionId != pAdapterIdx->sessionId) { + hddLog(LOG1, FL("Enabling Roaming on sessionId(%d)"), + pAdapterIdx->sessionId); + sme_startRoaming(WLAN_HDD_GET_HAL_CTX(pAdapterIdx), + pAdapterIdx->sessionId, + REASON_CONNECT); + } + + status = hdd_get_next_adapter(pHddCtx, pAdapterNode, &pNext); + pAdapterNode = pNext; + } + } +} +#endif + + void wlan_hdd_send_svc_nlink_msg(int type, void *data, int len) { struct sk_buff *skb; diff --git a/CORE/HDD/src/wlan_hdd_oemdata.c b/CORE/HDD/src/wlan_hdd_oemdata.c index e52eb1dd85a6..04ca34ac388a 100644 --- a/CORE/HDD/src/wlan_hdd_oemdata.c +++ b/CORE/HDD/src/wlan_hdd_oemdata.c @@ -331,9 +331,11 @@ int iw_get_oem_data_cap( oemDataCap.allowed_dwell_time_min = pConfig->nNeighborScanMinChanTime; oemDataCap.allowed_dwell_time_max = pConfig->nNeighborScanMaxChanTime; oemDataCap.curr_dwell_time_min = - sme_getNeighborScanMinChanTime(pHddContext->hHal); + sme_getNeighborScanMinChanTime(pHddContext->hHal, + pAdapter->sessionId); oemDataCap.curr_dwell_time_max = - sme_getNeighborScanMaxChanTime(pHddContext->hHal); + sme_getNeighborScanMaxChanTime(pHddContext->hHal, + pAdapter->sessionId); oemDataCap.supported_bands = pConfig->nBandCapability; /* request for max num of channels */ diff --git a/CORE/HDD/src/wlan_hdd_scan.c b/CORE/HDD/src/wlan_hdd_scan.c index f20915456eb8..e5c5760a2984 100644 --- a/CORE/HDD/src/wlan_hdd_scan.c +++ b/CORE/HDD/src/wlan_hdd_scan.c @@ -537,6 +537,7 @@ static eHalStatus hdd_IndicateScanResult(hdd_scan_info_t *scanInfo, tCsrScanResu \param - halHandle - Pointer to the Hal Handle. - pContext - Pointer to the data context. + - sessionId - Session identifier - scanId - Scan ID. - status - CSR Status. \return - 0 for success, non zero for failure @@ -544,7 +545,8 @@ static eHalStatus hdd_IndicateScanResult(hdd_scan_info_t *scanInfo, tCsrScanResu --------------------------------------------------------------------------*/ static eHalStatus hdd_ScanRequestCallback(tHalHandle halHandle, void *pContext, - tANI_U32 scanId, eCsrScanStatus status) + tANI_U8 sessionId, tANI_U32 scanId, + eCsrScanStatus status) { struct net_device *dev = (struct net_device *) pContext; hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev) ; @@ -734,7 +736,9 @@ int iw_set_scan(struct net_device *dev, struct iw_request_info *info, scanRequest.pIEField = pAdapter->scan_info.scanAddIE.addIEdata; } - status = sme_ScanRequest( (WLAN_HDD_GET_CTX(pAdapter))->hHal, pAdapter->sessionId,&scanRequest, &scanId, &hdd_ScanRequestCallback, dev ); + status = sme_ScanRequest((WLAN_HDD_GET_CTX(pAdapter))->hHal, + pAdapter->sessionId, &scanRequest, &scanId, + &hdd_ScanRequestCallback, dev); if (!HAL_STATUS_SUCCESS(status)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:sme_ScanRequest fail %d!!!",__func__, status); @@ -1112,8 +1116,9 @@ int iw_set_cscan(struct net_device *dev, struct iw_request_info *info, scanRequest.pIEField = pAdapter->scan_info.scanAddIE.addIEdata; } - status = sme_ScanRequest( (WLAN_HDD_GET_CTX(pAdapter))->hHal, - pAdapter->sessionId,&scanRequest, &scanId, &hdd_ScanRequestCallback, dev ); + status = sme_ScanRequest((WLAN_HDD_GET_CTX(pAdapter))->hHal, + pAdapter->sessionId, &scanRequest, &scanId, + &hdd_ScanRequestCallback, dev); if( !HAL_STATUS_SUCCESS(status) ) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s: SME scan fail status %d !!!",__func__, status); diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c index 53a23d9ea0cd..166bf38169d3 100644 --- a/CORE/HDD/src/wlan_hdd_wext.c +++ b/CORE/HDD/src/wlan_hdd_wext.c @@ -203,7 +203,7 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2}, #define WE_PPS_DELIM_CRC_FAIL 51 #define WE_PPS_GID_NSTS_ZERO 52 #define WE_PPS_RSSI_CHECK 53 -#define WE_ENABLE_STRICT_FCC_REG 54 +/* 54 is unused */ #define WE_SET_HTSMPS 55 /* Private ioctl for QPower */ #define WE_SET_QPOWER_MAX_PSPOLL_COUNT 56 @@ -4120,7 +4120,8 @@ static int iw_set_encodeext(struct net_device *dev, /* The supplicant may attempt to set the PTK once pre-authentication is done. Save the key in the UMAC and include it in the ADD BSS request */ - halStatus = sme_FTUpdateKey( WLAN_HDD_GET_HAL_CTX(pAdapter), &setKey); + halStatus = sme_FTUpdateKey(WLAN_HDD_GET_HAL_CTX(pAdapter), + pAdapter->sessionId, &setKey); if ( halStatus == eHAL_STATUS_FT_PREAUTH_KEY_SUCCESS ) { hddLog(VOS_TRACE_LEVEL_INFO_MED, @@ -4947,43 +4948,6 @@ static int iw_setint_getnone(struct net_device *dev, struct iw_request_info *inf break; } - case WE_ENABLE_STRICT_FCC_REG: - { - hdd_context_t *hddCtxt = WLAN_HDD_GET_CTX(pAdapter); - struct wiphy *wiphy = NULL; - long lrc; - int status; - - wiphy = hddCtxt->wiphy; - if(wiphy == NULL) - { - hddLog(VOS_TRACE_LEVEL_ERROR,"%s: wiphy is NULL ", __func__); - break; - } - init_completion(&hddCtxt->wiphy_channel_update_event); - - hddCtxt->nEnableStrictRegulatoryForFCC = set_value; - - status = regulatory_hint(wiphy, "00"); - if(status < 0) - { - hddLog(VOS_TRACE_LEVEL_ERROR,"%s: Failure in setting regulatory rule ", __func__); - break; - } - - /* Wait for completion */ - lrc = wait_for_completion_interruptible_timeout(&hddCtxt->wiphy_channel_update_event, - msecs_to_jiffies(WLAN_WAIT_TIME_CHANNEL_UPDATE)); - if (lrc <= 0) - { - hddLog(VOS_TRACE_LEVEL_ERROR,"%s: SME %s while setting strict FCC regulatory rule ", - __func__, (0 == lrc) ? "Timeout" : "Interrupt"); - return (0 == lrc) ? -ETIMEDOUT : -EINTR; - } - hddLog(VOS_TRACE_LEVEL_INFO,"%s: SUCCESS in setting strict FCC regulatory rule", __func__); - - break; - } #ifdef QCA_WIFI_2_0 case WE_SET_PHYMODE: { @@ -6953,11 +6917,14 @@ static int iw_get_char_setnone(struct net_device *dev, struct iw_request_info *i macTraceGetHDDWlanConnState( pHddStaCtx->conn_info.connState), macTraceGetNeighbourRoamState( - pMac->roam.neighborRoamInfo.neighborRoamState), + sme_getNeighborRoamState(hHal, + useAdapter->sessionId)), macTraceGetcsrRoamState( - pMac->roam.curState[useAdapter->sessionId]), + sme_getCurrentRoamState(hHal, + useAdapter->sessionId)), macTraceGetcsrRoamSubState( - pMac->roam.curSubState[useAdapter->sessionId]), + sme_getCurrentRoamSubState(hHal, + useAdapter->sessionId)), pHddStaCtx->conn_info.staId[0], macTraceGetTLState(tlState) ); @@ -6972,24 +6939,24 @@ static int iw_get_char_setnone(struct net_device *dev, struct iw_request_info *i "\n Global Sme State - %s "\ "\n Global mlm State - %s "\ "\n", - macTraceGetLimSmeState(pMac->lim.gLimSmeState), - macTraceGetLimMlmState(pMac->lim.gLimMlmState) + macTraceGetLimSmeState(sme_getLimSmeState(hHal)), + macTraceGetLimMlmState(sme_getLimSmeState(hHal)) ); len += buf; - /*printing the PE Sme and Mlm states for valid lim sessions*/ - while ( check < 3 && count < 255) - { - if ( pMac->lim.gpSession[count].valid ) - { + /* Printing the PE Sme and Mlm states for valid lim sessions */ + while (check < 3 && count < 255) { + if (sme_IsLimSessionValid(hHal, count)) { buf = scnprintf(extra + len, WE_MAX_STR_LEN - len, "\n Lim Valid Session %d:-" "\n PE Sme State - %s " "\n PE Mlm State - %s " "\n", check, - macTraceGetLimSmeState(pMac->lim.gpSession[count].limSmeState), - macTraceGetLimMlmState(pMac->lim.gpSession[count].limMlmState) + macTraceGetLimSmeState(sme_getLimSmeSessionState( + hHal, count)), + macTraceGetLimMlmState(sme_getLimMlmSessionState( + hHal, count)) ); len += buf; @@ -9401,11 +9368,10 @@ int hdd_setBand(struct net_device *dev, u8 ui_band) pAdapterNode = pNext; } - if (eHAL_STATUS_SUCCESS != sme_SetFreqBand(hHal, band)) - { + if (eHAL_STATUS_SUCCESS != sme_SetFreqBand(hHal, pAdapter->sessionId, + band)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "%s: failed to set the band value to %u ", - __func__, band); + FL("Failed to set the band value to %u"), band); return -EINVAL; } wlan_hdd_cfg80211_update_band(pHddCtx->wiphy, (eCsrBand)band); @@ -9749,11 +9715,6 @@ static const iw_handler we_private[] = { /*Maximum command length can be only 15 */ static const struct iw_priv_args we_private_args[] = { - { WE_ENABLE_STRICT_FCC_REG, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, - 0, - "setStrictFCCreg" }, - /* handlers for main ioctl */ { WLAN_PRIV_SET_INT_GET_NONE, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, diff --git a/CORE/MAC/inc/aniGlobal.h b/CORE/MAC/inc/aniGlobal.h index f4d61ac34fff..aa1bd5f41cf5 100644 --- a/CORE/MAC/inc/aniGlobal.h +++ b/CORE/MAC/inc/aniGlobal.h @@ -95,7 +95,6 @@ typedef struct sAniSirGlobal *tpAniSirGlobal; #include <limFTDefs.h> #endif - #ifdef ANI_DVT_DEBUG #include "dvtModule.h" #endif @@ -953,14 +952,6 @@ typedef struct sRrmContext }tRrmContext, *tpRrmContext; #endif -#if defined WLAN_FEATURE_VOWIFI_11R -typedef struct sFTContext -{ - tftSMEContext ftSmeContext; - tftPEContext ftPEContext; -} tftContext, *tpFTContext; -#endif - //Check if this definition can actually move here even for Volans. In that case //this featurization can be removed. /** ------------------------------------------------------------------------- * @@ -1106,10 +1097,6 @@ typedef struct sAniSirGlobal tp2pContext p2pContext; #endif -#if defined WLAN_FEATURE_VOWIFI_11R - tftContext ft; -#endif - tANI_U32 gCurrentLogSize; tANI_U32 menuCurrent; /* logDump specific */ diff --git a/CORE/MAC/inc/qwlan_version.h b/CORE/MAC/inc/qwlan_version.h index aabc1690b445..b8d98e312f3f 100644 --- a/CORE/MAC/inc/qwlan_version.h +++ b/CORE/MAC/inc/qwlan_version.h @@ -42,9 +42,9 @@ BRIEF DESCRIPTION: #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 0 #define QWLAN_VERSION_EXTRA "" -#define QWLAN_VERSION_BUILD 154 +#define QWLAN_VERSION_BUILD 155 -#define QWLAN_VERSIONSTR "1.0.0.154" +#define QWLAN_VERSIONSTR "1.0.0.155" #ifdef QCA_WIFI_2_0 diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index 15e92a5eb459..c1979f0308b8 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -3920,6 +3920,7 @@ typedef struct /* Length of the beacon or probe response * corresponding to the candidate found by PNO */ tANI_U32 frameLength; + tANI_U8 sessionId; /* Index to memory location where the contents of * beacon or probe response frame will be copied */ tANI_U8 data[1]; @@ -4015,6 +4016,12 @@ typedef struct sSirRoamOffloadScanReq tSirAcUapsd AcUapsd; #endif } tSirRoamOffloadScanReq, *tpSirRoamOffloadScanReq; + +typedef struct sSirRoamOffloadScanRsp +{ + tANI_U8 sessionId; + tANI_U32 reason; +} tSirRoamOffloadScanRsp, *tpSirRoamOffloadScanRsp; #endif //WLAN_FEATURE_ROAM_SCAN_OFFLOAD #define SIR_NOCHANGE_POWER_VALUE 0xFFFFFFFF diff --git a/CORE/MAC/src/include/parserApi.h b/CORE/MAC/src/include/parserApi.h index 82a240d096e6..3feb34c31266 100644 --- a/CORE/MAC/src/include/parserApi.h +++ b/CORE/MAC/src/include/parserApi.h @@ -41,6 +41,9 @@ #include <stdarg.h> #include "sirMacPropExts.h" #include "dot11f.h" +#ifdef WLAN_FEATURE_VOWIFI_11R +#include "limFTDefs.h" +#endif #include "limSession.h" #define COUNTRY_STRING_LENGTH ( 3 ) diff --git a/CORE/MAC/src/pe/include/limFT.h b/CORE/MAC/src/pe/include/limFT.h index 046a1db82ad3..2bfe5d8d16bc 100644 --- a/CORE/MAC/src/pe/include/limFT.h +++ b/CORE/MAC/src/pe/include/limFT.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -42,28 +42,27 @@ #include <limDebug.h> #include <limSerDesUtils.h> - /*------------------------------------------------------------------------- Function declarations and documenation ------------------------------------------------------------------------*/ -extern void limFTOpen(tpAniSirGlobal pMac); -extern void limFTCleanup(tpAniSirGlobal pMac); -extern void limFTInit(tpAniSirGlobal pMac); -extern int limProcessFTPreAuthReq(tpAniSirGlobal pMac, tpSirMsgQ pMsg); -extern void limPerformFTPreAuth(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data, +void limFTOpen(tpAniSirGlobal pMac, tpPESession psessionEntry); +void limFTCleanup(tpAniSirGlobal pMac, tpPESession psessionEntry); +void limFTCleanupPreAuthInfo(tpAniSirGlobal pMac, tpPESession psessionEntry); +int limProcessFTPreAuthReq(tpAniSirGlobal pMac, tpSirMsgQ pMsg); +void limPerformFTPreAuth(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data, tpPESession psessionEntry); -void limPerformPostFTPreAuth(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data, +void limPerformPostFTPreAuth(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data, tpPESession psessionEntry); -void limFTResumeLinkCb(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data); -void limPostFTPreAuthRsp(tpAniSirGlobal pMac, tSirRetStatus status, +void limFTResumeLinkCb(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data); +void limPostFTPreAuthRsp(tpAniSirGlobal pMac, tSirRetStatus status, tANI_U8 *auth_rsp, tANI_U16 auth_rsp_length, tpPESession psessionEntry); -void limHandleFTPreAuthRsp(tpAniSirGlobal pMac, tSirRetStatus status, +void limHandleFTPreAuthRsp(tpAniSirGlobal pMac, tSirRetStatus status, tANI_U8 *auth_rsp, tANI_U16 auth_rsp_len, tpPESession psessionEntry); -void limProcessMlmFTReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf, +void limProcessMlmFTReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf, tpPESession psessionEntry); -void limProcessFTPreauthRspTimeout(tpAniSirGlobal pMac); +void limProcessFTPreauthRspTimeout(tpAniSirGlobal pMac); tANI_BOOLEAN limProcessFTUpdateKey(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf ); tSirRetStatus limProcessFTAggrQosReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf ); @@ -71,6 +70,7 @@ void limProcessFTAggrQoSRsp(tpAniSirGlobal pMac, tpSirMsgQ limMsg); #ifdef WLAN_FEATURE_ROAM_OFFLOAD void limProcessFTRoamOffloadSynchInd(tpAniSirGlobal pMac, tpSirMsgQ pMsg); #endif +void limFTCleanupAllFTSessions(tpAniSirGlobal pMac); #endif /* __LIMFT_H__ */ diff --git a/CORE/MAC/src/pe/include/limFTDefs.h b/CORE/MAC/src/pe/include/limFTDefs.h index 1281a80fbe35..98a9f1d2a1ee 100644 --- a/CORE/MAC/src/pe/include/limFTDefs.h +++ b/CORE/MAC/src/pe/include/limFTDefs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -90,6 +90,7 @@ typedef struct sSirFTUpdateKeyInfo { tANI_U16 messageType; tANI_U16 length; + tANI_U32 smeSessionId; tSirMacAddr bssId; tSirKeyMaterial keyMaterial; } tSirFTUpdateKeyInfo, *tpSirFTUpdateKeyInfo; @@ -108,17 +109,24 @@ typedef struct sSirFTPreAuthKeyInfo ------------------------------------------------------------------------*/ typedef struct sFTPEContext { - tpSirFTPreAuthReq pFTPreAuthReq; // Saved FT Pre Auth Req - void *psavedsessionEntry; + tpSirFTPreAuthReq pFTPreAuthReq; /* Saved FT Pre Auth Req */ tSirRetStatus ftPreAuthStatus; tANI_U16 saved_auth_rsp_length; tANI_U8 saved_auth_rsp[MAX_FTIE_SIZE]; tSirFTPreAuthKeyInfo PreAuthKeyInfo; - // Items created for the new FT, session - void *pftSessionEntry; // Saved session created for pre-auth - void *pAddBssReq; // Save add bss req. - void *pAddStaReq; // Save add sta req. - + /* Items created for the new FT, session */ + void *pAddBssReq; /* Save add bss req */ + void *pAddStaReq; /*Save add sta req */ + tANI_U32 peSessionId; + tANI_U32 smeSessionId; + + /* This flag is required to indicate on which session the preauth + * has taken place, since the auth reponse for preauth will come + * for a new BSSID for which there is no session yet. This flag + * will be used to extract the session from the session preauth + * has been initiated + */ + tANI_BOOLEAN ftPreAuthSession; } tftPEContext, *tpftPEContext; #ifdef WLAN_FEATURE_ROAM_OFFLOAD diff --git a/CORE/MAC/src/pe/include/limSession.h b/CORE/MAC/src/pe/include/limSession.h index e327c3690a8d..ed841368063d 100644 --- a/CORE/MAC/src/pe/include/limSession.h +++ b/CORE/MAC/src/pe/include/limSession.h @@ -28,7 +28,6 @@ #if !defined( __LIM_SESSION_H ) #define __LIM_SESSION_H - /**========================================================================= \file limSession.h @@ -155,22 +154,19 @@ typedef struct sPESession // Added to Support BT-AMP // Assoc or ReAssoc Response Data/Frame void *limAssocResponseData; - - /** BSS Table parameters **/ - /* - * staId: Start BSS: this is the Sta Id for the BSS. - Join: this is the selfStaId - In both cases above, the peer STA ID wll be stored in dph hash table. - */ + * staId: Start BSS: this is the Sta Id for the BSS. + * Join: this is the selfStaId + * In both cases above, the peer STA ID wll be stored in dph hash table. + */ tANI_U16 staId; - tANI_U16 statypeForBss; //to know session is for PEER or SELF + tANI_U16 statypeForBss; //to know session is for PEER or SELF tANI_U8 shortSlotTimeSupported; tANI_U8 dtimPeriod; - tSirMacRateSet rateSet; - tSirMacRateSet extRateSet; + tSirMacRateSet rateSet; + tSirMacRateSet extRateSet; tSirMacHTOperatingMode htOperMode; tANI_U8 currentOperChannel; tANI_U8 currentReqChannel; @@ -450,6 +446,12 @@ typedef struct sPESession // Added to Support BT-AMP #ifdef WLAN_FEATURE_ROAM_OFFLOAD tANI_BOOLEAN bRoamSynchInProgress; #endif + +#if defined WLAN_FEATURE_VOWIFI_11R + /* Fast Transition (FT) */ + tftPEContext ftPEContext; +#endif + }tPESession, *tpPESession; #define LIM_MAX_ACTIVE_SESSIONS 4 diff --git a/CORE/MAC/src/pe/include/rrmGlobal.h b/CORE/MAC/src/pe/include/rrmGlobal.h index 810a385c1525..e774964078eb 100644 --- a/CORE/MAC/src/pe/include/rrmGlobal.h +++ b/CORE/MAC/src/pe/include/rrmGlobal.h @@ -142,9 +142,9 @@ typedef struct sSirNeighborReportInd { tANI_U16 messageType; // eWNI_SME_NEIGHBOR_REPORT_IND tANI_U16 length; + tANI_U8 sessionId; tANI_U16 numNeighborReports; tSirMacAddr bssId; //For the session. - //tSirResultCodes statusCode; tSirNeighborBssDescription sNeighborBssDescription[1]; } tSirNeighborReportInd, * tpSirNeighborReportInd; diff --git a/CORE/MAC/src/pe/lim/limAIDmgmt.c b/CORE/MAC/src/pe/lim/limAIDmgmt.c index e9752b2b7f85..6a1f1b441159 100644 --- a/CORE/MAC/src/pe/lim/limAIDmgmt.c +++ b/CORE/MAC/src/pe/lim/limAIDmgmt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -43,6 +43,9 @@ #include "sirParams.h" #include "limUtils.h" #include "limTimerUtils.h" +#ifdef WLAN_FEATURE_VOWIFI_11R +#include "limFTDefs.h" +#endif #include "limSession.h" #include "limSessionUtils.h" diff --git a/CORE/MAC/src/pe/lim/limApi.c b/CORE/MAC/src/pe/lim/limApi.c index e119cb495cf0..2d5d18efc45a 100644 --- a/CORE/MAC/src/pe/lim/limApi.c +++ b/CORE/MAC/src/pe/lim/limApi.c @@ -60,6 +60,9 @@ #include "limSendSmeRspMessages.h" #include "wmmApsd.h" #include "limTrace.h" +#ifdef WLAN_FEATURE_VOWIFI_11R +#include "limFTDefs.h" +#endif #include "limSession.h" #include "wlan_qct_wda.h" @@ -142,45 +145,10 @@ static void __limInitBssVars(tpAniSirGlobal pMac) vos_mem_set((void*)pMac->lim.gpSession, sizeof(*pMac->lim.gpSession)*pMac->lim.maxBssId, 0); - - //pMac->lim.gpLimStartBssReq = NULL; - - - - -/* These global variables are moved to session table and intialization is done during session creation Oct 9th Review */ -#if 0 - - // Place holder for BSS description that we're - // currently joined with - vos_mem_set(&pMac->lim.gLimCurrentBssId, sizeof(tSirMacAddr), 0); - pMac->lim.gLimCurrentChannelId = HAL_INVALID_CHANNEL_ID; - vos_mem_set(&pMac->lim.gLimCurrentSSID, sizeof(tSirMacSSid), 0); - pMac->lim.gLimCurrentBssCaps = 0; - QosCaps is a bit map of various qos capabilities - see defn above - pMac->lim.gLimCurrentBssQosCaps = 0; - pMac->lim.gLimCurrentBssPropCap = 0; - pMac->lim.gLimSentCapsChangeNtf = 0; - - // Place holder for BSS description that - // we're currently Reassociating - vos_mem_set(&pMac->lim.gLimReassocBssId, sizeof(tSirMacAddr), 0); - pMac->lim.gLimReassocChannelId = 0; - vos_mem_set(&pMac->lim.gLimReassocSSID, sizeof(tSirMacSSid), 0); - pMac->lim.gLimReassocBssCaps = 0; - pMac->lim.gLimReassocBssQosCaps = 0; - pMac->lim.gLimReassocBssPropCap = 0; - #endif - /* This is for testing purposes only, be default should always be off */ pMac->lim.gLimForceNoPropIE = 0; - - // pMac->lim.gLimBssIdx = 0; - pMac->lim.gpLimMlmSetKeysReq = NULL; pMac->lim.gpLimMlmRemoveKeyReq = NULL; - // pMac->lim.gLimStaid = 0; //TO SUPPORT BT-AMP - } @@ -192,12 +160,8 @@ static void __limInitStatsVars(tpAniSirGlobal pMac) pMac->lim.gLimNumDeferredMsgs = 0; /// Variable to keep track of number of currently associated STAs - //pMac->lim.gLimNumOfCurrentSTAs = 0; pMac->lim.gLimNumOfAniSTAs = 0; // count of ANI peers - /// This indicates number of RXed Beacons during HB period - //pMac->lim.gLimRxedBeaconCntDuringHB = 0; - // Heart-Beat interval value pMac->lim.gLimHeartBeatCount = 0; @@ -273,14 +237,6 @@ static void __limInitStates(tpAniSirGlobal pMac) vos_mem_set(pMac->lim.gLimMyMacAddr, sizeof(pMac->lim.gLimMyMacAddr), 0); pMac->lim.ackPolicy = 0; -#if 0 /* Moving all these to session specific elements */ - pMac->lim.gLimQosEnabled = 0; //11E - pMac->lim.gLimWmeEnabled = 0; //WME - pMac->lim.gLimWsmEnabled = 0; //WSM - pMac->lim.gLimHcfEnabled = 0; - pMac->lim.gLim11dEnabled = 0; -#endif - pMac->lim.gLimProbeRespDisableFlag = 0; // control over probe response } @@ -311,11 +267,6 @@ static void __limInitVars(tpAniSirGlobal pMac) vos_mem_set(&pMac->lim.gLimAlternateRadio, sizeof(tSirAlternateRadioInfo), 0); SET_LIM_PROCESS_DEFD_MESGS(pMac, true); -#if 0 - // 11h Spectrum Management Related Flag - LIM_SET_RADAR_DETECTED(pMac, eANI_BOOLEAN_FALSE); - pMac->sys.gSysEnableLearnMode = eANI_BOOLEAN_TRUE; -#endif // WMM Related Flag pMac->lim.gUapsdEnable = 0; pMac->lim.gUapsdPerAcBitmask = 0; @@ -348,12 +299,7 @@ static void __limInitVars(tpAniSirGlobal pMac) static void __limInitAssocVars(tpAniSirGlobal pMac) { tANI_U32 val; -#if 0 - vos_mem_set(pMac->lim.gpLimAIDpool, - sizeof(*pMac->lim.gpLimAIDpool) * (WNI_CFG_ASSOC_STA_LIMIT_STAMAX+1), 0); - pMac->lim.freeAidHead = 0; - pMac->lim.freeAidTail = 0; -#endif + if(wlan_cfgGetInt(pMac, WNI_CFG_ASSOC_STA_LIMIT, &val) != eSIR_SUCCESS) { limLog( pMac, LOGP, FL( "cfg get assoc sta limit failed" )); @@ -363,7 +309,6 @@ static void __limInitAssocVars(tpAniSirGlobal pMac) // Place holder for current authentication request // being handled pMac->lim.gpLimMlmAuthReq = NULL; - //pMac->lim.gpLimMlmJoinReq = NULL; /// MAC level Pre-authentication related globals pMac->lim.gLimPreAuthChannelNumber = 0; @@ -398,11 +343,6 @@ static void __limInitAssocVars(tpAniSirGlobal pMac) static void __limInitTitanVars(tpAniSirGlobal pMac) { -#if 0 - vos_mem_set(&pMac->lim.gLimChannelSwitch, sizeof(tLimChannelSwitchInfo), 0); - pMac->lim.gLimChannelSwitch.state = eLIM_CHANNEL_SWITCH_IDLE; - pMac->lim.gLimChannelSwitch.secondarySubBand = PHY_SINGLE_CHANNEL_CENTERED; -#endif // Debug workaround for BEACON's // State change triggered by "dump 222" pMac->lim.gLimScanOverride = 1; @@ -733,13 +673,9 @@ limInitialize(tpAniSirGlobal pMac) if(!pMac->psOffloadEnabled) pmmInitialize(pMac); - #if defined WLAN_FEATURE_VOWIFI rrmInitialize(pMac); #endif -#if defined WLAN_FEATURE_VOWIFI_11R - limFTOpen(pMac); -#endif vos_list_init(&pMac->lim.gLimMgmtFrameRegistratinQueue); @@ -827,50 +763,18 @@ limCleanup(tpAniSirGlobal pMac) pMac->lim.pDialogueTokenTail = NULL; } - # if 0 - if (pMac->lim.gpLimStartBssReq != NULL) - { - vos_mem_free(pMac->lim.gpLimStartBssReq); - pMac->lim.gpLimStartBssReq = NULL; - } - #endif - if (pMac->lim.gpLimMlmSetKeysReq != NULL) { vos_mem_free(pMac->lim.gpLimMlmSetKeysReq); pMac->lim.gpLimMlmSetKeysReq = NULL; } - #if 0 - if (pMac->lim.gpLimJoinReq != NULL) - { - vos_mem_free(pMac->lim.gpLimJoinReq); - pMac->lim.gpLimJoinReq = NULL; - } - #endif - if (pMac->lim.gpLimMlmAuthReq != NULL) { vos_mem_free(pMac->lim.gpLimMlmAuthReq); pMac->lim.gpLimMlmAuthReq = NULL; } -#if 0 - if (pMac->lim.gpLimMlmJoinReq != NULL) - { - vos_mem_free(pMac->lim.gpLimMlmJoinReq); - pMac->lim.gpLimMlmJoinReq = NULL; - } -#endif - - #if 0 - if (pMac->lim.gpLimReassocReq != NULL) - { - vos_mem_free(pMac->lim.gpLimReassocReq); - pMac->lim.gpLimReassocReq = NULL; - } - #endif - if (pMac->lim.gpLimMlmRemoveKeyReq != NULL) { vos_mem_free(pMac->lim.gpLimMlmRemoveKeyReq); @@ -889,32 +793,9 @@ limCleanup(tpAniSirGlobal pMac) pMac->lim.gpLimMlmScanReq = NULL; } -#if 0 - if(NULL != pMac->lim.beacon) - { - vos_mem_free((void*) pMac->lim.beacon); - pMac->lim.beacon = NULL; - } -#endif - #if 0 - if(NULL != pMac->lim.assocReq) - { - vos_mem_free((void*) pMac->lim.assocReq); - pMac->lim.assocReq= NULL; - } - #endif - -#if 0 - if(NULL != pMac->lim.assocRsp) - { - vos_mem_free((void*) pMac->lim.assocRsp); - pMac->lim.assocRsp= NULL; - } -#endif // Now, finally reset the deferred message queue pointers limResetDeferredMsgQ(pMac); - pvosGCTx = vos_get_global_context(VOS_MODULE_ID_PE, (v_VOID_t *) pMac); retStatus = WLANTL_DeRegisterMgmtFrmClient(pvosGCTx); @@ -924,8 +805,9 @@ limCleanup(tpAniSirGlobal pMac) #if defined WLAN_FEATURE_VOWIFI rrmCleanup(pMac); #endif + #if defined WLAN_FEATURE_VOWIFI_11R - limFTCleanup(pMac); + limFTCleanupAllFTSessions(pMac); #endif } /*** end limCleanup() ***/ diff --git a/CORE/MAC/src/pe/lim/limAssocUtils.c b/CORE/MAC/src/pe/lim/limAssocUtils.c index abe87e5e83bd..9e9404e89eec 100644 --- a/CORE/MAC/src/pe/lim/limAssocUtils.c +++ b/CORE/MAC/src/pe/lim/limAssocUtils.c @@ -56,6 +56,9 @@ #include "limAdmitControl.h" #include "limSendMessages.h" #include "limIbssPeerMgmt.h" +#ifdef WLAN_FEATURE_VOWIFI_11R +#include "limFTDefs.h" +#endif #include "limSession.h" #include "vos_types.h" @@ -2741,7 +2744,7 @@ limAddSta( msgQ.bodyptr = pAddStaParams; msgQ.bodyval = 0; - limLog( pMac, LOG1, FL( "Sending SIR_HAL_ADD_STA_REQ for assocId %d" ), + limLog(pMac, LOG1, FL("Sending WDA_ADD_STA_REQ for assocId %d"), pStaDs->assocId); MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); @@ -2907,35 +2910,35 @@ limDelSta( */ tSirRetStatus limAddFTStaSelf(tpAniSirGlobal pMac, tANI_U16 assocId, tpPESession psessionEntry) { - tpAddStaParams pAddStaParams = NULL; + tpAddStaParams pAddStaParams = NULL; + tSirRetStatus retCode = eSIR_SUCCESS; tSirMsgQ msgQ; - tSirRetStatus retCode = eSIR_SUCCESS; - pAddStaParams = pMac->ft.ftPEContext.pAddStaReq; + pAddStaParams = psessionEntry->ftPEContext.pAddStaReq; pAddStaParams->assocId = assocId; + pAddStaParams->smesessionId = psessionEntry->smeSessionId; - msgQ.type = SIR_HAL_ADD_STA_REQ; + msgQ.type = WDA_ADD_STA_REQ; msgQ.reserved = 0; msgQ.bodyptr = pAddStaParams; msgQ.bodyval = 0; - #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - limLog( pMac, LOG1, FL( "Sending SIR_HAL_ADD_STA_REQ... (aid %d)" ), pAddStaParams->assocId); + limLog(pMac, LOGE, + FL("Sending WDA_ADD_STA_REQ (aid %d)"), pAddStaParams->assocId); #endif MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); psessionEntry->limPrevMlmState = psessionEntry->limMlmState; - MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, eLIM_MLM_WT_ADD_STA_RSP_STATE)); + MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, + eLIM_MLM_WT_ADD_STA_RSP_STATE)); psessionEntry->limMlmState = eLIM_MLM_WT_ADD_STA_RSP_STATE; - if( eSIR_SUCCESS != (retCode = wdaPostCtrlMsg( pMac, &msgQ ))) - { - limLog( pMac, LOGE, FL("Posting ADD_STA_REQ to HAL failed, reason=%X"), retCode ); + if (eSIR_SUCCESS != (retCode = wdaPostCtrlMsg(pMac, &msgQ))) { + limLog(pMac, LOGE, + FL("Posting WDA_ADD_STA_REQ to HAL failed, reason=%X"), retCode); vos_mem_free(pAddStaParams); } - // - // Dont need it any more - pMac->ft.ftPEContext.pAddStaReq = NULL; + psessionEntry->ftPEContext.pAddStaReq = NULL; return retCode; } @@ -2987,15 +2990,6 @@ limAddStaSelf(tpAniSirGlobal pMac,tANI_U16 staIdx, tANI_U8 updateSta, tpPESessio limLog( pMac, LOG1, FL("SGI 20 %d"),(int)selfTxWidth); limLog( pMac, LOG1, FL("Roam Channel Bonding Mode %d"),(int)pMac->roam.configParam.uCfgDot11Mode); - #if 0 - retCode =wlan_cfgGetStr(pMac, WNI_CFG_STA_ID, staMac, &cfg); - if (retCode != eSIR_SUCCESS) - { - /// Could not get BSSID from CFG. Log error. - limLog(pMac, LOGP, FL("could not retrieve STA MAC")); - return retCode; - } - #endif //TO SUPPORT BT-AMP sirCopyMacAddr(staMac,psessionEntry->selfMacAddr); limLog(pMac, LOG1, FL(MAC_ADDRESS_STR": "),MAC_ADDR_ARRAY(staMac)); pAddStaParams = vos_mem_malloc(sizeof(tAddStaParams)); @@ -3037,9 +3031,6 @@ limAddStaSelf(tpAniSirGlobal pMac,tANI_U16 staIdx, tANI_U8 updateSta, tpPESessio #else limPopulateOwnRateSet(pMac, &pAddStaParams->supportedRates, NULL, false,psessionEntry); #endif -// if( psessionEntry->htCapability)---> old check - /*We used to check if the session is htCapable before setting the htCapable - * flag. The check limited us from operating */ if ( IS_DOT11_MODE_HT(selfStaDot11Mode) ) { pAddStaParams->htCapable = TRUE ; @@ -3061,7 +3052,6 @@ limAddStaSelf(tpAniSirGlobal pMac,tANI_U16 staIdx, tANI_U8 updateSta, tpPESessio pAddStaParams->greenFieldCapable = limGetHTCapability( pMac, eHT_GREENFIELD, psessionEntry); pAddStaParams->txChannelWidthSet = pMac->roam.configParam.channelBondingMode5GHz; - // pAddStaParams->txChannelWidthSet = limGetHTCapability( pMac, eHT_SUPPORTED_CHANNEL_WIDTH_SET, psessionEntry); pAddStaParams->mimoPS = limGetHTCapability( pMac, eHT_MIMO_POWER_SAVE, psessionEntry ); pAddStaParams->rifsMode = limGetHTCapability( pMac, eHT_RIFS_MODE, psessionEntry ); pAddStaParams->lsigTxopProtection = limGetHTCapability( pMac, eHT_LSIG_TXOP_PROTECTION, psessionEntry ); @@ -3082,9 +3072,6 @@ limAddStaSelf(tpAniSirGlobal pMac,tANI_U16 staIdx, tANI_U8 updateSta, tpPESessio { pAddStaParams->fShortGI20Mhz = WNI_CFG_SHORT_GI_20MHZ_STAMAX; - //pAddStaParams->fShortGI20Mhz = - //limGetHTCapability(pMac, eHT_SHORT_GI_20MHZ, - // psessionEntry); } else { @@ -3110,9 +3097,6 @@ limAddStaSelf(tpAniSirGlobal pMac,tANI_U16 staIdx, tANI_U8 updateSta, tpPESessio { pAddStaParams->fShortGI40Mhz = WNI_CFG_SHORT_GI_40MHZ_STAMAX; - //pAddStaParams->fShortGI40Mhz = - //limGetHTCapability(pMac, eHT_SHORT_GI_40MHZ, - // psessionEntry); } else { @@ -3183,8 +3167,8 @@ limAddStaSelf(tpAniSirGlobal pMac,tANI_U16 staIdx, tANI_U8 updateSta, tpPESessio pAddStaParams->p2pCapableSta = 1; } - //limFillSupportedRatesInfo(pMac, NULL, &pAddStaParams->supportedRates,psessionEntry); - pAddStaParams->supportedRates.opRateMode = limGetStaRateMode((tANI_U8)selfStaDot11Mode); + pAddStaParams->supportedRates.opRateMode = + limGetStaRateMode((tANI_U8)selfStaDot11Mode); limLog(pMac, LOG2, FL(" StaIdx: %d updateSta = %d htcapable = %d "), pAddStaParams->staIdx,pAddStaParams->updateSta, @@ -3195,31 +3179,26 @@ limAddStaSelf(tpAniSirGlobal pMac,tANI_U16 staIdx, tANI_U8 updateSta, tpPESessio pAddStaParams->htLdpcCapable,pAddStaParams->vhtLdpcCapable, pAddStaParams->p2pCapableSta); - limLog(pMac, LOG2, FL(" sessionid: %d Assoc ID: %d listenInterval = %d" - " shortPreambleSupported: %d "), psessionEntry->smeSessionId, - pAddStaParams->assocId, pAddStaParams->listenInterval, - pAddStaParams->shortPreambleSupported); + limLog(pMac, LOG2, FL("sessionid: %d Assoc ID: %d listenInterval = %d " + "shortPreambleSupported: %d"), psessionEntry->smeSessionId, + pAddStaParams->assocId, pAddStaParams->listenInterval, + pAddStaParams->shortPreambleSupported); msgQ.type = WDA_ADD_STA_REQ; - // - // FIXME_GEN4 - // A global counter (dialog token) is required to keep track of - // all PE <-> HAL communication(s) - // msgQ.reserved = 0; msgQ.bodyptr = pAddStaParams; msgQ.bodyval = 0; - limLog( pMac, LOGW, FL(MAC_ADDRESS_STR":Sessionid %d : " - "Sending SIR_HAL_ADD_STA_REQ... (aid %d)" ), - MAC_ADDR_ARRAY(pAddStaParams->staMac), - pAddStaParams->sessionId, - pAddStaParams->assocId); - MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); + limLog(pMac, LOG1, FL(MAC_ADDRESS_STR":Sessionid %d : " + "Sending WDA_ADD_STA_REQ. (aid %d)"), + MAC_ADDR_ARRAY(pAddStaParams->staMac), + pAddStaParams->sessionId, + pAddStaParams->assocId); + MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); - if( eSIR_SUCCESS != (retCode = wdaPostCtrlMsg( pMac, &msgQ ))) - { - limLog( pMac, LOGE, FL("Posting ADD_STA_REQ to HAL failed, reason=%X"), retCode ); + if (eSIR_SUCCESS != (retCode = wdaPostCtrlMsg(pMac, &msgQ))) { + limLog(pMac, LOGE, + FL("Posting WDA_ADD_STA_REQ to HAL failed, reason=%X"), retCode); vos_mem_free(pAddStaParams); } return retCode; @@ -4194,8 +4173,8 @@ tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, msgQ.bodyptr = pAddBssParams; msgQ.bodyval = 0; - limLog( pMac, LOG1, FL("SessionId:%d Sending SIR_HAL_ADD_BSS_REQ" ), - psessionEntry->peSessionId); + limLog(pMac, LOG1, FL("SessionId:%d Sending WDA_ADD_BSS_REQ"), + psessionEntry->peSessionId); MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); retCode = wdaPostCtrlMsg( pMac, &msgQ ); @@ -4632,8 +4611,8 @@ tSirRetStatus limStaSendAddBssPreAssoc( tpAniSirGlobal pMac, tANI_U8 updateEntry msgQ.bodyptr = pAddBssParams; msgQ.bodyval = 0; - limLog( pMac, LOG1, FL("SessionId:%d Sending SIR_HAL_ADD_BSS_REQ" ), - psessionEntry->peSessionId); + limLog(pMac, LOG1, FL("SessionId:%d Sending WDA_ADD_BSS_REQ"), + psessionEntry->peSessionId); MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); retCode = wdaPostCtrlMsg( pMac, &msgQ ); diff --git a/CORE/MAC/src/pe/lim/limFT.c b/CORE/MAC/src/pe/lim/limFT.c index d81f44466d04..e3fc7131d362 100644 --- a/CORE/MAC/src/pe/lim/limFT.c +++ b/CORE/MAC/src/pe/lim/limFT.c @@ -64,159 +64,144 @@ extern void limSendSetStaKeyReq( tpAniSirGlobal pMac, /*-------------------------------------------------------------------------- Initialize the FT variables. ------------------------------------------------------------------------*/ -void limFTOpen(tpAniSirGlobal pMac) +void limFTOpen(tpAniSirGlobal pMac, tpPESession psessionEntry) { - pMac->ft.ftPEContext.pFTPreAuthReq = NULL; - pMac->ft.ftPEContext.psavedsessionEntry = NULL; + if (psessionEntry) + vos_mem_set(&psessionEntry->ftPEContext, sizeof(tftPEContext), 0); } /*-------------------------------------------------------------------------- Cleanup FT variables. ------------------------------------------------------------------------*/ -void limFTCleanup(tpAniSirGlobal pMac) +void limFTCleanupPreAuthInfo(tpAniSirGlobal pMac, tpPESession psessionEntry) { - if (pMac->ft.ftPEContext.pFTPreAuthReq) - { -#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOG1, "%s: Freeing pFTPreAuthReq= %p", - __func__, pMac->ft.ftPEContext.pFTPreAuthReq);) -#endif - if (pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription) - { - vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription); - pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription = NULL; - } - vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq); - pMac->ft.ftPEContext.pFTPreAuthReq = NULL; - } + tpPESession pReAssocSessionEntry = NULL; + tANI_U8 sessionId = 0; - // This is the old session, should be deleted else where. - // We should not be cleaning it here, just set it to NULL. - if (pMac->ft.ftPEContext.psavedsessionEntry) - { + if (!pMac) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOG1, "%s: Setting psavedsessionEntry= %p to NULL", - __func__, pMac->ft.ftPEContext.psavedsessionEntry);) + PELOGE(limLog(pMac, LOGE, "%s: pMac is NULL", __func__);) #endif - pMac->ft.ftPEContext.psavedsessionEntry = NULL; - } + return; + } - // This is the extra session we added as part of Auth resp - // clean it up. - if (pMac->ft.ftPEContext.pftSessionEntry) - { - if ((((tpPESession)(pMac->ft.ftPEContext.pftSessionEntry))->valid) && - (((tpPESession)(pMac->ft.ftPEContext.pftSessionEntry))->limSmeState == eLIM_SME_WT_REASSOC_STATE)) - { - PELOGE(limLog( pMac, LOGE, "%s: Deleting Preauth Session %d", __func__, ((tpPESession)pMac->ft.ftPEContext.pftSessionEntry)->peSessionId);) - peDeleteSession(pMac, pMac->ft.ftPEContext.pftSessionEntry); - } - pMac->ft.ftPEContext.pftSessionEntry = NULL; + if (!psessionEntry) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOG1, "%s: Setting psavedsessionEntry= %p to NULL", - __func__, pMac->ft.ftPEContext.psavedsessionEntry);) + PELOGE(limLog(pMac, LOGE, "%s: psessionEntry is NULL", __func__);) #endif - } + return; + } - if (pMac->ft.ftPEContext.pAddBssReq) - { - vos_mem_free(pMac->ft.ftPEContext.pAddBssReq); - pMac->ft.ftPEContext.pAddBssReq = NULL; - } - - if (pMac->ft.ftPEContext.pAddStaReq) - { - vos_mem_free(pMac->ft.ftPEContext.pAddStaReq); - pMac->ft.ftPEContext.pAddStaReq = NULL; - } - - pMac->ft.ftPEContext.ftPreAuthStatus = eSIR_SUCCESS; - -} - -/*-------------------------------------------------------------------------- - Init FT variables. - ------------------------------------------------------------------------*/ -void limFTInit(tpAniSirGlobal pMac) -{ - if (pMac->ft.ftPEContext.pFTPreAuthReq) - { + /* Nothing to be done if the session is not in STA mode */ + if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOG1, "%s: Freeing pFTPreAuthReq= %p", - __func__, pMac->ft.ftPEContext.pFTPreAuthReq);) + PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif - if (pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription) - { - vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription); - pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription = NULL; - } + return; + } - vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq); - pMac->ft.ftPEContext.pFTPreAuthReq = NULL; - } + if (psessionEntry->ftPEContext.pFTPreAuthReq) { + pReAssocSessionEntry = + peFindSessionByBssid(pMac, + psessionEntry->ftPEContext.pFTPreAuthReq->preAuthbssId, + &sessionId); - // This is the old session, should be deleted else where. - // We should not be cleaning it here, just set it to NULL. - if (pMac->ft.ftPEContext.psavedsessionEntry) - { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOG1, "%s: Setting psavedsessionEntry= %p to NULL", - __func__, pMac->ft.ftPEContext.psavedsessionEntry);) + PELOG1(limLog( pMac, LOG1, FL("Freeing pFTPreAuthReq= %p"), + psessionEntry->ftPEContext.pFTPreAuthReq);) #endif - pMac->ft.ftPEContext.psavedsessionEntry = NULL; - } + if (psessionEntry->ftPEContext.pFTPreAuthReq->pbssDescription) { + vos_mem_free( + psessionEntry->ftPEContext.pFTPreAuthReq->pbssDescription); + psessionEntry->ftPEContext.pFTPreAuthReq->pbssDescription = NULL; + } + vos_mem_free(psessionEntry->ftPEContext.pFTPreAuthReq); + psessionEntry->ftPEContext.pFTPreAuthReq = NULL; + } + + if (psessionEntry->ftPEContext.pAddBssReq) { + vos_mem_free(psessionEntry->ftPEContext.pAddBssReq); + psessionEntry->ftPEContext.pAddBssReq = NULL; + } + + if (psessionEntry->ftPEContext.pAddStaReq) { + vos_mem_free(psessionEntry->ftPEContext.pAddStaReq); + psessionEntry->ftPEContext.pAddStaReq = NULL; + } + + /* The session is being deleted, cleanup the contents */ + vos_mem_set(&psessionEntry->ftPEContext, sizeof(tftPEContext), 0); + + /* Delete the session created while handling pre-auth response */ + if (pReAssocSessionEntry) { + /* If we have successful pre-auth response, then we would have + * created a session on which reassoc request will be sent + */ + if (pReAssocSessionEntry->valid && + pReAssocSessionEntry->limSmeState == eLIM_SME_WT_REASSOC_STATE) { + PELOGW(limLog( pMac, LOGW, FL("Deleting Preauth Session %d"), + pReAssocSessionEntry->peSessionId);) + peDeleteSession(pMac, pReAssocSessionEntry); + } + } +} - // This is the extra session we added as part of Auth resp - // clean it up. - if (pMac->ft.ftPEContext.pftSessionEntry) - { +void limFTCleanupAllFTSessions(tpAniSirGlobal pMac) +{ + /* Wrapper function to cleanup all FT sessions */ + int i; + + for (i = 0; i < pMac->lim.maxBssId; i++) { + if (VOS_TRUE == pMac->lim.gpSession[i].valid) { + /* The session is valid, may have FT data */ + limFTCleanup(pMac, &pMac->lim.gpSession[i]); + } + } +} +void limFTCleanup(tpAniSirGlobal pMac, tpPESession psessionEntry) +{ + if (NULL == psessionEntry) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOG1, "%s: Deleting session = %p ", - __func__, pMac->ft.ftPEContext.pftSessionEntry);) + PELOGE(limLog(pMac, LOGE, FL("psessionEntry is NULL"));) #endif - /* Delete the previous valid preauth pesession if it is still in - * mMlmState= eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE - * and limSmeState = eLIM_SME_WT_REASSOC_STATE. This means last - * preauth didnt went through and its Session was not deleted. - */ - if ((((tpPESession)(pMac->ft.ftPEContext.pftSessionEntry))->valid) && - (((tpPESession)(pMac->ft.ftPEContext.pftSessionEntry))->limSmeState - == eLIM_SME_WT_REASSOC_STATE) && - (((tpPESession)(pMac->ft.ftPEContext.pftSessionEntry))->limMlmState - == eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE) ) - { - limLog( pMac, LOGE, FL("Deleting Preauth Session %d"), - ((tpPESession)pMac->ft.ftPEContext.pftSessionEntry)->peSessionId); - peDeleteSession(pMac, pMac->ft.ftPEContext.pftSessionEntry); - } - - pMac->ft.ftPEContext.pftSessionEntry = NULL; - } + return; + } - if (pMac->ft.ftPEContext.pAddBssReq) - { + /* Nothing to be done if the session is not in STA mode */ + if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOG1, "%s: Freeing AddBssReq = %p ", - __func__, pMac->ft.ftPEContext.pAddBssReq);) + PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif - vos_mem_free(pMac->ft.ftPEContext.pAddBssReq); - pMac->ft.ftPEContext.pAddBssReq = NULL; - } - + return; + } - if (pMac->ft.ftPEContext.pAddStaReq) - { + if (NULL != psessionEntry->ftPEContext.pFTPreAuthReq) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOG1, "%s: Freeing AddStaReq = %p ", - __func__, pMac->ft.ftPEContext.pAddStaReq);) + PELOG1(limLog( pMac, LOG1, FL("Freeing pFTPreAuthReq= %p"), + psessionEntry->ftPEContext.pFTPreAuthReq);) #endif - vos_mem_free(pMac->ft.ftPEContext.pAddStaReq); - pMac->ft.ftPEContext.pAddStaReq = NULL; - } - - pMac->ft.ftPEContext.ftPreAuthStatus = eSIR_SUCCESS; - + if (NULL != psessionEntry->ftPEContext.pFTPreAuthReq->pbssDescription) { + vos_mem_free( + psessionEntry->ftPEContext.pFTPreAuthReq->pbssDescription); + psessionEntry->ftPEContext.pFTPreAuthReq->pbssDescription = NULL; + } + vos_mem_free(psessionEntry->ftPEContext.pFTPreAuthReq); + psessionEntry->ftPEContext.pFTPreAuthReq = NULL; + } + + if (psessionEntry->ftPEContext.pAddBssReq) { + vos_mem_free(psessionEntry->ftPEContext.pAddBssReq); + psessionEntry->ftPEContext.pAddBssReq = NULL; + } + + if (psessionEntry->ftPEContext.pAddStaReq) { + vos_mem_free(psessionEntry->ftPEContext.pAddStaReq); + psessionEntry->ftPEContext.pAddStaReq = NULL; + } + + /* The session is being deleted, cleanup the contents */ + vos_mem_set(&psessionEntry->ftPEContext, sizeof(tftPEContext), 0); } /*------------------------------------------------------------------ @@ -225,33 +210,31 @@ void limFTInit(tpAniSirGlobal pMac) * We suspend the link and then now proceed to switch channel. * *------------------------------------------------------------------*/ -void FTPreAuthSuspendLinkHandler(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data) +void static +limFTPreAuthSuspendLinkHandler(tpAniSirGlobal pMac, eHalStatus status, + tANI_U32 *data) { - tpPESession psessionEntry; - - // The link is suspended of not ? - if (status != eHAL_STATUS_SUCCESS) - { - PELOGE(limLog( pMac, LOGE, "%s: Returning ", __func__);) - // Post the FT Pre Auth Response to SME - limPostFTPreAuthRsp(pMac, eSIR_FAILURE, NULL, 0, (tpPESession)data); + tpPESession psessionEntry = (tpPESession)data; + /* The link is suspended of not */ + if (NULL == psessionEntry || + NULL == psessionEntry->ftPEContext.pFTPreAuthReq || + status != eHAL_STATUS_SUCCESS) { + PELOGE(limLog( pMac, LOGE, + FL("preAuth error, status = %d"), status);) + limPostFTPreAuthRsp(pMac, eSIR_FAILURE, NULL, 0, psessionEntry); return; } - psessionEntry = (tpPESession)data; - // Suspended, now move to a different channel. - // Perform some sanity check before proceeding. - if ((pMac->ft.ftPEContext.pFTPreAuthReq) && psessionEntry) - { - limChangeChannelWithCallback(pMac, - pMac->ft.ftPEContext.pFTPreAuthReq->preAuthchannelNum, - limPerformFTPreAuth, NULL, psessionEntry); - return; + /* Suspended, now move to a different channel. + * Perform some sanity check before proceeding + */ + if (psessionEntry->ftPEContext.pFTPreAuthReq) { + limChangeChannelWithCallback(pMac, + psessionEntry->ftPEContext.pFTPreAuthReq->preAuthchannelNum, + limPerformFTPreAuth, NULL, psessionEntry); + return; } - - // Else return error. - limPostFTPreAuthRsp(pMac, eSIR_FAILURE, NULL, 0, psessionEntry); } @@ -271,66 +254,84 @@ int limProcessFTPreAuthReq(tpAniSirGlobal pMac, tpSirMsgQ pMsg) int bufConsumed = FALSE; tpPESession psessionEntry; tANI_U8 sessionId; + tpSirFTPreAuthReq ftPreAuthReq = + (tSirFTPreAuthReq *)pMsg->bodyptr; - // Now we are starting fresh make sure all's cleanup. - limFTInit(pMac); - // Can set it only after sending auth - pMac->ft.ftPEContext.ftPreAuthStatus = eSIR_FAILURE; - - if( pMac->ft.ftPEContext.pFTPreAuthReq && - pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription) - { - vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription); - pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription = NULL; + if (NULL == ftPreAuthReq) { +#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG + PELOGE(limLog(pMac, LOGE, FL("tSirFTPreAuthReq is NULL"));) +#endif + return bufConsumed; } - // We need information from the Pre-Auth Req. Lets save that - pMac->ft.ftPEContext.pFTPreAuthReq = (tpSirFTPreAuthReq)pMsg->bodyptr; + /* Get the current session entry */ + psessionEntry = + peFindSessionByBssid(pMac, ftPreAuthReq->currbssId, &sessionId); + if (psessionEntry == NULL) { + PELOGE(limLog( pMac, LOGE, + FL("Unable to find session for the following bssid"));) + limPrintMacAddr( pMac, ftPreAuthReq->currbssId, LOGE ); + + /* Post the FT Pre Auth Response to SME */ + limPostFTPreAuthRsp(pMac, eSIR_FAILURE, NULL, 0, psessionEntry); + bufConsumed = TRUE; + return bufConsumed; + } + /* Nothing to be done if the session is not in STA mode */ + if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOG1, "%s: PE Auth ft_ies_length=%02x%02x%02x", __func__, - pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies[0], - pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies[1], - pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies[2]);) + PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif + bufConsumed = TRUE; + return bufConsumed; + } - // Get the current session entry - psessionEntry = peFindSessionByBssid(pMac, - pMac->ft.ftPEContext.pFTPreAuthReq->currbssId, &sessionId); - if (psessionEntry == NULL) - { - PELOGE(limLog( pMac, LOGE, "%s: Unable to find session for the following bssid", - __func__);) - limPrintMacAddr( pMac, pMac->ft.ftPEContext.pFTPreAuthReq->currbssId, LOGE ); - // Post the FT Pre Auth Response to SME - limPostFTPreAuthRsp(pMac, eSIR_FAILURE, NULL, 0, NULL); - if (pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription) - { - vos_mem_free(pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription); - pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription = NULL; - } - pMac->ft.ftPEContext.pFTPreAuthReq = NULL; - return TRUE; + /* Can set it only after sending auth */ + psessionEntry->ftPEContext.ftPreAuthStatus = eSIR_FAILURE; + psessionEntry->ftPEContext.ftPreAuthSession = VOS_TRUE; + + /* Indicate that this is the session on which preauth is being done */ + if (psessionEntry->ftPEContext.pFTPreAuthReq) { + if (psessionEntry->ftPEContext.pFTPreAuthReq->pbssDescription) + { + vos_mem_free( + psessionEntry->ftPEContext.pFTPreAuthReq->pbssDescription); + psessionEntry->ftPEContext.pFTPreAuthReq->pbssDescription = NULL; + } + vos_mem_free(psessionEntry->ftPEContext.pFTPreAuthReq); + psessionEntry->ftPEContext.pFTPreAuthReq = NULL; } + + /* We need information from the Pre-Auth Req. Lets save that */ + psessionEntry->ftPEContext.pFTPreAuthReq = ftPreAuthReq; + +#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG + PELOGE(limLog( pMac, LOG1, FL("PE Auth ft_ies_length=%02x%02x%02x"), + psessionEntry->ftPEContext.pFTPreAuthReq->ft_ies[0], + psessionEntry->ftPEContext.pFTPreAuthReq->ft_ies[1], + psessionEntry->ftPEContext.pFTPreAuthReq->ft_ies[2]);) +#endif + #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT - limDiagEventReport(pMac, WLAN_PE_DIAG_PRE_AUTH_REQ_EVENT, psessionEntry, 0, 0); + limDiagEventReport(pMac, WLAN_PE_DIAG_PRE_AUTH_REQ_EVENT, + psessionEntry, 0, 0); #endif - // Dont need to suspend if APs are in same channel - if (psessionEntry->currentOperChannel != pMac->ft.ftPEContext.pFTPreAuthReq->preAuthchannelNum) - { - // Need to suspend link only if the channels are different - PELOG2(limLog(pMac,LOG2,"%s: Performing pre-auth on different" - " channel (session %p)", __func__, psessionEntry);) - limSuspendLink(pMac, eSIR_CHECK_ROAMING_SCAN, FTPreAuthSuspendLinkHandler, - (tANI_U32 *)psessionEntry); - } - else - { - PELOG2(limLog(pMac,LOG2,"%s: Performing pre-auth on same" - " channel (session %p)", __func__, psessionEntry);) - // We are in the same channel. Perform pre-auth - limPerformFTPreAuth(pMac, eHAL_STATUS_SUCCESS, NULL, psessionEntry); + /* Dont need to suspend if APs are in same channel */ + if (psessionEntry->currentOperChannel != + psessionEntry->ftPEContext.pFTPreAuthReq->preAuthchannelNum) { + /* Need to suspend link only if the channels are different */ + PELOG2(limLog(pMac, LOG2, FL("Performing pre-auth on different" + " channel (session %p)"), psessionEntry);) + limSuspendLink(pMac, eSIR_CHECK_ROAMING_SCAN, + limFTPreAuthSuspendLinkHandler, + (tANI_U32 *)psessionEntry); + } else { + PELOG2(limLog(pMac, LOG2, FL("Performing pre-auth on same" + " channel (session %p)"), psessionEntry);) + /* We are in the same channel. Perform pre-auth */ + limPerformFTPreAuth(pMac, eHAL_STATUS_SUCCESS, NULL, psessionEntry); } return bufConsumed; @@ -340,80 +341,86 @@ int limProcessFTPreAuthReq(tpAniSirGlobal pMac, tpSirMsgQ pMsg) * Send the Auth1 * Receive back Auth2 *------------------------------------------------------------------*/ -void limPerformFTPreAuth(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data, - tpPESession psessionEntry) +void limPerformFTPreAuth(tpAniSirGlobal pMac, eHalStatus status, + tANI_U32 *data, tpPESession psessionEntry) { tSirMacAuthFrameBody authFrame; - if (psessionEntry->is11Rconnection) - { - // Only 11r assoc has FT IEs. - if (pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies == NULL) - { + if (psessionEntry && psessionEntry->is11Rconnection && + psessionEntry->ftPEContext.pFTPreAuthReq) { + /* Only 11r assoc has FT IEs */ + if (psessionEntry->ftPEContext.pFTPreAuthReq->ft_ies == NULL) { PELOGE(limLog( pMac, LOGE, "%s: FTIEs for Auth Req Seq 1 is absent", __func__);) goto preauth_fail; } } - if (status != eHAL_STATUS_SUCCESS) - { + + if (status != eHAL_STATUS_SUCCESS) { PELOGE(limLog( pMac, LOGE, "%s: Change channel not successful for FT pre-auth", __func__);) goto preauth_fail; } - pMac->ft.ftPEContext.psavedsessionEntry = psessionEntry; + /* Nothing to be done if the session is not in STA mode */ + if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOG2(limLog(pMac,LOG2,"Entered wait auth2 state for FT" - " (old session %p)", - pMac->ft.ftPEContext.psavedsessionEntry);) + PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif + return; + } +#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG + PELOG2(limLog(pMac,LOG2,"Entered wait auth2 state for FT" + " (old session %p)", psessionEntry);) +#endif - if (psessionEntry->is11Rconnection) - { - // Now we are on the right channel and need to send out Auth1 and - // receive Auth2. - authFrame.authAlgoNumber = eSIR_FT_AUTH; // Set the auth type to FT + if (psessionEntry->is11Rconnection) { + /* Now we are on the right channel and need to send out Auth1 and + * receive Auth2 + */ + authFrame.authAlgoNumber = eSIR_FT_AUTH; } #if defined FEATURE_WLAN_ESE || defined FEATURE_WLAN_LFR - else - { - // Will need to make isESEconnection a enum may be for further - // improvements to this to match this algorithm number - authFrame.authAlgoNumber = eSIR_OPEN_SYSTEM; // For now if its ESE and 11r FT. + else { + /* Will need to make isESEconnection a enum may be for further + * improvements to this to match this algorithm number + */ + authFrame.authAlgoNumber = eSIR_OPEN_SYSTEM; } #endif authFrame.authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_1; authFrame.authStatusCode = 0; - // Start timer here to come back to operating channel. - pMac->lim.limTimers.gLimFTPreAuthRspTimer.sessionId = psessionEntry->peSessionId; - if(TX_SUCCESS != tx_timer_activate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer)) - { + /* Start timer here to come back to operating channel */ + pMac->lim.limTimers.gLimFTPreAuthRspTimer.sessionId = + psessionEntry->peSessionId; + if(TX_SUCCESS != + tx_timer_activate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer)) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOGE, "%s: FT Auth Rsp Timer Start Failed", __func__);) + PELOGE(limLog( pMac, LOGE, FL("FT Auth Rsp Timer Start Failed"));) #endif } -MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, eLIM_FT_PREAUTH_RSP_TIMER)); + MTRACE(macTrace(pMac, TRACE_CODE_TIMER_ACTIVATE, psessionEntry->peSessionId, + eLIM_FT_PREAUTH_RSP_TIMER)); #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOG1, "%s: FT Auth Rsp Timer Started", __func__);) + PELOG1(limLog( pMac, LOG1, FL("FT Auth Rsp Timer Started"));) #endif limSendAuthMgmtFrame(pMac, &authFrame, - pMac->ft.ftPEContext.pFTPreAuthReq->preAuthbssId, + psessionEntry->ftPEContext.pFTPreAuthReq->preAuthbssId, LIM_NO_WEP_IN_FC, psessionEntry); return; + preauth_fail: limHandleFTPreAuthRsp(pMac, eSIR_FAILURE, NULL, 0, psessionEntry); return; } - /*------------------------------------------------------------------ * * Create the new Add Bss Req to the new AP. @@ -430,17 +437,24 @@ tSirRetStatus limFTPrepareAddBssReq( tpAniSirGlobal pMac, tANI_U8 chanWidthSupp = 0; tSchBeaconStruct *pBeaconStruct; + /* Nothing to be done if the session is not in STA mode */ + if (eLIM_STA_ROLE != pftSessionEntry->limSystemRole) { +#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG + PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) +#endif + return eSIR_FAILURE; + } + pBeaconStruct = vos_mem_malloc(sizeof(tSchBeaconStruct)); - if (NULL == pBeaconStruct) - { - limLog(pMac, LOGE, FL("Unable to allocate memory for creating ADD_BSS") ); - return eSIR_MEM_ALLOC_FAILED; + if (NULL == pBeaconStruct) { + limLog(pMac, LOGE, + FL("Unable to allocate memory for creating ADD_BSS") ); + return eSIR_MEM_ALLOC_FAILED; } // Package SIR_HAL_ADD_BSS_REQ message parameters pAddBssParams = vos_mem_malloc(sizeof( tAddBssParams )); - if (NULL == pAddBssParams) - { + if (NULL == pAddBssParams) { vos_mem_free(pBeaconStruct); limLog( pMac, LOGP, FL( "Unable to allocate memory for creating ADD_BSS" )); @@ -449,12 +463,12 @@ tSirRetStatus limFTPrepareAddBssReq( tpAniSirGlobal pMac, vos_mem_set((tANI_U8 *) pAddBssParams, sizeof( tAddBssParams ), 0); - limExtractApCapabilities( pMac, (tANI_U8 *) bssDescription->ieFields, limGetIElenFromBssDescription( bssDescription ), pBeaconStruct ); - if (pMac->lim.gLimProtectionControl != WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE) + if (pMac->lim.gLimProtectionControl != + WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE) limDecideStaProtectionOnAssoc(pMac, pBeaconStruct, pftSessionEntry); vos_mem_copy(pAddBssParams->bssId, bssDescription->bssId, @@ -464,7 +478,7 @@ tSirRetStatus limFTPrepareAddBssReq( tpAniSirGlobal pMac, vos_mem_copy(pAddBssParams->selfMacAddr, pftSessionEntry->selfMacAddr, sizeof(tSirMacAddr)); - pAddBssParams->bssType = pftSessionEntry->bssType;//eSIR_INFRASTRUCTURE_MODE; + pAddBssParams->bssType = pftSessionEntry->bssType; pAddBssParams->operMode = BSS_OPERATIONAL_MODE_STA; pAddBssParams->beaconInterval = bssDescription->beaconInterval; @@ -476,27 +490,36 @@ tSirRetStatus limFTPrepareAddBssReq( tpAniSirGlobal pMac, pAddBssParams->cfParamSet.cfpCount = pBeaconStruct->cfParamSet.cfpCount; pAddBssParams->cfParamSet.cfpPeriod = pBeaconStruct->cfParamSet.cfpPeriod; - pAddBssParams->cfParamSet.cfpMaxDuration = pBeaconStruct->cfParamSet.cfpMaxDuration; - pAddBssParams->cfParamSet.cfpDurRemaining = pBeaconStruct->cfParamSet.cfpDurRemaining; + pAddBssParams->cfParamSet.cfpMaxDuration = + pBeaconStruct->cfParamSet.cfpMaxDuration; + pAddBssParams->cfParamSet.cfpDurRemaining = + pBeaconStruct->cfParamSet.cfpDurRemaining; pAddBssParams->rateSet.numRates = pBeaconStruct->supportedRates.numRates; vos_mem_copy(pAddBssParams->rateSet.rate, - pBeaconStruct->supportedRates.rate, pBeaconStruct->supportedRates.numRates); + pBeaconStruct->supportedRates.rate, + pBeaconStruct->supportedRates.numRates); pAddBssParams->nwType = bssDescription->nwType; - pAddBssParams->shortSlotTimeSupported = (tANI_U8)pBeaconStruct->capabilityInfo.shortSlotTime; - pAddBssParams->llaCoexist = (tANI_U8) pftSessionEntry->beaconParams.llaCoexist; - pAddBssParams->llbCoexist = (tANI_U8) pftSessionEntry->beaconParams.llbCoexist; - pAddBssParams->llgCoexist = (tANI_U8) pftSessionEntry->beaconParams.llgCoexist; - pAddBssParams->ht20Coexist = (tANI_U8) pftSessionEntry->beaconParams.ht20Coexist; + pAddBssParams->shortSlotTimeSupported = + (tANI_U8)pBeaconStruct->capabilityInfo.shortSlotTime; + pAddBssParams->llaCoexist = + (tANI_U8) pftSessionEntry->beaconParams.llaCoexist; + pAddBssParams->llbCoexist = + (tANI_U8) pftSessionEntry->beaconParams.llbCoexist; + pAddBssParams->llgCoexist = + (tANI_U8) pftSessionEntry->beaconParams.llgCoexist; + pAddBssParams->ht20Coexist = + (tANI_U8) pftSessionEntry->beaconParams.ht20Coexist; #ifdef WLAN_FEATURE_11W pAddBssParams->rmfEnabled = pftSessionEntry->limRmfEnabled; #endif // Use the advertised capabilities from the received beacon/PR - if (IS_DOT11_MODE_HT(pftSessionEntry->dot11mode) && ( pBeaconStruct->HTCaps.present )) + if (IS_DOT11_MODE_HT(pftSessionEntry->dot11mode) && + ( pBeaconStruct->HTCaps.present )) { pAddBssParams->htCapable = pBeaconStruct->HTCaps.present; vos_mem_copy(&pAddBssParams->staContext.capab_info, @@ -508,42 +531,56 @@ tSirRetStatus limFTPrepareAddBssReq( tpAniSirGlobal pMac, if ( pBeaconStruct->HTInfo.present ) { - pAddBssParams->htOperMode = (tSirMacHTOperatingMode)pBeaconStruct->HTInfo.opMode; - pAddBssParams->dualCTSProtection = ( tANI_U8 ) pBeaconStruct->HTInfo.dualCTSProtection; - - chanWidthSupp = limGetHTCapability( pMac, eHT_SUPPORTED_CHANNEL_WIDTH_SET, pftSessionEntry); + pAddBssParams->htOperMode = + (tSirMacHTOperatingMode)pBeaconStruct->HTInfo.opMode; + pAddBssParams->dualCTSProtection = + ( tANI_U8 ) pBeaconStruct->HTInfo.dualCTSProtection; + + chanWidthSupp = limGetHTCapability( pMac, + eHT_SUPPORTED_CHANNEL_WIDTH_SET, + pftSessionEntry); if( (pBeaconStruct->HTCaps.supportedChannelWidthSet) && (chanWidthSupp) ) { - pAddBssParams->txChannelWidthSet = ( tANI_U8 ) pBeaconStruct->HTInfo.recommendedTxWidthSet; - pAddBssParams->currentExtChannel = pBeaconStruct->HTInfo.secondaryChannelOffset; + pAddBssParams->txChannelWidthSet = + ( tANI_U8 ) pBeaconStruct->HTInfo.recommendedTxWidthSet; + pAddBssParams->currentExtChannel = + pBeaconStruct->HTInfo.secondaryChannelOffset; } else { - pAddBssParams->txChannelWidthSet = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; + pAddBssParams->txChannelWidthSet = + WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; pAddBssParams->currentExtChannel = PHY_SINGLE_CHANNEL_CENTERED; } - pAddBssParams->llnNonGFCoexist = (tANI_U8)pBeaconStruct->HTInfo.nonGFDevicesPresent; - pAddBssParams->fLsigTXOPProtectionFullSupport = (tANI_U8)pBeaconStruct->HTInfo.lsigTXOPProtectionFullSupport; + pAddBssParams->llnNonGFCoexist = + (tANI_U8)pBeaconStruct->HTInfo.nonGFDevicesPresent; + pAddBssParams->fLsigTXOPProtectionFullSupport = + (tANI_U8)pBeaconStruct->HTInfo.lsigTXOPProtectionFullSupport; pAddBssParams->fRIFSMode = pBeaconStruct->HTInfo.rifsMode; } } pAddBssParams->currentOperChannel = bssDescription->channelId; - pftSessionEntry->htSecondaryChannelOffset = pAddBssParams->currentExtChannel; + pftSessionEntry->htSecondaryChannelOffset = + pAddBssParams->currentExtChannel; #ifdef WLAN_FEATURE_11AC - if (pftSessionEntry->vhtCapability && pftSessionEntry->vhtCapabilityPresentInBeacon) + if (pftSessionEntry->vhtCapability && + pftSessionEntry->vhtCapabilityPresentInBeacon) { pAddBssParams->vhtCapable = pBeaconStruct->VHTCaps.present; - pAddBssParams->vhtTxChannelWidthSet = pBeaconStruct->VHTOperation.chanWidth; - pAddBssParams->currentExtChannel = limGet11ACPhyCBState ( pMac, - pAddBssParams->currentOperChannel, - pAddBssParams->currentExtChannel, - pftSessionEntry->apCenterChan, - pftSessionEntry); + pAddBssParams->vhtTxChannelWidthSet = + pBeaconStruct->VHTOperation.chanWidth; + pAddBssParams->currentExtChannel = + limGet11ACPhyCBState(pMac, + pAddBssParams->currentOperChannel, + pAddBssParams->currentExtChannel, + pftSessionEntry->apCenterChan, + pftSessionEntry); pAddBssParams->staContext.vht_caps = - ((pBeaconStruct->VHTCaps.maxMPDULen << SIR_MAC_VHT_CAP_MAX_MPDU_LEN) | + ((pBeaconStruct->VHTCaps.maxMPDULen << + SIR_MAC_VHT_CAP_MAX_MPDU_LEN) | (pBeaconStruct->VHTCaps.supportedChannelWidthSet << SIR_MAC_VHT_CAP_SUPP_CH_WIDTH_SET) | (pBeaconStruct->VHTCaps.ldpcCodingCap << @@ -588,43 +625,49 @@ tSirRetStatus limFTPrepareAddBssReq( tpAniSirGlobal pMac, limLog( pMac, LOG1, FL( "SIR_HAL_ADD_BSS_REQ with channel = %d..." ), pAddBssParams->currentOperChannel); #endif + // Populate the STA-related parameters here // Note that the STA here refers to the AP { - pAddBssParams->staContext.staType = STA_ENTRY_OTHER; // Identifying AP as an STA + pAddBssParams->staContext.staType = STA_ENTRY_OTHER; vos_mem_copy(pAddBssParams->staContext.bssId, bssDescription->bssId, sizeof(tSirMacAddr)); - pAddBssParams->staContext.listenInterval = bssDescription->beaconInterval; + pAddBssParams->staContext.listenInterval = + bssDescription->beaconInterval; - pAddBssParams->staContext.assocId = 0; // Is SMAC OK with this? + pAddBssParams->staContext.assocId = 0; pAddBssParams->staContext.uAPSD = 0; pAddBssParams->staContext.maxSPLen = 0; - pAddBssParams->staContext.shortPreambleSupported = (tANI_U8)pBeaconStruct->capabilityInfo.shortPreamble; + pAddBssParams->staContext.shortPreambleSupported = + (tANI_U8)pBeaconStruct->capabilityInfo.shortPreamble; pAddBssParams->staContext.updateSta = updateEntry; pAddBssParams->staContext.encryptType = pftSessionEntry->encryptType; #ifdef WLAN_FEATURE_11W pAddBssParams->staContext.rmfEnabled = pftSessionEntry->limRmfEnabled; #endif - if (IS_DOT11_MODE_HT(pftSessionEntry->dot11mode) && ( pBeaconStruct->HTCaps.present )) - { + if (IS_DOT11_MODE_HT(pftSessionEntry->dot11mode) && + ( pBeaconStruct->HTCaps.present )) { pAddBssParams->staContext.us32MaxAmpduDuration = 0; pAddBssParams->staContext.htCapable = 1; - pAddBssParams->staContext.greenFieldCapable = ( tANI_U8 ) pBeaconStruct->HTCaps.greenField; - pAddBssParams->staContext.lsigTxopProtection = ( tANI_U8 ) pBeaconStruct->HTCaps.lsigTXOPProtection; + pAddBssParams->staContext.greenFieldCapable = + ( tANI_U8 ) pBeaconStruct->HTCaps.greenField; + pAddBssParams->staContext.lsigTxopProtection = + ( tANI_U8 ) pBeaconStruct->HTCaps.lsigTXOPProtection; if ((pBeaconStruct->HTCaps.supportedChannelWidthSet) && - (chanWidthSupp)) - { - pAddBssParams->staContext.txChannelWidthSet = ( tANI_U8 )pBeaconStruct->HTInfo.recommendedTxWidthSet; + (chanWidthSupp)) { + pAddBssParams->staContext.txChannelWidthSet = + ( tANI_U8 )pBeaconStruct->HTInfo.recommendedTxWidthSet; } - else - { - pAddBssParams->staContext.txChannelWidthSet = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; + else { + pAddBssParams->staContext.txChannelWidthSet = + WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; } #ifdef WLAN_FEATURE_11AC - if (pftSessionEntry->vhtCapability && pBeaconStruct->VHTCaps.present) + if (pftSessionEntry->vhtCapability && + pBeaconStruct->VHTCaps.present) { pAddBssParams->staContext.vhtCapable = 1; if ((pBeaconStruct->VHTCaps.suBeamFormerCap || @@ -650,19 +693,29 @@ tSirRetStatus limFTPrepareAddBssReq( tpAniSirGlobal pMac, } else { - pAddBssParams->staContext.txChannelWidthSet = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; + pAddBssParams->staContext.txChannelWidthSet = + WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; } - pAddBssParams->staContext.mimoPS = (tSirMacHTMIMOPowerSaveState)pBeaconStruct->HTCaps.mimoPowerSave; - pAddBssParams->staContext.delBASupport = ( tANI_U8 ) pBeaconStruct->HTCaps.delayedBA; - pAddBssParams->staContext.maxAmsduSize = ( tANI_U8 ) pBeaconStruct->HTCaps.maximalAMSDUsize; - pAddBssParams->staContext.maxAmpduDensity = pBeaconStruct->HTCaps.mpduDensity; - pAddBssParams->staContext.fDsssCckMode40Mhz = (tANI_U8)pBeaconStruct->HTCaps.dsssCckMode40MHz; - pAddBssParams->staContext.fShortGI20Mhz = (tANI_U8)pBeaconStruct->HTCaps.shortGI20MHz; - pAddBssParams->staContext.fShortGI40Mhz = (tANI_U8)pBeaconStruct->HTCaps.shortGI40MHz; - pAddBssParams->staContext.maxAmpduSize= pBeaconStruct->HTCaps.maxRxAMPDUFactor; + pAddBssParams->staContext.mimoPS = + (tSirMacHTMIMOPowerSaveState)pBeaconStruct->HTCaps.mimoPowerSave; + pAddBssParams->staContext.delBASupport = + ( tANI_U8 ) pBeaconStruct->HTCaps.delayedBA; + pAddBssParams->staContext.maxAmsduSize = + ( tANI_U8 ) pBeaconStruct->HTCaps.maximalAMSDUsize; + pAddBssParams->staContext.maxAmpduDensity = + pBeaconStruct->HTCaps.mpduDensity; + pAddBssParams->staContext.fDsssCckMode40Mhz = + (tANI_U8)pBeaconStruct->HTCaps.dsssCckMode40MHz; + pAddBssParams->staContext.fShortGI20Mhz = + (tANI_U8)pBeaconStruct->HTCaps.shortGI20MHz; + pAddBssParams->staContext.fShortGI40Mhz = + (tANI_U8)pBeaconStruct->HTCaps.shortGI40MHz; + pAddBssParams->staContext.maxAmpduSize = + pBeaconStruct->HTCaps.maxRxAMPDUFactor; if( pBeaconStruct->HTInfo.present ) - pAddBssParams->staContext.rifsMode = pBeaconStruct->HTInfo.rifsMode; + pAddBssParams->staContext.rifsMode = + pBeaconStruct->HTInfo.rifsMode; } if ((pftSessionEntry->limWmeEnabled && pBeaconStruct->wmeEdcaPresent) || @@ -678,7 +731,8 @@ tSirRetStatus limFTPrepareAddBssReq( tpAniSirGlobal pMac, * wpa_rsn */ pAddBssParams->staContext.wpa_rsn |= (pBeaconStruct->wpaPresent << 1); - if ((!pAddBssParams->staContext.wpa_rsn) && (pftSessionEntry->isOSENConnection)) + if ((!pAddBssParams->staContext.wpa_rsn) && + (pftSessionEntry->isOSENConnection)) pAddBssParams->staContext.wpa_rsn = 1; //Update the rates #ifdef WLAN_FEATURE_11AC @@ -687,7 +741,7 @@ tSirRetStatus limFTPrepareAddBssReq( tpAniSirGlobal pMac, false,pftSessionEntry,&pBeaconStruct->VHTCaps); #else limPopulatePeerRateSet(pMac, &pAddBssParams->staContext.supportedRates, - beaconStruct.HTCaps.supportedMCSSet, false,pftSessionEntry); + beaconStruct.HTCaps.supportedMCSSet, false,pftSessionEntry); #endif if (pftSessionEntry->htCapability) { @@ -713,8 +767,10 @@ tSirRetStatus limFTPrepareAddBssReq( tpAniSirGlobal pMac, { pAddBssParams->staContext.staTCParams[i].txUseBA = eBA_DISABLE; pAddBssParams->staContext.staTCParams[i].rxUseBA = eBA_DISABLE; - pAddBssParams->staContext.staTCParams[i].txBApolicy = eBA_POLICY_IMMEDIATE; - pAddBssParams->staContext.staTCParams[i].rxBApolicy = eBA_POLICY_IMMEDIATE; + pAddBssParams->staContext.staTCParams[i].txBApolicy = + eBA_POLICY_IMMEDIATE; + pAddBssParams->staContext.staTCParams[i].rxBApolicy = + eBA_POLICY_IMMEDIATE; } #if defined WLAN_FEATURE_VOWIFI @@ -733,15 +789,17 @@ tSirRetStatus limFTPrepareAddBssReq( tpAniSirGlobal pMac, pAddBssParams->respReqd = true; pAddBssParams->staContext.sessionId = pftSessionEntry->peSessionId; + pAddBssParams->staContext.smesessionId = pftSessionEntry->smeSessionId; pAddBssParams->sessionId = pftSessionEntry->peSessionId; // Set a new state for MLME pftSessionEntry->limMlmState = eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE; - MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, pftSessionEntry->peSessionId, eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE)); - pAddBssParams->halPersona=(tANI_U8)pftSessionEntry->pePersona; //pass on the session persona to hal + MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, pftSessionEntry->peSessionId, + eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE)); + pAddBssParams->halPersona=(tANI_U8)pftSessionEntry->pePersona; - pMac->ft.ftPEContext.pAddBssReq = pAddBssParams; + pftSessionEntry->ftPEContext.pAddBssReq = pAddBssParams; #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG limLog( pMac, LOG1, FL( "Saving SIR_HAL_ADD_BSS_REQ for pre-auth ap..." )); @@ -751,174 +809,199 @@ tSirRetStatus limFTPrepareAddBssReq( tpAniSirGlobal pMac, return 0; } + /*------------------------------------------------------------------ * * Setup the new session for the pre-auth AP. * Return the newly created session entry. * *------------------------------------------------------------------*/ -tpPESession limFillFTSession(tpAniSirGlobal pMac, - tpSirBssDescription pbssDescription, tpPESession psessionEntry) +void limFillFTSession(tpAniSirGlobal pMac, + tpSirBssDescription pbssDescription, + tpPESession pftSessionEntry, + tpPESession psessionEntry) { - tpPESession pftSessionEntry; - tANI_U8 currentBssUapsd; - tPowerdBm localPowerConstraint; - tPowerdBm regMax; - tSchBeaconStruct *pBeaconStruct; - tANI_U32 selfDot11Mode; - ePhyChanBondState cbEnabledMode; - - pBeaconStruct = vos_mem_malloc(sizeof(tSchBeaconStruct)); - if (NULL == pBeaconStruct) - { - limLog(pMac, LOGE, FL("Unable to allocate memory for creating limFillFTSession") ); - return NULL; - } + tANI_U8 currentBssUapsd; + tPowerdBm localPowerConstraint; + tPowerdBm regMax; + tSchBeaconStruct *pBeaconStruct; + tANI_U32 selfDot11Mode; + ePhyChanBondState cbEnabledMode; + + pBeaconStruct = vos_mem_malloc(sizeof(tSchBeaconStruct)); + if (NULL == pBeaconStruct) { +#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG + limLog(pMac, LOGE, + FL("Unable to allocate memory for creating limFillFTSession") ); +#endif + return; + } - /* Retrieve the session that has already been created and update the entry */ - pftSessionEntry = pMac->ft.ftPEContext.pftSessionEntry; + /* Retrieve the session that has already been created and update the entry */ #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) - limPrintMacAddr(pMac, pbssDescription->bssId, LOG1); + limPrintMacAddr(pMac, pbssDescription->bssId, LOG1); #endif - pftSessionEntry->limWmeEnabled = psessionEntry->limWmeEnabled; - pftSessionEntry->limQosEnabled = psessionEntry->limQosEnabled; - pftSessionEntry->limWsmEnabled = psessionEntry->limWsmEnabled; - pftSessionEntry->lim11hEnable = psessionEntry->lim11hEnable; - pftSessionEntry->isOSENConnection = psessionEntry->isOSENConnection; - - // Fields to be filled later - pftSessionEntry->pLimJoinReq = NULL; - pftSessionEntry->smeSessionId = 0; - pftSessionEntry->transactionId = 0; - - limExtractApCapabilities( pMac, - (tANI_U8 *) pbssDescription->ieFields, - limGetIElenFromBssDescription( pbssDescription ), - pBeaconStruct ); - - pftSessionEntry->rateSet.numRates = pBeaconStruct->supportedRates.numRates; - vos_mem_copy(pftSessionEntry->rateSet.rate, - pBeaconStruct->supportedRates.rate, pBeaconStruct->supportedRates.numRates); - - pftSessionEntry->extRateSet.numRates = pBeaconStruct->extendedRates.numRates; - vos_mem_copy(pftSessionEntry->extRateSet.rate, - pBeaconStruct->extendedRates.rate, pftSessionEntry->extRateSet.numRates); - - - pftSessionEntry->ssId.length = pBeaconStruct->ssId.length; - vos_mem_copy(pftSessionEntry->ssId.ssId, pBeaconStruct->ssId.ssId, - pftSessionEntry->ssId.length); - - wlan_cfgGetInt(pMac, WNI_CFG_DOT11_MODE, &selfDot11Mode); - pftSessionEntry->dot11mode = selfDot11Mode; - pftSessionEntry->vhtCapability = (IS_DOT11_MODE_VHT(pftSessionEntry->dot11mode) - && pBeaconStruct->VHTCaps.present); - pftSessionEntry->htCapability = (IS_DOT11_MODE_HT(pftSessionEntry->dot11mode) - && pBeaconStruct->HTCaps.present); + pftSessionEntry->limWmeEnabled = psessionEntry->limWmeEnabled; + pftSessionEntry->limQosEnabled = psessionEntry->limQosEnabled; + pftSessionEntry->limWsmEnabled = psessionEntry->limWsmEnabled; + pftSessionEntry->lim11hEnable = psessionEntry->lim11hEnable; + pftSessionEntry->isOSENConnection = psessionEntry->isOSENConnection; + + // Fields to be filled later + pftSessionEntry->pLimJoinReq = NULL; + pftSessionEntry->smeSessionId = psessionEntry->smeSessionId; + pftSessionEntry->transactionId = 0; + + limExtractApCapabilities( pMac, + (tANI_U8 *) pbssDescription->ieFields, + limGetIElenFromBssDescription( pbssDescription ), + pBeaconStruct ); + + pftSessionEntry->rateSet.numRates = pBeaconStruct->supportedRates.numRates; + vos_mem_copy(pftSessionEntry->rateSet.rate, + pBeaconStruct->supportedRates.rate, pBeaconStruct->supportedRates.numRates); + + pftSessionEntry->extRateSet.numRates = pBeaconStruct->extendedRates.numRates; + vos_mem_copy(pftSessionEntry->extRateSet.rate, + pBeaconStruct->extendedRates.rate, pftSessionEntry->extRateSet.numRates); + + pftSessionEntry->ssId.length = pBeaconStruct->ssId.length; + vos_mem_copy(pftSessionEntry->ssId.ssId, pBeaconStruct->ssId.ssId, + pftSessionEntry->ssId.length); + + wlan_cfgGetInt(pMac, WNI_CFG_DOT11_MODE, &selfDot11Mode); + pftSessionEntry->dot11mode = selfDot11Mode; + pftSessionEntry->vhtCapability = + (IS_DOT11_MODE_VHT(pftSessionEntry->dot11mode) + && pBeaconStruct->VHTCaps.present); + pftSessionEntry->htCapability = (IS_DOT11_MODE_HT(pftSessionEntry->dot11mode) + && pBeaconStruct->HTCaps.present); #ifdef WLAN_FEATURE_11AC - if (pBeaconStruct->VHTCaps.present && pBeaconStruct->VHTOperation.present) - { - pftSessionEntry->vhtCapabilityPresentInBeacon = 1; - pftSessionEntry->apCenterChan = pBeaconStruct->VHTOperation.chanCenterFreqSeg1; - pftSessionEntry->apChanWidth = pBeaconStruct->VHTOperation.chanWidth; - } - else - { - pftSessionEntry->vhtCapabilityPresentInBeacon = 0; - } + if (pBeaconStruct->VHTCaps.present && pBeaconStruct->VHTOperation.present) + { + pftSessionEntry->vhtCapabilityPresentInBeacon = 1; + pftSessionEntry->apCenterChan = + pBeaconStruct->VHTOperation.chanCenterFreqSeg1; + pftSessionEntry->apChanWidth = pBeaconStruct->VHTOperation.chanWidth; + } + else + { + pftSessionEntry->vhtCapabilityPresentInBeacon = 0; + } #endif - // Self Mac - sirCopyMacAddr(pftSessionEntry->selfMacAddr, psessionEntry->selfMacAddr); - sirCopyMacAddr(pftSessionEntry->limReAssocbssId, pbssDescription->bssId); + sirCopyMacAddr(pftSessionEntry->selfMacAddr, psessionEntry->selfMacAddr); + sirCopyMacAddr(pftSessionEntry->limReAssocbssId, pbssDescription->bssId); #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) - limPrintMacAddr(pMac, pftSessionEntry->limReAssocbssId, LOG1); + limPrintMacAddr(pMac, pftSessionEntry->limReAssocbssId, LOG1); #endif - /* Store beaconInterval */ - pftSessionEntry->beaconParams.beaconInterval = pbssDescription->beaconInterval; - pftSessionEntry->bssType = psessionEntry->bssType; + /* Store beaconInterval */ + pftSessionEntry->beaconParams.beaconInterval = + pbssDescription->beaconInterval; + pftSessionEntry->bssType = psessionEntry->bssType; + + pftSessionEntry->statypeForBss = STA_ENTRY_PEER; + pftSessionEntry->nwType = pbssDescription->nwType; + + /* Copy The channel Id to the session Table */ + pftSessionEntry->limReassocChannelId = pbssDescription->channelId; + pftSessionEntry->currentOperChannel = pbssDescription->channelId; + + if (pftSessionEntry->bssType == eSIR_INFRASTRUCTURE_MODE) + { + pftSessionEntry->limSystemRole = eLIM_STA_ROLE; + } + else if(pftSessionEntry->bssType == eSIR_BTAMP_AP_MODE) + { + pftSessionEntry->limSystemRole = eLIM_BT_AMP_STA_ROLE; + } + else + { + /* Throw an error and return and make sure to delete the session.*/ + limLog(pMac, LOGE, FL("Invalid bss type")); + } + + pftSessionEntry->limCurrentBssCaps = pbssDescription->capabilityInfo; + pftSessionEntry->limReassocBssCaps = pbssDescription->capabilityInfo; + if( pMac->roam.configParam.shortSlotTime && + SIR_MAC_GET_SHORT_SLOT_TIME(pftSessionEntry->limReassocBssCaps)) + { + pftSessionEntry->shortSlotTimeSupported = TRUE; + } + + regMax = cfgGetRegulatoryMaxTransmitPower(pMac, + pftSessionEntry->currentOperChannel ); + localPowerConstraint = regMax; + limExtractApCapability( pMac, (tANI_U8 *) pbssDescription->ieFields, + limGetIElenFromBssDescription(pbssDescription), + &pftSessionEntry->limCurrentBssQosCaps, + &pftSessionEntry->limCurrentBssPropCap, + ¤tBssUapsd , &localPowerConstraint, psessionEntry); + + pftSessionEntry->limReassocBssQosCaps = + pftSessionEntry->limCurrentBssQosCaps; + pftSessionEntry->limReassocBssPropCap = + pftSessionEntry->limCurrentBssPropCap; - pftSessionEntry->statypeForBss = STA_ENTRY_PEER; - pftSessionEntry->nwType = pbssDescription->nwType; - - /* Copy The channel Id to the session Table */ - pftSessionEntry->limReassocChannelId = pbssDescription->channelId; - pftSessionEntry->currentOperChannel = pbssDescription->channelId; - - if (pftSessionEntry->bssType == eSIR_INFRASTRUCTURE_MODE) - { - pftSessionEntry->limSystemRole = eLIM_STA_ROLE; - } - else if(pftSessionEntry->bssType == eSIR_BTAMP_AP_MODE) - { - pftSessionEntry->limSystemRole = eLIM_BT_AMP_STA_ROLE; - } - else - { - /* Throw an error and return and make sure to delete the session.*/ - limLog(pMac, LOGE, FL("Invalid bss type")); - } - - pftSessionEntry->limCurrentBssCaps = pbssDescription->capabilityInfo; - pftSessionEntry->limReassocBssCaps = pbssDescription->capabilityInfo; - if( pMac->roam.configParam.shortSlotTime && - SIR_MAC_GET_SHORT_SLOT_TIME(pftSessionEntry->limReassocBssCaps)) - { - pftSessionEntry->shortSlotTimeSupported = TRUE; - } - - regMax = cfgGetRegulatoryMaxTransmitPower( pMac, pftSessionEntry->currentOperChannel ); - localPowerConstraint = regMax; - limExtractApCapability( pMac, (tANI_U8 *) pbssDescription->ieFields, - limGetIElenFromBssDescription(pbssDescription), - &pftSessionEntry->limCurrentBssQosCaps, - &pftSessionEntry->limCurrentBssPropCap, - ¤tBssUapsd , &localPowerConstraint, psessionEntry); - - pftSessionEntry->limReassocBssQosCaps = - pftSessionEntry->limCurrentBssQosCaps; - pftSessionEntry->limReassocBssPropCap = - pftSessionEntry->limCurrentBssPropCap; +#ifdef WLAN_FEATURE_VOWIFI_11R + pftSessionEntry->is11Rconnection = psessionEntry->is11Rconnection; +#endif +#ifdef FEATURE_WLAN_ESE + pftSessionEntry->isESEconnection = psessionEntry->isESEconnection; +#endif +#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) + pftSessionEntry->isFastTransitionEnabled = + psessionEntry->isFastTransitionEnabled; +#endif +#ifdef FEATURE_WLAN_LFR + pftSessionEntry->isFastRoamIniFeatureEnabled = + psessionEntry->isFastRoamIniFeatureEnabled; +#endif #ifdef FEATURE_WLAN_ESE - pftSessionEntry->maxTxPower = limGetMaxTxPower(regMax, localPowerConstraint, pMac->roam.configParam.nTxPowerCap); + pftSessionEntry->maxTxPower = + limGetMaxTxPower(regMax, localPowerConstraint, + pMac->roam.configParam.nTxPowerCap); #else - pftSessionEntry->maxTxPower = VOS_MIN( regMax , (localPowerConstraint) ); + pftSessionEntry->maxTxPower = VOS_MIN( regMax , (localPowerConstraint) ); #endif #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - limLog( pMac, LOG1, "%s: Regulatory max = %d, local power constraint = %d, ini tx power = %d, max tx = %d", - __func__, regMax, localPowerConstraint, pMac->roam.configParam.nTxPowerCap, pftSessionEntry->maxTxPower ); + limLog(pMac, LOG1, + FL("Reg max = %d, local power = %d, ini tx power = %d, max tx = %d"), + regMax, localPowerConstraint, pMac->roam.configParam.nTxPowerCap, + pftSessionEntry->maxTxPower); #endif - pftSessionEntry->limRFBand = limGetRFBand(pftSessionEntry->currentOperChannel); + pftSessionEntry->limRFBand = + limGetRFBand(pftSessionEntry->currentOperChannel); - pftSessionEntry->limPrevSmeState = pftSessionEntry->limSmeState; - pftSessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE; - MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, pftSessionEntry->peSessionId, pftSessionEntry->limSmeState)); + pftSessionEntry->limPrevSmeState = pftSessionEntry->limSmeState; + pftSessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE; + MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, pftSessionEntry->peSessionId, + pftSessionEntry->limSmeState)); - pftSessionEntry->encryptType = psessionEntry->encryptType; + pftSessionEntry->encryptType = psessionEntry->encryptType; #ifdef WLAN_FEATURE_11W - pftSessionEntry->limRmfEnabled = psessionEntry->limRmfEnabled; + pftSessionEntry->limRmfEnabled = psessionEntry->limRmfEnabled; #endif - if (pftSessionEntry->limRFBand == SIR_BAND_2_4_GHZ) - { - cbEnabledMode = pMac->roam.configParam.channelBondingMode24GHz; - } - else - { - cbEnabledMode = pMac->roam.configParam.channelBondingMode5GHz; - } - pftSessionEntry->htSupportedChannelWidthSet = - (pBeaconStruct->HTInfo.present)? - (cbEnabledMode && pBeaconStruct->HTInfo.recommendedTxWidthSet):0; - pftSessionEntry->htRecommendedTxWidthSet = - pftSessionEntry->htSupportedChannelWidthSet; - - vos_mem_free(pBeaconStruct); - return pftSessionEntry; + if (pftSessionEntry->limRFBand == SIR_BAND_2_4_GHZ) + { + cbEnabledMode = pMac->roam.configParam.channelBondingMode24GHz; + } + else + { + cbEnabledMode = pMac->roam.configParam.channelBondingMode5GHz; + } + pftSessionEntry->htSupportedChannelWidthSet = + (pBeaconStruct->HTInfo.present)? + (cbEnabledMode && pBeaconStruct->HTInfo.recommendedTxWidthSet):0; + pftSessionEntry->htRecommendedTxWidthSet = + pftSessionEntry->htSupportedChannelWidthSet; + + vos_mem_free(pBeaconStruct); } /*------------------------------------------------------------------ @@ -926,168 +1009,89 @@ tpPESession limFillFTSession(tpAniSirGlobal pMac, * Setup the session and the add bss req for the pre-auth AP. * *------------------------------------------------------------------*/ -void limFTSetupAuthSession(tpAniSirGlobal pMac, tpPESession psessionEntry) +tSirRetStatus limFTSetupAuthSession(tpAniSirGlobal pMac, + tpPESession psessionEntry) { - tpPESession pftSessionEntry; - - // Prepare the session right now with as much as possible. - pftSessionEntry = limFillFTSession(pMac, pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription, psessionEntry); - - if (pftSessionEntry) - { - pftSessionEntry->is11Rconnection = psessionEntry->is11Rconnection; -#ifdef FEATURE_WLAN_ESE - pftSessionEntry->isESEconnection = psessionEntry->isESEconnection; -#endif -#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) - pftSessionEntry->isFastTransitionEnabled = psessionEntry->isFastTransitionEnabled; + tpPESession pftSessionEntry = NULL; + tANI_U8 sessionId = 0; + + pftSessionEntry = + peFindSessionByBssid(pMac, psessionEntry->limReAssocbssId, &sessionId); + if (pftSessionEntry == NULL) { + PELOGE(limLog(pMac, LOGE, + FL("Unable to find session for the following bssid"));) + limPrintMacAddr(pMac, psessionEntry->limReAssocbssId, LOGE); + return eSIR_FAILURE; + } + + /* Nothing to be done if the session is not in STA mode */ + if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { +#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG + PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif + return eSIR_FAILURE; + } -#ifdef FEATURE_WLAN_LFR - pftSessionEntry->isFastRoamIniFeatureEnabled = psessionEntry->isFastRoamIniFeatureEnabled; -#endif + if (psessionEntry->ftPEContext.pFTPreAuthReq && + psessionEntry->ftPEContext.pFTPreAuthReq->pbssDescription) { + limFillFTSession(pMac, + psessionEntry->ftPEContext.pFTPreAuthReq->pbssDescription, + pftSessionEntry, + psessionEntry); -#ifdef WLAN_FEATURE_11W - pftSessionEntry->limRmfEnabled = psessionEntry->limRmfEnabled; -#endif + limFTPrepareAddBssReq( pMac, FALSE, pftSessionEntry, + psessionEntry->ftPEContext.pFTPreAuthReq->pbssDescription ); + } - limFTPrepareAddBssReq( pMac, FALSE, pftSessionEntry, - pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription ); - pMac->ft.ftPEContext.pftSessionEntry = pftSessionEntry; - } + return eSIR_SUCCESS; } /*------------------------------------------------------------------ * Resume Link Call Back *------------------------------------------------------------------*/ -void limFTProcessPreAuthResult(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data) +void limFTProcessPreAuthResult(tpAniSirGlobal pMac, eHalStatus status, + tANI_U32 *data) { - tpPESession psessionEntry; - - if (!pMac->ft.ftPEContext.pFTPreAuthReq) - return; + tpPESession psessionEntry = (tpPESession)data; - psessionEntry = (tpPESession)data; + if (NULL == psessionEntry && + NULL == psessionEntry->ftPEContext.pFTPreAuthReq) + return; - if (pMac->ft.ftPEContext.ftPreAuthStatus == eSIR_SUCCESS) - { - limFTSetupAuthSession(pMac, psessionEntry); - } + /* Nothing to be done if the session is not in STA mode */ + if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { +#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG + PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) +#endif + return; + } - // Post the FT Pre Auth Response to SME - limPostFTPreAuthRsp(pMac, pMac->ft.ftPEContext.ftPreAuthStatus, - pMac->ft.ftPEContext.saved_auth_rsp, - pMac->ft.ftPEContext.saved_auth_rsp_length, psessionEntry); + if (psessionEntry->ftPEContext.ftPreAuthStatus == eSIR_SUCCESS) { + psessionEntry->ftPEContext.ftPreAuthStatus = + limFTSetupAuthSession(pMac, psessionEntry); + } + // Post the FT Pre Auth Response to SME + limPostFTPreAuthRsp(pMac, psessionEntry->ftPEContext.ftPreAuthStatus, + psessionEntry->ftPEContext.saved_auth_rsp, + psessionEntry->ftPEContext.saved_auth_rsp_length, psessionEntry); } /*------------------------------------------------------------------ * Resume Link Call Back *------------------------------------------------------------------*/ -void limPerformPostFTPreAuthAndChannelChange(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data, - tpPESession psessionEntry) +void limPerformPostFTPreAuthAndChannelChange(tpAniSirGlobal pMac, + eHalStatus status, + tANI_U32 *data, + tpPESession psessionEntry) { - //Set the resume channel to Any valid channel (invalid). - //This will instruct HAL to set it to any previous valid channel. + /* Set the resume channel to Any valid channel (invalid) + * This will instruct HAL to set it to any previous valid channel. + */ peSetResumeChannel(pMac, 0, 0); limResumeLink(pMac, limFTProcessPreAuthResult, (tANI_U32 *)psessionEntry); } -tSirRetStatus limCreateRICBlockAckIE(tpAniSirGlobal pMac, tANI_U8 tid, tCfgTrafficClass *pTrafficClass, - tANI_U8 *ric_ies, tANI_U32 *ieLength) -{ - /* BlockACK + RIC is not supported now, TODO later to support this */ -#if 0 - tDot11fIERICDataDesc ricIe; - tDot11fFfBAStartingSequenceControl baSsnControl; - tDot11fFfAddBAParameterSet baParamSet; - tDot11fFfBATimeout baTimeout; - - vos_mem_zero(&ricIe, sizeof(tDot11fIERICDataDesc)); - vos_mem_zero(&baSsnControl, sizeof(tDot11fFfBAStartingSequenceControl)); - vos_mem_zero(&baParamSet, sizeof(tDot11fFfAddBAParameterSet)); - vos_mem_zero(&baTimeout, sizeof(tDot11fFfBATimeout)); - - ricIe.present = 1; - ricIe.RICData.present = 1; - ricIe.RICData.resourceDescCount = 1; - ricIe.RICData.Identifier = LIM_FT_RIC_BA_DIALOG_TOKEN_TID_0 + tid; - ricIe.RICDescriptor.present = 1; - ricIe.RICDescriptor.resourceType = LIM_FT_RIC_DESCRIPTOR_RESOURCE_TYPE_BA; - baParamSet.tid = tid; - baParamSet.policy = pTrafficClass->fTxBApolicy; // Immediate Block Ack - baParamSet.bufferSize = pTrafficClass->txBufSize; - vos_mem_copy((v_VOID_t *)&baTimeout, (v_VOID_t *)&pTrafficClass->tuTxBAWaitTimeout, sizeof(baTimeout)); - baSsnControl.fragNumber = 0; - baSsnControl.ssn = LIM_FT_RIC_BA_SSN; - if (ricIe.RICDescriptor.num_variableData < sizeof (ricIe.RICDescriptor.variableData)) { - dot11fPackFfAddBAParameterSet(pMac, &baParamSet, &ricIe.RICDescriptor.variableData[ricIe.RICDescriptor.num_variableData]); - //vos_mem_copy(&ricIe.RICDescriptor.variableData[ricIe.RICDescriptor.num_variableData], &baParamSet, sizeof(tDot11fFfAddBAParameterSet)); - ricIe.RICDescriptor.num_variableData += sizeof(tDot11fFfAddBAParameterSet); - } - if (ricIe.RICDescriptor.num_variableData < sizeof (ricIe.RICDescriptor.variableData)) { - dot11fPackFfBATimeout(pMac, &baTimeout, &ricIe.RICDescriptor.variableData[ricIe.RICDescriptor.num_variableData]); - //vos_mem_copy(&ricIe.RICDescriptor.variableData[ricIe.RICDescriptor.num_variableData], &baTimeout, sizeof(tDot11fFfBATimeout)); - ricIe.RICDescriptor.num_variableData += sizeof(tDot11fFfBATimeout); - } - if (ricIe.RICDescriptor.num_variableData < sizeof (ricIe.RICDescriptor.variableData)) { - dot11fPackFfBAStartingSequenceControl(pMac, &baSsnControl, &ricIe.RICDescriptor.variableData[ricIe.RICDescriptor.num_variableData]); - //vos_mem_copy(&ricIe.RICDescriptor.variableData[ricIe.RICDescriptor.num_variableData], &baSsnControl, sizeof(tDot11fFfBAStartingSequenceControl)); - ricIe.RICDescriptor.num_variableData += sizeof(tDot11fFfBAStartingSequenceControl); - } - return (tSirRetStatus) dot11fPackIeRICDataDesc(pMac, &ricIe, ric_ies, sizeof(tDot11fIERICDataDesc), ieLength); -#endif - - return eSIR_FAILURE; -} - -tSirRetStatus limFTFillRICBlockAckInfo(tpAniSirGlobal pMac, tANI_U8 *ric_ies, tANI_U32 *ric_ies_length) -{ - tANI_U8 tid = 0; - tpDphHashNode pSta; - tANI_U16 numBA = 0, aid = 0; - tpPESession psessionEntry = pMac->ft.ftPEContext.psavedsessionEntry; - tANI_U32 offset = 0, ieLength = 0; - tSirRetStatus status = eSIR_SUCCESS; - - // First, extract the DPH entry - pSta = dphLookupHashEntry( pMac, pMac->ft.ftPEContext.pFTPreAuthReq->currbssId, &aid, &psessionEntry->dph.dphHashTable); - if( NULL == pSta ) - { - PELOGE(limLog( pMac, LOGE, - FL( "STA context not found for saved session's BSSID " MAC_ADDRESS_STR ), - MAC_ADDR_ARRAY(pMac->ft.ftPEContext.pFTPreAuthReq->currbssId));) - return eSIR_FAILURE; - } - - for (tid = 0; tid < STACFG_MAX_TC; tid++) - { - if (pSta->tcCfg[tid].fUseBATx) - { - status = limCreateRICBlockAckIE(pMac, tid, &pSta->tcCfg[tid], ric_ies + offset, &ieLength); - if (eSIR_SUCCESS == status) - { - // TODO RIC - if ( ieLength > MAX_FTIE_SIZE ) - { - ieLength = 0; - return status; - } - offset += ieLength; - *ric_ies_length += ieLength; - numBA++; - } - else - { - PELOGE(limLog(pMac, LOGE, FL("BA RIC IE creation for TID %d failed with status %d"), tid, status);) - } - } - } - - PELOGE(limLog(pMac, LOGE, FL("Number of BA RIC IEs created = %d: Total length = %d"), numBA, *ric_ies_length);) - return status; -} - /*------------------------------------------------------------------ * * Will post pre auth response to SME. @@ -1097,78 +1101,69 @@ void limPostFTPreAuthRsp(tpAniSirGlobal pMac, tSirRetStatus status, tANI_U8 *auth_rsp, tANI_U16 auth_rsp_length, tpPESession psessionEntry) { - tpSirFTPreAuthRsp pFTPreAuthRsp; - tSirMsgQ mmhMsg; - tANI_U16 rspLen = sizeof(tSirFTPreAuthRsp); - // TODO: RIC Support - //tSirRetStatus sirStatus = eSIR_SUCCESS; - - pFTPreAuthRsp = (tpSirFTPreAuthRsp)vos_mem_malloc(rspLen); - if (NULL == pFTPreAuthRsp) - { - PELOGE(limLog( pMac, LOGE, "Failed to allocate memory");) - VOS_ASSERT(pFTPreAuthRsp != NULL); - return; - } - vos_mem_zero( pFTPreAuthRsp, rspLen); + tpSirFTPreAuthRsp pFTPreAuthRsp; + tSirMsgQ mmhMsg; + tANI_U16 rspLen = sizeof(tSirFTPreAuthRsp); + + pFTPreAuthRsp = (tpSirFTPreAuthRsp)vos_mem_malloc(rspLen); + if (NULL == pFTPreAuthRsp) { + PELOGE(limLog( pMac, LOGE, "Failed to allocate memory");) + VOS_ASSERT(pFTPreAuthRsp != NULL); + return; + } + vos_mem_zero( pFTPreAuthRsp, rspLen); + #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOG1, FL("Auth Rsp = %p"), pFTPreAuthRsp);) + PELOGE(limLog( pMac, LOG1, FL("Auth Rsp = %p"), pFTPreAuthRsp);) #endif - vos_mem_set((tANI_U8*)pFTPreAuthRsp, rspLen, 0); - pFTPreAuthRsp->messageType = eWNI_SME_FT_PRE_AUTH_RSP; - pFTPreAuthRsp->length = (tANI_U16) rspLen; - pFTPreAuthRsp->status = status; - if (psessionEntry) - pFTPreAuthRsp->smeSessionId = psessionEntry->smeSessionId; - - // The bssid of the AP we are sending Auth1 to. - if (pMac->ft.ftPEContext.pFTPreAuthReq) - sirCopyMacAddr(pFTPreAuthRsp->preAuthbssId, - pMac->ft.ftPEContext.pFTPreAuthReq->preAuthbssId); - - // Attach the auth response now back to SME - pFTPreAuthRsp->ft_ies_length = 0; - if ((auth_rsp != NULL) && (auth_rsp_length < MAX_FTIE_SIZE)) - { - // Only 11r assoc has FT IEs. - vos_mem_copy(pFTPreAuthRsp->ft_ies, auth_rsp, auth_rsp_length); - pFTPreAuthRsp->ft_ies_length = auth_rsp_length; - } - -#ifdef WLAN_FEATURE_VOWIFI_11R - if ((psessionEntry) && (psessionEntry->is11Rconnection)) - { - /* TODO: RIC SUPPORT Fill in the Block Ack RIC IEs in the preAuthRsp */ - /* - sirStatus = limFTFillRICBlockAckInfo(pMac, pFTPreAuthRsp->ric_ies, - (tANI_U32 *)&pFTPreAuthRsp->ric_ies_length); - if (eSIR_SUCCESS != sirStatus) - { - PELOGE(limLog(pMac, LOGE, FL("Fill RIC BA Info failed with status %d"), sirStatus);) - } - */ - } + /* Nothing to be done if the session is not in STA mode */ + if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { +#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG + PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif - - mmhMsg.type = pFTPreAuthRsp->messageType; - mmhMsg.bodyptr = pFTPreAuthRsp; - mmhMsg.bodyval = 0; + return; + } + + pFTPreAuthRsp->messageType = eWNI_SME_FT_PRE_AUTH_RSP; + pFTPreAuthRsp->length = (tANI_U16) rspLen; + pFTPreAuthRsp->status = status; + if (psessionEntry) + pFTPreAuthRsp->smeSessionId = psessionEntry->smeSessionId; + + /* The bssid of the AP we are sending Auth1 to. */ + if (psessionEntry->ftPEContext.pFTPreAuthReq) + sirCopyMacAddr(pFTPreAuthRsp->preAuthbssId, + psessionEntry->ftPEContext.pFTPreAuthReq->preAuthbssId); + + /* Attach the auth response now back to SME */ + pFTPreAuthRsp->ft_ies_length = 0; + if ((auth_rsp != NULL) && (auth_rsp_length < MAX_FTIE_SIZE)) { + /* Only 11r assoc has FT IEs */ + vos_mem_copy(pFTPreAuthRsp->ft_ies, auth_rsp, auth_rsp_length); + pFTPreAuthRsp->ft_ies_length = auth_rsp_length; + } + + mmhMsg.type = pFTPreAuthRsp->messageType; + mmhMsg.bodyptr = pFTPreAuthRsp; + mmhMsg.bodyval = 0; #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOG1, "Posted Auth Rsp to SME with status of 0x%x", status);) + PELOGE(limLog( pMac, LOG1, + "Posted Auth Rsp to SME with status of 0x%x", status);) #endif + #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT - if (status == eSIR_SUCCESS) - limDiagEventReport(pMac, WLAN_PE_DIAG_PREAUTH_DONE, psessionEntry, - status, 0); + if (status == eSIR_SUCCESS) + limDiagEventReport(pMac, WLAN_PE_DIAG_PREAUTH_DONE, psessionEntry, + status, 0); #endif - limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); + limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT); } /*------------------------------------------------------------------ * - * Send the FT Pre Auth Response to SME when ever we have a status + * Send the FT Pre Auth Response to SME whenever we have a status * ready to be sent to SME * * SME will be the one to send it up to the supplicant to receive @@ -1180,85 +1175,98 @@ void limHandleFTPreAuthRsp(tpAniSirGlobal pMac, tSirRetStatus status, tpPESession psessionEntry) { - tpPESession pftSessionEntry; - tANI_U8 sessionId; - tpSirBssDescription pbssDescription; -#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT - limDiagEventReport(pMac, WLAN_PE_DIAG_PRE_AUTH_RSP_EVENT, psessionEntry, (tANI_U16)status, 0); + tpPESession pftSessionEntry = NULL; + tANI_U8 sessionId = 0; + tpSirBssDescription pbssDescription = NULL; +#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM + limDiagEventReport(pMac, WLAN_PE_DIAG_PRE_AUTH_RSP_EVENT, + psessionEntry, (tANI_U16)status, 0); #endif - // Save the status of pre-auth - pMac->ft.ftPEContext.ftPreAuthStatus = status; - - // Save the auth rsp, so we can send it to - // SME once we resume link. - pMac->ft.ftPEContext.saved_auth_rsp_length = 0; - if ((auth_rsp != NULL) && (auth_rsp_length < MAX_FTIE_SIZE)) - { - vos_mem_copy(pMac->ft.ftPEContext.saved_auth_rsp, + /* Nothing to be done if the session is not in STA mode */ + if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { +#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG + PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) +#endif + return; + } + + /* Save the status of pre-auth */ + psessionEntry->ftPEContext.ftPreAuthStatus = status; + + /* Save the auth rsp, so we can send it to + * SME once we resume link + */ + psessionEntry->ftPEContext.saved_auth_rsp_length = 0; + if ((auth_rsp != NULL) && (auth_rsp_length < MAX_FTIE_SIZE)) { + vos_mem_copy(psessionEntry->ftPEContext.saved_auth_rsp, auth_rsp, auth_rsp_length); - pMac->ft.ftPEContext.saved_auth_rsp_length = auth_rsp_length; - } - - /* Create FT session for the re-association at this point */ - if (pMac->ft.ftPEContext.ftPreAuthStatus == eSIR_SUCCESS) - { - pbssDescription = pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription; - if((pftSessionEntry = peCreateSession(pMac, pbssDescription->bssId, - &sessionId, pMac->lim.maxStation, - psessionEntry->bssType)) == NULL) - { - limLog(pMac, LOGE, FL("Session Can not be created for pre-auth 11R AP")); - return; - } - pftSessionEntry->peSessionId = sessionId; - pftSessionEntry->smeSessionId = psessionEntry->smeSessionId; - sirCopyMacAddr(pftSessionEntry->selfMacAddr, psessionEntry->selfMacAddr); - sirCopyMacAddr(pftSessionEntry->limReAssocbssId, pbssDescription->bssId); - pftSessionEntry->bssType = psessionEntry->bssType; - - if (pftSessionEntry->bssType == eSIR_INFRASTRUCTURE_MODE) - { - pftSessionEntry->limSystemRole = eLIM_STA_ROLE; - } - else if(pftSessionEntry->bssType == eSIR_BTAMP_AP_MODE) - { - pftSessionEntry->limSystemRole = eLIM_BT_AMP_STA_ROLE; - } - else - { - limLog(pMac, LOGE, FL("Invalid bss type")); - } - pftSessionEntry->limPrevSmeState = pftSessionEntry->limSmeState; - vos_mem_copy(&(pftSessionEntry->htConfig), &(psessionEntry->htConfig), - sizeof(psessionEntry->htConfig)); - pftSessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE; - pMac->ft.ftPEContext.pftSessionEntry = pftSessionEntry; - PELOGE(limLog(pMac, LOG1, "%s:created session (%p) with id = %d", - __func__, pftSessionEntry, pftSessionEntry->peSessionId);) + psessionEntry->ftPEContext.saved_auth_rsp_length = + auth_rsp_length; + } + + /* Create FT session for the re-association at this point */ + if (psessionEntry->ftPEContext.ftPreAuthStatus == eSIR_SUCCESS && + psessionEntry->ftPEContext.pFTPreAuthReq && + psessionEntry->ftPEContext.pFTPreAuthReq->pbssDescription) { + pbssDescription = + psessionEntry->ftPEContext.pFTPreAuthReq->pbssDescription; + limPrintMacAddr(pMac, pbssDescription->bssId, LOG1); + if((pftSessionEntry = + peCreateSession(pMac, pbssDescription->bssId, + &sessionId, pMac->lim.maxStation, + psessionEntry->bssType)) == NULL) { + limLog(pMac, LOGE, + FL("Session Can not be created for pre-auth 11R AP")); + return; + } - /* Update the ReAssoc BSSID of the current session */ - sirCopyMacAddr(psessionEntry->limReAssocbssId, pbssDescription->bssId); - limPrintMacAddr(pMac, psessionEntry->limReAssocbssId, LOG1); - } + pftSessionEntry->peSessionId = sessionId; + pftSessionEntry->smeSessionId = psessionEntry->smeSessionId; + sirCopyMacAddr(pftSessionEntry->selfMacAddr, psessionEntry->selfMacAddr); + sirCopyMacAddr(pftSessionEntry->limReAssocbssId, pbssDescription->bssId); + pftSessionEntry->bssType = psessionEntry->bssType; - if (psessionEntry->currentOperChannel != - pMac->ft.ftPEContext.pFTPreAuthReq->preAuthchannelNum) - { - // Need to move to the original AP channel - limChangeChannelWithCallback(pMac, psessionEntry->currentOperChannel, - limPerformPostFTPreAuthAndChannelChange, NULL, psessionEntry); - } - else - { + if (pftSessionEntry->bssType == eSIR_INFRASTRUCTURE_MODE) { + pftSessionEntry->limSystemRole = eLIM_STA_ROLE; + } + else if(pftSessionEntry->bssType == eSIR_BTAMP_AP_MODE) { + pftSessionEntry->limSystemRole = eLIM_BT_AMP_STA_ROLE; + } + else { + limLog(pMac, LOGE, FL("Invalid bss type")); + } + pftSessionEntry->limPrevSmeState = pftSessionEntry->limSmeState; + vos_mem_copy(&(pftSessionEntry->htConfig), &(psessionEntry->htConfig), + sizeof(psessionEntry->htConfig)); + pftSessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE; + + PELOGE(limLog(pMac, LOG1, "%s:created session (%p) with id = %d", + __func__, pftSessionEntry, pftSessionEntry->peSessionId);) + + /* Update the ReAssoc BSSID of the current session */ + sirCopyMacAddr(psessionEntry->limReAssocbssId, pbssDescription->bssId); + limPrintMacAddr(pMac, psessionEntry->limReAssocbssId, LOG1); + } + + if (psessionEntry->currentOperChannel != + psessionEntry->ftPEContext.pFTPreAuthReq->preAuthchannelNum) { + /* Need to move to the original AP channel */ + limChangeChannelWithCallback(pMac, psessionEntry->currentOperChannel, + limPerformPostFTPreAuthAndChannelChange, + NULL, psessionEntry); + } + else { #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOGE(limLog( pMac, LOG1, "Pre auth on same channel as connected AP channel %d", - pMac->ft.ftPEContext.pFTPreAuthReq->preAuthchannelNum);) + PELOGE(limLog( pMac, LOG1, + "Pre auth on same channel as connected AP channel %d", + psessionEntry->ftPEContext.pFTPreAuthReq->preAuthchannelNum);) #endif - limFTProcessPreAuthResult(pMac, status, (tANI_U32 *)psessionEntry); - } + limFTProcessPreAuthResult(pMac, status, (tANI_U32 *)psessionEntry); + } } + /*------------------------------------------------------------------ * * This function handles the 11R Reassoc Req from SME @@ -1286,16 +1294,22 @@ void limProcessMlmFTReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf, limDiagEventReport(pMac, WLAN_PE_DIAG_REASSOCIATING, psessionEntry, 0, 0); #endif - if (NULL == pMac->ft.ftPEContext.pAddBssReq) - { + /* Nothing to be done if the session is not in STA mode */ + if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { +#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG + PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) +#endif + return; + } + + if (NULL == psessionEntry->ftPEContext.pAddBssReq) { limLog(pMac, LOGE, FL("pAddBssReq is NULL")); return; } pMlmReassocReq = vos_mem_malloc(sizeof(tLimMlmReassocReq)); - if (NULL == pMlmReassocReq) - { - // Log error - limLog(pMac, LOGE, FL("call to AllocateMemory failed for mlmReassocReq")); + if (NULL == pMlmReassocReq) { + limLog(pMac, LOGE, + FL("call to AllocateMemory failed for mlmReassocReq")); return; } @@ -1305,19 +1319,18 @@ void limProcessMlmFTReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf, if (wlan_cfgGetInt(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT, (tANI_U32 *) &pMlmReassocReq->reassocFailureTimeout) - != eSIR_SUCCESS) - { + != eSIR_SUCCESS) { /** * Could not get ReassocFailureTimeout value * from CFG. Log error. */ - limLog(pMac, LOGE, FL("could not retrieve ReassocFailureTimeout value")); + limLog(pMac, LOGE, + FL("could not retrieve ReassocFailureTimeout value")); vos_mem_free(pMlmReassocReq); return; } - if (cfgGetCapabilityInfo(pMac, &caps,psessionEntry) != eSIR_SUCCESS) - { + if (cfgGetCapabilityInfo(pMac, &caps,psessionEntry) != eSIR_SUCCESS) { /** * Could not get Capabilities value * from CFG. Log error. @@ -1331,17 +1344,17 @@ void limProcessMlmFTReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf, /* Update PE sessionId*/ pMlmReassocReq->sessionId = psessionEntry->peSessionId; - /* If telescopic beaconing is enabled, set listen interval to WNI_CFG_TELE_BCN_MAX_LI */ + /* If telescopic beaconing is enabled, set listen interval + to WNI_CFG_TELE_BCN_MAX_LI + */ if (wlan_cfgGetInt(pMac, WNI_CFG_TELE_BCN_WAKEUP_EN, &teleBcnEn) != - eSIR_SUCCESS) - { + eSIR_SUCCESS) { limLog(pMac, LOGP, FL("Couldn't get WNI_CFG_TELE_BCN_WAKEUP_EN")); vos_mem_free(pMlmReassocReq); return; } - if (teleBcnEn) - { + if (teleBcnEn) { if (wlan_cfgGetInt(pMac, WNI_CFG_TELE_BCN_MAX_LI, &val) != eSIR_SUCCESS) { /** @@ -1353,11 +1366,9 @@ void limProcessMlmFTReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf, return; } } - else - { - if (wlan_cfgGetInt(pMac, WNI_CFG_LISTEN_INTERVAL, &val) != eSIR_SUCCESS) - { - /** + else { + if (wlan_cfgGetInt(pMac, WNI_CFG_LISTEN_INTERVAL, &val) != eSIR_SUCCESS) { + /** * Could not get ListenInterval value * from CFG. Log error. */ @@ -1367,39 +1378,34 @@ void limProcessMlmFTReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf, } } if (limSetLinkState(pMac, eSIR_LINK_PREASSOC_STATE, psessionEntry->bssId, - psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS) - { + psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS) { vos_mem_free(pMlmReassocReq); return; } pMlmReassocReq->listenInterval = (tANI_U16) val; - psessionEntry->pLimMlmReassocReq = pMlmReassocReq; - - //we need to defer the message until we get the response back from HAL. + /* we need to defer the message until we get the response back from HAL */ SET_LIM_PROCESS_DEFD_MESGS(pMac, false); msgQ.type = SIR_HAL_ADD_BSS_REQ; msgQ.reserved = 0; - msgQ.bodyptr = pMac->ft.ftPEContext.pAddBssReq; + msgQ.bodyptr = psessionEntry->ftPEContext.pAddBssReq; msgQ.bodyval = 0; - #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG limLog( pMac, LOG1, FL( "Sending SIR_HAL_ADD_BSS_REQ..." )); #endif MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type)); retCode = wdaPostCtrlMsg( pMac, &msgQ ); - if( eSIR_SUCCESS != retCode) - { - vos_mem_free(pMac->ft.ftPEContext.pAddBssReq); + if( eSIR_SUCCESS != retCode) { + vos_mem_free(psessionEntry->ftPEContext.pAddBssReq); limLog( pMac, LOGE, FL("Posting ADD_BSS_REQ to HAL failed, reason=%X"), retCode ); } - // Dont need this anymore - pMac->ft.ftPEContext.pAddBssReq = NULL; + + psessionEntry->ftPEContext.pAddBssReq = NULL; return; } @@ -1411,45 +1417,64 @@ void limProcessMlmFTReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf, *------------------------------------------------------------------*/ void limProcessFTPreauthRspTimeout(tpAniSirGlobal pMac) { - tpPESession psessionEntry; - - // We have failed pre auth. We need to resume link and get back on - // home channel. - limLog(pMac, LOG1, FL("FT Pre-Auth Time Out!!!!")); - - if((psessionEntry = peFindSessionBySessionId(pMac, pMac->lim.limTimers.gLimFTPreAuthRspTimer.sessionId))== NULL) - { - limLog(pMac, LOGE, FL("Session Does not exist for given sessionID")); - return; - } - - /* To handle the race condition where we recieve preauth rsp after - * timer has expired. - */ - if (eANI_BOOLEAN_TRUE == - pMac->ft.ftPEContext.pFTPreAuthReq->bPreAuthRspProcessed) - { - limLog(pMac,LOGE,FL("Auth rsp already posted to SME" + tpPESession psessionEntry; + + /* We have failed pre auth. We need to resume link and get back on + * home channel + */ + limLog(pMac, LOG1, FL("FT Pre-Auth Time Out!!!!")); + + if ((psessionEntry = + peFindSessionBySessionId(pMac, + pMac->lim.limTimers.gLimFTPreAuthRspTimer.sessionId)) == NULL) { + limLog(pMac, LOGE, FL("Session Does not exist for given sessionID")); + return; + } + + /* Nothing to be done if the session is not in STA mode */ + if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { +#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG + PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) +#endif + return; + } + + /* Reset the flag to indicate preauth request session */ + psessionEntry->ftPEContext.ftPreAuthSession = VOS_FALSE; + + if (NULL == + psessionEntry->ftPEContext.pFTPreAuthReq) { + limLog(pMac,LOGE,FL("pFTPreAuthReq is NULL")); + return; + } + + /* To handle the race condition where we recieve preauth rsp after + * timer has expired. + */ + if (eANI_BOOLEAN_TRUE == + psessionEntry->ftPEContext.pFTPreAuthReq->bPreAuthRspProcessed) { + limLog(pMac,LOGE,FL("Auth rsp already posted to SME" " (session %p)"), psessionEntry); - return; - } - else - { - /* Here we are sending preauth rsp with failure state - * and which is forwarded to SME. Now, if we receive an preauth - * resp from AP with success it would create a FT pesession, but - * will be dropped in SME leaving behind the pesession. - * Mark Preauth rsp processed so that any rsp from AP is dropped in - * limProcessAuthFrameNoSession. - */ - limLog(pMac,LOG1,FL("Auth rsp not yet posted to SME" + return; + } + else { + /* Here we are sending preauth rsp with failure state + * and which is forwarded to SME. Now, if we receive an preauth + * resp from AP with success it would create a FT pesession, but + * will be dropped in SME leaving behind the pesession. + * Mark Preauth rsp processed so that any rsp from AP is dropped in + * limProcessAuthFrameNoSession. + */ + limLog(pMac,LOG1,FL("Auth rsp not yet posted to SME" " (session %p)"), psessionEntry); - pMac->ft.ftPEContext.pFTPreAuthReq->bPreAuthRspProcessed = - eANI_BOOLEAN_TRUE; - } - // Ok, so attempted at Pre-Auth and failed. If we are off channel. We need - // to get back. - limHandleFTPreAuthRsp(pMac, eSIR_FAILURE, NULL, 0, psessionEntry); + psessionEntry->ftPEContext.pFTPreAuthReq->bPreAuthRspProcessed = + eANI_BOOLEAN_TRUE; + } + + /* Attempted at Pre-Auth and failed. If we are off channel. We need + * to get back to home channel + */ + limHandleFTPreAuthRsp(pMac, eSIR_FAILURE, NULL, 0, psessionEntry); } @@ -1460,25 +1485,48 @@ void limProcessFTPreauthRspTimeout(tpAniSirGlobal pMac) *------------------------------------------------------------------*/ tANI_BOOLEAN limProcessFTUpdateKey(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf ) { - tAddBssParams * pAddBssParams; - tSirFTUpdateKeyInfo * pKeyInfo; + tAddBssParams *pAddBssParams; + tSirFTUpdateKeyInfo *pKeyInfo; tANI_U32 val = 0; + tpPESession psessionEntry; + tANI_U8 sessionId; /* Sanity Check */ if( pMac == NULL || pMsgBuf == NULL ) { - return TRUE; + return VOS_FALSE; } - if(pMac->ft.ftPEContext.pAddBssReq == NULL) + pKeyInfo = (tSirFTUpdateKeyInfo *)pMsgBuf; + + psessionEntry = + peFindSessionByBssid(pMac, pKeyInfo->bssId, &sessionId); + if (NULL == psessionEntry) + { + PELOGE(limLog( pMac, LOGE, + "%s: Unable to find session for the following bssid", + __func__);) + limPrintMacAddr( pMac, pKeyInfo->bssId, LOGE ); + return VOS_FALSE; + } + + /* Nothing to be done if the session is not in STA mode */ + if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { +#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG + PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) +#endif + return VOS_FALSE; + } + + if (NULL == psessionEntry->ftPEContext.pAddBssReq) { // AddBss Req is NULL, save the keys to configure them later. - tpLimMlmSetKeysReq pMlmSetKeysReq = &pMac->ft.ftPEContext.PreAuthKeyInfo.extSetStaKeyParam; - tpPESession psessionEntry = (tPESession *)pMac->ft.ftPEContext.pftSessionEntry; + tpLimMlmSetKeysReq pMlmSetKeysReq = + &psessionEntry->ftPEContext.PreAuthKeyInfo.extSetStaKeyParam; - pKeyInfo = (tSirFTUpdateKeyInfo *)pMsgBuf; vos_mem_zero(pMlmSetKeysReq, sizeof(tLimMlmSetKeysReq)); - vos_mem_copy(pMlmSetKeysReq->peerMacAddr, pKeyInfo->bssId, sizeof(tSirMacAddr)); + vos_mem_copy(pMlmSetKeysReq->peerMacAddr, pKeyInfo->bssId, + sizeof(tSirMacAddr)); pMlmSetKeysReq->sessionId = psessionEntry->peSessionId; pMlmSetKeysReq->smesessionId = psessionEntry->smeSessionId; pMlmSetKeysReq->edType = pKeyInfo->keyMaterial.edType; @@ -1486,21 +1534,22 @@ tANI_BOOLEAN limProcessFTUpdateKey(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf ) vos_mem_copy((tANI_U8 *) &pMlmSetKeysReq->key, (tANI_U8 *) &pKeyInfo->keyMaterial.key, sizeof(tSirKeys)); - pMac->ft.ftPEContext.PreAuthKeyInfo.extSetStaKeyParamValid = TRUE; + psessionEntry->ftPEContext.PreAuthKeyInfo.extSetStaKeyParamValid = TRUE; limLog( pMac, LOGE, FL( "pAddBssReq is NULL" )); - if (pMac->ft.ftPEContext.pAddStaReq == NULL) + if (psessionEntry->ftPEContext.pAddStaReq == NULL) { limLog( pMac, LOGE, FL( "pAddStaReq is NULL" )); - limSendSetStaKeyReq(pMac, pMlmSetKeysReq, 0, 0, psessionEntry, FALSE); - pMac->ft.ftPEContext.PreAuthKeyInfo.extSetStaKeyParamValid = FALSE; + limSendSetStaKeyReq(pMac, pMlmSetKeysReq, 0, 0, psessionEntry, + FALSE); + psessionEntry->ftPEContext.PreAuthKeyInfo.extSetStaKeyParamValid = + FALSE; } } else { - pAddBssParams = pMac->ft.ftPEContext.pAddBssReq; - pKeyInfo = (tSirFTUpdateKeyInfo *)pMsgBuf; + pAddBssParams = psessionEntry->ftPEContext.pAddBssReq; /* Store the key information in the ADD BSS parameters */ pAddBssParams->extSetStaKeyParamValid = 1; @@ -1522,7 +1571,8 @@ tANI_BOOLEAN limProcessFTUpdateKey(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf ) PELOG1(limLog(pMac, LOG1, FL("BSSID = "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pKeyInfo->bssId));) - sirCopyMacAddr(pAddBssParams->extSetStaKeyParam.peerMacAddr, pKeyInfo->bssId); + sirCopyMacAddr(pAddBssParams->extSetStaKeyParam.peerMacAddr, + pKeyInfo->bssId); pAddBssParams->extSetStaKeyParam.sendRsp = FALSE; @@ -1576,15 +1626,26 @@ limProcessFTAggrQosReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf ) psessionEntry = peFindSessionByBssid(pMac, aggrQosReq->bssId, &sessionId); if (psessionEntry == NULL) { - PELOGE(limLog(pMac, LOGE, FL("psession Entry Null for sessionId = %d"), aggrQosReq->sessionId);) + PELOGE(limLog(pMac, LOGE, FL("psession Entry Null for sessionId = %d"), + aggrQosReq->sessionId);) vos_mem_free(pAggrAddTsParam); return eSIR_FAILURE; } - pSta = dphLookupHashEntry(pMac, aggrQosReq->bssId, &aid, &psessionEntry->dph.dphHashTable); + /* Nothing to be done if the session is not in STA mode */ + if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { +#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG + PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) +#endif + return eSIR_FAILURE; + } + + pSta = dphLookupHashEntry(pMac, aggrQosReq->bssId, &aid, + &psessionEntry->dph.dphHashTable); if (pSta == NULL) { - PELOGE(limLog(pMac, LOGE, FL("Station context not found - ignoring AddTsRsp"));) + PELOGE(limLog(pMac, LOGE, + FL("Station context not found - ignoring AddTsRsp"));) vos_mem_free(pAggrAddTsParam); return eSIR_FAILURE; } @@ -1598,109 +1659,128 @@ limProcessFTAggrQosReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf ) for( i = 0; i < HAL_QOS_NUM_AC_MAX; i++ ) { - if (aggrQosReq->aggrInfo.tspecIdx & (1<<i)) - { - tSirMacTspecIE *pTspec = &aggrQosReq->aggrInfo.aggrAddTsInfo[i].tspec; - /* Since AddTS response was successful, check for the PSB flag - * and directional flag inside the TS Info field. - * An AC is trigger enabled AC if the PSB subfield is set to 1 - * in the uplink direction. - * An AC is delivery enabled AC if the PSB subfield is set to 1 - * in the downlink direction. - * An AC is trigger and delivery enabled AC if the PSB subfield - * is set to 1 in the bi-direction field. - */ - if(!pMac->psOffloadEnabled) - { - if (pTspec->tsinfo.traffic.psb == 1) - { - limSetTspecUapsdMask(pMac, &pTspec->tsinfo, SET_UAPSD_MASK); - } - else - { - limSetTspecUapsdMask(pMac, &pTspec->tsinfo, CLEAR_UAPSD_MASK); - } - /* - * ADDTS success, so AC is now admitted. - * We shall now use the default - * EDCA parameters as advertised by AP and - * send the updated EDCA params - * to HAL. - */ - ac = upToAc(pTspec->tsinfo.traffic.userPrio); - if(pTspec->tsinfo.traffic.direction == SIR_MAC_DIRECTION_UPLINK) - { - pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac); - } - else if(pTspec->tsinfo.traffic.direction == SIR_MAC_DIRECTION_DNLINK) - { - pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac); - } - else if(pTspec->tsinfo.traffic.direction == SIR_MAC_DIRECTION_BIDIR) - { - pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac); - pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac); - } - } - else - { - if (pTspec->tsinfo.traffic.psb == 1) - { - limSetTspecUapsdMaskPerSession(pMac, psessionEntry, - &pTspec->tsinfo, - SET_UAPSD_MASK); - } - else - { - limSetTspecUapsdMaskPerSession(pMac, psessionEntry, - &pTspec->tsinfo, - CLEAR_UAPSD_MASK); - } - /* - * ADDTS success, so AC is now admitted. - * We shall now use the default - * EDCA parameters as advertised by AP and - * send the updated EDCA params - * to HAL. - */ - ac = upToAc(pTspec->tsinfo.traffic.userPrio); - if(pTspec->tsinfo.traffic.direction == SIR_MAC_DIRECTION_UPLINK) - { - psessionEntry->gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac); - } - else if(pTspec->tsinfo.traffic.direction == SIR_MAC_DIRECTION_DNLINK) - { - psessionEntry->gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac); - } - else if(pTspec->tsinfo.traffic.direction == SIR_MAC_DIRECTION_BIDIR) - { - psessionEntry->gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= (1 << ac); - psessionEntry->gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= (1 << ac); - } - } - - limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry); - - if (pSta->aniPeer == eANI_BOOLEAN_TRUE) - { - limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pSta->bssId, eANI_BOOLEAN_TRUE); - } - else - { - limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pSta->bssId, eANI_BOOLEAN_FALSE); - } - - if(eSIR_SUCCESS != limTspecAdd(pMac, pSta->staAddr, pSta->assocId, pTspec, 0, &tspecInfo)) - { - PELOGE(limLog(pMac, LOGE, FL("Adding entry in lim Tspec Table failed "));) + if (aggrQosReq->aggrInfo.tspecIdx & (1<<i)) + { + tSirMacTspecIE *pTspec = + &aggrQosReq->aggrInfo.aggrAddTsInfo[i].tspec; + /* Since AddTS response was successful, check for the PSB flag + * and directional flag inside the TS Info field. + * An AC is trigger enabled AC if the PSB subfield is set to 1 + * in the uplink direction. + * An AC is delivery enabled AC if the PSB subfield is set to 1 + * in the downlink direction. + * An AC is trigger and delivery enabled AC if the PSB subfield + * is set to 1 in the bi-direction field. + */ + if(!pMac->psOffloadEnabled) + { + if (pTspec->tsinfo.traffic.psb == 1) + { + limSetTspecUapsdMask(pMac, &pTspec->tsinfo, SET_UAPSD_MASK); + } + else + { + limSetTspecUapsdMask(pMac, &pTspec->tsinfo, + CLEAR_UAPSD_MASK); + } + /* + * ADDTS success, so AC is now admitted. + * We shall now use the default + * EDCA parameters as advertised by AP and + * send the updated EDCA params + * to HAL. + */ + ac = upToAc(pTspec->tsinfo.traffic.userPrio); + if(pTspec->tsinfo.traffic.direction == SIR_MAC_DIRECTION_UPLINK) + { + pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= + (1 << ac); + } + else if(pTspec->tsinfo.traffic.direction == + SIR_MAC_DIRECTION_DNLINK) + { + pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= + (1 << ac); + } + else if(pTspec->tsinfo.traffic.direction == + SIR_MAC_DIRECTION_BIDIR) + { + pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= + (1 << ac); + pMac->lim.gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= + (1 << ac); + } + } + else + { + if (pTspec->tsinfo.traffic.psb == 1) + { + limSetTspecUapsdMaskPerSession(pMac, psessionEntry, + &pTspec->tsinfo, + SET_UAPSD_MASK); + } + else + { + limSetTspecUapsdMaskPerSession(pMac, psessionEntry, + &pTspec->tsinfo, + CLEAR_UAPSD_MASK); + } + /* + * ADDTS success, so AC is now admitted. + * We shall now use the default + * EDCA parameters as advertised by AP and + * send the updated EDCA params + * to HAL. + */ + ac = upToAc(pTspec->tsinfo.traffic.userPrio); + if(pTspec->tsinfo.traffic.direction == SIR_MAC_DIRECTION_UPLINK) + { + psessionEntry->gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= + (1 << ac); + } + else if(pTspec->tsinfo.traffic.direction == + SIR_MAC_DIRECTION_DNLINK) + { + psessionEntry->gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= + (1 << ac); + } + else if(pTspec->tsinfo.traffic.direction == + SIR_MAC_DIRECTION_BIDIR) + { + psessionEntry->gAcAdmitMask[SIR_MAC_DIRECTION_UPLINK] |= + (1 << ac); + psessionEntry->gAcAdmitMask[SIR_MAC_DIRECTION_DNLINK] |= + (1 << ac); + } + } + + limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, + psessionEntry); + + if (pSta->aniPeer == eANI_BOOLEAN_TRUE) + { + limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, + pSta->bssId, eANI_BOOLEAN_TRUE); + } + else + { + limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, + pSta->bssId, eANI_BOOLEAN_FALSE); + } + + if(eSIR_SUCCESS != limTspecAdd(pMac, pSta->staAddr, pSta->assocId, + pTspec, 0, &tspecInfo)) + { + PELOGE(limLog(pMac, LOGE, + FL("Adding entry in lim Tspec Table failed "));) pMac->lim.gLimAddtsSent = false; - vos_mem_free(pAggrAddTsParam); - return eSIR_FAILURE; //Error handling. send the response with error status. need to send DelTS to tear down the TSPEC status. - } + vos_mem_free(pAggrAddTsParam); + return eSIR_FAILURE; + } - // Copy the TSPEC paramters - pAggrAddTsParam->tspec[i] = aggrQosReq->aggrInfo.aggrAddTsInfo[i].tspec; - } + pAggrAddTsParam->tspec[i] = + aggrQosReq->aggrInfo.aggrAddTsInfo[i].tspec; + } } msg.type = WDA_AGGR_QOS_REQ; @@ -1766,7 +1846,6 @@ limFTSendAggrQosRsp(tpAniSirGlobal pMac, tANI_U8 rspReqd, void limProcessFTAggrQoSRsp(tpAniSirGlobal pMac, tpSirMsgQ limMsg) { tpAggrAddTsParams pAggrQosRspMsg = NULL; - //tpAggrQosParams pAggrQosRspMsg = NULL; tAddTsParams addTsParam = {0}; tpDphHashNode pSta = NULL; tANI_U16 assocId =0; @@ -1791,8 +1870,8 @@ void limProcessFTAggrQoSRsp(tpAniSirGlobal pMac, tpSirMsgQ limMsg) psessionEntry = peFindSessionBySessionId(pMac, pAggrQosRspMsg->sessionId); if (NULL == psessionEntry) { - // Cant find session entry - PELOGE(limLog(pMac, LOGE, FL("Cant find session entry for %s"), __func__);) + PELOGE(limLog(pMac, LOGE, + FL("Cant find session entry for %s"), __func__);) if( pAggrQosRspMsg != NULL ) { vos_mem_free(pAggrQosRspMsg); @@ -1800,6 +1879,14 @@ void limProcessFTAggrQoSRsp(tpAniSirGlobal pMac, tpSirMsgQ limMsg) return; } + /* Nothing to be done if the session is not in STA mode */ + if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { +#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG + PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) +#endif + return; + } + for( i = 0; i < HAL_QOS_NUM_AC_MAX; i++ ) { if((((1 << i) & pAggrQosRspMsg->tspecIdx)) && @@ -1828,7 +1915,6 @@ void limProcessFTAggrQoSRsp(tpAniSirGlobal pMac, tpSirMsgQ limMsg) } /* Send the Aggr QoS response to SME */ - limFTSendAggrQosRsp(pMac, rspReqd, pAggrQosRspMsg, psessionEntry->smeSessionId); if( pAggrQosRspMsg != NULL ) @@ -1868,6 +1954,14 @@ void limProcessFTRoamOffloadSynchInd(tpAniSirGlobal pMac, tpSirMsgQ pMsg) return; } + /* Nothing to be done if the session is not in STA mode */ + if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { +#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG + PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) +#endif + return; + } + pbssDescription = pFTRoamOffloadSynchInd->pbssDescription; if((pftSessionEntry = peCreateSession(pMac, pbssDescription->bssId, &sessionId, pMac->lim.maxStation, @@ -1922,12 +2016,12 @@ void limProcessFTRoamOffloadSynchInd(tpAniSirGlobal pMac, tpSirMsgQ pMsg) #endif #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_ESE || defined(FEATURE_WLAN_LFR) pftSessionEntry->isFastTransitionEnabled = - psessionEntry->isFastTransitionEnabled; + psessionEntry->isFastTransitionEnabled; #endif #ifdef FEATURE_WLAN_LFR pftSessionEntry->isFastRoamIniFeatureEnabled = - psessionEntry->isFastRoamIniFeatureEnabled; + psessionEntry->isFastRoamIniFeatureEnabled; #endif limFTPrepareAddBssReq( pMac, FALSE, pftSessionEntry, pbssDescription ); pMac->ft.ftPEContext.pftSessionEntry = pftSessionEntry; diff --git a/CORE/MAC/src/pe/lim/limIbssPeerMgmt.c b/CORE/MAC/src/pe/lim/limIbssPeerMgmt.c index b50ae9f9f4b5..0c0e0271f856 100644 --- a/CORE/MAC/src/pe/lim/limIbssPeerMgmt.c +++ b/CORE/MAC/src/pe/lim/limIbssPeerMgmt.c @@ -45,6 +45,9 @@ #include "schApi.h" // schSetFixedBeaconFields for IBSS coalesce #include "limSecurityUtils.h" #include "limSendMessages.h" +#ifdef WLAN_FEATURE_VOWIFI_11R +#include "limFTDefs.h" +#endif #include "limSession.h" #include "limIbssPeerMgmt.h" diff --git a/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c b/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c index 67d0dde50cf4..053b17841c00 100644 --- a/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c +++ b/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c @@ -53,6 +53,9 @@ #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT #include "vos_diag_core_log.h" #endif //FEATURE_WLAN_DIAG_SUPPORT +#ifdef WLAN_FEATURE_VOWIFI_11R +#include "limFTDefs.h" +#endif #include "limSession.h" #include "limSerDesUtils.h" diff --git a/CORE/MAC/src/pe/lim/limLogDump.c b/CORE/MAC/src/pe/lim/limLogDump.c index 2639c76a1ccf..51ea71c41151 100644 --- a/CORE/MAC/src/pe/lim/limLogDump.c +++ b/CORE/MAC/src/pe/lim/limLogDump.c @@ -2075,93 +2075,111 @@ dump_lim_set_tl_data_pkt_rssi( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2 static char * dump_lim_ft_event( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p) { - static tANI_U8 macAddr[6] = {0x00, 0xde, 0xad, 0xaf, 0xaf, 0x04}; - tpPESession psessionEntry; - tSirMsgQ msg; - tpSirFTPreAuthReq pftPreAuthReq; - tANI_U16 auth_req_len = 0; - tCsrRoamConnectedProfile Profile; + static tANI_U8 macAddr[6] = {0x00, 0xde, 0xad, 0xaf, 0xaf, 0x04}; + tpPESession psessionEntry; + tSirMsgQ msg; + tpSirFTPreAuthReq pftPreAuthReq; + tANI_U16 auth_req_len = 0; + tCsrRoamConnectedProfile Profile; + tANI_U32 smeSessionId = arg2; + + if (!CSR_IS_SESSION_VALID( pMac, smeSessionId )) + { + p += log_sprintf( pMac, p, "smeSessionId is not valid\n"); + return p; + } - csrRoamCopyConnectProfile(pMac, arg2, &Profile); + csrRoamCopyConnectProfile(pMac, arg2, &Profile); - if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg2) )== NULL) - { - p += log_sprintf( pMac, + if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg2) )== NULL) + { + p += log_sprintf( pMac, p,"Session does not exist usage: 363 <0> sessionid channel \n"); - return p; - } + return p; + } - switch (arg1) - { - case 0: - // Send Pre-auth event - { - /*----------------*/ - p += log_sprintf( pMac,p, "Preparing Pre Auth Req message\n"); - auth_req_len = sizeof(tSirFTPreAuthReq); + switch (arg1) + { + case 0: + // Send Pre-auth event + { + /*----------------*/ + p += log_sprintf( pMac,p, "Preparing Pre Auth Req message\n"); + auth_req_len = sizeof(tSirFTPreAuthReq); - pftPreAuthReq = vos_mem_malloc(auth_req_len); - if (NULL == pftPreAuthReq) - { - p += log_sprintf( pMac,p,"Pre auth dump: AllocateMemory() failed \n"); - return p; - } - pftPreAuthReq->pbssDescription = vos_mem_malloc(sizeof(Profile.pBssDesc->length)+ - Profile.pBssDesc->length); - - pftPreAuthReq->messageType = eWNI_SME_FT_PRE_AUTH_REQ; - pftPreAuthReq->length = auth_req_len + sizeof(Profile.pBssDesc->length) + - Profile.pBssDesc->length; - pftPreAuthReq->preAuthchannelNum = 6; - - vos_mem_copy((void *) &pftPreAuthReq->currbssId, - (void *)psessionEntry->bssId, 6); - vos_mem_copy((void *) &pftPreAuthReq->preAuthbssId, - (void *)macAddr, 6); - pftPreAuthReq->ft_ies_length = (tANI_U16)pMac->ft.ftSmeContext.auth_ft_ies_length; - - // Also setup the mac address in sme context. - vos_mem_copy(pMac->ft.ftSmeContext.preAuthbssId, macAddr, 6); - - vos_mem_copy(pftPreAuthReq->ft_ies, pMac->ft.ftSmeContext.auth_ft_ies, - pMac->ft.ftSmeContext.auth_ft_ies_length); - - vos_mem_copy(Profile.pBssDesc->bssId, macAddr, 6); - - p += log_sprintf( pMac,p, "\n ----- LIM Debug Information ----- \n"); - p += log_sprintf( pMac, p, "%s: length = %d\n", __func__, - (int)pMac->ft.ftSmeContext.auth_ft_ies_length); - p += log_sprintf( pMac, p, "%s: length = %02x\n", __func__, - (int)pMac->ft.ftSmeContext.auth_ft_ies[0]); - p += log_sprintf( pMac, p, "%s: Auth Req %02x %02x %02x\n", - __func__, pftPreAuthReq->ft_ies[0], - pftPreAuthReq->ft_ies[1], pftPreAuthReq->ft_ies[2]); - - p += log_sprintf( pMac, p, "%s: Session %02x %02x %02x\n", __func__, - psessionEntry->bssId[0], - psessionEntry->bssId[1], psessionEntry->bssId[2]); - p += log_sprintf( pMac, p, "%s: Session %02x %02x %02x %p\n", __func__, - pftPreAuthReq->currbssId[0], - pftPreAuthReq->currbssId[1], - pftPreAuthReq->currbssId[2], pftPreAuthReq); - - Profile.pBssDesc->channelId = (tANI_U8)arg3; - vos_mem_copy((void *)pftPreAuthReq->pbssDescription, (void *)Profile.pBssDesc, - Profile.pBssDesc->length); - - msg.type = eWNI_SME_FT_PRE_AUTH_REQ; - msg.bodyptr = pftPreAuthReq; - msg.bodyval = 0; - - p += log_sprintf( pMac, p, "limPostMsgApi(eWNI_SME_FT_PRE_AUTH_REQ) \n"); - limPostMsgApi(pMac, &msg); - } - break; + pftPreAuthReq = vos_mem_malloc(auth_req_len); + if (NULL == pftPreAuthReq) + { + p += log_sprintf( pMac, p, + "Pre auth dump: AllocateMemory() failed \n"); + return p; + } + pftPreAuthReq->pbssDescription = + vos_mem_malloc(sizeof(Profile.pBssDesc->length)+ + Profile.pBssDesc->length); + + pftPreAuthReq->messageType = eWNI_SME_FT_PRE_AUTH_REQ; + pftPreAuthReq->length = + auth_req_len + sizeof(Profile.pBssDesc->length) + + Profile.pBssDesc->length; + pftPreAuthReq->preAuthchannelNum = 6; + + vos_mem_copy((void *) &pftPreAuthReq->currbssId, + (void *)psessionEntry->bssId, 6); + vos_mem_copy((void *) &pftPreAuthReq->preAuthbssId, + (void *)macAddr, 6); + pftPreAuthReq->ft_ies_length = + (tANI_U16)pMac->roam.roamSession[smeSessionId].ftSmeContext.auth_ft_ies_length; + + // Also setup the mac address in sme context. + vos_mem_copy( + pMac->roam.roamSession[smeSessionId].ftSmeContext.preAuthbssId, + macAddr, 6); + + vos_mem_copy(pftPreAuthReq->ft_ies, + pMac->roam.roamSession[smeSessionId].ftSmeContext.auth_ft_ies, + pMac->roam.roamSession[smeSessionId].ftSmeContext.auth_ft_ies_length); + + vos_mem_copy(Profile.pBssDesc->bssId, macAddr, 6); + + p += log_sprintf( pMac, p, + "\n ----- LIM Debug Information ----- \n"); + p += log_sprintf( pMac, p, "%s: length = %d\n", __func__, + (int)pMac->roam.roamSession[smeSessionId].ftSmeContext.auth_ft_ies_length); + p += log_sprintf( pMac, p, "%s: length = %02x\n", __func__, + (int)pMac->roam.roamSession[smeSessionId].ftSmeContext.auth_ft_ies[0]); + p += log_sprintf( pMac, p, "%s: Auth Req %02x %02x %02x\n", + __func__, pftPreAuthReq->ft_ies[0], + pftPreAuthReq->ft_ies[1], pftPreAuthReq->ft_ies[2]); + + p += log_sprintf( pMac, p, "%s: Session %02x %02x %02x\n", __func__, + psessionEntry->bssId[0], + psessionEntry->bssId[1], psessionEntry->bssId[2]); + p += log_sprintf( pMac, p, "%s: Session %02x %02x %02x %p\n", + __func__, + pftPreAuthReq->currbssId[0], + pftPreAuthReq->currbssId[1], + pftPreAuthReq->currbssId[2], pftPreAuthReq); + + Profile.pBssDesc->channelId = (tANI_U8)arg3; + vos_mem_copy((void *)pftPreAuthReq->pbssDescription, + (void *)Profile.pBssDesc, + Profile.pBssDesc->length); + + msg.type = eWNI_SME_FT_PRE_AUTH_REQ; + msg.bodyptr = pftPreAuthReq; + msg.bodyval = 0; + + p += log_sprintf(pMac, p, + "limPostMsgApi(eWNI_SME_FT_PRE_AUTH_REQ) \n"); + limPostMsgApi(pMac, &msg); + } + break; - default: - break; - } - return p; + default: + break; + } + return p; } #endif static char * diff --git a/CORE/MAC/src/pe/lim/limProcessActionFrame.c b/CORE/MAC/src/pe/lim/limProcessActionFrame.c index b09e89d7b5d8..0f17cd205f0c 100644 --- a/CORE/MAC/src/pe/lim/limProcessActionFrame.c +++ b/CORE/MAC/src/pe/lim/limProcessActionFrame.c @@ -96,7 +96,7 @@ void limStopTxAndSwitchChannel(tpAniSirGlobal pMac, tANI_U8 sessionId) if( NULL == psessionEntry ) { - limLog(pMac, LOGE, FL("Session %d not active\n "), sessionId); + limLog(pMac, LOGE, FL("Session %d not active"), sessionId); return; } diff --git a/CORE/MAC/src/pe/lim/limProcessAuthFrame.c b/CORE/MAC/src/pe/lim/limProcessAuthFrame.c index 3fd85ded66d9..3667812d02d9 100644 --- a/CORE/MAC/src/pe/lim/limProcessAuthFrame.c +++ b/CORE/MAC/src/pe/lim/limProcessAuthFrame.c @@ -1000,21 +1000,22 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) && (psessionEntry->limSmeState == eLIM_SME_WT_REASSOC_STATE) && (pRxAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS) && - (pMac->ft.ftPEContext.pFTPreAuthReq != NULL) && - (vos_mem_compare(pMac->ft.ftPEContext.pFTPreAuthReq->preAuthbssId, - pHdr->sa, sizeof(tSirMacAddr)))) + (psessionEntry->ftPEContext.pFTPreAuthReq != NULL) && + (vos_mem_compare( + psessionEntry->ftPEContext.pFTPreAuthReq->preAuthbssId, + pHdr->sa, sizeof(tSirMacAddr)))) { // Update the FTIEs in the saved auth response PELOGW(limLog(pMac, LOGW, FL("received another PreAuth frame2" " from peer " MAC_ADDRESS_STR" in Smestate %d"), MAC_ADDR_ARRAY(pHdr->sa), psessionEntry->limSmeState);) - pMac->ft.ftPEContext.saved_auth_rsp_length = 0; + psessionEntry->ftPEContext.saved_auth_rsp_length = 0; if ((pBody != NULL) && (frameLen < MAX_FTIE_SIZE)) { - vos_mem_copy(pMac->ft.ftPEContext.saved_auth_rsp, + vos_mem_copy(psessionEntry->ftPEContext.saved_auth_rsp, pBody, frameLen); - pMac->ft.ftPEContext.saved_auth_rsp_length = frameLen; + psessionEntry->ftPEContext.saved_auth_rsp_length = frameLen; } } else @@ -1714,6 +1715,7 @@ tSirRetStatus limProcessAuthFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pBd, vo tSirMacAuthFrameBody rxAuthFrame; tSirMacAuthFrameBody *pRxAuthFrameBody = NULL; tSirRetStatus ret_status = eSIR_FAILURE; + int i; pHdr = WDA_GET_RX_MAC_HEADER(pBd); pBody = WDA_GET_RX_MPDU_DATA(pBd); @@ -1724,15 +1726,27 @@ tSirRetStatus limProcessAuthFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pBd, vo MAC_ADDR_ARRAY(pHdr->bssId), (uint)abs((tANI_S8)WDA_GET_RX_RSSI_DB(pBd))); - // Check for the operating channel and see what needs to be done next. - psessionEntry = pMac->ft.ftPEContext.psavedsessionEntry; + /* Auth frame has come on a new BSS, however, we need to find the session + * from where the auth-req was sent to the new AP + */ + for (i = 0; i < pMac->lim.maxBssId; i++) { + /* Find first free room in session table */ + if (pMac->lim.gpSession[i].valid == TRUE && + pMac->lim.gpSession[i].ftPEContext.ftPreAuthSession == VOS_TRUE) { + /* Found the session */ + psessionEntry = &pMac->lim.gpSession[i]; + pMac->lim.gpSession[i].ftPEContext.ftPreAuthSession = VOS_FALSE; + } + } + if (psessionEntry == NULL) { - limLog(pMac, LOGE, FL("Error: Unable to find session id while in pre-auth phase for FT")); + limLog(pMac, LOGE, + FL("Error: Unable to find session id while in pre-auth phase for FT")); return eSIR_FAILURE; } - if (pMac->ft.ftPEContext.pFTPreAuthReq == NULL) + if (psessionEntry->ftPEContext.pFTPreAuthReq == NULL) { limLog(pMac, LOGE, FL("Error: No FT")); // No FT in progress. @@ -1746,7 +1760,8 @@ tSirRetStatus limProcessAuthFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pBd, vo } #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG limPrintMacAddr(pMac, pHdr->bssId, LOG2); - limPrintMacAddr(pMac, pMac->ft.ftPEContext.pFTPreAuthReq->preAuthbssId, LOG2); + limPrintMacAddr(pMac, + psessionEntry->ftPEContext.pFTPreAuthReq->preAuthbssId, LOG2); limLog(pMac,LOG2,FL("seqControl 0x%X"), ((pHdr->seqControl.seqNumHi << 8) | (pHdr->seqControl.seqNumLo << 4) | @@ -1754,7 +1769,7 @@ tSirRetStatus limProcessAuthFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pBd, vo #endif // Check that its the same bssId we have for preAuth - if (!vos_mem_compare(pMac->ft.ftPEContext.pFTPreAuthReq->preAuthbssId, + if (!vos_mem_compare(psessionEntry->ftPEContext.pFTPreAuthReq->preAuthbssId, pHdr->bssId, sizeof( tSirMacAddr ))) { limLog(pMac, LOGE, FL("Error: Same bssid as preauth BSSID")); @@ -1764,7 +1779,7 @@ tSirRetStatus limProcessAuthFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pBd, vo } if (eANI_BOOLEAN_TRUE == - pMac->ft.ftPEContext.pFTPreAuthReq->bPreAuthRspProcessed) + psessionEntry->ftPEContext.pFTPreAuthReq->bPreAuthRspProcessed) { /* * This is likely a duplicate for the same pre-auth request. @@ -1785,15 +1800,15 @@ tSirRetStatus limProcessAuthFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pBd, vo */ PELOGE(limLog(pMac,LOG1,"Auth rsp already posted to SME" " (session %p, FT session %p)", psessionEntry, - pMac->ft.ftPEContext.pftSessionEntry);); + psessionEntry);); return eSIR_SUCCESS; } else { PELOGE(limLog(pMac,LOGW,"Auth rsp not yet posted to SME" " (session %p, FT session %p)", psessionEntry, - pMac->ft.ftPEContext.pftSessionEntry);); - pMac->ft.ftPEContext.pFTPreAuthReq->bPreAuthRspProcessed = + psessionEntry);); + psessionEntry->ftPEContext.pFTPreAuthReq->bPreAuthRspProcessed = eANI_BOOLEAN_TRUE; } diff --git a/CORE/MAC/src/pe/lim/limProcessLmmMessages.c b/CORE/MAC/src/pe/lim/limProcessLmmMessages.c index 95ce621f817a..5148c3f48641 100644 --- a/CORE/MAC/src/pe/lim/limProcessLmmMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessLmmMessages.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -49,4 +49,7 @@ #include "limAssocUtils.h" #include "limSerDesUtils.h" #include "limPropExtsUtils.h" +#ifdef WLAN_FEATURE_VOWIFI_11R +#include "limFTDefs.h" +#endif #include "limSession.h" diff --git a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c index bbd1c18f3b02..287511773064 100644 --- a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c +++ b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c @@ -55,6 +55,9 @@ #include "pmmApi.h" #include "limIbssPeerMgmt.h" #include "schApi.h" +#ifdef WLAN_FEATURE_VOWIFI_11R +#include "limFTDefs.h" +#endif #include "limSession.h" #include "limSendMessages.h" @@ -564,9 +567,8 @@ limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg) #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if ( WDA_GET_ROAMCANDIDATEIND(pRxPacketInfo)) { - limLog( pMac, LOG2, FL("Notify SME with candidate ind")); - //send a session 0 for now - TBD - limSendSmeCandidateFoundInd(pMac, 0); + limLog(pMac, LOG2, FL("Notify SME with candidate ind")); + limSendSmeCandidateFoundInd(pMac, WDA_GET_SESSIONID(pRxPacketInfo)); goto end; } if (WDA_GET_OFFLOADSCANLEARN(pRxPacketInfo)) @@ -1515,14 +1517,14 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) tANI_U8 sessionId; if((psessionEntry = peFindSessionByStaId(pMac,pTdlsInd->staIdx,&sessionId))== NULL) { - limLog(pMac, LOG1, FL("session does not exist for given bssId\n")); + limLog(pMac, LOG1, FL("session does not exist for given bssId")); vos_mem_free(limMsg->bodyptr); limMsg->bodyptr = NULL; return; } if ((pStaDs = dphGetHashEntry(pMac, pTdlsInd->assocId, &psessionEntry->dph.dphHashTable)) == NULL) { - limLog(pMac, LOG1, FL("pStaDs Does not exist for given staId\n")); + limLog(pMac, LOG1, FL("pStaDs Does not exist for given staId")); vos_mem_free(limMsg->bodyptr); limMsg->bodyptr = NULL; return; @@ -2107,10 +2109,11 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) pTdlsLinkEstablishParams->staIdx, &sessionId))== NULL) { - limLog(pMac, LOGE, FL("session %u does not exist.\n"), sessionId); - /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP message to SME - with session id as zero and status as FAILURE so, that message - queued in SME queue can be freed to prevent the SME cmd buffer leak */ + limLog(pMac, LOGE, FL("session %u does not exist"), sessionId); + /* Still send the eWNI_SME_TDLS_LINK_ESTABLISH_RSP message to + * SME with session id as zero and status as FAILURE so, + * that message queued in SME queue can be freed to prevent + * the SME cmd buffer leak */ limSendSmeTdlsLinkEstablishReqRsp(pMac, 0, NULL, diff --git a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c index 4e319fbce53c..86556aaeccbf 100644 --- a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c @@ -151,7 +151,7 @@ limProcessMlmReqMessages(tpAniSirGlobal pMac, tpSirMsgQ Msg) case SIR_LIM_AUTH_RSP_TIMEOUT: limProcessAuthRspTimeout(pMac, Msg->bodyval); break; case SIR_LIM_ASSOC_FAIL_TIMEOUT: limProcessAssocFailureTimeout(pMac, Msg->bodyval); break; #ifdef WLAN_FEATURE_VOWIFI_11R - case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT:limProcessFTPreauthRspTimeout(pMac); break; + case SIR_LIM_FT_PREAUTH_RSP_TIMEOUT: limProcessFTPreauthRspTimeout(pMac); break; #endif case SIR_LIM_REMAIN_CHN_TIMEOUT: limProcessRemainOnChnTimeout(pMac); break; case SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT: diff --git a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c index fc17889c6943..cbfbd82bfb3f 100644 --- a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c @@ -50,14 +50,15 @@ #include "limAdmitControl.h" #include "limSendMessages.h" #include "limIbssPeerMgmt.h" +#ifdef WLAN_FEATURE_VOWIFI_11R +#include "limFT.h" +#include "limFTDefs.h" +#endif #include "limSession.h" #include "limSessionUtils.h" #if defined WLAN_FEATURE_VOWIFI #include "rrmApi.h" #endif -#if defined WLAN_FEATURE_VOWIFI_11R -#include <limFT.h> -#endif #include "wlan_qct_wda.h" #include "vos_utils.h" @@ -1907,6 +1908,8 @@ void limProcessStaMlmAddStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ,tpPESess tpDphHashNode pStaDs; tANI_U32 mesgType = LIM_MLM_ASSOC_CNF; tpAddStaParams pAddStaParams = (tpAddStaParams) limMsgQ->bodyptr; + tpPESession pftSessionEntry = NULL; + tANI_U8 ftSessionId; if(NULL == pAddStaParams ) { @@ -1941,12 +1944,15 @@ void limProcessStaMlmAddStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ,tpPESess { #ifdef WLAN_FEATURE_VOWIFI_11R // Check if we have keys (PTK) to install in case of 11r - tpftPEContext pftPECntxt = &pMac->ft.ftPEContext; - if (pftPECntxt->pftSessionEntry != NULL && + tpftPEContext pftPECntxt = &psessionEntry->ftPEContext; + pftSessionEntry = peFindSessionByBssid(pMac, + psessionEntry->limReAssocbssId, + &ftSessionId); + if (pftSessionEntry != NULL && pftPECntxt->PreAuthKeyInfo.extSetStaKeyParamValid == TRUE) { tpLimMlmSetKeysReq pMlmStaKeys = &pftPECntxt->PreAuthKeyInfo.extSetStaKeyParam; - limSendSetStaKeyReq(pMac, pMlmStaKeys, 0, 0, pftPECntxt->pftSessionEntry, FALSE); + limSendSetStaKeyReq(pMac, pMlmStaKeys, 0, 0, pftSessionEntry, FALSE); pftPECntxt->PreAuthKeyInfo.extSetStaKeyParamValid = FALSE; } #endif @@ -2840,11 +2846,6 @@ limProcessStaMlmAddBssRspFT(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ, tpPESession PELOGE(limLog(pMac, LOGE, FL("Invalid parameters"));) goto end; } - if((psessionEntry = peFindSessionBySessionId(pMac,pAddBssParams->sessionId))== NULL) - { - limLog( pMac, LOGE, FL( "Session Does not exist for given sessionId" )); - goto end; - } if ( eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE != psessionEntry->limMlmState ) { goto end; @@ -2945,6 +2946,7 @@ limProcessStaMlmAddBssRspFT(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ, tpPESession /* Update PE session ID */ pAddStaParams->sessionId = psessionEntry->peSessionId; + pAddStaParams->smesessionId = psessionEntry->smeSessionId; // This will indicate HAL to "allocate" a new STA index #ifdef WLAN_FEATURE_ROAM_OFFLOAD @@ -3015,7 +3017,7 @@ limProcessStaMlmAddBssRspFT(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ, tpPESession pAddStaParams->maxTxPower = psessionEntry->maxTxPower; // Lets save this for when we receive the Reassoc Rsp - pMac->ft.ftPEContext.pAddStaReq = pAddStaParams; + psessionEntry->ftPEContext.pAddStaReq = pAddStaParams; if (pAddBssParams != NULL) { @@ -5033,13 +5035,14 @@ limSendBeaconInd(tpAniSirGlobal pMac, tpPESession psessionEntry){ * * @return None */ -void limSendSmeScanCacheUpdatedInd(void) +void limSendSmeScanCacheUpdatedInd(tANI_U8 sessionId) { vos_msg_t msg; msg.type = WDA_SME_SCAN_CACHE_UPDATED; msg.reserved = 0; msg.bodyptr = NULL; + msg.bodyval = sessionId; if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, @@ -5068,7 +5071,7 @@ void limSendScanOffloadComplete(tpAniSirGlobal pMac, pScanEvent->sessionId, 0); #ifdef FEATURE_WLAN_SCAN_PNO - limSendSmeScanCacheUpdatedInd(); + limSendSmeScanCacheUpdatedInd(pScanEvent->sessionId); #endif } diff --git a/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c b/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c index f47e8358e0be..ff03fe53bb08 100644 --- a/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c +++ b/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -46,6 +46,9 @@ #include "limAssocUtils.h" #include "limSerDesUtils.h" #include "parserApi.h" +#ifdef WLAN_FEATURE_VOWIFI_11R +#include "limFTDefs.h" +#endif #include "limSession.h" #ifdef WLAN_FEATURE_P2P_INTERNAL diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c index ee8daf62adc9..1d63dd12f4c2 100644 --- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c @@ -2320,10 +2320,9 @@ __limProcessSmeReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) // Make sure its our preauth bssid if (!vos_mem_compare( pReassocReq->bssDescription.bssId, - pMac->ft.ftPEContext.pFTPreAuthReq->preAuthbssId, 6)) + psessionEntry->limReAssocbssId, 6)) { limPrintMacAddr(pMac, pReassocReq->bssDescription.bssId, LOGE); - limPrintMacAddr(pMac, pMac->ft.ftPEContext.pFTPreAuthReq->preAuthbssId, LOGE); limLog(pMac, LOGP, FL("Unknown bssId in reassoc state")); retCode = eSIR_SME_INVALID_PARAMETERS; goto end; @@ -2396,21 +2395,7 @@ __limProcessSmeReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) psessionEntry->maxTxPower ); #endif { - #if 0 - if (wlan_cfgGetStr(pMac, WNI_CFG_SSID, pMac->lim.gLimReassocSSID.ssId, - &cfgLen) != eSIR_SUCCESS) - { - /// Could not get SSID from CFG. Log error. - limLog(pMac, LOGP, FL("could not retrive SSID")); - } - #endif//TO SUPPORT BT-AMP - /* Copy the SSID from sessio entry to local variable */ - #if 0 - vos_mem_copy( pMac->lim.gLimReassocSSID.ssId, - psessionEntry->ssId.ssId, - psessionEntry->ssId.length); - #endif psessionEntry->limReassocSSID.length = pReassocReq->ssId.length; vos_mem_copy( psessionEntry->limReassocSSID.ssId, pReassocReq->ssId.ssId, psessionEntry->limReassocSSID.length); @@ -2898,8 +2883,11 @@ __limProcessSmeDisassocCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) MAC_ADDR_ARRAY(smeDisassocCnf.peerMacAddr));) return; } + +#if defined WLAN_FEATURE_VOWIFI_11R /* Delete FT session if there exists one */ - limFTCleanup(pMac); + limFTCleanupPreAuthInfo(pMac, psessionEntry); +#endif limCleanupRxPath(pMac, pStaDs, psessionEntry); limCleanUpDisassocDeauthReq(pMac, (char*)&smeDisassocCnf.peerMacAddr, 0); @@ -6349,7 +6337,7 @@ limProcessSmeChannelChangeRequest(tpAniSirGlobal pMac, tANI_U32 *pMsg) pChannelChangeReq->targetChannel; limSetChannel(pMac, pChannelChangeReq->targetChannel, - pChannelChangeReq->cbMode, + psessionEntry->htSecondaryChannelOffset, maxTxPwr, psessionEntry->peSessionId); #endif diff --git a/CORE/MAC/src/pe/lim/limPropExtsUtils.c b/CORE/MAC/src/pe/lim/limPropExtsUtils.c index 95474ed4d9c7..2990b226dc1f 100644 --- a/CORE/MAC/src/pe/lim/limPropExtsUtils.c +++ b/CORE/MAC/src/pe/lim/limPropExtsUtils.c @@ -51,6 +51,9 @@ #include "limPropExtsUtils.h" #include "limSerDesUtils.h" #include "limTrace.h" +#ifdef WLAN_FEATURE_VOWIFI_11R +#include "limFTDefs.h" +#endif #include "limSession.h" #define LIM_GET_NOISE_MAX_TRY 5 /** diff --git a/CORE/MAC/src/pe/lim/limScanResultUtils.c b/CORE/MAC/src/pe/lim/limScanResultUtils.c index e14b13073fe0..f8d884da4701 100644 --- a/CORE/MAC/src/pe/lim/limScanResultUtils.c +++ b/CORE/MAC/src/pe/lim/limScanResultUtils.c @@ -39,6 +39,9 @@ #include "limUtils.h" #include "limSerDesUtils.h" #include "limApi.h" +#ifdef WLAN_FEATURE_VOWIFI_11R +#include "limFTDefs.h" +#endif #include "limSession.h" #if defined WLAN_FEATURE_VOWIFI #include "rrmApi.h" diff --git a/CORE/MAC/src/pe/lim/limSecurityUtils.c b/CORE/MAC/src/pe/lim/limSecurityUtils.c index fe8f15f7072c..9cd9567c0c2b 100644 --- a/CORE/MAC/src/pe/lim/limSecurityUtils.c +++ b/CORE/MAC/src/pe/lim/limSecurityUtils.c @@ -47,6 +47,9 @@ #include "utilsApi.h" #include "limUtils.h" #include "limSecurityUtils.h" +#ifdef WLAN_FEATURE_VOWIFI_11R +#include "limFTDefs.h" +#endif #include "limSession.h" diff --git a/CORE/MAC/src/pe/lim/limSendManagementFrames.c b/CORE/MAC/src/pe/lim/limSendManagementFrames.c index 4c8edf6e0efc..244472a14745 100644 --- a/CORE/MAC/src/pe/lim/limSendManagementFrames.c +++ b/CORE/MAC/src/pe/lim/limSendManagementFrames.c @@ -53,6 +53,9 @@ #include "wniCfgAp.h" #endif +#ifdef WLAN_FEATURE_VOWIFI_11R +#include "limFTDefs.h" +#endif #include "limSession.h" #include "vos_types.h" #include "vos_trace.h" @@ -2592,16 +2595,14 @@ limSendReassocReqWithFTIEsMgmtFrame(tpAniSirGlobal pMac, tANI_BOOLEAN isVHTEnabled = eANI_BOOLEAN_FALSE; tpSirMacMgmtHdr pMacHdr; - if (NULL == psessionEntry) - { + if (NULL == psessionEntry) { return; } smeSessionId = psessionEntry->smeSessionId; /* check this early to avoid unncessary operation */ - if(NULL == psessionEntry->pLimReAssocReq) - { + if(NULL == psessionEntry->pLimReAssocReq) { return; } nAddIELen = psessionEntry->pLimReAssocReq->addIEAssoc.length; @@ -2629,8 +2630,12 @@ limSendReassocReqWithFTIEsMgmtFrame(tpAniSirGlobal pMac, frm.ListenInterval.interval = pMlmReassocReq->listenInterval; // Get the old bssid of the older AP. - vos_mem_copy( ( tANI_U8* )frm.CurrentAPAddress.mac, - pMac->ft.ftPEContext.pFTPreAuthReq->currbssId, 6); + if (NULL != psessionEntry->ftPEContext.pFTPreAuthReq) + { + vos_mem_copy( ( tANI_U8* )frm.CurrentAPAddress.mac, + psessionEntry->ftPEContext.pFTPreAuthReq->currbssId, + sizeof(tSirMacAddr)); + } PopulateDot11fSSID2( pMac, &frm.SSID ); PopulateDot11fSuppRates( pMac, POPULATE_DOT11F_RATES_OPERATIONAL, @@ -2651,8 +2656,10 @@ limSendReassocReqWithFTIEsMgmtFrame(tpAniSirGlobal pMac, #if defined WLAN_FEATURE_VOWIFI PowerCapsPopulated = TRUE; - PopulateDot11fPowerCaps( pMac, &frm.PowerCaps, LIM_REASSOC,psessionEntry); - PopulateDot11fSuppChannels( pMac, &frm.SuppChannels, LIM_REASSOC,psessionEntry); + PopulateDot11fPowerCaps(pMac, &frm.PowerCaps, + LIM_REASSOC,psessionEntry); + PopulateDot11fSuppChannels(pMac, &frm.SuppChannels, LIM_REASSOC, + psessionEntry); #endif } @@ -2805,7 +2812,7 @@ limSendReassocReqWithFTIEsMgmtFrame(tpAniSirGlobal pMac, #if defined WLAN_FEATURE_VOWIFI_11R if ( psessionEntry->pLimReAssocReq->bssDescription.mdiePresent && - (pMac->ft.ftSmeContext.addMDIE == TRUE) + (pMac->roam.roamSession[smeSessionId].ftSmeContext.addMDIE == TRUE) #if defined FEATURE_WLAN_ESE && !psessionEntry->isESEconnection #endif @@ -2846,13 +2853,14 @@ limSendReassocReqWithFTIEsMgmtFrame(tpAniSirGlobal pMac, #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG limLog( pMac, LOG1, FL("FT IE Reassoc Req (%d)."), - pMac->ft.ftSmeContext.reassoc_ft_ies_length); + pMac->roam.roamSession[smeSessionId].ftSmeContext.reassoc_ft_ies_length); #endif #if defined WLAN_FEATURE_VOWIFI_11R if (psessionEntry->is11Rconnection) { - ft_ies_length = pMac->ft.ftSmeContext.reassoc_ft_ies_length; + ft_ies_length = + pMac->roam.roamSession[smeSessionId].ftSmeContext.reassoc_ft_ies_length; } #endif @@ -2936,19 +2944,18 @@ limSendReassocReqWithFTIEsMgmtFrame(tpAniSirGlobal pMac, psessionEntry->assocReqLen = nPayload; } - if (psessionEntry->is11Rconnection) - { + if (psessionEntry->is11Rconnection && + pMac->roam.roamSession[smeSessionId].ftSmeContext.reassoc_ft_ies) { int i = 0; pBody = pFrame + nBytes; for (i=0; i<ft_ies_length; i++) { - *pBody = pMac->ft.ftSmeContext.reassoc_ft_ies[i]; + *pBody = pMac->roam.roamSession[smeSessionId].ftSmeContext.reassoc_ft_ies[i]; pBody++; } } - } #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG PELOGE(limLog(pMac, LOG1, FL("Re-assoc Req Frame is: ")); @@ -2981,7 +2988,8 @@ limSendReassocReqWithFTIEsMgmtFrame(tpAniSirGlobal pMac, else { //Store the Assoc request. This is sent to csr/hdd in join cnf response. - vos_mem_copy( psessionEntry->assocReq, pMac->ft.ftSmeContext.reassoc_ft_ies, + vos_mem_copy( psessionEntry->assocReq, + pMac->roam.roamSession[smeSessionId].ftSmeContext.reassoc_ft_ies, (ft_ies_length)); psessionEntry->assocReqLen = (ft_ies_length); } @@ -3477,18 +3485,20 @@ limSendAuthMgmtFrame(tpAniSirGlobal pMac, #if defined WLAN_FEATURE_VOWIFI_11R if (pAuthFrameBody->authAlgoNumber == eSIR_FT_AUTH) { - if (0 != pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length) - { - frameLen += pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length; - limLog(pMac, LOG3, FL("Auth frame, FTIES length added=%d"), - pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length); - } - else - { - limLog(pMac, LOG3, FL("Auth frame, Does not contain " - "FTIES!!!")); - frameLen += (2+SIR_MDIE_SIZE); - } + if (NULL != psessionEntry->ftPEContext.pFTPreAuthReq && + 0 != psessionEntry->ftPEContext.pFTPreAuthReq->ft_ies_length) + { + frameLen += + psessionEntry->ftPEContext.pFTPreAuthReq->ft_ies_length; + limLog(pMac, LOG3, FL("Auth frame, FTIES length added=%d"), + psessionEntry->ftPEContext.pFTPreAuthReq->ft_ies_length); + } + else + { + limLog(pMac, LOG3, FL("Auth frame, Does not contain " + "FTIES!!!")); + frameLen += (2+SIR_MDIE_SIZE); + } } #endif break; @@ -3496,7 +3506,8 @@ limSendAuthMgmtFrame(tpAniSirGlobal pMac, case SIR_MAC_AUTH_FRAME_2: if ((pAuthFrameBody->authAlgoNumber == eSIR_OPEN_SYSTEM) || ((pAuthFrameBody->authAlgoNumber == eSIR_SHARED_KEY) && - (pAuthFrameBody->authStatusCode != eSIR_MAC_SUCCESS_STATUS))) + (pAuthFrameBody->authStatusCode != + eSIR_MAC_SUCCESS_STATUS))) { /** * Allocate buffer for Authenticaton frame of size @@ -3587,7 +3598,8 @@ limSendAuthMgmtFrame(tpAniSirGlobal pMac, pMacHdr->fc.wep = wepBit; // Prepare BSSId - if( (psessionEntry->limSystemRole == eLIM_AP_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) ) + if ((psessionEntry->limSystemRole == eLIM_AP_ROLE)|| + (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) ) { vos_mem_copy( (tANI_U8 *) pMacHdr->bssId, (tANI_U8 *) psessionEntry->bssId, @@ -3599,88 +3611,100 @@ limSendAuthMgmtFrame(tpAniSirGlobal pMac, if (wepBit == LIM_WEP_IN_FC) { - vos_mem_copy(pBody, (tANI_U8 *) pAuthFrameBody, bodyLen); + vos_mem_copy(pBody, (tANI_U8 *) pAuthFrameBody, bodyLen); - PELOG1(limLog(pMac, LOG1, - FL("*** Sending Auth seq# 3 status %d (%d) to"MAC_ADDRESS_STR), - pAuthFrameBody->authStatusCode, - (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS), - MAC_ADDR_ARRAY(pMacHdr->da));) + PELOG1(limLog(pMac, LOG1, + FL("*** Sending Auth seq# 3 status %d (%d) to"MAC_ADDRESS_STR), + pAuthFrameBody->authStatusCode, + (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS), + MAC_ADDR_ARRAY(pMacHdr->da));) } else { - *((tANI_U16 *)(pBody)) = sirSwapU16ifNeeded(pAuthFrameBody->authAlgoNumber); - pBody += sizeof(tANI_U16); - bodyLen -= sizeof(tANI_U16); - - *((tANI_U16 *)(pBody)) = sirSwapU16ifNeeded(pAuthFrameBody->authTransactionSeqNumber); - pBody += sizeof(tANI_U16); - bodyLen -= sizeof(tANI_U16); - - *((tANI_U16 *)(pBody)) = sirSwapU16ifNeeded(pAuthFrameBody->authStatusCode); - pBody += sizeof(tANI_U16); - bodyLen -= sizeof(tANI_U16); - if ( bodyLen <= (sizeof (pAuthFrameBody->type) + - sizeof (pAuthFrameBody->length) + - sizeof (pAuthFrameBody->challengeText))) - vos_mem_copy(pBody, (tANI_U8 *) &pAuthFrameBody->type, bodyLen); + *((tANI_U16 *)(pBody)) = + sirSwapU16ifNeeded(pAuthFrameBody->authAlgoNumber); + pBody += sizeof(tANI_U16); + bodyLen -= sizeof(tANI_U16); + + *((tANI_U16 *)(pBody)) = + sirSwapU16ifNeeded(pAuthFrameBody->authTransactionSeqNumber); + pBody += sizeof(tANI_U16); + bodyLen -= sizeof(tANI_U16); + + *((tANI_U16 *)(pBody)) = + sirSwapU16ifNeeded(pAuthFrameBody->authStatusCode); + pBody += sizeof(tANI_U16); + bodyLen -= sizeof(tANI_U16); + if ( bodyLen <= (sizeof (pAuthFrameBody->type) + + sizeof (pAuthFrameBody->length) + + sizeof (pAuthFrameBody->challengeText))) + vos_mem_copy(pBody, (tANI_U8 *) &pAuthFrameBody->type, bodyLen); #if defined WLAN_FEATURE_VOWIFI_11R - if ((pAuthFrameBody->authAlgoNumber == eSIR_FT_AUTH) && - (pAuthFrameBody->authTransactionSeqNumber == SIR_MAC_AUTH_FRAME_1)) - { + if ((pAuthFrameBody->authAlgoNumber == eSIR_FT_AUTH) && + (pAuthFrameBody->authTransactionSeqNumber == SIR_MAC_AUTH_FRAME_1)) + { - { - int i = 0; - if (pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length) - { + int i = 0; + if (NULL != psessionEntry->ftPEContext.pFTPreAuthReq) + { + if (psessionEntry->ftPEContext.pFTPreAuthReq->ft_ies_length) + { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - PELOG2(limLog(pMac, LOG2, FL("Auth1 Frame FTIE is: ")); - sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2, - (tANI_U8 *)pBody, - (pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length));) + PELOG2(limLog(pMac, LOG2, FL("Auth1 Frame FTIE is: ")); + sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2, + (tANI_U8 *)pBody, + (psessionEntry->ftPEContext.pFTPreAuthReq->ft_ies_length));) #endif - for (i=0; i<pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies_length; i++) - { - *pBody = pMac->ft.ftPEContext.pFTPreAuthReq->ft_ies[i]; - pBody++; - } - } - else + for (i = 0; + i < psessionEntry->ftPEContext.pFTPreAuthReq->ft_ies_length; + i++) + { + *pBody = + psessionEntry->ftPEContext.pFTPreAuthReq->ft_ies[i]; + pBody++; + } + } + else + { + /* MDID attr is 54*/ + *pBody = 54; + pBody++; + *pBody = SIR_MDIE_SIZE; + pBody++; + if (NULL != + psessionEntry->ftPEContext.pFTPreAuthReq->pbssDescription) { - /* MDID attr is 54*/ - *pBody = 54; - pBody++; - *pBody = SIR_MDIE_SIZE; - pBody++; - for(i=0;i<SIR_MDIE_SIZE;i++) - { - *pBody = pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription->mdie[i]; - pBody++; - } + for(i=0;i<SIR_MDIE_SIZE;i++) + { + *pBody = psessionEntry->ftPEContext.pFTPreAuthReq->pbssDescription->mdie[i]; + pBody++; + } } - } - } + } + } + } #endif - PELOG1(limLog(pMac, LOG1, - FL("*** Sending Auth seq# %d status %d (%d) to "MAC_ADDRESS_STR), - pAuthFrameBody->authTransactionSeqNumber, - pAuthFrameBody->authStatusCode, - (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS), - MAC_ADDR_ARRAY(pMacHdr->da));) + PELOG1(limLog(pMac, LOG1, + FL("*** Sending Auth seq# %d status %d (%d) to "MAC_ADDRESS_STR), + pAuthFrameBody->authTransactionSeqNumber, + pAuthFrameBody->authStatusCode, + (pAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS), + MAC_ADDR_ARRAY(pMacHdr->da));) } PELOG2(sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2, pFrame, frameLen);) - if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) - || ( psessionEntry->pePersona == VOS_P2P_CLIENT_MODE ) || - ( psessionEntry->pePersona == VOS_P2P_GO_MODE) -#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) - || ((NULL != pMac->ft.ftPEContext.pFTPreAuthReq) - && ( SIR_BAND_5_GHZ == limGetRFBand(pMac->ft.ftPEContext.pFTPreAuthReq->preAuthchannelNum))) + if( (SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel)) || + (psessionEntry->pePersona == VOS_P2P_CLIENT_MODE) || + (psessionEntry->pePersona == VOS_P2P_GO_MODE) +#if defined(WLAN_FEATURE_VOWIFI_11R) || defined(FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) + || ((NULL != psessionEntry->ftPEContext.pFTPreAuthReq) && + (SIR_BAND_5_GHZ == + limGetRFBand(psessionEntry->ftPEContext.pFTPreAuthReq->preAuthchannelNum))) #endif - ) + ) { txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; } @@ -3813,19 +3837,23 @@ eHalStatus limSendDisassocCnf(tpAniSirGlobal pMac) if ( (psessionEntry->limSystemRole == eLIM_STA_ROLE ) && ( #ifdef FEATURE_WLAN_ESE - (psessionEntry->isESEconnection ) || + (psessionEntry->isESEconnection ) || #endif #ifdef FEATURE_WLAN_LFR - (psessionEntry->isFastRoamIniFeatureEnabled ) || + (psessionEntry->isFastRoamIniFeatureEnabled ) || #endif - (psessionEntry->is11Rconnection )) && + (psessionEntry->is11Rconnection )) && (pMlmDisassocReq->reasonCode != eSIR_MAC_DISASSOC_DUE_TO_FTHANDOFF_REASON)) { PELOGE(limLog(pMac, LOGE, FL("FT Preauth Session (%p,%d) Cleanup"), psessionEntry, psessionEntry->peSessionId);); - limFTCleanup(pMac); + +#if defined WLAN_FEATURE_VOWIFI_11R + /* Delete FT session if there exists one */ + limFTCleanupPreAuthInfo(pMac, psessionEntry); +#endif } else { @@ -3849,7 +3877,6 @@ eHalStatus limSendDisassocCnf(tpAniSirGlobal pMac) pMlmDisassocReq->reasonCode);); } #endif - /// Free up buffer allocated for mlmDisassocReq vos_mem_free(pMlmDisassocReq); pMac->lim.limDisassocDeauthCnfReq.pMlmDisassocReq = NULL; diff --git a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c index 613210bef9fc..917f2a2a9cc2 100644 --- a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c +++ b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c @@ -3219,20 +3219,20 @@ void limSendSmeMaxAssocExceededNtf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, \sa ----------------------------------------------------------------- */ void -limSendSmeCandidateFoundInd(tpAniSirGlobal pMac, tANI_U8 sessionId) +limSendSmeCandidateFoundInd(tpAniSirGlobal pMac, tANI_U8 sessionId) { tSirMsgQ mmhMsg; tSirSmeCandidateFoundInd *pSirSmeCandidateFoundInd; pSirSmeCandidateFoundInd = vos_mem_malloc(sizeof(tSirSmeCandidateFoundInd)); - if ( NULL == pSirSmeCandidateFoundInd ) - { - limLog(pMac, LOGP, FL("AllocateMemory failed for eWNI_SME_CANDIDATE_FOUND_IND\n")); + if (NULL == pSirSmeCandidateFoundInd) { + limLog(pMac, LOGP, + FL("AllocateMemory failed for eWNI_SME_CANDIDATE_FOUND_IND")); return; } pSirSmeCandidateFoundInd->messageType = eWNI_SME_CANDIDATE_FOUND_IND; - pSirSmeCandidateFoundInd->length = sizeof(tSirSmeDisassocInd); + pSirSmeCandidateFoundInd->length = sizeof(tSirSmeCandidateFoundInd); pSirSmeCandidateFoundInd->sessionId = sessionId; diff --git a/CORE/MAC/src/pe/lim/limSession.c b/CORE/MAC/src/pe/lim/limSession.c index 2fde47292ef2..1089c9756b70 100644 --- a/CORE/MAC/src/pe/lim/limSession.c +++ b/CORE/MAC/src/pe/lim/limSession.c @@ -41,6 +41,10 @@ ------------------------------------------------------------------------*/ #include "aniGlobal.h" #include "limDebug.h" +#ifdef WLAN_FEATURE_VOWIFI_11R +#include "limFTDefs.h" +#include "limFT.h" +#endif #include "limSession.h" #include "limUtils.h" #if defined(FEATURE_WLAN_ESE) && !defined(FEATURE_WLAN_ESE_UPLOAD) @@ -252,6 +256,12 @@ tpPESession peCreateSession(tpAniSirGlobal pMac, return NULL; } } + +#if defined WLAN_FEATURE_VOWIFI_11R + if (eSIR_INFRASTRUCTURE_MODE == bssType) { + limFTOpen(pMac, &pMac->lim.gpSession[i]); + } +#endif return(&pMac->lim.gpSession[i]); } } @@ -424,6 +434,11 @@ void peDeleteSession(tpAniSirGlobal pMac, tpPESession psessionEntry) } } +#if defined (WLAN_FEATURE_VOWIFI_11R) + /* Delete FT related information */ + limFTCleanup(pMac, psessionEntry); +#endif + if (psessionEntry->pLimStartBssReq != NULL) { vos_mem_free( psessionEntry->pLimStartBssReq ); diff --git a/CORE/MAC/src/pe/lim/limSessionUtils.c b/CORE/MAC/src/pe/lim/limSessionUtils.c index 4f40ff2d0074..d3b6ddc66ac2 100644 --- a/CORE/MAC/src/pe/lim/limSessionUtils.c +++ b/CORE/MAC/src/pe/lim/limSessionUtils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -37,6 +37,9 @@ ------------------------------------------------------------------------*/ #include "aniGlobal.h" #include "limDebug.h" +#ifdef WLAN_FEATURE_VOWIFI_11R +#include "limFTDefs.h" +#endif #include "limSession.h" #include "limSessionUtils.h" #include "limUtils.h" diff --git a/CORE/MAC/src/pe/lim/limTimerUtils.c b/CORE/MAC/src/pe/lim/limTimerUtils.c index b220d96a75a1..8e25b751d9cf 100644 --- a/CORE/MAC/src/pe/lim/limTimerUtils.c +++ b/CORE/MAC/src/pe/lim/limTimerUtils.c @@ -1547,99 +1547,9 @@ limDeactivateAndChangeTimer(tpAniSirGlobal pMac, tANI_U32 timerId) break; -#if 0 - case eLIM_CHANNEL_SWITCH_TIMER: - if (tx_timer_deactivate(&pMac->lim.limTimers.gLimChannelSwitchTimer) != eSIR_SUCCESS) - { - limLog(pMac, LOGP, FL("tx_timer_deactivate failed!")); - return; - } - - if (tx_timer_change(&pMac->lim.limTimers.gLimChannelSwitchTimer, - pMac->lim.gLimChannelSwitch.switchTimeoutValue, - 0) != TX_SUCCESS) - { - limLog(pMac, LOGP, FL("tx_timer_change failed ")); - return; - } - break; -#endif - case eLIM_LEARN_DURATION_TIMER: break; -#if 0 - case eLIM_QUIET_BSS_TIMER: - if (TX_SUCCESS != - tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietBssTimer)) - { - limLog( pMac, LOGE, - FL("Unable to de-activate gLimQuietBssTimer! Will attempt to activate anyway...")); - } - - // gLimQuietDuration appears to be in units of ticks - // Use it as is - if (TX_SUCCESS != - tx_timer_change( &pMac->lim.limTimers.gLimQuietBssTimer, - pMac->lim.gLimSpecMgmt.quietDuration, - 0)) - { - limLog( pMac, LOGE, - FL("Unable to change gLimQuietBssTimer! Will still attempt to activate anyway...")); - } - break; - - case eLIM_QUIET_TIMER: - if( TX_SUCCESS != tx_timer_deactivate(&pMac->lim.limTimers.gLimQuietTimer)) - { - limLog( pMac, LOGE, - FL( "Unable to deactivate gLimQuietTimer! Will still attempt to re-activate anyway..." )); - } - - // Set the NEW timeout value, in ticks - if( TX_SUCCESS != tx_timer_change( &pMac->lim.limTimers.gLimQuietTimer, - SYS_MS_TO_TICKS(pMac->lim.gLimSpecMgmt.quietTimeoutValue), 0)) - { - limLog( pMac, LOGE, - FL( "Unable to change gLimQuietTimer! Will still attempt to re-activate anyway..." )); - } - break; -#endif - -#if 0 - case eLIM_WPS_OVERLAP_TIMER: - { - // Restart Learn Interval timer - - tANI_U32 WPSOverlapTimer = SYS_MS_TO_TICKS(LIM_WPS_OVERLAP_TIMER_MS); - - if (tx_timer_deactivate( - &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer) != TX_SUCCESS) - { - // Could not deactivate Learn Interval timer. - // Log error - limLog(pMac, LOGP, - FL("Unable to deactivate WPS overlap timer")); - } - - if (tx_timer_change( - &pMac->lim.limTimers.gLimWPSOverlapTimerObj.gLimWPSOverlapTimer, - WPSOverlapTimer, 0) != TX_SUCCESS) - { - // Could not change Learn Interval timer. - // Log error - limLog(pMac, LOGP, FL("Unable to change WPS overlap timer")); - - return; - } - - limLog( pMac, LOGE, - FL("Setting WPS overlap TIMER to %d ticks"), - WPSOverlapTimer); - } - break; -#endif - #ifdef WLAN_FEATURE_VOWIFI_11R case eLIM_FT_PREAUTH_RSP_TIMER: if (tx_timer_deactivate(&pMac->lim.limTimers.gLimFTPreAuthRspTimer) != TX_SUCCESS) diff --git a/CORE/MAC/src/pe/lim/limUtils.c b/CORE/MAC/src/pe/lim/limUtils.c index ca09b87abf74..9aa3f9a3a6ff 100644 --- a/CORE/MAC/src/pe/lim/limUtils.c +++ b/CORE/MAC/src/pe/lim/limUtils.c @@ -53,6 +53,9 @@ #endif //FEATURE_WLAN_DIAG_SUPPORT #include "limIbssPeerMgmt.h" #include "limSessionUtils.h" +#ifdef WLAN_FEATURE_VOWIFI_11R +#include "limFTDefs.h" +#endif #include "limSession.h" #include "vos_nvitem.h" diff --git a/CORE/MAC/src/pe/pmm/pmmApi.c b/CORE/MAC/src/pe/pmm/pmmApi.c index 9fc20b03fdea..15b9cf40d4fa 100644 --- a/CORE/MAC/src/pe/pmm/pmmApi.c +++ b/CORE/MAC/src/pe/pmm/pmmApi.c @@ -50,7 +50,6 @@ #include "limSessionUtils.h" #include "limFT.h" - #include "pmmApi.h" #include "pmmDebug.h" #include "sirApi.h" diff --git a/CORE/MAC/src/pe/rrm/rrmApi.c b/CORE/MAC/src/pe/rrm/rrmApi.c index 38398b321cc2..a914254167e2 100644 --- a/CORE/MAC/src/pe/rrm/rrmApi.c +++ b/CORE/MAC/src/pe/rrm/rrmApi.c @@ -411,6 +411,7 @@ rrmProcessNeighborReportResponse( tpAniSirGlobal pMac, pSmeNeighborRpt->messageType = eWNI_SME_NEIGHBOR_REPORT_IND; pSmeNeighborRpt->length = length; + pSmeNeighborRpt->sessionId = pSessionEntry->smeSessionId; pSmeNeighborRpt->numNeighborReports = pNeighborRep->num_NeighborReport; vos_mem_copy(pSmeNeighborRpt->bssId, pSessionEntry->bssId, sizeof(tSirMacAddr)); diff --git a/CORE/SAP/inc/sapApi.h b/CORE/SAP/inc/sapApi.h index 59be68eff820..601cec77567f 100644 --- a/CORE/SAP/inc/sapApi.h +++ b/CORE/SAP/inc/sapApi.h @@ -483,7 +483,8 @@ typedef struct sap_Config { char acsAllowedChnls[MAX_CHANNEL_LIST_LEN]; v_U16_t acsBandSwitchThreshold; v_BOOL_t apAutoChannelSelection; - + v_U8_t apStartChannelNum; + v_U8_t apEndChannelNum; #ifdef WLAN_FEATURE_11W v_BOOL_t mfpRequired; v_BOOL_t mfpCapable; diff --git a/CORE/SAP/src/sapApiLinkCntl.c b/CORE/SAP/src/sapApiLinkCntl.c index 315c1cc3932b..3695bc3eae50 100644 --- a/CORE/SAP/src/sapApiLinkCntl.c +++ b/CORE/SAP/src/sapApiLinkCntl.c @@ -128,6 +128,7 @@ WLANSAP_ScanCallback ( tHalHandle halHandle, void *pContext, /* Opaque SAP handle */ + v_U8_t sessionId, v_U32_t scanID, eCsrScanStatus scanStatus ) diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c index 253bcce65bc8..bd2b19309ff4 100644 --- a/CORE/SAP/src/sapFsm.c +++ b/CORE/SAP/src/sapFsm.c @@ -941,31 +941,13 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext) v_BOOL_t sapAcsChannelCheck(ptSapContext sapContext, v_U8_t channelNumber) { - v_U32_t acsStartChannelNum; - v_U32_t acsEndChannelNum; - tHalHandle hHal; - if (!sapContext->apAutoChannelSelection) return VOS_FALSE; - hHal = VOS_GET_HAL_CB(sapContext->pvosGCtx); - if (NULL == hHal) - { - VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, - "Invalid HAL pointer from pvosGCtx on sapGetChannelList"); - return VOS_STATUS_E_FAULT; - } - - ccmCfgGetInt(hHal, WNI_CFG_SAP_CHANNEL_SELECT_START_CHANNEL, - &acsStartChannelNum); - ccmCfgGetInt(hHal, WNI_CFG_SAP_CHANNEL_SELECT_END_CHANNEL, - &acsEndChannelNum); - - if ((channelNumber < acsStartChannelNum) || - (channelNumber > acsEndChannelNum)) + if ((channelNumber < sapContext->apStartChannelNum) || + (channelNumber > sapContext->apEndChannelNum)) return VOS_TRUE; - return VOS_FALSE; } diff --git a/CORE/SAP/src/sapInternal.h b/CORE/SAP/src/sapInternal.h index 6056e9507637..689f02e282b8 100644 --- a/CORE/SAP/src/sapInternal.h +++ b/CORE/SAP/src/sapInternal.h @@ -242,6 +242,8 @@ typedef struct sSapContext { tSapAcsChannelInfo acsBestChannelInfo; tANI_BOOLEAN enableOverLapCh; v_BOOL_t apAutoChannelSelection; + v_U8_t apStartChannelNum; + v_U8_t apEndChannelNum; #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH v_U8_t cc_switch_mode; #endif @@ -291,6 +293,7 @@ typedef struct sWLAN_SAPEvent { tHalHandle: the tHalHandle passed in with the scan request *p2: the second context pass in for the caller, opaque sap Handle here scanID: + sessionId: Session identifier status: Status of scan -success, failure or abort RETURN VALUE @@ -306,6 +309,7 @@ WLANSAP_ScanCallback ( tHalHandle halHandle, void *pContext, + v_U8_t sessionId, v_U32_t scanID, eCsrScanStatus scanStatus ); diff --git a/CORE/SAP/src/sapModule.c b/CORE/SAP/src/sapModule.c index 14af1d03c609..8d4f2996a5b6 100644 --- a/CORE/SAP/src/sapModule.c +++ b/CORE/SAP/src/sapModule.c @@ -676,6 +676,8 @@ WLANSAP_StartBss pSapCtx->acsBandSwitchThreshold = pConfig->acsBandSwitchThreshold; pSapCtx->pUsrContext = pUsrContext; pSapCtx->apAutoChannelSelection = pConfig->apAutoChannelSelection; + pSapCtx->apStartChannelNum = pConfig->apStartChannelNum; + pSapCtx->apEndChannelNum = pConfig->apEndChannelNum; pSapCtx->enableOverLapCh = pConfig->enOverLapCh; if (strlen(pConfig->acsAllowedChnls) > 0) diff --git a/CORE/SERVICES/HIF/USB/hif_usb_internal.h b/CORE/SERVICES/HIF/USB/hif_usb_internal.h index 88b91d7cc745..f50af97b43ed 100644 --- a/CORE/SERVICES/HIF/USB/hif_usb_internal.h +++ b/CORE/SERVICES/HIF/USB/hif_usb_internal.h @@ -163,4 +163,27 @@ extern void usb_hif_suspend(struct usb_interface *interface); extern void usb_hif_resume(struct usb_interface *interface); A_STATUS HIFDiagWriteWARMRESET(struct usb_interface *interface, A_UINT32 address, A_UINT32 data); + +#define FW_ASSERT_PATTERN 0x0000c600 +#define FW_REG_PATTERN 0x0000d600 +#define FW_REG_END_PATTERN 0x0000e600 +#define FW_RAMDUMP_PATTERN 0x0000f600 +#define FW_RAMDUMP_END_PATTERN 0x0000f601 +#define FW_RAMDUMP_PATTERN_MASK 0xfffffff0 + +enum { + FW_RAM_SEG_DRAM, + FW_RAM_SEG_IRAM, + FW_RAM_SEG_AXI, + FW_RAM_SEG_CNT +}; + +/* Allocate 384K memory to save each segment of ram dump */ +#define FW_RAMDUMP_SEG_SIZE 393216 + +struct fw_ramdump { + A_UINT32 start_addr; + A_UINT32 length; + A_UINT8 *mem; +}; #endif diff --git a/CORE/SERVICES/HIF/USB/if_usb.c b/CORE/SERVICES/HIF/USB/if_usb.c index 081b29cd6e0f..0a8d11ff4b93 100644 --- a/CORE/SERVICES/HIF/USB/if_usb.c +++ b/CORE/SERVICES/HIF/USB/if_usb.c @@ -54,10 +54,25 @@ #define AR6320_DEVICE_ID (0x003e) #define DELAY_FOR_TARGET_READY 200 /* 200ms */ #define DELAY_INT_FOR_HDD_REMOVE 200 /* 200ms */ +#define HIFDiagWriteCOLDRESET(hifdevice) HIFDiagWriteAccess(sc->hif_device, \ + (ROME_USB_SOC_RESET_CONTROL_COLD_RST_LSB | \ + ROME_USB_RTC_SOC_BASE_ADDRESS), \ + SOC_RESET_CONTROL_COLD_RST_SET(1)) unsigned int msienable; module_param(msienable, int, 0644); -struct hif_usb_softc *usb_sc; +#define HIF_USB_UNLOAD_TIMEOUT (2*HZ) +enum hif_usb_drv_unload_state { + HIF_USB_UNLOAD_STATE_NULL = 0, + HIF_USB_UNLOAD_STATE_DRV_DEREG, + HIF_USB_UNLOAD_STATE_TARGET_RESET, + HIF_USB_UNLOAD_STATE_DEV_DISCONNECTED, +}; + +static int hif_usb_unload_dev_num = -1; +static wait_queue_head_t hif_usb_unload_event_wq; +static atomic_t hif_usb_unload_state; +struct hif_usb_softc *usb_sc = NULL; static int hif_usb_resume(struct usb_interface *interface); static int @@ -65,6 +80,7 @@ hif_usb_configure(struct hif_usb_softc *sc, hif_handle_t *hif_hdl, struct usb_interface *interface) { int ret = 0; + struct usb_device *dev = interface_to_usbdev(interface); if (HIF_USBDeviceInserted(interface, sc)) { pr_err("ath: %s: Target probe failed.\n", __func__); @@ -76,7 +92,7 @@ hif_usb_configure(struct hif_usb_softc *sc, hif_handle_t *hif_hdl, pr_err("athdiag_procfs_init failed\n"); return A_ERROR; } - + hif_usb_unload_dev_num = dev->devnum; *hif_hdl = sc->hif_device; return 0; @@ -94,7 +110,8 @@ static int hif_usb_reboot(struct notifier_block *nb, unsigned long val, { struct hif_usb_softc *sc; sc = container_of(nb, struct hif_usb_softc, reboot_notifier); - HIFDiagWriteWARMRESET(sc->interface, 0, 0); + /* do cold reset */ + HIFDiagWriteCOLDRESET(sc->hif_device); return NOTIFY_DONE; } @@ -120,7 +137,7 @@ hif_usb_probe(struct usb_interface *interface, const struct usb_device_id *id) ret = -ENOMEM; goto err_alloc; } - usb_sc = sc; + OS_MEMZERO(sc, sizeof(*sc)); sc->pdev = (void *)pdev; sc->dev = &pdev->dev; @@ -174,7 +191,6 @@ hif_usb_probe(struct usb_interface *interface, const struct usb_device_id *id) init_waitqueue_head(&ol_sc->sc_osdev->event_queue); ret = hdd_wlan_startup(&pdev->dev, ol_sc); - if (ret) { hif_nointrs(sc); if (sc->hif_device != NULL) { @@ -206,6 +222,8 @@ hif_usb_probe(struct usb_interface *interface, const struct usb_device_id *id) sc->interface = interface; sc->reboot_notifier.notifier_call = hif_usb_reboot; register_reboot_notifier(&sc->reboot_notifier); + + usb_sc = sc; return 0; err_config: @@ -213,7 +231,6 @@ err_config: err_attach: ret = -EIO; err_tgtstate: - usb_sc = NULL; A_FREE(sc); err_alloc: usb_put_dev(pdev); @@ -240,8 +257,8 @@ static void hif_usb_remove(struct usb_interface *interface) set_current_state(TASK_RUNNING); usb_sc->hdd_removed_wait_cnt ++; } - - HIFDiagWriteWARMRESET(interface, 0, 0); + /* do cold reset */ + HIFDiagWriteCOLDRESET(sc->hif_device); /* wait for target jump to boot code and finish the initialization */ set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(msecs_to_jiffies(DELAY_FOR_TARGET_READY)); @@ -251,8 +268,11 @@ static void hif_usb_remove(struct usb_interface *interface) usb_sc->local_state.event = 0; } unregister_reboot_notifier(&sc->reboot_notifier); - usb_put_dev(interface_to_usbdev(interface)); + if (atomic_read(&hif_usb_unload_state) == + HIF_USB_UNLOAD_STATE_DRV_DEREG) + atomic_set(&hif_usb_unload_state, + HIF_USB_UNLOAD_STATE_TARGET_RESET); scn = sc->ol_sc; if (usb_sc->hdd_removed == 0) { @@ -364,10 +384,7 @@ static int hif_usb_reset_resume(struct usb_interface *intf) HIF_DEVICE_USB *device = usb_get_intfdata(intf); struct hif_usb_softc *sc = device->sc; - HIFDiagWriteAccess(sc->hif_device, - (ROME_USB_SOC_RESET_CONTROL_COLD_RST_LSB | - ROME_USB_RTC_SOC_BASE_ADDRESS), - SOC_RESET_CONTROL_COLD_RST_SET(1)); + HIFDiagWriteCOLDRESET(sc->hif_device); return 0; } @@ -408,16 +425,47 @@ void hif_deinit_adf_ctx(void *ol_sc) sc->adf_dev = NULL; } +static int hif_usb_dev_notify(struct notifier_block *nb, + unsigned long action, void *dev) +{ + struct usb_device *udev; + int ret = NOTIFY_DONE; + + if (action != USB_DEVICE_REMOVE) + goto done; + + udev = (struct usb_device *) dev; + if (hif_usb_unload_dev_num != udev->devnum) + goto done; + + if (atomic_read(&hif_usb_unload_state) == + HIF_USB_UNLOAD_STATE_TARGET_RESET) { + atomic_set(&hif_usb_unload_state, + HIF_USB_UNLOAD_STATE_DEV_DISCONNECTED); + wake_up(&hif_usb_unload_event_wq); + } + +done: + return ret; +} + +static struct notifier_block hif_usb_dev_nb = { + .notifier_call = hif_usb_dev_notify, +}; static int is_usb_driver_register = 0; int hif_register_driver(void) { is_usb_driver_register = 1; + init_waitqueue_head(&hif_usb_unload_event_wq); + atomic_set(&hif_usb_unload_state, HIF_USB_UNLOAD_STATE_NULL); + usb_register_notify(&hif_usb_dev_nb); return usb_register(&hif_usb_drv_id); } void hif_unregister_driver(void) { if (is_usb_driver_register) { + long timeleft = 0; if (usb_sc != NULL) { /* wait __hdd_wlan_exit until finished and no more than * 4 seconds @@ -447,7 +495,23 @@ void hif_unregister_driver(void) } } is_usb_driver_register = 0; + atomic_set(&hif_usb_unload_state, + HIF_USB_UNLOAD_STATE_DRV_DEREG); usb_deregister(&hif_usb_drv_id); + if (atomic_read(&hif_usb_unload_state) != + HIF_USB_UNLOAD_STATE_TARGET_RESET) + goto finish; + timeleft = wait_event_interruptible_timeout( + hif_usb_unload_event_wq, + atomic_read(&hif_usb_unload_state) == + HIF_USB_UNLOAD_STATE_DEV_DISCONNECTED, + HIF_USB_UNLOAD_TIMEOUT); + if (timeleft <= 0) + pr_err("Fail to wait from DRV_DEREG to DISCONNECT," + "timeleft = %ld \n\r", + timeleft); +finish: + usb_unregister_notify(&hif_usb_dev_nb); } } diff --git a/CORE/SERVICES/HIF/USB/usbdrv.c b/CORE/SERVICES/HIF/USB/usbdrv.c index 79e9a7eb6d0d..d61f1232e4e6 100644 --- a/CORE/SERVICES/HIF/USB/usbdrv.c +++ b/CORE/SERVICES/HIF/USB/usbdrv.c @@ -41,6 +41,7 @@ #include "htc_packet.h" #include "qwlan_version.h" #include "if_usb.h" +#include "vos_api.h" #define IS_BULK_EP(attr) (((attr) & 3) == 0x02) #define IS_INT_EP(attr) (((attr) & 3) == 0x03) @@ -973,6 +974,107 @@ A_STATUS usb_hif_submit_ctrl_in(HIF_DEVICE_USB *device, return ret; } +#define IS_FW_CRASH_DUMP(x) ((x == FW_ASSERT_PATTERN) || \ + (x == FW_REG_PATTERN) || \ + ((x & FW_RAMDUMP_PATTERN_MASK) == FW_RAMDUMP_PATTERN))?1:0 + +void fw_crash_dump(HIF_DEVICE_USB *device, A_UINT8 *data, A_UINT32 len) +{ + A_UINT32 *reg, pattern, i, start_addr = 0, stack_addr = 0; + A_UINT32 MSPId = 0, mSPId = 0, SIId = 0, CRMId = 0; + static A_UINT8 dumping = 0; +#ifdef USB_FW_CRASH_RAM_DUMP + A_UINT8 *ram_ptr = NULL; + static struct fw_ramdump *ramdump[FW_RAM_SEG_CNT]; + static A_UINT8 ramdump_index = 0; + static char *fw_ram_seg_name[FW_RAM_SEG_CNT] = {"DRAM", "IRAM", "AXI"}; +#endif + + pattern = *((A_UINT32 *) data); + + if (pattern == FW_ASSERT_PATTERN) { + MSPId = (device->sc->ol_sc->target_fw_version & 0xf0000000) >> 28; + mSPId = (device->sc->ol_sc->target_fw_version & 0xf000000) >> 24; + SIId = (device->sc->ol_sc->target_fw_version & 0xf00000) >> 20; + CRMId = device->sc->ol_sc->target_fw_version & 0x7fff; + AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("Firmware crash detected...\n")); + AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("Host SW version: %s\n", QWLAN_VERSIONSTR)); + AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("FW version: %d.%d.%d.%d", MSPId, mSPId, SIId, CRMId)); + reg = (A_UINT32 *) (data+4); + for (i = 0; i < 60; reg++, i++ ) { + if (i%4 == 0) { + AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("\n")); + AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("%2d: ", i)); + } + AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("0x%08x ", *reg)); + } + AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("\n")); + } else if (pattern == FW_REG_PATTERN) { + reg = (A_UINT32 *) (data+4); + start_addr = *reg++; + if (dumping == 0) { + AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("Firmware stack dump:")); + dumping = 1; + stack_addr = start_addr; + } + for (i = 0; i < (len>>2)-2; reg++, i++ ) { + if (*reg == FW_REG_END_PATTERN && (i == (len>>2)-3)) { + dumping = 0; + AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, + ("\nStack start address = 0x%08X\n", stack_addr)); + break; + } + if (i%4 == 0) { + AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("\n")); + AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("0x%08X: ", start_addr + (i << 2))); + } + AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("0x%08X ", *reg)); + } +#ifdef USB_FW_CRASH_RAM_DUMP + } else if ((pattern & FW_RAMDUMP_PATTERN_MASK) == FW_RAMDUMP_PATTERN) { + ASSERT(ramdump_index < FW_RAM_SEG_CNT); + i = ramdump_index; + reg = (A_UINT32 *) (data+4); + + if (dumping == 0) { + AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("Firmware %s dump:\n", fw_ram_seg_name[i])); + dumping = 1; + ramdump[i] = kmalloc(sizeof(struct fw_ramdump)+FW_RAMDUMP_SEG_SIZE, GFP_KERNEL); + if (!ramdump[i]) { + AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, + ("Failed to allocate memory for ram dump")); + VOS_BUG(0); + } + AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("FW %s start addr = 0x%08X\n", + fw_ram_seg_name[i], *reg)); + AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("Memory addr for %s = 0x%08X\n", + fw_ram_seg_name[i], (A_UINT32) ramdump[i])); + (ramdump[i])->start_addr = *reg; + (ramdump[i])->length = 0; + (ramdump[i])->mem = (A_UINT8 *) (ramdump[i] + 1); + } + + reg++; + ram_ptr = (ramdump[i])->mem + (ramdump[i])->length; + (ramdump[i])->length += (len - 8); + memcpy(ram_ptr, (A_UINT8 *) reg, len-8); + + if (pattern == FW_RAMDUMP_END_PATTERN) { + + AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, + ("%s memory size = %d\n", + fw_ram_seg_name[i], (ramdump[i])->length)); + if (i == (FW_RAM_SEG_CNT - 1)) { + VOS_BUG(0); + } + + dumping = 0; + ramdump_index++; + } +#endif /* USB_FW_CRASH_RAM_DUMP */ + } +} + void usb_hif_io_comp_work(struct work_struct *work) { HIF_USB_PIPE *pipe = container_of(work, HIF_USB_PIPE, io_complete_work); @@ -980,14 +1082,7 @@ void usb_hif_io_comp_work(struct work_struct *work) HIF_DEVICE_USB *device; HTC_FRAME_HDR *HtcHdr; A_UINT8 *data; - A_UINT32 *reg; - A_UINT32 len, i; - static A_UINT32 assert_pattern = 0x0000c600; - static A_UINT32 reg_pattern = 0x0000d600; - static A_UINT32 regend_pattern = 0x0000e600; - A_UINT32 start_addr = 0; - static A_UINT32 stack_dumping = 0; - A_UINT32 MSPId = 0, mSPId = 0, SIId = 0, CRMId = 0; + A_UINT32 len; AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("+%s\n", __func__)); device = pipe->device; @@ -1016,43 +1111,9 @@ void usb_hif_io_comp_work(struct work_struct *work) ("+athusb recv callback buf:" "0x%p\n", buf)); adf_nbuf_peek_header(buf, &data, &len); - if (!memcmp(data, &assert_pattern, sizeof(assert_pattern))) { - MSPId = (device->sc->ol_sc->target_fw_version & 0xf0000000) >> 28; - mSPId = (device->sc->ol_sc->target_fw_version & 0xf000000) >> 24; - SIId = (device->sc->ol_sc->target_fw_version & 0xf00000) >> 20; - CRMId = device->sc->ol_sc->target_fw_version & 0x7fff; - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("Firmware crash detected...\n")); - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("Host SW version: %s\n", QWLAN_VERSIONSTR)); - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("FW version: %d.%d.%d.%d", MSPId, mSPId, SIId, CRMId)); - reg = (A_UINT32 *) (data+4); - for (i = 0; i < 60; reg++, i++ ) { - if (i%4 == 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("\n")); - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("%2d: ", i)); - } - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("0x%08x ", *reg)); - } - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("\n")); - dev_kfree_skb(buf); - } else if (!memcmp(data, ®_pattern, sizeof(reg_pattern))) { - reg = (A_UINT32 *) (data+4); - start_addr = *reg++; - if(stack_dumping == 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("Firmware stack dump:")); - stack_dumping = 1; - } - for (i = 0; i < (len>>2)-2; reg++, i++ ) { - if (*reg == regend_pattern && (i == (len>>2)-3)) { - stack_dumping = 0; - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("\n")); - break; - } - if (i%4 == 0) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("\n")); - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("0x%08X: ", start_addr + (i << 2))); - } - AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("0x%08X ", *reg)); - } + + if (IS_FW_CRASH_DUMP(*((A_UINT32 *) data))) { + fw_crash_dump(device, data, len); dev_kfree_skb(buf); } else { device->htcCallbacks.rxCompletionHandler( diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 27804a0a72ad..f3ea39b0d01c 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -7915,9 +7915,16 @@ VOS_STATUS wma_process_roam_scan_req(tp_wma_handle wma_handle, wma_roam_scan_offload_end_connect(wma_handle); if (roam_req->StartScanReason == REASON_OS_REQUESTED_ROAMING_NOW) { vos_msg_t vosMsg; + tSirRoamOffloadScanRsp *scan_offload_rsp; + scan_offload_rsp = vos_mem_malloc(sizeof(*scan_offload_rsp)); + if (!scan_offload_rsp) { + WMA_LOGE("%s: Alloc failed for scan_offload_rsp", __func__); + return VOS_STATUS_E_NOMEM; + } vosMsg.type = eWNI_SME_ROAM_SCAN_OFFLOAD_RSP; - vosMsg.bodyptr = NULL; - vosMsg.bodyval = roam_req->StartScanReason; + scan_offload_rsp->sessionId = roam_req->sessionId; + scan_offload_rsp->reason = roam_req->StartScanReason; + vosMsg.bodyptr = scan_offload_rsp; /* * Since REASSOC request is processed in Roam_Scan_Offload_Rsp * post a dummy rsp msg back to SME with proper reason code. @@ -9474,8 +9481,13 @@ static int32_t wmi_unified_send_peer_assoc(tp_wma_handle wma, u_int32_t num_peer_11a_rates=0; u_int32_t phymode; u_int32_t peer_nss=1; + struct wma_txrx_node *intr = NULL; - struct wma_txrx_node *intr = &wma->interfaces[params->smesessionId]; + if (NULL == params) { + WMA_LOGE("%s: params is NULL", __func__); + return -EINVAL; + } + intr = &wma->interfaces[params->smesessionId]; pdev = vos_get_context(VOS_MODULE_ID_TXRX, wma->vos_context); @@ -12493,9 +12505,7 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params) ol_txrx_peer_handle peer; struct wma_txrx_node *iface; tPowerdBm maxTxPower; -#ifdef WLAN_FEATURE_11W int ret = 0; -#endif #ifdef FEATURE_WLAN_TDLS if (STA_ENTRY_TDLS_PEER == params->staType) @@ -12556,9 +12566,16 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params) #endif wmi_unified_send_txbf(wma, params); - wmi_unified_send_peer_assoc(wma, + ret = wmi_unified_send_peer_assoc(wma, iface->nwType, (tAddStaParams *)iface->addBssStaContext); + if (ret) { + status = VOS_STATUS_E_FAILURE; + wma_remove_peer(wma, params->bssId, + params->smesessionId, peer, VOS_FALSE); + goto out; + } + #ifdef WLAN_FEATURE_11W if (params->rmfEnabled) { /* when 802.11w PMF is enabled for hw encr/decr @@ -15377,7 +15394,7 @@ static void wma_config_plm(tp_wma_handle wma, tpSirPlmReq plm) * check for PNO completion (by checking NLO match event) and post PNO * completion back to SME if PNO operation is completed successfully. */ -void wma_scan_cache_updated_ind(tp_wma_handle wma) +void wma_scan_cache_updated_ind(tp_wma_handle wma, u_int8_t sessionId) { tSirPrefNetworkFoundInd *nw_found_ind; VOS_STATUS status; @@ -15407,6 +15424,7 @@ void wma_scan_cache_updated_ind(tp_wma_handle wma) nw_found_ind->mesgType = eWNI_SME_PREF_NETWORK_FOUND_IND; nw_found_ind->mesgLen = len; + nw_found_ind->sessionId = sessionId; vos_msg.type = eWNI_SME_PREF_NETWORK_FOUND_IND; vos_msg.bodyptr = (void *) nw_found_ind; @@ -20698,7 +20716,7 @@ VOS_STATUS wma_mc_process_msg(v_VOID_t *vos_context, vos_msg_t *msg) break; case WDA_SME_SCAN_CACHE_UPDATED: - wma_scan_cache_updated_ind(wma_handle); + wma_scan_cache_updated_ind(wma_handle, msg->bodyval); break; #endif #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) diff --git a/CORE/SERVICES/WMI/wmi_unified.c b/CORE/SERVICES/WMI/wmi_unified.c index 041b6022aa61..e222743d00f3 100644 --- a/CORE/SERVICES/WMI/wmi_unified.c +++ b/CORE/SERVICES/WMI/wmi_unified.c @@ -764,7 +764,56 @@ void wmi_control_rx(void *ctx, HTC_PACKET *htc_packet) struct wmi_unified *wmi_handle = (struct wmi_unified *)ctx; wmi_buf_t evt_buf; +#ifndef QCA_CONFIG_SMP + /* MDM is single core apps processor + * As a result, PAUSE event cannot be processed fast enough + * if RX process reserve CPU + * To ensure PAUSE event processed fast enough + * only PAUSE event should not be scheduled on worker thread */ + u_int32_t id; + u_int32_t len; + u_int8_t *data; + void *wmi_cmd_struct_ptr = NULL; + u_int32_t idx = 0; + int tlv_ok_status = 0; +#endif /* QCA_CONFIG_SMP */ + evt_buf = (wmi_buf_t) htc_packet->pPktContext; +#ifndef QCA_CONFIG_SMP + id = WMI_GET_FIELD(adf_nbuf_data(evt_buf), WMI_CMD_HDR, COMMANDID); + /* TX_PAUSE EVENT should be handled with tasklet context */ + if (WMI_TX_PAUSE_EVENTID == id) { + if (adf_nbuf_pull_head(evt_buf, sizeof(WMI_CMD_HDR)) == NULL) + return; + + data = adf_nbuf_data(evt_buf); + len = adf_nbuf_len(evt_buf); + tlv_ok_status = wmitlv_check_and_pad_event_tlvs( + wmi_handle->scn_handle, + data, len, id, + &wmi_cmd_struct_ptr); + if (tlv_ok_status != 0) { + if (tlv_ok_status == 1) { + wmi_cmd_struct_ptr = data; + } else { + return; + } + } + + idx = wmi_unified_get_event_handler_ix(wmi_handle, id); + if (idx == -1) { + wmitlv_free_allocated_event_tlvs(id, + &wmi_cmd_struct_ptr); + adf_nbuf_free(evt_buf); + return; + } + wmi_handle->event_handler[idx](wmi_handle->scn_handle, + wmi_cmd_struct_ptr, len); + wmitlv_free_allocated_event_tlvs(id, &wmi_cmd_struct_ptr); + adf_nbuf_free(evt_buf); + return; + } +#endif /* QCA_CONFIG_SMP */ #ifdef QCA_WIFI_ISOC __wmi_control_rx(wmi_handle, evt_buf); diff --git a/CORE/SME/inc/csrApi.h b/CORE/SME/inc/csrApi.h index 8ab4f4374f4c..bbd68f35bb73 100644 --- a/CORE/SME/inc/csrApi.h +++ b/CORE/SME/inc/csrApi.h @@ -1577,7 +1577,10 @@ typedef struct tagCsrEseBeaconReq //void *p2 -- the second context pass in for the caller //***what if callback is called before requester gets the scanId?? -typedef eHalStatus (*csrScanCompleteCallback)(tHalHandle, void *p2, tANI_U32 scanID, eCsrScanStatus status); +typedef eHalStatus (*csrScanCompleteCallback)(tHalHandle, void *p2, + tANI_U8 sessionId, + tANI_U32 scanID, + eCsrScanStatus status); @@ -1747,10 +1750,11 @@ eHalStatus csrRoamIssueFTPreauthReq(tHalHandle hHal, tANI_U32 sessionId, tpSirBs \param hHal - handle to Hal context \param eBand - band value + \param sessionId - Session Identifier \return eHalStatus ---------------------------------------------------------------------------*/ -eHalStatus csrSetBand(tHalHandle hHal, eCsrBand eBand); +eHalStatus csrSetBand(tHalHandle hHal, tANI_U8 sessionId, eCsrBand eBand); /*--------------------------------------------------------------------------- This is the function to get the current operating band value diff --git a/CORE/SME/inc/csrInternal.h b/CORE/SME/inc/csrInternal.h index 7e62d2d86609..62cd46e31faa 100644 --- a/CORE/SME/inc/csrInternal.h +++ b/CORE/SME/inc/csrInternal.h @@ -802,7 +802,8 @@ typedef struct tagCsrScanStruct #ifdef WLAN_AP_STA_CONCURRENCY tDblLinkList scanCmdPendingList; #endif - tCsrChannel occupiedChannels; //This includes all channels on which candidate APs are found + /* This includes all channels on which candidate APs are found */ + tCsrChannel occupiedChannels[CSR_ROAM_SESSION_MAX]; tANI_S8 inScanResultBestAPRssi; eCsrBand scanBandPreference; //This defines the band perference for scan csrScanCompleteCallback callback11dScanDone; @@ -1015,10 +1016,16 @@ typedef struct tagCsrRoamSession #ifdef FEATURE_WLAN_SCAN_PNO tANI_BOOLEAN pnoStarted; #endif + #ifdef WLAN_FEATURE_ROAM_OFFLOAD tCsrRoamOffloadSynchStruct roamOffloadSynchParams; tANI_U8 psk_pmk[SIR_ROAM_SCAN_PSK_SIZE]; #endif + + /* SME FT Context */ +#if defined WLAN_FEATURE_VOWIFI_11R + tftSMEContext ftSmeContext; +#endif } tCsrRoamSession; typedef struct tagCsrRoamStruct @@ -1061,7 +1068,7 @@ typedef struct tagCsrRoamStruct tCsrRoamSession *roamSession; tANI_U32 transactionId; // Current transaction ID for internal use. #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING - tCsrNeighborRoamControlInfo neighborRoamInfo; + tCsrNeighborRoamControlInfo neighborRoamInfo[CSR_ROAM_SESSION_MAX]; #endif #ifdef FEATURE_WLAN_LFR tANI_U8 isFastRoamIniFeatureEnabled; @@ -1491,14 +1498,14 @@ eHalStatus csrScanSavePreferredNetworkFound(tpAniSirGlobal pMac, #ifdef WLAN_FEATURE_VOWIFI_11R //Returns whether the current association is a 11r assoc or not -tANI_BOOLEAN csrRoamIs11rAssoc(tpAniSirGlobal pMac); +tANI_BOOLEAN csrRoamIs11rAssoc(tpAniSirGlobal pMac, tANI_U8 sessionId); #endif #ifdef FEATURE_WLAN_ESE //Returns whether the current association is a ESE assoc or not -tANI_BOOLEAN csrRoamIsESEAssoc(tpAniSirGlobal pMac); +tANI_BOOLEAN csrRoamIsESEAssoc(tpAniSirGlobal pMac, tANI_U8 sessionId); tANI_BOOLEAN csrRoamIsEseIniFeatureEnabled(tpAniSirGlobal pMac); -tANI_BOOLEAN csrNeighborRoamIsESEAssoc(tpAniSirGlobal pMac); +tANI_BOOLEAN csrNeighborRoamIsESEAssoc(tpAniSirGlobal pMac, tANI_U8 sessionId); #endif //Remove this code once SLM_Sessionization is supported @@ -1516,8 +1523,10 @@ VOS_STATUS csrAddToChannelListFront( tANI_U8 *pChannelList, int numChannels, tA #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD eHalStatus csrScanRequestLfrResult(tpAniSirGlobal pMac, tANI_U32 sessionId, csrScanCompleteCallback callback, void *pContext); -eHalStatus csrRoamOffloadScanRspHdlr(tpAniSirGlobal pMac, tANI_U8 reason); -eHalStatus csrHandoffRequest(tpAniSirGlobal pMac, tCsrHandoffRequest *pHandoffInfo); +eHalStatus csrRoamOffloadScanRspHdlr(tpAniSirGlobal pMac, + tpSirRoamOffloadScanRsp scanOffloadRsp); +eHalStatus csrHandoffRequest(tpAniSirGlobal pMac, tANI_U8 sessionId, + tCsrHandoffRequest *pHandoffInfo); #endif tANI_BOOLEAN csrRoamIsStaMode(tpAniSirGlobal pMac, tANI_U32 sessionId); #endif @@ -1568,3 +1577,4 @@ eHalStatus csrScanSaveRoamOffloadApToScanCache(tpAniSirGlobal pMac, tSirSmeRoamOffloadSynchInd *pRoamOffloadSynchInd); #endif #endif + diff --git a/CORE/SME/inc/csrNeighborRoam.h b/CORE/SME/inc/csrNeighborRoam.h index 0b7bc99afa6e..c1023eb12ef2 100644 --- a/CORE/SME/inc/csrNeighborRoam.h +++ b/CORE/SME/inc/csrNeighborRoam.h @@ -179,7 +179,6 @@ typedef struct sCsrNeighborRoamControlInfo tANI_BOOLEAN scanRspPending; tANI_TIMESTAMP scanRequestTimeStamp; tDblLinkList roamableAPList; // List of current FT candidates - tANI_U32 csrSessionId; tCsrRoamProfile csrNeighborRoamProfile; #ifdef WLAN_FEATURE_VOWIFI_11R tANI_BOOLEAN is11rAssoc; @@ -213,48 +212,74 @@ typedef struct sCsrNeighborRoamControlInfo tANI_U8 currentRoamBeaconRssiWeight; } tCsrNeighborRoamControlInfo, *tpCsrNeighborRoamControlInfo; - /* All the necessary Function declarations are here */ -eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac,tANI_U8 sessionId, VOS_STATUS status); -eHalStatus csrNeighborRoamIndicateDisconnect(tpAniSirGlobal pMac,tANI_U8 sessionId); -tANI_BOOLEAN csrNeighborRoamIsHandoffInProgress(tpAniSirGlobal pMac); -void csrNeighborRoamRequestHandoff(tpAniSirGlobal pMac); -eHalStatus csrNeighborRoamInit(tpAniSirGlobal pMac); -void csrNeighborRoamClose(tpAniSirGlobal pMac); +eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac, + tANI_U8 sessionId, VOS_STATUS status); +eHalStatus csrNeighborRoamIndicateDisconnect(tpAniSirGlobal pMac, + tANI_U8 sessionId); +tANI_BOOLEAN csrNeighborRoamIsHandoffInProgress(tpAniSirGlobal pMac, + tANI_U8 sessionId); +void csrNeighborRoamRequestHandoff(tpAniSirGlobal pMac, tANI_U8 sessionId); +eHalStatus csrNeighborRoamInit(tpAniSirGlobal pMac, tANI_U8 sessionId); +void csrNeighborRoamClose(tpAniSirGlobal pMac, tANI_U8 sessionId); void csrNeighborRoamPurgePreauthFailedList(tpAniSirGlobal pMac); -VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac); +VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac, + tANI_U8 sessionId); VOS_STATUS csrNeighborRoamTransitionToPreauthDone(tpAniSirGlobal pMac); -eHalStatus csrNeighborRoamPrepareScanProfileFilter(tpAniSirGlobal pMac, tCsrScanResultFilter *pScanFilter); -void csrNeighborRoamGetHandoffAPInfo(tpAniSirGlobal pMac, tpCsrNeighborRoamBSSInfo pHandoffNode); -eHalStatus csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, tSirRetStatus limStatus); +eHalStatus csrNeighborRoamPrepareScanProfileFilter(tpAniSirGlobal pMac, + tCsrScanResultFilter *pScanFilter, + tANI_U8 sessionId); +void csrNeighborRoamGetHandoffAPInfo(tpAniSirGlobal pMac, + tpCsrNeighborRoamBSSInfo pHandoffNode, + tANI_U8 sessionId); +eHalStatus csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, + tANI_U8 sessionId, + tSirRetStatus limStatus); #ifdef WLAN_FEATURE_VOWIFI_11R -tANI_BOOLEAN csrNeighborRoamIs11rAssoc(tpAniSirGlobal pMac); +tANI_BOOLEAN csrNeighborRoamIs11rAssoc(tpAniSirGlobal pMac, + tANI_U8 sessionId); #endif -VOS_STATUS csrNeighborRoamCreateChanListFromNeighborReport(tpAniSirGlobal pMac); -void csrNeighborRoamTranistionPreauthDoneToDisconnected(tpAniSirGlobal pMac); -tANI_BOOLEAN csrNeighborRoamStatePreauthDone(tpAniSirGlobal pMac); -tANI_BOOLEAN csrNeighborRoamScanRspPending(tHalHandle hHal); -tANI_BOOLEAN csrNeighborMiddleOfRoaming(tHalHandle hHal); -VOS_STATUS csrNeighborRoamSetLookupRssiThreshold(tpAniSirGlobal pMac, v_U8_t neighborLookupRssiThreshold); +VOS_STATUS csrNeighborRoamCreateChanListFromNeighborReport(tpAniSirGlobal pMac, + tANI_U8 sessionId); +void csrNeighborRoamTranistionPreauthDoneToDisconnected(tpAniSirGlobal pMac, + tANI_U8 sessionId); +tANI_BOOLEAN csrNeighborRoamStatePreauthDone(tpAniSirGlobal pMac, + tANI_U8 sessionId); +tANI_BOOLEAN csrNeighborRoamScanRspPending(tHalHandle hHal, + tANI_U8 sessionId); +tANI_BOOLEAN csrNeighborMiddleOfRoaming(tHalHandle hHal, tANI_U8 sessionId); +VOS_STATUS csrNeighborRoamSetLookupRssiThreshold(tpAniSirGlobal pMac, + tANI_U8 sessionId, + v_U8_t neighborLookupRssiThreshold); VOS_STATUS csrNeighborRoamSetOpportunisticScanThresholdDiff(tpAniSirGlobal pMac, + tANI_U8 sessionId, v_U8_t nOpportunisticThresholdDiff); VOS_STATUS csrNeighborRoamSetRoamRescanRssiDiff(tpAniSirGlobal pMac, + tANI_U8 sessionId, v_U8_t nRoamRescanRssiDiff); VOS_STATUS csrNeighborRoamSetRoamBmissFirstBcnt(tpAniSirGlobal pMac, + tANI_U8 sessionId, v_U8_t nRoamBmissFirstBcnt); VOS_STATUS csrNeighborRoamSetRoamBmissFinalBcnt(tpAniSirGlobal pMac, + tANI_U8 sessionId, v_U8_t nRoamBmissFinalBcnt); VOS_STATUS csrNeighborRoamSetRoamBeaconRssiWeight(tpAniSirGlobal pMac, + tANI_U8 sessionId, v_U8_t nRoamBeaconRssiWeight); -VOS_STATUS csrNeighborRoamUpdateFastRoamingEnabled(tpAniSirGlobal pMac, const v_BOOL_t fastRoamEnabled); -VOS_STATUS csrNeighborRoamUpdateEseModeEnabled(tpAniSirGlobal pMac, const v_BOOL_t eseMode); +VOS_STATUS csrNeighborRoamUpdateFastRoamingEnabled(tpAniSirGlobal pMac, + tANI_U8 sessionId, + const v_BOOL_t fastRoamEnabled); +VOS_STATUS csrNeighborRoamUpdateEseModeEnabled(tpAniSirGlobal pMac, + tANI_U32 sessionId, + const v_BOOL_t eseMode); VOS_STATUS csrNeighborRoamChannelsFilterByCurrentBand( tpAniSirGlobal pMac, + tANI_U8 sessionId, tANI_U8* pInputChannelList, tANI_U8 inputNumOfChannels, tANI_U8* pOutputChannelList, @@ -301,19 +326,25 @@ VOS_STATUS csrNeighborRoamMergeChannelLists(tpAniSirGlobal pMac, #define REASON_ROAM_BEACON_RSSI_WEIGHT_CHANGED 22 #define REASON_ROAM_DFS_SCAN_MODE_CHANGED 23 #define REASON_ROAM_ABORT_ROAM_SCAN 24 -eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 command, tANI_U8 reason); -eHalStatus csrNeighborRoamCandidateFoundIndHdlr(tpAniSirGlobal pMac, void* pMsg); +eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 sessionId, + tANI_U8 command, tANI_U8 reason); +eHalStatus csrNeighborRoamCandidateFoundIndHdlr(tpAniSirGlobal pMac, + void* pMsg); eHalStatus csrNeighborRoamHandoffReqHdlr(tpAniSirGlobal pMac, void* pMsg); -eHalStatus csrNeighborRoamProceedWithHandoffReq(tpAniSirGlobal pMac); -eHalStatus csrNeighborRoamSssidScanDone(tpAniSirGlobal pMac, eHalStatus status); -eHalStatus csrNeighborRoamStartLfrScan(tpAniSirGlobal pMac); +eHalStatus csrNeighborRoamProceedWithHandoffReq(tpAniSirGlobal pMac, + tANI_U8 sessionId); +eHalStatus csrNeighborRoamSssidScanDone(tpAniSirGlobal pMac, + tANI_U8 sessionId, + eHalStatus status); +eHalStatus csrNeighborRoamStartLfrScan(tpAniSirGlobal pMac, tANI_U8 sessionId); #endif #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) VOS_STATUS csrSetCCKMIe(tpAniSirGlobal pMac, const tANI_U8 sessionId, const tANI_U8 *pCckmIe, const tANI_U8 ccKmIeLen); -VOS_STATUS csrRoamReadTSF(tpAniSirGlobal pMac, tANI_U8 *pTimestamp); +VOS_STATUS csrRoamReadTSF(tpAniSirGlobal pMac, tANI_U8 *pTimestamp, + const tANI_U8 sessionId); #endif /*FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ #ifdef WLAN_FEATURE_ROAM_OFFLOAD eHalStatus csrNeighborRoamOffloadSynchRspHandler(tpAniSirGlobal pMac, diff --git a/CORE/SME/inc/smeInside.h b/CORE/SME/inc/smeInside.h index be17a5892e80..a55264b65287 100644 --- a/CORE/SME/inc/smeInside.h +++ b/CORE/SME/inc/smeInside.h @@ -324,18 +324,23 @@ eHalStatus csrTdlsTeardownReq(tHalHandle hHal, tANI_U8 sessionId, #endif /* FEATURE_WLAN_TDLS */ #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) -eHalStatus csrFlushCfgBgScanRoamChannelList(tpAniSirGlobal pMac); +eHalStatus csrFlushCfgBgScanRoamChannelList(tpAniSirGlobal pMac, + tANI_U8 sessionId); eHalStatus csrCreateBgScanRoamChannelList(tpAniSirGlobal pMac, - const tANI_U8 *pChannelList, - const tANI_U8 numChannels); -eHalStatus csrUpdateBgScanConfigIniChannelList(tpAniSirGlobal pMac, eCsrBand eBand); + tANI_U8 sessionId, + const tANI_U8 *pChannelList, + const tANI_U8 numChannels); +eHalStatus csrUpdateBgScanConfigIniChannelList(tpAniSirGlobal pMac, + tANI_U8 sessionId, + eCsrBand eBand); #endif #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) eHalStatus csrCreateRoamScanChannelList(tpAniSirGlobal pMac, - tANI_U8 *pChannelList, - tANI_U8 numChannels, - const eCsrBand eBand); + tANI_U8 sessionId, + tANI_U8 *pChannelList, + tANI_U8 numChannels, + const eCsrBand eBand); #endif ePhyChanBondState csrConvertCBIniValueToPhyCBState(v_U32_t cbIniValue); @@ -345,12 +350,6 @@ eHalStatus csrPsOffloadIsFullPowerNeeded(tpAniSirGlobal pMac, tRequestFullPowerReason *pReason, tANI_BOOLEAN *pfNeedPower); -#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) -eHalStatus csrCreateRoamScanChannelList(tpAniSirGlobal pMac, - tANI_U8 *pChannelList, - tANI_U8 numChannels, - const eCsrBand eBand); -#endif void activeListCmdTimeoutHandle(void *userData); #endif //#if !defined( __SMEINSIDE_H ) diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h index e31a1ec5e57a..7774d62be99e 100644 --- a/CORE/SME/inc/sme_Api.h +++ b/CORE/SME/inc/sme_Api.h @@ -2378,10 +2378,11 @@ tANI_BOOLEAN sme_IsChannelValid(tHalHandle hHal, tANI_U8 channel); \fn sme_SetFreqBand \brief Used to set frequency band. \param hHal + \sessionId Session identifier \eBand band value to be configured \- return eHalStatus -------------------------------------------------------------------------*/ -eHalStatus sme_SetFreqBand(tHalHandle hHal, eCsrBand eBand); +eHalStatus sme_SetFreqBand(tHalHandle hHal, tANI_U8 sessionId, eCsrBand eBand); /* --------------------------------------------------------------------------- \fn sme_GetFreqBand @@ -2631,10 +2632,12 @@ eHalStatus sme_setRoamIntraBand(tHalHandle hHal, const v_BOOL_t nRoamIntraBand); This function is called through dynamic setConfig callback function to update roam scan N probes \param hHal - HAL handle for device + \param sessionId - Session identifier \param nProbes number of probe requests to be sent out \- return Success or failure -------------------------------------------------------------------------*/ -eHalStatus sme_UpdateRoamScanNProbes(tHalHandle hHal, const v_U8_t nProbes); +eHalStatus sme_UpdateRoamScanNProbes(tHalHandle hHal, tANI_U8 sessionId, + const v_U8_t nProbes); /* --------------------------------------------------------------------------- \fn sme_UpdateRoamScanHomeAwayTime @@ -2642,10 +2645,11 @@ eHalStatus sme_UpdateRoamScanNProbes(tHalHandle hHal, const v_U8_t nProbes); This function is called through dynamic setConfig callback function to update roam scan home away time \param hHal - HAL handle for device + \param sessionId - Session identifier \param nRoamScanAwayTime Scan home away time \- return Success or failure -------------------------------------------------------------------------*/ -eHalStatus sme_UpdateRoamScanHomeAwayTime(tHalHandle hHal, +eHalStatus sme_UpdateRoamScanHomeAwayTime(tHalHandle hHal, tANI_U8 sessionId, const v_U16_t nRoamScanHomeAwayTime, const eAniBoolean bSendOffloadCmd); @@ -2682,10 +2686,13 @@ v_U16_t sme_getRoamScanHomeAwayTime(tHalHandle hHal); \param hHal - HAL handle for device \param nImmediateRoamRssiDiff - minimum rssi difference between potential candidate and current AP. + \param sessionId - Session identifier \- return Success or failure -------------------------------------------------------------------------*/ -eHalStatus sme_UpdateImmediateRoamRssiDiff(tHalHandle hHal, v_U8_t nImmediateRoamRssiDiff); +eHalStatus sme_UpdateImmediateRoamRssiDiff(tHalHandle hHal, + v_U8_t nImmediateRoamRssiDiff, + tANI_U8 sessionId); /* --------------------------------------------------------------------------- \fn sme_UpdateRoamRssiDiff @@ -2694,12 +2701,14 @@ eHalStatus sme_UpdateImmediateRoamRssiDiff(tHalHandle hHal, v_U8_t nImmediateRoa to configure RoamRssiDiff Usage: adb shell iwpriv wlan0 setConfig RoamRssiDiff=[0 .. 125] \param hHal - HAL handle for device + \param sessionId - Session identifier \param RoamRssiDiff - minimum rssi difference between potential candidate and current AP. \- return Success or failure -------------------------------------------------------------------------*/ -eHalStatus sme_UpdateRoamRssiDiff(tHalHandle hHal, v_U8_t RoamRssiDiff); +eHalStatus sme_UpdateRoamRssiDiff(tHalHandle hHal, tANI_U8 sessionId, + v_U8_t RoamRssiDiff); /*-------------------------------------------------------------------------- \brief sme_UpdateFastTransitionEnabled() - enable/disable Fast Transition support at runtime @@ -2722,9 +2731,11 @@ eHalStatus sme_UpdateFastTransitionEnabled(tHalHandle hHal, to configure isWESModeEnabled \param hHal - HAL handle for device \param isWESModeEnabled - Enable/Disable WES Mode + \param sessionId - Session identifier \- return Success or failure -------------------------------------------------------------------------*/ -eHalStatus sme_UpdateWESMode(tHalHandle hHal, v_BOOL_t isWESModeEnabled); +eHalStatus sme_UpdateWESMode(tHalHandle hHal, v_BOOL_t isWESModeEnabled, + tANI_U8 sessionId); /* --------------------------------------------------------------------------- \fn sme_SetRoamScanControl @@ -2733,10 +2744,12 @@ eHalStatus sme_UpdateWESMode(tHalHandle hHal, v_BOOL_t isWESModeEnabled); if roam scan control is set to 0, roaming scan cache is cleared any value other than 0 is treated as invalid value \param hHal - HAL handle for device + \param sessionId - Session identifier \return eHAL_STATUS_SUCCESS - SME update config successfully. Other status means SME failure to update -------------------------------------------------------------------------*/ -eHalStatus sme_SetRoamScanControl(tHalHandle hHal, v_BOOL_t roamScanControl); +eHalStatus sme_SetRoamScanControl(tHalHandle hHal, tANI_U8 sessionId, + v_BOOL_t roamScanControl); #endif /* (WLAN_FEATURE_VOWIFI_11R) || (FEATURE_WLAN_ESE) || (FEATURE_WLAN_LFR) */ #ifdef FEATURE_WLAN_LFR @@ -2744,14 +2757,16 @@ eHalStatus sme_SetRoamScanControl(tHalHandle hHal, v_BOOL_t roamScanControl); \brief sme_UpdateIsFastRoamIniFeatureEnabled() - enable/disable LFR support at runtime It is used at in the REG_DYNAMIC_VARIABLE macro definition of isFastRoamIniFeatureEnabled. - This is a synchronuous call + This is a synchronous call \param hHal - The handle returned by macOpen. + \param sessionId - Session identifier \return eHAL_STATUS_SUCCESS - SME update isFastRoamIniFeatureEnabled config successfully. Other status means SME is failed to update isFastRoamIniFeatureEnabled. \sa --------------------------------------------------------------------------*/ eHalStatus sme_UpdateIsFastRoamIniFeatureEnabled(tHalHandle hHal, + tANI_U8 sessionId, const v_BOOL_t isFastRoamIniFeatureEnabled); /*-------------------------------------------------------------------------- @@ -2770,8 +2785,35 @@ eHalStatus sme_UpdateIsMAWCIniFeatureEnabled(tHalHandle hHal, #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD /*-------------------------------------------------------------------------- - \brief sme_UpdateEnableFastRoamInConcurrency() - enable/disable LFR if Concurrent session exists - This is a synchronuous call + \brief sme_stopRoaming() - Stop roaming for a given sessionId + This is a synchronous call + \param hHal - The handle returned by macOpen + \param sessionId - sessionId + \param reason - reason + \return eHAL_STATUS_SUCCESS on success + Other status on failure + \sa + --------------------------------------------------------------------------*/ +eHalStatus sme_stopRoaming(tHalHandle hHal, tANI_U8 sessionId, + tANI_U8 reason); + +/*-------------------------------------------------------------------------- + \brief sme_startRoaming() - Start roaming for a given sessionId + This is a synchronous call + \param hHal - The handle returned by macOpen + \param sessionId - sessionId + \param reason - reason + \return eHAL_STATUS_SUCCESS on success + Other status on failure + \sa + --------------------------------------------------------------------------*/ +eHalStatus sme_startRoaming(tHalHandle hHal, tANI_U8 sessionId, + tANI_U8 reason); + +/*-------------------------------------------------------------------------- + \brief sme_UpdateEnableFastRoamInConcurrency() - enable/disable LFR if + Concurrent session exists + This is a synchronous call \param hHal - The handle returned by macOpen. \return eHAL_STATUS_SUCCESS Other status means SME is failed @@ -2821,6 +2863,7 @@ eHalStatus sme_UpdateConfigFwRssiMonitoring(tHalHandle hHal, This function is called through dynamic setConfig callback function to configure nRoamRescanRssiDiff \param hHal - HAL handle for device + \param sessionId - Session identifier \param nRoamRescanRssiDiff - Roam Rescan Rssi Diff \return eHAL_STATUS_SUCCESS - SME update nRoamRescanRssiDiff config successfully. @@ -2828,6 +2871,7 @@ eHalStatus sme_UpdateConfigFwRssiMonitoring(tHalHandle hHal, -------------------------------------------------------------------------*/ eHalStatus sme_SetRoamRescanRssiDiff(tHalHandle hHal, + tANI_U8 sessionId, const v_U8_t nRoamRescanRssiDiff); /*-------------------------------------------------------------------------- @@ -2847,6 +2891,7 @@ v_U8_t sme_GetRoamRescanRssiDiff(tHalHandle hHal); This function is called through dynamic setConfig callback function to configure nOpportunisticThresholdDiff \param hHal - HAL handle for device + \param sessionId - Session identifier \param nOpportunisticThresholdDiff - Opportunistic Scan threshold diff \return eHAL_STATUS_SUCCESS - SME update nOpportunisticThresholdDiff config successfully. @@ -2854,6 +2899,7 @@ v_U8_t sme_GetRoamRescanRssiDiff(tHalHandle hHal); -------------------------------------------------------------------------*/ eHalStatus sme_SetRoamOpportunisticScanThresholdDiff(tHalHandle hHal, + tANI_U8 sessionId, const v_U8_t nOpportunisticThresholdDiff); /*-------------------------------------------------------------------------- @@ -2870,27 +2916,31 @@ v_U8_t sme_GetRoamOpportunisticScanThresholdDiff(tHalHandle hHal); \brief sme_setNeighborLookupRssiThreshold() - update neighbor lookup rssi threshold This is a synchronuous call \param hHal - The handle returned by macOpen. + \param sessionId - Session identifier \return eHAL_STATUS_SUCCESS - SME update config successful. Other status means SME is failed to update \sa --------------------------------------------------------------------------*/ eHalStatus sme_setNeighborLookupRssiThreshold(tHalHandle hHal, - v_U8_t neighborLookupRssiThreshold); + tANI_U8 sessionId, + v_U8_t neighborLookupRssiThreshold); /*-------------------------------------------------------------------------- \brief sme_setNeighborReassocRssiThreshold() - update neighbor reassoc rssi threshold - This is a synchronuous call + This is a synchronous call \param hHal - The handle returned by macOpen. + \param sessionId - Session identifier \return eHAL_STATUS_SUCCESS - SME update config successful. Other status means SME is failed to update \sa --------------------------------------------------------------------------*/ eHalStatus sme_setNeighborReassocRssiThreshold(tHalHandle hHal, + tANI_U8 sessionId, v_U8_t neighborReassocRssiThreshold); /*-------------------------------------------------------------------------- \brief sme_getNeighborLookupRssiThreshold() - get neighbor lookup rssi threshold - This is a synchronuous call + This is a synchronous call \param hHal - The handle returned by macOpen. \return eHAL_STATUS_SUCCESS - SME update config successful. Other status means SME is failed to update @@ -2902,11 +2952,13 @@ v_U8_t sme_getNeighborLookupRssiThreshold(tHalHandle hHal); \brief sme_setNeighborScanRefreshPeriod() - set neighbor scan results refresh period This is a synchronuous call \param hHal - The handle returned by macOpen. + \param sessionId - Session identifier \return eHAL_STATUS_SUCCESS - SME update config successful. Other status means SME is failed to update \sa --------------------------------------------------------------------------*/ eHalStatus sme_setNeighborScanRefreshPeriod(tHalHandle hHal, + tANI_U8 sessionId, v_U16_t neighborScanResultsRefreshPeriod); /*-------------------------------------------------------------------------- @@ -2936,10 +2988,12 @@ v_U16_t sme_getEmptyScanRefreshPeriod(tHalHandle hHal); to configure nEmptyScanRefreshPeriod Usage: adb shell iwpriv wlan0 setConfig nEmptyScanRefreshPeriod=[0 .. 60] \param hHal - HAL handle for device + \param sessionId - Session identifier \param nEmptyScanRefreshPeriod - scan period following empty scan results. \- return Success or failure -------------------------------------------------------------------------*/ -eHalStatus sme_UpdateEmptyScanRefreshPeriod(tHalHandle hHal, v_U16_t nEmptyScanRefreshPeriod); +eHalStatus sme_UpdateEmptyScanRefreshPeriod(tHalHandle hHal,tANI_U8 sessionId, + v_U16_t nEmptyScanRefreshPeriod); /* --------------------------------------------------------------------------- \fn sme_setNeighborScanMinChanTime @@ -2949,9 +3003,12 @@ eHalStatus sme_UpdateEmptyScanRefreshPeriod(tHalHandle hHal, v_U16_t nEmptyScanR Usage: adb shell iwpriv wlan0 setConfig gNeighborScanChannelMinTime=[0 .. 60] \param hHal - HAL handle for device \param nNeighborScanMinChanTime - Channel minimum dwell time + \param sessionId - Session identifier \- return Success or failure -------------------------------------------------------------------------*/ -eHalStatus sme_setNeighborScanMinChanTime(tHalHandle hHal, const v_U16_t nNeighborScanMinChanTime); +eHalStatus sme_setNeighborScanMinChanTime(tHalHandle hHal, + const v_U16_t nNeighborScanMinChanTime, + tANI_U8 sessionId); /* --------------------------------------------------------------------------- \fn sme_setNeighborScanMaxChanTime @@ -2960,26 +3017,100 @@ eHalStatus sme_setNeighborScanMinChanTime(tHalHandle hHal, const v_U16_t nNeighb to configure gNeighborScanChannelMaxTime Usage: adb shell iwpriv wlan0 setConfig gNeighborScanChannelMaxTime=[0 .. 60] \param hHal - HAL handle for device + \param sessionId - Session identifier \param nNeighborScanMinChanTime - Channel maximum dwell time \- return Success or failure -------------------------------------------------------------------------*/ -eHalStatus sme_setNeighborScanMaxChanTime(tHalHandle hHal, const v_U16_t nNeighborScanMaxChanTime); +eHalStatus sme_setNeighborScanMaxChanTime(tHalHandle hHal, tANI_U8 sessionId, + const v_U16_t nNeighborScanMaxChanTime); /* --------------------------------------------------------------------------- \fn sme_getNeighborScanMinChanTime \brief get neighbor scan min channel time \param hHal - The handle returned by macOpen. + \param sessionId - Session identifier \return v_U16_t - channel min time value -------------------------------------------------------------------------*/ -v_U16_t sme_getNeighborScanMinChanTime(tHalHandle hHal); +v_U16_t sme_getNeighborScanMinChanTime(tHalHandle hHal, tANI_U8 sessionId); + +/* --------------------------------------------------------------------------- + \fn sme_getNeighborRoamState + \brief get neighbor roam state + \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier + \return v_U32_t - neighbor roam state + -------------------------------------------------------------------------*/ +v_U32_t sme_getNeighborRoamState(tHalHandle hHal, tANI_U8 sessionId); + +/* --------------------------------------------------------------------------- + \fn sme_getCurrentRoamState + \brief get current roam state + \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier + \return v_U32_t - current roam state + -------------------------------------------------------------------------*/ +v_U32_t sme_getCurrentRoamState(tHalHandle hHal, tANI_U8 sessionId); + +/* --------------------------------------------------------------------------- + \fn sme_getCurrentRoamSubState + \brief get neighbor roam sub state + \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier + \return v_U32_t - current roam sub state + -------------------------------------------------------------------------*/ +v_U32_t sme_getCurrentRoamSubState(tHalHandle hHal, tANI_U8 sessionId); + +/* --------------------------------------------------------------------------- + \fn sme_getLimSmeState + \brief get Lim Sme state + \param hHal - The handle returned by macOpen. + \return v_U32_t - Lim Sme state + -------------------------------------------------------------------------*/ +v_U32_t sme_getLimSmeState(tHalHandle hHal); + +/* --------------------------------------------------------------------------- + \fn sme_getLimMlmState + \brief get Lim Mlm state + \param hHal - The handle returned by macOpen. + \return v_U32_t - Lim Mlm state + -------------------------------------------------------------------------*/ +v_U32_t sme_getLimMlmState(tHalHandle hHal); + +/* --------------------------------------------------------------------------- + \fn sme_IsLimSessionValid + \brief is Lim session valid + \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier + \return v_BOOL_t - true or false + -------------------------------------------------------------------------*/ +v_BOOL_t sme_IsLimSessionValid(tHalHandle hHal, tANI_U8 sessionId); + +/* --------------------------------------------------------------------------- + \fn sme_getLimSmeSessionState + \brief get Lim Sme session state + \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier + \return v_U32_t - Lim Sme session state + -------------------------------------------------------------------------*/ +v_U32_t sme_getLimSmeSessionState(tHalHandle hHal, tANI_U8 sessionId); + +/* --------------------------------------------------------------------------- + \fn sme_getLimMlmSessionState + \brief get Lim Mlm session state + \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier + \return v_U32_t - Lim Mlm session state + -------------------------------------------------------------------------*/ +v_U32_t sme_getLimMlmSessionState(tHalHandle hHal, tANI_U8 sessionId); /* --------------------------------------------------------------------------- \fn sme_getNeighborScanMaxChanTime \brief get neighbor scan max channel time \param hHal - The handle returned by macOpen. + \param sessionId - Session identifier \return v_U16_t - channel max time value -------------------------------------------------------------------------*/ -v_U16_t sme_getNeighborScanMaxChanTime(tHalHandle hHal); +v_U16_t sme_getNeighborScanMaxChanTime(tHalHandle hHal, tANI_U8 sessionId); /* --------------------------------------------------------------------------- \fn sme_setNeighborScanPeriod @@ -2988,18 +3119,21 @@ v_U16_t sme_getNeighborScanMaxChanTime(tHalHandle hHal); to configure nNeighborScanPeriod Usage: adb shell iwpriv wlan0 setConfig nNeighborScanPeriod=[0 .. 60] \param hHal - HAL handle for device + \param sessionId - Session identifier \param nNeighborScanPeriod - neighbor scan period \- return Success or failure -------------------------------------------------------------------------*/ -eHalStatus sme_setNeighborScanPeriod(tHalHandle hHal, const v_U16_t nNeighborScanPeriod); +eHalStatus sme_setNeighborScanPeriod(tHalHandle hHal, tANI_U8 sessionId, + const v_U16_t nNeighborScanPeriod); /* --------------------------------------------------------------------------- \fn sme_getNeighborScanPeriod \brief get neighbor scan period \param hHal - The handle returned by macOpen. + \param sessionId - Session identifier \return v_U16_t - neighbor scan period -------------------------------------------------------------------------*/ -v_U16_t sme_getNeighborScanPeriod(tHalHandle hHal); +v_U16_t sme_getNeighborScanPeriod(tHalHandle hHal, tANI_U8 sessionId); /* --------------------------------------------------------------------------- \fn sme_SetRoamBmissFirstBcnt @@ -3007,6 +3141,7 @@ v_U16_t sme_getNeighborScanPeriod(tHalHandle hHal); This function is called through dynamic setConfig callback function to configure nRoamBmissFirstBcnt \param hHal - HAL handle for device + \param sessionId - Session identifier \param nRoamBmissFirstBcnt - Roam first bmiss count \return eHAL_STATUS_SUCCESS - SME update nRoamBmissFirstBcnt successfully. @@ -3014,6 +3149,7 @@ v_U16_t sme_getNeighborScanPeriod(tHalHandle hHal); -------------------------------------------------------------------------*/ eHalStatus sme_SetRoamBmissFirstBcnt(tHalHandle hHal, + tANI_U8 sessionId, const v_U8_t nRoamBmissFirstBcnt); /*-------------------------------------------------------------------------- @@ -3032,13 +3168,14 @@ v_U8_t sme_GetRoamBmissFirstBcnt(tHalHandle hHal); This function is called through dynamic setConfig callback function to configure nRoamBmissFinalBcnt \param hHal - HAL handle for device + \param sessionId - Session identifier \param nRoamBmissFinalBcnt - Roam final bmiss count \return eHAL_STATUS_SUCCESS - SME update nRoamBmissFinalBcnt successfully. else SME is failed to update nRoamBmissFinalBcnt -------------------------------------------------------------------------*/ -eHalStatus sme_SetRoamBmissFinalBcnt(tHalHandle hHal, +eHalStatus sme_SetRoamBmissFinalBcnt(tHalHandle hHal, tANI_U8 sessionId, const v_U8_t nRoamBmissFinalBcnt); /*-------------------------------------------------------------------------- @@ -3057,13 +3194,14 @@ v_U8_t sme_GetRoamBmissFinalBcnt(tHalHandle hHal); This function is called through dynamic setConfig callback function to configure nRoamBeaconRssiWeight \param hHal - HAL handle for device + \param sessionId - Session identifier \param nRoamBeaconRssiWeight - Roam beacon rssi weight \return eHAL_STATUS_SUCCESS - SME update nRoamBeaconRssiWeight config successfully. else SME is failed to update nRoamBeaconRssiWeight -------------------------------------------------------------------------*/ -eHalStatus sme_SetRoamBeaconRssiWeight(tHalHandle hHal, +eHalStatus sme_SetRoamBeaconRssiWeight(tHalHandle hHal, tANI_U8 sessionId, const v_U8_t nRoamBeaconRssiWeight); /*-------------------------------------------------------------------------- @@ -3080,7 +3218,7 @@ v_U8_t sme_GetRoamBeaconRssiWeight(tHalHandle hHal); #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) /*-------------------------------------------------------------------------- \brief sme_getRoamRssiDiff() - get Roam rssi diff - This is a synchronuous call + This is a synchronous call \param hHal - The handle returned by macOpen. \return eHAL_STATUS_SUCCESS - SME update config successful. Other status means SME is failed to update @@ -3090,43 +3228,49 @@ v_U8_t sme_getRoamRssiDiff(tHalHandle hHal); /*-------------------------------------------------------------------------- \brief sme_ChangeRoamScanChannelList() - Change roam scan channel list - This is a synchronuous call + This is a synchronous call \param hHal - The handle returned by macOpen. + \param sessionId - Session identifier \return eHAL_STATUS_SUCCESS - SME update config successful. Other status means SME is failed to update \sa --------------------------------------------------------------------------*/ -eHalStatus sme_ChangeRoamScanChannelList(tHalHandle hHal, tANI_U8 *pChannelList, +eHalStatus sme_ChangeRoamScanChannelList(tHalHandle hHal, tANI_U8 sessionId, + tANI_U8 *pChannelList, tANI_U8 numChannels); #ifdef FEATURE_WLAN_ESE_UPLOAD /*-------------------------------------------------------------------------- \brief sme_SetEseRoamScanChannelList() - set ese roam scan channel list - This is a synchronuous call + This is a synchronous call \param hHal - The handle returned by macOpen. + \param sessionId - Session identifier \return eHAL_STATUS_SUCCESS - SME update config successful. Other status means SME is failed to update \sa --------------------------------------------------------------------------*/ -eHalStatus sme_SetEseRoamScanChannelList(tHalHandle hHal, +eHalStatus sme_SetEseRoamScanChannelList(tHalHandle hHal, tANI_U8 sessionId, tANI_U8 *pChannelList, tANI_U8 numChannels); #endif /*-------------------------------------------------------------------------- \brief sme_getRoamScanChannelList() - get roam scan channel list - This is a synchronuous call + This is a synchronous call \param hHal - The handle returned by macOpen. + \param pChannelList - Output channel list + \param pNumChannels - Output number of channels + \param sessionId - Session identifier \return eHAL_STATUS_SUCCESS - SME update config successful. Other status means SME is failed to update \sa --------------------------------------------------------------------------*/ eHalStatus sme_getRoamScanChannelList(tHalHandle hHal, tANI_U8 *pChannelList, - tANI_U8 *pNumChannels); + tANI_U8 *pNumChannels, tANI_U8 sessionId); /*-------------------------------------------------------------------------- \brief sme_getIsEseFeatureEnabled() - get ESE feature enabled or not - This is a synchronuous call + This is a synchronous call \param hHal - The handle returned by macOpen. \return TRUE (1) - if the ESE feature is enabled FALSE (0) - if feature is disabled (compile or runtime) @@ -3346,6 +3490,7 @@ VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode, tANI_U8 ch from CSR. This is a synchronous call \param hHal - The handle returned by macOpen + \param sessionId - Session identifier \param pHandoffInfo - info provided by HDD with the handoff request (namely: BSSID, channel etc.) \return eHAL_STATUS_SUCCESS - SME passed the request to CSR successfully. @@ -3353,7 +3498,8 @@ VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode, tANI_U8 ch \sa --------------------------------------------------------------------------*/ -eHalStatus sme_HandoffRequest(tHalHandle hHal, tCsrHandoffRequest *pHandoffInfo); +eHalStatus sme_HandoffRequest(tHalHandle hHal, tANI_U8 sessionId, + tCsrHandoffRequest *pHandoffInfo); #endif /*-------------------------------------------------------------------------- \brief sme_isSta_p2p_clientConnected() - a wrapper function to check if there @@ -3427,7 +3573,8 @@ eHalStatus sme_SendRateUpdateInd(tHalHandle hHal, tSirRateUpdateInd *rateUpdateP */ eHalStatus smeIssueFastRoamNeighborAPEvent (tHalHandle hHal, tANI_U8 *bssid, - tSmeFastRoamTrigger fastRoamTrig); + tSmeFastRoamTrigger fastRoamTrig, + tANI_U8 sessionId); eHalStatus sme_RoamDelPMKIDfromCache( tHalHandle hHal, tANI_U8 sessionId, tANI_U8 *pBSSId ); @@ -3686,6 +3833,7 @@ eHalStatus sme_StatsExtEvent (tHalHandle hHal, void* pMsg); This function is called through dynamic setConfig callback function to configure allowDFSChannelRoam. \param hHal - HAL handle for device + \param sessionId - Session identifier \param allowDFSChannelRoam - DFS roaming scan mode 0 (disable), 1 (passive), 2 (active) \return eHAL_STATUS_SUCCESS - SME update DFS roaming scan config @@ -3693,7 +3841,9 @@ eHalStatus sme_StatsExtEvent (tHalHandle hHal, void* pMsg); Other status means SME failed to update DFS roaming scan config. \sa -------------------------------------------------------------------------*/ -eHalStatus sme_UpdateDFSScanMode(tHalHandle hHal, v_U8_t allowDFSChannelRoam); +eHalStatus sme_UpdateDFSScanMode(tHalHandle hHal, + tANI_U8 sessionId, + v_U8_t allowDFSChannelRoam); /*-------------------------------------------------------------------------- \brief sme_GetDFSScanMode() - get DFS roam scan mode @@ -3708,9 +3858,10 @@ v_BOOL_t sme_GetDFSScanMode(tHalHandle hHal); \fn sme_staInMiddleOfRoaming \brief This function returns TRUE if STA is in the middle of roaming state \param hHal - HAL handle for device + \param sessionId - Session identifier \- return TRUE or FALSE -------------------------------------------------------------------------*/ -tANI_BOOLEAN sme_staInMiddleOfRoaming(tHalHandle hHal); +tANI_BOOLEAN sme_staInMiddleOfRoaming(tHalHandle hHal, tANI_U8 sessionId); #ifdef FEATURE_WLAN_EXTSCAN /* --------------------------------------------------------------------------- @@ -3821,9 +3972,10 @@ eHalStatus sme_ExtScanRegisterCallback (tHalHandle hHal, \fn sme_abortRoamScan \brief API to abort current roam scan cycle by roam scan offload module. \param hHal - The handle returned by macOpen. + \param sessionId - Session identifier \return eHalStatus ---------------------------------------------------------------------------*/ -eHalStatus sme_abortRoamScan(tHalHandle hHal); +eHalStatus sme_abortRoamScan(tHalHandle hHal, tANI_U8 sessionId); #endif //#if WLAN_FEATURE_ROAM_SCAN_OFFLOAD #ifdef WLAN_FEATURE_LINK_LAYER_STATS diff --git a/CORE/SME/inc/sme_FTApi.h b/CORE/SME/inc/sme_FTApi.h index 7d5b0efc85db..24296caa251b 100644 --- a/CORE/SME/inc/sme_FTApi.h +++ b/CORE/SME/inc/sme_FTApi.h @@ -24,6 +24,7 @@ * under proprietary terms before Copyright ownership was assigned * to the Linux Foundation. */ +#if defined(WLAN_FEATURE_VOWIFI_11R) #if !defined( __SME_FTAPI_H ) #define __SME_FTAPI_H @@ -48,50 +49,59 @@ typedef enum eFTIEState // supplicant. Waiting for the keys. } tFTIEStates; +/* FT neighbor roam callback user context */ +typedef struct sFTRoamCallbackUsrCtx +{ + tpAniSirGlobal pMac; + tANI_U8 sessionId; +} tFTRoamCallbackUsrCtx, *tpFTRoamCallbackUsrCtx; typedef struct sFTSMEContext { + /* Received and processed during pre-auth */ tANI_U8 *auth_ft_ies; tANI_U32 auth_ft_ies_length; + /* Received and processed during re-assoc */ tANI_U8 *reassoc_ft_ies; tANI_U16 reassoc_ft_ies_length; - // Pre-Auth info + /* Pre-Auth info */ tFTIEStates FTState; // The state of FT in the current 11rAssoc tSirMacAddr preAuthbssId; // BSSID to preauth to tANI_U32 smeSessionId; - // Saved pFTPreAuthRsp + /* Saved pFTPreAuthRsp */ tpSirFTPreAuthRsp psavedFTPreAuthRsp; v_BOOL_t setFTPreAuthState; v_BOOL_t setFTPTKState; - // Time to trigger reassoc once pre-auth is successful + /* Time to trigger reassoc once pre-auth is successful */ vos_timer_t preAuthReassocIntvlTimer; - tCsrRoamSetKey *pCsrFTKeyInfo; v_BOOL_t addMDIE; + + /* User context for the timer callback */ + tpFTRoamCallbackUsrCtx pUsrCtx; } tftSMEContext, *tpftSMEContext; /*-------------------------------------------------------------------------- Prototype functions ------------------------------------------------------------------------*/ -void sme_FTOpen(tHalHandle hHal); -void sme_FTClose(tHalHandle hHal); -void sme_SetFTIEs( tHalHandle hHal, tANI_U8 sessionId, const tANI_U8 *ft_ies, tANI_U16 ft_ies_length ); -eHalStatus sme_FTUpdateKey( tHalHandle hHal, tCsrRoamSetKey * pFTKeyInfo ); -void csrFTPreAuthRspProcessor( tHalHandle hHal, tpSirFTPreAuthRsp pFTPreAuthRsp ); -void sme_GetFTPreAuthResponse( tHalHandle hHal, tANI_U8 *ft_ies, tANI_U32 ft_ies_ip_len, tANI_U16 *ft_ies_length ); -void sme_GetRICIEs( tHalHandle hHal, tANI_U8 *ric_ies, tANI_U32 ric_ies_ip_len, tANI_U32 *ric_ies_length ); +void sme_FTOpen(tHalHandle hHal, tANI_U32 sessionId); +void sme_FTClose(tHalHandle hHal, tANI_U32 sessionId); +void sme_FTReset(tHalHandle hHal, tANI_U32 sessionId); +void sme_SetFTIEs( tHalHandle hHal, tANI_U32 sessionId, const tANI_U8 *ft_ies, tANI_U16 ft_ies_length ); +eHalStatus sme_FTUpdateKey( tHalHandle hHal, tANI_U32 sessionId, tCsrRoamSetKey * pFTKeyInfo ); +void sme_GetFTPreAuthResponse(tHalHandle hHal, tANI_U32 sessionId, tANI_U8 *ft_ies, + tANI_U32 ft_ies_ip_len, tANI_U16 *ft_ies_length ); +void sme_GetRICIEs(tHalHandle hHal, tANI_U32 sessionId, tANI_U8 *ric_ies, + tANI_U32 ric_ies_ip_len, tANI_U32 *ric_ies_length ); void sme_PreauthReassocIntvlTimerCallback(void *context); -void sme_SetFTPreAuthState(tHalHandle hHal, v_BOOL_t state); -v_BOOL_t sme_GetFTPreAuthState(tHalHandle hHal); -v_BOOL_t sme_GetFTPTKState(tHalHandle hHal); -void sme_SetFTPTKState(tHalHandle hHal, v_BOOL_t state); -#if defined(WLAN_FEATURE_VOWIFI_11R) -void sme_FTReset(tHalHandle hHal); +void sme_SetFTPreAuthState(tHalHandle hHal, tANI_U32 sessionId, v_BOOL_t state); +v_BOOL_t sme_GetFTPreAuthState(tHalHandle hHal, tANI_U32 sessionId); +v_BOOL_t sme_GetFTPTKState(tHalHandle hHal, tANI_U32 sessionId); +void sme_SetFTPTKState(tHalHandle hHal, tANI_U32 sessionId, v_BOOL_t state); #endif - #endif //#if !defined( __SME_FTAPI_H ) diff --git a/CORE/SME/src/QoS/sme_Qos.c b/CORE/SME/src/QoS/sme_Qos.c index 23443066c383..8d7f2266f537 100644 --- a/CORE/SME/src/QoS/sme_Qos.c +++ b/CORE/SME/src/QoS/sme_Qos.c @@ -4597,20 +4597,20 @@ eHalStatus sme_QosProcessReassocSuccessEv(tpAniSirGlobal pMac, v_U8_t sessionId, #ifdef WLAN_FEATURE_VOWIFI_11R if (pSession->ftHandoffInProgress) { - if (csrRoamIs11rAssoc(pMac)) - { - if (pCsrRoamSession && pCsrRoamSession->connectedInfo.nRICRspLength) - { - status = sme_QosProcessFTReassocRspEv(pMac, sessionId, pEvent_info); + if (csrRoamIs11rAssoc(pMac, sessionId)) { + if (pCsrRoamSession && + pCsrRoamSession->connectedInfo.nRICRspLength) { + status = sme_QosProcessFTReassocRspEv(pMac, sessionId, + pEvent_info); } } #ifdef FEATURE_WLAN_ESE // If ESE association check for TSPEC IEs in the reassoc rsp frame - if (csrRoamIsESEAssoc(pMac)) - { - if (pCsrRoamSession && pCsrRoamSession->connectedInfo.nTspecIeLength) - { - status = sme_QosESEProcessReassocTspecRsp(pMac, sessionId, pEvent_info); + if (csrRoamIsESEAssoc(pMac, sessionId)) { + if (pCsrRoamSession && + pCsrRoamSession->connectedInfo.nTspecIeLength) { + status = sme_QosESEProcessReassocTspecRsp(pMac, sessionId, + pEvent_info); } } #endif @@ -5133,17 +5133,24 @@ eHalStatus sme_QosProcessJoinReqEv(tpAniSirGlobal pMac, v_U8_t sessionId, void * \sa --------------------------------------------------------------------------*/ -eHalStatus sme_QosProcessPreauthSuccessInd(tpAniSirGlobal pMac, v_U8_t sessionId, void * pEvent_info) +eHalStatus sme_QosProcessPreauthSuccessInd(tpAniSirGlobal pMac, + v_U8_t sessionId, void * pEvent_info) { sme_QosSessionInfo *pSession; + tCsrRoamSession *pSmeSession = CSR_GET_SESSION( pMac, sessionId ); sme_QosACInfo *pACInfo; v_U8_t ac; eHalStatus status = eHAL_STATUS_SUCCESS; VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, - "%s: %d: invoked on session %d", - __func__, __LINE__, - sessionId); + FL("invoked on SME session %d"), sessionId); + + if (NULL == pSmeSession) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("pSmeSession is NULL")); + return eHAL_STATUS_INVALID_PARAMETER; + } pSession = &sme_QosCb.sessionInfo[sessionId]; @@ -5176,21 +5183,31 @@ eHalStatus sme_QosProcessPreauthSuccessInd(tpAniSirGlobal pMac, v_U8_t sessionId pSession->ftHandoffInProgress = VOS_TRUE; // Check if its a 11R roaming before preparing the RIC IEs - if (csrRoamIs11rAssoc(pMac)) - { + if (csrRoamIs11rAssoc(pMac, sessionId)) { v_U16_t ricOffset = 0; v_U32_t ricIELength = 0; v_U8_t *ricIE; v_U8_t tspec_mask_status = 0; v_U8_t tspec_pending_status = 0; - /* Any Block Ack info there, should have been already filled by PE and present in this buffer - and the ric_ies_length should contain the length of the whole RIC IEs. Filling of TSPEC info - should start from this length */ - ricIE = pMac->ft.ftSmeContext.psavedFTPreAuthRsp->ric_ies; - ricOffset = pMac->ft.ftSmeContext.psavedFTPreAuthRsp->ric_ies_length; + /* Data is accessed from saved PreAuth Rsp */ + if (NULL == pSmeSession->ftSmeContext.psavedFTPreAuthRsp) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("psavedFTPreAuthRsp is NULL")); + return eHAL_STATUS_INVALID_PARAMETER; + } + + /* Any Block Ack info there, should have been already filled by PE and + present in this buffer and the ric_ies_length should contain the + length of the whole RIC IEs. Filling of TSPEC info should start + from this length */ + ricIE = pSmeSession->ftSmeContext.psavedFTPreAuthRsp->ric_ies; + ricOffset = + pSmeSession->ftSmeContext.psavedFTPreAuthRsp->ric_ies_length; - /* Now we have to process the currentTspeInfo inside this session and create the RIC IEs */ + /* Now we have to process the currentTspeInfo inside this session and + create the RIC IEs */ for(ac = SME_QOS_EDCA_AC_BE; ac < SME_QOS_EDCA_AC_MAX; ac++) { volatile v_U8_t tspec_index = 0; @@ -5207,21 +5224,26 @@ eHalStatus sme_QosProcessPreauthSuccessInd(tpAniSirGlobal pMac, v_U8_t sessionId { if (tspec_mask_status & 0x1) { - /* If a tspec status is pending, take requested_QoSInfo for RIC request, else use curr_QoSInfo - for the RIC request */ + /* If a tspec status is pending, take requested_QoSInfo for + RIC request, else use curr_QoSInfo for the RIC request */ if (tspec_pending_status & 0x1) { - status = sme_QosCreateTspecRICIE(pMac, &pACInfo->requested_QoSInfo[tspec_index], - ricIE + ricOffset, &ricIELength, &pACInfo->ricIdentifier[tspec_index]); + status = sme_QosCreateTspecRICIE(pMac, + &pACInfo->requested_QoSInfo[tspec_index], + ricIE + ricOffset, &ricIELength, + &pACInfo->ricIdentifier[tspec_index]); } else { - status = sme_QosCreateTspecRICIE(pMac, &pACInfo->curr_QoSInfo[tspec_index], - ricIE + ricOffset, &ricIELength, &pACInfo->ricIdentifier[tspec_index]); + status = sme_QosCreateTspecRICIE(pMac, + &pACInfo->curr_QoSInfo[tspec_index], + ricIE + ricOffset, &ricIELength, + &pACInfo->ricIdentifier[tspec_index]); } } ricOffset += ricIELength; - pMac->ft.ftSmeContext.psavedFTPreAuthRsp->ric_ies_length += ricIELength; + pSmeSession->ftSmeContext.psavedFTPreAuthRsp->ric_ies_length += + ricIELength; tspec_mask_status >>= 1; tspec_pending_status >>= 1; diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c index cb0f277f5145..df1734178aab 100644 --- a/CORE/SME/src/csr/csrApiRoam.c +++ b/CORE/SME/src/csr/csrApiRoam.c @@ -572,7 +572,8 @@ eHalStatus csrStart(tpAniSirGlobal pMac) pMac->roam.sPendingCommands = 0; csrScanEnable(pMac); #if defined WLAN_FEATURE_NEIGHBOR_ROAMING - status = csrNeighborRoamInit(pMac); + for (i = 0; i < CSR_ROAM_SESSION_MAX; i++) + status = csrNeighborRoamInit(pMac, i); #endif /* WLAN_FEATURE_NEIGHBOR_ROAMING */ pMac->roam.tlStatsReqInfo.numClient = 0; pMac->roam.tlStatsReqInfo.periodicity = 0; @@ -602,7 +603,6 @@ eHalStatus csrStart(tpAniSirGlobal pMac) eHalStatus csrStop(tpAniSirGlobal pMac, tHalStopType stopType) { tANI_U32 sessionId; - tANI_U32 i; for(sessionId = 0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++) { @@ -614,9 +614,13 @@ eHalStatus csrStop(tpAniSirGlobal pMac, tHalStopType stopType) csrLLPurge( &pMac->roam.roamCmdPendingList, eANI_BOOLEAN_TRUE ); #if defined WLAN_FEATURE_NEIGHBOR_ROAMING - csrNeighborRoamClose(pMac); + for (sessionId = 0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++) + csrNeighborRoamClose(pMac, sessionId); #endif - csrScanFlushResult(pMac); //Do we want to do this? + for (sessionId = 0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++) + if (CSR_IS_SESSION_VALID(pMac, sessionId)) + csrScanFlushResult(pMac, sessionId); + // deregister from PMC since we register during csrStart() // (ignore status since there is nothing we can do if it fails) if(!pMac->psOffloadEnabled) @@ -635,10 +639,9 @@ eHalStatus csrStop(tpAniSirGlobal pMac, tHalStopType stopType) //Reset the domain back to the deault pMac->scan.domainIdCurrent = pMac->scan.domainIdDefault; - for( i = 0; i < CSR_ROAM_SESSION_MAX; i++ ) - { - csrRoamStateChange( pMac, eCSR_ROAMING_STATE_STOP, i ); - pMac->roam.curSubState[i] = eCSR_ROAM_SUBSTATE_NONE; + for (sessionId = 0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++) { + csrRoamStateChange(pMac, eCSR_ROAMING_STATE_STOP, sessionId); + pMac->roam.curSubState[sessionId] = eCSR_ROAM_SUBSTATE_NONE; } #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD @@ -1153,11 +1156,12 @@ eCsrBand csrGetCurrentBand(tHalHandle hHal) /* This function flushes the roam scan cache */ -eHalStatus csrFlushRoamScanRoamChannelList(tpAniSirGlobal pMac) +eHalStatus csrFlushRoamScanRoamChannelList(tpAniSirGlobal pMac, + tANI_U8 sessionId) { eHalStatus status = eHAL_STATUS_SUCCESS; tpCsrNeighborRoamControlInfo pNeighborRoamInfo - = &pMac->roam.neighborRoamInfo; + = &pMac->roam.neighborRoamInfo[sessionId]; /* Free up the memory first (if required) */ if (NULL != pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList) @@ -1178,10 +1182,12 @@ eHalStatus csrFlushRoamScanRoamChannelList(tpAniSirGlobal pMac) /* This function flushes the roam scan cache */ -eHalStatus csrFlushCfgBgScanRoamChannelList(tpAniSirGlobal pMac) +eHalStatus csrFlushCfgBgScanRoamChannelList(tpAniSirGlobal pMac, + tANI_U8 sessionId) { eHalStatus status = eHAL_STATUS_SUCCESS; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; /* Free up the memory first (if required) */ if (NULL != pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) @@ -1200,11 +1206,13 @@ eHalStatus csrFlushCfgBgScanRoamChannelList(tpAniSirGlobal pMac) based on the input channel list */ eHalStatus csrCreateBgScanRoamChannelList(tpAniSirGlobal pMac, + tANI_U8 sessionId, const tANI_U8 *pChannelList, const tANI_U8 numChannels) { eHalStatus status = eHAL_STATUS_SUCCESS; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels = numChannels; @@ -1232,10 +1240,12 @@ eHalStatus csrCreateBgScanRoamChannelList(tpAniSirGlobal pMac, if the band is 5G, then make sure channel list contains only 5G valid channels */ eHalStatus csrUpdateBgScanConfigIniChannelList(tpAniSirGlobal pMac, + tANI_U8 sessionId, eCsrBand eBand) { eHalStatus status = eHAL_STATUS_SUCCESS; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; tANI_U8 outNumChannels = 0; tANI_U8 inNumChannels = 0; tANI_U8 *inPtr = NULL; @@ -1263,8 +1273,9 @@ eHalStatus csrUpdateBgScanConfigIniChannelList(tpAniSirGlobal pMac, ChannelList[outNumChannels++] = inPtr[i]; } } - csrFlushCfgBgScanRoamChannelList(pMac); - csrCreateBgScanRoamChannelList(pMac, ChannelList, outNumChannels); + csrFlushCfgBgScanRoamChannelList(pMac, sessionId); + csrCreateBgScanRoamChannelList(pMac, sessionId, ChannelList, + outNumChannels); } else if (eCSR_BAND_5G == eBand) { @@ -1278,8 +1289,9 @@ eHalStatus csrUpdateBgScanConfigIniChannelList(tpAniSirGlobal pMac, ChannelList[outNumChannels++] = inPtr[i]; } } - csrFlushCfgBgScanRoamChannelList(pMac); - csrCreateBgScanRoamChannelList(pMac, ChannelList, outNumChannels); + csrFlushCfgBgScanRoamChannelList(pMac, sessionId); + csrCreateBgScanRoamChannelList(pMac, sessionId, ChannelList, + outNumChannels); } else if (eCSR_BAND_ALL == eBand) { @@ -1291,8 +1303,9 @@ eHalStatus csrUpdateBgScanConfigIniChannelList(tpAniSirGlobal pMac, ChannelList[outNumChannels++] = inPtr[i]; } } - csrFlushCfgBgScanRoamChannelList(pMac); - csrCreateBgScanRoamChannelList(pMac, ChannelList, outNumChannels); + csrFlushCfgBgScanRoamChannelList(pMac, sessionId); + csrCreateBgScanRoamChannelList(pMac, sessionId, ChannelList, + outNumChannels); } else { @@ -1316,13 +1329,14 @@ eHalStatus csrUpdateBgScanConfigIniChannelList(tpAniSirGlobal pMac, * only 5G valid channels */ eHalStatus csrCreateRoamScanChannelList(tpAniSirGlobal pMac, + tANI_U8 sessionId, tANI_U8 *pChannelList, tANI_U8 numChannels, const eCsrBand eBand) { eHalStatus status = eHAL_STATUS_SUCCESS; tpCsrNeighborRoamControlInfo pNeighborRoamInfo - = &pMac->roam.neighborRoamInfo; + = &pMac->roam.neighborRoamInfo[sessionId]; tANI_U8 outNumChannels = 0; tANI_U8 inNumChannels = numChannels; tANI_U8 *inPtr = pChannelList; @@ -1338,11 +1352,11 @@ eHalStatus csrCreateRoamScanChannelList(tpAniSirGlobal pMac, * the DUT to get a candidate AP while roaming even if the Neighbor * Report is not able to provide sufficient information. */ - if (pMac->scan.occupiedChannels.numChannels) + if (pMac->scan.occupiedChannels[sessionId].numChannels) { csrNeighborRoamMergeChannelLists(pMac, - &pMac->scan.occupiedChannels.channelList[0], - pMac->scan.occupiedChannels.numChannels, + &pMac->scan.occupiedChannels[sessionId].channelList[0], + pMac->scan.occupiedChannels[sessionId].numChannels, inPtr, inNumChannels, &mergedOutputNumOfChannels); @@ -1400,6 +1414,7 @@ eHalStatus csrCreateRoamScanChannelList(tpAniSirGlobal pMac, { csrNeighborRoamChannelsFilterByCurrentBand( pMac, + sessionId, ChannelList, outNumChannels, tmpChannelList, @@ -1433,7 +1448,7 @@ eHalStatus csrCreateRoamScanChannelList(tpAniSirGlobal pMac, } #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ -eHalStatus csrSetBand(tHalHandle hHal, eCsrBand eBand) +eHalStatus csrSetBand(tHalHandle hHal, tANI_U8 sessionId, eCsrBand eBand) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_SUCCESS; @@ -1464,8 +1479,10 @@ eHalStatus csrSetBand(tHalHandle hHal, eCsrBand eBand) pMac->roam.configParam.bandCapability = eBand; csrScanGetSupportedChannels( pMac ); #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) +#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (!csrRoamIsRoamOffloadScanEnabled(pMac)) - csrUpdateBgScanConfigIniChannelList( pMac, eBand ); +#endif + csrUpdateBgScanConfigIniChannelList(pMac, sessionId, eBand); #endif status = csrInitGetChannels( pMac ); if (eHAL_STATUS_SUCCESS == status) @@ -2684,14 +2701,15 @@ eHalStatus csrRoamCallCallback(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoam return (status); } // Returns whether handoff is currently in progress or not -tANI_BOOLEAN csrRoamIsHandoffInProgress(tpAniSirGlobal pMac) +tANI_BOOLEAN csrRoamIsHandoffInProgress(tpAniSirGlobal pMac, tANI_U8 sessionId) { #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING - return csrNeighborRoamIsHandoffInProgress(pMac); + return csrNeighborRoamIsHandoffInProgress(pMac, sessionId); #else return eANI_BOOLEAN_FALSE; #endif } + eHalStatus csrRoamIssueDisassociate( tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamSubState NewSubstate, tANI_BOOLEAN fMICFailure ) { @@ -2727,10 +2745,11 @@ eHalStatus csrRoamIssueDisassociate( tpAniSirGlobal pMac, tANI_U32 sessionId, reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON; } #ifdef WLAN_FEATURE_VOWIFI_11R - if ( (csrRoamIsHandoffInProgress(pMac)) && + if ( (csrRoamIsHandoffInProgress(pMac, sessionId)) && (NewSubstate != eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF)) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; vos_mem_copy(&bssId, pNeighborRoamInfo->csrNeighborRoamProfile.BSSIDs.bssid, sizeof(tSirMacAddr)); @@ -4129,7 +4148,7 @@ eHalStatus csrRoamStopNetwork( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoam ) { tANI_BOOLEAN is11rRoamingFlag = eANI_BOOLEAN_FALSE; - is11rRoamingFlag = csrRoamIs11rAssoc(pMac); + is11rRoamingFlag = csrRoamIs11rAssoc(pMac, sessionId); // Set parameters for this Bss. status = csrRoamSetBssConfigCfg(pMac, sessionId, pProfile, pBssDesc, pBssConfig, @@ -5306,10 +5325,10 @@ static void csrCheckAndUpdateACWeight( tpAniSirGlobal pMac, tDot11fBeaconIEs *pI } #ifdef WLAN_FEATURE_VOWIFI_11R //Returns whether the current association is a 11r assoc or not -tANI_BOOLEAN csrRoamIs11rAssoc(tpAniSirGlobal pMac) +tANI_BOOLEAN csrRoamIs11rAssoc(tpAniSirGlobal pMac, tANI_U8 sessionId) { #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING - return csrNeighborRoamIs11rAssoc(pMac); + return csrNeighborRoamIs11rAssoc(pMac, sessionId); #else return eANI_BOOLEAN_FALSE; #endif @@ -5317,10 +5336,10 @@ tANI_BOOLEAN csrRoamIs11rAssoc(tpAniSirGlobal pMac) #endif #ifdef FEATURE_WLAN_ESE //Returns whether the current association is a ESE assoc or not -tANI_BOOLEAN csrRoamIsESEAssoc(tpAniSirGlobal pMac) +tANI_BOOLEAN csrRoamIsESEAssoc(tpAniSirGlobal pMac, tANI_U8 sessionId) { #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING - return csrNeighborRoamIsESEAssoc(pMac); + return csrNeighborRoamIsESEAssoc(pMac, sessionId); #else return eANI_BOOLEAN_FALSE; #endif @@ -5365,13 +5384,14 @@ tANI_BOOLEAN csrRoamIsFastRoamEnabled(tpAniSirGlobal pMac, tANI_U32 sessionId) is a ESE assoc or not \param pMac - The handle returned by macOpen. + \param sessionId - Session Id \return eANI_BOOLEAN_TRUE if current assoc is ESE, eANI_BOOLEAN_FALSE otherwise ---------------------------------------------------------------------------*/ -tANI_BOOLEAN csrNeighborRoamIsESEAssoc(tpAniSirGlobal pMac) +tANI_BOOLEAN csrNeighborRoamIsESEAssoc(tpAniSirGlobal pMac, tANI_U8 sessionId) { - return pMac->roam.neighborRoamInfo.isESEAssoc; + return pMac->roam.neighborRoamInfo[sessionId].isESEAssoc; } #endif /* FEATURE_WLAN_ESE */ @@ -5870,7 +5890,10 @@ static tANI_BOOLEAN csrRoamProcessResults( tpAniSirGlobal pMac, tSmeCmd *pComman } if (!CSR_IS_INFRA_AP(pProfile)) { - pScanResult = csrScanAppendBssDescription( pMac, pSirBssDesc, pIes, FALSE ); + pScanResult = csrScanAppendBssDescription(pMac, + pSirBssDesc, + pIes, FALSE, + sessionId); } csrRoamSaveConnectedBssDesc(pMac, sessionId, pSirBssDesc); csrRoamFreeConnectProfile(pMac, &pSession->connectedProfile); @@ -6177,7 +6200,7 @@ static tANI_BOOLEAN csrRoamProcessResults( tpAniSirGlobal pMac, tSmeCmd *pComman /* Defeaturize this later if needed */ #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING /* If Join fails while Handoff is in progress, indicate disassociated event to supplicant to reconnect */ - if (csrRoamIsHandoffInProgress(pMac)) + if (csrRoamIsHandoffInProgress(pMac, sessionId)) { /* Should indicate neighbor roam algorithm about the connect failure here */ csrNeighborRoamIndicateConnect(pMac, (tANI_U8)sessionId, VOS_STATUS_E_FAILURE); @@ -7454,7 +7477,10 @@ eHalStatus csrRoamDisconnectInternal(tpAniSirGlobal pMac, tANI_U32 sessionId, eC } else { - smsLog( pMac, LOGE, FL("Roam command is not present")); + csrScanAbortScanForSSID(pMac, sessionId); + status = eHAL_STATUS_CMD_NOT_QUEUED; + smsLog( pMac, LOG1, FL(" Disconnect cmd not queued, Roam command is not present" + " return with status %d"), status); } return (status); } @@ -7664,7 +7690,7 @@ static void csrRoamJoinRspProcessor( tpAniSirGlobal pMac, tSirSmeJoinRsp *pSmeJo smsLog( pMac, LOGW, "SmeJoinReq failed with statusCode= 0x%08X [%d]", pSmeJoinRsp->statusCode, pSmeJoinRsp->statusCode ); #if defined WLAN_FEATURE_NEIGHBOR_ROAMING /* If Join fails while Handoff is in progress, indicate disassociated event to supplicant to reconnect */ - if (csrRoamIsHandoffInProgress(pMac)) + if (csrRoamIsHandoffInProgress(pMac, pSmeJoinRsp->sessionId)) { csrRoamCallCallback(pMac, pSmeJoinRsp->sessionId, NULL, roamId, eCSR_ROAM_DISASSOCIATED, eCSR_ROAM_RESULT_FORCED); /* Should indicate neighbor roam algorithm about the connect failure here */ @@ -8083,8 +8109,8 @@ static void csrRoamingStateConfigCnfProcessor( tpAniSirGlobal pMac, tANI_U32 res /* Reassoc request will be used only for ESE and 11r handoff whereas other legacy roaming should * use join request */ #ifdef WLAN_FEATURE_VOWIFI_11R - if (csrRoamIsHandoffInProgress(pMac) && - csrRoamIs11rAssoc(pMac)) + if (csrRoamIsHandoffInProgress(pMac, sessionId) && + csrRoamIs11rAssoc(pMac, sessionId)) { status = csrRoamIssueReassociate(pMac, sessionId, pBssDesc, (tDot11fBeaconIEs *)( pScanResult->Result.pvIes ), &pCommand->u.roamCmd.roamProfile); @@ -8092,8 +8118,8 @@ static void csrRoamingStateConfigCnfProcessor( tpAniSirGlobal pMac, tANI_U32 res else #endif #ifdef FEATURE_WLAN_ESE - if (csrRoamIsHandoffInProgress(pMac) && - csrRoamIsESEAssoc(pMac)) + if (csrRoamIsHandoffInProgress(pMac, sessionId) && + csrRoamIsESEAssoc(pMac, sessionId)) { // Now serialize the reassoc command. status = csrRoamIssueReassociateCmd(pMac, sessionId); @@ -8101,8 +8127,8 @@ static void csrRoamingStateConfigCnfProcessor( tpAniSirGlobal pMac, tANI_U32 res else #endif #ifdef FEATURE_WLAN_LFR - if (csrRoamIsHandoffInProgress(pMac) && - csrRoamIsFastRoamEnabled(pMac, sessionId)) + if (csrRoamIsHandoffInProgress(pMac, sessionId) && + csrRoamIsFastRoamEnabled(pMac, sessionId)) { // Now serialize the reassoc command. status = csrRoamIssueReassociateCmd(pMac, sessionId); @@ -8182,7 +8208,8 @@ static void csrRoamRoamingStateAuthRspProcessor( tpAniSirGlobal pMac, tSirSmeAut static void csrRoamRoamingStateReassocRspProcessor( tpAniSirGlobal pMac, tpSirSmeJoinRsp pSmeJoinRsp ) { eCsrRoamCompleteResult result; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[pSmeJoinRsp->sessionId]; tCsrRoamInfo roamInfo; tANI_U32 roamId = 0; @@ -8195,7 +8222,7 @@ static void csrRoamRoamingStateReassocRspProcessor( tpAniSirGlobal pMac, tpSirSm #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING /* Since the neighbor roam algorithm uses reassoc req for handoff instead of join, * we need the response contents while processing the result in csrRoamProcessResults() */ - if (csrRoamIsHandoffInProgress(pMac)) + if (csrRoamIsHandoffInProgress(pMac, pSmeJoinRsp->sessionId)) { /* Need to dig more on indicating events to SME QoS module */ sme_QosCsrEventInd(pMac, pSmeJoinRsp->sessionId, SME_QOS_CSR_HANDOFF_COMPLETE, NULL); @@ -8221,8 +8248,10 @@ static void csrRoamRoamingStateReassocRspProcessor( tpAniSirGlobal pMac, tpSirSm if (pNeighborRoamInfo) { vos_mem_zero(&roamInfo, sizeof(tCsrRoamInfo)); - csrRoamCallCallback(pMac, pNeighborRoamInfo->csrSessionId, - &roamInfo, roamId, eCSR_ROAM_FT_REASSOC_FAILED, eSIR_SME_SUCCESS); + csrRoamCallCallback(pMac, pSmeJoinRsp->sessionId, + &roamInfo, roamId, + eCSR_ROAM_FT_REASSOC_FAILED, + eSIR_SME_SUCCESS); /* * Since the above callback sends a disconnect * to HDD, we should clean-up our state @@ -8294,6 +8323,7 @@ void csrRoamRoamingStateDisassocRspProcessor( tpAniSirGlobal pMac, tSirSmeDisass #endif tANI_U32 sessionId; tCsrRoamSession *pSession; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = NULL; tSirSmeDisassocRsp SmeDisassocRsp; @@ -8333,6 +8363,7 @@ void csrRoamRoamingStateDisassocRspProcessor( tpAniSirGlobal pMac, tSirSmeDisass { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, "CSR SmeDisassocReq due to HO on session %d", sessionId ); + pNeighborRoamInfo = &pMac->roam.neighborRoamInfo[sessionId]; #if defined (WLAN_FEATURE_NEIGHBOR_ROAMING) /* * First ensure if the roam profile is in the scan cache. @@ -8347,7 +8378,8 @@ void csrRoamRoamingStateDisassocRspProcessor( tpAniSirGlobal pMac, tSirSmeDisass { vos_mem_set(pScanFilter, sizeof(tCsrScanResultFilter), 0); status = csrRoamPrepareFilterFromProfile(pMac, - &pMac->roam.neighborRoamInfo.csrNeighborRoamProfile, pScanFilter); + &pNeighborRoamInfo->csrNeighborRoamProfile, + pScanFilter); if(!HAL_STATUS_SUCCESS(status)) { smsLog(pMac, LOGE, "%s: failed to prepare scan filter with status %d", @@ -8419,7 +8451,7 @@ void csrRoamRoamingStateDisassocRspProcessor( tpAniSirGlobal pMac, tSirSmeDisass roamInfo.reasonCode = eCsrRoamReasonBetterAP; vos_mem_copy(roamInfo.bssid, - pMac->roam.neighborRoamInfo.csrNeighborRoamProfile.BSSIDs.bssid, + pNeighborRoamInfo->csrNeighborRoamProfile.BSSIDs.bssid, sizeof(tSirMacAddr)); csrRoamCallCallback(pMac,sessionId, &roamInfo, 0, @@ -9774,21 +9806,24 @@ void csrRoamCheckForLinkStatusChange( tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg ) // from current ap and then go to disconnected state // This happens for ESE and 11r FT connections ONLY. #ifdef WLAN_FEATURE_VOWIFI_11R - if (csrRoamIs11rAssoc(pMac) && (csrNeighborRoamStatePreauthDone(pMac))) - { - csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac); + if (csrRoamIs11rAssoc(pMac, sessionId) && + (csrNeighborRoamStatePreauthDone(pMac, sessionId))) { + csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac, + sessionId); } #endif #ifdef FEATURE_WLAN_ESE - if (csrRoamIsESEAssoc(pMac) && (csrNeighborRoamStatePreauthDone(pMac))) - { - csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac); + if (csrRoamIsESEAssoc(pMac, sessionId) && + (csrNeighborRoamStatePreauthDone(pMac, sessionId))) { + csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac, + sessionId); } #endif #ifdef FEATURE_WLAN_LFR - if (csrRoamIsFastRoamEnabled(pMac, sessionId) && (csrNeighborRoamStatePreauthDone(pMac))) - { - csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac); + if (csrRoamIsFastRoamEnabled(pMac, sessionId) && + (csrNeighborRoamStatePreauthDone(pMac, sessionId))) { + csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac, + sessionId); } #endif pSession = CSR_GET_SESSION( pMac, sessionId ); @@ -9856,21 +9891,24 @@ void csrRoamCheckForLinkStatusChange( tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg ) // from current ap and then go to disconnected state // This happens for ESE and 11r FT connections ONLY. #ifdef WLAN_FEATURE_VOWIFI_11R - if (csrRoamIs11rAssoc(pMac) && (csrNeighborRoamStatePreauthDone(pMac))) - { - csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac); + if (csrRoamIs11rAssoc(pMac, sessionId) && + (csrNeighborRoamStatePreauthDone(pMac, sessionId))) { + csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac, + sessionId); } #endif #ifdef FEATURE_WLAN_ESE - if (csrRoamIsESEAssoc(pMac) && (csrNeighborRoamStatePreauthDone(pMac))) - { - csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac); + if (csrRoamIsESEAssoc(pMac, sessionId) && + (csrNeighborRoamStatePreauthDone(pMac, sessionId))) { + csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac, + sessionId); } #endif #ifdef FEATURE_WLAN_LFR - if (csrRoamIsFastRoamEnabled(pMac, sessionId) && (csrNeighborRoamStatePreauthDone(pMac))) - { - csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac); + if (csrRoamIsFastRoamEnabled(pMac, sessionId) && + (csrNeighborRoamStatePreauthDone(pMac, sessionId))) { + csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac, + sessionId); } #endif pSession = CSR_GET_SESSION( pMac, sessionId ); @@ -10604,8 +10642,8 @@ void csrRoamCheckForLinkStatusChange( tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg ) break; #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD case eWNI_SME_CANDIDATE_FOUND_IND: - smsLog( pMac, LOG2, FL("Candidate found indication from PE")); - csrNeighborRoamCandidateFoundIndHdlr( pMac, pSirMsg ); + smsLog(pMac, LOG2, FL("Candidate found indication from PE")); + csrNeighborRoamCandidateFoundIndHdlr(pMac, pSirMsg); break; case eWNI_SME_HANDOFF_REQ: smsLog( pMac, LOG2, FL("Handoff Req from self")); @@ -10805,14 +10843,14 @@ void csrRoamWaitForKeyTimeOutHandler(void *pv) smsLog(pMac, LOGW, FL("WaitForKey timer expired in state=%s sub-state=%s"), macTraceGetNeighbourRoamState( - pMac->roam.neighborRoamInfo.neighborRoamState), + pMac->roam.neighborRoamInfo[pInfo->sessionId].neighborRoamState), macTraceGetcsrRoamSubState( pMac->roam.curSubState[pInfo->sessionId])); if( CSR_IS_WAIT_FOR_KEY( pMac, pInfo->sessionId ) ) { #ifdef FEATURE_WLAN_LFR - if (csrNeighborRoamIsHandoffInProgress(pMac)) + if (csrNeighborRoamIsHandoffInProgress(pMac, pInfo->sessionId)) { /* * Enable heartbeat timer when hand-off is in progress @@ -10866,13 +10904,16 @@ void csrRoamWaitForKeyTimeOutHandler(void *pv) eHalStatus csrRoamStartWaitForKeyTimer(tpAniSirGlobal pMac, tANI_U32 interval) { eHalStatus status; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[pMac->roam.WaitForKeyTimerInfo.sessionId]; #ifdef FEATURE_WLAN_LFR - if (csrNeighborRoamIsHandoffInProgress(pMac)) + if (csrNeighborRoamIsHandoffInProgress(pMac, + pMac->roam.WaitForKeyTimerInfo.sessionId)) { /* Disable heartbeat timer when hand-off is in progress */ smsLog(pMac, LOG2, FL("disabling HB timer in state=%s sub-state=%s"), macTraceGetNeighbourRoamState( - pMac->roam.neighborRoamInfo.neighborRoamState), + pNeighborRoamInfo->neighborRoamState), macTraceGetcsrRoamSubState( pMac->roam.curSubState[pMac->roam.WaitForKeyTimerInfo.sessionId] )); @@ -10887,13 +10928,17 @@ eHalStatus csrRoamStartWaitForKeyTimer(tpAniSirGlobal pMac, tANI_U32 interval) eHalStatus csrRoamStopWaitForKeyTimer(tpAniSirGlobal pMac) { + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[pMac->roam.WaitForKeyTimerInfo.sessionId]; + smsLog(pMac, LOG2, FL("WaitForKey timer stopped in state=%s sub-state=%s"), macTraceGetNeighbourRoamState( - pMac->roam.neighborRoamInfo.neighborRoamState), + pNeighborRoamInfo->neighborRoamState), macTraceGetcsrRoamSubState( pMac->roam.curSubState[pMac->roam.WaitForKeyTimerInfo.sessionId])); #ifdef FEATURE_WLAN_LFR - if (csrNeighborRoamIsHandoffInProgress(pMac)) + if (csrNeighborRoamIsHandoffInProgress(pMac, + pMac->roam.WaitForKeyTimerInfo.sessionId)) { /* * Enable heartbeat timer when hand-off is in progress @@ -13753,7 +13798,7 @@ eHalStatus csrSendMBDisassocReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSi Here we should not send the disassoc over the air to the AP */ if ( CSR_IS_ROAM_SUBSTATE_DISASSOC_HO(pMac, sessionId) #ifdef WLAN_FEATURE_VOWIFI_11R - && csrRoamIs11rAssoc(pMac) + && csrRoamIs11rAssoc(pMac, sessionId) #endif ) { @@ -14722,7 +14767,6 @@ eHalStatus csrSendMBAddSelfStaReqMsg( tpAniSirGlobal pMac, pMsg->type = pAddStaReq->type; pMsg->subType = pAddStaReq->subType; pMsg->sessionId = sessionId; - printk("session id - %d, AddSta session - %d\n", sessionId, pAddStaReq->sessionId); smsLog( pMac, LOG1, FL("selfMac="MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pMsg->selfMacAddr)); @@ -14730,6 +14774,7 @@ eHalStatus csrSendMBAddSelfStaReqMsg( tpAniSirGlobal pMac, } while( 0 ); return( status ); } + eHalStatus csrIssueAddStaForSessionReq(tpAniSirGlobal pMac, tANI_U32 sessionId, tSirMacAddr sessionMacAddr, tANI_U32 type, tANI_U32 subType) @@ -14787,22 +14832,31 @@ eHalStatus csrRoamOpenSession(tpAniSirGlobal pMac, pSession = CSR_GET_SESSION( pMac, i ); if (!pSession) { - smsLog(pMac, LOGE, FL("Session does not exist for interface %d"), i); + smsLog(pMac, LOGE, + FL("Session does not exist for interface %d"), i); break; } status = eHAL_STATUS_SUCCESS; pSession->sessionActive = eANI_BOOLEAN_TRUE; pSession->sessionId = (tANI_U8)i; - pSession->callback = callback; + +#ifdef WLAN_FEATURE_VOWIFI_11R + /* Initialize FT related data structures only in STA mode */ + sme_FTOpen(pMac, pSession->sessionId); +#endif + + pSession->callback = callback; pSession->pContext = pContext; - vos_mem_copy(&pSession->selfMacAddr, pSelfMacAddr, sizeof(tCsrBssid)); + vos_mem_copy(&pSession->selfMacAddr, pSelfMacAddr, + sizeof(tCsrBssid)); *pbSessionId = (tANI_U8)i; status = vos_timer_init(&pSession->hTimerRoaming, VOS_TIMER_TYPE_SW, csrRoamRoamingTimerHandler, &pSession->roamingTimerInfo); if (!HAL_STATUS_SUCCESS(status)) { - smsLog(pMac, LOGE, FL("cannot allocate memory for Roaming timer")); + smsLog(pMac, LOGE, + FL("cannot allocate memory for Roaming timer")); break; } /* get the HT capability info*/ @@ -14815,12 +14869,14 @@ eHalStatus csrRoamOpenSession(tpAniSirGlobal pMac, } #ifdef FEATURE_WLAN_BTAMP_UT_RF - status = vos_timer_init(&pSession->hTimerJoinRetry, VOS_TIMER_TYPE_SW, + status = vos_timer_init(&pSession->hTimerJoinRetry, + VOS_TIMER_TYPE_SW, csrRoamJoinRetryTimerHandler, &pSession->joinRetryTimerInfo); if (!HAL_STATUS_SUCCESS(status)) { - smsLog(pMac, LOGE, FL("cannot allocate memory for joinretry timer")); + smsLog(pMac, LOGE, + FL("cannot allocate memory for joinretry timer")); break; } #endif @@ -14830,19 +14886,22 @@ eHalStatus csrRoamOpenSession(tpAniSirGlobal pMac, pSession->htConfig.ht_tx_stbc = uHTCapabilityInfo.htCapInfo.txSTBC; pSession->htConfig.ht_rx_stbc = uHTCapabilityInfo.htCapInfo.rxSTBC; pSession->htConfig.ht_sgi = VOS_TRUE; - status = csrIssueAddStaForSessionReq ( pMac, i, pSelfMacAddr, type, subType ); + status = csrIssueAddStaForSessionReq ( pMac, i, pSelfMacAddr, type, + subType ); break; } } if( pMac->sme.max_intf_count == i ) { //No session is available - smsLog(pMac, LOGE, "%s: Reached max interfaces: %d! Session creation will fail", + smsLog(pMac, LOGE, + "%s: Reached max interfaces: %d! Session creation will fail", __func__, pMac->sme.max_intf_count); status = eHAL_STATUS_RESOURCES; } return ( status ); } + eHalStatus csrProcessDelStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg) { eHalStatus status = eHAL_STATUS_SUCCESS; @@ -15015,7 +15074,13 @@ void csrCleanupSession(tpAniSirGlobal pMac, tANI_U32 sessionId) if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) { tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); + csrRoamStop(pMac, sessionId); + + /* Clean up FT related data structures */ +#if defined WLAN_FEATURE_VOWIFI_11R + sme_FTClose(pMac, sessionId); +#endif csrFreeConnectBssDesc(pMac, sessionId); csrRoamFreeConnectProfile( pMac, &pSession->connectedProfile ); csrRoamFreeConnectedInfo ( pMac, &pSession->connectedInfo); @@ -15220,7 +15285,7 @@ static void csrRoamLinkDown(tpAniSirGlobal pMac, tANI_U32 sessionId) if (csrRoamIsStaMode(pMac, sessionId) && !CSR_IS_ROAM_SUBSTATE_DISASSOC_HO(pMac, sessionId) #ifdef WLAN_FEATURE_VOWIFI_11R - && !csrRoamIs11rAssoc(pMac) + && !csrRoamIs11rAssoc(pMac, sessionId) #endif ) { smsLog(pMac, LOG1, FL("Inform Link lost for session %d"), sessionId); @@ -16033,7 +16098,7 @@ eHalStatus csrGetStatistics(tpAniSirGlobal pMac, eCsrStatsRequesterType requeste return eHAL_STATUS_FAILURE; } - if (csrNeighborMiddleOfRoaming((tHalHandle)pMac)) + if (csrNeighborMiddleOfRoaming((tHalHandle)pMac, sessionId)) { smsLog(pMac, LOG1, FL("in the middle of roaming states")); return eHAL_STATUS_FAILURE; @@ -16419,6 +16484,7 @@ csrRoamScanOffloadPrepareProbeReqTemplate(tpAniSirGlobal pMac, *pusLen = nPayload + sizeof(tSirMacMgmtHdr); return eSIR_SUCCESS; } + #ifdef WLAN_FEATURE_ROAM_OFFLOAD void csrRoamOffload(tpAniSirGlobal pMac, tSirRoamOffloadScanReq *pRequestBuf, tCsrRoamSession *pSession) @@ -16454,15 +16520,17 @@ void csrRoamOffload(tpAniSirGlobal pMac, tSirRoamOffloadScanReq *pRequestBuf, SIR_UAPSD_GET(ACVO, pMac->lim.gUapsdPerAcBitmask); } #endif -eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 command, tANI_U8 reason) + +eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 sessionId, + tANI_U8 command, tANI_U8 reason) { vos_msg_t msg; tSirRoamOffloadScanReq *pRequestBuf; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; tCsrRoamSession *pSession; tANI_U8 i,j,num_channels = 0, ucDot11Mode; tANI_U8 *ChannelList = NULL; - tANI_U32 sessionId; eHalStatus status = eHAL_STATUS_SUCCESS; tpCsrChannelInfo currChannelListInfo; tANI_U32 host_channels = 0; @@ -16470,16 +16538,8 @@ eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 command, tANI_U8 reas tANI_U8 ChannelCacheStr[128] = {0}; currChannelListInfo = &pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo; - status = csrRoamGetSessionIdFromBSSID(pMac, - (tCsrBssid *)pNeighborRoamInfo->currAPbssid, - &sessionId); - if (!HAL_STATUS_SUCCESS(status)) - { - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, - "%s: Not able to find the sessionId",__func__); - return eHAL_STATUS_FAILURE; - } pSession = CSR_GET_SESSION( pMac, sessionId ); + if (NULL == pSession) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, @@ -16514,21 +16574,24 @@ eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 command, tANI_U8 reas * in a PREAUTH or REASSOC states.So, consider not sending the command down in INIT state. * We also have to ensure that if there is a STOP command we always have to inform Riva, * irrespective of whichever state we are in.*/ - if ((pMac->roam.neighborRoamInfo.neighborRoamState == eCSR_NEIGHBOR_ROAM_STATE_INIT) && + + if ((pMac->roam.neighborRoamInfo[sessionId].neighborRoamState == + eCSR_NEIGHBOR_ROAM_STATE_INIT) && (command != ROAM_SCAN_OFFLOAD_STOP)) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - FL("Scan Command not sent to FW with state = %s and cmd=%d "), - macTraceGetNeighbourRoamState( - pMac->roam.neighborRoamInfo.neighborRoamState), command); + FL("Scan Command not sent to FW with state = %s and cmd=%d"), + macTraceGetNeighbourRoamState( + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState), command); return eHAL_STATUS_FAILURE; } pRequestBuf = vos_mem_malloc(sizeof(tSirRoamOffloadScanReq)); if (NULL == pRequestBuf) { - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to allocate memory for Roam Offload scan request", __func__); - return eHAL_STATUS_FAILED_ALLOC; + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("Not able to allocate memory for Roam Offload scan request)")); + return eHAL_STATUS_FAILED_ALLOC; } vos_mem_zero(pRequestBuf, sizeof(tSirRoamOffloadScanReq)); @@ -16591,74 +16654,75 @@ eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 command, tANI_U8 reas eANI_BOOLEAN_FALSE)) || (pNeighborRoamInfo->isESEAssoc == eANI_BOOLEAN_FALSE) || #endif // ESE - currChannelListInfo->numOfChannels == 0) - { - - /*Retrieve the Channel Cache either from ini or from the Occupied Channels list. - * Give Preference to INI Channels.*/ - if (pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels) - { - ChannelList = pNeighborRoamInfo->cfgParams.channelInfo.ChannelList; - /* The INI channels need to be filtered with respect to the current - * band that is supported. - */ - eBand = pMac->roam.configParam.bandCapability; - if ((eCSR_BAND_24 != eBand) && (eCSR_BAND_5G != eBand) && (eCSR_BAND_ALL != eBand)) - { - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + currChannelListInfo->numOfChannels == 0) { + /* Retrieve the Channel Cache either from ini or from the Occupied + * Channels list. Give Preference to INI Channels.*/ + if (pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels) { + ChannelList = pNeighborRoamInfo->cfgParams.channelInfo.ChannelList; + /* The INI channels need to be filtered with respect to the current + * band that is supported. */ + eBand = pMac->roam.configParam.bandCapability; + if ((eCSR_BAND_24 != eBand) && (eCSR_BAND_5G != eBand) && + (eCSR_BAND_ALL != eBand)) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "Invalid band, No operation carried out (Band %d)", eBand); - vos_mem_free(pRequestBuf); - return eHAL_STATUS_FAILURE; - } - for (i=0; i<pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels ;i++) - { - if (((eCSR_BAND_24 == eBand) && CSR_IS_CHANNEL_24GHZ(*ChannelList)) || - ((eCSR_BAND_5G == eBand) && CSR_IS_CHANNEL_5GHZ(*ChannelList)) || - (eCSR_BAND_ALL == eBand)) - { - /*Allow DFS channels only if the DFS channel roam flag is enabled */ - if(((pMac->roam.configParam.allowDFSChannelRoam + vos_mem_free(pRequestBuf); + return eHAL_STATUS_FAILURE; + } + + for (i = 0; + i < pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; + i++) { + if (((eCSR_BAND_24 == eBand) && + CSR_IS_CHANNEL_24GHZ(*ChannelList)) || + ((eCSR_BAND_5G == eBand) && + CSR_IS_CHANNEL_5GHZ(*ChannelList)) || + (eCSR_BAND_ALL == eBand)) { + /* Allow DFS channels only if the DFS channel + * roam flag is enabled */ + if (((pMac->roam.configParam.allowDFSChannelRoam != CSR_ROAMING_DFS_CHANNEL_DISABLED) || - (!CSR_IS_CHANNEL_DFS(*ChannelList))) && - csrRoamIsChannelValid(pMac, *ChannelList) && - *ChannelList && (num_channels < SIR_ROAM_MAX_CHANNELS)) - { - pRequestBuf->ConnectedNetwork.ChannelCache[num_channels++] = *ChannelList; - } - ChannelList++; - } - } - pRequestBuf->ConnectedNetwork.ChannelCount = num_channels; - pRequestBuf->ChannelCacheType = CHANNEL_LIST_STATIC; - } - else - { - ChannelList = pMac->scan.occupiedChannels.channelList; - for(i=0; i<pMac->scan.occupiedChannels.numChannels; i++) - { - if(((pMac->roam.configParam.allowDFSChannelRoam + (!CSR_IS_CHANNEL_DFS(*ChannelList))) && + csrRoamIsChannelValid(pMac, *ChannelList) && + *ChannelList && + (num_channels < SIR_ROAM_MAX_CHANNELS)) { + pRequestBuf->ConnectedNetwork.ChannelCache[ + num_channels++] = *ChannelList; + } + ChannelList++; + } + } + pRequestBuf->ConnectedNetwork.ChannelCount = num_channels; + pRequestBuf->ChannelCacheType = CHANNEL_LIST_STATIC; + } else { + ChannelList = pMac->scan.occupiedChannels[sessionId].channelList; + for (i = 0; + i < pMac->scan.occupiedChannels[sessionId].numChannels; + i++) { + if(((pMac->roam.configParam.allowDFSChannelRoam != CSR_ROAMING_DFS_CHANNEL_DISABLED) || - (!CSR_IS_CHANNEL_DFS(*ChannelList))) && *ChannelList && - (num_channels < SIR_ROAM_MAX_CHANNELS)) - { - pRequestBuf->ConnectedNetwork.ChannelCache[num_channels++] = *ChannelList; + (!CSR_IS_CHANNEL_DFS(*ChannelList))) && *ChannelList && + (num_channels < SIR_ROAM_MAX_CHANNELS)) { + pRequestBuf->ConnectedNetwork.ChannelCache[num_channels++] = + *ChannelList; } ChannelList++; - } - pRequestBuf->ConnectedNetwork.ChannelCount = num_channels; - /* If the profile changes as to what it was earlier, inform the FW through - * FLUSH as ChannelCacheType in which case, the FW will flush the occupied channels - * for the earlier profile and try to learn them afresh.*/ - if (reason == REASON_FLUSH_CHANNEL_LIST) - pRequestBuf->ChannelCacheType = CHANNEL_LIST_DYNAMIC_FLUSH; - else { - if (csrNeighborRoamIsNewConnectedProfile(pMac)) - pRequestBuf->ChannelCacheType = CHANNEL_LIST_DYNAMIC_INIT; - else - pRequestBuf->ChannelCacheType = CHANNEL_LIST_DYNAMIC_UPDATE; - } + } + pRequestBuf->ConnectedNetwork.ChannelCount = num_channels; + /* If the profile changes as to what it was earlier, inform the + * FW through FLUSH as ChannelCacheType in which case, + * the FW will flush the occupied channels for the earlier profile and + * try to learn them afresh.*/ + if (reason == REASON_FLUSH_CHANNEL_LIST) + pRequestBuf->ChannelCacheType = CHANNEL_LIST_DYNAMIC_FLUSH; + else { + if (csrNeighborRoamIsNewConnectedProfile(pMac, sessionId)) + pRequestBuf->ChannelCacheType = CHANNEL_LIST_DYNAMIC_INIT; + else + pRequestBuf->ChannelCacheType = CHANNEL_LIST_DYNAMIC_UPDATE; } } + } #ifdef FEATURE_WLAN_ESE else { @@ -16794,18 +16858,23 @@ eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 command, tANI_U8 reas return status; } -eHalStatus csrRoamOffloadScanRspHdlr(tpAniSirGlobal pMac, tANI_U8 reason) +eHalStatus csrRoamOffloadScanRspHdlr(tpAniSirGlobal pMac, + tpSirRoamOffloadScanRsp scanOffloadRsp) { - switch(reason) - { - case 0: - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, "Rsp for Roam Scan Offload with failure status"); - break; - case REASON_OS_REQUESTED_ROAMING_NOW: - csrNeighborRoamProceedWithHandoffReq(pMac); - break; - default: - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "Rsp for Roam Scan Offload with reason %d", reason); + switch (scanOffloadRsp->reason) { + case 0: + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, + "Rsp for Roam Scan Offload with failure status"); + break; + case REASON_OS_REQUESTED_ROAMING_NOW: + csrNeighborRoamProceedWithHandoffReq(pMac, + scanOffloadRsp->sessionId); + break; + + default: + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + "Rsp for Roam Scan Offload with reason %d", + scanOffloadRsp->reason); } return eHAL_STATUS_SUCCESS; } @@ -17700,15 +17769,22 @@ eHalStatus csrRoamIssueFTPreauthReq(tHalHandle hHal, tANI_U32 sessionId, tpSirBs pftPreAuthReq = (tpSirFTPreAuthReq)vos_mem_malloc(auth_req_len); if (NULL == pftPreAuthReq) { - smsLog(pMac, LOGE, FL("Memory allocation for FT Preauth request failed")); + smsLog(pMac, LOGE, + FL("Memory allocation for FT Preauth request failed")); return eHAL_STATUS_RESOURCES; } // Save the SME Session ID here. We need it while processing the preauth response - pMac->ft.ftSmeContext.smeSessionId = sessionId; + pSession->ftSmeContext.smeSessionId = sessionId; vos_mem_zero(pftPreAuthReq, auth_req_len); pftPreAuthReq->pbssDescription = (tpSirBssDescription)vos_mem_malloc( sizeof(pBssDescription->length) + pBssDescription->length); + if (NULL == pftPreAuthReq->pbssDescription) + { + smsLog(pMac, LOGE, + FL("Memory allocation for FT Preauth request failed")); + return eHAL_STATUS_RESOURCES; + } pftPreAuthReq->messageType = pal_cpu_to_be16(eWNI_SME_FT_PRE_AUTH_REQ); @@ -17720,12 +17796,13 @@ eHalStatus csrRoamIssueFTPreauthReq(tHalHandle hHal, tANI_U32 sessionId, tpSirBs (void *)pBssDescription->bssId, sizeof(tSirMacAddr)); #ifdef WLAN_FEATURE_VOWIFI_11R - if (csrRoamIs11rAssoc(pMac) && + if (csrRoamIs11rAssoc(pMac, sessionId) && (pMac->roam.roamSession[sessionId].connectedProfile.AuthType != eCSR_AUTH_TYPE_OPEN_SYSTEM)) { - pftPreAuthReq->ft_ies_length = (tANI_U16)pMac->ft.ftSmeContext.auth_ft_ies_length; - vos_mem_copy(pftPreAuthReq->ft_ies, pMac->ft.ftSmeContext.auth_ft_ies, - pMac->ft.ftSmeContext.auth_ft_ies_length); + pftPreAuthReq->ft_ies_length = + (tANI_U16)pSession->ftSmeContext.auth_ft_ies_length; + vos_mem_copy(pftPreAuthReq->ft_ies, pSession->ftSmeContext.auth_ft_ies, + pSession->ftSmeContext.auth_ft_ies_length); } else #endif @@ -17746,113 +17823,130 @@ eHalStatus csrRoamIssueFTPreauthReq(tHalHandle hHal, tANI_U32 sessionId, tpSirBs ------------------------------------------------------------------------*/ void csrRoamFTPreAuthRspProcessor( tHalHandle hHal, tpSirFTPreAuthRsp pFTPreAuthRsp ) { - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - eHalStatus status = eHAL_STATUS_SUCCESS; + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + eHalStatus status = eHAL_STATUS_SUCCESS; #if defined(FEATURE_WLAN_LFR) || defined(FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_ESE_UPLOAD) - tCsrRoamInfo roamInfo; + tCsrRoamInfo roamInfo; #endif - eCsrAuthType conn_Auth_type; + eCsrAuthType conn_Auth_type; + tANI_U32 sessionId = pFTPreAuthRsp->smeSessionId; + tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); + + if (NULL == pSession) + { + smsLog(pMac, LOGE, FL("pSession is NULL")); + return; + } #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING - status = csrNeighborRoamPreauthRspHandler(pMac, pFTPreAuthRsp->status); - if (status != eHAL_STATUS_SUCCESS) { - /* - * Bail out if pre-auth was not even processed. - */ - smsLog(pMac, LOGE,FL("Preauth was not processed: %d SessionID: %d"), - status, pFTPreAuthRsp->smeSessionId); - return; - } + status = csrNeighborRoamPreauthRspHandler(pMac, pFTPreAuthRsp->smeSessionId, + pFTPreAuthRsp->status); + if (status != eHAL_STATUS_SUCCESS) { + /* + * Bail out if pre-auth was not even processed. + */ + smsLog(pMac, LOGE,FL("Preauth was not processed: %d SessionID: %d"), + status, sessionId); + return; + } #endif - /* The below function calls/timers should be invoked only if the pre-auth is successful */ - if (VOS_STATUS_SUCCESS != (VOS_STATUS)pFTPreAuthRsp->status) - return; - // Implies a success - pMac->ft.ftSmeContext.FTState = eFT_AUTH_COMPLETE; - // Indicate SME QoS module the completion of Preauth success. This will trigger the creation of RIC IEs - pMac->ft.ftSmeContext.psavedFTPreAuthRsp = pFTPreAuthRsp; - /* No need to notify qos module if this is a non 11r roam*/ - if (csrRoamIs11rAssoc(pMac)) - { - sme_QosCsrEventInd(pMac, pMac->ft.ftSmeContext.smeSessionId, SME_QOS_CSR_PREAUTH_SUCCESS_IND, NULL); - } - /* Start the pre-auth reassoc interval timer with a period of 400ms. When this expires, - * actual transition from the current to handoff AP is triggered */ - status = vos_timer_start(&pMac->ft.ftSmeContext.preAuthReassocIntvlTimer, - 60); - if (eHAL_STATUS_SUCCESS != status) - { - smsLog(pMac, LOGE, FL("Preauth reassoc interval timer start failed to start with status %d"), status); - return; - } - // Save the received response - vos_mem_copy((void *)&pMac->ft.ftSmeContext.preAuthbssId, - (void *)pFTPreAuthRsp->preAuthbssId, sizeof(tCsrBssid)); - if (csrRoamIs11rAssoc(pMac)) - csrRoamCallCallback(pMac, pFTPreAuthRsp->smeSessionId, NULL, 0, - eCSR_ROAM_FT_RESPONSE, eCSR_ROAM_RESULT_NONE); + + /* The below function calls/timers should be invoked only if the pre-auth is successful */ + if (VOS_STATUS_SUCCESS != (VOS_STATUS)pFTPreAuthRsp->status) + return; + // Implies a success + pSession->ftSmeContext.FTState = eFT_AUTH_COMPLETE; + // Indicate SME QoS module the completion of Preauth success. This will trigger the creation of RIC IEs + pSession->ftSmeContext.psavedFTPreAuthRsp = pFTPreAuthRsp; + /* No need to notify qos module if this is a non 11r roam*/ + if (csrRoamIs11rAssoc(pMac, pFTPreAuthRsp->smeSessionId)) + { + sme_QosCsrEventInd(pMac, + pSession->ftSmeContext.smeSessionId, + SME_QOS_CSR_PREAUTH_SUCCESS_IND, NULL); + } + /* Start the pre-auth reassoc interval timer with a period of 400ms. When this expires, + * actual transition from the current to handoff AP is triggered */ + status = vos_timer_start(&pSession->ftSmeContext.preAuthReassocIntvlTimer, + 60); + if (eHAL_STATUS_SUCCESS != status) + { + smsLog(pMac, LOGE, FL("Preauth reassoc interval timer start failed to start with status %d"), status); + return; + } + // Save the received response + vos_mem_copy((void *)&pSession->ftSmeContext.preAuthbssId, + (void *)pFTPreAuthRsp->preAuthbssId, sizeof(tCsrBssid)); + if (csrRoamIs11rAssoc(pMac, pFTPreAuthRsp->smeSessionId)) + csrRoamCallCallback(pMac, pFTPreAuthRsp->smeSessionId, NULL, 0, + eCSR_ROAM_FT_RESPONSE, eCSR_ROAM_RESULT_NONE); #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) - if (csrRoamIsESEAssoc(pMac)) - { - /* read TSF */ - csrRoamReadTSF(pMac, (tANI_U8 *)roamInfo.timestamp); - // Save the bssid from the received response - vos_mem_copy((void *)&roamInfo.bssid, - (void *)pFTPreAuthRsp->preAuthbssId, sizeof(tCsrBssid)); - csrRoamCallCallback(pMac, pFTPreAuthRsp->smeSessionId, &roamInfo, - 0, eCSR_ROAM_CCKM_PREAUTH_NOTIFY, 0); - } + if (csrRoamIsESEAssoc(pMac)) + { + /* read TSF */ + csrRoamReadTSF(pMac, (tANI_U8 *)roamInfo.timestamp, + pFTPreAuthRsp->smeSessionId); + // Save the bssid from the received response + vos_mem_copy((void *)&roamInfo.bssid, + (void *)pFTPreAuthRsp->preAuthbssId, sizeof(tCsrBssid)); + csrRoamCallCallback(pMac, pFTPreAuthRsp->smeSessionId, &roamInfo, + 0, eCSR_ROAM_CCKM_PREAUTH_NOTIFY, 0); + } #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ #ifdef FEATURE_WLAN_LFR - // If Legacy Fast Roaming is enabled, signal the supplicant - // So he can send us a PMK-ID for this candidate AP. - if (csrRoamIsFastRoamEnabled(pMac, CSR_SESSION_ID_INVALID)) - { - // Save the bssid from the received response - vos_mem_copy((void *)&roamInfo.bssid, - (void *)pFTPreAuthRsp->preAuthbssId, sizeof(tCsrBssid)); - csrRoamCallCallback(pMac, pFTPreAuthRsp->smeSessionId, &roamInfo, 0, eCSR_ROAM_PMK_NOTIFY, 0); - } + // If Legacy Fast Roaming is enabled, signal the supplicant + // So he can send us a PMK-ID for this candidate AP. + if (csrRoamIsFastRoamEnabled(pMac, pFTPreAuthRsp->smeSessionId)) + { + // Save the bssid from the received response + vos_mem_copy((void *)&roamInfo.bssid, + (void *)pFTPreAuthRsp->preAuthbssId, sizeof(tCsrBssid)); + csrRoamCallCallback(pMac, pFTPreAuthRsp->smeSessionId, &roamInfo, 0, eCSR_ROAM_PMK_NOTIFY, 0); + } #endif - // If its an Open Auth, FT IEs are not provided by supplicant - // Hence populate them here - conn_Auth_type = pMac->roam.roamSession[pMac->ft.ftSmeContext.smeSessionId].connectedProfile.AuthType; - pMac->ft.ftSmeContext.addMDIE = FALSE; - if( csrRoamIs11rAssoc(pMac) && - (conn_Auth_type == eCSR_AUTH_TYPE_OPEN_SYSTEM)) - { - tANI_U16 ft_ies_length; - ft_ies_length = pFTPreAuthRsp->ric_ies_length; + // If its an Open Auth, FT IEs are not provided by supplicant + // Hence populate them here + conn_Auth_type = + pMac->roam.roamSession[sessionId].connectedProfile.AuthType; - if ( (pMac->ft.ftSmeContext.reassoc_ft_ies) && - (pMac->ft.ftSmeContext.reassoc_ft_ies_length)) - { - vos_mem_free(pMac->ft.ftSmeContext.reassoc_ft_ies); - pMac->ft.ftSmeContext.reassoc_ft_ies_length = 0; - } + pSession->ftSmeContext.addMDIE = FALSE; + if (csrRoamIs11rAssoc(pMac, pFTPreAuthRsp->smeSessionId) && + (conn_Auth_type == eCSR_AUTH_TYPE_OPEN_SYSTEM)) + { + tANI_U16 ft_ies_length; + ft_ies_length = pFTPreAuthRsp->ric_ies_length; - pMac->ft.ftSmeContext.reassoc_ft_ies = vos_mem_malloc(ft_ies_length); - if ( NULL == pMac->ft.ftSmeContext.reassoc_ft_ies ) - { - smsLog( pMac, LOGE, FL("Memory allocation failed for ft_ies")); - } - else - { - // Copy the RIC IEs to reassoc IEs - vos_mem_copy(((tANI_U8 *)pMac->ft.ftSmeContext.reassoc_ft_ies), - (tANI_U8 *)pFTPreAuthRsp->ric_ies, - pFTPreAuthRsp->ric_ies_length); - pMac->ft.ftSmeContext.reassoc_ft_ies_length = ft_ies_length; - pMac->ft.ftSmeContext.addMDIE = TRUE; - } - } + if ( (pSession->ftSmeContext.reassoc_ft_ies) && + (pSession->ftSmeContext.reassoc_ft_ies_length)) + { + vos_mem_free(pSession->ftSmeContext.reassoc_ft_ies); + pSession->ftSmeContext.reassoc_ft_ies_length = 0; + pSession->ftSmeContext.reassoc_ft_ies = NULL; + } - // Done with it, init it. - pMac->ft.ftSmeContext.psavedFTPreAuthRsp = NULL; + pSession->ftSmeContext.reassoc_ft_ies = vos_mem_malloc(ft_ies_length); + if ( NULL == pSession->ftSmeContext.reassoc_ft_ies ) + { + smsLog( pMac, LOGE, FL("Memory allocation failed for ft_ies")); + return; + } + else + { + // Copy the RIC IEs to reassoc IEs + vos_mem_copy(((tANI_U8 *)pSession->ftSmeContext.reassoc_ft_ies), + (tANI_U8 *)pFTPreAuthRsp->ric_ies, + pFTPreAuthRsp->ric_ies_length); + pSession->ftSmeContext.reassoc_ft_ies_length = ft_ies_length; + pSession->ftSmeContext.addMDIE = TRUE; + } + } + + // Done with it, init it. + pSession->ftSmeContext.psavedFTPreAuthRsp = NULL; } #endif @@ -17864,31 +17958,37 @@ void csrRoamJoinRetryTimerHandler(void *pv) tANI_U32 sessionId = pInfo->sessionId; tCsrRoamSession *pSession; - if( CSR_IS_SESSION_VALID(pMac, sessionId) ) - { - smsLog( pMac, LOGE, FL( " retrying the last roam profile on session %d" ), sessionId ); + if (CSR_IS_SESSION_VALID(pMac, sessionId) ) { + smsLog( pMac, LOGE, + FL("retrying the last roam profile on session %d" ), sessionId ); pSession = CSR_GET_SESSION( pMac, sessionId ); - if(pSession->pCurRoamProfile && csrIsConnStateDisconnected(pMac, sessionId)) + if (pSession->pCurRoamProfile && + csrIsConnStateDisconnected(pMac, sessionId)) { - if( !HAL_STATUS_SUCCESS(csrRoamJoinLastProfile(pMac, sessionId)) ) + if (!HAL_STATUS_SUCCESS(csrRoamJoinLastProfile(pMac, sessionId)) ) { - smsLog( pMac, LOGE, FL( " fail to retry the last roam profile" ) ); + smsLog( pMac, LOGE, + FL("fail to retry the last roam profile" ) ); } } } } -eHalStatus csrRoamStartJoinRetryTimer(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 interval) +eHalStatus csrRoamStartJoinRetryTimer(tpAniSirGlobal pMac, tANI_U32 sessionId, + tANI_U32 interval) { eHalStatus status = eHAL_STATUS_FAILURE; tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); if(pSession->pCurRoamProfile && pSession->maxRetryCount) { - smsLog(pMac, LOGE, FL(" call sessionId %d retry count %d left"), sessionId, pSession->maxRetryCount); + smsLog(pMac, LOGE, FL(" call sessionId %d retry count %d left"), + sessionId, pSession->maxRetryCount); pSession->maxRetryCount--; pSession->joinRetryTimerInfo.pMac = pMac; pSession->joinRetryTimerInfo.sessionId = (tANI_U8)sessionId; - status = vos_timer_start(&pSession->hTimerJoinRetry, interval/PAL_TIMER_TO_MS_UNIT); + status = + vos_timer_start(&pSession->hTimerJoinRetry, + interval/PAL_TIMER_TO_MS_UNIT); if (!HAL_STATUS_SUCCESS(status)) { smsLog(pMac, LOGE, FL(" fail to start timer status %s"), status); @@ -17896,8 +17996,9 @@ eHalStatus csrRoamStartJoinRetryTimer(tpAniSirGlobal pMac, tANI_U32 sessionId, t } else { - smsLog(pMac, LOGE, FL(" not to start timer due to no profile or reach mac ret (%d)"), - pSession->maxRetryCount); + smsLog(pMac, LOGE, + FL("not to start timer due to no profile or reach mac ret (%d)"), + pSession->maxRetryCount); } return (status); @@ -17907,7 +18008,8 @@ eHalStatus csrRoamStopJoinRetryTimer(tpAniSirGlobal pMac, tANI_U32 sessionId) smsLog(pMac, LOGE, " csrRoamStopJoinRetryTimer"); if( CSR_IS_SESSION_VALID(pMac, sessionId) ) { - return (vos_timer_stop(&pMac->roam.roamSession[sessionId].hTimerJoinRetry)); + return (vos_timer_stop( + &pMac->roam.roamSession[sessionId].hTimerJoinRetry)); } return eHAL_STATUS_SUCCESS; @@ -18038,6 +18140,7 @@ tANI_BOOLEAN csrRoamIsStaMode(tpAniSirGlobal pMac, tANI_U32 sessionId) #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD eHalStatus csrHandoffRequest(tpAniSirGlobal pMac, + tANI_U8 sessionId, tCsrHandoffRequest *pHandoffInfo) { eHalStatus status = eHAL_STATUS_SUCCESS; @@ -18052,7 +18155,7 @@ eHalStatus csrHandoffRequest(tpAniSirGlobal pMac, } pMsg->msgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_HANDOFF_REQ); pMsg->msgLen = (tANI_U16)sizeof(tAniHandoffReq); - pMsg->sessionId = pMac->roam.neighborRoamInfo.csrSessionId; + pMsg->sessionId = sessionId; pMsg->channel = pHandoffInfo->channel; #ifndef QCA_WIFI_ISOC pMsg->handoff_src = pHandoffInfo->src; @@ -18111,14 +18214,15 @@ VOS_STATUS csrSetCCKMIe(tpAniSirGlobal pMac, const tANI_U8 sessionId, \param pTimestamp - output TSF timestamp \- return Success or failure -------------------------------------------------------------------------*/ -VOS_STATUS csrRoamReadTSF(tpAniSirGlobal pMac, tANI_U8 *pTimestamp) +VOS_STATUS csrRoamReadTSF(tpAniSirGlobal pMac, tANI_U8 *pTimestamp, + tANI_U8 sessionId) { eHalStatus status = eHAL_STATUS_SUCCESS; tCsrNeighborRoamBSSInfo handoffNode; tANI_U32 timer_diff = 0; tANI_U32 timeStamp[2]; tpSirBssDescription pBssDescription = NULL; - csrNeighborRoamGetHandoffAPInfo(pMac, &handoffNode); + csrNeighborRoamGetHandoffAPInfo(pMac, &handoffNode, sessionId); pBssDescription = handoffNode.pBssDescription; // Get the time diff in milli seconds timer_diff = vos_timer_get_system_time() - pBssDescription->scanSysTimeMsec; @@ -18548,7 +18652,7 @@ void csrProcessRoamOffloadSynchInd(tpAniSirGlobal pMac, void *pMsgBuf) if (pEntry) csrRoamEnqueueRoamOffloadSynch( - pMac, pMac->roam.neighborRoamInfo.csrSessionId, + pMac, smeRoamOffloadSynchInd->roamedVdevId, &pBssDesc->Result.BssDescriptor, eCsrPerformRoamOffloadSynch); } diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c index ac3330170aa9..6accc7be3ef3 100644 --- a/CORE/SME/src/csr/csrApiScan.c +++ b/CORE/SME/src/csr/csrApiScan.c @@ -365,7 +365,8 @@ static void csrSetDefaultScanTiming( tpAniSirGlobal pMac, tSirScanType scanType, #ifdef WLAN_AP_STA_CONCURRENCY //Return SUCCESS is the command is queued, else returns eHAL_STATUS_FAILURE -eHalStatus csrQueueScanRequest( tpAniSirGlobal pMac, tSmeCmd *pScanCmd ) +eHalStatus csrQueueScanRequest(tpAniSirGlobal pMac, tANI_U8 sessionId, + tSmeCmd *pScanCmd) { eHalStatus status = eHAL_STATUS_SUCCESS; @@ -401,7 +402,7 @@ eHalStatus csrQueueScanRequest( tpAniSirGlobal pMac, tSmeCmd *pScanCmd ) #ifdef FEATURE_WLAN_LFR (csrIsConcurrentInfraConnected(pMac) || ((pScanCmd->u.scanCmd.reason != eCsrScanBgScan) && - (pMac->roam.neighborRoamInfo.neighborRoamState != + (pMac->roam.neighborRoamInfo[sessionId].neighborRoamState != eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN))) && #endif (pScanCmd->u.scanCmd.u.scanRequest.p2pSearch != 1)) || @@ -573,7 +574,7 @@ eHalStatus csrQueueScanRequest( tpAniSirGlobal pMac, tSmeCmd *pScanCmd ) smsLog( pMac, LOG2, FL("Queuing scan command (reason=%d, roamState=%d" " numOfChannels=%d)"), pScanCmd->u.scanCmd.reason, - pMac->roam.neighborRoamInfo.neighborRoamState, + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState, pScanCmd->u.scanCmd.u.scanRequest.ChannelInfo.numOfChannels); return csrQueueSmeCommand(pMac, pScanCmd, eANI_BOOLEAN_FALSE); } @@ -862,7 +863,8 @@ eHalStatus csrScanRequest(tpAniSirGlobal pMac, tANI_U16 sessionId, //Start process the command #ifdef WLAN_AP_STA_CONCURRENCY if (!pMac->fScanOffload) - status = csrQueueScanRequest(pMac, p11dScanCmd); + status = csrQueueScanRequest(pMac, sessionId, + p11dScanCmd); else status = csrQueueSmeCommand(pMac, p11dScanCmd, eANI_BOOLEAN_FALSE); @@ -934,7 +936,7 @@ eHalStatus csrScanRequest(tpAniSirGlobal pMac, tANI_U16 sessionId, //Start process the command #ifdef WLAN_AP_STA_CONCURRENCY if (!pMac->fScanOffload) - status = csrQueueScanRequest(pMac,pScanCmd); + status = csrQueueScanRequest(pMac, sessionId, pScanCmd); else status = csrQueueSmeCommand(pMac, pScanCmd, eANI_BOOLEAN_FALSE); @@ -1699,13 +1701,13 @@ eHalStatus csrScanHandleSearchForSSID(tpAniSirGlobal pMac, tSmeCmd *pCommand) do { #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD - //if this scan is for LFR - if(pMac->roam.neighborRoamInfo.uOsRequestedHandoff) - { - //notify LFR state m/c - if(eHAL_STATUS_SUCCESS != csrNeighborRoamSssidScanDone(pMac, eHAL_STATUS_SUCCESS)) - { - csrNeighborRoamStartLfrScan(pMac); + /* If this scan is for LFR */ + if (pMac->roam.neighborRoamInfo[sessionId].uOsRequestedHandoff) { + /* Notify LFR state m/c */ + if (eHAL_STATUS_SUCCESS != csrNeighborRoamSssidScanDone(pMac, + sessionId, + eHAL_STATUS_SUCCESS)) { + csrNeighborRoamStartLfrScan(pMac, sessionId); } status = eHAL_STATUS_SUCCESS; break; @@ -1787,13 +1789,13 @@ eHalStatus csrScanHandleSearchForSSIDFailure(tpAniSirGlobal pMac, tSmeCmd *pComm tCsrRoamProfile *pProfile = pCommand->u.scanCmd.pToRoamProfile; tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD - //if this scan is for LFR - if(pMac->roam.neighborRoamInfo.uOsRequestedHandoff) - { - //notify LFR state m/c - if(eHAL_STATUS_SUCCESS != csrNeighborRoamSssidScanDone(pMac, eHAL_STATUS_FAILURE)) - { - csrNeighborRoamStartLfrScan(pMac); + /* If this scan is for LFR */ + if (pMac->roam.neighborRoamInfo[sessionId].uOsRequestedHandoff) { + /* Notify LFR state m/c */ + if (eHAL_STATUS_SUCCESS != csrNeighborRoamSssidScanDone(pMac, + sessionId, + eHAL_STATUS_FAILURE)) { + csrNeighborRoamStartLfrScan(pMac, sessionId); } return eHAL_STATUS_SUCCESS; } @@ -2079,6 +2081,7 @@ static tANI_BOOLEAN csrIsBetterBss(tCsrScanResult *pBss1, tCsrScanResult *pBss2) static void csrScanAddToOccupiedChannels( tpAniSirGlobal pMac, tCsrScanResult *pResult, + tANI_U8 sessionId, tCsrChannel *pOccupiedChannels, tDot11fBeaconIEs *pIes) { @@ -2090,14 +2093,14 @@ static void csrScanAddToOccupiedChannels( channel = pResult->Result.BssDescriptor.channelId; if (!csrIsChannelPresentInList(pOccupiedChannelList, numOccupiedChannels, channel) - && csrNeighborRoamConnectedProfileMatch(pMac, pResult, pIes)) + && csrNeighborRoamConnectedProfileMatch(pMac, sessionId, pResult, pIes)) { status = csrAddToChannelListFront(pOccupiedChannelList, numOccupiedChannels, channel); if(HAL_STATUS_SUCCESS(status)) { pOccupiedChannels->numChannels++; - smsLog(pMac, LOG2, FL("%s: added channel %d to the list (count=%d)"), - __func__, channel, pOccupiedChannels->numChannels); + smsLog(pMac, LOG2, FL("Added channel %d to the list (count=%d)"), + channel, pOccupiedChannels->numChannels); if (pOccupiedChannels->numChannels > CSR_BG_SCAN_OCCUPIED_CHANNEL_LIST_LEN) pOccupiedChannels->numChannels = CSR_BG_SCAN_OCCUPIED_CHANNEL_LIST_LEN; } @@ -2107,21 +2110,27 @@ static void csrScanAddToOccupiedChannels( //Put the BSS into the scan result list //pIes can not be NULL -static void csrScanAddResult(tpAniSirGlobal pMac, tCsrScanResult *pResult, tDot11fBeaconIEs *pIes) +static void csrScanAddResult(tpAniSirGlobal pMac, tCsrScanResult *pResult, + tDot11fBeaconIEs *pIes, tANI_U32 sessionId) { #ifdef FEATURE_WLAN_LFR - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; #endif - pResult->preferValue = csrGetBssPreferValue(pMac, (int)pResult->Result.BssDescriptor.rssi); - pResult->capValue = csrGetBssCapValue(pMac, &pResult->Result.BssDescriptor, pIes); + pResult->preferValue = + csrGetBssPreferValue(pMac, (int)pResult->Result.BssDescriptor.rssi); + pResult->capValue = + csrGetBssCapValue(pMac, &pResult->Result.BssDescriptor, pIes); csrLLInsertTail( &pMac->scan.scanResultList, &pResult->Link, LL_ACCESS_LOCK ); #ifdef FEATURE_WLAN_LFR if(0 == pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels) { /* Build the occupied channel list, only if "gNeighborScanChannelList" is NOT set in the cfg.ini file */ - csrScanAddToOccupiedChannels(pMac, pResult, &pMac->scan.occupiedChannels, pIes); + csrScanAddToOccupiedChannels(pMac, pResult, sessionId, + &pMac->scan.occupiedChannels[sessionId], + pIes); } #endif } @@ -2427,22 +2436,22 @@ eHalStatus csrScanGetResult(tpAniSirGlobal pMac, tCsrScanResultFilter *pFilter, * csrScanGetResult returns with a failure because * of not being able to find the roaming BSS. */ -tANI_U8 csrScanFlushDenied(tpAniSirGlobal pMac) +tANI_U8 csrScanFlushDenied(tpAniSirGlobal pMac, tANI_U8 sessionId) { - switch(pMac->roam.neighborRoamInfo.neighborRoamState) { + switch(pMac->roam.neighborRoamInfo[sessionId].neighborRoamState) { case eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN: case eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING: case eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE: case eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING: - return (pMac->roam.neighborRoamInfo.neighborRoamState); + return (pMac->roam.neighborRoamInfo[sessionId].neighborRoamState); default: return 0; } } -eHalStatus csrScanFlushResult(tpAniSirGlobal pMac) +eHalStatus csrScanFlushResult(tpAniSirGlobal pMac, tANI_U8 sessionId) { - tANI_U8 isFlushDenied = csrScanFlushDenied(pMac); + tANI_U8 isFlushDenied = csrScanFlushDenied(pMac, sessionId); eHalStatus status = eHAL_STATUS_SUCCESS; tSirMbMsg *pMsg; tANI_U16 msgLen; @@ -2976,43 +2985,42 @@ eHalStatus csrAddPMKIDCandidateList( tpAniSirGlobal pMac, tANI_U32 sessionId, //This function checks whether new AP is found for the current connected profile //If it is found, it return the sessionId, else it return invalid sessionID -tANI_U32 csrProcessBSSDescForPMKIDList(tpAniSirGlobal pMac, - tSirBssDescription *pBssDesc, - tDot11fBeaconIEs *pIes) +eHalStatus csrProcessBSSDescForPMKIDList(tpAniSirGlobal pMac, + tSirBssDescription *pBssDesc, + tDot11fBeaconIEs *pIes, + tANI_U8 sessionId) { - tANI_U32 i, bRet = CSR_SESSION_ID_INVALID; tCsrRoamSession *pSession; tDot11fBeaconIEs *pIesLocal = pIes; + eHalStatus status = eHAL_STATUS_FAILURE; - if( pIesLocal || HAL_STATUS_SUCCESS(csrGetParsedBssDescriptionIEs(pMac, pBssDesc, &pIesLocal)) ) - { - for( i = 0; i < CSR_ROAM_SESSION_MAX; i++ ) - { - if( CSR_IS_SESSION_VALID( pMac, i ) ) - { - pSession = CSR_GET_SESSION( pMac, i ); - if( csrIsConnStateConnectedInfra( pMac, i ) && - ( eCSR_AUTH_TYPE_RSN == pSession->connectedProfile.AuthType ) ) - { - if(csrMatchBSSToConnectProfile(pMac, &pSession->connectedProfile, pBssDesc, pIesLocal)) - { - //this new BSS fits the current profile connected - if(HAL_STATUS_SUCCESS(csrAddPMKIDCandidateList(pMac, i, pBssDesc, pIesLocal))) - { - bRet = i; - } - break; + if (pIesLocal || + HAL_STATUS_SUCCESS(csrGetParsedBssDescriptionIEs( + pMac, pBssDesc, &pIesLocal))) { + if (CSR_IS_SESSION_VALID(pMac, sessionId)) { + pSession = CSR_GET_SESSION(pMac, sessionId); + if (csrIsConnStateConnectedInfra(pMac, sessionId) && + (eCSR_AUTH_TYPE_RSN == pSession->connectedProfile.AuthType)) { + if (csrMatchBSSToConnectProfile(pMac, + &pSession->connectedProfile, + pBssDesc, pIesLocal)) { + /* This new BSS fits the current profile connected */ + if (!HAL_STATUS_SUCCESS(csrAddPMKIDCandidateList(pMac, + sessionId, pBssDesc, pIesLocal))) { + smsLog(pMac, LOGE, + FL("csrAddPMKIDCandidateList failed")); + } else { + status = eHAL_STATUS_SUCCESS; } } } } - if( !pIes ) - { + + if (!pIes) { vos_mem_free(pIesLocal); } } - - return (tANI_U8)bRet; + return status; } #ifdef FEATURE_WLAN_WAPI @@ -3107,7 +3115,9 @@ tANI_BOOLEAN csrProcessBSSDescForBKIDList(tpAniSirGlobal pMac, tSirBssDescriptio #endif -static void csrMoveTempScanResultsToMainList( tpAniSirGlobal pMac, tANI_U8 reason ) +static void csrMoveTempScanResultsToMainList(tpAniSirGlobal pMac, + tANI_U8 reason, + tANI_U8 sessionId) { tListElem *pEntry; tListElem *pEntryTemp; @@ -3120,7 +3130,6 @@ static void csrMoveTempScanResultsToMainList( tpAniSirGlobal pMac, tANI_U8 reaso tANI_BOOLEAN fNewWapiBSSForCurConnection = eANI_BOOLEAN_FALSE; #endif /* FEATURE_WLAN_WAPI */ tDot11fBeaconIEs *pIesLocal = NULL; - tANI_U32 sessionId = CSR_SESSION_ID_INVALID; tAniSSID tmpSsid; v_TIME_t timer=0; tCsrBssid bssid_temp = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; @@ -3169,11 +3178,10 @@ static void csrMoveTempScanResultsToMainList( tpAniSirGlobal pMac, tANI_U8 reaso // check for duplicate scan results if ( !fDupBss ) { - //Found a new BSS - sessionId = csrProcessBSSDescForPMKIDList(pMac, - &pBssDescription->Result.BssDescriptor, pIesLocal); - if( CSR_SESSION_ID_INVALID != sessionId) - { + if (HAL_STATUS_SUCCESS(csrProcessBSSDescForPMKIDList(pMac, + &pBssDescription->Result.BssDescriptor, + pIesLocal, sessionId))) { + /* Found a new BSS */ csrRoamCallCallback(pMac, sessionId, NULL, 0, eCSR_ROAM_SCAN_FOUND_NEW_BSS, eCSR_ROAM_RESULT_NONE); } @@ -3239,33 +3247,27 @@ static void csrMoveTempScanResultsToMainList( tpAniSirGlobal pMac, tANI_U8 reaso // append to main list - csrScanAddResult(pMac, pBssDescription, pIesLocal); + csrScanAddResult(pMac, pBssDescription, pIesLocal, sessionId); if ( (pBssDescription->Result.pvIes == NULL) && pIesLocal ) { vos_mem_free(pIesLocal); } } - //we don't need to update CC while connected to an AP which is advertising CC already + /* We don't need to update CC while connected to an AP + which is advertising CC already */ if (csrIs11dSupported(pMac)) { - tANI_U32 i; tCsrRoamSession *pSession; - for (i = 0; i < CSR_ROAM_SESSION_MAX; i++ ) - { - if (CSR_IS_SESSION_VALID( pMac, i ) ) - { - pSession = CSR_GET_SESSION( pMac, i ); - if (csrIsConnStateConnected(pMac, i)) - { - if (csrIsBssidMatch(pMac, (tCsrBssid *)&pMac->scan.currentCountryBssid, - &pSession->connectedProfile.bssid)) - { - smsLog(pMac, LOGW, FL("No need for updating CC, we will" - "continue with current AP's CC")); - goto end; - } + if (CSR_IS_SESSION_VALID(pMac, sessionId)) { + if (csrIsConnStateConnected(pMac, sessionId)) { + pSession = CSR_GET_SESSION(pMac, sessionId); + if (csrIsBssidMatch(pMac, &pMac->scan.currentCountryBssid, + &pSession->connectedProfile.bssid)) { + smsLog(pMac, LOGW, FL("No need for updating CC, we will " + "continue with current AP's CC")); + goto end; } } } @@ -3338,8 +3340,11 @@ end: } -static tCsrScanResult *csrScanSaveBssDescription( tpAniSirGlobal pMac, tSirBssDescription *pBSSDescription, - tDot11fBeaconIEs *pIes) +static tCsrScanResult * +csrScanSaveBssDescription(tpAniSirGlobal pMac, + tSirBssDescription *pBSSDescription, + tDot11fBeaconIEs *pIes, + tANI_U8 sessionId) { tCsrScanResult *pCsrBssDescription = NULL; tANI_U32 cbBSSDesc; @@ -3364,16 +3369,19 @@ static tCsrScanResult *csrScanSaveBssDescription( tpAniSirGlobal pMac, tSirBssDe return NULL; } #endif - csrScanAddResult(pMac, pCsrBssDescription, pIes); + csrScanAddResult(pMac, pCsrBssDescription, pIes, sessionId); } return( pCsrBssDescription ); } // Append a Bss Description... -tCsrScanResult *csrScanAppendBssDescription( tpAniSirGlobal pMac, - tSirBssDescription *pSirBssDescription, - tDot11fBeaconIEs *pIes, tANI_BOOLEAN fForced ) +tCsrScanResult * +csrScanAppendBssDescription(tpAniSirGlobal pMac, + tSirBssDescription *pSirBssDescription, + tDot11fBeaconIEs *pIes, + tANI_BOOLEAN fForced, + tANI_U8 sessionId) { tCsrScanResult *pCsrBssDescription = NULL; tAniSSID tmpSsid; @@ -3382,7 +3390,8 @@ tCsrScanResult *csrScanAppendBssDescription( tpAniSirGlobal pMac, tmpSsid.length = 0; result = csrRemoveDupBssDescription( pMac, pSirBssDescription, pIes, &tmpSsid, &timer, fForced ); - pCsrBssDescription = csrScanSaveBssDescription( pMac, pSirBssDescription, pIes ); + pCsrBssDescription = csrScanSaveBssDescription(pMac, pSirBssDescription, + pIes, sessionId); if (result && (pCsrBssDescription != NULL)) { //Check if the new one has SSID it it, if not, use the older SSID if it exists. @@ -4341,7 +4350,8 @@ tANI_BOOLEAN csrLearnCountryInformation( tpAniSirGlobal pMac, tSirBssDescription } -static void csrSaveScanResults( tpAniSirGlobal pMac, tANI_U8 reason ) +static void csrSaveScanResults(tpAniSirGlobal pMac, tANI_U8 reason, + tANI_U8 sessionId) { // initialize this to FALSE. profMoveInterimScanResultsToMainList() routine // will set this to the channel where an .11d beacon is seen @@ -4353,7 +4363,7 @@ static void csrSaveScanResults( tpAniSirGlobal pMac, tANI_U8 reason ) // only if the applied 11d info could be found in one of the scan results pMac->scan.fCurrent11dInfoMatch = eANI_BOOLEAN_FALSE; // move the scan results from interim list to the main scan list - csrMoveTempScanResultsToMainList( pMac, reason ); + csrMoveTempScanResultsToMainList(pMac, reason, sessionId); // Now check if we gathered any domain/country specific information // If so, we should update channel list and apply Tx power settings @@ -4597,7 +4607,7 @@ tANI_BOOLEAN csrScanComplete( tpAniSirGlobal pMac, tSirSmeScanRsp *pScanRsp ) pCommand->u.scanCmd.abortScanDueToBandChange = eANI_BOOLEAN_FALSE; } - csrSaveScanResults(pMac, pCommand->u.scanCmd.reason); + csrSaveScanResults(pMac, pCommand->u.scanCmd.reason, sessionId); #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR { @@ -5039,6 +5049,8 @@ static tANI_BOOLEAN csrScanProcessScanResults( tpAniSirGlobal pMac, tSmeCmd *pCo tANI_U32 cbBssDesc; tANI_U32 cbScanResult = GET_FIELD_OFFSET( tSirSmeScanRsp, bssDescription ) + sizeof(tSirBssDescription); //We need at least one CB + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[pScanRsp->sessionId]; // don't consider the scan rsp to be valid if the status code is Scan Failure. Scan Failure // is returned when the scan could not find anything. so if we get scan failure return that @@ -5190,15 +5202,15 @@ static tANI_BOOLEAN csrScanProcessScanResults( tpAniSirGlobal pMac, tSmeCmd *pCo * the scan is delaying the time it takes for LFR to find * candidates and resulting in disconnects. */ - if ( (csrIsStaSessionConnected(pMac) && + if ((csrIsStaSessionConnected(pMac) && #ifdef FEATURE_WLAN_LFR - (csrIsConcurrentInfraConnected(pMac) || - ((pCommand->u.scanCmd.reason != eCsrScanBgScan) && - (pMac->roam.neighborRoamInfo.neighborRoamState != + (csrIsConcurrentInfraConnected(pMac) || + ((pCommand->u.scanCmd.reason != eCsrScanBgScan) && + (pNeighborRoamInfo->neighborRoamState != eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN))) && #endif - (pCommand->u.scanCmd.u.scanRequest.p2pSearch != 1)) || - (csrIsP2pSessionConnected(pMac)) ) + (pCommand->u.scanCmd.u.scanRequest.p2pSearch != 1)) || + (csrIsP2pSessionConnected(pMac))) { /* if active connected sessions present then continue to split scan * with specified interval between consecutive scans */ @@ -5228,7 +5240,8 @@ tANI_BOOLEAN csrScanIsWildCardScan( tpAniSirGlobal pMac, tSmeCmd *pCommand ) } #ifdef FEATURE_WLAN_SCAN_PNO -eHalStatus csrSavePnoScanResults(tpAniSirGlobal pMac, tSirSmeScanRsp *pScanRsp) +eHalStatus csrSavePnoScanResults(tpAniSirGlobal pMac, tSirSmeScanRsp *pScanRsp, + tANI_U8 sessionId) { tSirBssDescription *pSirBssDescription; tANI_U32 cbScanResult = GET_FIELD_OFFSET( tSirSmeScanRsp, bssDescription ) @@ -5289,7 +5302,8 @@ eHalStatus csrSavePnoScanResults(tpAniSirGlobal pMac, tSirSmeScanRsp *pScanRsp) &tmpSsid , &timer, FALSE ); //Add to scan cache csrScanAddResult(pMac, pScanResult, - (tDot11fBeaconIEs *)pScanResult->Result.pvIes); + (tDot11fBeaconIEs *)pScanResult->Result.pvIes, + sessionId); // skip over the BSS description to the next one... cbParsed += cbBssDesc; @@ -5389,7 +5403,9 @@ eHalStatus csrScanSmeScanResponse( tpAniSirGlobal pMac, void *pMsgBuf ) smeProcessPendingQueue( pMac ); } #ifdef FEATURE_WLAN_SCAN_PNO - else if (pMac->pnoOffload && !HAL_STATUS_SUCCESS(csrSavePnoScanResults(pMac, pScanRsp))) + else if (pMac->pnoOffload && + !HAL_STATUS_SUCCESS(csrSavePnoScanResults(pMac, pScanRsp, + pScanRsp->sessionId))) { smsLog( pMac, LOGE, "CSR: Unable to store scan results for PNO" ); status = eHAL_STATUS_FAILURE; @@ -5402,7 +5418,9 @@ eHalStatus csrScanSmeScanResponse( tpAniSirGlobal pMac, void *pMsgBuf ) } } #ifdef FEATURE_WLAN_SCAN_PNO - else if (pMac->pnoOffload && !HAL_STATUS_SUCCESS(csrSavePnoScanResults(pMac, pScanRsp))) + else if (pMac->pnoOffload && + !HAL_STATUS_SUCCESS(csrSavePnoScanResults(pMac, pScanRsp, + pScanRsp->sessionId))) { smsLog( pMac, LOGE, "CSR: Unable to store scan results for PNO" ); status = eHAL_STATUS_FAILURE; @@ -6456,9 +6474,9 @@ void csrScanCallCallback(tpAniSirGlobal pMac, tSmeCmd *pCommand, eCsrScanStatus { if(pCommand->u.scanCmd.callback) { -// sme_ReleaseGlobalLock( &pMac->sme ); - pCommand->u.scanCmd.callback(pMac, pCommand->u.scanCmd.pContext, pCommand->u.scanCmd.scanID, scanStatus); -// sme_AcquireGlobalLock( &pMac->sme ); + pCommand->u.scanCmd.callback(pMac, pCommand->u.scanCmd.pContext, + pCommand->sessionId, + pCommand->u.scanCmd.scanID, scanStatus); } else { smsLog( pMac, LOG2, "%s:%d - Callback NULL!!!", __func__, __LINE__); } @@ -6516,6 +6534,7 @@ static void csrStaApConcTimerHandler(void *pv) tpAniSirGlobal pMac = PMAC_STRUCT( pv ); tListElem *pEntry; tSmeCmd *pScanCmd; + tANI_U32 sessionId = CSR_SESSION_ID_INVALID; csrLLLock(&pMac->scan.scanCmdPendingList); @@ -6532,6 +6551,7 @@ static void csrStaApConcTimerHandler(void *pv) pScanCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); numChn = pScanCmd->u.scanCmd.u.scanRequest.ChannelInfo.numOfChannels; + sessionId = pScanCmd->sessionId; /* if any session is connected and the number of channels to scan is * greater than 1 then split the scan into multiple scan operations @@ -6564,7 +6584,7 @@ static void csrStaApConcTimerHandler(void *pv) #ifdef FEATURE_WLAN_LFR (csrIsConcurrentInfraConnected(pMac) || ((pScanCmd->u.scanCmd.reason != eCsrScanBgScan) && - (pMac->roam.neighborRoamInfo.neighborRoamState != + (pMac->roam.neighborRoamInfo[sessionId].neighborRoamState != eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN))) && #endif (pScanCmd->u.scanCmd.u.scanRequest.p2pSearch != 1)) || @@ -7212,6 +7232,7 @@ tANI_BOOLEAN csrScanRemoveFreshScanCommand(tpAniSirGlobal pMac, tANI_U8 sessionI * send response with status eCSR_SCAN_ABORT*/ pCommand->u.scanCmd.callback(pMac, pCommand->u.scanCmd.pContext, + sessionId, pCommand->u.scanCmd.scanID, eCSR_SCAN_ABORT); } @@ -7306,8 +7327,10 @@ eHalStatus csrScanGetPMKIDCandidateList(tpAniSirGlobal pMac, tANI_U32 sessionId, while(((pScanResult = csrScanResultGetNext(pMac, hBSSList)) != NULL) && ( pSession->NumPmkidCandidate < nItems)) { //NumPmkidCandidate adds up here - csrProcessBSSDescForPMKIDList(pMac, &pScanResult->BssDescriptor, - (tDot11fBeaconIEs *)( pScanResult->pvIes )); + csrProcessBSSDescForPMKIDList(pMac, + &pScanResult->BssDescriptor, + (tDot11fBeaconIEs *)(pScanResult->pvIes), + sessionId); } if(pSession->NumPmkidCandidate) { @@ -7397,6 +7420,8 @@ eHalStatus csrScanForSSID(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfi tANI_U8 bAddr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; tANI_U8 index = 0; tANI_U32 numSsid = pProfile->SSIDs.numOfSSIDs; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; smsLog(pMac, LOG2, FL("called")); //For WDS, we use the index 0. There must be at least one in there @@ -7469,12 +7494,14 @@ eHalStatus csrScanForSSID(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfi /* For one channel be good enpugh time to receive beacon atleast */ if( 1 == pProfile->ChannelInfo.numOfChannels ) { -#ifndef QCA_WIFI_ISOC - if(pMac->roam.neighborRoamInfo.handoffReqInfo.src == FASTREASSOC) - { - pScanCmd->u.scanCmd.u.scanRequest.maxChnTime = MAX_ACTIVE_SCAN_FOR_ONE_CHANNEL_FASTREASSOC; - pScanCmd->u.scanCmd.u.scanRequest.minChnTime = MIN_ACTIVE_SCAN_FOR_ONE_CHANNEL_FASTREASSOC; - pMac->roam.neighborRoamInfo.handoffReqInfo.src = 0; //reset this value +#if !defined(QCA_WIFI_ISOC) && defined (WLAN_FEATURE_ROAM_SCAN_OFFLOAD) + if (pNeighborRoamInfo->handoffReqInfo.src == FASTREASSOC) { + pScanCmd->u.scanCmd.u.scanRequest.maxChnTime = + MAX_ACTIVE_SCAN_FOR_ONE_CHANNEL_FASTREASSOC; + pScanCmd->u.scanCmd.u.scanRequest.minChnTime = + MIN_ACTIVE_SCAN_FOR_ONE_CHANNEL_FASTREASSOC; + /* Reset this value */ + pNeighborRoamInfo->handoffReqInfo.src = 0; } else #endif @@ -8209,6 +8236,112 @@ void csrRemoveCmdFromPendingList(tpAniSirGlobal pMac, tDblLinkList *pList, } +eHalStatus csrScanAbortScanForSSID(tpAniSirGlobal pMac, tANI_U32 sessionId) +{ + eHalStatus status = eHAL_STATUS_SUCCESS; + tSirSmeScanAbortReq *pMsg; + tANI_U16 msgLen; + tListElem *pEntry; + tSmeCmd *pCommand; + + if (!pMac->fScanOffload) + { + pMac->scan.fDropScanCmd = eANI_BOOLEAN_TRUE; +#ifdef WLAN_AP_STA_CONCURRENCY + csrRemoveScanForSSIDFromPendingList( pMac, &pMac->scan.scanCmdPendingList, sessionId); +#endif + csrRemoveScanForSSIDFromPendingList( pMac, &pMac->roam.roamCmdPendingList, sessionId); + csrRemoveScanForSSIDFromPendingList( pMac, &pMac->sme.smeCmdPendingList, sessionId); + pMac->scan.fDropScanCmd = eANI_BOOLEAN_FALSE; + pEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK); + } + else + { + pMac->scan.fDropScanCmd = eANI_BOOLEAN_TRUE; + csrRemoveScanForSSIDFromPendingList( pMac, &pMac->sme.smeScanCmdPendingList, sessionId); + pMac->scan.fDropScanCmd = eANI_BOOLEAN_FALSE; + pEntry = csrLLPeekHead(&pMac->sme.smeScanCmdActiveList, LL_ACCESS_LOCK); + } + + if(NULL != pEntry) + { + pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); + + if ( (eSmeCommandScan == pCommand->command ) && + (sessionId == pCommand->sessionId)) + { + if ( eCsrScanForSsid == pCommand->u.scanCmd.reason) + { + msgLen = (tANI_U16)(sizeof( tSirSmeScanAbortReq )); + pMsg = vos_mem_malloc(msgLen); + if ( NULL == pMsg ) + { + status = eHAL_STATUS_FAILURE; + smsLog(pMac, LOGE, FL("Failed to allocate memory for SmeScanAbortReq")); + } + else + { + vos_mem_zero((void *)pMsg, msgLen); + pMsg->type = pal_cpu_to_be16((tANI_U16)eWNI_SME_SCAN_ABORT_IND); + pMsg->msgLen = pal_cpu_to_be16(msgLen); + pMsg->sessionId = sessionId; + status = palSendMBMessage(pMac->hHdd, pMsg); + } + } + } + } + return( status ); +} + +void csrRemoveScanForSSIDFromPendingList(tpAniSirGlobal pMac, tDblLinkList *pList, tANI_U32 sessionId) +{ + tDblLinkList localList; + tListElem *pEntry; + tSmeCmd *pCommand; + tListElem *pEntryToRemove; + + vos_mem_zero(&localList, sizeof(tDblLinkList)); + if(!HAL_STATUS_SUCCESS(csrLLOpen(pMac->hHdd, &localList))) + { + smsLog(pMac, LOGE, FL(" failed to open list")); + return; + } + + csrLLLock(pList); + if( !csrLLIsListEmpty( pList, LL_ACCESS_NOLOCK ) ) + { + pEntry = csrLLPeekHead( pList, LL_ACCESS_NOLOCK); + + // Have to make sure we don't loop back to the head of the list, which will + // happen if the entry is NOT on the list... + while( pEntry ) + { + pEntryToRemove = pEntry; + pEntry = csrLLNext(pList, pEntry, LL_ACCESS_NOLOCK); + pCommand = GET_BASE_ADDR( pEntryToRemove, tSmeCmd, Link ); + if ( (eSmeCommandScan == pCommand->command ) && + (sessionId == pCommand->sessionId) ) + { + if ( eCsrScanForSsid == pCommand->u.scanCmd.reason) + { + // Remove that entry only + if ( csrLLRemoveEntry( pList, pEntryToRemove, LL_ACCESS_NOLOCK)) + { + csrLLInsertTail(&localList, pEntryToRemove, LL_ACCESS_NOLOCK); + } + } + } + } + } + csrLLUnlock(pList); + + while( (pEntry = csrLLRemoveHead(&localList, LL_ACCESS_NOLOCK)) ) + { + pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); + csrAbortCommand( pMac, pCommand, eANI_BOOLEAN_FALSE); + } + csrLLClose(&localList); +} eHalStatus csrScanAbortMacScanNotForConnect(tpAniSirGlobal pMac, tANI_U8 sessionId) @@ -8436,7 +8569,8 @@ eHalStatus csrScanSavePreferredNetworkFound(tpAniSirGlobal pMac, return eHAL_STATUS_RESOURCES; } //Add to scan cache - csrScanAddResult(pMac, pScanResult, pIesLocal); + csrScanAddResult(pMac, pScanResult, pIesLocal, + pPrefNetworkFoundInd->sessionId); if( (pScanResult->Result.pvIes == NULL) && pIesLocal ) { @@ -8450,31 +8584,32 @@ eHalStatus csrScanSavePreferredNetworkFound(tpAniSirGlobal pMac, #endif //FEATURE_WLAN_SCAN_PNO #ifdef FEATURE_WLAN_LFR -void csrInitOccupiedChannelsList(tpAniSirGlobal pMac) +void csrInitOccupiedChannelsList(tpAniSirGlobal pMac, tANI_U8 sessionId) { tListElem *pEntry = NULL; tCsrScanResult *pBssDesc = NULL; tDot11fBeaconIEs *pIes = NULL; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; if (0 != pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels) { - smsLog(pMac, LOG1, FL("%s: Ini file contains neighbor scan channel list," - " hence NO need to build occupied channel list (numChannels = %d)"), - __func__, pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels); + smsLog(pMac, LOG1, FL("Ini file contains neighbor scan channel list, " + "hence NO need to build occupied channel list (numChannels = %d)"), + pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels); return; } - if (!csrNeighborRoamIsNewConnectedProfile(pMac)) + if (!csrNeighborRoamIsNewConnectedProfile(pMac, sessionId)) { - smsLog(pMac, LOG2, FL("%s: donot flush occupied list since current roam profile" - " matches previous (numChannels = %d)"), - __func__, pMac->scan.occupiedChannels.numChannels); + smsLog(pMac, LOG2, FL("donot flush occupied list since current roam " + "profile matches previous (numChannels = %d)"), + pMac->scan.occupiedChannels[sessionId].numChannels); return; } /* Empty occupied channels here */ - pMac->scan.occupiedChannels.numChannels = 0; + pMac->scan.occupiedChannels[sessionId].numChannels = 0; csrLLLock(&pMac->scan.scanResultList); pEntry = csrLLPeekHead( &pMac->scan.scanResultList, LL_ACCESS_NOLOCK ); @@ -8490,7 +8625,9 @@ void csrInitOccupiedChannelsList(tpAniSirGlobal pMac) continue; } - csrScanAddToOccupiedChannels(pMac, pBssDesc, &pMac->scan.occupiedChannels, pIes); + csrScanAddToOccupiedChannels(pMac, pBssDesc, sessionId, + &pMac->scan.occupiedChannels[sessionId], + pIes); /* * Free the memory allocated for pIes in csrGetParsedBssDescriptionIEs @@ -8503,7 +8640,6 @@ void csrInitOccupiedChannelsList(tpAniSirGlobal pMac) pEntry = csrLLNext( &pMac->scan.scanResultList, pEntry, LL_ACCESS_NOLOCK ); }//while csrLLUnlock(&pMac->scan.scanResultList); - } #endif @@ -8562,10 +8698,9 @@ eHalStatus csrScanCreateEntryInScanCache(tpAniSirGlobal pMac, tANI_U32 sessionId //change the BSSID & channel as passed vos_mem_copy(pNewBssDescriptor->bssId, bssid, sizeof(tSirMacAddr)); pNewBssDescriptor->channelId = channel; - if(NULL == csrScanAppendBssDescription( pMac, pNewBssDescriptor, pNewIes, TRUE )) - { - smsLog(pMac, LOGE, FL("%s: csrScanAppendBssDescription failed"), - __func__); + if (NULL == csrScanAppendBssDescription(pMac, pNewBssDescriptor, + pNewIes, TRUE, sessionId)) { + smsLog(pMac, LOGE, FL("csrScanAppendBssDescription failed")); status = eHAL_STATUS_FAILURE; break; } diff --git a/CORE/SME/src/csr/csrCmdProcess.c b/CORE/SME/src/csr/csrCmdProcess.c index 9e6cdb3da86c..dd3b97fe0126 100644 --- a/CORE/SME/src/csr/csrCmdProcess.c +++ b/CORE/SME/src/csr/csrCmdProcess.c @@ -54,11 +54,11 @@ eHalStatus csrMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf ) #endif smsLog(pMac, LOG2, FL("Message %d[0x%04X] received in curState %s" - " and substate %s"), + " and substate %s sessionId (%d)"), pSmeRsp->messageType, pSmeRsp->messageType, macTraceGetcsrRoamState(pMac->roam.curState[pSmeRsp->sessionId]), macTraceGetcsrRoamSubState( - pMac->roam.curSubState[pSmeRsp->sessionId])); + pMac->roam.curSubState[pSmeRsp->sessionId]), pSmeRsp->sessionId); #ifdef FEATURE_WLAN_SCAN_PNO /* diff --git a/CORE/SME/src/csr/csrInsideApi.h b/CORE/SME/src/csr/csrInsideApi.h index d6fc72f0cbc4..7124ba4c1403 100644 --- a/CORE/SME/src/csr/csrInsideApi.h +++ b/CORE/SME/src/csr/csrInsideApi.h @@ -247,9 +247,11 @@ eHalStatus csrScanRequestLostLink3( tpAniSirGlobal pMac, tANI_U32 sessionId ); eHalStatus csrScanHandleFailedLostlink1(tpAniSirGlobal pMac, tANI_U32 sessionId); eHalStatus csrScanHandleFailedLostlink2(tpAniSirGlobal pMac, tANI_U32 sessionId); eHalStatus csrScanHandleFailedLostlink3(tpAniSirGlobal pMac, tANI_U32 sessionId); -tCsrScanResult *csrScanAppendBssDescription( tpAniSirGlobal pMac, - tSirBssDescription *pSirBssDescription, - tDot11fBeaconIEs *pIes, tANI_BOOLEAN fForced); +tCsrScanResult *csrScanAppendBssDescription(tpAniSirGlobal pMac, + tSirBssDescription *pSirBssDescription, + tDot11fBeaconIEs *pIes, + tANI_BOOLEAN fForced, + tANI_U8 sessionId); void csrScanCallCallback(tpAniSirGlobal pMac, tSmeCmd *pCommand, eCsrScanStatus scanStatus); eHalStatus csrScanCopyRequest(tpAniSirGlobal pMac, tCsrScanRequest *pDstReq, tCsrScanRequest *pSrcReq); eHalStatus csrScanFreeRequest(tpAniSirGlobal pMac, tCsrScanRequest *pReq); @@ -288,6 +290,9 @@ void csrRemoveCmdWithSessionIdFromPendingList(tpAniSirGlobal pMac, eHalStatus csrScanAbortMacScanNotForConnect(tpAniSirGlobal pMac, tANI_U8 sessionId); eHalStatus csrScanGetScanChannelInfo(tpAniSirGlobal pMac, tANI_U8 sessionId); +eHalStatus csrScanAbortScanForSSID(tpAniSirGlobal pMac, tANI_U32 sessionId); +void csrRemoveScanForSSIDFromPendingList(tpAniSirGlobal pMac, tDblLinkList *pList, tANI_U32 sessionId); + //To age out scan results base. tSmeGetScanChnRsp is a pointer returned by LIM that //has the information regarding scanned channels. //The logic is that whenever CSR add a BSS to scan result, it set the age count to @@ -481,9 +486,11 @@ eHalStatus csrScanGetResult(tpAniSirGlobal, tCsrScanResultFilter *pFilter, tScan /* --------------------------------------------------------------------------- \fn csrScanFlushResult \brief Clear scan results. + \param pMac - pMac global pointer + \param sessionId - Session Identifier \return eHalStatus -------------------------------------------------------------------------------*/ -eHalStatus csrScanFlushResult(tpAniSirGlobal); +eHalStatus csrScanFlushResult(tpAniSirGlobal, tANI_U8 sessionId); /* --------------------------------------------------------------------------- * \fn csrScanFilterResults * \brief Filter scan results based on valid channel list. @@ -1002,9 +1009,12 @@ eHalStatus csrRoamEnqueuePreauth(tpAniSirGlobal pMac, tANI_U32 sessionId, tpSirB eCsrRoamReason reason, tANI_BOOLEAN fImmediate); eHalStatus csrDequeueRoamCommand(tpAniSirGlobal pMac, eCsrRoamReason reason); #ifdef FEATURE_WLAN_LFR -void csrInitOccupiedChannelsList(tpAniSirGlobal pMac); -tANI_BOOLEAN csrNeighborRoamIsNewConnectedProfile(tpAniSirGlobal pMac); -tANI_BOOLEAN csrNeighborRoamConnectedProfileMatch(tpAniSirGlobal pMac, tCsrScanResult *pResult, +void csrInitOccupiedChannelsList(tpAniSirGlobal pMac, tANI_U8 sessionId); +tANI_BOOLEAN csrNeighborRoamIsNewConnectedProfile(tpAniSirGlobal pMac, + tANI_U8 sessionId); +tANI_BOOLEAN csrNeighborRoamConnectedProfileMatch(tpAniSirGlobal pMac, + tANI_U8 sessionId, + tCsrScanResult *pResult, tDot11fBeaconIEs *pIes); #endif eHalStatus csrSetTxPower(tpAniSirGlobal pMac, v_U8_t sessionId, v_U8_t mW); diff --git a/CORE/SME/src/csr/csrNeighborRoam.c b/CORE/SME/src/csr/csrNeighborRoam.c index ebae4e53dc2c..f36959028610 100644 --- a/CORE/SME/src/csr/csrNeighborRoam.c +++ b/CORE/SME/src/csr/csrNeighborRoam.c @@ -78,22 +78,27 @@ #endif static void csrNeighborRoamResetChannelInfo(tpCsrNeighborRoamChannelInfo rChInfo); -static void csrNeighborRoamResetCfgListChanScanControlInfo(tpAniSirGlobal pMac); -static void csrNeighborRoamResetPreauthControlInfo(tpAniSirGlobal pMac); -static void csrNeighborRoamDeregAllRssiIndication(tpAniSirGlobal pMac); +static void csrNeighborRoamResetCfgListChanScanControlInfo(tpAniSirGlobal pMac, + tANI_U8 sessionId); +static void csrNeighborRoamResetPreauthControlInfo(tpAniSirGlobal pMac, + tANI_U8 sessionId); +static void csrNeighborRoamDeregAllRssiIndication(tpAniSirGlobal pMac, + tANI_U8 sessionId); VOS_STATUS csrNeighborRoamNeighborLookupUPCallback (v_PVOID_t pAdapter, v_U8_t rssiNotification, - v_PVOID_t pUserCtxt, - v_S7_t avgRssi); + v_PVOID_t pUserCtxt, + v_S7_t avgRssi); VOS_STATUS csrNeighborRoamNeighborLookupDOWNCallback (v_PVOID_t pAdapter, v_U8_t rssiNotification, - v_PVOID_t pUserCtxt, - v_S7_t avgRssi); + v_PVOID_t pUserCtxt, + v_S7_t avgRssi); void csrNeighborRoamRRMNeighborReportResult(void *context, VOS_STATUS vosStatus); eHalStatus csrRoamCopyConnectedProfile(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pDstProfile ); #ifdef WLAN_FEATURE_VOWIFI_11R -static eHalStatus csrNeighborRoamIssuePreauthReq(tpAniSirGlobal pMac); -VOS_STATUS csrNeighborRoamIssueNeighborRptRequest(tpAniSirGlobal pMac); +static eHalStatus csrNeighborRoamIssuePreauthReq(tpAniSirGlobal pMac, + tANI_U8 sessionId); +VOS_STATUS csrNeighborRoamIssueNeighborRptRequest(tpAniSirGlobal pMac, + tANI_U8 sessionId); #endif v_U8_t *csrNeighborRoamStateToString(v_U8_t state) @@ -116,14 +121,17 @@ v_U8_t *csrNeighborRoamStateToString(v_U8_t state) } /* State Transition macro */ -#define CSR_NEIGHBOR_ROAM_STATE_TRANSITION(newState)\ +#define CSR_NEIGHBOR_ROAM_STATE_TRANSITION(newState, sessionId)\ {\ - pMac->roam.neighborRoamInfo.prevNeighborRoamState = pMac->roam.neighborRoamInfo.neighborRoamState;\ - pMac->roam.neighborRoamInfo.neighborRoamState = newState;\ + pMac->roam.neighborRoamInfo[sessionId].prevNeighborRoamState = \ + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState;\ + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState = newState;\ VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, \ - FL("Neighbor Roam Transition from state %s ==> %s"), \ - csrNeighborRoamStateToString (pMac->roam.neighborRoamInfo.prevNeighborRoamState), \ - csrNeighborRoamStateToString (newState));\ + FL("Session id(%d) Neighbor Roam Transition from state %s ==> %s"), \ + sessionId, \ + csrNeighborRoamStateToString ( \ + pMac->roam.neighborRoamInfo[sessionId].prevNeighborRoamState), \ + csrNeighborRoamStateToString (newState));\ } /* --------------------------------------------------------------------------- @@ -247,8 +255,10 @@ void csrNeighborRoamFreeRoamableBSSList(tpAniSirGlobal pMac, tDblLinkList *pList } static void csrNeighborRoamTriggerHandoff(tpAniSirGlobal pMac, - tpCsrNeighborRoamControlInfo pNeighborRoamInfo) + tANI_U8 sessionId) { + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; #ifdef WLAN_FEATURE_VOWIFI_11R if ((pNeighborRoamInfo->is11rAssoc) #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD @@ -259,7 +269,7 @@ static void csrNeighborRoamTriggerHandoff(tpAniSirGlobal pMac, if ((eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN == pNeighborRoamInfo->neighborRoamState) || (eSME_ROAM_TRIGGER_FAST_ROAM == pNeighborRoamInfo->cfgRoamEn)) { - csrNeighborRoamIssuePreauthReq(pMac); + csrNeighborRoamIssuePreauthReq(pMac, sessionId); pNeighborRoamInfo->cfgRoamEn = eSME_ROAM_TRIGGER_NONE; vos_mem_set(&pNeighborRoamInfo->cfgRoambssId[0], sizeof(pNeighborRoamInfo->cfgRoambssId), @@ -285,7 +295,7 @@ static void csrNeighborRoamTriggerHandoff(tpAniSirGlobal pMac, { if (eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN == pNeighborRoamInfo->neighborRoamState) { - csrNeighborRoamIssuePreauthReq(pMac); + csrNeighborRoamIssuePreauthReq(pMac, sessionId); } else { @@ -298,7 +308,7 @@ static void csrNeighborRoamTriggerHandoff(tpAniSirGlobal pMac, else #endif #ifdef FEATURE_WLAN_LFR - if (csrRoamIsFastRoamEnabled(pMac, CSR_SESSION_ID_INVALID)) + if (csrRoamIsFastRoamEnabled(pMac, sessionId)) { if ((eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN == pNeighborRoamInfo->neighborRoamState) #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD @@ -307,7 +317,7 @@ static void csrNeighborRoamTriggerHandoff(tpAniSirGlobal pMac, #endif ) { - csrNeighborRoamIssuePreauthReq(pMac); + csrNeighborRoamIssuePreauthReq(pMac, sessionId); pNeighborRoamInfo->cfgRoamEn = eSME_ROAM_TRIGGER_NONE; vos_mem_set(&pNeighborRoamInfo->cfgRoambssId[0], sizeof(pNeighborRoamInfo->cfgRoambssId), @@ -326,7 +336,7 @@ static void csrNeighborRoamTriggerHandoff(tpAniSirGlobal pMac, { if (eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN == pNeighborRoamInfo->neighborRoamState) { - csrNeighborRoamRequestHandoff(pMac); + csrNeighborRoamRequestHandoff(pMac, sessionId); } else { @@ -337,10 +347,15 @@ static void csrNeighborRoamTriggerHandoff(tpAniSirGlobal pMac, } } -VOS_STATUS csrNeighborRoamUpdateFastRoamingEnabled(tpAniSirGlobal pMac, const v_BOOL_t fastRoamEnabled) +VOS_STATUS +csrNeighborRoamUpdateFastRoamingEnabled(tpAniSirGlobal pMac, + tANI_U8 sessionId, + const v_BOOL_t fastRoamEnabled) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + tpFTRoamCallbackUsrCtx pUsrCtx; if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED == pNeighborRoamInfo->neighborRoamState) { @@ -349,21 +364,37 @@ VOS_STATUS csrNeighborRoamUpdateFastRoamingEnabled(tpAniSirGlobal pMac, const v_ #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_CONNECT); + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_START, + REASON_CONNECT); } else { #endif - NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Registering neighbor lookup DOWN event with TL, RSSI = %d"), - pNeighborRoamInfo->currentNeighborLookupThreshold); - /* Register Neighbor Lookup threshold callback with TL for DOWN event only */ - vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1), - WLANTL_HO_THRESHOLD_DOWN, - csrNeighborRoamNeighborLookupDOWNCallback, - VOS_MODULE_ID_SME, pMac); - if (!VOS_IS_STATUS_SUCCESS(vosStatus)) - { - //err msg - smsLog(pMac, LOGW, FL(" Couldn't register csrNeighborRoamNeighborLookupDOWNCallback with TL: Status = %d"), + NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Registering neighbor lookup " + "DOWN event with TL, RSSI = %d"), + pNeighborRoamInfo->currentNeighborLookupThreshold); + + /* Both pMac and sessionId are required to identify for which + * session the indication is being received + */ + pUsrCtx = vos_mem_malloc(sizeof(*pUsrCtx)); + if (NULL == pUsrCtx) { + smsLog(pMac, LOGE, FL("Memory allocation failure")); + return VOS_STATUS_E_NOMEM; + } + pUsrCtx->pMac = pMac; + pUsrCtx->sessionId = sessionId; + + /* Register Neighbor Lookup threshold callback with TL for + DOWN event only */ + vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, + (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1), + WLANTL_HO_THRESHOLD_DOWN, + csrNeighborRoamNeighborLookupDOWNCallback, + VOS_MODULE_ID_SME, pUsrCtx); + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { + smsLog(pMac, LOGW, + FL("Failed to register RSSI indication callback = %d"), vosStatus); + vos_mem_free(pUsrCtx); vosStatus = VOS_STATUS_E_FAILURE; } #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD @@ -377,10 +408,11 @@ VOS_STATUS csrNeighborRoamUpdateFastRoamingEnabled(tpAniSirGlobal pMac, const v_ #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_STOP, REASON_DISCONNECTED); + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_STOP, + REASON_DISCONNECTED); } else { #endif - csrNeighborRoamDeregAllRssiIndication(pMac); + csrNeighborRoamDeregAllRssiIndication(pMac, sessionId); #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD } #endif @@ -402,32 +434,52 @@ VOS_STATUS csrNeighborRoamUpdateFastRoamingEnabled(tpAniSirGlobal pMac, const v_ } #ifdef FEATURE_WLAN_ESE -VOS_STATUS csrNeighborRoamUpdateEseModeEnabled(tpAniSirGlobal pMac, const v_BOOL_t eseMode) +VOS_STATUS csrNeighborRoamUpdateEseModeEnabled(tpAniSirGlobal pMac, + tANI_U8 sessionId, + const v_BOOL_t eseMode) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED == pNeighborRoamInfo->neighborRoamState) { if (VOS_TRUE == eseMode) { - NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Registering neighbor lookup DOWN event with TL, RSSI = %d"), - pNeighborRoamInfo->currentNeighborLookupThreshold); + NEIGHBOR_ROAM_DEBUG(pMac, LOG2, + FL("Registering neighbor lookup DOWN event with TL, RSSI = %d"), + pNeighborRoamInfo->currentNeighborLookupThreshold); + #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_CONNECT); + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_START, + REASON_CONNECT); } else { #endif + /* This user context data will be returned with callback */ + pUsrCtx = vos_mem_malloc(sizeof(*pUsrCtx)); + if (NULL == pUsrCtx) { + smsLog(pMac, LOGE, FL("Memory allocation failure")); + return VOS_STATUS_E_NOMEM; + } + pUsrCtx->pMac = pMac; + pUsrCtx->sessionId = sessionId; + /* Register Neighbor Lookup threshold callback with TL for DOWN event only */ - vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1), - WLANTL_HO_THRESHOLD_DOWN, - csrNeighborRoamNeighborLookupDOWNCallback, - VOS_MODULE_ID_SME, pMac); - if (!VOS_IS_STATUS_SUCCESS(vosStatus)) - { - //err msg - smsLog(pMac, LOGW, FL(" Couldn't register csrNeighborRoamNeighborLookupDOWNCallback with TL: Status = %d"), vosStatus); + vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, + (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1), + WLANTL_HO_THRESHOLD_DOWN, + csrNeighborRoamNeighborLookupDOWNCallback, + VOS_MODULE_ID_SME, pUsrCtx); + + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { + smsLog(pMac, LOGW, + FL("Failed to register RSSI indication callback: Status = %d"), + vosStatus); + + /* Registration failed, freeup user context */ + vos_mem_free(pUsrCtx); vosStatus = VOS_STATUS_E_FAILURE; } #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD @@ -436,27 +488,34 @@ VOS_STATUS csrNeighborRoamUpdateEseModeEnabled(tpAniSirGlobal pMac, const v_BOOL } else if (VOS_FALSE == eseMode) { - NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Currently in CONNECTED state, so deregister all events")); + NEIGHBOR_ROAM_DEBUG(pMac, LOG2, + FL("Currently in CONNECTED state, so deregister all events")); + /* De-register existing lookup UP/DOWN, Rssi indications */ #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_STOP, REASON_DISCONNECTED); + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_STOP, + REASON_DISCONNECTED); } else { #endif - csrNeighborRoamDeregAllRssiIndication(pMac); + csrNeighborRoamDeregAllRssiIndication(pMac, sessionId); #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD } #endif } } - else if (eCSR_NEIGHBOR_ROAM_STATE_INIT == pNeighborRoamInfo->neighborRoamState) + else if (eCSR_NEIGHBOR_ROAM_STATE_INIT == + pNeighborRoamInfo->neighborRoamState) { - NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Currently in INIT state, Nothing to do")); + NEIGHBOR_ROAM_DEBUG(pMac, LOG2, + FL("Currently in INIT state, Nothing to do")); } else { - NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Unexpected state %d, returning failure"), pNeighborRoamInfo->neighborRoamState); + NEIGHBOR_ROAM_DEBUG(pMac, LOGE, + FL("Unexpected state %d, returning failure"), + pNeighborRoamInfo->neighborRoamState); vosStatus = VOS_STATUS_E_FAILURE; } return vosStatus; @@ -465,42 +524,65 @@ VOS_STATUS csrNeighborRoamUpdateEseModeEnabled(tpAniSirGlobal pMac, const v_BOOL #endif -VOS_STATUS csrNeighborRoamSetLookupRssiThreshold(tpAniSirGlobal pMac, v_U8_t neighborLookupRssiThreshold) +VOS_STATUS csrNeighborRoamSetLookupRssiThreshold(tpAniSirGlobal pMac, + tANI_U8 sessionId, + v_U8_t neighborLookupRssiThreshold) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + tpFTRoamCallbackUsrCtx pUsrCtx; - if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED == pNeighborRoamInfo->neighborRoamState) + if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED == + pNeighborRoamInfo->neighborRoamState) { - NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Currently in CONNECTED state, so deregister all and re-register for DOWN event again")); + NEIGHBOR_ROAM_DEBUG(pMac, LOG2, + FL("In CONNECTED state, re-register for DOWN event only")); - pMac->roam.neighborRoamInfo.cfgParams.neighborLookupThreshold = neighborLookupRssiThreshold; - pNeighborRoamInfo->currentNeighborLookupThreshold = pMac->roam.neighborRoamInfo.cfgParams.neighborLookupThreshold; + pNeighborRoamInfo->cfgParams.neighborLookupThreshold = + neighborLookupRssiThreshold; + pNeighborRoamInfo->currentNeighborLookupThreshold = + pNeighborRoamInfo->cfgParams.neighborLookupThreshold; /* De-register existing lookup UP/DOWN, Rssi indications */ #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_LOOKUP_THRESH_CHANGED); + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_LOOKUP_THRESH_CHANGED); } else { #endif - csrNeighborRoamDeregAllRssiIndication(pMac); + csrNeighborRoamDeregAllRssiIndication(pMac, sessionId); + + /* This user context data will be returned with callback */ + pUsrCtx = vos_mem_malloc(sizeof(*pUsrCtx)); + if (NULL == pUsrCtx) { + smsLog(pMac, LOGE, FL("Memory allocation failure")); + return VOS_STATUS_E_NOMEM; + } + pUsrCtx->pMac = pMac; + pUsrCtx->sessionId = sessionId; NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Registering neighbor lookup DOWN event with TL, RSSI = %d"), pNeighborRoamInfo->currentNeighborLookupThreshold); + /* Register Neighbor Lookup threshold callback with TL for DOWN event only */ vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, - (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1), + (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1), WLANTL_HO_THRESHOLD_DOWN, csrNeighborRoamNeighborLookupDOWNCallback, - VOS_MODULE_ID_SME, pMac); - if (!VOS_IS_STATUS_SUCCESS(vosStatus)) - { - //err msg - smsLog(pMac, LOGE, FL(" Couldn't register csrNeighborRoamNeighborLookupDOWNCallback with TL: Status = %d"), vosStatus); + VOS_MODULE_ID_SME, pUsrCtx); + + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { + smsLog(pMac, LOGE, + FL("Failed to register DOWN event with TL: Status = %d"), + vosStatus); + + /* Registration failed, freeup user context as well */ + vos_mem_free(pUsrCtx); vosStatus = VOS_STATUS_E_FAILURE; } #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD @@ -509,9 +591,12 @@ VOS_STATUS csrNeighborRoamSetLookupRssiThreshold(tpAniSirGlobal pMac, v_U8_t nei } else if (eCSR_NEIGHBOR_ROAM_STATE_INIT == pNeighborRoamInfo->neighborRoamState) { - NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Currently in INIT state, safe to set lookupRssi threshold")); - pMac->roam.neighborRoamInfo.cfgParams.neighborLookupThreshold = neighborLookupRssiThreshold; - pNeighborRoamInfo->currentNeighborLookupThreshold = pMac->roam.neighborRoamInfo.cfgParams.neighborLookupThreshold; + NEIGHBOR_ROAM_DEBUG(pMac, LOG2, + FL("Currently in INIT state, safe to set lookupRssi threshold")); + pNeighborRoamInfo->cfgParams.neighborLookupThreshold = + neighborLookupRssiThreshold; + pNeighborRoamInfo->currentNeighborLookupThreshold = + pNeighborRoamInfo->cfgParams.neighborLookupThreshold; } else { @@ -525,20 +610,24 @@ VOS_STATUS csrNeighborRoamSetLookupRssiThreshold(tpAniSirGlobal pMac, v_U8_t nei VOS_STATUS csrNeighborRoamSetOpportunisticScanThresholdDiff(tpAniSirGlobal pMac, + tANI_U8 sessionId, v_U8_t nOpportunisticThresholdDiff) { VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED - == pMac->roam.neighborRoamInfo.neighborRoamState) + == pNeighborRoamInfo->neighborRoamState) { NEIGHBOR_ROAM_DEBUG(pMac, LOG2, - FL("Currently in CONNECTED state, so deregister all and re-register for DOWN event again")); + FL("Currently in CONNECTED state, so deregister " + "all and re-register for DOWN event again")); - pMac->roam.neighborRoamInfo.cfgParams.nOpportunisticThresholdDiff = + pNeighborRoamInfo->cfgParams.nOpportunisticThresholdDiff = nOpportunisticThresholdDiff; - pMac->roam.neighborRoamInfo.currentOpportunisticThresholdDiff = + pNeighborRoamInfo->currentOpportunisticThresholdDiff = nOpportunisticThresholdDiff; /* De-register existing lookup UP/DOWN, Rssi indications */ @@ -546,20 +635,22 @@ csrNeighborRoamSetOpportunisticScanThresholdDiff(tpAniSirGlobal pMac, if (pMac->roam.configParam.isRoamOffloadScanEnabled) { csrRoamOffloadScan(pMac, + sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_OPPORTUNISTIC_THRESH_DIFF_CHANGED); } #endif } else if (eCSR_NEIGHBOR_ROAM_STATE_INIT - == pMac->roam.neighborRoamInfo.neighborRoamState) + == pNeighborRoamInfo->neighborRoamState) { NEIGHBOR_ROAM_DEBUG(pMac, LOG2, - FL("Currently in INIT state, safe to set opportunistic threshold diff")); - pMac->roam.neighborRoamInfo.cfgParams.nOpportunisticThresholdDiff = + FL("Currently in INIT state, safe to set " + "opportunistic threshold diff")); + pNeighborRoamInfo->cfgParams.nOpportunisticThresholdDiff = nOpportunisticThresholdDiff; - pMac->roam.neighborRoamInfo.currentOpportunisticThresholdDiff = + pNeighborRoamInfo->currentOpportunisticThresholdDiff = nOpportunisticThresholdDiff; } else @@ -567,7 +658,7 @@ csrNeighborRoamSetOpportunisticScanThresholdDiff(tpAniSirGlobal pMac, NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Unexpected state %d returning failure"), - pMac->roam.neighborRoamInfo.neighborRoamState); + pNeighborRoamInfo->neighborRoamState); vosStatus = VOS_STATUS_E_FAILURE; } return vosStatus; @@ -575,20 +666,24 @@ csrNeighborRoamSetOpportunisticScanThresholdDiff(tpAniSirGlobal pMac, VOS_STATUS csrNeighborRoamSetRoamRescanRssiDiff(tpAniSirGlobal pMac, + tANI_U8 sessionId, v_U8_t nRoamRescanRssiDiff) { VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED - == pMac->roam.neighborRoamInfo.neighborRoamState) + == pNeighborRoamInfo->neighborRoamState) { NEIGHBOR_ROAM_DEBUG(pMac, LOG2, - FL("Currently in CONNECTED state, so deregister all and re-register for DOWN event again")); + FL("Currently in CONNECTED state, so deregister " + "all and re-register for DOWN event again")); - pMac->roam.neighborRoamInfo.cfgParams.nRoamRescanRssiDiff = + pNeighborRoamInfo->cfgParams.nRoamRescanRssiDiff = nRoamRescanRssiDiff; - pMac->roam.neighborRoamInfo.currentRoamRescanRssiDiff = + pNeighborRoamInfo->currentRoamRescanRssiDiff = nRoamRescanRssiDiff; /* De-register existing lookup UP/DOWN, Rssi indications */ @@ -596,28 +691,29 @@ csrNeighborRoamSetRoamRescanRssiDiff(tpAniSirGlobal pMac, if (pMac->roam.configParam.isRoamOffloadScanEnabled) { csrRoamOffloadScan(pMac, + sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_ROAM_RESCAN_RSSI_DIFF_CHANGED); } #endif } else if (eCSR_NEIGHBOR_ROAM_STATE_INIT - == pMac->roam.neighborRoamInfo.neighborRoamState) + == pNeighborRoamInfo->neighborRoamState) { NEIGHBOR_ROAM_DEBUG(pMac, LOG2, - FL("Currently in INIT state, safe to set roam rescan rssi diff")); - pMac->roam.neighborRoamInfo.cfgParams.nRoamRescanRssiDiff = - nRoamRescanRssiDiff; - pMac->roam.neighborRoamInfo.currentRoamRescanRssiDiff = + FL("Currently in INIT state, safe to set roam " + "rescan rssi diff")); + pNeighborRoamInfo->cfgParams.nRoamRescanRssiDiff = nRoamRescanRssiDiff; + pNeighborRoamInfo->currentRoamRescanRssiDiff = nRoamRescanRssiDiff; } else { NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Unexpected state %d returning failure"), - pMac->roam.neighborRoamInfo.neighborRoamState); + pNeighborRoamInfo->neighborRoamState); vosStatus = VOS_STATUS_E_FAILURE; } return vosStatus; @@ -625,49 +721,51 @@ csrNeighborRoamSetRoamRescanRssiDiff(tpAniSirGlobal pMac, VOS_STATUS csrNeighborRoamSetRoamBmissFirstBcnt(tpAniSirGlobal pMac, + tANI_U8 sessionId, v_U8_t nRoamBmissFirstBcnt) { VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED - == pMac->roam.neighborRoamInfo.neighborRoamState) + == pNeighborRoamInfo->neighborRoamState) { NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Currently in CONNECTED state, so deregister all and re-register for DOWN event again")); - pMac->roam.neighborRoamInfo.cfgParams.nRoamBmissFirstBcnt = - nRoamBmissFirstBcnt; - pMac->roam.neighborRoamInfo.currentRoamBmissFirstBcnt = + pNeighborRoamInfo->cfgParams.nRoamBmissFirstBcnt = nRoamBmissFirstBcnt; + pNeighborRoamInfo->currentRoamBmissFirstBcnt = nRoamBmissFirstBcnt; /* De-register existing lookup UP/DOWN, Rssi indications */ #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled) { csrRoamOffloadScan(pMac, + sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_ROAM_BMISS_FIRST_BCNT_CHANGED); } #endif } else if (eCSR_NEIGHBOR_ROAM_STATE_INIT - == pMac->roam.neighborRoamInfo.neighborRoamState) + == pNeighborRoamInfo->neighborRoamState) { NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Currently in INIT state, safe to set roam rescan rssi diff")); - pMac->roam.neighborRoamInfo.cfgParams.nRoamBmissFirstBcnt = - nRoamBmissFirstBcnt; - pMac->roam.neighborRoamInfo.currentRoamBmissFirstBcnt = + pNeighborRoamInfo->cfgParams.nRoamBmissFirstBcnt = nRoamBmissFirstBcnt; + pNeighborRoamInfo->currentRoamBmissFirstBcnt = nRoamBmissFirstBcnt; } else { NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Unexpected state %d returning failure"), - pMac->roam.neighborRoamInfo.neighborRoamState); + pNeighborRoamInfo->neighborRoamState); vosStatus = VOS_STATUS_E_FAILURE; } return vosStatus; @@ -675,49 +773,50 @@ csrNeighborRoamSetRoamBmissFirstBcnt(tpAniSirGlobal pMac, VOS_STATUS csrNeighborRoamSetRoamBmissFinalBcnt(tpAniSirGlobal pMac, + tANI_U8 sessionId, v_U8_t nRoamBmissFinalBcnt) { VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED - == pMac->roam.neighborRoamInfo.neighborRoamState) + == pNeighborRoamInfo->neighborRoamState) { NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Currently in CONNECTED state, so deregister all and re-register for DOWN event again")); - pMac->roam.neighborRoamInfo.cfgParams.nRoamBmissFinalBcnt = - nRoamBmissFinalBcnt; - pMac->roam.neighborRoamInfo.currentRoamBmissFinalBcnt = + pNeighborRoamInfo->cfgParams.nRoamBmissFinalBcnt = nRoamBmissFinalBcnt; + pNeighborRoamInfo->currentRoamBmissFinalBcnt = nRoamBmissFinalBcnt; /* De-register existing lookup UP/DOWN, Rssi indications */ #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csrRoamOffloadScan(pMac, + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_ROAM_BMISS_FINAL_BCNT_CHANGED); } #endif } else if (eCSR_NEIGHBOR_ROAM_STATE_INIT - == pMac->roam.neighborRoamInfo.neighborRoamState) + == pNeighborRoamInfo->neighborRoamState) { NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Currently in INIT state, safe to set roam rescan rssi diff")); - pMac->roam.neighborRoamInfo.cfgParams.nRoamBmissFinalBcnt = - nRoamBmissFinalBcnt; - pMac->roam.neighborRoamInfo.currentRoamBmissFinalBcnt = + pNeighborRoamInfo->cfgParams.nRoamBmissFinalBcnt = nRoamBmissFinalBcnt; + pNeighborRoamInfo->currentRoamBmissFinalBcnt = nRoamBmissFinalBcnt; } else { NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Unexpected state %d returning failure"), - pMac->roam.neighborRoamInfo.neighborRoamState); + pNeighborRoamInfo->neighborRoamState); vosStatus = VOS_STATUS_E_FAILURE; } return vosStatus; @@ -725,41 +824,43 @@ csrNeighborRoamSetRoamBmissFinalBcnt(tpAniSirGlobal pMac, VOS_STATUS csrNeighborRoamSetRoamBeaconRssiWeight(tpAniSirGlobal pMac, + tANI_U8 sessionId, v_U8_t nRoamBeaconRssiWeight) { VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED - == pMac->roam.neighborRoamInfo.neighborRoamState) + == pNeighborRoamInfo->neighborRoamState) { NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Currently in CONNECTED state, so deregister all and re-register for DOWN event again")); - pMac->roam.neighborRoamInfo.cfgParams.nRoamBeaconRssiWeight = - nRoamBeaconRssiWeight; - pMac->roam.neighborRoamInfo.currentRoamBeaconRssiWeight = + pNeighborRoamInfo->cfgParams.nRoamBeaconRssiWeight = nRoamBeaconRssiWeight; + pNeighborRoamInfo->currentRoamBeaconRssiWeight = nRoamBeaconRssiWeight; /* De-register existing lookup UP/DOWN, Rssi indications */ #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csrRoamOffloadScan(pMac, + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_ROAM_BEACON_RSSI_WEIGHT_CHANGED); } #endif } else if (eCSR_NEIGHBOR_ROAM_STATE_INIT - == pMac->roam.neighborRoamInfo.neighborRoamState) + == pNeighborRoamInfo->neighborRoamState) { NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Currently in INIT state, safe to set roam rescan rssi diff")); - pMac->roam.neighborRoamInfo.cfgParams.nRoamBeaconRssiWeight = + pNeighborRoamInfo->cfgParams.nRoamBeaconRssiWeight = nRoamBeaconRssiWeight; - pMac->roam.neighborRoamInfo.currentRoamBeaconRssiWeight = + pNeighborRoamInfo->currentRoamBeaconRssiWeight = nRoamBeaconRssiWeight; } else @@ -767,7 +868,7 @@ csrNeighborRoamSetRoamBeaconRssiWeight(tpAniSirGlobal pMac, NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Unexpected state %d returning failure"), - pMac->roam.neighborRoamInfo.neighborRoamState); + pNeighborRoamInfo->neighborRoamState); vosStatus = VOS_STATUS_E_FAILURE; } return vosStatus; @@ -792,20 +893,26 @@ VOS_STATUS csrNeighborRoamReassocIndCallback(v_PVOID_t pAdapter, v_PVOID_t pUserCtxt, v_S7_t avgRssi) { - tpAniSirGlobal pMac = PMAC_STRUCT( pUserCtxt ); - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tFTRoamCallbackUsrCtx *pUsrCtx = (tFTRoamCallbackUsrCtx *)pUserCtxt; + tANI_U8 sessionId = pUsrCtx->sessionId; + tpAniSirGlobal pMac = pUsrCtx->pMac; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; if (eSME_ROAM_TRIGGER_FAST_ROAM != pNeighborRoamInfo->cfgRoamEn) { - NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Deregistering DOWN event reassoc callback with TL. Threshold RSSI = %d Reported RSSI = %d"), - pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1), - avgRssi); + NEIGHBOR_ROAM_DEBUG(pMac, LOG2, + FL("Deregistering DOWN event reassoc callback with TL. " + "Threshold RSSI = %d Reported RSSI = %d"), + pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1), + avgRssi); - vosStatus = WLANTL_DeregRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1), - WLANTL_HO_THRESHOLD_DOWN, - csrNeighborRoamReassocIndCallback, - VOS_MODULE_ID_SME); + vosStatus = WLANTL_DeregRSSIIndicationCB(pMac->roam.gVosContext, + (v_S7_t)pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1), + WLANTL_HO_THRESHOLD_DOWN, + csrNeighborRoamReassocIndCallback, + VOS_MODULE_ID_SME); if(!VOS_IS_STATUS_SUCCESS(vosStatus)) { @@ -831,7 +938,8 @@ VOS_STATUS csrNeighborRoamReassocIndCallback(v_PVOID_t pAdapter, vos_timer_stop(&pNeighborRoamInfo->neighborResultsRefreshTimer); vos_timer_stop(&pNeighborRoamInfo->emptyScanRefreshTimer); - csrNeighborRoamTriggerHandoff(pMac, pNeighborRoamInfo); + csrNeighborRoamTriggerHandoff(pMac, sessionId); + vos_mem_free(pUsrCtx); return VOS_STATUS_SUCCESS; } @@ -858,60 +966,66 @@ static void csrNeighborRoamResetChannelInfo(tpCsrNeighborRoamChannelInfo rChInfo } } -static void csrNeighborRoamResetCfgListChanScanControlInfo(tpAniSirGlobal pMac) +static void csrNeighborRoamResetCfgListChanScanControlInfo(tpAniSirGlobal pMac, + tANI_U8 sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; - /* Stop neighbor scan timer */ - vos_timer_stop(&pNeighborRoamInfo->neighborScanTimer); + /* Stop neighbor scan timer */ + vos_timer_stop(&pNeighborRoamInfo->neighborScanTimer); - /* Stop neighbor scan results refresh timer */ - vos_timer_stop(&pNeighborRoamInfo->neighborResultsRefreshTimer); + /* Stop neighbor scan results refresh timer */ + vos_timer_stop(&pNeighborRoamInfo->neighborResultsRefreshTimer); - /* Stop empty scan results refresh timer */ - vos_timer_stop(&pNeighborRoamInfo->emptyScanRefreshTimer); + /* Stop empty scan results refresh timer */ + vos_timer_stop(&pNeighborRoamInfo->emptyScanRefreshTimer); - /* Abort any ongoing scan */ - if (eANI_BOOLEAN_TRUE == pNeighborRoamInfo->scanRspPending) - { - csrScanAbortMacScan(pMac, pNeighborRoamInfo->csrSessionId, - eCSR_SCAN_ABORT_DEFAULT); - } - pNeighborRoamInfo->scanRspPending = eANI_BOOLEAN_FALSE; + /* Abort any ongoing scan */ + if (eANI_BOOLEAN_TRUE == pNeighborRoamInfo->scanRspPending) + { + csrScanAbortMacScan(pMac, sessionId, eCSR_SCAN_ABORT_DEFAULT); + } + pNeighborRoamInfo->scanRspPending = eANI_BOOLEAN_FALSE; - /* Reset roam channel list information */ - csrNeighborRoamResetChannelInfo(&pNeighborRoamInfo->roamChannelInfo); + /* Reset roam channel list information */ + csrNeighborRoamResetChannelInfo(&pNeighborRoamInfo->roamChannelInfo); } -static void csrNeighborRoamResetPreauthControlInfo(tpAniSirGlobal pMac) +static void csrNeighborRoamResetPreauthControlInfo(tpAniSirGlobal pMac, + tANI_U8 sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) - pNeighborRoamInfo->is11rAssoc = eANI_BOOLEAN_FALSE; - /* Purge pre-auth fail list */ - csrNeighborRoamPurgePreauthFailedList(pMac); + pNeighborRoamInfo->is11rAssoc = eANI_BOOLEAN_FALSE; + /* Purge pre-auth fail list */ + csrNeighborRoamPurgePreauthFailedList(pMac); #endif - pNeighborRoamInfo->FTRoamInfo.preauthRspPending = eANI_BOOLEAN_FALSE; - pNeighborRoamInfo->FTRoamInfo.numPreAuthRetries = 0; + pNeighborRoamInfo->FTRoamInfo.preauthRspPending = eANI_BOOLEAN_FALSE; + pNeighborRoamInfo->FTRoamInfo.numPreAuthRetries = 0; #ifdef WLAN_FEATURE_VOWIFI_11R - /* Do not free up the preauth done list here */ - pNeighborRoamInfo->FTRoamInfo.currentNeighborRptRetryNum = 0; - pNeighborRoamInfo->FTRoamInfo.neighborRptPending = eANI_BOOLEAN_FALSE; - pNeighborRoamInfo->FTRoamInfo.numBssFromNeighborReport = 0; - vos_mem_zero(pNeighborRoamInfo->FTRoamInfo.neighboReportBssInfo, sizeof(tCsrNeighborReportBssInfo) * MAX_BSS_IN_NEIGHBOR_RPT); + /* Do not free up the preauth done list here */ + pNeighborRoamInfo->FTRoamInfo.currentNeighborRptRetryNum = 0; + pNeighborRoamInfo->FTRoamInfo.neighborRptPending = eANI_BOOLEAN_FALSE; + pNeighborRoamInfo->FTRoamInfo.numBssFromNeighborReport = 0; + vos_mem_zero(pNeighborRoamInfo->FTRoamInfo.neighboReportBssInfo, + sizeof(tCsrNeighborReportBssInfo) * MAX_BSS_IN_NEIGHBOR_RPT); #endif #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD pNeighborRoamInfo->uOsRequestedHandoff = 0; - vos_mem_zero(&pNeighborRoamInfo->handoffReqInfo, sizeof(tCsrHandoffRequest)); + vos_mem_zero(&pNeighborRoamInfo->handoffReqInfo, + sizeof(tCsrHandoffRequest)); #endif - } -static void csrNeighborRoamDeregAllRssiIndication(tpAniSirGlobal pMac) +static void csrNeighborRoamDeregAllRssiIndication(tpAniSirGlobal pMac, + tANI_U8 sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; NEIGHBOR_ROAM_DEBUG(pMac, LOG2, @@ -934,7 +1048,7 @@ static void csrNeighborRoamDeregAllRssiIndication(tpAniSirGlobal pMac) NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Deregistering reassoc DOWN callback with TL. RSSI = %d"), - pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1)); + pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1)); /* Deregister reassoc callback. Ignore return status */ vosStatus = WLANTL_DeregRSSIIndicationCB(pMac->roam.gVosContext, @@ -997,13 +1111,16 @@ static void csrNeighborRoamDeregAllRssiIndication(tpAniSirGlobal pMac) any state other than INIT state \param pMac - The handle returned by macOpen. + \param sessionId - session id \return VOID ---------------------------------------------------------------------------*/ -void csrNeighborRoamResetConnectedStateControlInfo(tpAniSirGlobal pMac) +void csrNeighborRoamResetConnectedStateControlInfo(tpAniSirGlobal pMac, + tANI_U8 sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; csrNeighborRoamResetChannelInfo(&pNeighborRoamInfo->roamChannelInfo); csrNeighborRoamFreeRoamableBSSList(pMac, &pNeighborRoamInfo->roamableAPList); @@ -1019,18 +1136,22 @@ void csrNeighborRoamResetConnectedStateControlInfo(tpAniSirGlobal pMac) pNeighborRoamInfo->FTRoamInfo.numPreAuthRetries = 0; pNeighborRoamInfo->FTRoamInfo.numBssFromNeighborReport = 0; pNeighborRoamInfo->FTRoamInfo.preauthRspPending = 0; - vos_mem_zero(pNeighborRoamInfo->FTRoamInfo.neighboReportBssInfo, sizeof(tCsrNeighborReportBssInfo) * MAX_BSS_IN_NEIGHBOR_RPT); + vos_mem_zero(pNeighborRoamInfo->FTRoamInfo.neighboReportBssInfo, + sizeof(tCsrNeighborReportBssInfo) * MAX_BSS_IN_NEIGHBOR_RPT); #endif #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD pNeighborRoamInfo->uOsRequestedHandoff = 0; - vos_mem_zero(&pNeighborRoamInfo->handoffReqInfo, sizeof(tCsrHandoffRequest)); + vos_mem_zero(&pNeighborRoamInfo->handoffReqInfo, + sizeof(tCsrHandoffRequest)); #endif } -void csrNeighborRoamResetReportScanStateControlInfo(tpAniSirGlobal pMac) +void csrNeighborRoamResetReportScanStateControlInfo(tpAniSirGlobal pMac, + tANI_U8 sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; - pNeighborRoamInfo->csrSessionId = CSR_SESSION_ID_INVALID; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; + vos_mem_set(pNeighborRoamInfo->currAPbssid, sizeof(tCsrBssid), 0); pNeighborRoamInfo->neighborScanTimerInfo.pMac = pMac; pNeighborRoamInfo->neighborScanTimerInfo.sessionId = CSR_SESSION_ID_INVALID; @@ -1044,8 +1165,8 @@ void csrNeighborRoamResetReportScanStateControlInfo(tpAniSirGlobal pMac) vos_timer_stop(&pNeighborRoamInfo->neighborResultsRefreshTimer); /* Stop empty scan results refresh timer */ vos_timer_stop(&pNeighborRoamInfo->emptyScanRefreshTimer); - /* Purge roamable AP list */ - csrNeighborRoamFreeRoamableBSSList(pMac, &pNeighborRoamInfo->roamableAPList); + /* Purge roamable AP list */ + csrNeighborRoamFreeRoamableBSSList(pMac, &pNeighborRoamInfo->roamableAPList); return; } @@ -1058,20 +1179,22 @@ void csrNeighborRoamResetReportScanStateControlInfo(tpAniSirGlobal pMac) INIT state \param pMac - The handle returned by macOpen. + \param sessionId - Session Id \return VOID ---------------------------------------------------------------------------*/ -void csrNeighborRoamResetInitStateControlInfo(tpAniSirGlobal pMac) +void csrNeighborRoamResetInitStateControlInfo(tpAniSirGlobal pMac, + tANI_U8 sessionId) { - csrNeighborRoamResetConnectedStateControlInfo(pMac); + csrNeighborRoamResetConnectedStateControlInfo(pMac, sessionId); - /* In addition to the above resets, we should clear off the curAPBssId/Session ID in the timers */ - csrNeighborRoamResetReportScanStateControlInfo(pMac); + /* In addition to the above resets, + we should clear off the curAPBssId/Session ID in the timers */ + csrNeighborRoamResetReportScanStateControlInfo(pMac, sessionId); } - #ifdef WLAN_FEATURE_VOWIFI_11R /* --------------------------------------------------------------------------- @@ -1090,9 +1213,12 @@ void csrNeighborRoamResetInitStateControlInfo(tpAniSirGlobal pMac) code otherwise ---------------------------------------------------------------------------*/ -static eHalStatus csrNeighborRoamBssIdScanFilter(tpAniSirGlobal pMac, tCsrScanResultFilter *pScanFilter) +static eHalStatus csrNeighborRoamBssIdScanFilter(tpAniSirGlobal pMac, + tANI_U8 sessionId, + tCsrScanResultFilter *pScanFilter) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; tANI_U8 i = 0; VOS_ASSERT(pScanFilter != NULL); @@ -1111,14 +1237,14 @@ static eHalStatus csrNeighborRoamBssIdScanFilter(tpAniSirGlobal pMac, tCsrScanRe vos_mem_zero(pScanFilter->BSSIDs.bssid, sizeof(tSirMacAddr) * pScanFilter->BSSIDs.numOfBSSIDs); /* Populate the BSSID from Neighbor BSS info received from neighbor report */ - for (i = 0; i < pScanFilter->BSSIDs.numOfBSSIDs; i++) - { + for (i = 0; i < pScanFilter->BSSIDs.numOfBSSIDs; i++) { vos_mem_copy(&pScanFilter->BSSIDs.bssid[i], - pNeighborRoamInfo->FTRoamInfo.neighboReportBssInfo[i].neighborBssId, sizeof(tSirMacAddr)); + pNeighborRoamInfo->FTRoamInfo.neighboReportBssInfo[i].neighborBssId, + sizeof(tSirMacAddr)); } /* Fill other general scan filter params */ - return csrNeighborRoamPrepareScanProfileFilter(pMac, pScanFilter); + return csrNeighborRoamPrepareScanProfileFilter(pMac, pScanFilter, sessionId); } /* --------------------------------------------------------------------------- @@ -1134,14 +1260,17 @@ static eHalStatus csrNeighborRoamBssIdScanFilter(tpAniSirGlobal pMac, tCsrScanRe ---------------------------------------------------------------------------*/ void csrNeighborRoamPurgePreauthFailList(tpAniSirGlobal pMac) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tANI_U8 i; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = NULL; NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Purging the preauth fail list")); - while (pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress) - { - vos_mem_zero(pNeighborRoamInfo->FTRoamInfo.preAuthFailList.macAddress[pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress-1], - sizeof(tSirMacAddr)); - pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress--; + for (i = 0; i < CSR_ROAM_SESSION_MAX; i++) { + pNeighborRoamInfo = &pMac->roam.neighborRoamInfo[i]; + while (pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress) { + vos_mem_zero(pNeighborRoamInfo->FTRoamInfo.preAuthFailList.macAddress[pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress-1], + sizeof(tSirMacAddr)); + pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress--; + } } return; } @@ -1158,13 +1287,15 @@ void csrNeighborRoamPurgePreauthFailList(tpAniSirGlobal pMac) \return eHAL_STATUS_SUCCESS on success, eHAL_STATUS_FAILURE otherwise ---------------------------------------------------------------------------*/ -eHalStatus csrNeighborRoamAddBssIdToPreauthFailList(tpAniSirGlobal pMac, tSirMacAddr bssId) +eHalStatus csrNeighborRoamAddBssIdToPreauthFailList(tpAniSirGlobal pMac, + tANI_U8 sessionId, + tSirMacAddr bssId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; - - NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL(" Added BSSID "MAC_ADDRESS_STR" to Preauth failed list"), - MAC_ADDR_ARRAY(bssId)); + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; + NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL(" Added BSSID "MAC_ADDRESS_STR + " to Preauth failed list"), MAC_ADDR_ARRAY(bssId)); if ((pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress + 1) > MAX_NUM_PREAUTH_FAIL_LIST_ADDRESS) @@ -1193,10 +1324,13 @@ eHalStatus csrNeighborRoamAddBssIdToPreauthFailList(tpAniSirGlobal pMac, tSirMac \return eANI_BOOLEAN_TRUE if preauth candidate, eANI_BOOLEAN_FALSE otherwise ---------------------------------------------------------------------------*/ -tANI_BOOLEAN csrNeighborRoamIsPreauthCandidate(tpAniSirGlobal pMac, tSirMacAddr bssId) +tANI_BOOLEAN csrNeighborRoamIsPreauthCandidate(tpAniSirGlobal pMac, + tANI_U8 sessionId, + tSirMacAddr bssId) { tANI_U8 i = 0; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (csrRoamIsRoamOffloadScanEnabled(pMac)) @@ -1210,7 +1344,7 @@ tANI_BOOLEAN csrNeighborRoamIsPreauthCandidate(tpAniSirGlobal pMac, tSirMacAddr for (i = 0; i < pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress; i++) { if (VOS_TRUE == vos_mem_compare(pNeighborRoamInfo->FTRoamInfo.preAuthFailList.macAddress[i], - bssId, sizeof(tSirMacAddr))) + bssId, sizeof(tSirMacAddr))) { NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("BSSID "MAC_ADDRESS_STR" already present in preauth fail list"), MAC_ADDR_ARRAY(bssId)); @@ -1233,9 +1367,11 @@ tANI_BOOLEAN csrNeighborRoamIsPreauthCandidate(tpAniSirGlobal pMac, tSirMacAddr \return eHAL_STATUS_SUCCESS on success, eHAL_STATUS_FAILURE otherwise ---------------------------------------------------------------------------*/ -static eHalStatus csrNeighborRoamIssuePreauthReq(tpAniSirGlobal pMac) +static eHalStatus csrNeighborRoamIssuePreauthReq(tpAniSirGlobal pMac, + tANI_U8 sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; eHalStatus status = eHAL_STATUS_SUCCESS; tpCsrNeighborRoamBSSInfo pNeighborBssNode; @@ -1276,14 +1412,15 @@ static eHalStatus csrNeighborRoamIssuePreauthReq(tpAniSirGlobal pMac) vos_mem_copy((void *)roamInfo->bssid, (void *)pNeighborBssNode->pBssDescription->bssId, sizeof(tCsrBssid)); - csrRoamCallCallback(pMac, pNeighborRoamInfo->csrSessionId, - roamInfo, 0, eCSR_ROAM_PREAUTH_INIT_NOTIFY, 0); + csrRoamCallCallback(pMac, sessionId, roamInfo, 0, + eCSR_ROAM_PREAUTH_INIT_NOTIFY, 0); vos_mem_free(pRoamInfo); } #endif - status = csrRoamEnqueuePreauth(pMac, pNeighborRoamInfo->csrSessionId, pNeighborBssNode->pBssDescription, - eCsrPerformPreauth, eANI_BOOLEAN_TRUE); + status = csrRoamEnqueuePreauth(pMac, sessionId, + pNeighborBssNode->pBssDescription, + eCsrPerformPreauth, eANI_BOOLEAN_TRUE); smsLog(pMac, LOG1, FL("Before Pre-Auth: BSSID "MAC_ADDRESS_STR", Ch:%d"), MAC_ADDR_ARRAY(pNeighborBssNode->pBssDescription->bssId), @@ -1302,7 +1439,9 @@ static eHalStatus csrNeighborRoamIssuePreauthReq(tpAniSirGlobal pMac) pNeighborRoamInfo->FTRoamInfo.numPreAuthRetries++; /* Transition the state to preauthenticating */ - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING) + CSR_NEIGHBOR_ROAM_STATE_TRANSITION( + eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING, + sessionId) return status; } @@ -1326,13 +1465,17 @@ static eHalStatus csrNeighborRoamIssuePreauthReq(tpAniSirGlobal pMac) eHAL_STATUS_FAILURE otherwise ---------------------------------------------------------------------------*/ -eHalStatus csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, tSirRetStatus limStatus) +eHalStatus csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, + tANI_U8 sessionId, + tSirRetStatus limStatus) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; eHalStatus status = eHAL_STATUS_SUCCESS; VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; eHalStatus preauthProcessed = eHAL_STATUS_SUCCESS; tpCsrNeighborRoamBSSInfo pPreauthRspNode = NULL; + tpFTRoamCallbackUsrCtx pUsrCtx; #ifdef FEATURE_WLAN_LFR_METRICS tCsrRoamInfo *roamInfo; @@ -1369,7 +1512,9 @@ eHalStatus csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, tSirRetStatus l if (eSIR_SUCCESS == limStatus) { - pPreauthRspNode = csrNeighborRoamGetRoamableAPListNextEntry(pMac, &pNeighborRoamInfo->roamableAPList, NULL); + pPreauthRspNode = csrNeighborRoamGetRoamableAPListNextEntry(pMac, + &pNeighborRoamInfo->roamableAPList, + NULL); } if ((eSIR_SUCCESS == limStatus) && (NULL != pPreauthRspNode)) { @@ -1392,8 +1537,8 @@ eHalStatus csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, tSirRetStatus l vos_mem_copy((void *)roamInfo->bssid, (void *)pPreauthRspNode->pBssDescription->bssId, sizeof(tCsrBssid)); - csrRoamCallCallback(pMac, pNeighborRoamInfo->csrSessionId, - roamInfo, 0, eCSR_ROAM_PREAUTH_STATUS_SUCCESS, 0); + csrRoamCallCallback(pMac, sessionId, roamInfo, 0, + eCSR_ROAM_PREAUTH_STATUS_SUCCESS, 0); vos_mem_free(pRoamInfo); } #endif @@ -1403,7 +1548,9 @@ eHalStatus csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, tSirRetStatus l csrLLInsertTail(&pNeighborRoamInfo->FTRoamInfo.preAuthDoneList, &pPreauthRspNode->List, LL_ACCESS_LOCK); /* Pre-auth completed successfully. Transition to PREAUTH Done state */ - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE) + CSR_NEIGHBOR_ROAM_STATE_TRANSITION( + eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE, + sessionId) pNeighborRoamInfo->FTRoamInfo.numPreAuthRetries = 0; /* The caller of this function would start a timer and by the time it expires, supplicant should @@ -1435,7 +1582,9 @@ eHalStatus csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, tSirRetStatus l if(!pNeighborRoamInfo->uOsRequestedHandoff) #endif { - status = csrNeighborRoamAddBssIdToPreauthFailList(pMac, pNeighborBssNode->pBssDescription->bssId); + status = csrNeighborRoamAddBssIdToPreauthFailList(pMac, + sessionId, + pNeighborBssNode->pBssDescription->bssId); } #ifdef FEATURE_WLAN_LFR_METRICS @@ -1451,8 +1600,8 @@ eHalStatus csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, tSirRetStatus l vos_mem_copy((void *)roamInfo->bssid, (void *)pNeighborBssNode->pBssDescription->bssId, sizeof(tCsrBssid)); - csrRoamCallCallback(pMac, pNeighborRoamInfo->csrSessionId, - roamInfo, 0, eCSR_ROAM_PREAUTH_STATUS_FAILURE, 0); + csrRoamCallCallback(pMac, sessionId, roamInfo, 0, + eCSR_ROAM_PREAUTH_STATUS_FAILURE, 0); vos_mem_free(pRoamInfo); } #endif @@ -1463,7 +1612,8 @@ eHalStatus csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, tSirRetStatus l } /* Issue preauth request for the same/next entry */ - if (eHAL_STATUS_SUCCESS == csrNeighborRoamIssuePreauthReq(pMac)) + if (eHAL_STATUS_SUCCESS == csrNeighborRoamIssuePreauthReq(pMac, + sessionId)) goto DEQ_PREAUTH; #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD @@ -1472,31 +1622,48 @@ eHalStatus csrNeighborRoamPreauthRspHandler(tpAniSirGlobal pMac, tSirRetStatus l if(pNeighborRoamInfo->uOsRequestedHandoff) { pNeighborRoamInfo->uOsRequestedHandoff = 0; - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_PREAUTH_FAILED_FOR_ALL); + csrRoamOffloadScan(pMac, 0, ROAM_SCAN_OFFLOAD_START, + REASON_PREAUTH_FAILED_FOR_ALL); } else { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_RESTART, REASON_PREAUTH_FAILED_FOR_ALL); + csrRoamOffloadScan(pMac, 0, ROAM_SCAN_OFFLOAD_RESTART, + REASON_PREAUTH_FAILED_FOR_ALL); } - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED); + CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED, + sessionId); } else { #endif - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN); + CSR_NEIGHBOR_ROAM_STATE_TRANSITION( + eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN, + sessionId); - /* Register Neighbor Lookup threshold callback with TL for UP event now */ + /* Register Neighbor Lookup threshold callback with TL + for UP event now */ NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("No more pre-auth candidates-" - "register UP indication with TL. RSSI = %d,"), NEIGHBOR_ROAM_LOOKUP_UP_THRESHOLD * (-1)); + "register UP indication with TL. RSSI = %d,"), + NEIGHBOR_ROAM_LOOKUP_UP_THRESHOLD * (-1)); + pUsrCtx = vos_mem_malloc(sizeof(*pUsrCtx)); + if (NULL == pUsrCtx) { + smsLog(pMac, LOGE, FL("Memory allocation failed for pUsrCtx")); + return eHAL_STATUS_FAILED_ALLOC; + } + + pUsrCtx->pMac = pMac; + pUsrCtx->sessionId = sessionId; vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)NEIGHBOR_ROAM_LOOKUP_UP_THRESHOLD * (-1), WLANTL_HO_THRESHOLD_UP, csrNeighborRoamNeighborLookupUPCallback, - VOS_MODULE_ID_SME, pMac); + VOS_MODULE_ID_SME, pUsrCtx); if(!VOS_IS_STATUS_SUCCESS(vosStatus)) { //err msg smsLog(pMac, LOGE, FL(" Couldn't register csrNeighborRoamNeighborLookupCallback UP event with TL: Status = %d"), status); + + vos_mem_free(pUsrCtx); } /* Start the neighbor results refresh timer and transition to REPORT_SCAN state to perform scan again */ @@ -1604,10 +1771,13 @@ eHalStatus csrNeighborRoamOffloadSynchRspHandler( \return eHAL_STATUS_SUCCESS on success, eHAL_STATUS_FAILURE otherwise ---------------------------------------------------------------------------*/ -eHalStatus csrNeighborRoamPrepareScanProfileFilter(tpAniSirGlobal pMac, tCsrScanResultFilter *pScanFilter) +eHalStatus +csrNeighborRoamPrepareScanProfileFilter(tpAniSirGlobal pMac, + tCsrScanResultFilter *pScanFilter, + tANI_U8 sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; - tANI_U8 sessionId = (tANI_U8)pNeighborRoamInfo->csrSessionId; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; tCsrRoamConnectedProfile *pCurProfile = &pMac->roam.roamSession[sessionId].connectedProfile; tANI_U8 i = 0; @@ -1698,39 +1868,41 @@ eHalStatus csrNeighborRoamPrepareScanProfileFilter(tpAniSirGlobal pMac, tCsrScan return eHAL_STATUS_SUCCESS; } -tANI_U32 csrGetCurrentAPRssi(tpAniSirGlobal pMac, tScanResultHandle *pScanResultList) +tANI_U32 csrGetCurrentAPRssi(tpAniSirGlobal pMac, + tScanResultHandle *pScanResultList, + tANI_U8 sessionId) { - tCsrScanResultInfo *pScanResult; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tCsrScanResultInfo *pScanResult; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; #ifdef FEATURE_WLAN_LFR - tANI_U32 CurrAPRssi = pNeighborRoamInfo->lookupDOWNRssi; + tANI_U32 CurrAPRssi = pNeighborRoamInfo->lookupDOWNRssi; #else /* We are setting this as default value to make sure we return this value, when we do not see this AP in the scan result for some reason.However,it is less likely that we are associated to an AP and do not see it in the scan list */ - tANI_U32 CurrAPRssi = -125; + tANI_U32 CurrAPRssi = -125; #endif - while (NULL != (pScanResult = csrScanResultGetNext(pMac, *pScanResultList))) - { - - if (VOS_TRUE == vos_mem_compare(pScanResult->BssDescriptor.bssId, + while (NULL != (pScanResult = csrScanResultGetNext(pMac, *pScanResultList))) + { + if (VOS_TRUE == vos_mem_compare(pScanResult->BssDescriptor.bssId, pNeighborRoamInfo->currAPbssid, sizeof(tSirMacAddr))) - { - /* We got a match with the currently associated AP. - * Capture the RSSI value and complete the while loop. + { + /* We got a match with the currently associated AP. + * Capture the RSSI value and complete the while loop. * The while loop is completed in order to make the current entry go back to NULL, * and in the next while loop, it properly starts searching from the head of the list. * TODO: Can also try setting the current entry directly to NULL as soon as we find the new AP*/ - CurrAPRssi = (int)pScanResult->BssDescriptor.rssi * (-1) ; + CurrAPRssi = (int)pScanResult->BssDescriptor.rssi * (-1); - } else { - continue; - } - } + } else { + continue; + } + } - return CurrAPRssi; + return CurrAPRssi; } @@ -1749,11 +1921,14 @@ tANI_U32 csrGetCurrentAPRssi(tpAniSirGlobal pMac, tScanResultHandle *pScanResult ---------------------------------------------------------------------------*/ -static tANI_BOOLEAN csrNeighborRoamProcessScanResults(tpAniSirGlobal pMac, - tScanResultHandle *pScanResultList) +static tANI_BOOLEAN +csrNeighborRoamProcessScanResults(tpAniSirGlobal pMac, + tANI_U8 sessionId, + tScanResultHandle *pScanResultList) { tCsrScanResultInfo *pScanResult; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; tpCsrNeighborRoamBSSInfo pBssInfo; tANI_U32 CurrAPRssi; tANI_U8 RoamRssiDiff = pMac->roam.configParam.RoamRssiDiff; @@ -1768,7 +1943,7 @@ static tANI_BOOLEAN csrNeighborRoamProcessScanResults(tpAniSirGlobal pMac, * going to roam.If so, we are going to continue with the * current AP. ***************************************************************/ - CurrAPRssi = csrGetCurrentAPRssi(pMac, pScanResultList); + CurrAPRssi = csrGetCurrentAPRssi(pMac, pScanResultList, sessionId); /* Expecting the scan result already to be in the sorted order based on the RSSI */ /* Based on the previous state we need to check whether the list should be sorted again taking neighbor score into consideration */ @@ -1779,7 +1954,7 @@ static tANI_BOOLEAN csrNeighborRoamProcessScanResults(tpAniSirGlobal pMac, while (NULL != (pScanResult = csrScanResultGetNext(pMac, *pScanResultList))) { - VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, + VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, FL("Scan result: BSSID "MAC_ADDRESS_STR" (Rssi %ld, Ch:%d)"), MAC_ADDR_ARRAY(pScanResult->BssDescriptor.bssId), abs(pScanResult->BssDescriptor.rssi), @@ -1827,54 +2002,52 @@ static tANI_BOOLEAN csrNeighborRoamProcessScanResults(tpAniSirGlobal pMac, /* * If RSSI is lower than the lookup threshold, then continue. */ - if (abs(pScanResult->BssDescriptor.rssi) > - pNeighborRoamInfo->currentNeighborLookupThreshold) - { - VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - "%s: [INFOLOG] new ap rssi (%d) lower than lookup threshold (%d)", - __func__, (int)pScanResult->BssDescriptor.rssi * (-1), - (int)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1)); - continue; - } + if (abs(pScanResult->BssDescriptor.rssi) > + pNeighborRoamInfo->currentNeighborLookupThreshold) { + VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, + FL("new ap rssi (%d) lower than lookup threshold (%d)"), + (int)pScanResult->BssDescriptor.rssi * (-1), + (int)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1)); + continue; + } - if (abs(CurrAPRssi) < abs(pScanResult->BssDescriptor.rssi)) - { - /*Do not roam to an AP with worse RSSI than the current*/ + if (abs(CurrAPRssi) < abs(pScanResult->BssDescriptor.rssi)) + { + /* Do not roam to an AP with worse RSSI than the current */ VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: [INFOLOG]Current AP rssi=%d new ap rssi worse=%d", __func__, - CurrAPRssi, - (int)pScanResult->BssDescriptor.rssi * (-1) ); - continue; - } else { + CurrAPRssi, + (int)pScanResult->BssDescriptor.rssi * (-1) ); + continue; + } else { /*Do not roam to an AP which is having better RSSI than the current AP, but still less than the * margin that is provided by user from the ini file (RoamRssiDiff)*/ - if (abs(abs(CurrAPRssi) - abs(pScanResult->BssDescriptor.rssi)) < RoamRssiDiff) - { + if (abs(abs(CurrAPRssi) - abs(pScanResult->BssDescriptor.rssi)) < RoamRssiDiff) + { VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: [INFOLOG]Current AP rssi=%d new ap rssi=%d not good enough, roamRssiDiff=%d", __func__, CurrAPRssi, - (int)pScanResult->BssDescriptor.rssi * (-1), - RoamRssiDiff); - continue; + (int)pScanResult->BssDescriptor.rssi * (-1), + RoamRssiDiff); + continue; } else { VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: [INFOLOG]Current AP rssi=%d new ap rssi better=%d", __func__, - CurrAPRssi, - (int)pScanResult->BssDescriptor.rssi * (-1) ); - } + CurrAPRssi, + (int)pScanResult->BssDescriptor.rssi * (-1) ); } + } } #ifdef WLAN_FEATURE_VOWIFI_11R - if (pNeighborRoamInfo->is11rAssoc) - { - if (!csrNeighborRoamIsPreauthCandidate(pMac, pScanResult->BssDescriptor.bssId)) - { + if (pNeighborRoamInfo->is11rAssoc) { + if (!csrNeighborRoamIsPreauthCandidate(pMac, sessionId, + pScanResult->BssDescriptor.bssId)) { smsLog(pMac, LOGE, FL("BSSID present in pre-auth fail list.. Ignoring")); - continue; - } - } + continue; + } + } #endif /* WLAN_FEATURE_VOWIFI_11R */ #ifdef FEATURE_WLAN_ESE @@ -1884,8 +2057,8 @@ static tANI_BOOLEAN csrNeighborRoamProcessScanResults(tpAniSirGlobal pMac, #endif if (pNeighborRoamInfo->isESEAssoc) { - if (!csrNeighborRoamIsPreauthCandidate(pMac, pScanResult->BssDescriptor.bssId)) - { + if (!csrNeighborRoamIsPreauthCandidate(pMac, sessionId, + pScanResult->BssDescriptor.bssId)) { smsLog(pMac, LOGE, FL("BSSID present in pre-auth fail list.. Ignoring")); continue; } @@ -1925,10 +2098,9 @@ static tANI_BOOLEAN csrNeighborRoamProcessScanResults(tpAniSirGlobal pMac, #ifdef FEATURE_WLAN_LFR // If we are supporting legacy roaming, and // if the candidate is on the "pre-auth failed" list, ignore it. - if (csrRoamIsFastRoamEnabled(pMac, CSR_SESSION_ID_INVALID)) - { - if (!csrNeighborRoamIsPreauthCandidate(pMac, pScanResult->BssDescriptor.bssId)) - { + if (csrRoamIsFastRoamEnabled(pMac, sessionId)) { + if (!csrNeighborRoamIsPreauthCandidate(pMac, sessionId, + pScanResult->BssDescriptor.bssId)) { smsLog(pMac, LOGE, FL("BSSID present in pre-auth fail list.. Ignoring")); continue; } @@ -2061,11 +2233,15 @@ static tANI_BOOLEAN csrNeighborRoamProcessScanResults(tpAniSirGlobal pMac, \return VOS_STATUS_SUCCESS on success, corresponding error code otherwise ---------------------------------------------------------------------------*/ -static VOS_STATUS csrNeighborRoamHandleEmptyScanResult(tpAniSirGlobal pMac) +static VOS_STATUS csrNeighborRoamHandleEmptyScanResult(tpAniSirGlobal pMac, + tANI_U8 sessionId) { VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; eHalStatus status = eHAL_STATUS_SUCCESS; + tpFTRoamCallbackUsrCtx pUsrCtx; + #ifdef FEATURE_WLAN_LFR tANI_BOOLEAN performPeriodicScan = (pNeighborRoamInfo->cfgParams.emptyScanRefreshPeriod) ? TRUE : FALSE; @@ -2123,10 +2299,11 @@ static VOS_STATUS csrNeighborRoamHandleEmptyScanResult(tpAniSirGlobal pMac) #endif /* Transition to CONNECTED state */ - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED); + CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED, + sessionId); /* Reset all the necessary variables before transitioning to the CONNECTED state */ - csrNeighborRoamResetConnectedStateControlInfo(pMac); + csrNeighborRoamResetConnectedStateControlInfo(pMac, sessionId); #ifdef FEATURE_WLAN_LFR if (pNeighborRoamInfo->uEmptyScanCount == eFirstEmptyScan) @@ -2138,18 +2315,29 @@ static VOS_STATUS csrNeighborRoamHandleEmptyScanResult(tpAniSirGlobal pMac) FL("Registering DOWN event neighbor lookup callback with TL for RSSI = %d"), pNeighborRoamInfo->currentNeighborLookupThreshold * (-1)); + /* This user context data will be returned with callback */ + pUsrCtx = vos_mem_malloc(sizeof(*pUsrCtx)); + if (NULL == pUsrCtx) { + smsLog(pMac, LOGE, FL("Memory allocation failure")); + return VOS_STATUS_E_NOMEM; + } + pUsrCtx->pMac = pMac; + pUsrCtx->sessionId = sessionId; + vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1), WLANTL_HO_THRESHOLD_DOWN, csrNeighborRoamNeighborLookupDOWNCallback, - VOS_MODULE_ID_SME, pMac); + VOS_MODULE_ID_SME, pUsrCtx); if(!VOS_IS_STATUS_SUCCESS(vosStatus)) { smsLog(pMac, LOGW, FL("Couldn't re-register csrNeighborRoamNeighborLookupDOWNCallback" " with TL: Status = %d"), status); + vos_mem_free(pUsrCtx); } + #ifdef FEATURE_WLAN_LFR pNeighborRoamInfo->lookupDOWNRssi = 0; } @@ -2159,7 +2347,7 @@ static VOS_STATUS csrNeighborRoamHandleEmptyScanResult(tpAniSirGlobal pMac) /* Empty scan results for the second or fourth time */ /* Immediately scan on channels in non-occupied list */ - csrNeighborRoamTransitToCFGChanScan(pMac); + csrNeighborRoamTransitToCFGChanScan(pMac, sessionId); } else if (pNeighborRoamInfo->uEmptyScanCount >= eThirdEmptyScan) { @@ -2225,14 +2413,17 @@ static VOS_STATUS csrNeighborRoamHandleEmptyScanResult(tpAniSirGlobal pMac) } -static eHalStatus csrNeighborRoamProcessScanComplete (tpAniSirGlobal pMac) +static eHalStatus csrNeighborRoamProcessScanComplete (tpAniSirGlobal pMac, + tANI_U8 sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; tCsrScanResultFilter scanFilter; tScanResultHandle scanResult; tANI_U32 tempVal = 0; tANI_BOOLEAN roamNow = eANI_BOOLEAN_FALSE; eHalStatus hstatus; + tpFTRoamCallbackUsrCtx pUsrCtx; #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) /* If the state is REPORT_SCAN, then this must be the scan after the REPORT_QUERY state. So, we @@ -2243,14 +2434,15 @@ static eHalStatus csrNeighborRoamProcessScanComplete (tpAniSirGlobal pMac) #endif ) { - hstatus = csrNeighborRoamBssIdScanFilter(pMac, &scanFilter); + hstatus = csrNeighborRoamBssIdScanFilter(pMac, sessionId, &scanFilter); NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("11R or ESE Association: Prepare scan filter status with neighbor AP = %d"), hstatus); tempVal = 1; } else #endif { - hstatus = csrNeighborRoamPrepareScanProfileFilter(pMac, &scanFilter); + hstatus = csrNeighborRoamPrepareScanProfileFilter(pMac, + &scanFilter, sessionId); NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("11R/ESE/Other Association: Prepare scan to find neighbor AP filter status = %d"), hstatus); } if (eHAL_STATUS_SUCCESS != hstatus) @@ -2264,7 +2456,8 @@ static eHalStatus csrNeighborRoamProcessScanComplete (tpAniSirGlobal pMac) NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Get Scan Result status code %d"), hstatus); } /* Process the scan results and update roamable AP list */ - roamNow = csrNeighborRoamProcessScanResults(pMac, &scanResult); + roamNow = csrNeighborRoamProcessScanResults(pMac, sessionId, + &scanResult); /* Free the scan filter */ csrFreeScanFilter(pMac, &scanFilter); @@ -2294,27 +2487,33 @@ static eHalStatus csrNeighborRoamProcessScanComplete (tpAniSirGlobal pMac) if (pNeighborRoamInfo->is11rAssoc) { /* Valid APs are found after scan. Now we can initiate pre-authentication */ - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN) + CSR_NEIGHBOR_ROAM_STATE_TRANSITION( + eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN, + sessionId) } else #endif #ifdef FEATURE_WLAN_ESE /* If this is a non-11r association, then we can register the reassoc callback here as we have some - APs in the roamable AP list */ + APs in the roamable AP list */ if (pNeighborRoamInfo->isESEAssoc) { /* Valid APs are found after scan. Now we can initiate pre-authentication */ - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN) + CSR_NEIGHBOR_ROAM_STATE_TRANSITION( + eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN, + sessionId) } else #endif #ifdef FEATURE_WLAN_LFR /* If LFR is enabled, then we can register the reassoc callback here as we have some APs in the roamable AP list */ - if (csrRoamIsFastRoamEnabled(pMac, CSR_SESSION_ID_INVALID)) + if (csrRoamIsFastRoamEnabled(pMac, sessionId)) { /* Valid APs are found after scan. Now we can initiate pre-authentication */ - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN) + CSR_NEIGHBOR_ROAM_STATE_TRANSITION( + eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN, + sessionId) } else #endif @@ -2337,7 +2536,7 @@ static eHalStatus csrNeighborRoamProcessScanComplete (tpAniSirGlobal pMac) macTraceGetNeighbourRoamState( pNeighborRoamInfo->neighborRoamState)); /* Handle it appropriately */ - csrNeighborRoamHandleEmptyScanResult(pMac); + csrNeighborRoamHandleEmptyScanResult(pMac, sessionId); } break; #ifdef WLAN_FEATURE_VOWIFI_11R @@ -2350,7 +2549,7 @@ static eHalStatus csrNeighborRoamProcessScanComplete (tpAniSirGlobal pMac) macTraceGetNeighbourRoamState( pNeighborRoamInfo->neighborRoamState)); /* Stop the timer here as the same timer will be started again in CFG_CHAN_SCAN_STATE */ - csrNeighborRoamTransitToCFGChanScan(pMac); + csrNeighborRoamTransitToCFGChanScan(pMac, sessionId); } break; #endif /* WLAN_FEATURE_VOWIFI_11R */ @@ -2398,7 +2597,7 @@ static eHalStatus csrNeighborRoamProcessScanComplete (tpAniSirGlobal pMac) } #endif - csrNeighborRoamTriggerHandoff(pMac, pNeighborRoamInfo); + csrNeighborRoamTriggerHandoff(pMac, sessionId); return eHAL_STATUS_SUCCESS; } @@ -2417,18 +2616,27 @@ static eHalStatus csrNeighborRoamProcessScanComplete (tpAniSirGlobal pMac) } NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Registering DOWN event Reassoc callback with TL. RSSI = %d"), pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1)); + pUsrCtx = vos_mem_malloc(sizeof(*pUsrCtx)); + if (NULL == pUsrCtx) { + smsLog(pMac, LOGE, FL("Allocation failed for pUsrCtx")); + return eHAL_STATUS_FAILURE; + } + + pUsrCtx->pMac = pMac; + pUsrCtx->sessionId = sessionId; /* Register a reassoc Indication callback */ - vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1), + vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, + (v_S7_t)pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1), WLANTL_HO_THRESHOLD_DOWN, csrNeighborRoamReassocIndCallback, - VOS_MODULE_ID_SME, pMac); + VOS_MODULE_ID_SME, pUsrCtx); - if(!VOS_IS_STATUS_SUCCESS(vosStatus)) + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { //err msg smsLog(pMac, LOGW, FL(" Couldn't register csrNeighborRoamReassocIndCallback with TL: Status = %d"), vosStatus); + vos_mem_free(pUsrCtx); } - } #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD @@ -2438,16 +2646,19 @@ if (csrRoamIsRoamOffloadScanEnabled(pMac)) { if (pNeighborRoamInfo->uOsRequestedHandoff) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_NO_CAND_FOUND_OR_NOT_ROAMING_NOW); + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_START, + REASON_NO_CAND_FOUND_OR_NOT_ROAMING_NOW); pNeighborRoamInfo->uOsRequestedHandoff = 0; } else { /* There is no candidate or We are not roaming Now. * Inform the FW to restart Roam Offload Scan */ - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_RESTART, REASON_NO_CAND_FOUND_OR_NOT_ROAMING_NOW); + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_RESTART, + REASON_NO_CAND_FOUND_OR_NOT_ROAMING_NOW); } - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED); + CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED, + sessionId); } } #endif @@ -2475,20 +2686,19 @@ if (csrRoamIsRoamOffloadScanEnabled(pMac)) \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise ---------------------------------------------------------------------------*/ -static eHalStatus csrNeighborRoamScanRequestCallback(tHalHandle halHandle, void *pContext, +static eHalStatus csrNeighborRoamScanRequestCallback(tHalHandle halHandle, + void *pContext, tANI_U8 sessionId, tANI_U32 scanId, eCsrScanStatus status) { tpAniSirGlobal pMac = (tpAniSirGlobal) halHandle; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; tANI_U8 currentChanIndex; eHalStatus hstatus; -#ifdef FEATURE_WLAN_LFR - tANI_U32 sessionId = CSR_SESSION_ID_INVALID; if (NULL != pContext) { - sessionId = *((tANI_U32*)pContext); - +#ifdef FEATURE_WLAN_LFR if (!csrRoamIsStaMode(pMac, sessionId)) { smsLog(pMac, LOGE, @@ -2506,9 +2716,10 @@ static eHalStatus csrNeighborRoamScanRequestCallback(tHalHandle halHandle, void vos_mem_free(pContext); return eHAL_STATUS_SUCCESS; } - } #endif - pMac->roam.neighborRoamInfo.scanRspPending = eANI_BOOLEAN_FALSE; + } + + pNeighborRoamInfo->scanRspPending = eANI_BOOLEAN_FALSE; /* This can happen when we receive a UP event from TL in any of the scan states. Silently ignore it */ if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED == pNeighborRoamInfo->neighborRoamState) @@ -2519,13 +2730,17 @@ static eHalStatus csrNeighborRoamScanRequestCallback(tHalHandle halHandle, void return eHAL_STATUS_SUCCESS; } - /* -1 is done because the chanIndex would have got incremented after issuing a successful scan request */ - currentChanIndex = (pMac->roam.neighborRoamInfo.roamChannelInfo.currentChanIndex) ? (pMac->roam.neighborRoamInfo.roamChannelInfo.currentChanIndex - 1) : 0; + /* -1 is done because the chanIndex would have got incremented after + issuing a successful scan request */ + currentChanIndex = (pNeighborRoamInfo->roamChannelInfo.currentChanIndex) ? (pNeighborRoamInfo->roamChannelInfo.currentChanIndex - 1) : 0; /* Validate inputs */ - if (pMac->roam.neighborRoamInfo.roamChannelInfo.currentChannelListInfo.ChannelList) { - NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("csrNeighborRoamScanRequestCallback received for Channel = %d, ChanIndex = %d"), - pMac->roam.neighborRoamInfo.roamChannelInfo.currentChannelListInfo.ChannelList[currentChanIndex], currentChanIndex); + if (pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList) { + NEIGHBOR_ROAM_DEBUG(pMac, LOGW, + FL("csrNeighborRoamScanRequestCallback received for Channel = %d, " + "ChanIndex = %d"), + pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList[currentChanIndex], + currentChanIndex); } else { @@ -2549,7 +2764,7 @@ static eHalStatus csrNeighborRoamScanRequestCallback(tHalHandle halHandle, void return eHAL_STATUS_FAILURE; } - hstatus = csrNeighborRoamProcessScanComplete(pMac); + hstatus = csrNeighborRoamProcessScanComplete(pMac, sessionId); if (eHAL_STATUS_SUCCESS != hstatus) { @@ -2600,15 +2815,19 @@ static eHalStatus csrNeighborRoamScanRequestCallback(tHalHandle halHandle, void \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise ---------------------------------------------------------------------------*/ -static eHalStatus csrNeighborRoamScanResultRequestCallback(tHalHandle halHandle, void *pContext, - tANI_U32 scanId, eCsrScanStatus status) +static eHalStatus csrNeighborRoamScanResultRequestCallback(tHalHandle halHandle, + void *pContext, + tANI_U8 sessionId, + tANI_U32 scanId, + eCsrScanStatus status) { - tpAniSirGlobal pMac = (tpAniSirGlobal) halHandle; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpAniSirGlobal pMac = (tpAniSirGlobal) halHandle; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; eHalStatus hstatus; smsLog(pMac, LOG2, FL("called ")); - pMac->roam.neighborRoamInfo.scanRspPending = eANI_BOOLEAN_FALSE; + pNeighborRoamInfo->scanRspPending = eANI_BOOLEAN_FALSE; /* we must be in connected state, if not ignore it */ if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED != pNeighborRoamInfo->neighborRoamState) @@ -2620,7 +2839,7 @@ static eHalStatus csrNeighborRoamScanResultRequestCallback(tHalHandle halHandle, /* Now we have completed scanning the channel list. We have get the result by applying appropriate filter sort the results based on neighborScore and RSSI and select the best candidate out of the list */ - hstatus = csrNeighborRoamProcessScanComplete(pMac); + hstatus = csrNeighborRoamProcessScanComplete(pMac, sessionId); if (eHAL_STATUS_SUCCESS != hstatus) { @@ -2633,12 +2852,13 @@ static eHalStatus csrNeighborRoamScanResultRequestCallback(tHalHandle halHandle, #ifdef FEATURE_WLAN_LFR static eHalStatus csrNeighborRoamContiguousScanRequestCallback(tHalHandle halHandle, - void *pContext, tANI_U32 scanId, eCsrScanStatus status) + void *pContext, tANI_U8 sessionId, + tANI_U32 scanId, eCsrScanStatus status) { - tpAniSirGlobal pMac = (tpAniSirGlobal) halHandle; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpAniSirGlobal pMac = (tpAniSirGlobal) halHandle; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; eHalStatus hstatus = eHAL_STATUS_SUCCESS; - tANI_U32 sessionId = CSR_SESSION_ID_INVALID; if (NULL != pContext) { @@ -2651,7 +2871,7 @@ static eHalStatus csrNeighborRoamContiguousScanRequestCallback(tHalHandle halHan } } - pMac->roam.neighborRoamInfo.scanRspPending = eANI_BOOLEAN_FALSE; + pNeighborRoamInfo->scanRspPending = eANI_BOOLEAN_FALSE; /* This can happen when we receive a UP event from TL in any of the scan states. Silently ignore it */ if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED == pNeighborRoamInfo->neighborRoamState) @@ -2671,7 +2891,7 @@ static eHalStatus csrNeighborRoamContiguousScanRequestCallback(tHalHandle halHan } NEIGHBOR_ROAM_DEBUG(pMac, LOGW, "%s: process scan results", __func__); - hstatus = csrNeighborRoamProcessScanComplete(pMac); + hstatus = csrNeighborRoamProcessScanComplete(pMac, sessionId); if (eHAL_STATUS_SUCCESS != hstatus) { @@ -2708,11 +2928,13 @@ eHalStatus csrNeighborRoamIssueBgScanRequest(tpAniSirGlobal pMac, tCsrScanRequest scanReq; tANI_U8 channel; void * userData = NULL; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; if (1 == pBgScanParams->ChannelInfo.numOfChannels) NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("Channel = %d, ChanIndex = %d"), pBgScanParams->ChannelInfo.ChannelList[0], - pMac->roam.neighborRoamInfo.roamChannelInfo.currentChanIndex); + pNeighborRoamInfo->roamChannelInfo.currentChanIndex); //send down the scan req for 1 channel on the associated SSID vos_mem_set(&scanReq, sizeof(tCsrScanRequest), 0); @@ -2765,28 +2987,32 @@ eHalStatus csrNeighborRoamIssueBgScanRequest(tpAniSirGlobal pMac, vos_mem_free(userData); return status; } - pMac->roam.neighborRoamInfo.scanRspPending = eANI_BOOLEAN_TRUE; + pNeighborRoamInfo->scanRspPending = eANI_BOOLEAN_TRUE; vos_mem_free(scanReq.SSIDs.SSIDList); if (1 == pBgScanParams->ChannelInfo.numOfChannels) - NEIGHBOR_ROAM_DEBUG(pMac, LOG1, FL("Channel List Address = %p, Actual index = %d"), - &pMac->roam.neighborRoamInfo.roamChannelInfo.currentChannelListInfo.ChannelList[0], - pMac->roam.neighborRoamInfo.roamChannelInfo.currentChanIndex); + NEIGHBOR_ROAM_DEBUG(pMac, LOG1, + FL("Channel List Address = %p, Actual index = %d"), + &pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList[0], + pNeighborRoamInfo->roamChannelInfo.currentChanIndex); return status; } static void csrNeighborRoamFillNonChannelBgScanParams (tpAniSirGlobal pMac, + tANI_U8 sessionId, tpCsrBGScanRequest bgScanParams) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; tANI_U8 broadcastBssid[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; vos_mem_copy(bgScanParams->bssid, broadcastBssid, sizeof(tCsrBssid)); - bgScanParams->SSID.length = pMac->roam.roamSession[pNeighborRoamInfo->csrSessionId].connectedProfile.SSID.length; + bgScanParams->SSID.length = + pMac->roam.roamSession[sessionId].connectedProfile.SSID.length; vos_mem_copy(bgScanParams->SSID.ssId, - pMac->roam.roamSession[pNeighborRoamInfo->csrSessionId].connectedProfile.SSID.ssId, - pMac->roam.roamSession[pNeighborRoamInfo->csrSessionId].connectedProfile.SSID.length); + pMac->roam.roamSession[sessionId].connectedProfile.SSID.ssId, + pMac->roam.roamSession[sessionId].connectedProfile.SSID.length); bgScanParams->minChnTime = pNeighborRoamInfo->cfgParams.minChannelScanTime; bgScanParams->maxChnTime = pNeighborRoamInfo->cfgParams.maxChannelScanTime; @@ -2806,10 +3032,11 @@ static void csrNeighborRoamFillNonChannelBgScanParams (tpAniSirGlobal pMac, \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise ---------------------------------------------------------------------------*/ -eHalStatus csrNeighborRoamPerformBgScan(tpAniSirGlobal pMac, tANI_U32 sessionId) +eHalStatus csrNeighborRoamPerformBgScan(tpAniSirGlobal pMac, tANI_U8 sessionId) { eHalStatus status = eHAL_STATUS_SUCCESS; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; tCsrBGScanRequest bgScanParams; tANI_U8 channel = 0; @@ -2824,7 +3051,7 @@ eHalStatus csrNeighborRoamPerformBgScan(tpAniSirGlobal pMac, tANI_U32 sessionId) // When timer start is declared a failure, then we delete the list. // Should not happen now as we stop and then only start the scan timer. // still handle the unlikely case. - csrNeighborRoamHandleEmptyScanResult(pMac); + csrNeighborRoamHandleEmptyScanResult(pMac, sessionId); return status; } @@ -2834,7 +3061,7 @@ eHalStatus csrNeighborRoamPerformBgScan(tpAniSirGlobal pMac, tANI_U32 sessionId) { NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Invalid channel index: %d"), pNeighborRoamInfo->roamChannelInfo.currentChanIndex); // Go back and restart. - csrNeighborRoamHandleEmptyScanResult(pMac); + csrNeighborRoamHandleEmptyScanResult(pMac, sessionId); return status; } @@ -2846,7 +3073,7 @@ eHalStatus csrNeighborRoamPerformBgScan(tpAniSirGlobal pMac, tANI_U32 sessionId) bgScanParams.ChannelInfo.numOfChannels = 1; bgScanParams.ChannelInfo.ChannelList = &channel; - csrNeighborRoamFillNonChannelBgScanParams(pMac, &bgScanParams); + csrNeighborRoamFillNonChannelBgScanParams(pMac, sessionId, &bgScanParams); /* Update the passive scan time for DFS channel */ if ((TRUE == CSR_IS_CHANNEL_DFS(channel)) && (CSR_ROAMING_DFS_CHANNEL_DISABLED != @@ -2868,8 +3095,8 @@ eHalStatus csrNeighborRoamPerformBgScan(tpAniSirGlobal pMac, tANI_U32 sessionId) pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels) { NEIGHBOR_ROAM_DEBUG(pMac, LOG1, FL("Completed scanning channels in Channel List: CurrChanIndex = %d, Num Channels = %d"), - pNeighborRoamInfo->roamChannelInfo.currentChanIndex, - pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels); + pNeighborRoamInfo->roamChannelInfo.currentChanIndex, + pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels); /* We have completed scanning all the channels */ pNeighborRoamInfo->roamChannelInfo.currentChanIndex = 0; /* We are no longer scanning the channel list. Next timer firing should be used to get the scan results @@ -2886,14 +3113,16 @@ eHalStatus csrNeighborRoamPerformBgScan(tpAniSirGlobal pMac, tANI_U32 sessionId) * If the status is not success, we need to call the callback * routine so that the state machine does not get stuck. */ - csrNeighborRoamScanRequestCallback(pMac, NULL, 0, eCSR_SCAN_FAILURE); + csrNeighborRoamScanRequestCallback(pMac, NULL, sessionId, 0, + eCSR_SCAN_FAILURE); } return status; } #ifdef FEATURE_WLAN_LFR -eHalStatus csrNeighborRoamPerformContiguousBgScan(tpAniSirGlobal pMac, tANI_U32 sessionId) +eHalStatus csrNeighborRoamPerformContiguousBgScan(tpAniSirGlobal pMac, + tANI_U32 sessionId) { eHalStatus status = eHAL_STATUS_SUCCESS; tCsrBGScanRequest bgScanParams; @@ -2905,7 +3134,7 @@ eHalStatus csrNeighborRoamPerformContiguousBgScan(tpAniSirGlobal pMac, tANI_U32 vos_mem_set(&bgScanParams, sizeof(tCsrBGScanRequest), 0); /* Contiguously scan all channels from valid list */ - NEIGHBOR_ROAM_DEBUG(pMac, LOG2, "%s: get valid channel list", __func__); + NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("get valid channel list")); numOfChannels = sizeof(pMac->roam.validChannelList); @@ -2922,6 +3151,7 @@ eHalStatus csrNeighborRoamPerformContiguousBgScan(tpAniSirGlobal pMac, tANI_U32 { csrNeighborRoamChannelsFilterByCurrentBand( pMac, + sessionId, pInChannelList, numOfChannels, tmpChannelList, @@ -2945,7 +3175,7 @@ eHalStatus csrNeighborRoamPerformContiguousBgScan(tpAniSirGlobal pMac, tANI_U32 NEIGHBOR_ROAM_DEBUG(pMac, LOGW, "%s: valid channel list = %d", __func__, bgScanParams.ChannelInfo.ChannelList[i]); } - csrNeighborRoamFillNonChannelBgScanParams(pMac, &bgScanParams); + csrNeighborRoamFillNonChannelBgScanParams(pMac, sessionId, &bgScanParams); status = csrNeighborRoamIssueBgScanRequest(pMac, &bgScanParams, sessionId, csrNeighborRoamContiguousScanRequestCallback); @@ -2978,7 +3208,8 @@ void csrNeighborRoamNeighborScanTimerCallback(void *pv) tCsrTimerInfo *pInfo = (tCsrTimerInfo *)pv; tpAniSirGlobal pMac = pInfo->pMac; tANI_U32 sessionId = pInfo->sessionId; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; // check if bg scan is on going, no need to send down the new params if true if(eANI_BOOLEAN_TRUE == pNeighborRoamInfo->scanRspPending) @@ -2988,12 +3219,6 @@ void csrNeighborRoamNeighborScanTimerCallback(void *pv) return; } - if (sessionId != pNeighborRoamInfo->csrSessionId) - { - VOS_ASSERT(sessionId == pNeighborRoamInfo->csrSessionId); - return; - } - switch (pNeighborRoamInfo->neighborRoamState) { #ifdef WLAN_FEATURE_VOWIFI_11R @@ -3029,16 +3254,18 @@ void csrNeighborRoamEmptyScanRefreshTimerCallback(void *context) tCsrTimerInfo *pInfo = (tCsrTimerInfo *)context; tpAniSirGlobal pMac = pInfo->pMac; VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tANI_U32 sessionId = pInfo->sessionId; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; /* Reset all the variables just as no scan had happened before */ - csrNeighborRoamResetConnectedStateControlInfo(pMac); + csrNeighborRoamResetConnectedStateControlInfo(pMac, sessionId); #if defined WLAN_FEATURE_VOWIFI_11R && defined WLAN_FEATURE_VOWIFI if ((pNeighborRoamInfo->is11rAssoc) && (pMac->rrm.rrmSmeContext.rrmConfig.rrmEnabled)) { NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("11R Association:Neighbor Lookup Down event received in CONNECTED state")); - vosStatus = csrNeighborRoamIssueNeighborRptRequest(pMac); + vosStatus = csrNeighborRoamIssueNeighborRptRequest(pMac, sessionId); if (VOS_STATUS_SUCCESS != vosStatus) { smsLog(pMac, LOGE, FL("Neighbor report request failed. status = %d"), vosStatus); @@ -3047,13 +3274,14 @@ void csrNeighborRoamEmptyScanRefreshTimerCallback(void *context) /* Increment the neighbor report retry count after sending the neighbor request successfully */ pNeighborRoamInfo->FTRoamInfo.currentNeighborRptRetryNum++; pNeighborRoamInfo->FTRoamInfo.neighborRptPending = eANI_BOOLEAN_TRUE; - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REPORT_QUERY) - } - else + CSR_NEIGHBOR_ROAM_STATE_TRANSITION( + eCSR_NEIGHBOR_ROAM_STATE_REPORT_QUERY, + sessionId) + } else #endif { NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Non 11R or ESE Association:empty scan refresh timer expired")); - vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac); + vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac, sessionId); if (VOS_STATUS_SUCCESS != vosStatus) { return; @@ -3081,30 +3309,32 @@ void csrNeighborRoamResultsRefreshTimerCallback(void *context) tCsrTimerInfo *pInfo = (tCsrTimerInfo *)context; tpAniSirGlobal pMac = pInfo->pMac; VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tANI_U32 sessionId = pInfo->sessionId; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[pInfo->sessionId]; NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Deregistering DOWN event reassoc callback with TL. RSSI = %d"), pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1)); /* Deregister reassoc callback. Ignore return status */ vosStatus = WLANTL_DeregRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1), - WLANTL_HO_THRESHOLD_DOWN, - csrNeighborRoamReassocIndCallback, - VOS_MODULE_ID_SME); + WLANTL_HO_THRESHOLD_DOWN, + csrNeighborRoamReassocIndCallback, + VOS_MODULE_ID_SME); - if(!VOS_IS_STATUS_SUCCESS(vosStatus)) + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { //err msg smsLog(pMac, LOGW, FL(" Couldn't deregister csrNeighborRoamReassocIndCallback with TL: Status = %d"), vosStatus); } /* Reset all the variables just as no scan had happened before */ - csrNeighborRoamResetConnectedStateControlInfo(pMac); + csrNeighborRoamResetConnectedStateControlInfo(pMac, pInfo->sessionId); #if defined WLAN_FEATURE_VOWIFI_11R && defined WLAN_FEATURE_VOWIFI if ((pNeighborRoamInfo->is11rAssoc) && (pMac->rrm.rrmSmeContext.rrmConfig.rrmEnabled)) { NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("11R Association:Neighbor Lookup Down event received in CONNECTED state")); - vosStatus = csrNeighborRoamIssueNeighborRptRequest(pMac); + vosStatus = csrNeighborRoamIssueNeighborRptRequest(pMac, sessionId); if (VOS_STATUS_SUCCESS != vosStatus) { smsLog(pMac, LOGE, FL("Neighbor report request failed. status = %d"), vosStatus); @@ -3113,13 +3343,15 @@ void csrNeighborRoamResultsRefreshTimerCallback(void *context) /* Increment the neighbor report retry count after sending the neighbor request successfully */ pNeighborRoamInfo->FTRoamInfo.currentNeighborRptRetryNum++; pNeighborRoamInfo->FTRoamInfo.neighborRptPending = eANI_BOOLEAN_TRUE; - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REPORT_QUERY) + CSR_NEIGHBOR_ROAM_STATE_TRANSITION( + eCSR_NEIGHBOR_ROAM_STATE_REPORT_QUERY, + sessionId) } else #endif { NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Non 11R or ESE Association:results refresh timer expired")); - vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac); + vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac, sessionId); if (VOS_STATUS_SUCCESS != vosStatus) { return; @@ -3142,25 +3374,39 @@ void csrNeighborRoamResultsRefreshTimerCallback(void *context) \return VOS_STATUS_SUCCESS on success, corresponding error code otherwise ---------------------------------------------------------------------------*/ -VOS_STATUS csrNeighborRoamIssueNeighborRptRequest(tpAniSirGlobal pMac) +VOS_STATUS csrNeighborRoamIssueNeighborRptRequest(tpAniSirGlobal pMac, + tANI_U8 sessionId) { tRrmNeighborRspCallbackInfo callbackInfo; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; tRrmNeighborReq neighborReq; + tpFTRoamCallbackUsrCtx pUsrCtx; + /* This user context data will be returned with callback */ + pUsrCtx = vos_mem_malloc(sizeof(*pUsrCtx)); + if (NULL == pUsrCtx) { + smsLog(pMac, LOGE, FL("Memory allocation failure")); + return VOS_STATUS_E_NOMEM; + } + pUsrCtx->pMac = pMac; + pUsrCtx->sessionId = sessionId; neighborReq.no_ssid = 0; /* Fill in the SSID */ - neighborReq.ssid.length = pMac->roam.roamSession[pNeighborRoamInfo->csrSessionId].connectedProfile.SSID.length; - vos_mem_copy(neighborReq.ssid.ssId, pMac->roam.roamSession[pNeighborRoamInfo->csrSessionId].connectedProfile.SSID.ssId, - pMac->roam.roamSession[pNeighborRoamInfo->csrSessionId].connectedProfile.SSID.length); + neighborReq.ssid.length = + pMac->roam.roamSession[sessionId].connectedProfile.SSID.length; + vos_mem_copy(neighborReq.ssid.ssId, + pMac->roam.roamSession[sessionId].connectedProfile.SSID.ssId, + pMac->roam.roamSession[sessionId].connectedProfile.SSID.length); callbackInfo.neighborRspCallback = csrNeighborRoamRRMNeighborReportResult; - callbackInfo.neighborRspCallbackContext = pMac; + callbackInfo.neighborRspCallbackContext = pUsrCtx; callbackInfo.timeout = pNeighborRoamInfo->FTRoamInfo.neighborReportTimeout; - return sme_NeighborReportRequest(pMac,(tANI_U8) pNeighborRoamInfo->csrSessionId, &neighborReq, &callbackInfo); + return sme_NeighborReportRequest(pMac, sessionId, &neighborReq, + &callbackInfo); } /* --------------------------------------------------------------------------- @@ -3183,6 +3429,7 @@ VOS_STATUS csrNeighborRoamIssueNeighborRptRequest(tpAniSirGlobal pMac) VOS_STATUS csrNeighborRoamChannelsFilterByCurrentBand( tpAniSirGlobal pMac, + tANI_U8 sessionId, tANI_U8* pInputChannelList, tANI_U8 inputNumOfChannels, tANI_U8* pOutputChannelList, @@ -3191,7 +3438,8 @@ VOS_STATUS csrNeighborRoamChannelsFilterByCurrentBand( { tANI_U8 i = 0; tANI_U8 numChannels = 0; - tANI_U8 currAPoperationChannel = pMac->roam.neighborRoamInfo.currAPoperationChannel; + tANI_U8 currAPoperationChannel = + pMac->roam.neighborRoamInfo[sessionId].currAPoperationChannel; // Check for NULL pointer if (!pInputChannelList) return VOS_STATUS_E_INVAL; @@ -3322,10 +3570,12 @@ VOS_STATUS csrNeighborRoamMergeChannelLists( \return VOS_STATUS_SUCCESS on success, corresponding error code otherwise ---------------------------------------------------------------------------*/ -VOS_STATUS csrNeighborRoamCreateChanListFromNeighborReport(tpAniSirGlobal pMac) +VOS_STATUS csrNeighborRoamCreateChanListFromNeighborReport(tpAniSirGlobal pMac, + tANI_U8 sessionId) { tpRrmNeighborReportDesc pNeighborBssDesc; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; tANI_U8 numChannels = 0; tANI_U8 i = 0; tANI_U8 channelList[MAX_BSS_IN_NEIGHBOR_RPT]; @@ -3411,11 +3661,10 @@ VOS_STATUS csrNeighborRoamCreateChanListFromNeighborReport(tpAniSirGlobal pMac) * report Channels. This increases the chances of the DUT to get a candidate AP while * roaming even if the Neighbor Report is not able to provide sufficient information. * */ - if (pMac->scan.occupiedChannels.numChannels) - { + if (pMac->scan.occupiedChannels[sessionId].numChannels) { csrNeighborRoamMergeChannelLists(pMac, - &pMac->scan.occupiedChannels.channelList[0], - pMac->scan.occupiedChannels.numChannels, + &pMac->scan.occupiedChannels[sessionId].channelList[0], + pMac->scan.occupiedChannels[sessionId].numChannels, &pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList[0], pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels, &mergedOutputNumOfChannels); @@ -3437,7 +3686,8 @@ VOS_STATUS csrNeighborRoamCreateChanListFromNeighborReport(tpAniSirGlobal pMac) #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (csrRoamIsRoamOffloadScanEnabled(pMac)) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CHANNEL_LIST_CHANGED); + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_CHANNEL_LIST_CHANGED); } #endif } @@ -3465,8 +3715,11 @@ VOS_STATUS csrNeighborRoamCreateChanListFromNeighborReport(tpAniSirGlobal pMac) ---------------------------------------------------------------------------*/ void csrNeighborRoamRRMNeighborReportResult(void *context, VOS_STATUS vosStatus) { - tpAniSirGlobal pMac = PMAC_STRUCT(context); - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tFTRoamCallbackUsrCtx *pUsrCtx = (tFTRoamCallbackUsrCtx *)context; + tANI_U32 sessionId = pUsrCtx->sessionId; + tpAniSirGlobal pMac = pUsrCtx->pMac; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; eHalStatus status = eHAL_STATUS_SUCCESS; smsLog(pMac, LOG1, FL("Neighbor report result callback with status = %d"), vosStatus); @@ -3478,7 +3731,9 @@ void csrNeighborRoamRRMNeighborReportResult(void *context, VOS_STATUS vosStatus) if (VOS_STATUS_SUCCESS == vosStatus) { /* Need to create channel list based on the neighbor AP list and transition to REPORT_SCAN state */ - vosStatus = csrNeighborRoamCreateChanListFromNeighborReport(pMac); + vosStatus = csrNeighborRoamCreateChanListFromNeighborReport( + pMac, + sessionId); if (VOS_STATUS_SUCCESS == vosStatus) { NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Channel List created from Neighbor report, Transitioning to NEIGHBOR_SCAN state")); @@ -3499,11 +3754,13 @@ void csrNeighborRoamRRMNeighborReportResult(void *context, VOS_STATUS vosStatus) vos_mem_free(pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList); pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList = NULL; pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels = 0; + vos_mem_free(pUsrCtx); return; } pNeighborRoamInfo->FTRoamInfo.currentNeighborRptRetryNum = 0; /* Neighbor scan timer started. Transition to REPORT_SCAN state */ - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN) + CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN, + sessionId) } else { @@ -3515,10 +3772,12 @@ void csrNeighborRoamRRMNeighborReportResult(void *context, VOS_STATUS vosStatus) pNeighborRoamInfo->cfgParams.maxNeighborRetries) { smsLog(pMac, LOGE, FL("Bailing out to CFG Channel list scan.. ")); - vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac); + vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac, + sessionId); if (VOS_STATUS_SUCCESS != vosStatus) { smsLog(pMac, LOGE, FL("Transit to CFG Channel list scan state failed with status %d "), vosStatus); + vos_mem_free(pUsrCtx); return; } /* We transitioned to different state now. Reset the Neighbor report retry count */ @@ -3526,10 +3785,12 @@ void csrNeighborRoamRRMNeighborReportResult(void *context, VOS_STATUS vosStatus) } else { - vosStatus = csrNeighborRoamIssueNeighborRptRequest(pMac); + vosStatus = csrNeighborRoamIssueNeighborRptRequest(pMac, + sessionId); if (VOS_STATUS_SUCCESS != vosStatus) { smsLog(pMac, LOGE, FL("Neighbor report request failed. status = %d"), vosStatus); + vos_mem_free(pUsrCtx); return; } pNeighborRoamInfo->FTRoamInfo.neighborRptPending = eANI_BOOLEAN_TRUE; @@ -3546,6 +3807,7 @@ void csrNeighborRoamRRMNeighborReportResult(void *context, VOS_STATUS vosStatus) pNeighborRoamInfo->neighborRoamState)); break; } + vos_mem_free(pUsrCtx); return; } #endif /* WLAN_FEATURE_VOWIFI_11R */ @@ -3612,11 +3874,11 @@ tANI_BOOLEAN csrNeighborRoamIsSsidAndSecurityMatch( } } -tANI_BOOLEAN csrNeighborRoamIsNewConnectedProfile( - tpAniSirGlobal pMac) +tANI_BOOLEAN csrNeighborRoamIsNewConnectedProfile(tpAniSirGlobal pMac, + tANI_U8 sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; - tANI_U8 sessionId = (tANI_U8)pNeighborRoamInfo->csrSessionId; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; tCsrRoamConnectedProfile *pCurrProfile = NULL; tCsrRoamConnectedProfile *pPrevProfile = NULL; tDot11fBeaconIEs *pIes = NULL; @@ -3669,11 +3931,10 @@ tANI_BOOLEAN csrNeighborRoamIsNewConnectedProfile( tANI_BOOLEAN csrNeighborRoamConnectedProfileMatch( tpAniSirGlobal pMac, + tANI_U8 sessionId, tCsrScanResult *pResult, tDot11fBeaconIEs *pIes) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; - tANI_U8 sessionId = (tANI_U8)pNeighborRoamInfo->csrSessionId; tCsrRoamConnectedProfile *pCurProfile = NULL; tSirBssDescription *pBssDesc = &pResult->Result.BssDescriptor; @@ -3712,6 +3973,7 @@ tANI_BOOLEAN csrNeighborRoamConnectedProfileMatch( ---------------------------------------------------------------------------*/ VOS_STATUS csrNeighborRoamPrepareNonOccupiedChannelList( tpAniSirGlobal pMac, + tANI_U8 sessionId, tANI_U8 *pInputChannelList, tANI_U8 numOfChannels, tANI_U8 *pOutputChannelList, @@ -3720,8 +3982,10 @@ VOS_STATUS csrNeighborRoamPrepareNonOccupiedChannelList( { tANI_U8 i = 0; tANI_U8 outputNumOfChannels = 0; // Clear the output number of channels - tANI_U8 numOccupiedChannels = pMac->scan.occupiedChannels.numChannels; - tANI_U8 *pOccupiedChannelList = pMac->scan.occupiedChannels.channelList; + tANI_U8 numOccupiedChannels = + pMac->scan.occupiedChannels[sessionId].numChannels; + tANI_U8 *pOccupiedChannelList = + pMac->scan.occupiedChannels[sessionId].channelList; for (i = 0; i < numOfChannels; i++) { @@ -3770,17 +4034,16 @@ VOS_STATUS csrNeighborRoamPrepareNonOccupiedChannelList( \return VOS_STATUS_SUCCESS on success, corresponding error code otherwise ---------------------------------------------------------------------------*/ -VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac) +VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac, + tANI_U8 sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; eHalStatus status = eHAL_STATUS_SUCCESS; int i = 0; tANI_U8 numOfChannels = 0; tANI_U8 channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN]; tpCsrChannelInfo currChannelListInfo; -#ifdef FEATURE_WLAN_LFR - tANI_U32 sessionId = pNeighborRoamInfo->csrSessionId; -#endif currChannelListInfo = &pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo; if ( @@ -3822,6 +4085,7 @@ VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac) { csrNeighborRoamChannelsFilterByCurrentBand( pMac, + sessionId, pNeighborRoamInfo->cfgParams.channelInfo.ChannelList, pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels, channelList, @@ -3869,14 +4133,16 @@ VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac) csrNeighborRoamPerformContiguousBgScan(pMac, sessionId); /* Transition to CFG_CHAN_LIST_SCAN */ - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN); + CSR_NEIGHBOR_ROAM_STATE_TRANSITION( + eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN, + sessionId); return VOS_STATUS_SUCCESS; } #endif else { - numOfChannels = pMac->scan.occupiedChannels.numChannels; + numOfChannels = pMac->scan.occupiedChannels[sessionId].numChannels; if (numOfChannels #ifdef FEATURE_WLAN_LFR && ((pNeighborRoamInfo->uScanMode == SPLIT_SCAN_OCCUPIED_LIST) || @@ -3900,7 +4166,8 @@ VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac) { csrNeighborRoamChannelsFilterByCurrentBand( pMac, - pMac->scan.occupiedChannels.channelList, + sessionId, + pMac->scan.occupiedChannels[sessionId].channelList, numOfChannels, channelList, &numOfChannels); @@ -3912,7 +4179,7 @@ VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac) numOfChannels = WNI_CFG_VALID_CHANNEL_LIST_LEN; } vos_mem_copy(channelList, - pMac->scan.occupiedChannels.channelList, + pMac->scan.occupiedChannels[sessionId].channelList, numOfChannels * sizeof(tANI_U8)); } @@ -3953,6 +4220,7 @@ VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac) */ NEIGHBOR_ROAM_DEBUG(pMac, LOG1, "Switching to non-occupied channel list"); status = csrNeighborRoamPrepareNonOccupiedChannelList(pMac, + sessionId, (tANI_U8 *)pMac->roam.validChannelList, numOfChannels, channelList, @@ -3978,6 +4246,7 @@ VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac) { csrNeighborRoamChannelsFilterByCurrentBand( pMac, + sessionId, (tANI_U8 *)pMac->roam.validChannelList, numOfChannels, channelList, @@ -4049,7 +4318,9 @@ VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac) csrNeighborRoamPurgePreauthFailedList(pMac); /* Transition to CFG_CHAN_LIST_SCAN_STATE */ - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN) + CSR_NEIGHBOR_ROAM_STATE_TRANSITION( + eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN, + sessionId) return VOS_STATUS_SUCCESS; } @@ -4063,43 +4334,58 @@ VOS_STATUS csrNeighborRoamTransitToCFGChanScan(tpAniSirGlobal pMac) CONNECTED state and reset all the scan parameters \param pMac - The handle returned by macOpen. + \param sessionId - Session ID \return VOS_STATUS_SUCCESS on success, corresponding error code otherwise ---------------------------------------------------------------------------*/ -VOS_STATUS csrNeighborRoamNeighborLookupUpEvent(tpAniSirGlobal pMac) +VOS_STATUS csrNeighborRoamNeighborLookupUpEvent(tpAniSirGlobal pMac, + tANI_U8 sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; VOS_STATUS vosStatus; - csrNeighborRoamDeregAllRssiIndication(pMac); + tpFTRoamCallbackUsrCtx pUsrCtx; + csrNeighborRoamDeregAllRssiIndication(pMac, sessionId); /* Recheck whether the below check is needed. */ if (pNeighborRoamInfo->neighborRoamState != eCSR_NEIGHBOR_ROAM_STATE_CONNECTED) - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED) + CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED, + sessionId) #ifdef FEATURE_WLAN_LFR - if (!csrRoamIsFastRoamEnabled(pMac,pMac->roam.neighborRoamInfo.csrSessionId)) - { - smsLog(pMac, LOGE, FL("Received when fast roam is disabled. Ignore it")); + if (!csrRoamIsFastRoamEnabled(pMac, sessionId)) { + smsLog(pMac, LOGE, FL("LookUp event received when fast roam is " + "disabled. Ignore it")); return eHAL_STATUS_SUCCESS; } #endif /* Reset all the neighbor roam info control variables. Free all the allocated memory. It is like we are just associated now */ - csrNeighborRoamResetConnectedStateControlInfo(pMac); + csrNeighborRoamResetConnectedStateControlInfo(pMac, sessionId); + /* This user context data will be returned with callback */ + pUsrCtx = vos_mem_malloc(sizeof(*pUsrCtx)); + if (NULL == pUsrCtx) { + smsLog(pMac, LOGE, FL("Memory allocation failure")); + return VOS_STATUS_E_NOMEM; + } + pUsrCtx->pMac = pMac; + pUsrCtx->sessionId = sessionId; NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Registering DOWN event neighbor lookup callback with TL. RSSI = %d,"), pNeighborRoamInfo->currentNeighborLookupThreshold * (-1)); /* Register Neighbor Lookup threshold callback with TL for DOWN event now */ - vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1), + vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, + (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1), WLANTL_HO_THRESHOLD_DOWN, csrNeighborRoamNeighborLookupDOWNCallback, - VOS_MODULE_ID_SME, pMac); + VOS_MODULE_ID_SME, pUsrCtx); #ifdef FEATURE_WLAN_LFR pNeighborRoamInfo->lookupDOWNRssi = 0; #endif - if(!VOS_IS_STATUS_SUCCESS(vosStatus)) + if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { //err msg smsLog(pMac, LOGW, FL(" Couldn't register csrNeighborRoamNeighborLookupCallback DOWN event with TL: Status = %d"), vosStatus); + vos_mem_free(pUsrCtx); } @@ -4116,15 +4402,19 @@ VOS_STATUS csrNeighborRoamNeighborLookupUpEvent(tpAniSirGlobal pMac) a non-11R association. \param pMac - The handle returned by macOpen. + \param sessionId - Session Id \return VOS_STATUS_SUCCESS on success, corresponding error code otherwise ---------------------------------------------------------------------------*/ -VOS_STATUS csrNeighborRoamNeighborLookupDownEvent(tpAniSirGlobal pMac) +VOS_STATUS csrNeighborRoamNeighborLookupDownEvent(tpAniSirGlobal pMac, + tANI_U8 sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; eHalStatus status = eHAL_STATUS_SUCCESS; + tpFTRoamCallbackUsrCtx pUsrCtx; switch (pNeighborRoamInfo->neighborRoamState) { @@ -4144,9 +4434,9 @@ VOS_STATUS csrNeighborRoamNeighborLookupDownEvent(tpAniSirGlobal pMac) smsLog(pMac, LOGW, FL(" Couldn't Deregister csrNeighborRoamNeighborLookupCallback DOWN event from TL: Status = %d"), vosStatus); } #ifdef FEATURE_WLAN_LFR - if (!csrRoamIsFastRoamEnabled(pMac,pMac->roam.neighborRoamInfo.csrSessionId)) - { - smsLog(pMac, LOGE, FL("Received when fast roam is disabled. Ignore it")); + if (!csrRoamIsFastRoamEnabled(pMac, sessionId)) { + smsLog(pMac, LOGE, FL("LookDown event received when fast roam " + "is disabled. Ignore it")); return eHAL_STATUS_SUCCESS; } #endif @@ -4156,7 +4446,8 @@ VOS_STATUS csrNeighborRoamNeighborLookupDownEvent(tpAniSirGlobal pMac) { NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("11R Association:Neighbor Lookup Down event received in CONNECTED state")); - vosStatus = csrNeighborRoamIssueNeighborRptRequest(pMac); + vosStatus = csrNeighborRoamIssueNeighborRptRequest(pMac, + sessionId); if (VOS_STATUS_SUCCESS != vosStatus) { smsLog(pMac, LOGE, FL("Neighbor report request failed. status = %d"), vosStatus); @@ -4165,28 +4456,35 @@ VOS_STATUS csrNeighborRoamNeighborLookupDownEvent(tpAniSirGlobal pMac) /* Increment the neighbor report retry count after sending the neighbor request successfully */ pNeighborRoamInfo->FTRoamInfo.currentNeighborRptRetryNum++; pNeighborRoamInfo->FTRoamInfo.neighborRptPending = eANI_BOOLEAN_TRUE; - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REPORT_QUERY) + CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REPORT_QUERY, + sessionId) } else #endif { NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Non 11R or ESE Association:Neighbor Lookup Down event received in CONNECTED state")); - vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac); + vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac, sessionId); if (VOS_STATUS_SUCCESS != vosStatus) { NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("csrNeighborRoamTransitToCFGChanScan failed" - " with status=%d"), vosStatus); + " with status=%d"), vosStatus); return vosStatus; } } NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Registering UP event neighbor lookup callback with TL. RSSI = %d,"), NEIGHBOR_ROAM_LOOKUP_UP_THRESHOLD * (-1)); /* Register Neighbor Lookup threshold callback with TL for UP event now */ + pUsrCtx = vos_mem_malloc(sizeof(*pUsrCtx)); + if (NULL == pUsrCtx) { + smsLog(pMac, LOGE, FL("Memory allocation failed")); + return eHAL_STATUS_FAILED_ALLOC; + } + vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, - (v_S7_t)NEIGHBOR_ROAM_LOOKUP_UP_THRESHOLD * (-1), - WLANTL_HO_THRESHOLD_UP, - csrNeighborRoamNeighborLookupUPCallback, - VOS_MODULE_ID_SME, pMac); + (v_S7_t)NEIGHBOR_ROAM_LOOKUP_UP_THRESHOLD * (-1), + WLANTL_HO_THRESHOLD_UP, + csrNeighborRoamNeighborLookupUPCallback, + VOS_MODULE_ID_SME, pUsrCtx); if(!VOS_IS_STATUS_SUCCESS(vosStatus)) { //err msg @@ -4194,6 +4492,7 @@ VOS_STATUS csrNeighborRoamNeighborLookupDownEvent(tpAniSirGlobal pMac) FL(" Couldn't register csrNeighborRoamNeighborLookupCallback" "UP event with TL: Status = %d"), status); + vos_mem_free(pUsrCtx); } break; default: @@ -4221,30 +4520,36 @@ VOS_STATUS csrNeighborRoamNeighborLookupDownEvent(tpAniSirGlobal pMac) \return VOS_STATUS_SUCCESS on success, corresponding error code otherwise ---------------------------------------------------------------------------*/ -VOS_STATUS csrNeighborRoamNeighborLookupUPCallback (v_PVOID_t pAdapter, v_U8_t rssiNotification, - v_PVOID_t pUserCtxt, - v_S7_t avgRssi) +VOS_STATUS +csrNeighborRoamNeighborLookupUPCallback (v_PVOID_t pAdapter, + v_U8_t rssiNotification, + v_PVOID_t pUserCtxt, + v_S7_t avgRssi) { - tpAniSirGlobal pMac = PMAC_STRUCT( pUserCtxt ); - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tFTRoamCallbackUsrCtx *pUsrCtx = (tFTRoamCallbackUsrCtx *)pUserCtxt; + tANI_U32 sessionId = pUsrCtx->sessionId; + tpAniSirGlobal pMac = pUsrCtx->pMac; VOS_STATUS vosStatus = eHAL_STATUS_SUCCESS; NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("Neighbor Lookup UP indication callback called with notification %d Reported RSSI = %d"), rssiNotification, avgRssi); - if(!csrIsConnStateConnectedInfra(pMac, pNeighborRoamInfo->csrSessionId)) - { - smsLog(pMac, LOGW, "Ignoring the indication as we are not connected"); + if (!csrIsConnStateConnectedInfra(pMac, sessionId)) { + smsLog(pMac, LOGW, FL("LookUp Event received when we are not connected. " + "Ignore it")); + vos_mem_free(pUsrCtx); return VOS_STATUS_SUCCESS; } if (WLANTL_HO_THRESHOLD_UP != rssiNotification) { VOS_ASSERT(WLANTL_HO_THRESHOLD_UP == rssiNotification); + vos_mem_free(pUsrCtx); return VOS_STATUS_E_FAILURE; } - vosStatus = csrNeighborRoamNeighborLookupUpEvent(pMac); + vosStatus = csrNeighborRoamNeighborLookupUpEvent(pMac, sessionId); + vos_mem_free(pUsrCtx); return vosStatus; } @@ -4262,12 +4567,17 @@ VOS_STATUS csrNeighborRoamNeighborLookupUPCallback (v_PVOID_t pAdapter, v_U8_t r \return VOS_STATUS_SUCCESS on success, corresponding error code otherwise ---------------------------------------------------------------------------*/ -VOS_STATUS csrNeighborRoamNeighborLookupDOWNCallback (v_PVOID_t pAdapter, v_U8_t rssiNotification, - v_PVOID_t pUserCtxt, - v_S7_t avgRssi) +VOS_STATUS +csrNeighborRoamNeighborLookupDOWNCallback (v_PVOID_t pAdapter, + v_U8_t rssiNotification, + v_PVOID_t pUserCtxt, + v_S7_t avgRssi) { - tpAniSirGlobal pMac = PMAC_STRUCT( pUserCtxt ); - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tFTRoamCallbackUsrCtx *pUsrCtx = (tFTRoamCallbackUsrCtx *)pUserCtxt; + tANI_U32 sessionId = pUsrCtx->sessionId; + tpAniSirGlobal pMac = pUsrCtx->pMac; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; VOS_STATUS vosStatus = eHAL_STATUS_SUCCESS; NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("Neighbor Lookup DOWN indication callback called with notification %d Reported RSSI = %d"), @@ -4277,18 +4587,21 @@ VOS_STATUS csrNeighborRoamNeighborLookupDOWNCallback (v_PVOID_t pAdapter, v_U8_t #ifdef FEATURE_WLAN_LFR pNeighborRoamInfo->lookupDOWNRssi = avgRssi; #endif - if(!csrIsConnStateConnectedInfra(pMac, pNeighborRoamInfo->csrSessionId)) - { - smsLog(pMac, LOGW, "Ignoring the indication as we are not connected"); + if (!csrIsConnStateConnectedInfra(pMac, sessionId)) { + smsLog(pMac, LOGW, FL("LookDown Event received when we are not " + "connected. Ignore it")); + vos_mem_free(pUsrCtx); return VOS_STATUS_SUCCESS; } if (WLANTL_HO_THRESHOLD_DOWN != rssiNotification) { VOS_ASSERT(WLANTL_HO_THRESHOLD_DOWN == rssiNotification); + vos_mem_free(pUsrCtx); return VOS_STATUS_E_FAILURE; } - vosStatus = csrNeighborRoamNeighborLookupDownEvent(pMac); + vosStatus = csrNeighborRoamNeighborLookupDownEvent(pMac, sessionId); + vos_mem_free(pUsrCtx); return vosStatus; } @@ -4312,9 +4625,11 @@ extern int dumpCmdRSSI; \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise ---------------------------------------------------------------------------*/ -eHalStatus csrNeighborRoamIndicateDisconnect(tpAniSirGlobal pMac, tANI_U8 sessionId) +eHalStatus csrNeighborRoamIndicateDisconnect(tpAniSirGlobal pMac, + tANI_U8 sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; #ifdef FEATURE_WLAN_LFR tCsrRoamConnectedProfile *pPrevProfile = &pNeighborRoamInfo->prevConnProfile; #endif @@ -4383,46 +4698,50 @@ eHalStatus csrNeighborRoamIndicateDisconnect(tpAniSirGlobal pMac, tANI_U8 sessio * Otherwise, we will be stuck in reassoc state which will * in-turn block scans (see csrIsScanAllowed). */ - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT); + CSR_NEIGHBOR_ROAM_STATE_TRANSITION( + eCSR_NEIGHBOR_ROAM_STATE_INIT, + sessionId); pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; } break; case eCSR_NEIGHBOR_ROAM_STATE_INIT: - csrNeighborRoamResetInitStateControlInfo(pMac); + csrNeighborRoamResetInitStateControlInfo(pMac, sessionId); #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (!csrRoamIsRoamOffloadScanEnabled(pMac)) { #endif - csrNeighborRoamDeregAllRssiIndication(pMac); + csrNeighborRoamDeregAllRssiIndication(pMac, sessionId); #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD } #endif break; case eCSR_NEIGHBOR_ROAM_STATE_CONNECTED: - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT) + CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT, + sessionId) pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; - csrNeighborRoamResetConnectedStateControlInfo(pMac); + csrNeighborRoamResetConnectedStateControlInfo(pMac, sessionId); #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (!csrRoamIsRoamOffloadScanEnabled(pMac)) { #endif - csrNeighborRoamDeregAllRssiIndication(pMac); + csrNeighborRoamDeregAllRssiIndication(pMac, sessionId); #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD } #endif break; case eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN: - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT); + CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT, + sessionId); pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; - csrNeighborRoamResetCfgListChanScanControlInfo(pMac); + csrNeighborRoamResetCfgListChanScanControlInfo(pMac, sessionId); #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (!csrRoamIsRoamOffloadScanEnabled(pMac)) { #endif - csrNeighborRoamDeregAllRssiIndication(pMac); + csrNeighborRoamDeregAllRssiIndication(pMac, sessionId); #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD } #endif @@ -4430,18 +4749,19 @@ eHalStatus csrNeighborRoamIndicateDisconnect(tpAniSirGlobal pMac, tANI_U8 sessio case eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE: /* Stop pre-auth to reassoc interval timer */ - vos_timer_stop(&pMac->ft.ftSmeContext.preAuthReassocIntvlTimer); + vos_timer_stop(&pSession->ftSmeContext.preAuthReassocIntvlTimer); case eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN: case eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING: - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT) + CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT, + sessionId) pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; - csrNeighborRoamResetPreauthControlInfo(pMac); - csrNeighborRoamResetReportScanStateControlInfo(pMac); + csrNeighborRoamResetPreauthControlInfo(pMac, sessionId); + csrNeighborRoamResetReportScanStateControlInfo(pMac, sessionId); #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (!csrRoamIsRoamOffloadScanEnabled(pMac)) { #endif - csrNeighborRoamDeregAllRssiIndication(pMac); + csrNeighborRoamDeregAllRssiIndication(pMac, sessionId); #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD } #endif @@ -4452,7 +4772,8 @@ eHalStatus csrNeighborRoamIndicateDisconnect(tpAniSirGlobal pMac, tANI_U8 sessio macTraceGetNeighbourRoamState( pNeighborRoamInfo->neighborRoamState)); NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("Transitioning to INIT state")); - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT) + CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT, + sessionId) pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; break; } @@ -4460,7 +4781,8 @@ eHalStatus csrNeighborRoamIndicateDisconnect(tpAniSirGlobal pMac, tANI_U8 sessio /*Inform the Firmware to STOP Scanning as the host has a disconnect.*/ if (csrRoamIsStaMode(pMac, sessionId)) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_STOP, REASON_DISCONNECTED); + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_STOP, + REASON_DISCONNECTED); } #endif @@ -4482,9 +4804,12 @@ eHalStatus csrNeighborRoamIndicateDisconnect(tpAniSirGlobal pMac, tANI_U8 sessio \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise ---------------------------------------------------------------------------*/ -eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac, tANI_U8 sessionId, VOS_STATUS vosStatus) +eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac, + tANI_U8 sessionId, + VOS_STATUS vosStatus) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; eHalStatus status = eHAL_STATUS_SUCCESS; VOS_STATUS vstatus; #ifdef WLAN_FEATURE_ROAM_OFFLOAD @@ -4493,6 +4818,7 @@ eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac, tANI_U8 sessionId vos_msg_t msg; tCsrRoamSession *pSession = &pMac->roam.roamSession[sessionId]; #endif + tpFTRoamCallbackUsrCtx pUsrCtx; #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) int init_ft_flag = FALSE; @@ -4529,7 +4855,7 @@ eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac, tANI_U8 sessionId if (csrIsConcurrentSessionRunning(pMac)) { smsLog(pMac, LOGE, FL("Ignoring Connect indication received in multisession %d"), - csrIsConcurrentSessionRunning(pMac)); + csrIsConcurrentSessionRunning(pMac)); return eHAL_STATUS_SUCCESS; } #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD @@ -4573,16 +4899,16 @@ eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac, tANI_U8 sessionId if (VOS_STATUS_SUCCESS != vosStatus) { /* Just transition the state to INIT state. Rest of the clean up happens when we get next connect indication */ - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT) + CSR_NEIGHBOR_ROAM_STATE_TRANSITION( + eCSR_NEIGHBOR_ROAM_STATE_INIT, + sessionId) pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; break; } /* Fall through if the status is SUCCESS */ case eCSR_NEIGHBOR_ROAM_STATE_INIT: /* Reset all the data structures here */ - csrNeighborRoamResetInitStateControlInfo(pMac); - - pNeighborRoamInfo->csrSessionId = sessionId; + csrNeighborRoamResetInitStateControlInfo(pMac, sessionId); #ifdef FEATURE_WLAN_LFR /* @@ -4590,9 +4916,11 @@ eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac, tANI_U8 sessionId * transitioning from INIT state to CONNECTED state. */ if (eCSR_NEIGHBOR_ROAM_STATE_INIT == pNeighborRoamInfo->neighborRoamState) - csrInitOccupiedChannelsList(pMac); + csrInitOccupiedChannelsList(pMac, sessionId); #endif - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED); + CSR_NEIGHBOR_ROAM_STATE_TRANSITION( + eCSR_NEIGHBOR_ROAM_STATE_CONNECTED, + sessionId); vos_mem_copy(pNeighborRoamInfo->currAPbssid, pMac->roam.roamSession[sessionId].connectedProfile.bssid, sizeof(tCsrBssid)); @@ -4620,7 +4948,8 @@ eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac, tANI_U8 sessionId #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) /* Now we can clear the preauthDone that was saved as we are connected afresh */ - csrNeighborRoamFreeRoamableBSSList(pMac, &pMac->roam.neighborRoamInfo.FTRoamInfo.preAuthDoneList); + csrNeighborRoamFreeRoamableBSSList(pMac, + &pNeighborRoamInfo->FTRoamInfo.preAuthDoneList); #endif #ifdef WLAN_FEATURE_VOWIFI_11R @@ -4667,7 +4996,8 @@ eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac, tANI_U8 sessionId pNeighborRoamInfo->FTRoamInfo.currentNeighborRptRetryNum = 0; csrNeighborRoamPurgePreauthFailedList(pMac); #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD - if (csrRoamIsRoamOffloadScanEnabled(pMac)) + if (!vos_is_multiple_active_sta_sessions() && + csrRoamIsRoamOffloadScanEnabled(pMac)) { /*If this is not a INFRA type BSS, then do not send the command * down to firmware.Do not send the START command for other session @@ -4732,17 +5062,32 @@ eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac, tANI_U8 sessionId } } else #endif - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_CONNECT); + csrRoamOffloadScan(pMac, sessionId, + ROAM_SCAN_OFFLOAD_START, + REASON_CONNECT); } } else { #endif + NEIGHBOR_ROAM_DEBUG(pMac, LOG2, + FL("Registering neighbor lookup DOWN event with TL, RSSI = %d"), + pNeighborRoamInfo->currentNeighborLookupThreshold); + + /* This user context data will be returned with callback */ + pUsrCtx = vos_mem_malloc(sizeof(*pUsrCtx)); + if (NULL == pUsrCtx) { + smsLog(pMac, LOGE, FL("Memory allocation failure")); + return VOS_STATUS_E_NOMEM; + } + pUsrCtx->pMac = pMac; + pUsrCtx->sessionId = sessionId; NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Registering neighbor lookup DOWN event with TL, RSSI = %d"), pNeighborRoamInfo->currentNeighborLookupThreshold); /* Register Neighbor Lookup threshold callback with TL for DOWN event only */ - vstatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1), - WLANTL_HO_THRESHOLD_DOWN, - csrNeighborRoamNeighborLookupDOWNCallback, - VOS_MODULE_ID_SME, pMac); + vstatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, + (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1), + WLANTL_HO_THRESHOLD_DOWN, + csrNeighborRoamNeighborLookupDOWNCallback, + VOS_MODULE_ID_SME, pUsrCtx); #ifdef FEATURE_WLAN_LFR pNeighborRoamInfo->lookupDOWNRssi = 0; #endif @@ -4750,6 +5095,7 @@ eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac, tANI_U8 sessionId { //err msg smsLog(pMac, LOGW, FL(" Couldn't register csrNeighborRoamNeighborLookupDOWNCallback with TL: Status = %d"), vstatus); + vos_mem_free(pUsrCtx); status = eHAL_STATUS_FAILURE; } #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD @@ -4784,15 +5130,19 @@ eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac, tANI_U8 sessionId ---------------------------------------------------------------------------*/ void csrNeighborRoamPurgePreauthFailedList(tpAniSirGlobal pMac) { - tANI_U8 i; - - for (i = 0; i < pMac->roam.neighborRoamInfo.FTRoamInfo.preAuthFailList.numMACAddress; i++) - { - vos_mem_zero(pMac->roam.neighborRoamInfo.FTRoamInfo.preAuthFailList.macAddress[i], sizeof(tSirMacAddr)); + tANI_U8 i, j; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = NULL; + + for (j = 0; j < CSR_ROAM_SESSION_MAX; j++) { + pNeighborRoamInfo = &pMac->roam.neighborRoamInfo[j]; + for (i = 0; + i < pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress; + i++) { + vos_mem_zero(pNeighborRoamInfo->FTRoamInfo.preAuthFailList.macAddress[i], + sizeof(tSirMacAddr)); + } + pNeighborRoamInfo->FTRoamInfo.preAuthFailList.numMACAddress = 0; } - pMac->roam.neighborRoamInfo.FTRoamInfo.preAuthFailList.numMACAddress = 0; - - return; } /* --------------------------------------------------------------------------- @@ -4809,26 +5159,37 @@ void csrNeighborRoamPurgePreauthFailedList(tpAniSirGlobal pMac) eHalStatus csrNeighborRoamInit11rAssocInfo(tpAniSirGlobal pMac) { eHalStatus status; - tpCsr11rAssocNeighborInfo pFTRoamInfo = &pMac->roam.neighborRoamInfo.FTRoamInfo; - - pMac->roam.neighborRoamInfo.is11rAssoc = eANI_BOOLEAN_FALSE; - pMac->roam.neighborRoamInfo.cfgParams.maxNeighborRetries = pMac->roam.configParam.neighborRoamConfig.nMaxNeighborRetries; - pFTRoamInfo->neighborReportTimeout = CSR_NEIGHBOR_ROAM_REPORT_QUERY_TIMEOUT; - pFTRoamInfo->PEPreauthRespTimeout = CSR_NEIGHBOR_ROAM_PREAUTH_RSP_WAIT_MULTIPLIER * pMac->roam.neighborRoamInfo.cfgParams.neighborScanPeriod; - pFTRoamInfo->neighborRptPending = eANI_BOOLEAN_FALSE; - pFTRoamInfo->preauthRspPending = eANI_BOOLEAN_FALSE; - - pMac->roam.neighborRoamInfo.FTRoamInfo.currentNeighborRptRetryNum = 0; - pMac->roam.neighborRoamInfo.FTRoamInfo.numBssFromNeighborReport = 0; - vos_mem_zero(pMac->roam.neighborRoamInfo.FTRoamInfo.neighboReportBssInfo, - sizeof(tCsrNeighborReportBssInfo) * MAX_BSS_IN_NEIGHBOR_RPT); + tANI_U8 i; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = NULL; + tpCsr11rAssocNeighborInfo pFTRoamInfo = NULL; + for (i = 0; i < CSR_ROAM_SESSION_MAX; i++) { + pNeighborRoamInfo = &pMac->roam.neighborRoamInfo[i]; + pFTRoamInfo = &pNeighborRoamInfo->FTRoamInfo; - status = csrLLOpen(pMac->hHdd, &pFTRoamInfo->preAuthDoneList); - if (eHAL_STATUS_SUCCESS != status) - { - smsLog(pMac, LOGE, FL("LL Open of preauth done AP List failed")); - return eHAL_STATUS_RESOURCES; + pNeighborRoamInfo->is11rAssoc = eANI_BOOLEAN_FALSE; + pNeighborRoamInfo->cfgParams.maxNeighborRetries = + pMac->roam.configParam.neighborRoamConfig.nMaxNeighborRetries; + + pFTRoamInfo->neighborReportTimeout = + CSR_NEIGHBOR_ROAM_REPORT_QUERY_TIMEOUT; + pFTRoamInfo->PEPreauthRespTimeout = + CSR_NEIGHBOR_ROAM_PREAUTH_RSP_WAIT_MULTIPLIER * + pNeighborRoamInfo->cfgParams.neighborScanPeriod; + pFTRoamInfo->neighborRptPending = eANI_BOOLEAN_FALSE; + pFTRoamInfo->preauthRspPending = eANI_BOOLEAN_FALSE; + + pFTRoamInfo->currentNeighborRptRetryNum = 0; + pFTRoamInfo->numBssFromNeighborReport = 0; + + vos_mem_zero(pFTRoamInfo->neighboReportBssInfo, + sizeof(tCsrNeighborReportBssInfo) * MAX_BSS_IN_NEIGHBOR_RPT); + + status = csrLLOpen(pMac->hHdd, &pFTRoamInfo->preAuthDoneList); + if (eHAL_STATUS_SUCCESS != status) { + smsLog(pMac, LOGE, FL("LL Open of preauth done AP List failed")); + return eHAL_STATUS_RESOURCES; + } } return status; } @@ -4845,14 +5206,14 @@ eHalStatus csrNeighborRoamInit11rAssocInfo(tpAniSirGlobal pMac) \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise ---------------------------------------------------------------------------*/ -eHalStatus csrNeighborRoamInit(tpAniSirGlobal pMac) +eHalStatus csrNeighborRoamInit(tpAniSirGlobal pMac, tANI_U8 sessionId) { eHalStatus status; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; pNeighborRoamInfo->neighborRoamState = eCSR_NEIGHBOR_ROAM_STATE_CLOSED; pNeighborRoamInfo->prevNeighborRoamState = eCSR_NEIGHBOR_ROAM_STATE_CLOSED; - pNeighborRoamInfo->csrSessionId = CSR_SESSION_ID_INVALID; pNeighborRoamInfo->cfgParams.maxChannelScanTime = pMac->roam.configParam.neighborRoamConfig.nNeighborScanMaxChanTime; pNeighborRoamInfo->cfgParams.minChannelScanTime = pMac->roam.configParam.neighborRoamConfig.nNeighborScanMinChanTime; pNeighborRoamInfo->cfgParams.maxNeighborRetries = 0; @@ -4890,17 +5251,18 @@ eHalStatus csrNeighborRoamInit(tpAniSirGlobal pMac) pMac->roam.configParam.neighborRoamConfig.neighborScanChanList.numChannels); vos_mem_set(pNeighborRoamInfo->currAPbssid, sizeof(tCsrBssid), 0); - pNeighborRoamInfo->currentNeighborLookupThreshold = pMac->roam.neighborRoamInfo.cfgParams.neighborLookupThreshold; + pNeighborRoamInfo->currentNeighborLookupThreshold = + pNeighborRoamInfo->cfgParams.neighborLookupThreshold; pNeighborRoamInfo->currentOpportunisticThresholdDiff = - pMac->roam.neighborRoamInfo.cfgParams.nOpportunisticThresholdDiff; + pNeighborRoamInfo->cfgParams.nOpportunisticThresholdDiff; pNeighborRoamInfo->currentRoamRescanRssiDiff = - pMac->roam.neighborRoamInfo.cfgParams.nRoamRescanRssiDiff; + pNeighborRoamInfo->cfgParams.nRoamRescanRssiDiff; pNeighborRoamInfo->currentRoamBmissFirstBcnt = - pMac->roam.neighborRoamInfo.cfgParams.nRoamBmissFirstBcnt; + pNeighborRoamInfo->cfgParams.nRoamBmissFirstBcnt; pNeighborRoamInfo->currentRoamBmissFinalBcnt = - pMac->roam.neighborRoamInfo.cfgParams.nRoamBmissFinalBcnt; + pNeighborRoamInfo->cfgParams.nRoamBmissFinalBcnt; pNeighborRoamInfo->currentRoamBeaconRssiWeight = - pMac->roam.neighborRoamInfo.cfgParams.nRoamBeaconRssiWeight; + pNeighborRoamInfo->cfgParams.nRoamBeaconRssiWeight; #ifdef FEATURE_WLAN_LFR pNeighborRoamInfo->lookupDOWNRssi = 0; pNeighborRoamInfo->uEmptyScanCount = 0; @@ -4983,7 +5345,7 @@ eHalStatus csrNeighborRoamInit(tpAniSirGlobal pMac) /* Initialize this with the current tick count */ pNeighborRoamInfo->scanRequestTimeStamp = (tANI_TIMESTAMP)palGetTickCount(pMac->hHdd); - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT) + CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT, sessionId) pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; return eHAL_STATUS_SUCCESS; } @@ -4995,13 +5357,14 @@ eHalStatus csrNeighborRoamInit(tpAniSirGlobal pMac) \brief This function closes/frees all the neighbor roam data structures \param pMac - The handle returned by macOpen. - + \param sessionId - Session identifier \return VOID ---------------------------------------------------------------------------*/ -void csrNeighborRoamClose(tpAniSirGlobal pMac) +void csrNeighborRoamClose(tpAniSirGlobal pMac, tANI_U8 sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; if (eCSR_NEIGHBOR_ROAM_STATE_CLOSED == pNeighborRoamInfo->neighborRoamState) { @@ -5042,15 +5405,17 @@ void csrNeighborRoamClose(tpAniSirGlobal pMac) csrRoamFreeConnectProfile(pMac, &pNeighborRoamInfo->prevConnProfile); #endif #ifdef WLAN_FEATURE_VOWIFI_11R - pMac->roam.neighborRoamInfo.FTRoamInfo.currentNeighborRptRetryNum = 0; - pMac->roam.neighborRoamInfo.FTRoamInfo.numBssFromNeighborReport = 0; - vos_mem_zero(pMac->roam.neighborRoamInfo.FTRoamInfo.neighboReportBssInfo, - sizeof(tCsrNeighborReportBssInfo) * MAX_BSS_IN_NEIGHBOR_RPT); - csrNeighborRoamFreeRoamableBSSList(pMac, &pMac->roam.neighborRoamInfo.FTRoamInfo.preAuthDoneList); - csrLLClose(&pMac->roam.neighborRoamInfo.FTRoamInfo.preAuthDoneList); + pNeighborRoamInfo->FTRoamInfo.currentNeighborRptRetryNum = 0; + pNeighborRoamInfo->FTRoamInfo.numBssFromNeighborReport = 0; + vos_mem_zero(pNeighborRoamInfo->FTRoamInfo.neighboReportBssInfo, + sizeof(tCsrNeighborReportBssInfo) * MAX_BSS_IN_NEIGHBOR_RPT); + csrNeighborRoamFreeRoamableBSSList(pMac, + &pNeighborRoamInfo->FTRoamInfo.preAuthDoneList); + csrLLClose(&pNeighborRoamInfo->FTRoamInfo.preAuthDoneList); #endif /* WLAN_FEATURE_VOWIFI_11R */ - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CLOSED) + CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CLOSED, + sessionId) return; } @@ -5068,13 +5433,13 @@ void csrNeighborRoamClose(tpAniSirGlobal pMac) \return VOID ---------------------------------------------------------------------------*/ -void csrNeighborRoamRequestHandoff(tpAniSirGlobal pMac) +void csrNeighborRoamRequestHandoff(tpAniSirGlobal pMac, tANI_U8 sessionId) { - tCsrRoamInfo roamInfo; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; - tANI_U32 sessionId = pNeighborRoamInfo->csrSessionId; - tCsrNeighborRoamBSSInfo handoffNode; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; + tCsrNeighborRoamBSSInfo handoffNode; + extern void csrRoamRoamingStateDisassocRspProcessor( tpAniSirGlobal pMac, tSirSmeDisassocRsp *pSmeDisassocRsp ); tANI_U32 roamId = 0; @@ -5084,23 +5449,24 @@ void csrNeighborRoamRequestHandoff(tpAniSirGlobal pMac) VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG,"%s sessionId=%d", __func__, sessionId); - if (pMac->roam.neighborRoamInfo.neighborRoamState != eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE) - { + if (pNeighborRoamInfo->neighborRoamState != + eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE) { smsLog(pMac, LOGE, FL("Roam requested when Neighbor roam is in %s state"), macTraceGetNeighbourRoamState( - pMac->roam.neighborRoamInfo.neighborRoamState)); + pNeighborRoamInfo->neighborRoamState)); return; } vos_mem_zero(&roamInfo, sizeof(tCsrRoamInfo)); - csrRoamCallCallback(pMac, pNeighborRoamInfo->csrSessionId, &roamInfo, roamId, eCSR_ROAM_FT_START, - eSIR_SME_SUCCESS); + csrRoamCallCallback(pMac, sessionId, &roamInfo, roamId, eCSR_ROAM_FT_START, + eSIR_SME_SUCCESS); vos_mem_zero(&roamInfo, sizeof(tCsrRoamInfo)); - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING) + CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING, + sessionId) - csrNeighborRoamGetHandoffAPInfo(pMac, &handoffNode); + csrNeighborRoamGetHandoffAPInfo(pMac, &handoffNode, sessionId); VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, FL("HANDOFF CANDIDATE BSSID "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(handoffNode.pBssDescription->bssId)); @@ -5117,8 +5483,8 @@ void csrNeighborRoamRequestHandoff(tpAniSirGlobal pMac) { vos_mem_copy((void *)roamInfoMetrics->bssid, (void *)&handoffNode.pBssDescription->bssId, sizeof(tCsrBssid)); - csrRoamCallCallback(pMac, pNeighborRoamInfo->csrSessionId, - roamInfoMetrics, 0, eCSR_ROAM_HANDOVER_SUCCESS, 0); + csrRoamCallCallback(pMac, sessionId, roamInfoMetrics, 0, + eCSR_ROAM_HANDOVER_SUCCESS, 0); vos_mem_free(pRoamInfo); } #endif @@ -5127,7 +5493,8 @@ void csrNeighborRoamRequestHandoff(tpAniSirGlobal pMac) csrReleaseProfile(pMac, &pNeighborRoamInfo->csrNeighborRoamProfile); /* Create the Handoff AP profile. Copy the currently connected profile and update only the BSSID and channel number This should happen before issuing disconnect */ - csrRoamCopyConnectedProfile(pMac, pNeighborRoamInfo->csrSessionId, &pNeighborRoamInfo->csrNeighborRoamProfile); + csrRoamCopyConnectedProfile(pMac, sessionId, + &pNeighborRoamInfo->csrNeighborRoamProfile); vos_mem_copy(pNeighborRoamInfo->csrNeighborRoamProfile.BSSIDs.bssid, handoffNode.pBssDescription->bssId, sizeof(tSirMacAddr)); pNeighborRoamInfo->csrNeighborRoamProfile.ChannelInfo.ChannelList[0] = handoffNode.pBssDescription->channelId; @@ -5146,8 +5513,8 @@ void csrNeighborRoamRequestHandoff(tpAniSirGlobal pMac) handoffNode.pBssDescription->bssId, sizeof( tCsrBssid )); - csrRoamCallCallback(pMac, sessionId, &roamInfo, 0, eCSR_ROAM_ROAMING_START, eCSR_ROAM_RESULT_NONE); - + csrRoamCallCallback(pMac, sessionId, &roamInfo, 0, + eCSR_ROAM_ROAMING_START, eCSR_ROAM_RESULT_NONE); return; } @@ -5165,9 +5532,11 @@ void csrNeighborRoamRequestHandoff(tpAniSirGlobal pMac) \return eANI_BOOLEAN_TRUE if reassoc in progress, eANI_BOOLEAN_FALSE otherwise ---------------------------------------------------------------------------*/ -tANI_BOOLEAN csrNeighborRoamIsHandoffInProgress(tpAniSirGlobal pMac) +tANI_BOOLEAN csrNeighborRoamIsHandoffInProgress(tpAniSirGlobal pMac, + tANI_U8 sessionId) { - if (eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING == pMac->roam.neighborRoamInfo.neighborRoamState) + if (eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING == + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState) return eANI_BOOLEAN_TRUE; return eANI_BOOLEAN_FALSE; @@ -5185,9 +5554,9 @@ tANI_BOOLEAN csrNeighborRoamIsHandoffInProgress(tpAniSirGlobal pMac) \return eANI_BOOLEAN_TRUE if current assoc is 11r, eANI_BOOLEAN_FALSE otherwise ---------------------------------------------------------------------------*/ -tANI_BOOLEAN csrNeighborRoamIs11rAssoc(tpAniSirGlobal pMac) +tANI_BOOLEAN csrNeighborRoamIs11rAssoc(tpAniSirGlobal pMac, tANI_U8 sessionId) { - return pMac->roam.neighborRoamInfo.is11rAssoc; + return pMac->roam.neighborRoamInfo[sessionId].is11rAssoc; } #endif /* WLAN_FEATURE_VOWIFI_11R */ @@ -5206,9 +5575,12 @@ tANI_BOOLEAN csrNeighborRoamIs11rAssoc(tpAniSirGlobal pMac) \return VOID ---------------------------------------------------------------------------*/ -void csrNeighborRoamGetHandoffAPInfo(tpAniSirGlobal pMac, tpCsrNeighborRoamBSSInfo pHandoffNode) +void csrNeighborRoamGetHandoffAPInfo(tpAniSirGlobal pMac, + tpCsrNeighborRoamBSSInfo pHandoffNode, + tANI_U8 sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; tpCsrNeighborRoamBSSInfo pBssNode; if (NULL == pHandoffNode) @@ -5220,7 +5592,8 @@ void csrNeighborRoamGetHandoffAPInfo(tpAniSirGlobal pMac, tpCsrNeighborRoamBSSIn if (pNeighborRoamInfo->is11rAssoc) { /* Always the BSS info in the head is the handoff candidate */ - pBssNode = csrNeighborRoamGetRoamableAPListNextEntry(pMac, &pNeighborRoamInfo->FTRoamInfo.preAuthDoneList, NULL); + pBssNode = csrNeighborRoamGetRoamableAPListNextEntry(pMac, + &pNeighborRoamInfo->FTRoamInfo.preAuthDoneList, NULL); NEIGHBOR_ROAM_DEBUG(pMac, LOG1, FL("Number of Handoff candidates = %d"), csrLLCount(&pNeighborRoamInfo->FTRoamInfo.preAuthDoneList)); } else @@ -5235,7 +5608,7 @@ void csrNeighborRoamGetHandoffAPInfo(tpAniSirGlobal pMac, tpCsrNeighborRoamBSSIn else #endif #ifdef FEATURE_WLAN_LFR - if (csrRoamIsFastRoamEnabled(pMac, CSR_SESSION_ID_INVALID)) + if (csrRoamIsFastRoamEnabled(pMac, sessionId)) { /* Always the BSS info in the head is the handoff candidate */ pBssNode = csrNeighborRoamGetRoamableAPListNextEntry(pMac, &pNeighborRoamInfo->FTRoamInfo.preAuthDoneList, NULL); @@ -5260,9 +5633,10 @@ void csrNeighborRoamGetHandoffAPInfo(tpAniSirGlobal pMac, tpCsrNeighborRoamBSSIn \return boolean ---------------------------------------------------------------------------*/ -tANI_BOOLEAN csrNeighborRoamStatePreauthDone(tpAniSirGlobal pMac) +tANI_BOOLEAN csrNeighborRoamStatePreauthDone(tpAniSirGlobal pMac, + tANI_U8 sessionId) { - return (pMac->roam.neighborRoamInfo.neighborRoamState == + return (pMac->roam.neighborRoamInfo[sessionId].neighborRoamState == eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE); } @@ -5279,17 +5653,28 @@ tANI_BOOLEAN csrNeighborRoamStatePreauthDone(tpAniSirGlobal pMac) \return boolean ---------------------------------------------------------------------------*/ -void csrNeighborRoamTranistionPreauthDoneToDisconnected(tpAniSirGlobal pMac) +void csrNeighborRoamTranistionPreauthDoneToDisconnected(tpAniSirGlobal pMac, + tANI_U8 sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; - if (pMac->roam.neighborRoamInfo.neighborRoamState != + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; + tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId); + + if (!pSession) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, + FL("pSession is NULL")); + return; + } + + if (pNeighborRoamInfo->neighborRoamState != eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE) return; // Stop timer - vos_timer_stop(&pMac->ft.ftSmeContext.preAuthReassocIntvlTimer); + vos_timer_stop(&pSession->ftSmeContext.preAuthReassocIntvlTimer); // Transition to init state - CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT) + CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_INIT, sessionId) pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived = eANI_BOOLEAN_FALSE; } @@ -5302,28 +5687,37 @@ void csrNeighborRoamTranistionPreauthDoneToDisconnected(tpAniSirGlobal pMac) \return boolean ---------------------------------------------------------------------------*/ -tANI_BOOLEAN csrNeighborRoamScanRspPending (tHalHandle hHal) +tANI_BOOLEAN csrNeighborRoamScanRspPending(tHalHandle hHal, + tANI_U8 sessionId) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - return (pMac->roam.neighborRoamInfo.scanRspPending); + return (pMac->roam.neighborRoamInfo[sessionId].scanRspPending); } /* --------------------------------------------------------------------------- \brief This function returns TRUE if STA is in the middle of roaming states \param halHandle - The handle from HDD context. + \param sessionId - Session identifier \return boolean ---------------------------------------------------------------------------*/ -tANI_BOOLEAN csrNeighborMiddleOfRoaming (tHalHandle hHal) +tANI_BOOLEAN csrNeighborMiddleOfRoaming(tHalHandle hHal, tANI_U8 sessionId) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - tANI_BOOLEAN val = (eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING == pMac->roam.neighborRoamInfo.neighborRoamState) || - (eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING == pMac->roam.neighborRoamInfo.neighborRoamState) || - (eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE == pMac->roam.neighborRoamInfo.neighborRoamState) || - (eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN == pMac->roam.neighborRoamInfo.neighborRoamState) || - (eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN == pMac->roam.neighborRoamInfo.neighborRoamState); + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; + tANI_BOOLEAN val = (eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING == + pNeighborRoamInfo->neighborRoamState) || + (eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING == + pNeighborRoamInfo->neighborRoamState) || + (eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE == + pNeighborRoamInfo->neighborRoamState) || + (eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN == + pNeighborRoamInfo->neighborRoamState) || + (eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN == + pNeighborRoamInfo->neighborRoamState); return (val); } #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD @@ -5342,7 +5736,11 @@ tANI_BOOLEAN csrNeighborMiddleOfRoaming (tHalHandle hHal) ---------------------------------------------------------------------------*/ eHalStatus csrNeighborRoamCandidateFoundIndHdlr(tpAniSirGlobal pMac, void* pMsg) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tSirSmeCandidateFoundInd *pSirSmeCandidateFoundInd = + (tSirSmeCandidateFoundInd *)pMsg; + tANI_U32 sessionId = pSirSmeCandidateFoundInd->sessionId; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; eHalStatus status = eHAL_STATUS_SUCCESS; /* we must be in connected state, if not ignore it */ if ((eCSR_NEIGHBOR_ROAM_STATE_CONNECTED != pNeighborRoamInfo->neighborRoamState) @@ -5356,12 +5754,13 @@ eHalStatus csrNeighborRoamCandidateFoundIndHdlr(tpAniSirGlobal pMac, void* pMsg) /* We are about to start a fresh scan cycle, * purge non-P2P results from the past */ csrScanFlushSelectiveResult(pMac, VOS_FALSE); - /* Once it gets the candidates found indication from PE, will issue a scan - - req to PE with “freshScan” in scanreq structure set as follows: - 0x42 - Return & purge LFR scan results - */ - status = csrScanRequestLfrResult(pMac, pNeighborRoamInfo->csrSessionId, - csrNeighborRoamScanResultRequestCallback, pMac); + /* Once it gets the candidates found indication from PE, will issue + * a scan req to PE with “freshScan” in scanreq structure set + * as follows: 0x42 - Return & purge LFR scan results + */ + status = csrScanRequestLfrResult(pMac, sessionId, + csrNeighborRoamScanResultRequestCallback, + pMac); } return status; @@ -5379,13 +5778,15 @@ eHalStatus csrNeighborRoamCandidateFoundIndHdlr(tpAniSirGlobal pMac, void* pMsg) \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise ---------------------------------------------------------------------------*/ -eHalStatus csrNeighborRoamProcessHandoffReq(tpAniSirGlobal pMac) +eHalStatus csrNeighborRoamProcessHandoffReq(tpAniSirGlobal pMac, + tANI_U8 sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; eHalStatus status = eHAL_STATUS_SUCCESS; tANI_U32 roamId; tCsrRoamProfile *pProfile = NULL; - tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, pNeighborRoamInfo->csrSessionId ); + tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId); tANI_U8 i = 0; if (NULL == pSession) @@ -5442,10 +5843,8 @@ eHalStatus csrNeighborRoamProcessHandoffReq(tpAniSirGlobal pMac) } pProfile->ChannelInfo.ChannelList[0] = pNeighborRoamInfo->handoffReqInfo.channel; - //clean up csr cache first - //csrScanFlushSelectiveResult(pMac, VOS_FALSE); //do a SSID scan - status = csrScanForSSID(pMac, pNeighborRoamInfo->csrSessionId, pProfile, roamId, FALSE); + status = csrScanForSSID(pMac, sessionId, pProfile, roamId, FALSE); if(!HAL_STATUS_SUCCESS(status)) { smsLog(pMac, LOGE, FL("SSID scan failed")); @@ -5474,10 +5873,13 @@ eHalStatus csrNeighborRoamProcessHandoffReq(tpAniSirGlobal pMac) \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise ---------------------------------------------------------------------------*/ -eHalStatus csrNeighborRoamSssidScanDone(tpAniSirGlobal pMac, eHalStatus status) +eHalStatus csrNeighborRoamSssidScanDone(tpAniSirGlobal pMac, + tANI_U8 sessionId, + eHalStatus status) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; - eHalStatus hstatus; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; + eHalStatus hstatus; smsLog(pMac, LOGE, FL("called ")); @@ -5492,9 +5894,9 @@ eHalStatus csrNeighborRoamSssidScanDone(tpAniSirGlobal pMac, eHalStatus status) if(!HAL_STATUS_SUCCESS(status)) { smsLog(pMac, LOGE, FL("Add an entry to csr scan cache")); - hstatus = csrScanCreateEntryInScanCache(pMac, pNeighborRoamInfo->csrSessionId, - pNeighborRoamInfo->handoffReqInfo.bssid, - pNeighborRoamInfo->handoffReqInfo.channel); + hstatus = csrScanCreateEntryInScanCache(pMac, sessionId, + pNeighborRoamInfo->handoffReqInfo.bssid, + pNeighborRoamInfo->handoffReqInfo.channel); if (eHAL_STATUS_SUCCESS != hstatus) { smsLog(pMac, LOGE, FL("csrScanCreateEntryInScanCache failed with status %d"), hstatus); @@ -5503,7 +5905,7 @@ eHalStatus csrNeighborRoamSssidScanDone(tpAniSirGlobal pMac, eHalStatus status) } /* Now we have completed scanning for the candidate provided by HDD. Let move on to HO*/ - hstatus = csrNeighborRoamProcessScanComplete(pMac); + hstatus = csrNeighborRoamProcessScanComplete(pMac, sessionId); if (eHAL_STATUS_SUCCESS != hstatus) { @@ -5528,8 +5930,10 @@ eHalStatus csrNeighborRoamSssidScanDone(tpAniSirGlobal pMac, eHalStatus status) ---------------------------------------------------------------------------*/ eHalStatus csrNeighborRoamHandoffReqHdlr(tpAniSirGlobal pMac, void* pMsg) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; - tAniHandoffReq *pHandoffReqInfo; + tAniHandoffReq *pHandoffReqInfo = (tAniHandoffReq *)pMsg; + tANI_U32 sessionId = pHandoffReqInfo->sessionId; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; eHalStatus status = eHAL_STATUS_SUCCESS; /* we must be in connected state, if not ignore it */ if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED != pNeighborRoamInfo->neighborRoamState) @@ -5557,7 +5961,8 @@ eHalStatus csrNeighborRoamHandoffReqHdlr(tpAniSirGlobal pMac, void* pMsg) pHandoffReqInfo->bssid, 6); pNeighborRoamInfo->uOsRequestedHandoff = 1; - status = csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_STOP, + status = csrRoamOffloadScan(pMac, sessionId, + ROAM_SCAN_OFFLOAD_STOP, REASON_OS_REQUESTED_ROAMING_NOW); if (eHAL_STATUS_SUCCESS != status) { @@ -5593,9 +5998,11 @@ eHalStatus csrNeighborRoamHandoffReqHdlr(tpAniSirGlobal pMac, void* pMsg) \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise ---------------------------------------------------------------------------*/ -eHalStatus csrNeighborRoamProceedWithHandoffReq(tpAniSirGlobal pMac) +eHalStatus csrNeighborRoamProceedWithHandoffReq(tpAniSirGlobal pMac, + tANI_U8 sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; eHalStatus status = eHAL_STATUS_SUCCESS; /* we must be in connected state, if not ignore it */ if ((eCSR_NEIGHBOR_ROAM_STATE_CONNECTED != pNeighborRoamInfo->neighborRoamState) @@ -5607,7 +6014,7 @@ eHalStatus csrNeighborRoamProceedWithHandoffReq(tpAniSirGlobal pMac) else { //Let's go ahead with handoff - status = csrNeighborRoamProcessHandoffReq(pMac); + status = csrNeighborRoamProcessHandoffReq(pMac, sessionId); } if(!HAL_STATUS_SUCCESS(status)) { @@ -5629,13 +6036,15 @@ eHalStatus csrNeighborRoamProceedWithHandoffReq(tpAniSirGlobal pMac) \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise ---------------------------------------------------------------------------*/ -eHalStatus csrNeighborRoamStartLfrScan(tpAniSirGlobal pMac) +eHalStatus csrNeighborRoamStartLfrScan(tpAniSirGlobal pMac, tANI_U8 sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; pNeighborRoamInfo->uOsRequestedHandoff = 0; /* There is no candidate or We are not roaming Now. * Inform the FW to restart Roam Offload Scan */ - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_NO_CAND_FOUND_OR_NOT_ROAMING_NOW); + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_START, + REASON_NO_CAND_FOUND_OR_NOT_ROAMING_NOW); return eHAL_STATUS_SUCCESS; } diff --git a/CORE/SME/src/rrm/sme_rrm.c b/CORE/SME/src/rrm/sme_rrm.c index 8a3912b89a33..83e52761939d 100644 --- a/CORE/SME/src/rrm/sme_rrm.c +++ b/CORE/SME/src/rrm/sme_rrm.c @@ -634,8 +634,11 @@ static eHalStatus sme_RrmSendScanResult( tpAniSirGlobal pMac, --------------------------------------------------------------------------*/ -static eHalStatus sme_RrmScanRequestCallback(tHalHandle halHandle, void *pContext, - tANI_U32 scanId, eCsrScanStatus status) +static eHalStatus sme_RrmScanRequestCallback(tHalHandle halHandle, + void *pContext, + tANI_U8 sessionId, + tANI_U32 scanId, + eCsrScanStatus status) { tANI_U16 interval; @@ -1038,6 +1041,9 @@ static void rrmCalculateNeighborAPRoamScore(tpAniSirGlobal pMac, tpRrmNeighborRe { tpSirNeighborBssDescripton pNeighborBssDesc; tANI_U32 roamScore = 0; +#ifdef FEATURE_WLAN_ESE + tANI_U8 sessionId; +#endif if (NULL == pNeighborReportDesc) { @@ -1081,13 +1087,14 @@ static void rrmCalculateNeighborAPRoamScore(tpAniSirGlobal pMac, tpRrmNeighborRe } } #ifdef FEATURE_WLAN_ESE - // It has come in the report so its the best score - if (csrNeighborRoamIs11rAssoc(pMac) == FALSE) - { - // IAPP Route so lets make use of this info - // save all AP, as the list does not come all the time - // Save and reuse till the next AP List comes to us. - // Even save our own MAC address. Will be useful next time around. + sessionId = pNeighborReportDesc->sessionId; + /* It has come in the report so its the best score */ + if (csrNeighborRoamIs11rAssoc(pMac, sessionId) == FALSE) { + /* IAPP Route so lets make use of this info + * save all AP, as the list does not come all the time + * Save and reuse till the next AP List comes to us. + * Even save our own MAC address. Will be useful next time around. + */ roamScore += RRM_ROAM_SCORE_NEIGHBOR_IAPP_LIST; } #endif @@ -1173,15 +1180,20 @@ eHalStatus sme_RrmProcessNeighborReport(tpAniSirGlobal pMac, void *pMsgBuf) tpRrmNeighborReportDesc pNeighborReportDesc; tANI_U8 i = 0; VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + tANI_U8 sessionId; + /* Get the session id */ + status = csrRoamGetSessionIdFromBSSID(pMac, (tCsrBssid *)pNeighborRpt->bssId, + (tANI_U32*) &sessionId); + if (HAL_STATUS_SUCCESS(status)) { #ifdef FEATURE_WLAN_ESE - // Clear the cache for ESE. - if (csrNeighborRoamIsESEAssoc(pMac)) - { - rrmLLPurgeNeighborCache(pMac, + /* Clear the cache for ESE. */ + if (csrNeighborRoamIsESEAssoc(pMac, sessionId)) { + rrmLLPurgeNeighborCache(pMac, &pMac->rrm.rrmSmeContext.neighborReportCache); - } + } #endif + } for (i = 0; i < pNeighborRpt->numNeighborReports; i++) { diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index fb6f3e902f8c..676b3ebb26a7 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -1325,9 +1325,6 @@ eHalStatus sme_Open(tHalHandle hHal) } #endif -#if defined WLAN_FEATURE_VOWIFI_11R - sme_FTOpen(pMac); -#endif sme_p2pOpen(pMac); smeTraceInit(pMac); @@ -2143,6 +2140,7 @@ eHalStatus sme_TsmIeInd(tHalHandle hHal, tSirSmeTsmIEInd *pSmeTsmIeInd) \brief function to store the CCKM IE passed from supplicant and use it while packing reassociation request \param hHal - HAL handle for device + \param sessionId - Session Identifier \param pCckmIe - pointer to CCKM IE data \param pCckmIeLen - length of the CCKM IE \- return Success or failure @@ -2605,7 +2603,8 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD case eWNI_SME_ROAM_SCAN_OFFLOAD_RSP: - status = csrRoamOffloadScanRspHdlr((void *)pMac, pMsg->bodyval); + status = csrRoamOffloadScanRspHdlr((void *)pMac, pMsg->bodyptr); + vos_mem_free(pMsg->bodyptr); break; #endif // WLAN_FEATURE_ROAM_SCAN_OFFLOAD @@ -2903,6 +2902,7 @@ eHalStatus sme_Close(tHalHandle hHal) eHalStatus fail_status = eHAL_STATUS_SUCCESS; tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + /* Note: pSession will be invalid from here on, do not access */ status = csrClose(pMac); if ( ! HAL_STATUS_SUCCESS( status ) ) { smsLog( pMac, LOGE, "csrClose failed during sme close with status=%d", @@ -2977,9 +2977,6 @@ eHalStatus sme_Close(tHalHandle hHal) } #endif -#if defined WLAN_FEATURE_VOWIFI_11R - sme_FTClose(hHal); -#endif sme_p2pClose(hHal); freeSmeCmdList(pMac); @@ -3036,6 +3033,8 @@ eHalStatus sme_ScanRequest(tHalHandle hHal, tANI_U8 sessionId, tCsrScanRequest * { eHalStatus status = eHAL_STATUS_FAILURE; tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; MTRACE(vos_trace(VOS_MODULE_ID_SME, TRACE_CODE_SME_RX_HDD_MSG_SCAN_REQ, sessionId, pscanReq->scanType)); smsLog(pMac, LOG2, FL("enter")); @@ -3064,7 +3063,7 @@ eHalStatus sme_ScanRequest(tHalHandle hHal, tANI_U8 sessionId, tCsrScanRequest * { smsLog(pMac, LOGE, FL("Scan denied in state %s (sub-state %d)"), macTraceGetNeighbourRoamState( - pMac->roam.neighborRoamInfo.neighborRoamState), + pNeighborRoamInfo->neighborRoamState), pMac->roam.curSubState[sessionId]); /*HandOff is in progress. So schedule this scan later*/ status = eHAL_STATUS_RESOURCES; @@ -3135,7 +3134,7 @@ eHalStatus sme_ScanFlushResult(tHalHandle hHal, tANI_U8 sessionId) status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { - status = csrScanFlushResult( hHal ); + status = csrScanFlushResult(hHal, sessionId); sme_ReleaseGlobalLock( &pMac->sme ); } @@ -6881,16 +6880,20 @@ eHalStatus sme_sendBTAmpEvent(tHalHandle hHal, tSmeBtAmpEvent btAmpEvent) \param hHal - The handle returned by macOpen. \param bssid - Pointer to the BSSID to roam to. \param fastRoamTrig - Trigger to Scan or roam + \param sessionId - Session Identifier \return eHalStatus ---------------------------------------------------------------------------*/ -eHalStatus smeIssueFastRoamNeighborAPEvent (tHalHandle hHal, - tANI_U8 *bssid, - tSmeFastRoamTrigger fastRoamTrig) +eHalStatus smeIssueFastRoamNeighborAPEvent(tHalHandle hHal, + tANI_U8 *bssid, + tSmeFastRoamTrigger fastRoamTrig, + tANI_U8 sessionId) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; eHalStatus status = eHAL_STATUS_SUCCESS; + tFTRoamCallbackUsrCtx *pUsrCtx; status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) @@ -6907,7 +6910,7 @@ eHalStatus smeIssueFastRoamNeighborAPEvent (tHalHandle hHal, smsLog(pMac, LOG1, "Calling Roam Look Up down Event BSSID " MAC_ADDRESS_STR, MAC_ADDR_ARRAY(pNeighborRoamInfo->cfgRoambssId)); - vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac); + vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac, sessionId); if (VOS_STATUS_SUCCESS != vosStatus) { smsLog(pMac, LOGE, @@ -6923,10 +6926,19 @@ eHalStatus smeIssueFastRoamNeighborAPEvent (tHalHandle hHal, smsLog(pMac, LOG1, "Roam to BSSID "MAC_ADDRESS_STR, MAC_ADDR_ARRAY(pNeighborRoamInfo->cfgRoambssId)); - vosStatus = csrNeighborRoamReassocIndCallback(pMac->roam.gVosContext, - 0, - pMac, - 0); + pUsrCtx = vos_mem_malloc(sizeof(*pUsrCtx)); + if (NULL == pUsrCtx) { + smsLog(pMac, LOGE, FL("Memory allocation failed")); + return eHAL_STATUS_FAILED_ALLOC; + } + + /* Populate user context */ + pUsrCtx->pMac = pMac; + pUsrCtx->sessionId = sessionId; + + vosStatus = csrNeighborRoamReassocIndCallback( + pMac->roam.gVosContext, + 0, pUsrCtx, 0); if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { @@ -6944,6 +6956,7 @@ eHalStatus smeIssueFastRoamNeighborAPEvent (tHalHandle hHal, \fn sme_SetHostOffload \brief API to set the host offload feature. \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier \param pRequest - Pointer to the offload request. \return eHalStatus ---------------------------------------------------------------------------*/ @@ -8706,10 +8719,11 @@ tANI_BOOLEAN sme_IsChannelValid(tHalHandle hHal, tANI_U8 channel) \fn sme_SetFreqBand \brief Used to set frequency band. \param hHal + \param sessionId - Session Identifier \eBand band value to be configured \- return eHalStatus -------------------------------------------------------------------------*/ -eHalStatus sme_SetFreqBand(tHalHandle hHal, eCsrBand eBand) +eHalStatus sme_SetFreqBand(tHalHandle hHal, tANI_U8 sessionId, eCsrBand eBand) { eHalStatus status = eHAL_STATUS_FAILURE; tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); @@ -8717,7 +8731,7 @@ eHalStatus sme_SetFreqBand(tHalHandle hHal, eCsrBand eBand) status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { - status = csrSetBand(hHal, eBand); + status = csrSetBand(hHal, sessionId, eBand); sme_ReleaseGlobalLock( &pMac->sme ); } return status; @@ -9245,10 +9259,12 @@ eHalStatus sme_setRoamIntraBand(tHalHandle hHal, const v_BOOL_t nRoamIntraBand) This function is called through dynamic setConfig callback function to update roam scan N probes \param hHal - HAL handle for device + \param sessionId - Session Identifier \param nProbes number of probe requests to be sent out \- return Success or failure -------------------------------------------------------------------------*/ -eHalStatus sme_UpdateRoamScanNProbes(tHalHandle hHal, const v_U8_t nProbes) +eHalStatus sme_UpdateRoamScanNProbes(tHalHandle hHal, tANI_U8 sessionId, + const v_U8_t nProbes) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_SUCCESS; @@ -9268,7 +9284,7 @@ eHalStatus sme_UpdateRoamScanNProbes(tHalHandle hHal, const v_U8_t nProbes) #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_NPROBES_CHANGED); } #endif @@ -9281,12 +9297,15 @@ eHalStatus sme_UpdateRoamScanNProbes(tHalHandle hHal, const v_U8_t nProbes) This function is called through dynamic setConfig callback function to update roam scan home away time \param hHal - HAL handle for device + \param sessionId - Session Identifier \param nRoamScanAwayTime Scan home away time \param bSendOffloadCmd If TRUE then send offload command to firmware If FALSE then command is not sent to firmware \- return Success or failure -------------------------------------------------------------------------*/ -eHalStatus sme_UpdateRoamScanHomeAwayTime(tHalHandle hHal, const v_U16_t nRoamScanHomeAwayTime, +eHalStatus sme_UpdateRoamScanHomeAwayTime(tHalHandle hHal, + tANI_U8 sessionId, + const v_U16_t nRoamScanHomeAwayTime, const eAniBoolean bSendOffloadCmd) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); @@ -9308,7 +9327,7 @@ eHalStatus sme_UpdateRoamScanHomeAwayTime(tHalHandle hHal, const v_U16_t nRoamSc #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled && bSendOffloadCmd) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_HOME_AWAY_TIME_CHANGED); } #endif @@ -9364,10 +9383,13 @@ v_U16_t sme_getRoamScanHomeAwayTime(tHalHandle hHal) \param hHal - HAL handle for device \param nImmediateRoamRssiDiff - minimum rssi difference between potential candidate and current AP. + \param sessionId - Session Identifier \- return Success or failure -------------------------------------------------------------------------*/ -eHalStatus sme_UpdateImmediateRoamRssiDiff(tHalHandle hHal, v_U8_t nImmediateRoamRssiDiff) +eHalStatus sme_UpdateImmediateRoamRssiDiff(tHalHandle hHal, + v_U8_t nImmediateRoamRssiDiff, + tANI_U8 sessionId) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_SUCCESS; @@ -9382,7 +9404,7 @@ eHalStatus sme_UpdateImmediateRoamRssiDiff(tHalHandle hHal, v_U8_t nImmediateRoa nImmediateRoamRssiDiff, pMac->roam.configParam.nImmediateRoamRssiDiff, macTraceGetNeighbourRoamState( - pMac->roam.neighborRoamInfo.neighborRoamState)); + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState)); pMac->roam.configParam.nImmediateRoamRssiDiff = nImmediateRoamRssiDiff; sme_ReleaseGlobalLock( &pMac->sme ); } @@ -9397,12 +9419,14 @@ eHalStatus sme_UpdateImmediateRoamRssiDiff(tHalHandle hHal, v_U8_t nImmediateRoa to configure RoamRssiDiff Usage: adb shell iwpriv wlan0 setConfig RoamRssiDiff=[0 .. 125] \param hHal - HAL handle for device + \param sessionId - Session Identifier \param RoamRssiDiff - minimum rssi difference between potential candidate and current AP. \- return Success or failure -------------------------------------------------------------------------*/ -eHalStatus sme_UpdateRoamRssiDiff(tHalHandle hHal, v_U8_t RoamRssiDiff) +eHalStatus sme_UpdateRoamRssiDiff(tHalHandle hHal, tANI_U8 sessionId, + v_U8_t RoamRssiDiff) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_SUCCESS; @@ -9415,14 +9439,15 @@ eHalStatus sme_UpdateRoamRssiDiff(tHalHandle hHal, v_U8_t RoamRssiDiff) RoamRssiDiff, pMac->roam.configParam.RoamRssiDiff, macTraceGetNeighbourRoamState( - pMac->roam.neighborRoamInfo.neighborRoamState)); + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState)); pMac->roam.configParam.RoamRssiDiff = RoamRssiDiff; sme_ReleaseGlobalLock( &pMac->sme ); } #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_RSSI_DIFF_CHANGED); + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_RSSI_DIFF_CHANGED); } #endif return status ; @@ -9466,11 +9491,14 @@ eHalStatus sme_UpdateFastTransitionEnabled(tHalHandle hHal, This function is called through dynamic setConfig callback function to configure isWESModeEnabled \param hHal - HAL handle for device + \param isWESModeEnabled - WES mode + \param sessionId - Session Identifier \return eHAL_STATUS_SUCCESS - SME update isWESModeEnabled config successfully. Other status means SME is failed to update isWESModeEnabled. -------------------------------------------------------------------------*/ -eHalStatus sme_UpdateWESMode(tHalHandle hHal, v_BOOL_t isWESModeEnabled) +eHalStatus sme_UpdateWESMode(tHalHandle hHal, v_BOOL_t isWESModeEnabled, + tANI_U8 sessionId) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_SUCCESS; @@ -9483,7 +9511,7 @@ eHalStatus sme_UpdateWESMode(tHalHandle hHal, v_BOOL_t isWESModeEnabled) isWESModeEnabled, pMac->roam.configParam.isWESModeEnabled, macTraceGetNeighbourRoamState( - pMac->roam.neighborRoamInfo.neighborRoamState)); + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState)); pMac->roam.configParam.isWESModeEnabled = isWESModeEnabled; sme_ReleaseGlobalLock( &pMac->sme ); } @@ -9498,10 +9526,12 @@ eHalStatus sme_UpdateWESMode(tHalHandle hHal, v_BOOL_t isWESModeEnabled) if roam scan control is set to 0, roaming scan cache is cleared any value other than 0 is treated as invalid value \param hHal - HAL handle for device + \param sessionId - Session Identifier \return eHAL_STATUS_SUCCESS - SME update config successfully. Other status means SME failure to update -------------------------------------------------------------------------*/ -eHalStatus sme_SetRoamScanControl(tHalHandle hHal, v_BOOL_t roamScanControl) +eHalStatus sme_SetRoamScanControl(tHalHandle hHal, tANI_U8 sessionId, + v_BOOL_t roamScanControl) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_SUCCESS; @@ -9516,17 +9546,19 @@ eHalStatus sme_SetRoamScanControl(tHalHandle hHal, v_BOOL_t roamScanControl) roamScanControl, pMac->roam.configParam.nRoamScanControl, macTraceGetNeighbourRoamState( - pMac->roam.neighborRoamInfo.neighborRoamState)); + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState)); pMac->roam.configParam.nRoamScanControl = roamScanControl; if ( 0 == roamScanControl) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, "LFR runtime successfully cleared roam scan cache"); - csrFlushCfgBgScanRoamChannelList(pMac); + csrFlushCfgBgScanRoamChannelList(pMac, sessionId); #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_FLUSH_CHANNEL_LIST); + csrRoamOffloadScan(pMac, sessionId, + ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_FLUSH_CHANNEL_LIST); } #endif } @@ -9543,30 +9575,37 @@ eHalStatus sme_SetRoamScanControl(tHalHandle hHal, v_BOOL_t roamScanControl) isFastRoamIniFeatureEnabled. This is a synchronous call \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier \return eHAL_STATUS_SUCCESS - SME update isFastRoamIniFeatureEnabled config successfully. Other status means SME is failed to update isFastRoamIniFeatureEnabled. \sa --------------------------------------------------------------------------*/ -eHalStatus sme_UpdateIsFastRoamIniFeatureEnabled(tHalHandle hHal, - const v_BOOL_t isFastRoamIniFeatureEnabled) +eHalStatus sme_UpdateIsFastRoamIniFeatureEnabled +( + tHalHandle hHal, + tANI_U8 sessionId, + const v_BOOL_t isFastRoamIniFeatureEnabled) { - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - if (pMac->roam.configParam.isFastRoamIniFeatureEnabled == isFastRoamIniFeatureEnabled) - { + if (pMac->roam.configParam.isFastRoamIniFeatureEnabled == + isFastRoamIniFeatureEnabled) + { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: FastRoam is already enabled or disabled, nothing to do (returning) old(%d) new(%d)", __func__, - pMac->roam.configParam.isFastRoamIniFeatureEnabled, - isFastRoamIniFeatureEnabled); - return eHAL_STATUS_SUCCESS; - } + pMac->roam.configParam.isFastRoamIniFeatureEnabled, + isFastRoamIniFeatureEnabled); + return eHAL_STATUS_SUCCESS; + } VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: FastRoamEnabled is changed from %d to %d", __func__, - pMac->roam.configParam.isFastRoamIniFeatureEnabled, - isFastRoamIniFeatureEnabled); - pMac->roam.configParam.isFastRoamIniFeatureEnabled = isFastRoamIniFeatureEnabled; - csrNeighborRoamUpdateFastRoamingEnabled(pMac, isFastRoamIniFeatureEnabled); + pMac->roam.configParam.isFastRoamIniFeatureEnabled, + isFastRoamIniFeatureEnabled); + pMac->roam.configParam.isFastRoamIniFeatureEnabled = + isFastRoamIniFeatureEnabled; + csrNeighborRoamUpdateFastRoamingEnabled(pMac, sessionId, + isFastRoamIniFeatureEnabled); return eHAL_STATUS_SUCCESS; } @@ -9605,6 +9644,54 @@ eHalStatus sme_UpdateIsMAWCIniFeatureEnabled(tHalHandle hHal, #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD /*-------------------------------------------------------------------------- + \brief sme_stopRoaming() - Stop roaming for a given sessionId + This is a synchronous call + \param hHal - The handle returned by macOpen + \param sessionId - Session Identifier + \return eHAL_STATUS_SUCCESS on success + Other status on failure + \sa + --------------------------------------------------------------------------*/ +eHalStatus sme_stopRoaming(tHalHandle hHal, + tANI_U8 sessionId, + tANI_U8 reason) +{ + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + eHalStatus status = eHAL_STATUS_SUCCESS; + + if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_STOP, reason); + sme_ReleaseGlobalLock(&pMac->sme); + } + + return status; +} + +/*-------------------------------------------------------------------------- + \brief sme_startRoaming() - Start roaming for a given sessionId + This is a synchronous call + \param hHal - The handle returned by macOpen + \param sessionId - Session Identifier + \return eHAL_STATUS_SUCCESS on success + Other status on failure + \sa + --------------------------------------------------------------------------*/ +eHalStatus sme_startRoaming(tHalHandle hHal, + tANI_U8 sessionId, + tANI_U8 reason) +{ + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + eHalStatus status = eHAL_STATUS_SUCCESS; + + if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_START, reason); + sme_ReleaseGlobalLock(&pMac->sme); + } + + return status; +} + +/*-------------------------------------------------------------------------- \brief sme_UpdateEnableFastRoamInConcurrency() - enable/disable LFR if Concurrent session exists This is a synchronuous call \param hHal - The handle returned by macOpen. @@ -9643,44 +9730,49 @@ eHalStatus sme_UpdateEnableFastRoamInConcurrency(tHalHandle hHal, isEseIniFeatureEnabled. This is a synchronous call \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier + \param isEseIniFeatureEnabled - flag to enable/disable \return eHAL_STATUS_SUCCESS - SME update isEseIniFeatureEnabled config successfully. Other status means SME is failed to update isEseIniFeatureEnabled. \sa --------------------------------------------------------------------------*/ - -eHalStatus sme_UpdateIsEseFeatureEnabled(tHalHandle hHal, - const v_BOOL_t isEseIniFeatureEnabled) +eHalStatus sme_UpdateIsEseFeatureEnabled +( + tHalHandle hHal, + tANI_U8 sessionId, + const v_BOOL_t isEseIniFeatureEnabled) { - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - if (pMac->roam.configParam.isEseIniFeatureEnabled == isEseIniFeatureEnabled) - { + if (pMac->roam.configParam.isEseIniFeatureEnabled == isEseIniFeatureEnabled) + { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: ESE Mode is already enabled or disabled, nothing to do (returning) old(%d) new(%d)", __func__, - pMac->roam.configParam.isEseIniFeatureEnabled, - isEseIniFeatureEnabled); - return eHAL_STATUS_SUCCESS; - } + pMac->roam.configParam.isEseIniFeatureEnabled, + isEseIniFeatureEnabled); + return eHAL_STATUS_SUCCESS; + } VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: EseEnabled is changed from %d to %d", __func__, - pMac->roam.configParam.isEseIniFeatureEnabled, - isEseIniFeatureEnabled); - pMac->roam.configParam.isEseIniFeatureEnabled = isEseIniFeatureEnabled; - csrNeighborRoamUpdateEseModeEnabled(pMac, isEseIniFeatureEnabled); + pMac->roam.configParam.isEseIniFeatureEnabled, + isEseIniFeatureEnabled); + pMac->roam.configParam.isEseIniFeatureEnabled = isEseIniFeatureEnabled; + csrNeighborRoamUpdateEseModeEnabled(pMac, isEseIniFeatureEnabled); - if(TRUE == isEseIniFeatureEnabled) - { - sme_UpdateFastTransitionEnabled(hHal, TRUE); - } + if (TRUE == isEseIniFeatureEnabled) + { + sme_UpdateFastTransitionEnabled(hHal, TRUE); + } #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_ESE_INI_CFG_CHANGED); + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_ESE_INI_CFG_CHANGED); } #endif - return eHAL_STATUS_SUCCESS; + return eHAL_STATUS_SUCCESS; } #endif /* FEATURE_WLAN_ESE */ @@ -9718,12 +9810,14 @@ eHalStatus sme_UpdateConfigFwRssiMonitoring(tHalHandle hHal, This function is called through dynamic setConfig callback function to configure nOpportunisticThresholdDiff \param hHal - HAL handle for device + \param sessionId - Session Identifier \param nOpportunisticThresholdDiff - Opportunistic Scan threshold diff \return eHAL_STATUS_SUCCESS - SME update nOpportunisticThresholdDiff config successfully. else SME is failed to update nOpportunisticThresholdDiff. -------------------------------------------------------------------------*/ eHalStatus sme_SetRoamOpportunisticScanThresholdDiff(tHalHandle hHal, + tANI_U8 sessionId, const v_U8_t nOpportunisticThresholdDiff) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); @@ -9733,6 +9827,7 @@ eHalStatus sme_SetRoamOpportunisticScanThresholdDiff(tHalHandle hHal, if ( HAL_STATUS_SUCCESS( status ) ) { status = csrNeighborRoamSetOpportunisticScanThresholdDiff(pMac, + sessionId, nOpportunisticThresholdDiff); if (HAL_STATUS_SUCCESS(status)) { @@ -9742,7 +9837,7 @@ eHalStatus sme_SetRoamOpportunisticScanThresholdDiff(tHalHandle hHal, " - old value is %d - roam state is %d", nOpportunisticThresholdDiff, pMac->roam.configParam.neighborRoamConfig.nOpportunisticThresholdDiff, - pMac->roam.neighborRoamInfo.neighborRoamState); + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState); pMac->roam.configParam.neighborRoamConfig.nOpportunisticThresholdDiff = nOpportunisticThresholdDiff; } sme_ReleaseGlobalLock( &pMac->sme ); @@ -9770,12 +9865,14 @@ v_U8_t sme_GetRoamOpportunisticScanThresholdDiff(tHalHandle hHal) This function is called through dynamic setConfig callback function to configure nRoamRescanRssiDiff \param hHal - HAL handle for device + \param sessionId - Session Identifier \param nRoamRescanRssiDiff - roam rescan rssi diff \return eHAL_STATUS_SUCCESS - SME update nRoamRescanRssiDiff config successfully. else SME is failed to update nRoamRescanRssiDiff. -------------------------------------------------------------------------*/ eHalStatus sme_SetRoamRescanRssiDiff(tHalHandle hHal, + tANI_U8 sessionId, const v_U8_t nRoamRescanRssiDiff) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); @@ -9784,7 +9881,7 @@ eHalStatus sme_SetRoamRescanRssiDiff(tHalHandle hHal, status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { - status = csrNeighborRoamSetRoamRescanRssiDiff(pMac, + status = csrNeighborRoamSetRoamRescanRssiDiff(pMac, sessionId, nRoamRescanRssiDiff); if (HAL_STATUS_SUCCESS(status)) { @@ -9794,7 +9891,7 @@ eHalStatus sme_SetRoamRescanRssiDiff(tHalHandle hHal, " - old value is %d - roam state is %d", nRoamRescanRssiDiff, pMac->roam.configParam.neighborRoamConfig.nRoamRescanRssiDiff, - pMac->roam.neighborRoamInfo.neighborRoamState); + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState); pMac->roam.configParam.neighborRoamConfig.nRoamRescanRssiDiff = nRoamRescanRssiDiff; } @@ -9823,12 +9920,14 @@ v_U8_t sme_GetRoamRescanRssiDiff(tHalHandle hHal) This function is called through dynamic setConfig callback function to configure nRoamBmissFirstBcnt \param hHal - HAL handle for device + \param sessionId - Session Identifier \param nRoamBmissFirstBcnt - Roam first bmiss count \return eHAL_STATUS_SUCCESS - SME update nRoamBmissFirstBcnt successfully. else SME is failed to update nRoamBmissFirstBcnt -------------------------------------------------------------------------*/ eHalStatus sme_SetRoamBmissFirstBcnt(tHalHandle hHal, + tANI_U8 sessionId, const v_U8_t nRoamBmissFirstBcnt) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); @@ -9837,7 +9936,8 @@ eHalStatus sme_SetRoamBmissFirstBcnt(tHalHandle hHal, status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { - status = csrNeighborRoamSetRoamBmissFirstBcnt(pMac, nRoamBmissFirstBcnt); + status = csrNeighborRoamSetRoamBmissFirstBcnt(pMac, sessionId, + nRoamBmissFirstBcnt); if (HAL_STATUS_SUCCESS(status)) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, @@ -9846,7 +9946,7 @@ eHalStatus sme_SetRoamBmissFirstBcnt(tHalHandle hHal, " - old value is %d - roam state is %d", nRoamBmissFirstBcnt, pMac->roam.configParam.neighborRoamConfig.nRoamBmissFirstBcnt, - pMac->roam.neighborRoamInfo.neighborRoamState); + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState); pMac->roam.configParam.neighborRoamConfig.nRoamBmissFirstBcnt = nRoamBmissFirstBcnt; } @@ -9856,10 +9956,10 @@ eHalStatus sme_SetRoamBmissFirstBcnt(tHalHandle hHal, } /* --------------------------------------------------------------------------- - \fn sme_getNeighborScanPeriod - \brief get neighbor scan period + \fn sme_GetRoamBmissFirstBcnt + \brief get neighbor roam beacon miss first count \param hHal - The handle returned by macOpen. - \return v_U16_t - neighbor scan period + \return v_U8_t - neighbor roam beacon miss first count -------------------------------------------------------------------------*/ v_U8_t sme_GetRoamBmissFirstBcnt(tHalHandle hHal) { @@ -9873,12 +9973,14 @@ v_U8_t sme_GetRoamBmissFirstBcnt(tHalHandle hHal) This function is called through dynamic setConfig callback function to configure nRoamBmissFinalBcnt \param hHal - HAL handle for device + \param sessionId - Session Identifier \param nRoamBmissFinalBcnt - Roam final bmiss count \return eHAL_STATUS_SUCCESS - SME update nRoamBmissFinalBcnt successfully. else SME is failed to update nRoamBmissFinalBcnt -------------------------------------------------------------------------*/ eHalStatus sme_SetRoamBmissFinalBcnt(tHalHandle hHal, + tANI_U8 sessionId, const v_U8_t nRoamBmissFinalBcnt) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); @@ -9887,7 +9989,8 @@ eHalStatus sme_SetRoamBmissFinalBcnt(tHalHandle hHal, status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { - status = csrNeighborRoamSetRoamBmissFinalBcnt(pMac, nRoamBmissFinalBcnt); + status = csrNeighborRoamSetRoamBmissFinalBcnt(pMac, sessionId, + nRoamBmissFinalBcnt); if (HAL_STATUS_SUCCESS(status)) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, @@ -9896,7 +9999,7 @@ eHalStatus sme_SetRoamBmissFinalBcnt(tHalHandle hHal, " - old value is %d - roam state is %d", nRoamBmissFinalBcnt, pMac->roam.configParam.neighborRoamConfig.nRoamBmissFinalBcnt, - pMac->roam.neighborRoamInfo.neighborRoamState); + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState); pMac->roam.configParam.neighborRoamConfig.nRoamBmissFinalBcnt = nRoamBmissFinalBcnt; } @@ -9925,12 +10028,14 @@ v_U8_t sme_GetRoamBmissFinalBcnt(tHalHandle hHal) This function is called through dynamic setConfig callback function to configure nRoamBeaconRssiWeight \param hHal - HAL handle for device + \param sessionId - Session Identifier \param nRoamBeaconRssiWeight - Roam beacon rssi weight \return eHAL_STATUS_SUCCESS - SME update nRoamBeaconRssiWeight config successfully. else SME is failed to update nRoamBeaconRssiWeight -------------------------------------------------------------------------*/ eHalStatus sme_SetRoamBeaconRssiWeight(tHalHandle hHal, + tANI_U8 sessionId, const v_U8_t nRoamBeaconRssiWeight) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); @@ -9939,7 +10044,8 @@ eHalStatus sme_SetRoamBeaconRssiWeight(tHalHandle hHal, status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { - status = csrNeighborRoamSetRoamBeaconRssiWeight(pMac, nRoamBeaconRssiWeight); + status = csrNeighborRoamSetRoamBeaconRssiWeight(pMac, sessionId, + nRoamBeaconRssiWeight); if (HAL_STATUS_SUCCESS(status)) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, @@ -9948,7 +10054,7 @@ eHalStatus sme_SetRoamBeaconRssiWeight(tHalHandle hHal, " - old value is %d - roam state is %d", nRoamBeaconRssiWeight, pMac->roam.configParam.neighborRoamConfig.nRoamBeaconRssiWeight, - pMac->roam.neighborRoamInfo.neighborRoamState); + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState); pMac->roam.configParam.neighborRoamConfig.nRoamBeaconRssiWeight = nRoamBeaconRssiWeight; } @@ -9974,20 +10080,25 @@ v_U8_t sme_GetRoamBeaconRssiWeight(tHalHandle hHal) \brief sme_setNeighborLookupRssiThreshold() - update neighbor lookup rssi threshold This is a synchronous call \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier \return eHAL_STATUS_SUCCESS - SME update config successful. Other status means SME is failed to update \sa --------------------------------------------------------------------------*/ -eHalStatus sme_setNeighborLookupRssiThreshold(tHalHandle hHal, - v_U8_t neighborLookupRssiThreshold) +eHalStatus sme_setNeighborLookupRssiThreshold +( + tHalHandle hHal, + tANI_U8 sessionId, + v_U8_t neighborLookupRssiThreshold) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_SUCCESS; status = sme_AcquireGlobalLock( &pMac->sme ); - if ( HAL_STATUS_SUCCESS( status ) ) + if (HAL_STATUS_SUCCESS(status)) { - status = csrNeighborRoamSetLookupRssiThreshold(pMac, neighborLookupRssiThreshold); + status = csrNeighborRoamSetLookupRssiThreshold(pMac, sessionId, + neighborLookupRssiThreshold); if (HAL_STATUS_SUCCESS(status)) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, @@ -9995,7 +10106,7 @@ eHalStatus sme_setNeighborLookupRssiThreshold(tHalHandle hHal, neighborLookupRssiThreshold, pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold, macTraceGetNeighbourRoamState( - pMac->roam.neighborRoamInfo.neighborRoamState)); + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState)); pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold = neighborLookupRssiThreshold; } @@ -10008,28 +10119,36 @@ eHalStatus sme_setNeighborLookupRssiThreshold(tHalHandle hHal, \brief sme_setNeighborReassocRssiThreshold() - update neighbor reassoc rssi threshold This is a synchronous call \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier \return eHAL_STATUS_SUCCESS - SME update config successful. Other status means SME is failed to update \sa --------------------------------------------------------------------------*/ -eHalStatus sme_setNeighborReassocRssiThreshold(tHalHandle hHal, - v_U8_t neighborReassocRssiThreshold) +eHalStatus sme_setNeighborReassocRssiThreshold +( + tHalHandle hHal, + tANI_U8 sessionId, + v_U8_t neighborReassocRssiThreshold) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_SUCCESS; + tCsrNeighborRoamConfig *pNeighborRoamConfig = NULL; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = NULL; status = sme_AcquireGlobalLock( &pMac->sme ); - if ( HAL_STATUS_SUCCESS( status ) ) + if (HAL_STATUS_SUCCESS(status)) { + pNeighborRoamConfig = &pMac->roam.configParam.neighborRoamConfig; + pNeighborRoamInfo = &pMac->roam.neighborRoamInfo[sessionId]; VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, "LFR runtime successfully set Reassoc threshold to %d- old value is %d - roam state is %s", neighborReassocRssiThreshold, pMac->roam.configParam.neighborRoamConfig.nNeighborReassocRssiThreshold, macTraceGetNeighbourRoamState( - pMac->roam.neighborRoamInfo.neighborRoamState)); - pMac->roam.configParam.neighborRoamConfig.nNeighborReassocRssiThreshold = + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState)); + pNeighborRoamConfig->nNeighborReassocRssiThreshold = neighborReassocRssiThreshold; - pMac->roam.neighborRoamInfo.cfgParams.neighborReassocThreshold = + pNeighborRoamInfo->cfgParams.neighborReassocThreshold = neighborReassocRssiThreshold; sme_ReleaseGlobalLock( &pMac->sme ); } @@ -10056,28 +10175,36 @@ v_U8_t sme_getNeighborLookupRssiThreshold(tHalHandle hHal) \brief sme_setNeighborScanRefreshPeriod() - set neighbor scan results refresh period This is a synchronous call \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier \return eHAL_STATUS_SUCCESS - SME update config successful. Other status means SME is failed to update \sa --------------------------------------------------------------------------*/ -eHalStatus sme_setNeighborScanRefreshPeriod(tHalHandle hHal, - v_U16_t neighborScanResultsRefreshPeriod) +eHalStatus sme_setNeighborScanRefreshPeriod +( + tHalHandle hHal, + tANI_U8 sessionId, + v_U16_t neighborScanResultsRefreshPeriod) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_SUCCESS; + tCsrNeighborRoamConfig *pNeighborRoamConfig = NULL; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = NULL; status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { + pNeighborRoamConfig = &pMac->roam.configParam.neighborRoamConfig; + pNeighborRoamInfo = &pMac->roam.neighborRoamInfo[sessionId]; VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, "LFR runtime successfully set roam scan refresh period to %d- old value is %d - roam state is %s", neighborScanResultsRefreshPeriod, pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod, macTraceGetNeighbourRoamState( - pMac->roam.neighborRoamInfo.neighborRoamState)); - pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod = + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState)); + pNeighborRoamConfig->nNeighborResultsRefreshPeriod = neighborScanResultsRefreshPeriod; - pMac->roam.neighborRoamInfo.cfgParams.neighborResultsRefreshPeriod = + pNeighborRoamInfo->cfgParams.neighborResultsRefreshPeriod = neighborScanResultsRefreshPeriod; sme_ReleaseGlobalLock( &pMac->sme ); @@ -10086,7 +10213,7 @@ eHalStatus sme_setNeighborScanRefreshPeriod(tHalHandle hHal, #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_NEIGHBOR_SCAN_REFRESH_PERIOD_CHANGED); } #endif @@ -10115,11 +10242,12 @@ eHalStatus sme_UpdateRoamScanOffloadEnabled(tHalHandle hHal, if ( HAL_STATUS_SUCCESS( status ) ) { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, - "%s: gRoamScanOffloadEnabled is changed from %d to %d", __func__, - pMac->roam.configParam.isRoamOffloadScanEnabled, - nRoamScanOffloadEnabled); - pMac->roam.configParam.isRoamOffloadScanEnabled = nRoamScanOffloadEnabled; - sme_ReleaseGlobalLock( &pMac->sme ); + FL("gRoamScanOffloadEnabled is changed from %d to %d"), + pMac->roam.configParam.isRoamOffloadScanEnabled, + nRoamScanOffloadEnabled); + pMac->roam.configParam.isRoamOffloadScanEnabled = + nRoamScanOffloadEnabled; + sme_ReleaseGlobalLock(&pMac->sme); } return status ; @@ -10160,33 +10288,40 @@ v_U16_t sme_getEmptyScanRefreshPeriod(tHalHandle hHal) to configure nEmptyScanRefreshPeriod Usage: adb shell iwpriv wlan0 setConfig nEmptyScanRefreshPeriod=[0 .. 60] \param hHal - HAL handle for device + \param sessionId - Session Identifier \param nEmptyScanRefreshPeriod - scan period following empty scan results. \- return Success or failure -------------------------------------------------------------------------*/ -eHalStatus sme_UpdateEmptyScanRefreshPeriod(tHalHandle hHal, v_U16_t nEmptyScanRefreshPeriod) +eHalStatus sme_UpdateEmptyScanRefreshPeriod(tHalHandle hHal, tANI_U8 sessionId, + v_U16_t nEmptyScanRefreshPeriod) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_SUCCESS; + tCsrNeighborRoamConfig *pNeighborRoamConfig = NULL; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = NULL; status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { + pNeighborRoamConfig = &pMac->roam.configParam.neighborRoamConfig; + pNeighborRoamInfo = &pMac->roam.neighborRoamInfo[sessionId]; VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, "LFR runtime successfully set roam scan period to %d -old value is %d - roam state is %s", nEmptyScanRefreshPeriod, pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod, macTraceGetNeighbourRoamState( - pMac->roam.neighborRoamInfo.neighborRoamState)); - pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod = nEmptyScanRefreshPeriod; - pMac->roam.neighborRoamInfo.cfgParams.emptyScanRefreshPeriod = nEmptyScanRefreshPeriod; + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState)); + pNeighborRoamConfig->nEmptyScanRefreshPeriod = nEmptyScanRefreshPeriod; + pNeighborRoamInfo->cfgParams.emptyScanRefreshPeriod = + nEmptyScanRefreshPeriod; sme_ReleaseGlobalLock( &pMac->sme ); } #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_EMPTY_SCAN_REF_PERIOD_CHANGED); } #endif @@ -10201,9 +10336,12 @@ eHalStatus sme_UpdateEmptyScanRefreshPeriod(tHalHandle hHal, v_U16_t nEmptyScanR Usage: adb shell iwpriv wlan0 setConfig gNeighborScanChannelMinTime=[0 .. 60] \param hHal - HAL handle for device \param nNeighborScanMinChanTime - Channel minimum dwell time + \param sessionId - Session Identifier \- return Success or failure -------------------------------------------------------------------------*/ -eHalStatus sme_setNeighborScanMinChanTime(tHalHandle hHal, const v_U16_t nNeighborScanMinChanTime) +eHalStatus sme_setNeighborScanMinChanTime(tHalHandle hHal, + const v_U16_t nNeighborScanMinChanTime, + tANI_U8 sessionId) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_SUCCESS; @@ -10216,9 +10354,12 @@ eHalStatus sme_setNeighborScanMinChanTime(tHalHandle hHal, const v_U16_t nNeighb nNeighborScanMinChanTime, pMac->roam.configParam.neighborRoamConfig.nNeighborScanMinChanTime, macTraceGetNeighbourRoamState( - pMac->roam.neighborRoamInfo.neighborRoamState)); - pMac->roam.configParam.neighborRoamConfig.nNeighborScanMinChanTime = nNeighborScanMinChanTime; - pMac->roam.neighborRoamInfo.cfgParams.minChannelScanTime = nNeighborScanMinChanTime; + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState)); + + pMac->roam.configParam.neighborRoamConfig.nNeighborScanMinChanTime = + nNeighborScanMinChanTime; + pMac->roam.neighborRoamInfo[sessionId].cfgParams.minChannelScanTime = + nNeighborScanMinChanTime; sme_ReleaseGlobalLock( &pMac->sme ); } @@ -10232,31 +10373,39 @@ eHalStatus sme_setNeighborScanMinChanTime(tHalHandle hHal, const v_U16_t nNeighb to configure gNeighborScanChannelMaxTime Usage: adb shell iwpriv wlan0 setConfig gNeighborScanChannelMaxTime=[0 .. 60] \param hHal - HAL handle for device + \param sessionId - Session Identifier \param nNeighborScanMinChanTime - Channel maximum dwell time \- return Success or failure -------------------------------------------------------------------------*/ -eHalStatus sme_setNeighborScanMaxChanTime(tHalHandle hHal, const v_U16_t nNeighborScanMaxChanTime) +eHalStatus sme_setNeighborScanMaxChanTime(tHalHandle hHal, tANI_U8 sessionId, + const v_U16_t nNeighborScanMaxChanTime) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_SUCCESS; + tCsrNeighborRoamConfig *pNeighborRoamConfig = NULL; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = NULL; status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { + pNeighborRoamConfig = &pMac->roam.configParam.neighborRoamConfig; + pNeighborRoamInfo = &pMac->roam.neighborRoamInfo[sessionId]; VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, "LFR runtime successfully set channel max dwell time to %d - old value is %d - roam state is %s", nNeighborScanMaxChanTime, pMac->roam.configParam.neighborRoamConfig.nNeighborScanMaxChanTime, macTraceGetNeighbourRoamState( - pMac->roam.neighborRoamInfo.neighborRoamState)); - pMac->roam.configParam.neighborRoamConfig.nNeighborScanMaxChanTime = nNeighborScanMaxChanTime; - pMac->roam.neighborRoamInfo.cfgParams.maxChannelScanTime = nNeighborScanMaxChanTime; + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState)); + pNeighborRoamConfig->nNeighborScanMaxChanTime = + nNeighborScanMaxChanTime; + pNeighborRoamInfo->cfgParams.maxChannelScanTime = + nNeighborScanMaxChanTime; sme_ReleaseGlobalLock( &pMac->sme ); } #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_SCAN_CH_TIME_CHANGED); } #endif @@ -10268,24 +10417,129 @@ eHalStatus sme_setNeighborScanMaxChanTime(tHalHandle hHal, const v_U16_t nNeighb \fn sme_getNeighborScanMinChanTime \brief get neighbor scan min channel time \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier \return v_U16_t - channel min time value -------------------------------------------------------------------------*/ -v_U16_t sme_getNeighborScanMinChanTime(tHalHandle hHal) +v_U16_t sme_getNeighborScanMinChanTime(tHalHandle hHal, tANI_U8 sessionId) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - return pMac->roam.neighborRoamInfo.cfgParams.minChannelScanTime; + return pMac->roam.neighborRoamInfo[sessionId].cfgParams.minChannelScanTime; } /* --------------------------------------------------------------------------- + \fn sme_getNeighborRoamState + \brief get neighbor roam state + \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier + \return v_U32_t - neighbor roam state + -------------------------------------------------------------------------*/ +v_U32_t sme_getNeighborRoamState(tHalHandle hHal, tANI_U8 sessionId) +{ + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + return pMac->roam.neighborRoamInfo[sessionId].neighborRoamState; +} + +/* --------------------------------------------------------------------------- + \fn sme_getCurrentRoamState + \brief get current roam state + \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier + \return v_U32_t - current roam state + -------------------------------------------------------------------------*/ +v_U32_t sme_getCurrentRoamState(tHalHandle hHal, tANI_U8 sessionId) +{ + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + return pMac->roam.curState[sessionId]; +} + +/* --------------------------------------------------------------------------- + \fn sme_getCurrentRoamSubState + \brief get neighbor roam sub state + \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier + \return v_U32_t - current roam sub state + -------------------------------------------------------------------------*/ +v_U32_t sme_getCurrentRoamSubState(tHalHandle hHal, tANI_U8 sessionId) +{ + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + return pMac->roam.curSubState[sessionId]; +} + +/* --------------------------------------------------------------------------- + \fn sme_getLimSmeState + \brief get Lim Sme state + \param hHal - The handle returned by macOpen. + \return v_U32_t - Lim Sme state + -------------------------------------------------------------------------*/ +v_U32_t sme_getLimSmeState(tHalHandle hHal) +{ + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + return pMac->lim.gLimSmeState; +} + +/* --------------------------------------------------------------------------- + \fn sme_getLimMlmState + \brief get Lim Mlm state + \param hHal - The handle returned by macOpen. + \return v_U32_t - Lim Mlm state + -------------------------------------------------------------------------*/ +v_U32_t sme_getLimMlmState(tHalHandle hHal) +{ + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + return pMac->lim.gLimMlmState; +} + +/* --------------------------------------------------------------------------- + \fn sme_IsLimSessionValid + \brief is Lim session valid + \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier + \return v_BOOL_t - true or false + -------------------------------------------------------------------------*/ +v_BOOL_t sme_IsLimSessionValid(tHalHandle hHal, tANI_U8 sessionId) +{ + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + return pMac->lim.gpSession[sessionId].valid; +} + +/* --------------------------------------------------------------------------- + \fn sme_getLimSmeSessionState + \brief get Lim Sme session state + \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier + \return v_U32_t - Lim Sme session state + -------------------------------------------------------------------------*/ +v_U32_t sme_getLimSmeSessionState(tHalHandle hHal, tANI_U8 sessionId) +{ + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + return pMac->lim.gpSession[sessionId].limSmeState; +} + +/* --------------------------------------------------------------------------- + \fn sme_getLimMlmSessionState + \brief get Lim Mlm session state + \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier + \return v_U32_t - Lim Mlm session state + -------------------------------------------------------------------------*/ +v_U32_t sme_getLimMlmSessionState(tHalHandle hHal, tANI_U8 sessionId) +{ + tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + return pMac->lim.gpSession[sessionId].limMlmState; +} + + +/* --------------------------------------------------------------------------- \fn sme_getNeighborScanMaxChanTime \brief get neighbor scan max channel time \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier \return v_U16_t - channel max time value -------------------------------------------------------------------------*/ -v_U16_t sme_getNeighborScanMaxChanTime(tHalHandle hHal) +v_U16_t sme_getNeighborScanMaxChanTime(tHalHandle hHal, tANI_U8 sessionId) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - return pMac->roam.neighborRoamInfo.cfgParams.maxChannelScanTime; + return pMac->roam.neighborRoamInfo[sessionId].cfgParams.maxChannelScanTime; } /* --------------------------------------------------------------------------- @@ -10295,32 +10549,38 @@ v_U16_t sme_getNeighborScanMaxChanTime(tHalHandle hHal) to configure nNeighborScanPeriod Usage: adb shell iwpriv wlan0 setConfig nNeighborScanPeriod=[0 .. 1000] \param hHal - HAL handle for device + \param sessionId - Session Identifier \param nNeighborScanPeriod - neighbor scan period \- return Success or failure -------------------------------------------------------------------------*/ -eHalStatus sme_setNeighborScanPeriod(tHalHandle hHal, const v_U16_t nNeighborScanPeriod) +eHalStatus sme_setNeighborScanPeriod(tHalHandle hHal, tANI_U8 sessionId, + const v_U16_t nNeighborScanPeriod) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_SUCCESS; + tCsrNeighborRoamConfig *pNeighborRoamConfig = NULL; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = NULL; status = sme_AcquireGlobalLock( &pMac->sme ); if ( HAL_STATUS_SUCCESS( status ) ) { + pNeighborRoamConfig = &pMac->roam.configParam.neighborRoamConfig; + pNeighborRoamInfo = &pMac->roam.neighborRoamInfo[sessionId]; VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, "LFR runtime successfully set neighbor scan period to %d" " - old value is %d - roam state is %s", nNeighborScanPeriod, pMac->roam.configParam.neighborRoamConfig.nNeighborScanTimerPeriod, macTraceGetNeighbourRoamState( - pMac->roam.neighborRoamInfo.neighborRoamState)); - pMac->roam.configParam.neighborRoamConfig.nNeighborScanTimerPeriod = nNeighborScanPeriod; - pMac->roam.neighborRoamInfo.cfgParams.neighborScanPeriod = nNeighborScanPeriod; + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState)); + pNeighborRoamConfig->nNeighborScanTimerPeriod = nNeighborScanPeriod; + pNeighborRoamInfo->cfgParams.neighborScanPeriod = nNeighborScanPeriod; sme_ReleaseGlobalLock( &pMac->sme ); } #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_SCAN_HOME_TIME_CHANGED); } #endif @@ -10332,12 +10592,13 @@ eHalStatus sme_setNeighborScanPeriod(tHalHandle hHal, const v_U16_t nNeighborSca \fn sme_getNeighborScanPeriod \brief get neighbor scan period \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier \return v_U16_t - neighbor scan period -------------------------------------------------------------------------*/ -v_U16_t sme_getNeighborScanPeriod(tHalHandle hHal) +v_U16_t sme_getNeighborScanPeriod(tHalHandle hHal, tANI_U8 sessionId) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - return pMac->roam.neighborRoamInfo.cfgParams.neighborScanPeriod; + return pMac->roam.neighborRoamInfo[sessionId].cfgParams.neighborScanPeriod; } #endif @@ -10361,16 +10622,21 @@ v_U8_t sme_getRoamRssiDiff(tHalHandle hHal) \brief sme_ChangeRoamScanChannelList() - Change roam scan channel list This is a synchronous call \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier + \param pChannelList - Output channel list + \param numChannels - Output number of channels \return eHAL_STATUS_SUCCESS - SME update config successful. Other status means SME is failed to update \sa --------------------------------------------------------------------------*/ -eHalStatus sme_ChangeRoamScanChannelList(tHalHandle hHal, tANI_U8 *pChannelList, +eHalStatus sme_ChangeRoamScanChannelList(tHalHandle hHal, tANI_U8 sessionId, + tANI_U8 *pChannelList, tANI_U8 numChannels) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_SUCCESS; - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; tANI_U8 oldChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; tANI_U8 newChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; tANI_U8 i = 0, j = 0; @@ -10393,9 +10659,10 @@ eHalStatus sme_ChangeRoamScanChannelList(tHalHandle hHal, tANI_U8 *pChannelList, } } } - csrFlushCfgBgScanRoamChannelList(pMac); - csrCreateBgScanRoamChannelList(pMac, pChannelList, numChannels); - sme_SetRoamScanControl(hHal, 1); + csrFlushCfgBgScanRoamChannelList(pMac, sessionId); + csrCreateBgScanRoamChannelList(pMac, sessionId, pChannelList, + numChannels); + sme_SetRoamScanControl(hHal, sessionId, 1); if (NULL != pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) { j = 0; @@ -10415,13 +10682,15 @@ eHalStatus sme_ChangeRoamScanChannelList(tHalHandle hHal, tANI_U8 *pChannelList, VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, "LFR runtime successfully set roam scan channels to %s - old value is %s - roam state is %d", newChannelList, oldChannelList, - pMac->roam.neighborRoamInfo.neighborRoamState); + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState); sme_ReleaseGlobalLock( &pMac->sme ); } #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CHANNEL_LIST_CHANGED); + csrRoamOffloadScan(pMac, sessionId, + ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_CHANNEL_LIST_CHANGED); } #endif @@ -10433,18 +10702,22 @@ eHalStatus sme_ChangeRoamScanChannelList(tHalHandle hHal, tANI_U8 *pChannelList, \brief sme_SetEseRoamScanChannelList() - set ese roam scan channel list This is a synchronuous call \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier + \param pChannelList - Input channel list + \param numChannels - Input number of channels \return eHAL_STATUS_SUCCESS - SME update config successful. Other status means SME is failed to update \sa --------------------------------------------------------------------------*/ eHalStatus sme_SetEseRoamScanChannelList(tHalHandle hHal, + tANI_U8 sessionId, tANI_U8 *pChannelList, tANI_U8 numChannels) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_SUCCESS; tpCsrNeighborRoamControlInfo pNeighborRoamInfo - = &pMac->roam.neighborRoamInfo; + = &pMac->roam.neighborRoamInfo[sessionId]; tpCsrChannelInfo currChannelListInfo = &pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo; tANI_U8 oldChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; @@ -10463,7 +10736,7 @@ eHalStatus sme_SetEseRoamScanChannelList(tHalHandle hHal, currChannelListInfo->ChannelList[i]); } } - status = csrCreateRoamScanChannelList(pMac, pChannelList, + status = csrCreateRoamScanChannelList(pMac, sessionId, pChannelList, numChannels, csrGetCurrentBand(hHal)); if ( HAL_STATUS_SUCCESS( status )) { @@ -10482,14 +10755,14 @@ eHalStatus sme_SetEseRoamScanChannelList(tHalHandle hHal, "ESE roam scan channel list successfully set to \ %s - old value is %s - roam state is %d", newChannelList, oldChannelList, - pMac->roam.neighborRoamInfo.neighborRoamState); + pNeighborRoamInfo->neighborRoamState); } sme_ReleaseGlobalLock( &pMac->sme ); } #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CHANNEL_LIST_CHANGED); } #endif @@ -10501,17 +10774,21 @@ eHalStatus sme_SetEseRoamScanChannelList(tHalHandle hHal, \brief sme_getRoamScanChannelList() - get roam scan channel list This is a synchronous call \param hHal - The handle returned by macOpen. + \param pChannelList - Output channel list + \param numChannels - Output number of channels + \param sessionId - Session Identifier \return eHAL_STATUS_SUCCESS - SME update config successful. Other status means SME is failed to update \sa --------------------------------------------------------------------------*/ eHalStatus sme_getRoamScanChannelList(tHalHandle hHal, tANI_U8 *pChannelList, - tANI_U8 *pNumChannels) + tANI_U8 *pNumChannels, tANI_U8 sessionId) { int i = 0; tANI_U8 *pOutPtr = pChannelList; tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; + tpCsrNeighborRoamControlInfo pNeighborRoamInfo = + &pMac->roam.neighborRoamInfo[sessionId]; eHalStatus status = eHAL_STATUS_SUCCESS; status = sme_AcquireGlobalLock( &pMac->sme ); @@ -11534,6 +11811,7 @@ void sme_SetCurrDeviceMode (tHalHandle hHal, tVOS_CON_MODE currDeviceMode) from CSR. This is a synchronous call \param hHal - The handle returned by macOpen + \param sessionId - Session Identifier \param pHandoffInfo - info provided by HDD with the handoff request (namely: BSSID, channel etc.) \return eHAL_STATUS_SUCCESS - SME passed the request to CSR successfully. @@ -11542,6 +11820,7 @@ void sme_SetCurrDeviceMode (tHalHandle hHal, tVOS_CON_MODE currDeviceMode) --------------------------------------------------------------------------*/ eHalStatus sme_HandoffRequest(tHalHandle hHal, + tANI_U8 sessionId, tCsrHandoffRequest *pHandoffInfo) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); @@ -11552,7 +11831,7 @@ eHalStatus sme_HandoffRequest(tHalHandle hHal, { VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: invoked", __func__); - status = csrHandoffRequest(pMac, pHandoffInfo); + status = csrHandoffRequest(pMac, sessionId, pHandoffInfo); sme_ReleaseGlobalLock( &pMac->sme ); } @@ -12959,6 +13238,7 @@ eHalStatus sme_StatsExtEvent(tHalHandle hHal, void* pMsg) This function is called through dynamic setConfig callback function to configure allowDFSChannelRoam. \param hHal - HAL handle for device + \param sessionId - Session Identifier \param allowDFSChannelRoam - DFS roaming scan mode 0 (disable), 1 (passive), 2 (active) \return eHAL_STATUS_SUCCESS - SME update DFS roaming scan config @@ -12966,7 +13246,8 @@ eHalStatus sme_StatsExtEvent(tHalHandle hHal, void* pMsg) Other status means SME failed to update DFS roaming scan config. \sa -------------------------------------------------------------------------*/ -eHalStatus sme_UpdateDFSScanMode(tHalHandle hHal, v_U8_t allowDFSChannelRoam) +eHalStatus sme_UpdateDFSScanMode(tHalHandle hHal, tANI_U8 sessionId, + v_U8_t allowDFSChannelRoam) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_SUCCESS; @@ -12980,14 +13261,14 @@ eHalStatus sme_UpdateDFSScanMode(tHalHandle hHal, v_U8_t allowDFSChannelRoam) allowDFSChannelRoam, pMac->roam.configParam.allowDFSChannelRoam, macTraceGetNeighbourRoamState( - pMac->roam.neighborRoamInfo.neighborRoamState)); + pMac->roam.neighborRoamInfo[sessionId].neighborRoamState)); pMac->roam.configParam.allowDFSChannelRoam = allowDFSChannelRoam; sme_ReleaseGlobalLock( &pMac->sme ); } #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_ROAM_DFS_SCAN_MODE_CHANGED); } #endif @@ -13062,16 +13343,17 @@ eHalStatus sme_UpdateAddIE(tHalHandle hHal, \fn sme_staInMiddleOfRoaming \brief This function returns TRUE if STA is in the middle of roaming state \param hHal - HAL handle for device + \param sessionId - Session Identifier \- return TRUE or FALSE -------------------------------------------------------------------------*/ -tANI_BOOLEAN sme_staInMiddleOfRoaming(tHalHandle hHal) +tANI_BOOLEAN sme_staInMiddleOfRoaming(tHalHandle hHal, tANI_U8 sessionId) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); eHalStatus status = eHAL_STATUS_SUCCESS; tANI_BOOLEAN ret = FALSE; if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { - ret = csrNeighborMiddleOfRoaming(hHal); + ret = csrNeighborMiddleOfRoaming(hHal, sessionId); sme_ReleaseGlobalLock(&pMac->sme); } return ret; @@ -13158,10 +13440,11 @@ VOS_STATUS sme_UpdateDSCPtoUPMapping( tHalHandle hHal, \fn sme_abortRoamScan \brief API to abort current roam scan cycle by roam scan offload module. \param hHal - The handle returned by macOpen. + \param sessionId - Session Identifier \return eHalStatus ---------------------------------------------------------------------------*/ -eHalStatus sme_abortRoamScan(tHalHandle hHal) +eHalStatus sme_abortRoamScan(tHalHandle hHal, tANI_U8 sessionId) { eHalStatus status = eHAL_STATUS_SUCCESS; tpAniSirGlobal pMac = PMAC_STRUCT(hHal); @@ -13171,9 +13454,9 @@ eHalStatus sme_abortRoamScan(tHalHandle hHal) { /* acquire the lock for the sme object */ status = sme_AcquireGlobalLock(&pMac->sme); - if(HAL_STATUS_SUCCESS(status)) + if (HAL_STATUS_SUCCESS(status)) { - csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_ABORT_SCAN, + csrRoamOffloadScan(pMac, sessionId, ROAM_SCAN_OFFLOAD_ABORT_SCAN, REASON_ROAM_ABORT_ROAM_SCAN); /* release the lock for the sme object */ sme_ReleaseGlobalLock( &pMac->sme ); diff --git a/CORE/SME/src/sme_common/sme_FTApi.c b/CORE/SME/src/sme_common/sme_FTApi.c index 367aee97b8e2..2ce4e02d9f9a 100644 --- a/CORE/SME/src/sme_common/sme_FTApi.c +++ b/CORE/SME/src/sme_common/sme_FTApi.c @@ -42,45 +42,101 @@ /*-------------------------------------------------------------------------- Initialize the FT context. ------------------------------------------------------------------------*/ -void sme_FTOpen(tHalHandle hHal) +void sme_FTOpen(tHalHandle hHal, tANI_U32 sessionId) { - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - eHalStatus status = eHAL_STATUS_SUCCESS; - - //Clear the FT Context. - sme_FTReset(hHal); - status = vos_timer_init(&pMac->ft.ftSmeContext.preAuthReassocIntvlTimer,VOS_TIMER_TYPE_SW, - sme_PreauthReassocIntvlTimerCallback, (void *)pMac); - - if (eHAL_STATUS_SUCCESS != status) - { - smsLog(pMac, LOGE, FL("Preauth Reassoc interval Timer allocation failed")); - return; - } + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + eHalStatus status = eHAL_STATUS_SUCCESS; + tCsrRoamSession *pSession = NULL; + + if (CSR_IS_SESSION_VALID(pMac, sessionId)) + { + /* Clear existing context data if any */ + pSession = CSR_GET_SESSION( pMac, sessionId ); + if (NULL != pSession) { + /* Clean up the context */ + vos_mem_set(&pSession->ftSmeContext, sizeof(tftSMEContext), 0); + + pSession->ftSmeContext.pUsrCtx = vos_mem_malloc( + sizeof(tFTRoamCallbackUsrCtx)); + + if (NULL == pSession->ftSmeContext.pUsrCtx) { + smsLog(pMac, LOGE, FL("Memory allocation failure")); + return; + } + pSession->ftSmeContext.pUsrCtx->pMac = pMac; + pSession->ftSmeContext.pUsrCtx->sessionId = sessionId; + + status = + vos_timer_init(&pSession->ftSmeContext.preAuthReassocIntvlTimer, + VOS_TIMER_TYPE_SW, + sme_PreauthReassocIntvlTimerCallback, + (void *)pSession->ftSmeContext.pUsrCtx); + + if (eHAL_STATUS_SUCCESS != status) { + smsLog(pMac, LOGE, + FL("Preauth Reassoc interval Timer allocation failed")); + vos_mem_free(pSession->ftSmeContext.pUsrCtx); + pSession->ftSmeContext.pUsrCtx = NULL; + return; + } + } + } } /*-------------------------------------------------------------------------- Cleanup the SME FT Global context. ------------------------------------------------------------------------*/ -void sme_FTClose(tHalHandle hHal) +void sme_FTClose(tHalHandle hHal, tANI_U32 sessionId) { - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - //Clear the FT Context. - sme_FTReset(hHal); + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + tCsrRoamSession *pSession = NULL; + + /* Clear the FT Context */ + sme_FTReset(hHal, sessionId); + + pSession = CSR_GET_SESSION( pMac, sessionId ); + if (NULL != pSession) + { + /* check if the timer is running */ + if (VOS_TIMER_STATE_RUNNING == + vos_timer_getCurrentState( + &pSession->ftSmeContext.preAuthReassocIntvlTimer)) + { + vos_timer_stop(&pSession->ftSmeContext.preAuthReassocIntvlTimer); + } - vos_timer_destroy(&pMac->ft.ftSmeContext.preAuthReassocIntvlTimer); + if (VOS_STATUS_SUCCESS != + vos_timer_destroy(&pSession->ftSmeContext.preAuthReassocIntvlTimer)) + { + smsLog(pMac, LOGE, FL("preAuthReAssocTimer destroy failed")); + } + + if (pSession->ftSmeContext.pUsrCtx != NULL) { + smsLog(pMac, LOG1, + FL("Freeing ftSmeContext.pUsrCtx and setting to NULL")); + vos_mem_free(pSession->ftSmeContext.pUsrCtx); + pSession->ftSmeContext.pUsrCtx = NULL; + } + } } -void sme_SetFTPreAuthState(tHalHandle hHal, v_BOOL_t state) +void sme_SetFTPreAuthState(tHalHandle hHal, tANI_U32 sessionId, v_BOOL_t state) { - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - pMac->ft.ftSmeContext.setFTPreAuthState = state; + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); + if (pSession) + pSession->ftSmeContext.setFTPreAuthState = state; } -v_BOOL_t sme_GetFTPreAuthState(tHalHandle hHal) +v_BOOL_t sme_GetFTPreAuthState(tHalHandle hHal, tANI_U32 sessionId) { - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - return pMac->ft.ftSmeContext.setFTPreAuthState; + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + + tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); + if (pSession) + return pSession->ftSmeContext.setFTPreAuthState; + + return FALSE; } /*-------------------------------------------------------------------------- @@ -88,284 +144,305 @@ v_BOOL_t sme_GetFTPreAuthState(tHalHandle hHal) This function is called in SME. This fucntion packages and sends the FT IEs to PE. ------------------------------------------------------------------------*/ -void sme_SetFTIEs( tHalHandle hHal, tANI_U8 sessionId, const tANI_U8 *ft_ies, - tANI_U16 ft_ies_length ) +void sme_SetFTIEs(tHalHandle hHal, tANI_U32 sessionId, const tANI_U8 *ft_ies, + tANI_U16 ft_ies_length ) { - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - eHalStatus status = eHAL_STATUS_FAILURE; + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); + eHalStatus status = eHAL_STATUS_FAILURE; - status = sme_AcquireGlobalLock( &pMac->sme ); - if (!( HAL_STATUS_SUCCESS( status ))) return; + if (NULL == pSession || NULL == ft_ies) + { + smsLog( pMac, LOGE, FL(" ft ies or pSession is NULL")); + return; + } - if (ft_ies == NULL) - { - smsLog( pMac, LOGE, FL(" ft ies is NULL")); - sme_ReleaseGlobalLock( &pMac->sme ); - return; - } + status = sme_AcquireGlobalLock( &pMac->sme ); + if (!( HAL_STATUS_SUCCESS( status ))) return; #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - smsLog( pMac, LOG1, "FT IEs Req is received in state %d", - pMac->ft.ftSmeContext.FTState); + smsLog( pMac, LOG1, "FT IEs Req is received in state %d", + pSession->ftSmeContext.FTState); #endif - // Global Station FT State - switch(pMac->ft.ftSmeContext.FTState) - { - case eFT_START_READY: - case eFT_AUTH_REQ_READY: - if ((pMac->ft.ftSmeContext.auth_ft_ies) && - (pMac->ft.ftSmeContext.auth_ft_ies_length)) - { - // Free the one we received last from the supplicant - vos_mem_free(pMac->ft.ftSmeContext.auth_ft_ies); - pMac->ft.ftSmeContext.auth_ft_ies_length = 0; - } - - // Save the FT IEs - pMac->ft.ftSmeContext.auth_ft_ies = vos_mem_malloc(ft_ies_length); - if ( NULL == pMac->ft.ftSmeContext.auth_ft_ies ) - { - smsLog( pMac, LOGE, FL("Memory allocation failed for " - "auth_ft_ies")); - sme_ReleaseGlobalLock( &pMac->sme ); - return; - } - pMac->ft.ftSmeContext.auth_ft_ies_length = ft_ies_length; - vos_mem_copy((tANI_U8 *)pMac->ft.ftSmeContext.auth_ft_ies, - ft_ies,ft_ies_length); - pMac->ft.ftSmeContext.FTState = eFT_AUTH_REQ_READY; + // Global Station FT State + switch(pSession->ftSmeContext.FTState) + { + case eFT_START_READY: + case eFT_AUTH_REQ_READY: + if ((pSession->ftSmeContext.auth_ft_ies) && + (pSession->ftSmeContext.auth_ft_ies_length)) + { + // Free the one we received last from the supplicant + vos_mem_free(pSession->ftSmeContext.auth_ft_ies); + pSession->ftSmeContext.auth_ft_ies_length = 0; + pSession->ftSmeContext.auth_ft_ies = NULL; + } + + // Save the FT IEs + pSession->ftSmeContext.auth_ft_ies = + vos_mem_malloc(ft_ies_length); + if ( NULL == pSession->ftSmeContext.auth_ft_ies ) + { + smsLog( pMac, LOGE, FL("Memory allocation failed for " + "auth_ft_ies")); + sme_ReleaseGlobalLock( &pMac->sme ); + return; + } + pSession->ftSmeContext.auth_ft_ies_length = ft_ies_length; + vos_mem_copy((tANI_U8 *)pSession->ftSmeContext.auth_ft_ies, + ft_ies,ft_ies_length); + pSession->ftSmeContext.FTState = eFT_AUTH_REQ_READY; #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - smsLog( pMac, LOG1, "ft_ies_length=%d", ft_ies_length); + smsLog( pMac, LOG1, "ft_ies_length=%d", ft_ies_length); #endif - break; + break; - case eFT_AUTH_COMPLETE: - // We will need to re-start preauth. If we received FT IEs in - // eFT_PRE_AUTH_DONE state, it implies there was a rekey in - // our pre-auth state. Hence this implies we need Pre-auth again. + case eFT_AUTH_COMPLETE: + // We will need to re-start preauth. If we received FT IEs in + // eFT_PRE_AUTH_DONE state, it implies there was a rekey in + // our pre-auth state. Hence this implies we need Pre-auth again. - // OK now inform SME we have no pre-auth list. - // Delete the pre-auth node locally. Set your self back to restart pre-auth - // TBD + // OK now inform SME we have no pre-auth list. + // Delete the pre-auth node locally. Set your self back to restart pre-auth + // TBD #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - smsLog( pMac, LOG1, - "Pre-auth done and now receiving---> AUTH REQ <---- in state %d", - pMac->ft.ftSmeContext.FTState); - smsLog( pMac, LOG1, "Unhandled reception of FT IES in state %d", - pMac->ft.ftSmeContext.FTState); + smsLog( pMac, LOG1, + "Pre-auth done and now receiving---> AUTH REQ <---- in state %d", + pSession->ftSmeContext.FTState); + smsLog( pMac, LOG1, "Unhandled reception of FT IES in state %d", + pSession->ftSmeContext.FTState); #endif - break; + break; - case eFT_REASSOC_REQ_WAIT: - // We are done with pre-auth, hence now waiting for - // reassoc req. This is the new FT Roaming in place + case eFT_REASSOC_REQ_WAIT: + // We are done with pre-auth, hence now waiting for + // reassoc req. This is the new FT Roaming in place - // At this juncture we are ready to start sending Re-Assoc Req. + // At this juncture we are ready to start sending Re-Assoc Req. #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - smsLog( pMac, LOG1, "New Reassoc Req=%p in state %d", - ft_ies, pMac->ft.ftSmeContext.FTState); + smsLog( pMac, LOG1, "New Reassoc Req=%p in state %d", + ft_ies, pSession->ftSmeContext.FTState); #endif - if ((pMac->ft.ftSmeContext.reassoc_ft_ies) && - (pMac->ft.ftSmeContext.reassoc_ft_ies_length)) - { - // Free the one we received last from the supplicant - vos_mem_free(pMac->ft.ftSmeContext.reassoc_ft_ies); - pMac->ft.ftSmeContext.reassoc_ft_ies_length = 0; - } - - // Save the FT IEs - pMac->ft.ftSmeContext.reassoc_ft_ies = vos_mem_malloc(ft_ies_length); - if ( NULL == pMac->ft.ftSmeContext.reassoc_ft_ies ) - { - smsLog( pMac, LOGE, FL("Memory allocation failed for " - "reassoc_ft_ies")); - sme_ReleaseGlobalLock( &pMac->sme ); - return; - } - pMac->ft.ftSmeContext.reassoc_ft_ies_length = ft_ies_length; - vos_mem_copy((tANI_U8 *)pMac->ft.ftSmeContext.reassoc_ft_ies, ft_ies, - ft_ies_length); - - pMac->ft.ftSmeContext.FTState = eFT_SET_KEY_WAIT; + if ((pSession->ftSmeContext.reassoc_ft_ies) && + (pSession->ftSmeContext.reassoc_ft_ies_length)) + { + // Free the one we received last from the supplicant + vos_mem_free(pSession->ftSmeContext.reassoc_ft_ies); + pSession->ftSmeContext.reassoc_ft_ies_length = 0; + } + + // Save the FT IEs + pSession->ftSmeContext.reassoc_ft_ies = vos_mem_malloc(ft_ies_length); + if ( NULL == pSession->ftSmeContext.reassoc_ft_ies ) + { + smsLog( pMac, LOGE, FL("Memory allocation failed for " + "reassoc_ft_ies")); + sme_ReleaseGlobalLock( &pMac->sme ); + return; + } + pSession->ftSmeContext.reassoc_ft_ies_length = ft_ies_length; + vos_mem_copy((tANI_U8 *)pSession->ftSmeContext.reassoc_ft_ies, ft_ies, + ft_ies_length); + + pSession->ftSmeContext.FTState = eFT_SET_KEY_WAIT; #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - smsLog( pMac, LOG1, "ft_ies_length=%d state=%d", ft_ies_length, - pMac->ft.ftSmeContext.FTState); + smsLog( pMac, LOG1, "ft_ies_length=%d state=%d", ft_ies_length, + pSession->ftSmeContext.FTState); #endif - break; + break; - default: - smsLog( pMac, LOGE, FL(" Unhandled state=%d"), - pMac->ft.ftSmeContext.FTState); - break; - } - sme_ReleaseGlobalLock( &pMac->sme ); + default: + smsLog( pMac, LOGE, FL(" Unhandled state=%d"), + pSession->ftSmeContext.FTState); + break; + } + sme_ReleaseGlobalLock( &pMac->sme ); } -eHalStatus sme_FTSendUpdateKeyInd(tHalHandle hHal, tCsrRoamSetKey * pFTKeyInfo) +eHalStatus sme_FTSendUpdateKeyInd(tHalHandle hHal, tANI_U32 sessionId, + tCsrRoamSetKey * pFTKeyInfo) { - tSirFTUpdateKeyInfo *pMsg; - tANI_U16 msgLen; - eHalStatus status = eHAL_STATUS_FAILURE; - tAniEdType tmpEdType; - tSirKeyMaterial *keymaterial = NULL; - tAniEdType edType; - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + tSirFTUpdateKeyInfo *pMsg; + tANI_U16 msgLen; + eHalStatus status = eHAL_STATUS_FAILURE; + tAniEdType tmpEdType; + tSirKeyMaterial *keymaterial = NULL; + tAniEdType edType; + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - int i = 0; + int i = 0; - smsLog(pMac, LOG1, FL("keyLength %d"), pFTKeyInfo->keyLength); + smsLog(pMac, LOG1, FL("keyLength %d"), pFTKeyInfo->keyLength); - for (i=0; i<pFTKeyInfo->keyLength; i++) + for (i=0; i<pFTKeyInfo->keyLength; i++) smsLog(pMac, LOG1, FL("%02x"), pFTKeyInfo->Key[i]); #endif - msgLen = sizeof( tANI_U16) + sizeof( tANI_U16 ) + - sizeof( pMsg->keyMaterial.length ) + sizeof( pMsg->keyMaterial.edType ) + - sizeof( pMsg->keyMaterial.numKeys ) + sizeof( pMsg->keyMaterial.key ); - - pMsg = vos_mem_malloc(msgLen); - if ( NULL == pMsg ) - { - return eHAL_STATUS_FAILURE; - } - - vos_mem_set(pMsg, msgLen, 0); - pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_FT_UPDATE_KEY); - pMsg->length = pal_cpu_to_be16(msgLen); - - keymaterial = &pMsg->keyMaterial; - - keymaterial->length = pFTKeyInfo->keyLength; - - edType = csrTranslateEncryptTypeToEdType( pFTKeyInfo->encType ); - tmpEdType = pal_cpu_to_be32(edType); - keymaterial->edType = tmpEdType; - - // Set the pMsg->keyMaterial.length field (this length is defined as all - // data that follows the edType field - // in the tSirKeyMaterial keyMaterial; field). - // - // !!NOTE: This keyMaterial.length contains the length of a MAX size key, - // though the keyLength can be - // shorter than this max size. Is LIM interpreting this ok ? - keymaterial->numKeys = 1; - keymaterial->key[ 0 ].keyId = pFTKeyInfo->keyId; - keymaterial->key[ 0 ].unicast = (tANI_U8)eANI_BOOLEAN_TRUE; - keymaterial->key[ 0 ].keyDirection = pFTKeyInfo->keyDirection; - - vos_mem_copy(&keymaterial->key[ 0 ].keyRsc, pFTKeyInfo->keyRsc, CSR_MAX_RSC_LEN); - keymaterial->key[ 0 ].paeRole = pFTKeyInfo->paeRole; - - keymaterial->key[ 0 ].keyLength = pFTKeyInfo->keyLength; + msgLen = sizeof( tANI_U16) + sizeof( tANI_U16 ) + + sizeof( pMsg->keyMaterial.length ) + sizeof( pMsg->keyMaterial.edType ) + + sizeof( pMsg->keyMaterial.numKeys ) + sizeof( pMsg->keyMaterial.key ); + + pMsg = vos_mem_malloc(msgLen); + if ( NULL == pMsg ) + { + return eHAL_STATUS_FAILURE; + } + + vos_mem_set(pMsg, msgLen, 0); + pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_FT_UPDATE_KEY); + pMsg->length = pal_cpu_to_be16(msgLen); + + keymaterial = &pMsg->keyMaterial; + + keymaterial->length = pFTKeyInfo->keyLength; + + edType = csrTranslateEncryptTypeToEdType( pFTKeyInfo->encType ); + tmpEdType = pal_cpu_to_be32(edType); + keymaterial->edType = tmpEdType; + + // Set the pMsg->keyMaterial.length field (this length is defined as all + // data that follows the edType field + // in the tSirKeyMaterial keyMaterial; field). + // + // !!NOTE: This keyMaterial.length contains the length of a MAX size key, + // though the keyLength can be + // shorter than this max size. Is LIM interpreting this ok ? + keymaterial->numKeys = 1; + keymaterial->key[ 0 ].keyId = pFTKeyInfo->keyId; + keymaterial->key[ 0 ].unicast = (tANI_U8)eANI_BOOLEAN_TRUE; + keymaterial->key[ 0 ].keyDirection = pFTKeyInfo->keyDirection; + + vos_mem_copy(&keymaterial->key[ 0 ].keyRsc, pFTKeyInfo->keyRsc, CSR_MAX_RSC_LEN); + keymaterial->key[ 0 ].paeRole = pFTKeyInfo->paeRole; + + keymaterial->key[ 0 ].keyLength = pFTKeyInfo->keyLength; + + if ( pFTKeyInfo->keyLength && pFTKeyInfo->Key ) + { + vos_mem_copy(&keymaterial->key[ 0 ].key, pFTKeyInfo->Key, pFTKeyInfo->keyLength); + if(pFTKeyInfo->keyLength == 16) + { + smsLog(pMac, LOG1, + "SME Set Update Ind keyIdx (%d) encType(%d) key = " + "%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X", + pMsg->keyMaterial.key[0].keyId, (tAniEdType)pMsg->keyMaterial.edType, + pMsg->keyMaterial.key[0].key[0], pMsg->keyMaterial.key[0].key[1], + pMsg->keyMaterial.key[0].key[2], pMsg->keyMaterial.key[0].key[3], + pMsg->keyMaterial.key[0].key[4], pMsg->keyMaterial.key[0].key[5], + pMsg->keyMaterial.key[0].key[6], pMsg->keyMaterial.key[0].key[7], + pMsg->keyMaterial.key[0].key[8], pMsg->keyMaterial.key[0].key[9], + pMsg->keyMaterial.key[0].key[10], pMsg->keyMaterial.key[0].key[11], + pMsg->keyMaterial.key[0].key[12], pMsg->keyMaterial.key[0].key[13], + pMsg->keyMaterial.key[0].key[14], pMsg->keyMaterial.key[0].key[15]); + } + } - if ( pFTKeyInfo->keyLength && pFTKeyInfo->Key ) - { - vos_mem_copy(&keymaterial->key[ 0 ].key, pFTKeyInfo->Key, pFTKeyInfo->keyLength); - if(pFTKeyInfo->keyLength == 16) - { - smsLog(pMac, LOG1, "SME Set Update Ind keyIdx (%d) encType(%d) key = " - "%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X", - pMsg->keyMaterial.key[0].keyId, (tAniEdType)pMsg->keyMaterial.edType, - pMsg->keyMaterial.key[0].key[0], pMsg->keyMaterial.key[0].key[1], - pMsg->keyMaterial.key[0].key[2], pMsg->keyMaterial.key[0].key[3], - pMsg->keyMaterial.key[0].key[4], pMsg->keyMaterial.key[0].key[5], - pMsg->keyMaterial.key[0].key[6], pMsg->keyMaterial.key[0].key[7], - pMsg->keyMaterial.key[0].key[8], pMsg->keyMaterial.key[0].key[9], - pMsg->keyMaterial.key[0].key[10], pMsg->keyMaterial.key[0].key[11], - pMsg->keyMaterial.key[0].key[12], pMsg->keyMaterial.key[0].key[13], - pMsg->keyMaterial.key[0].key[14], pMsg->keyMaterial.key[0].key[15]); - } - } + vos_mem_copy( &pMsg->bssId[ 0 ], + &pFTKeyInfo->peerMac[ 0 ], + sizeof(tCsrBssid) ); - vos_mem_copy( &pMsg->bssId[ 0 ], - &pFTKeyInfo->peerMac[ 0 ], - sizeof(tCsrBssid) ); + pMsg->smeSessionId = sessionId; - smsLog(pMac, LOG1, "BSSID = "MAC_ADDRESS_STR, - MAC_ADDR_ARRAY(pMsg->bssId)); + smsLog(pMac, LOG1, "BSSID = "MAC_ADDRESS_STR, + MAC_ADDR_ARRAY(pMsg->bssId)); - status = palSendMBMessage(pMac->hHdd, pMsg); + status = palSendMBMessage(pMac->hHdd, pMsg); - return( status ); + return( status ); } -v_BOOL_t sme_GetFTPTKState(tHalHandle hHal) +v_BOOL_t sme_GetFTPTKState(tHalHandle hHal, tANI_U32 sessionId) { - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - return pMac->ft.ftSmeContext.setFTPTKState; + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); + + if (!pSession) + { + smsLog( pMac, LOGE, FL("pSession is NULL")); + return VOS_FALSE; + } + return pSession->ftSmeContext.setFTPTKState; } -void sme_SetFTPTKState(tHalHandle hHal, v_BOOL_t state) +void sme_SetFTPTKState(tHalHandle hHal, tANI_U32 sessionId, v_BOOL_t state) { - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - pMac->ft.ftSmeContext.setFTPTKState = state; + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); + pSession->ftSmeContext.setFTPTKState = state; } -eHalStatus sme_FTUpdateKey( tHalHandle hHal, tCsrRoamSetKey * pFTKeyInfo ) +eHalStatus sme_FTUpdateKey(tHalHandle hHal, tANI_U32 sessionId, + tCsrRoamSetKey * pFTKeyInfo ) { - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - eHalStatus status = eHAL_STATUS_FAILURE; - - status = sme_AcquireGlobalLock( &pMac->sme ); - if (!( HAL_STATUS_SUCCESS( status ))) - { - return eHAL_STATUS_FAILURE; - } - - if (pFTKeyInfo == NULL) - { - smsLog( pMac, LOGE, "%s: pFTKeyInfo is NULL", __func__); - sme_ReleaseGlobalLock( &pMac->sme ); - return eHAL_STATUS_FAILURE; - } + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); + eHalStatus status = eHAL_STATUS_FAILURE; + + if (!pSession) + { + smsLog( pMac, LOGE, FL("pSession is NULL")); + return eHAL_STATUS_FAILURE; + } + + if (pFTKeyInfo == NULL) + { + smsLog( pMac, LOGE, "%s: pFTKeyInfo is NULL", __func__); + return eHAL_STATUS_FAILURE; + } + + status = sme_AcquireGlobalLock( &pMac->sme ); + if (!( HAL_STATUS_SUCCESS( status ))) + { + return eHAL_STATUS_FAILURE; + } #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - smsLog( pMac, LOG1, "sme_FTUpdateKey is received in state %d", - pMac->ft.ftSmeContext.FTState); + smsLog( pMac, LOG1, "sme_FTUpdateKey is received in state %d", + pSession->ftSmeContext.FTState); #endif - // Global Station FT State - switch(pMac->ft.ftSmeContext.FTState) - { - case eFT_SET_KEY_WAIT: - if (sme_GetFTPreAuthState (hHal) == TRUE) - { - status = sme_FTSendUpdateKeyInd(pMac, pFTKeyInfo); - if (status != 0 ) - { - smsLog( pMac, LOGE, "%s: Key set failure %d", __func__, - status); - pMac->ft.ftSmeContext.setFTPTKState = FALSE; - status = eHAL_STATUS_FT_PREAUTH_KEY_FAILED; - } - else - { - pMac->ft.ftSmeContext.setFTPTKState = TRUE; - status = eHAL_STATUS_FT_PREAUTH_KEY_SUCCESS; - smsLog( pMac, LOG1, "%s: Key set success", __func__); - } - sme_SetFTPreAuthState(hHal, FALSE); - } + // Global Station FT State + switch(pSession->ftSmeContext.FTState) + { + case eFT_SET_KEY_WAIT: + if (sme_GetFTPreAuthState(hHal, sessionId) == TRUE) + { + status = sme_FTSendUpdateKeyInd(pMac, sessionId, pFTKeyInfo); + if (status != 0 ) + { + smsLog( pMac, LOGE, "%s: Key set failure %d", __func__, + status); + pSession->ftSmeContext.setFTPTKState = FALSE; + status = eHAL_STATUS_FT_PREAUTH_KEY_FAILED; + } + else + { + pSession->ftSmeContext.setFTPTKState = TRUE; + status = eHAL_STATUS_FT_PREAUTH_KEY_SUCCESS; + smsLog( pMac, LOG1, "%s: Key set success", __func__); + } + sme_SetFTPreAuthState(hHal, sessionId, FALSE); + } - pMac->ft.ftSmeContext.FTState = eFT_START_READY; + pSession->ftSmeContext.FTState = eFT_START_READY; #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG - smsLog( pMac, LOG1, "%s: state changed to %d status %d", __func__, - pMac->ft.ftSmeContext.FTState, status); + smsLog( pMac, LOG1, "%s: state changed to %d status %d", __func__, + pSession->ftSmeContext.FTState, status); #endif - break; + break; - default: - smsLog( pMac, LOGW, "%s: Unhandled state=%d", __func__, - pMac->ft.ftSmeContext.FTState); - status = eHAL_STATUS_FAILURE; - break; - } - sme_ReleaseGlobalLock( &pMac->sme ); + default: + smsLog( pMac, LOGW, "%s: Unhandled state=%d", __func__, + pSession->ftSmeContext.FTState); + status = eHAL_STATUS_FAILURE; + break; + } + sme_ReleaseGlobalLock( &pMac->sme ); - return status; + return status; } /*-------------------------------------------------------------------------- * @@ -374,45 +451,52 @@ eHalStatus sme_FTUpdateKey( tHalHandle hHal, tCsrRoamSetKey * pFTKeyInfo ) * Reassoc Req. * *------------------------------------------------------------------------*/ -void sme_GetFTPreAuthResponse( tHalHandle hHal, tANI_U8 *ft_ies, +void sme_GetFTPreAuthResponse( tHalHandle hHal, tANI_U32 sessionId, tANI_U8 *ft_ies, tANI_U32 ft_ies_ip_len, tANI_U16 *ft_ies_length ) { - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - eHalStatus status = eHAL_STATUS_FAILURE; + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); + eHalStatus status = eHAL_STATUS_FAILURE; - *ft_ies_length = 0; + if (!pSession) + { + smsLog( pMac, LOGE, FL("pSession is NULL")); + return; + } - status = sme_AcquireGlobalLock( &pMac->sme ); - if (!( HAL_STATUS_SUCCESS( status ))) - return; + *ft_ies_length = 0; - /* All or nothing - proceed only if both BSSID and FT IE fit */ - if((ANI_MAC_ADDR_SIZE + - pMac->ft.ftSmeContext.psavedFTPreAuthRsp->ft_ies_length) > ft_ies_ip_len) - { - sme_ReleaseGlobalLock( &pMac->sme ); - return; - } + status = sme_AcquireGlobalLock( &pMac->sme ); + if (!( HAL_STATUS_SUCCESS( status ))) + return; + + /* All or nothing - proceed only if both BSSID and FT IE fit */ + if((ANI_MAC_ADDR_SIZE + + pSession->ftSmeContext.psavedFTPreAuthRsp->ft_ies_length) > ft_ies_ip_len) + { + sme_ReleaseGlobalLock( &pMac->sme ); + return; + } - // hdd needs to pack the bssid also along with the - // auth response to supplicant - vos_mem_copy(ft_ies, pMac->ft.ftSmeContext.preAuthbssId, ANI_MAC_ADDR_SIZE); + // hdd needs to pack the bssid also along with the + // auth response to supplicant + vos_mem_copy(ft_ies, pSession->ftSmeContext.preAuthbssId, ANI_MAC_ADDR_SIZE); - // Copy the auth resp FTIEs - vos_mem_copy(&(ft_ies[ANI_MAC_ADDR_SIZE]), - pMac->ft.ftSmeContext.psavedFTPreAuthRsp->ft_ies, - pMac->ft.ftSmeContext.psavedFTPreAuthRsp->ft_ies_length); + // Copy the auth resp FTIEs + vos_mem_copy(&(ft_ies[ANI_MAC_ADDR_SIZE]), + pSession->ftSmeContext.psavedFTPreAuthRsp->ft_ies, + pSession->ftSmeContext.psavedFTPreAuthRsp->ft_ies_length); - *ft_ies_length = ANI_MAC_ADDR_SIZE + - pMac->ft.ftSmeContext.psavedFTPreAuthRsp->ft_ies_length; + *ft_ies_length = ANI_MAC_ADDR_SIZE + + pSession->ftSmeContext.psavedFTPreAuthRsp->ft_ies_length; - pMac->ft.ftSmeContext.FTState = eFT_REASSOC_REQ_WAIT; + pSession->ftSmeContext.FTState = eFT_REASSOC_REQ_WAIT; #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG - smsLog( pMac, LOG1, FL(" Filled auth resp = %d"), *ft_ies_length); + smsLog( pMac, LOG1, FL(" Filled auth resp = %d"), *ft_ies_length); #endif - sme_ReleaseGlobalLock( &pMac->sme ); - return; + sme_ReleaseGlobalLock( &pMac->sme ); + return; } /*-------------------------------------------------------------------------- @@ -422,12 +506,19 @@ void sme_GetFTPreAuthResponse( tHalHandle hHal, tANI_U8 *ft_ies, * Reassoc Req. * *------------------------------------------------------------------------*/ -void sme_GetRICIEs( tHalHandle hHal, tANI_U8 *ric_ies, tANI_U32 ric_ies_ip_len, - tANI_U32 *ric_ies_length ) +void sme_GetRICIEs(tHalHandle hHal, tANI_U32 sessionId, tANI_U8 *ric_ies, + tANI_U32 ric_ies_ip_len, tANI_U32 *ric_ies_length ) { tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); eHalStatus status = eHAL_STATUS_FAILURE; + if (!pSession) + { + smsLog( pMac, LOGE, FL("pSession is NULL")); + return; + } + *ric_ies_length = 0; status = sme_AcquireGlobalLock( &pMac->sme ); @@ -435,17 +526,17 @@ void sme_GetRICIEs( tHalHandle hHal, tANI_U8 *ric_ies, tANI_U32 ric_ies_ip_len, return; /* All or nothing */ - if (pMac->ft.ftSmeContext.psavedFTPreAuthRsp->ric_ies_length > + if (pSession->ftSmeContext.psavedFTPreAuthRsp->ric_ies_length > ric_ies_ip_len) { sme_ReleaseGlobalLock( &pMac->sme ); return; } - vos_mem_copy(ric_ies, pMac->ft.ftSmeContext.psavedFTPreAuthRsp->ric_ies, - pMac->ft.ftSmeContext.psavedFTPreAuthRsp->ric_ies_length); + vos_mem_copy(ric_ies, pSession->ftSmeContext.psavedFTPreAuthRsp->ric_ies, + pSession->ftSmeContext.psavedFTPreAuthRsp->ric_ies_length); - *ric_ies_length = pMac->ft.ftSmeContext.psavedFTPreAuthRsp->ric_ies_length; + *ric_ies_length = pSession->ftSmeContext.psavedFTPreAuthRsp->ric_ies_length; #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG smsLog( pMac, LOG1, FL(" Filled ric ies = %d"), *ric_ies_length); @@ -466,8 +557,11 @@ void sme_GetRICIEs( tHalHandle hHal, tANI_U8 *ric_ies, tANI_U32 ric_ies_ip_len, void sme_PreauthReassocIntvlTimerCallback(void *context) { #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING - tpAniSirGlobal pMac = (tpAniSirGlobal )context; - csrNeighborRoamRequestHandoff(pMac); + tFTRoamCallbackUsrCtx *pUsrCtx = (tFTRoamCallbackUsrCtx *)context; + + if (pUsrCtx) { + csrNeighborRoamRequestHandoff(pUsrCtx->pMac, pUsrCtx->sessionId); + } #endif return; } @@ -475,55 +569,62 @@ void sme_PreauthReassocIntvlTimerCallback(void *context) /*-------------------------------------------------------------------------- Reset the FT context. ------------------------------------------------------------------------*/ -void sme_FTReset(tHalHandle hHal) +void sme_FTReset(tHalHandle hHal, tANI_U32 sessionId) { - tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); - if (pMac == NULL) - { - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, FL("pMac is NULL")); - return; - } - if (pMac->ft.ftSmeContext.auth_ft_ies != NULL) - { + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + tCsrRoamSession *pSession = NULL; + + if (pMac == NULL) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, FL("pMac is NULL")); + return; + } + + pSession = CSR_GET_SESSION( pMac, sessionId ); + if (NULL != pSession) { + + if (pSession->ftSmeContext.auth_ft_ies != NULL) + { + #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - smsLog( pMac, LOGE, FL(" Freeing FT Auth IE %p and setting to NULL"), - pMac->ft.ftSmeContext.auth_ft_ies); + smsLog( pMac, LOG1, FL(" Freeing FT Auth IE %p and setting to NULL"), + pSession->ftSmeContext.auth_ft_ies); #endif - vos_mem_free(pMac->ft.ftSmeContext.auth_ft_ies); - } - pMac->ft.ftSmeContext.auth_ft_ies = NULL; - pMac->ft.ftSmeContext.auth_ft_ies_length = 0; + vos_mem_free(pSession->ftSmeContext.auth_ft_ies); + pSession->ftSmeContext.auth_ft_ies = NULL; + } + pSession->ftSmeContext.auth_ft_ies_length = 0; - if (pMac->ft.ftSmeContext.reassoc_ft_ies != NULL) - { + if (pSession->ftSmeContext.reassoc_ft_ies != NULL) + { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - smsLog( pMac, LOGE, FL(" Freeing FT Reassoc IE %p and setting to NULL"), - pMac->ft.ftSmeContext.auth_ft_ies); + smsLog(pMac, LOG1, + FL(" Freeing FT Reassoc IE %p and setting to NULL"), + pSession->ftSmeContext.reassoc_ft_ies); #endif - vos_mem_free(pMac->ft.ftSmeContext.reassoc_ft_ies); - } - pMac->ft.ftSmeContext.reassoc_ft_ies = NULL; - pMac->ft.ftSmeContext.reassoc_ft_ies_length = 0; + vos_mem_free(pSession->ftSmeContext.reassoc_ft_ies); + pSession->ftSmeContext.reassoc_ft_ies = NULL; + } + pSession->ftSmeContext.reassoc_ft_ies_length = 0; - if (pMac->ft.ftSmeContext.psavedFTPreAuthRsp != NULL) - { + if (pSession->ftSmeContext.psavedFTPreAuthRsp != NULL) + { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG - smsLog( pMac, LOGE, FL("Freeing FtPreAuthRsp %p and setting to NULL"), - pMac->ft.ftSmeContext.psavedFTPreAuthRsp); + smsLog( pMac, LOG1, FL("Freeing FtPreAuthRsp %p and setting to NULL"), + pSession->ftSmeContext.psavedFTPreAuthRsp); #endif - vos_mem_free(pMac->ft.ftSmeContext.psavedFTPreAuthRsp); - } - pMac->ft.ftSmeContext.psavedFTPreAuthRsp = NULL; - pMac->ft.ftSmeContext.setFTPreAuthState = FALSE; - pMac->ft.ftSmeContext.setFTPTKState = FALSE; + vos_mem_free(pSession->ftSmeContext.psavedFTPreAuthRsp); + vos_mem_set(pSession->ftSmeContext.psavedFTPreAuthRsp, + sizeof(tSirFTPreAuthRsp), 0); + } + pSession->ftSmeContext.setFTPreAuthState = VOS_FALSE; + pSession->ftSmeContext.setFTPTKState = VOS_FALSE; - if (pMac->ft.ftSmeContext.pCsrFTKeyInfo != NULL) - { - vos_mem_free(pMac->ft.ftSmeContext.pCsrFTKeyInfo); - } - pMac->ft.ftSmeContext.pCsrFTKeyInfo = NULL; - vos_mem_zero(pMac->ft.ftSmeContext.preAuthbssId, ANI_MAC_ADDR_SIZE); - pMac->ft.ftSmeContext.FTState = eFT_START_READY; + vos_mem_zero(pSession->ftSmeContext.preAuthbssId, ANI_MAC_ADDR_SIZE); + } + + pSession->ftSmeContext.FTState = eFT_START_READY; } + /* End of File */ #endif /* WLAN_FEATURE_VOWIFI_11R */ diff --git a/CORE/VOSS/inc/i_vos_packet.h b/CORE/VOSS/inc/i_vos_packet.h index ea9938f5068d..59d592c461f3 100644 --- a/CORE/VOSS/inc/i_vos_packet.h +++ b/CORE/VOSS/inc/i_vos_packet.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -64,6 +64,7 @@ typedef struct u_int8_t roamCandidateInd:1; u_int8_t scan:1; u_int8_t dpuFeedback; + u_int8_t sessionId; }t_packetmeta, *tp_packetmeta; /* implementation specific vos packet type */ diff --git a/CORE/VOSS/inc/vos_getBin.h b/CORE/VOSS/inc/vos_getBin.h index ec3d949bf686..fc5122ad4efd 100644 --- a/CORE/VOSS/inc/vos_getBin.h +++ b/CORE/VOSS/inc/vos_getBin.h @@ -140,6 +140,8 @@ tVOS_CONCURRENCY_MODE vos_get_concurrency_mode( void ); v_BOOL_t vos_concurrent_open_sessions_running(void); v_BOOL_t vos_max_concurrent_connections_reached(void); void vos_clear_concurrent_session_count(void); +v_BOOL_t vos_is_multiple_active_sta_sessions (void); +v_BOOL_t vos_is_sta_active_connection_exists (void); #ifdef WLAN_FEATURE_MBSSID v_BOOL_t vos_concurrent_sap_sessions_running(v_VOID_t); diff --git a/CORE/VOSS/src/vos_getBin.c b/CORE/VOSS/src/vos_getBin.c index 345527e652b4..f9a21c09ef8e 100644 --- a/CORE/VOSS/src/vos_getBin.c +++ b/CORE/VOSS/src/vos_getBin.c @@ -235,3 +235,60 @@ void vos_clear_concurrent_session_count(void) } } } + +/**--------------------------------------------------------------------------- + * + * \brief vos_is_multiple_active_sta_sessions() + * + * This function checks for presence of multiple active sta connections + * and it returns TRUE if the more than 1 active sta connection exists. + * + * \param - None + * + * \return - TRUE or FALSE + * + * --------------------------------------------------------------------------*/ +v_BOOL_t vos_is_multiple_active_sta_sessions (void) +{ + hdd_context_t *pHddCtx; + v_U8_t j = 0; + + v_CONTEXT_t pVosContext = vos_get_global_context(VOS_MODULE_ID_HDD, NULL); + if (NULL != pVosContext) { + pHddCtx = vos_get_context(VOS_MODULE_ID_HDD, pVosContext); + if (NULL != pHddCtx) { + j = pHddCtx->no_of_active_sessions[VOS_STA_MODE]; + } + } + + return (j > 1); +} + +/**--------------------------------------------------------------------------- + * + * \brief vos_is_sta_active_connection_exists() + * + * This function checks for the presence of active sta connection + * and it returns TRUE if exists. + * + * \param - None + * + * \return - VOS_TRUE or VOS_FALSE + * + * --------------------------------------------------------------------------*/ +v_BOOL_t vos_is_sta_active_connection_exists (void) +{ + hdd_context_t *pHddCtx; + v_U8_t j = 0; + + v_CONTEXT_t pVosContext = vos_get_global_context(VOS_MODULE_ID_HDD, NULL); + if (NULL != pVosContext) { + pHddCtx = vos_get_context(VOS_MODULE_ID_HDD, pVosContext); + if (NULL != pHddCtx) { + j = pHddCtx->no_of_active_sessions[VOS_STA_MODE]; + } + } + + return (j ? VOS_TRUE : VOS_FALSE); +} + diff --git a/CORE/VOSS/src/vos_nvitem.c b/CORE/VOSS/src/vos_nvitem.c index 9f8e30253c6c..929d6e6b770f 100644 --- a/CORE/VOSS/src/vos_nvitem.c +++ b/CORE/VOSS/src/vos_nvitem.c @@ -3571,22 +3571,22 @@ int wlan_hdd_linux_reg_notifier(struct wiphy *wiphy, (request->initiator == NL80211_REGDOM_SET_BY_CORE) || (request->initiator == NL80211_REGDOM_SET_BY_USER)) { - if (wiphy->bands[IEEE80211_BAND_5GHZ]) - { - for (j=0; j<wiphy->bands[IEEE80211_BAND_5GHZ]->n_channels; j++) - { - // UNII-1 band channels are passive when domain is FCC. - if ((wiphy->bands[IEEE80211_BAND_5GHZ ]->channels[j].center_freq == 5180 || - wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5200 || - wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5220 || - wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5240) && - ((request->alpha2[0]== 'U'&& request->alpha2[1]=='S') && - pHddCtx->nEnableStrictRegulatoryForFCC)) - { - wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].flags |= IEEE80211_CHAN_PASSIVE_SCAN; - } - } - } + if (pHddCtx->cfg_ini->gEnableStrictRegulatoryForFCC && + wiphy->bands[IEEE80211_BAND_5GHZ]) + { + for (j=0; j<wiphy->bands[IEEE80211_BAND_5GHZ]->n_channels; j++) + { + // UNII-1 band channels are passive when domain is FCC. + if ((wiphy->bands[IEEE80211_BAND_5GHZ ]->channels[j].center_freq == 5180 || + wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5200 || + wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5220 || + wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5240) && + (request->alpha2[0]== 'U' && request->alpha2[1]=='S')) + { + wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].flags |= IEEE80211_CHAN_PASSIVE_SCAN; + } + } + } } #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) @@ -4178,8 +4178,7 @@ int wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5200 || wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5220 || wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5240) && - ((domainIdCurrent == REGDOMAIN_FCC) && - pHddCtx->nEnableStrictRegulatoryForFCC)) + (ccode[0]== 'U' && ccode[1]=='S')) { wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].flags |= IEEE80211_CHAN_PASSIVE_SCAN; } @@ -4187,8 +4186,7 @@ int wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5200 || wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5220 || wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5240) && - ((domainIdCurrent != REGDOMAIN_FCC) || - !pHddCtx->nEnableStrictRegulatoryForFCC)) + (ccode[0]!= 'U' && ccode[1]!='S')) { wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; } @@ -4201,8 +4199,6 @@ int wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, } } - complete(&pHddCtx->wiphy_channel_update_event); - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) return; #else diff --git a/CORE/WDA/inc/legacy/halTypes.h b/CORE/WDA/inc/legacy/halTypes.h index 60864646752e..ba7c539a1fd6 100644 --- a/CORE/WDA/inc/legacy/halTypes.h +++ b/CORE/WDA/inc/legacy/halTypes.h @@ -214,7 +214,8 @@ typedef enum eHAL_STATUS_FT_PREAUTH_KEY_SUCCESS, eHAL_STATUS_FT_PREAUTH_KEY_FAILED, #endif - + //CMD not Queued in SME + eHAL_STATUS_CMD_NOT_QUEUED, // not a real status. Just a way to mark the maximum in the enum. eHAL_STATUS_MAX diff --git a/CORE/WDA/inc/wlan_qct_wda.h b/CORE/WDA/inc/wlan_qct_wda.h index 93a0791fb770..8961ea322dba 100644 --- a/CORE/WDA/inc/wlan_qct_wda.h +++ b/CORE/WDA/inc/wlan_qct_wda.h @@ -678,6 +678,8 @@ tANI_U8 WDA_MapChannel(tANI_U8); (((t_packetmeta *)pRxMeta)->offloadScanLearn) #define WDA_GET_ROAMCANDIDATEIND(pRxMeta) \ (((t_packetmeta *)pRxMeta)->roamCandidateInd) +#define WDA_GET_SESSIONID(pRxMeta) \ + (((t_packetmeta *)pRxMeta)->sessionId) #endif @@ -840,6 +842,8 @@ tANI_U8 WDA_MapChannel(tANI_U8); # define WDA_GET_OFFLOADSCANLEARN(pRxMeta) (((WDI_DS_RxMetaInfoType*)(pRxMeta))->offloadScanLearn) /* WDA_GET_ROAMCANDIDATEIND **************************************************/ # define WDA_GET_ROAMCANDIDATEIND(pRxMeta) (((WDI_DS_RxMetaInfoType*)(pRxMeta))->roamCandidateInd) +# define WDA_GET_SESSIONID(pRxMeta) \ + (((WDI_DS_RxMetaInfoType*)(pRxMeta))->sessionId) #endif /* WDA_GET_RX_RSSI_DB ********************************************************/ // Volans RF diff --git a/CORE/WDI/DP/inc/wlan_qct_wdi_ds.h b/CORE/WDI/DP/inc/wlan_qct_wdi_ds.h index 141c2dc508a6..fcd868fceaa8 100644 --- a/CORE/WDI/DP/inc/wlan_qct_wdi_ds.h +++ b/CORE/WDI/DP/inc/wlan_qct_wdi_ds.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2013 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -154,6 +154,7 @@ typedef struct wpt_uint32 offloadScanLearn; wpt_uint32 roamCandidateInd; #endif + wpt_uint32 sessionId; } WDI_DS_RxMetaInfoType; typedef struct sPktMetaInfo @@ -1152,6 +1152,7 @@ CDEFINES += -DCONFIG_ATH_PROCFS_DIAG_SUPPORT CDEFINES += -DQCA_SUPPORT_OL_RX_REORDER_TIMEOUT CDEFINES += -DCONFIG_ATH_PCIE_MAX_PERF=0 -DCONFIG_ATH_PCIE_AWAKE_WHILE_DRIVER_LOAD=0 -DCONFIG_DISABLE_CDC_MAX_PERF_WAR=0 CDEFINES += -DQCA_TX_HTT2_SUPPORT +CDEFINES += -DUSB_FW_CRASH_RAM_DUMP endif # enable the MAC Address auto-generation feature |
