From ba392e15cb2469cafbbb68b9ad86ecb28c9ee5c8 Mon Sep 17 00:00:00 2001 From: Peng Xu Date: Tue, 4 Nov 2014 18:28:33 -0800 Subject: qca-cld:hdd: Set proper IE field for HT20/HT40 mode Based on hostapd.conf, INI and iwpriv setphymode settings, set proper HT Capabilities, OBSS scan parameter and HT operation IE field in beacon. Change-Id: I7ba312d0eb3bfc6cdd71408efb5df3eb28800715 CRs-fixed: 748530 --- CORE/HDD/src/wlan_hdd_cfg80211.c | 32 +++++++++++++++++++++----------- CORE/HDD/src/wlan_hdd_wext.c | 12 +++++------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 0ac8f744ddb0..ef837e9a651f 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -5520,20 +5520,30 @@ static int wlan_hdd_cfg80211_set_channel( struct wiphy *wiphy, struct net_device default: hddLog(VOS_TRACE_LEVEL_ERROR, - "%s:Error!!! Invalid HT20/40 mode !", - __func__); + "%s:Error!!! Invalid HT20/40 mode: %d !", + __func__, channel_type); return -EINVAL; } + } else { + vos_mem_zero(&smeConfig, sizeof(smeConfig)); + sme_GetConfigParam(pHddCtx->hHal, &smeConfig); + /* set cbMode for 5G */ + switch (channel_type) { + case NL80211_CHAN_HT20: + case NL80211_CHAN_NO_HT: + smeConfig.csrConfig.channelBondingMode5GHz = 0; + break; + case NL80211_CHAN_HT40MINUS: + case NL80211_CHAN_HT40PLUS: + smeConfig.csrConfig.channelBondingMode5GHz = 1; + break; + default: + hddLog(LOGE, + FL("Error!!! Invalid HT20/40 mode: %d !"), channel_type); + return -EINVAL; + } + sme_UpdateConfig(pHddCtx->hHal, &smeConfig); } - - vos_mem_zero(&smeConfig, sizeof(smeConfig)); - sme_GetConfigParam(pHddCtx->hHal, &smeConfig); - if (NL80211_CHAN_NO_HT == channel_type) - smeConfig.csrConfig.obssEnabled = VOS_FALSE; - else - smeConfig.csrConfig.obssEnabled = VOS_TRUE; - sme_UpdateConfig (pHddCtx->hHal, &smeConfig); - #endif } } diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c index bc1b94ffed1e..ad49b0164912 100644 --- a/CORE/HDD/src/wlan_hdd_wext.c +++ b/CORE/HDD/src/wlan_hdd_wext.c @@ -4691,14 +4691,12 @@ int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal, } } else if (phymode == eCSR_DOT11_MODE_11n && chwidth == WNI_CFG_CHANNEL_BONDING_MODE_ENABLE) { - if (phddctx->cfg_ini->ht2040CoexEnabled) { - smeconfig.csrConfig.obssEnabled = eANI_BOOLEAN_TRUE; - halStatus = sme_SetHT2040Mode(hal, pAdapter->sessionId, + smeconfig.csrConfig.obssEnabled = eANI_BOOLEAN_TRUE; + halStatus = sme_SetHT2040Mode(hal, pAdapter->sessionId, eHT_CHAN_HT20, eANI_BOOLEAN_TRUE); - if (halStatus == eHAL_STATUS_FAILURE) { - hddLog(LOGE, FL("Failed to enable OBSS")); - return -EIO; - } + if (halStatus == eHAL_STATUS_FAILURE) { + hddLog(LOGE, FL("Failed to enable OBSS")); + return -EIO; } } #endif -- cgit v1.2.3 From 120b9ef2d1c388d334499e099bc05549b0f41e01 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Lokere Date: Tue, 4 Nov 2014 17:33:07 -0800 Subject: qcacld: Reset the center frequency segment with fallback Reset the center frequency segment when SAP fallbacks to 20/40Mhz mode from 80MHz. Change-Id: I72ee1ddf4e19eb27fcc29add41b42cf7f52195af CRs-Fixed: 750795 --- CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c | 1 + 1 file changed, 1 insertion(+) diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c index ead2b8ca5b30..8951233da9cc 100644 --- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c @@ -5986,6 +5986,7 @@ limProcessSmeChannelChangeRequest(tpAniSirGlobal pMac, tANI_U32 *pMsg) limLog(pMac, LOGP, FL("couldn't reset center freq seg 0 in beacon")); } + psessionEntry->apCenterChan = 0; } if (chanWidth == eHT_CHANNEL_WIDTH_80MHZ) { -- cgit v1.2.3 From 3be6e0fcd7efa0faded13af30ea19a8bb450f428 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Thu, 6 Nov 2014 13:01:14 -0800 Subject: qcacld-2.0: Fix of wlan logger thread getting stuck if cnss_diag is not registered then do not wake up logger thread also do not send any broadcast indication from WLAN driver to CNSS_DIAG. CNSS_DIAG to check WLAN interface status and register itself once it detects WLAN interface is up. Change-Id: I5e829b13b1608cb11290a30ec6dd73d5f66d6c9d CRs-fixed: 750700 --- CORE/SVC/src/logging/wlan_logging_sock_svc.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/CORE/SVC/src/logging/wlan_logging_sock_svc.c b/CORE/SVC/src/logging/wlan_logging_sock_svc.c index f8e77ce2549b..7157e5ddd538 100644 --- a/CORE/SVC/src/logging/wlan_logging_sock_svc.c +++ b/CORE/SVC/src/logging/wlan_logging_sock_svc.c @@ -365,11 +365,10 @@ int wlan_log_to_user(VOS_TRACE_LEVEL log_level, char *to_be_sent, int length) /* Wakeup logger thread */ if ((true == wake_up_thread)) { /* If there is logger app registered wakeup the logging - * thread Else broadcast a Ready Indication message, - * apps which are waiting on this message can - * register for the logs. - */ - wake_up_interruptible(&gwlan_logging.wait_queue); + * thread + */ + if (gapp_pid != INVALID_PID) + wake_up_interruptible(&gwlan_logging.wait_queue); } if ((gapp_pid != INVALID_PID) @@ -503,11 +502,6 @@ static int wlan_logging_thread(void *Arg) break; } - if (INVALID_PID == gapp_pid) { - wlan_logging_srv_nl_ready_indication(); - continue; - } - ret = send_filled_buffers_to_user(); if (-ENOMEM == ret) { msleep(200); -- cgit v1.2.3 From d96de5db012f6a304ff688ac6676b89ba07dab13 Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Thu, 6 Nov 2014 14:06:40 -0800 Subject: qcacld: Fix the handling of invalid input to SETBAND The root cause, if the command is "SETBAND 100" the existing code reads only the 8th byte and ignores the following bytes and hence "SETBAND 100" is treated similar to "SETBAND 1" and proceeds without throwing error. The fix is to read the entire ASCII string and convert it to integer and let the code take care of error handling. Change-Id: Ibcd1a7a5c88e9b05c49d54ef3c7163be536c5f25 CRs-Fixed: 752065 --- CORE/HDD/src/wlan_hdd_wext.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c index ad49b0164912..fdc4e0a76be3 100644 --- a/CORE/HDD/src/wlan_hdd_wext.c +++ b/CORE/HDD/src/wlan_hdd_wext.c @@ -9513,12 +9513,17 @@ int hdd_setBand(struct net_device *dev, u8 ui_band) int hdd_setBand_helper(struct net_device *dev, const char *command) { u8 band; + int ret; - /*convert the band value from ascii to integer*/ - band = command[WLAN_HDD_UI_SET_BAND_VALUE_OFFSET] - '0'; + /* Convert the band value from ascii to integer */ + command += WLAN_HDD_UI_SET_BAND_VALUE_OFFSET; + ret = kstrtou8(command, 10, &band); + if (ret < 0) { + hddLog(LOGE, FL("kstrtou8 failed")); + return -EINVAL; + } return hdd_setBand(dev, band); - } static int iw_set_band_config(struct net_device *dev, -- cgit v1.2.3 From a5b5b3ebb9c47bb81061813cb8340809ce8ff7dd Mon Sep 17 00:00:00 2001 From: Ganesh Babu Kumaravel Date: Wed, 5 Nov 2014 16:32:34 +0530 Subject: qcacld:SDIO Fix for Data Stall issue There is race where HTCSendDataPkt() thinks the tx queue is in access by referring TxProcessCount so it puts the data in tx queue and returns. But HTCTrySend() which gets called from HTCTxCompletionHandler() serviced the queue but not yet cleared the TxProcessCount. But unlocks the traget htc lock. This race results in a case where the tx packet is not processed at all and txrx scheduler is waiting for this credit to download other packets. So fix it by unlocking the htc lock after clearing TxProcessCount. CRs-Fixed: 751626 Change-Id: If00d9e8c4757313671c58aee3d9869553424fdd6 --- CORE/SERVICES/HTC/htc_send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CORE/SERVICES/HTC/htc_send.c b/CORE/SERVICES/HTC/htc_send.c index aa22965383f7..72056ade7667 100644 --- a/CORE/SERVICES/HTC/htc_send.c +++ b/CORE/SERVICES/HTC/htc_send.c @@ -894,9 +894,9 @@ static HTC_SEND_QUEUE_RESULT HTCTrySend(HTC_TARGET *target, } - UNLOCK_HTC_TX(target); /* done with this endpoint, we can clear the count */ adf_os_atomic_init(&pEndpoint->TxProcessCount); + UNLOCK_HTC_TX(target); AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("-HTCTrySend: \n")); -- cgit v1.2.3 From 868632df365259080edcd03dd1a4a9ae89d98b06 Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Fri, 22 Aug 2014 11:50:41 -0700 Subject: qcacld: UMAC: Use the defined macros consistently across In the UMAC code, limSystemRole variable is accessed in three ways, 1. Directly accessing the variable psessionEntry->limSystemRole; 2. Using GET_LIM_SYSTEM_ROLE macro; and 3. By invoking the function limGetSystemRole(). With this change, use GET_LIM_SYSTEM_ROLE to access the variable consistently across. Similarly replace pMac->gDriverType with ANI_DRIVER_TYPE(pMac). Change-Id: I82c083afd96f7fa8514a2fcc5aa11cef349c4851 CRs-Fixed: 745779 --- CORE/MAC/inc/sirApi.h | 4 +- CORE/MAC/src/cfg/cfgApi.c | 33 +- CORE/MAC/src/pe/include/limApi.h | 22 +- CORE/MAC/src/pe/lim/limAIDmgmt.c | 6 +- CORE/MAC/src/pe/lim/limApi.c | 14 +- CORE/MAC/src/pe/lim/limAssocUtils.c | 156 ++++------ CORE/MAC/src/pe/lim/limFT.c | 28 +- CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c | 28 +- CORE/MAC/src/pe/lim/limLogDump.c | 23 +- CORE/MAC/src/pe/lim/limP2P.c | 5 +- CORE/MAC/src/pe/lim/limProcessActionFrame.c | 33 +- CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c | 43 ++- CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c | 12 +- CORE/MAC/src/pe/lim/limProcessAuthFrame.c | 105 +++---- CORE/MAC/src/pe/lim/limProcessCfgUpdates.c | 21 +- CORE/MAC/src/pe/lim/limProcessDeauthFrame.c | 20 +- CORE/MAC/src/pe/lim/limProcessDisassocFrame.c | 14 +- CORE/MAC/src/pe/lim/limProcessMessageQueue.c | 25 +- CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c | 123 ++++---- CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c | 145 ++++----- CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c | 32 +- CORE/MAC/src/pe/lim/limProcessProbeRspFrame.c | 7 +- CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c | 137 ++++---- CORE/MAC/src/pe/lim/limProcessTdls.c | 21 +- CORE/MAC/src/pe/lim/limSecurityUtils.c | 37 +-- CORE/MAC/src/pe/lim/limSendManagementFrames.c | 35 +-- CORE/MAC/src/pe/lim/limSendSmeRspMessages.c | 27 +- CORE/MAC/src/pe/lim/limTimerUtils.c | 10 +- CORE/MAC/src/pe/lim/limUtils.c | 413 ++++++++++--------------- CORE/MAC/src/pe/lim/limUtils.h | 4 +- CORE/MAC/src/pe/sch/schApi.c | 12 +- CORE/MAC/src/pe/sch/schBeaconGen.c | 51 ++- CORE/MAC/src/pe/sch/schBeaconProcess.c | 25 +- CORE/MAC/src/pe/sch/schMessage.c | 10 +- CORE/SYS/legacy/src/system/src/macInitApi.c | 6 +- CORE/SYS/legacy/src/utils/src/parserApi.c | 68 ++-- 36 files changed, 743 insertions(+), 1012 deletions(-) diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index 227bbd533052..5f803804f6f2 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -3211,6 +3211,7 @@ typedef struct sSirWPSProbeRspIE { #define SIR_WPS_BEACON_SELECTEDREGISTRACFGMETHOD_PRESENT 0x00000020 #define SIR_WPS_BEACON_UUIDE_PRESENT 0x00000080 #define SIR_WPS_BEACON_RF_BANDS_PRESENT 0x00000100 +#define SIR_WPS_UUID_LEN 16 typedef struct sSirWPSBeaconIE { v_U32_t FieldPresent; @@ -3220,7 +3221,7 @@ typedef struct sSirWPSBeaconIE { v_BOOL_t SelectedRegistra; //BOOL: indicates if the user has recently activated a Registrar to add an Enrollee. v_U16_t DevicePasswordID; // Device Password ID v_U16_t SelectedRegistraCfgMethod; // Selected Registrar config method - v_U8_t UUID_E[16]; // Unique identifier of the AP. + v_U8_t UUID_E[SIR_WPS_UUID_LEN]; /* Unique identifier of the AP */ v_U8_t RFBand; // RF bands available on the AP } tSirWPSBeaconIE; @@ -3279,7 +3280,6 @@ typedef struct sSirSetHT2040Mode } tSirSetHT2040Mode, *tpSirSetHT2040Mode; #endif -#define SIR_WPS_UUID_LEN 16 #define SIR_WPS_PBC_WALK_TIME 120 // 120 Second typedef struct sSirWPSPBCSession { diff --git a/CORE/MAC/src/cfg/cfgApi.c b/CORE/MAC/src/cfg/cfgApi.c index d34961b8f6e5..343fd6e41540 100644 --- a/CORE/MAC/src/cfg/cfgApi.c +++ b/CORE/MAC/src/cfg/cfgApi.c @@ -835,18 +835,18 @@ cfgGetCapabilityInfo(tpAniSirGlobal pMac, tANI_U16 *pCap,tpPESession sessionEntr { tANI_U32 val = 0; tpSirMacCapabilityInfo pCapInfo; - tLimSystemRole systemRole = limGetSystemRole(sessionEntry); *pCap = 0; pCapInfo = (tpSirMacCapabilityInfo) pCap; - if (systemRole == eLIM_STA_IN_IBSS_ROLE) + if (LIM_IS_IBSS_ROLE(sessionEntry)) pCapInfo->ibss = 1; // IBSS bit - else if ( (systemRole == eLIM_AP_ROLE) ||(systemRole == eLIM_BT_AMP_AP_ROLE)||(systemRole == eLIM_BT_AMP_STA_ROLE) || - (systemRole == eLIM_STA_ROLE) ) + else if (LIM_IS_AP_ROLE(sessionEntry) || + LIM_IS_BT_AMP_AP_ROLE(sessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(sessionEntry) || + LIM_IS_STA_ROLE(sessionEntry)) pCapInfo->ess = 1; // ESS bit - else if (limGetSystemRole(sessionEntry) == eLIM_P2P_DEVICE_ROLE ) - { + else if (LIM_IS_P2P_DEVICE_ROLE(sessionEntry)) { pCapInfo->ess = 0; pCapInfo->ibss = 0; } @@ -854,12 +854,9 @@ cfgGetCapabilityInfo(tpAniSirGlobal pMac, tANI_U16 *pCap,tpPESession sessionEntr cfgLog(pMac, LOGP, FL("can't get capability, role is UNKNOWN!!")); - if(systemRole == eLIM_AP_ROLE) - { + if (LIM_IS_AP_ROLE(sessionEntry)) { val = sessionEntry->privacy; - } - else - { + } else { // PRIVACY bit if (wlan_cfgGetInt(pMac, WNI_CFG_PRIVACY_ENABLED, &val) != eSIR_SUCCESS) { @@ -890,12 +887,9 @@ cfgGetCapabilityInfo(tpAniSirGlobal pMac, tANI_U16 *pCap,tpPESession sessionEntr return eSIR_SUCCESS; // Short slot time bit - if (systemRole == eLIM_AP_ROLE) - { + if (LIM_IS_AP_ROLE(sessionEntry)) { pCapInfo->shortSlotTime = sessionEntry->shortSlotTimeSupported; - } - else - { + } else { if (wlan_cfgGetInt(pMac, WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED, &val) != eSIR_SUCCESS) { @@ -916,9 +910,7 @@ cfgGetCapabilityInfo(tpAniSirGlobal pMac, tANI_U16 *pCap,tpPESession sessionEntr } // Spectrum Management bit - if((eLIM_STA_IN_IBSS_ROLE != systemRole) && - sessionEntry->lim11hEnable ) - { + if (!LIM_IS_IBSS_ROLE(sessionEntry) && sessionEntry->lim11hEnable) { if (wlan_cfgGetInt(pMac, WNI_CFG_11H_ENABLED, &val) != eSIR_SUCCESS) { cfgLog(pMac, LOGP, FL("cfg get WNI_CFG_11H_ENABLED failed")); @@ -947,8 +939,7 @@ cfgGetCapabilityInfo(tpAniSirGlobal pMac, tANI_U16 *pCap,tpPESession sessionEntr pCapInfo->apsd = 1; #if defined WLAN_FEATURE_VOWIFI - if ((limGetSystemRole(sessionEntry) == eLIM_STA_ROLE) ) - { + if (LIM_IS_STA_ROLE(sessionEntry)) { if (wlan_cfgGetInt(pMac, WNI_CFG_RRM_ENABLED, &val) != eSIR_SUCCESS) { cfgLog(pMac, LOGP, FL("cfg get WNI_CFG_RRM_ENABLED failed")); diff --git a/CORE/MAC/src/pe/include/limApi.h b/CORE/MAC/src/pe/include/limApi.h index 76200c1ec8de..8e6d8f51e51e 100644 --- a/CORE/MAC/src/pe/include/limApi.h +++ b/CORE/MAC/src/pe/include/limApi.h @@ -56,9 +56,22 @@ /* Useful macros for fetching various states in pMac->lim */ /* gLimSystemRole */ #define GET_LIM_SYSTEM_ROLE(psessionEntry) (psessionEntry->limSystemRole) -#define LIM_IS_AP_ROLE(psessionEntry) (GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_AP_ROLE) -#define LIM_IS_STA_ROLE(psessionEntry) (GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_STA_ROLE) -#define LIM_IS_IBSS_ROLE(psessionEntry) (GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_STA_IN_IBSS_ROLE) +#define LIM_IS_UNKNOWN_ROLE(psessionEntry) \ + (GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_UNKNOWN_ROLE) +#define LIM_IS_AP_ROLE(psessionEntry) \ + (GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_AP_ROLE) +#define LIM_IS_BT_AMP_AP_ROLE(psessionEntry) \ + (GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_BT_AMP_AP_ROLE) +#define LIM_IS_BT_AMP_STA_ROLE(psessionEntry) \ + (GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_BT_AMP_STA_ROLE) +#define LIM_IS_STA_ROLE(psessionEntry) \ + (GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_STA_ROLE) +#define LIM_IS_IBSS_ROLE(psessionEntry) \ + (GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_STA_IN_IBSS_ROLE) +#define LIM_IS_P2P_DEVICE_ROLE(psessionEntry) \ + (GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_P2P_DEVICE_ROLE) +#define LIM_IS_P2P_DEVICE_GO(psessionEntry) \ + (GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_P2P_DEVICE_GO) /* gLimSmeState */ #define GET_LIM_SME_STATE(pMac) (pMac->lim.gLimSmeState) #define SET_LIM_SME_STATE(pMac, state) (pMac->lim.gLimSmeState = state) @@ -131,9 +144,6 @@ extern tSirRetStatus limHandleIBSScoalescing(tpAniSirGlobal, /// Function used by other Sirius modules to read global SME state static inline tLimSmeStates limGetSmeState(tpAniSirGlobal pMac) { return pMac->lim.gLimSmeState; } -/// Function used by other Sirius modules to read global system role - static inline tLimSystemRole -limGetSystemRole(tpPESession psessionEntry) { return psessionEntry->limSystemRole; } extern void limReceivedHBHandler(tpAniSirGlobal, tANI_U8, tpPESession); extern void limCheckAndQuietBSS(tpAniSirGlobal); /// Function that triggers STA context deletion diff --git a/CORE/MAC/src/pe/lim/limAIDmgmt.c b/CORE/MAC/src/pe/lim/limAIDmgmt.c index 25600cb1dce8..26d27159ca96 100644 --- a/CORE/MAC/src/pe/lim/limAIDmgmt.c +++ b/CORE/MAC/src/pe/lim/limAIDmgmt.c @@ -84,15 +84,13 @@ limInitPeerIdxpool(tpAniSirGlobal pMac,tpPESession pSessionEntry) //In station role, DPH_STA_HASH_INDEX_PEER (index 1) is reserved for peer //station index corresponding to AP. Avoid choosing that index and get index //starting from (DPH_STA_HASH_INDEX_PEER + 1) (index 2) for TDLS stations; - if (pSessionEntry->limSystemRole == eLIM_STA_ROLE ) - { + if (LIM_IS_STA_ROLE(pSessionEntry)) { pSessionEntry->freePeerIdxHead = DPH_STA_HASH_INDEX_PEER + 1; } else #endif #ifdef QCA_IBSS_SUPPORT - if (pSessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) - { + if (LIM_IS_IBSS_ROLE(pSessionEntry)) { pSessionEntry->freePeerIdxHead=LIM_START_PEER_IDX; maxAssocSta = pMac->lim.gLimIbssStaLimit; } diff --git a/CORE/MAC/src/pe/lim/limApi.c b/CORE/MAC/src/pe/lim/limApi.c index 359c16a0e0b7..6197a138a446 100644 --- a/CORE/MAC/src/pe/lim/limApi.c +++ b/CORE/MAC/src/pe/lim/limApi.c @@ -1101,13 +1101,12 @@ tSirRetStatus pePostMsgApi(tpAniSirGlobal pMac, tSirMsgQ *pMsg) tSirRetStatus peProcessMessages(tpAniSirGlobal pMac, tSirMsgQ* pMsg) { - if(pMac->gDriverType == eDRIVER_TYPE_MFG) - { + if (ANI_DRIVER_TYPE(pMac) == eDRIVER_TYPE_MFG) { return eSIR_SUCCESS; } /** - * If the Message to be handled is for CFG Module call the CFG Msg Handler and - * for all the other cases post it to LIM + * If the Message to be handled is for CFG Module call the CFG Msg Handler + * and for all the other cases post it to LIM */ if ( SIR_CFG_PARAM_UPDATE_IND != pMsg->type && IS_CFG_MSG(pMsg->type)) cfgProcessMbMsg(pMac, (tSirMbMsg*)pMsg->bodyptr); @@ -2045,7 +2044,7 @@ void limRoamOffloadSynchInd(tpAniSirGlobal pMac, tpSirMsgQ pMsg) return; } /* Nothing to be done if the session is not in STA mode */ - if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { + if (!LIM_IS_STA_ROLE(psessionEntry)) { PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) return; } @@ -2284,9 +2283,8 @@ tMgmtFrmDropReason limIsPktCandidateForDrop(tpAniSirGlobal pMac, tANI_U8 *pRxPac { pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); psessionEntry = peFindSessionByBssid(pMac, pHdr->bssId, &sessionId); - if ((psessionEntry && - psessionEntry->limSystemRole != eLIM_STA_IN_IBSS_ROLE) || - (!psessionEntry)) + if ((psessionEntry && !LIM_IS_IBSS_ROLE(psessionEntry)) || + (!psessionEntry)) return eMGMT_DROP_NO_DROP; //Drop the Probe Request in IBSS mode, if STA did not send out the last beacon diff --git a/CORE/MAC/src/pe/lim/limAssocUtils.c b/CORE/MAC/src/pe/lim/limAssocUtils.c index a126f92abdd2..1385f451c1f8 100644 --- a/CORE/MAC/src/pe/lim/limAssocUtils.c +++ b/CORE/MAC/src/pe/lim/limAssocUtils.c @@ -149,11 +149,9 @@ limCompareCapabilities(tpAniSirGlobal pMac, { tANI_U32 val; - - if ( ((psessionEntry->limSystemRole == eLIM_AP_ROLE)|| - (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) && - (pAssocReq->capabilityInfo.ibss) ) - { + if ((LIM_IS_AP_ROLE(psessionEntry)|| + LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) && + (pAssocReq->capabilityInfo.ibss)) { // Requesting STA asserting IBSS capability. limLog(pMac, LOG1,FL("Requesting STA asserting IBSS capability")); return false; @@ -208,9 +206,9 @@ limCompareCapabilities(tpAniSirGlobal pMac, * then AP must reject any station that does not support * shortSlot */ - if ( ((psessionEntry->limSystemRole == eLIM_AP_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) && (pLocalCapabs->shortSlotTime == 1) ) - - { + if ((LIM_IS_AP_ROLE(psessionEntry) || + LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) && + (pLocalCapabs->shortSlotTime == 1)) { if (wlan_cfgGetInt(pMac, WNI_CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY, &val) != eSIR_SUCCESS) { limLog(pMac, LOGP, FL("error getting WNI_CFG_FORCE_SHORT_SLOT_ASSOC_ONLY ")); @@ -653,9 +651,8 @@ limCleanupRxPath(tpAniSirGlobal pMac, tpDphHashNode pStaDs,tpPESession psessionE * There is no context to delete. * Release our assigned AID back to the free pool */ - if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) || - (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) - { + if (LIM_IS_AP_ROLE(psessionEntry) || + LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { limReleasePeerIdx(pMac, pStaDs->assocId, psessionEntry); } limDeleteDphHashEntry(pMac, pStaDs->staAddr, pStaDs->assocId,psessionEntry); @@ -676,8 +673,8 @@ limCleanupRxPath(tpAniSirGlobal pMac, tpDphHashNode pStaDs,tpPESession psessionE pStaDs->valid = 0; pStaDs->mlmStaContext.mlmState = eLIM_MLM_WT_DEL_STA_RSP_STATE; - if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) - { + if (LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) { MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, eLIM_MLM_WT_DEL_STA_RSP_STATE)); psessionEntry->limMlmState = eLIM_MLM_WT_DEL_STA_RSP_STATE; /* Deactivating probe after heart beat timer */ @@ -756,8 +753,8 @@ limSendDelStaCnf(tpAniSirGlobal pMac, tSirMacAddr staDsAddr, staDsAssocId, mlmStaContext.cleanupTrigger, statusCode, MAC_ADDR_ARRAY(staDsAddr)); - if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) - { + if (LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) { // Set BSSID at CFG to null tSirMacAddr nullAddr = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; @@ -893,13 +890,10 @@ limSendDelStaCnf(tpAniSirGlobal pMac, tSirMacAddr staDsAddr, } - if((NULL != psessionEntry) - && (eLIM_AP_ROLE != psessionEntry->limSystemRole ) - ) - { - peDeleteSession(pMac,psessionEntry); - psessionEntry = NULL; - } + if ((NULL != psessionEntry) && (!LIM_IS_AP_ROLE(psessionEntry))) { + peDeleteSession(pMac, psessionEntry); + psessionEntry = NULL; + } } /** @@ -1335,9 +1329,8 @@ limDecideShortSlot(tpAniSirGlobal pMac, tpDphHashNode pStaDs, pMac->lim.gLimNoShortSlotParams.numNonShortSlotSta); limPrintMacAddr(pMac, pStaDs->staAddr, LOG1);) - if ((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && - psessionEntry->gLimNoShortSlotParams.numNonShortSlotSta> 0) - { + if (LIM_IS_AP_ROLE(psessionEntry) && + psessionEntry->gLimNoShortSlotParams.numNonShortSlotSta > 0) { for (i=0; igLimNoShortSlotParams.staNoShortSlotCache[i].active) @@ -1351,9 +1344,7 @@ limDecideShortSlot(tpAniSirGlobal pMac, tpDphHashNode pStaDs, } } } - } - else - { + } else { if (pMac->lim.gLimNoShortSlotParams.numNonShortSlotSta> 0) { for (i=0; ilimSystemRole == eLIM_AP_ROLE ) && - (val && psessionEntry->gLimNoShortSlotParams.numNonShortSlotSta == 0)) - { + if (LIM_IS_AP_ROLE(psessionEntry) && + (val && psessionEntry->gLimNoShortSlotParams.numNonShortSlotSta == 0)) { // enable short slot time //reset the cache vos_mem_set((tANI_U8 *)&psessionEntry->gLimNoShortSlotParams, sizeof(tLimNoShortSlotParams), 0); // in case of AP set SHORT_SLOT_TIME to enable - if (psessionEntry->limSystemRole == eLIM_AP_ROLE) - { - pBeaconParams->fShortSlotTime = true; - pBeaconParams->paramChangeBitmap |= PARAM_SHORT_SLOT_TIME_CHANGED; - psessionEntry->shortSlotTimeSupported = true; - } - } - else - { - if (val && pMac->lim.gLimNoShortSlotParams.numNonShortSlotSta == 0) - { + pBeaconParams->fShortSlotTime = true; + pBeaconParams->paramChangeBitmap |= PARAM_SHORT_SLOT_TIME_CHANGED; + psessionEntry->shortSlotTimeSupported = true; + } else { + if (val && pMac->lim.gLimNoShortSlotParams.numNonShortSlotSta == 0) { // enable short slot time //reset the cache vos_mem_set((tANI_U8 *)&pMac->lim.gLimNoShortSlotParams, sizeof(tLimNoShortSlotParams), 0); // in case of AP set SHORT_SLOT_TIME to enable - if (psessionEntry->limSystemRole == eLIM_AP_ROLE) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { pBeaconParams->fShortSlotTime = true; pBeaconParams->paramChangeBitmap |= PARAM_SHORT_SLOT_TIME_CHANGED; psessionEntry->shortSlotTimeSupported = true; @@ -1514,9 +1497,10 @@ limIsReassocInProgress(tpAniSirGlobal pMac,tpPESession psessionEntry) { return eANI_BOOLEAN_FALSE; } - if(((psessionEntry->limSystemRole == eLIM_STA_ROLE) || (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE))&& - ((psessionEntry->limSmeState == eLIM_SME_WT_REASSOC_STATE) || - (psessionEntry->limSmeState == eLIM_SME_WT_REASSOC_LINK_FAIL_STATE))) + if ((LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) && + ((psessionEntry->limSmeState == eLIM_SME_WT_REASSOC_STATE) || + (psessionEntry->limSmeState == eLIM_SME_WT_REASSOC_LINK_FAIL_STATE))) return eANI_BOOLEAN_TRUE; return eANI_BOOLEAN_FALSE; @@ -2269,7 +2253,8 @@ limAddSta( sirCopyMacAddr(staMac,psessionEntry->selfMacAddr); limLog(pMac, LOG1, FL("sessionid: %d updateEntry = %d limsystemrole = %d "), - psessionEntry->smeSessionId, updateEntry, psessionEntry->limSystemRole); + psessionEntry->smeSessionId, updateEntry, + GET_LIM_SYSTEM_ROLE(psessionEntry)); pAddStaParams = vos_mem_malloc(sizeof(tAddStaParams)); if (NULL == pAddStaParams) @@ -2279,9 +2264,8 @@ limAddSta( } vos_mem_set((tANI_U8 *) pAddStaParams, sizeof(tAddStaParams), 0); - if ((limGetSystemRole(psessionEntry) == eLIM_AP_ROLE) || - (limGetSystemRole(psessionEntry) == eLIM_STA_IN_IBSS_ROLE) || - (limGetSystemRole(psessionEntry) == eLIM_BT_AMP_AP_ROLE) ) + if (LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_IBSS_ROLE(psessionEntry) || + LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) pStaAddr = &pStaDs->staAddr; #ifdef FEATURE_WLAN_TDLS /* SystemRole shouldn't be matter if staType is TDLS peer */ @@ -2315,9 +2299,9 @@ limAddSta( pAddStaParams->wmmEnabled = pStaDs->qosMode; pAddStaParams->listenInterval = pStaDs->mlmStaContext.listenInterval; pAddStaParams->shortPreambleSupported = pStaDs->shortPreambleEnabled; - if((limGetSystemRole(psessionEntry) == eLIM_AP_ROLE) && (pStaDs->mlmStaContext.subType == LIM_REASSOC)) - { - /* TBD - need to remove this REASSOC check after fixinf rmmod issue */ + if (LIM_IS_AP_ROLE(psessionEntry) && + (pStaDs->mlmStaContext.subType == LIM_REASSOC)) { + /* TBD - need to remove this REASSOC check after fixing rmmod issue */ pAddStaParams->updateSta = pStaDs->mlmStaContext.updateContext; } pStaDs->valid = 0; @@ -2348,8 +2332,8 @@ limAddSta( pAddStaParams->respReqd = 1; //Update HT Capability - if ((limGetSystemRole(psessionEntry) == eLIM_AP_ROLE) ||(limGetSystemRole(psessionEntry) == eLIM_BT_AMP_AP_ROLE) || (limGetSystemRole(psessionEntry) == eLIM_STA_IN_IBSS_ROLE)) - { + if (LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_BT_AMP_AP_ROLE(psessionEntry) || + LIM_IS_IBSS_ROLE(psessionEntry)) { pAddStaParams->htCapable = pStaDs->mlmStaContext.htCapability; #ifdef WLAN_FEATURE_11AC pAddStaParams->vhtCapable = pStaDs->mlmStaContext.vhtCapability; @@ -2508,9 +2492,7 @@ limAddSta( SIR_MAC_VHT_CAP_TX_ANTENNA_PATTERN) | (pAssocReq->VHTCaps.reserved1 << SIR_MAC_VHT_CAP_RESERVED2)); } - } - else if (limGetSystemRole(psessionEntry) == eLIM_STA_IN_IBSS_ROLE) { - + } else if (LIM_IS_IBSS_ROLE(psessionEntry)) { /* in IBSS mode, use peer node as the source of ht_caps and vht_caps */ pPeerNode = limIbssPeerFind(pMac, *pStaAddr); if (!pPeerNode) { @@ -2601,10 +2583,11 @@ limAddSta( } #ifdef FEATURE_WLAN_TDLS - if(pStaDs->wmeEnabled && \ - ((eLIM_AP_ROLE == psessionEntry->limSystemRole) || (STA_ENTRY_TDLS_PEER == pStaDs->staType)) ) + if(pStaDs->wmeEnabled && + (LIM_IS_AP_ROLE(psessionEntry) || + (STA_ENTRY_TDLS_PEER == pStaDs->staType))) #else - if(pStaDs->wmeEnabled && (eLIM_AP_ROLE == psessionEntry->limSystemRole)) + if (pStaDs->wmeEnabled && LIM_IS_AP_ROLE(psessionEntry)) #endif { pAddStaParams->uAPSD = 0; @@ -2738,9 +2721,11 @@ limDelSta( // #ifdef FEATURE_WLAN_TDLS - if( ((eLIM_STA_ROLE == GET_LIM_SYSTEM_ROLE(psessionEntry)) && (pStaDs->staType != STA_ENTRY_TDLS_PEER)) ||(eLIM_BT_AMP_STA_ROLE == GET_LIM_SYSTEM_ROLE(psessionEntry)) ) + if ((LIM_IS_STA_ROLE(psessionEntry) && + (pStaDs->staType != STA_ENTRY_TDLS_PEER)) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) #else - if( (eLIM_STA_ROLE == GET_LIM_SYSTEM_ROLE(psessionEntry)) ||(eLIM_BT_AMP_STA_ROLE == GET_LIM_SYSTEM_ROLE(psessionEntry)) ) + if (LIM_IS_STA_ROLE(psessionEntry) || LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) #endif pDelStaParams->staIdx= psessionEntry->staId; @@ -2760,9 +2745,8 @@ limDelSta( MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, eLIM_MLM_WT_DEL_STA_RSP_STATE)); SET_LIM_STA_CONTEXT_MLM_STATE(pStaDs, eLIM_MLM_WT_DEL_STA_RSP_STATE); } - if ( (eLIM_STA_ROLE == GET_LIM_SYSTEM_ROLE(psessionEntry)) || - (eLIM_BT_AMP_STA_ROLE == GET_LIM_SYSTEM_ROLE(psessionEntry)) ) - { + if (LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) { MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, eLIM_MLM_WT_DEL_STA_RSP_STATE)); psessionEntry->limMlmState = eLIM_MLM_WT_DEL_STA_RSP_STATE; @@ -3168,7 +3152,6 @@ limTeardownInfraBss(tpAniSirGlobal pMac,tpPESession psessionEntry) void limHandleCnfWaitTimeout(tpAniSirGlobal pMac, tANI_U16 staId) { tpDphHashNode pStaDs; - tLimSystemRole systemRole; tpPESession psessionEntry = NULL; if((psessionEntry = peFindSessionBySessionId(pMac, pMac->lim.limTimers.gpLimCnfWaitTimer[staId].sessionId))== NULL) @@ -3176,7 +3159,6 @@ void limHandleCnfWaitTimeout(tpAniSirGlobal pMac, tANI_U16 staId) limLog(pMac, LOGP,FL("Session Does not exist for given sessionID")); return; } - systemRole = limGetSystemRole(psessionEntry); pStaDs = dphGetHashEntry(pMac, staId, &psessionEntry->dph.dphHashTable); if (pStaDs == NULL) @@ -3190,8 +3172,8 @@ void limHandleCnfWaitTimeout(tpAniSirGlobal pMac, tANI_U16 staId) PELOGW(limLog(pMac, LOGW, FL("Did not receive Assoc Cnf in eLIM_MLM_WT_ASSOC_CNF_STATE sta Assoc id %d"), pStaDs->assocId);) limPrintMacAddr(pMac, pStaDs->staAddr, LOGW); - if ( (systemRole == eLIM_AP_ROLE)|| (systemRole == eLIM_BT_AMP_AP_ROLE) ) - { + if (LIM_IS_AP_ROLE(psessionEntry) || + LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { limRejectAssociation( pMac, pStaDs->staAddr, @@ -3236,7 +3218,6 @@ limDeleteDphHashEntry(tpAniSirGlobal pMac, tSirMacAddr staAddr, tANI_U16 staId,t tANI_U16 aid; tpDphHashNode pStaDs; tUpdateBeaconParams beaconParams; - tLimSystemRole systemRole; vos_mem_zero(&beaconParams, sizeof(tUpdateBeaconParams)); beaconParams.paramChangeBitmap = 0; @@ -3246,7 +3227,6 @@ limDeleteDphHashEntry(tpAniSirGlobal pMac, tSirMacAddr staAddr, tANI_U16 staId,t PELOGE(limLog(pMac, LOGE, FL("NULL psessionEntry"));) return; } - systemRole = limGetSystemRole(psessionEntry); beaconParams.bssIdx = psessionEntry->bssIdx; pStaDs = dphLookupHashEntry(pMac, staAddr, &aid, &psessionEntry->dph.dphHashTable); if (pStaDs != NULL) @@ -3256,16 +3236,14 @@ limDeleteDphHashEntry(tpAniSirGlobal pMac, tSirMacAddr staAddr, tANI_U16 staId,t // do this before deleting the dph hash entry limUtilCountStaDel(pMac, pStaDs, psessionEntry); - if((eLIM_AP_ROLE == psessionEntry->limSystemRole) || - (eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole)) - { - if(psessionEntry->limSystemRole == eLIM_AP_ROLE ){ + if (LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_IBSS_ROLE(psessionEntry)) { + if (LIM_IS_AP_ROLE(psessionEntry)) { if(psessionEntry->gLimProtectionControl != WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE){ limDecideApProtectionOnDelete(pMac, pStaDs, &beaconParams,psessionEntry); } } - if(eLIM_STA_IN_IBSS_ROLE == systemRole) + if (LIM_IS_IBSS_ROLE(psessionEntry)) limIbssDecideProtectionOnDelete(pMac, pStaDs, &beaconParams, psessionEntry); limDecideShortPreamble(pMac, pStaDs, &beaconParams, psessionEntry); @@ -3355,8 +3333,8 @@ limCheckAndAnnounceJoinSuccess(tpAniSirGlobal pMac, return; } - if( (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)||(psessionEntry->limSystemRole == eLIM_STA_ROLE)) - { + if (LIM_IS_BT_AMP_STA_ROLE(psessionEntry) || + LIM_IS_STA_ROLE(psessionEntry)) { limLog(pMac, LOG1, FL("Received Beacon/PR with matching BSSID" MAC_ADDRESS_STR "PESessionID %d"), MAC_ADDR_ARRAY(psessionEntry->bssId), @@ -3621,7 +3599,8 @@ tSirRetStatus limStaSendAddBss( tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, sizeof(tSirMacAddr)); limLog(pMac, LOG1, FL("sessionid: %d updateEntry = %d limsystemrole = %d "), - psessionEntry->smeSessionId,updateEntry,psessionEntry->limSystemRole); + psessionEntry->smeSessionId, updateEntry, + GET_LIM_SYSTEM_ROLE(psessionEntry)); limLog(pMac, LOG1, FL("BSSID: "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pAddBssParams->bssId)); @@ -4169,8 +4148,9 @@ tSirRetStatus limStaSendAddBssPreAssoc( tpAniSirGlobal pMac, tANI_U8 updateEntry vos_mem_copy(pAddBssParams->selfMacAddr, psessionEntry->selfMacAddr, sizeof(tSirMacAddr)); - limLog(pMac, LOG1, FL("sessionid: %d updateEntry = %d limsystemrole = %d "), - psessionEntry->smeSessionId,updateEntry,psessionEntry->limSystemRole); + limLog(pMac, LOG1, FL("sessionid: %d updateEntry = %d limsystemrole = %d"), + psessionEntry->smeSessionId, updateEntry, + GET_LIM_SYSTEM_ROLE(psessionEntry)); limLog(pMac, LOG1, FL("BSSID: "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pAddBssParams->bssId)); @@ -4596,16 +4576,14 @@ limPrepareAndSendDelStaCnf(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tSirResult sizeof(tSirMacAddr)); mlmStaContext = pStaDs->mlmStaContext; - if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) || - (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) - { + if (LIM_IS_AP_ROLE(psessionEntry) || + LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { limReleasePeerIdx(pMac, pStaDs->assocId, psessionEntry); } limDeleteDphHashEntry(pMac, pStaDs->staAddr, pStaDs->assocId, psessionEntry); - if ( (psessionEntry->limSystemRole == eLIM_STA_ROLE)|| - (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) - { + if (LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) { psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE; MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); diff --git a/CORE/MAC/src/pe/lim/limFT.c b/CORE/MAC/src/pe/lim/limFT.c index fa4bae49398c..0966660dccec 100644 --- a/CORE/MAC/src/pe/lim/limFT.c +++ b/CORE/MAC/src/pe/lim/limFT.c @@ -81,7 +81,7 @@ void limFTCleanupPreAuthInfo(tpAniSirGlobal pMac, tpPESession psessionEntry) } /* Nothing to be done if the session is not in STA mode */ - if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { + if (!LIM_IS_STA_ROLE(psessionEntry)) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif @@ -157,7 +157,7 @@ void limFTCleanup(tpAniSirGlobal pMac, tpPESession psessionEntry) } /* Nothing to be done if the session is not in STA mode */ - if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { + if (!LIM_IS_STA_ROLE(psessionEntry)) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif @@ -267,7 +267,7 @@ int limProcessFTPreAuthReq(tpAniSirGlobal pMac, tpSirMsgQ pMsg) } /* Nothing to be done if the session is not in STA mode */ - if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { + if (!LIM_IS_STA_ROLE(psessionEntry)) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif @@ -358,7 +358,7 @@ void limPerformFTPreAuth(tpAniSirGlobal pMac, eHalStatus status, } /* Nothing to be done if the session is not in STA mode */ - if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { + if (!LIM_IS_STA_ROLE(psessionEntry)) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif @@ -431,7 +431,7 @@ tSirRetStatus limFTPrepareAddBssReq( tpAniSirGlobal pMac, tSchBeaconStruct *pBeaconStruct; /* Nothing to be done if the session is not in STA mode */ - if (eLIM_STA_ROLE != pftSessionEntry->limSystemRole) { + if (!LIM_IS_STA_ROLE(pftSessionEntry)) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif @@ -1018,7 +1018,7 @@ tSirRetStatus limFTSetupAuthSession(tpAniSirGlobal pMac, } /* Nothing to be done if the session is not in STA mode */ - if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { + if (!LIM_IS_STA_ROLE(psessionEntry)) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif @@ -1052,7 +1052,7 @@ void limFTProcessPreAuthResult(tpAniSirGlobal pMac, eHalStatus status, return; /* Nothing to be done if the session is not in STA mode */ - if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { + if (!LIM_IS_STA_ROLE(psessionEntry)) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif @@ -1112,7 +1112,7 @@ void limPostFTPreAuthRsp(tpAniSirGlobal pMac, tSirRetStatus status, if (psessionEntry) { /* Nothing to be done if the session is not in STA mode */ - if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { + if (!LIM_IS_STA_ROLE(psessionEntry)) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif @@ -1177,7 +1177,7 @@ void limHandleFTPreAuthRsp(tpAniSirGlobal pMac, tSirRetStatus status, #endif /* Nothing to be done if the session is not in STA mode */ - if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { + if (!LIM_IS_STA_ROLE(psessionEntry)) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif @@ -1293,7 +1293,7 @@ void limProcessMlmFTReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf, #endif /* Nothing to be done if the session is not in STA mode */ - if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { + if (!LIM_IS_STA_ROLE(psessionEntry)) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif @@ -1430,7 +1430,7 @@ void limProcessFTPreauthRspTimeout(tpAniSirGlobal pMac) } /* Nothing to be done if the session is not in STA mode */ - if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { + if (!LIM_IS_STA_ROLE(psessionEntry)) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif @@ -1509,7 +1509,7 @@ tANI_BOOLEAN limProcessFTUpdateKey(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf ) } /* Nothing to be done if the session is not in STA mode */ - if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { + if (!LIM_IS_STA_ROLE(psessionEntry)) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif @@ -1675,7 +1675,7 @@ void limProcessFTAggrQoSRsp(tpAniSirGlobal pMac, tpSirMsgQ limMsg) } /* Nothing to be done if the session is not in STA mode */ - if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { + if (!LIM_IS_STA_ROLE(psessionEntry)) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif @@ -1750,7 +1750,7 @@ limProcessFTAggrQosReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf ) } /* Nothing to be done if the session is not in STA mode */ - if (eLIM_STA_ROLE != psessionEntry->limSystemRole) { + if (!LIM_IS_STA_ROLE(psessionEntry)) { #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG PELOGE(limLog(pMac, LOGE, FL("psessionEntry is not in STA mode"));) #endif diff --git a/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c b/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c index 053b17841c00..5aaf4b56798b 100644 --- a/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c +++ b/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c @@ -119,14 +119,14 @@ limDeleteStaContext(tpAniSirGlobal pMac, tpSirMsgQ limMsg) case HAL_DEL_STA_REASON_CODE_KEEP_ALIVE: case HAL_DEL_STA_REASON_CODE_TIM_BASED: PELOGE(limLog(pMac, LOGE, FL(" Deleting station: staId = %d, reasonCode = %d"), pMsg->staId, pMsg->reasonCode);) - if (eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole) + if (LIM_IS_IBSS_ROLE(psessionEntry)) return; pStaDs = dphLookupAssocId(pMac, pMsg->staId, &pMsg->assocId, &psessionEntry->dph.dphHashTable); - if (!pStaDs) - { - PELOGE(limLog(pMac, LOGE, FL("Skip STA deletion (invalid STA) limSystemRole=%d"),psessionEntry->limSystemRole);) + if (!pStaDs) { + PELOGE(limLog(pMac, LOGE, FL("Skip STA deletion (invalid STA) limSystemRole=%d"), + GET_LIM_SYSTEM_ROLE(psessionEntry));) vos_mem_free(pMsg); return; } @@ -141,9 +141,8 @@ limDeleteStaContext(tpAniSirGlobal pMac, tpSirMsgQ limMsg) return; } - if((eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) || - (eLIM_AP_ROLE == psessionEntry->limSystemRole)) - { + if (LIM_IS_BT_AMP_AP_ROLE(psessionEntry) || + LIM_IS_AP_ROLE(psessionEntry)) { PELOG1(limLog(pMac, LOG1, FL("SAP:lim Delete Station Context (staId: %d, assocId: %d) "), pMsg->staId, pMsg->assocId);) limTriggerSTAdeletion(pMac, pStaDs, psessionEntry); @@ -151,17 +150,14 @@ limDeleteStaContext(tpAniSirGlobal pMac, tpSirMsgQ limMsg) else { #ifdef FEATURE_WLAN_TDLS - if(eLIM_STA_ROLE == psessionEntry->limSystemRole && - STA_ENTRY_TDLS_PEER == pStaDs->staType) - { + if (LIM_IS_STA_ROLE(psessionEntry) && + STA_ENTRY_TDLS_PEER == pStaDs->staType) { //TeardownLink with PEER //Reason code HAL_DEL_STA_REASON_CODE_KEEP_ALIVE means //eSIR_MAC_TDLS_TEARDOWN_PEER_UNREACHABLE limSendSmeTDLSDelStaInd(pMac, pStaDs, psessionEntry, - /*pMsg->reasonCode*/ eSIR_MAC_TDLS_TEARDOWN_PEER_UNREACHABLE); - } - else - { + eSIR_MAC_TDLS_TEARDOWN_PEER_UNREACHABLE); + } else { #endif //TearDownLink with AP tLimMlmDeauthInd mlmDeauthInd; @@ -431,8 +427,8 @@ void limHandleHeartBeatFailure(tpAniSirGlobal pMac,tpPESession psessionEntry) /* Ensure HB Status for the session has been reseted */ psessionEntry->LimHBFailureStatus = eANI_BOOLEAN_FALSE; - if (((psessionEntry->limSystemRole == eLIM_STA_ROLE) || - (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) && + if ((LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) && (psessionEntry->limMlmState == eLIM_MLM_LINK_ESTABLISHED_STATE) && (psessionEntry->limSmeState != eLIM_SME_WT_DISASSOC_STATE) && (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE)) diff --git a/CORE/MAC/src/pe/lim/limLogDump.c b/CORE/MAC/src/pe/lim/limLogDump.c index 68ab9cda8693..a8f112649f87 100644 --- a/CORE/MAC/src/pe/lim/limLogDump.c +++ b/CORE/MAC/src/pe/lim/limLogDump.c @@ -231,17 +231,14 @@ static char *sendSmeDisAssocReq(tpAniSirGlobal pMac, char *p,tANI_U32 arg1 ,tANI return p; } - if( ( (psessionEntry->limSystemRole == eLIM_STA_ROLE) || - (psessionEntry ->limSystemRole == eLIM_BT_AMP_STA_ROLE) ) && - (psessionEntry->statypeForBss == STA_ENTRY_PEER)) - { + if ((LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) && + (psessionEntry->statypeForBss == STA_ENTRY_PEER)) { sirCopyMacAddr(pDisAssocReq->bssId,psessionEntry->bssId); sirCopyMacAddr(pDisAssocReq->peerMacAddr,psessionEntry->bssId); } - if((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) - || (psessionEntry->limSystemRole == eLIM_AP_ROLE) - ) - { + if (LIM_IS_BT_AMP_AP_ROLE(psessionEntry) || + (LIM_IS_AP_ROLE(psessionEntry))) { sirCopyMacAddr(pDisAssocReq->peerMacAddr,pStaDs->staAddr); sirCopyMacAddr(pDisAssocReq->bssId,psessionEntry->bssId); } @@ -489,7 +486,7 @@ static char *printSessionInfo(tpAniSirGlobal pMac, char *p) p += log_sprintf( pMac,p, "valid: %d \n", psessionEntry->valid); p += log_sprintf( pMac,p, "limMlmState: (%d) %s ", psessionEntry->limMlmState, limMlmStateStr(psessionEntry->limMlmState) ); p += log_sprintf( pMac,p, "limPrevMlmState: (%d) %s ", psessionEntry->limPrevMlmState, limMlmStateStr(psessionEntry->limMlmState) ); - p += log_sprintf( pMac,p, "limSystemRole: (%d) %s \n", psessionEntry->limSystemRole, getRole(psessionEntry->limSystemRole) ); + p += log_sprintf( pMac,p, "limSystemRole: (%d) %s \n", GET_LIM_SYSTEM_ROLE(psessionEntry), getRole(psessionEntry->limSystemRole) ); p += log_sprintf( pMac,p, "bssType: (%d) %s \n", psessionEntry->bssType, limBssTypeStr(psessionEntry->bssType)); p += log_sprintf( pMac,p, "operMode: %d \n", psessionEntry->operMode); p += log_sprintf( pMac,p, "dot11mode: %d \n", psessionEntry->dot11mode); @@ -1099,8 +1096,7 @@ dump_lim_set_dot11_mode( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI tpPESession psessionEntry =&pMac->lim.gpSession[0]; dump_cfg_set(pMac, WNI_CFG_DOT11_MODE, arg1, arg2, arg3, p); - if ( (limGetSystemRole(psessionEntry) == eLIM_AP_ROLE) || - (limGetSystemRole(psessionEntry) == eLIM_STA_IN_IBSS_ROLE)) + if (LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_IBSS_ROLE(psessionEntry)) schSetFixedBeaconFields(pMac,psessionEntry); p += log_sprintf( pMac,p, "The Dot11 Mode is set to %d", (tANI_U8)psessionEntry->dot11mode); return p; @@ -1136,11 +1132,10 @@ static char* dump_lim_update_cb_Mode(tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U3 limSendSwitchChnlParams(pMac, psessionEntry->currentOperChannel, psessionEntry->htSecondaryChannelOffset, (tPowerdBm) localPwrConstraint, psessionEntry->peSessionId); - if ( (limGetSystemRole(psessionEntry) == eLIM_AP_ROLE) || - (limGetSystemRole(psessionEntry) == eLIM_STA_IN_IBSS_ROLE)) + if (LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_IBSS_ROLE(psessionEntry)) schSetFixedBeaconFields(pMac,psessionEntry); - return p; + return p; } static char* dump_lim_abort_scan(tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p) diff --git a/CORE/MAC/src/pe/lim/limP2P.c b/CORE/MAC/src/pe/lim/limP2P.c index 32816ccd29f6..b1558371924a 100644 --- a/CORE/MAC/src/pe/lim/limP2P.c +++ b/CORE/MAC/src/pe/lim/limP2P.c @@ -583,9 +583,8 @@ void limRemainOnChnRsp(tpAniSirGlobal pMac, eHalStatus status, tANI_U32 *data) if((psessionEntry = peFindSessionByBssid(pMac, MsgRemainonChannel->selfMacAddr,&sessionId)) != NULL) { - if ( eLIM_P2P_DEVICE_ROLE == psessionEntry->limSystemRole ) - { - peDeleteSession( pMac, psessionEntry); + if (LIM_IS_P2P_DEVICE_ROLE(psessionEntry)) { + peDeleteSession( pMac, psessionEntry); } } diff --git a/CORE/MAC/src/pe/lim/limProcessActionFrame.c b/CORE/MAC/src/pe/lim/limProcessActionFrame.c index 3cb663804fc6..e0e56bccec4a 100644 --- a/CORE/MAC/src/pe/lim/limProcessActionFrame.c +++ b/CORE/MAC/src/pe/lim/limProcessActionFrame.c @@ -626,8 +626,7 @@ __limProcessAddTsRsp(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession pse PELOGW(limLog(pMac, LOGW, "Recv AddTs Response");) - if ((psessionEntry->limSystemRole == eLIM_AP_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) - { + if (LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { PELOGW(limLog(pMac, LOGW, FL("AddTsRsp recvd at AP: ignoring"));) return; } @@ -933,8 +932,8 @@ __limProcessDelTsReq(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession pse } } - if ((psessionEntry->limSystemRole != eLIM_AP_ROLE) && - (psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE)) + if (!LIM_IS_AP_ROLE(psessionEntry) && + !LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) limSendSmeDeltsInd(pMac, &delts, aid,psessionEntry); // try to delete the TS @@ -1886,8 +1885,7 @@ static void __limProcessSAQueryResponseActionFrame(tpAniSirGlobal pMac, tANI_U8 /* When a station, supplicant handles SA Query Response. * Forward to SME to HDD to wpa_supplicant. */ - if (eLIM_STA_ROLE == psessionEntry->limSystemRole) - { + if (LIM_IS_STA_ROLE(psessionEntry)) { limSendSmeMgmtFrameInd(pMac, pHdr->fc.subType, (tANI_U8*)pHdr, frameLen + sizeof(tSirMacMgmtHdr), 0, WDA_GET_RX_CH( pRxPacketInfo ), @@ -1965,15 +1963,12 @@ limDropUnprotectedActionFrame (tpAniSirGlobal pMac, tpPESession psessionEntry, tpDphHashNode pStaDs; tANI_BOOLEAN rmfConnection = eANI_BOOLEAN_FALSE; - if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) || - (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) - { + if (LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { pStaDs = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable); if (pStaDs != NULL) if (pStaDs->rmfEnabled) rmfConnection = eANI_BOOLEAN_TRUE; - } - else if (psessionEntry->limRmfEnabled) + } else if (psessionEntry->limRmfEnabled) rmfConnection = eANI_BOOLEAN_TRUE; if (rmfConnection && (pHdr->fc.wep == 0)) @@ -2061,9 +2056,10 @@ limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps switch (pActionHdr->actionID) { case SIR_MAC_ACTION_CHANNEL_SWITCH_ID: - if (psessionEntry->limSystemRole == eLIM_STA_ROLE) - { - __limProcessChannelSwitchActionFrame(pMac, pRxPacketInfo,psessionEntry); + if (LIM_IS_STA_ROLE(psessionEntry)) { + __limProcessChannelSwitchActionFrame(pMac, + pRxPacketInfo, + psessionEntry); } break; default: @@ -2133,7 +2129,7 @@ limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps /** Type of HT Action to be performed*/ switch(pActionHdr->actionID) { case SIR_MAC_SM_POWER_SAVE: - if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) ) + if (LIM_IS_AP_ROLE(psessionEntry)) __limProcessSMPowerSaveUpdate(pMac, (tANI_U8 *) pRxPacketInfo,psessionEntry); break; default: @@ -2225,12 +2221,11 @@ limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); //Check if it is a vendor specific action frame. - if ((eLIM_STA_ROLE == psessionEntry->limSystemRole) && + if (LIM_IS_STA_ROLE(psessionEntry) && (VOS_TRUE == vos_mem_compare(psessionEntry->selfMacAddr, &pHdr->da[0], sizeof(tSirMacAddr))) && IS_WES_MODE_ENABLED(pMac) && - vos_mem_compare(pVendorSpecific->Oui, Oui, 3)) - { + vos_mem_compare(pVendorSpecific->Oui, Oui, 3)) { PELOGE( limLog( pMac, LOGW, FL("Received Vendor specific action frame, OUI %x %x %x"), pVendorSpecific->Oui[0], pVendorSpecific->Oui[1], pVendorSpecific->Oui[2]);) /* Forward to the SME to HDD to wpa_supplicant */ @@ -2248,7 +2243,7 @@ limProcessActionFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps IS_WES_MODE_ENABLED(pMac), pVendorSpecific->Oui[0], pVendorSpecific->Oui[1], pVendorSpecific->Oui[2], - psessionEntry->limSystemRole ); + GET_LIM_SYSTEM_ROLE(psessionEntry)); } } break; diff --git a/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c b/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c index 729bce4b1cd7..c73007151690 100644 --- a/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c +++ b/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c @@ -258,15 +258,15 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, limLog(pMac, LOG1, FL("Received %s Req Frame on sessionid: %d systemrole %d" " limMlmState %d from: "MAC_ADDRESS_STR), (LIM_ASSOC == subType) ? "Assoc" : "ReAssoc", - psessionEntry->peSessionId, psessionEntry->limSystemRole, + psessionEntry->peSessionId, GET_LIM_SYSTEM_ROLE(psessionEntry), psessionEntry->limMlmState, MAC_ADDR_ARRAY(pHdr->sa)); - if (psessionEntry->limSystemRole == eLIM_STA_ROLE || psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE ) - { + if (LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) { limLog(pMac, LOGE, FL("received unexpected ASSOC REQ on sessionid: %d " "sys subType=%d for role=%d from: "MAC_ADDRESS_STR), psessionEntry->peSessionId, - subType, psessionEntry->limSystemRole, MAC_ADDR_ARRAY(pHdr->sa)); + subType, GET_LIM_SYSTEM_ROLE(psessionEntry), MAC_ADDR_ARRAY(pHdr->sa)); sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG3, WDA_GET_RX_MPDU_DATA(pRxPacketInfo), framelen); return; @@ -289,7 +289,7 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, FL("STA is initiating Assoc Req after ACK lost.So, do not Process" "sessionid: %d sys subType=%d for role=%d from: "MAC_ADDRESS_STR), psessionEntry->peSessionId, - subType, psessionEntry->limSystemRole, MAC_ADDR_ARRAY(pHdr->sa)); + subType, GET_LIM_SYSTEM_ROLE(psessionEntry), MAC_ADDR_ARRAY(pHdr->sa)); return; } @@ -327,8 +327,7 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, } // If TKIP counter measures active send Assoc Rsp frame to station with eSIR_MAC_MIC_FAILURE_REASON - if ((psessionEntry->bTkipCntrMeasActive) && (psessionEntry->limSystemRole == eLIM_AP_ROLE)) - { + if ((psessionEntry->bTkipCntrMeasActive) && LIM_IS_AP_ROLE(psessionEntry)) { limLog(pMac, LOGE, FL("TKIP counter measure is active")); limSendAssocRspMgmtFrame(pMac, eSIR_MAC_MIC_FAILURE_REASON, @@ -469,10 +468,9 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, } - if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && + if (LIM_IS_AP_ROLE(psessionEntry) && (psessionEntry->dot11mode == WNI_CFG_DOT11_MODE_11G_ONLY) && - (pAssocReq->HTCaps.present)) - { + (pAssocReq->HTCaps.present)) { limLog(pMac, LOGE, FL("SOFTAP was in 11G only mode, rejecting legacy " "STA : "MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pHdr->sa)); limSendAssocRspMgmtFrame( pMac, eSIR_MAC_CAPABILITIES_NOT_SUPPORTED_STATUS, @@ -481,10 +479,9 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, }//end if phyMode == 11G_only - if((psessionEntry->limSystemRole == eLIM_AP_ROLE) && + if (LIM_IS_AP_ROLE(psessionEntry) && (psessionEntry->dot11mode == WNI_CFG_DOT11_MODE_11N_ONLY) && - (!pAssocReq->HTCaps.present)) - { + (!pAssocReq->HTCaps.present)) { limLog(pMac, LOGE, FL("SOFTAP was in 11N only mode, rejecting legacy " "STA : "MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pHdr->sa)); limSendAssocRspMgmtFrame( pMac, eSIR_MAC_CAPABILITIES_NOT_SUPPORTED_STATUS, @@ -492,10 +489,9 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, goto error; }//end if PhyMode == 11N_only - if((psessionEntry->limSystemRole == eLIM_AP_ROLE) && + if (LIM_IS_AP_ROLE(psessionEntry) && (psessionEntry->dot11mode == WNI_CFG_DOT11_MODE_11AC_ONLY) && - (!pAssocReq->VHTCaps.present)) - { + (!pAssocReq->VHTCaps.present)) { limSendAssocRspMgmtFrame( pMac, eSIR_MAC_CAPABILITIES_NOT_SUPPORTED_STATUS, 1, pHdr->sa, subType, 0, psessionEntry ); limLog(pMac, LOGE, FL("SOFTAP was in 11AC only mode, reject")); @@ -678,10 +674,9 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, if( wpsIe == NULL ) { /** check whether as RSN IE is present */ - if(psessionEntry->limSystemRole == eLIM_AP_ROLE - && psessionEntry->pLimStartBssReq->privacy - && psessionEntry->pLimStartBssReq->rsnIE.length) - { + if (LIM_IS_AP_ROLE(psessionEntry) && + psessionEntry->pLimStartBssReq->privacy && + psessionEntry->pLimStartBssReq->rsnIE.length) { limLog(pMac, LOGE, FL("RSN enabled auth, Re/Assoc req from STA: "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->sa)); @@ -1275,7 +1270,7 @@ if (limPopulateMatchingRateSet(pMac, if( pAssocReq->WMMInfoStation.present) { /* check whether AP supports or not */ - if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) + if (LIM_IS_AP_ROLE(psessionEntry) && (psessionEntry->apUapsdEnable == 0) && (pAssocReq->WMMInfoStation.acbe_uapsd || pAssocReq->WMMInfoStation.acbk_uapsd || pAssocReq->WMMInfoStation.acvo_uapsd @@ -1443,11 +1438,9 @@ if (limPopulateMatchingRateSet(pMac, } /* AddSta is sucess here */ - if((psessionEntry->limSystemRole == eLIM_AP_ROLE) && + if (LIM_IS_AP_ROLE(psessionEntry) && IS_DOT11_MODE_HT(psessionEntry->dot11mode) && - pAssocReq->HTCaps.present && pAssocReq->wmeInfoPresent) - { - + pAssocReq->HTCaps.present && pAssocReq->wmeInfoPresent) { /** Update in the HAL Station Table for the Update of the Protection Mode */ limPostSMStateUpdate(pMac,pStaDs->staIndex, pStaDs->htMIMOPSState, diff --git a/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c b/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c index 6b9283c6a319..202aa905b7bf 100644 --- a/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c +++ b/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c @@ -328,7 +328,7 @@ limProcessAssocRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tANI_U8 sub FL("received Re/Assoc(%d) resp on sessionid: %d with systemrole: %d " "and mlmstate: %d RSSI %d from "MAC_ADDRESS_STR),subType, psessionEntry->peSessionId, - psessionEntry->limSystemRole,psessionEntry->limMlmState, + GET_LIM_SYSTEM_ROLE(psessionEntry), psessionEntry->limMlmState, (uint)abs((tANI_S8)WDA_GET_RX_RSSI_DB(pRxPacketInfo)), MAC_ADDR_ARRAY(pHdr->sa)); @@ -340,13 +340,12 @@ limProcessAssocRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tANI_U8 sub } - if (psessionEntry->limSystemRole == eLIM_AP_ROLE || psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE ) - { + if (LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { // Should not have received Re/Association Response // frame on AP. Log error limLog(pMac, LOGE, - FL("Should not recieved Re/Assoc Response in role %d "), - psessionEntry->limSystemRole); + FL("Should not recieved Re/Assoc Response in role %d"), + GET_LIM_SYSTEM_ROLE(psessionEntry)); vos_mem_free(pBeaconStruct); return; @@ -693,8 +692,7 @@ limProcessAssocRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tANI_U8 sub if (!((psessionEntry->bssType == eSIR_BTAMP_STA_MODE) || ((psessionEntry->bssType == eSIR_BTAMP_AP_MODE) && - (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)))) - { + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)))) { if (limSetLinkState(pMac, eSIR_LINK_POSTASSOC_STATE, psessionEntry->bssId, psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS) { diff --git a/CORE/MAC/src/pe/lim/limProcessAuthFrame.c b/CORE/MAC/src/pe/lim/limProcessAuthFrame.c index 1571720ad579..310e9579cbeb 100644 --- a/CORE/MAC/src/pe/lim/limProcessAuthFrame.c +++ b/CORE/MAC/src/pe/lim/limProcessAuthFrame.c @@ -79,22 +79,28 @@ */ -static inline unsigned int isAuthValid(tpAniSirGlobal pMac, tpSirMacAuthFrameBody auth,tpPESession sessionEntry) { - unsigned int valid; - valid=1; +static inline unsigned int +isAuthValid(tpAniSirGlobal pMac, tpSirMacAuthFrameBody auth, + tpPESession sessionEntry) +{ + unsigned int valid = 1; - if ( ((auth->authTransactionSeqNumber==SIR_MAC_AUTH_FRAME_1)|| - (auth->authTransactionSeqNumber==SIR_MAC_AUTH_FRAME_3)) && - ((sessionEntry->limSystemRole == eLIM_STA_ROLE)||(sessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE))) - valid=0; + if (((auth->authTransactionSeqNumber == SIR_MAC_AUTH_FRAME_1) || + (auth->authTransactionSeqNumber == SIR_MAC_AUTH_FRAME_3)) && + (LIM_IS_STA_ROLE(sessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(sessionEntry))) + valid = 0; - if ( ((auth->authTransactionSeqNumber==SIR_MAC_AUTH_FRAME_2)||(auth->authTransactionSeqNumber==SIR_MAC_AUTH_FRAME_4))&& - ((sessionEntry->limSystemRole == eLIM_AP_ROLE)||(sessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE))) - valid=0; + if (((auth->authTransactionSeqNumber == SIR_MAC_AUTH_FRAME_2) || + (auth->authTransactionSeqNumber == SIR_MAC_AUTH_FRAME_4)) && + (LIM_IS_AP_ROLE(sessionEntry) || LIM_IS_BT_AMP_AP_ROLE(sessionEntry))) + valid = 0; - if ( ((auth->authTransactionSeqNumber==SIR_MAC_AUTH_FRAME_3)||(auth->authTransactionSeqNumber==SIR_MAC_AUTH_FRAME_4))&& - (auth->type!=SIR_MAC_CHALLENGE_TEXT_EID)&&(auth->authAlgoNumber != eSIR_SHARED_KEY)) - valid=0; + if (((auth->authTransactionSeqNumber == SIR_MAC_AUTH_FRAME_3) || + (auth->authTransactionSeqNumber == SIR_MAC_AUTH_FRAME_4)) && + (auth->type != SIR_MAC_CHALLENGE_TEXT_EID) && + (auth->authAlgoNumber != eSIR_SHARED_KEY)) + valid = 0; return valid; } @@ -186,7 +192,7 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse limLog(pMac, LOG1, FL("Sessionid: %d System role : %d limMlmState: %d :Auth " "Frame Received: BSSID: "MAC_ADDRESS_STR " (RSSI %d)"), - psessionEntry->peSessionId, psessionEntry->limSystemRole, + psessionEntry->peSessionId, GET_LIM_SYSTEM_ROLE(psessionEntry), psessionEntry->limMlmState, MAC_ADDR_ARRAY(pHdr->bssId), (uint)abs((tANI_S8)WDA_GET_RX_RSSI_DB(pRxPacketInfo))); @@ -208,8 +214,8 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse */ // If TKIP counter measures enabled issue Deauth frame to station - if ((psessionEntry->bTkipCntrMeasActive) && (psessionEntry->limSystemRole == eLIM_AP_ROLE)) - { + if ((psessionEntry->bTkipCntrMeasActive) && + LIM_IS_AP_ROLE(psessionEntry)) { PELOGE( limLog(pMac, LOGE, FL("Tkip counter measures Enabled, sending Deauth frame to")); ) limPrintMacAddr(pMac, pHdr->sa, LOGE); @@ -232,16 +238,16 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * Out-of-sequence-Authentication-Frame status code. */ - if (psessionEntry->limSystemRole == eLIM_STA_ROLE || psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE) - { + if (LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) { authFrame.authAlgoNumber = eSIR_SHARED_KEY; authFrame.authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_4; authFrame.authStatusCode = eSIR_MAC_CHALLENGE_FAILURE_STATUS; // Log error PELOGE(limLog(pMac, LOGE, - FL("received Authentication frame with wep bit set on role=%d " - MAC_ADDRESS_STR), psessionEntry->limSystemRole, - MAC_ADDR_ARRAY(pHdr->sa) );) + FL("received Authentication frame with wep bit set on role=%d" + MAC_ADDRESS_STR), GET_LIM_SYSTEM_ROLE(psessionEntry), + MAC_ADDR_ARRAY(pHdr->sa));) limSendAuthMgmtFrame(pMac, &authFrame, pHdr->sa, @@ -259,8 +265,7 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse return; } - if(psessionEntry->limSystemRole == eLIM_AP_ROLE) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { val = psessionEntry->privacy; } else @@ -423,17 +428,14 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse val = SIR_MAC_KEY_LENGTH; - if(psessionEntry->limSystemRole == eLIM_AP_ROLE) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { tpSirKeys pKey; pKey = &psessionEntry->WEPKeyMaterial[keyId].key[0]; vos_mem_copy(defaultKey, pKey->key, pKey->keyLength); val = pKey->keyLength; - } - else - if (wlan_cfgGetStr(pMac, (tANI_U16) (WNI_CFG_WEP_DEFAULT_KEY_1 + keyId), - defaultKey, &val) != eSIR_SUCCESS) - { + } else if (wlan_cfgGetStr(pMac, + (tANI_U16) (WNI_CFG_WEP_DEFAULT_KEY_1 + keyId), + defaultKey, &val) != eSIR_SUCCESS) { /// Could not get Default key from CFG. //Log error. limLog(pMac, LOGP, @@ -782,14 +784,10 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse case eSIR_SHARED_KEY: PELOGW(limLog(pMac, LOGW, FL("=======> eSIR_SHARED_KEY ..."));) - if(psessionEntry->limSystemRole == eLIM_AP_ROLE) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { val = psessionEntry->privacy; - } - else - if (wlan_cfgGetInt(pMac, WNI_CFG_PRIVACY_ENABLED, - &val) != eSIR_SUCCESS) - { + } else if (wlan_cfgGetInt(pMac, WNI_CFG_PRIVACY_ENABLED, + &val) != eSIR_SUCCESS) { /** * Could not get Privacy option * from CFG. Log error. @@ -995,8 +993,8 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse * Check if a Reassociation is in progress and this is a * Pre-Auth frame */ - if (((psessionEntry->limSystemRole == eLIM_STA_ROLE) || - (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) && + if ((LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) && (psessionEntry->limSmeState == eLIM_SME_WT_REASSOC_STATE) && (pRxAuthFrameBody->authStatusCode == eSIR_MAC_SUCCESS_STATUS) && (psessionEntry->ftPEContext.pFTPreAuthReq != NULL) && @@ -1128,14 +1126,10 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse { // Shared key authentication - if(psessionEntry->limSystemRole == eLIM_AP_ROLE) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { val = psessionEntry->privacy; - } - else - if (wlan_cfgGetInt(pMac, WNI_CFG_PRIVACY_ENABLED, - &val) != eSIR_SUCCESS) - { + } else if (wlan_cfgGetInt(pMac, WNI_CFG_PRIVACY_ENABLED, + &val) != eSIR_SUCCESS) { /** * Could not get Privacy option * from CFG. Log error. @@ -1265,18 +1259,13 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse val = SIR_MAC_KEY_LENGTH; - if(psessionEntry->limSystemRole == eLIM_AP_ROLE) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { tpSirKeys pKey; pKey = &psessionEntry->WEPKeyMaterial[keyId].key[0]; vos_mem_copy(defaultKey, pKey->key, pKey->keyLength); - } - else - if (wlan_cfgGetStr(pMac, (tANI_U16) (WNI_CFG_WEP_DEFAULT_KEY_1 + keyId), - defaultKey, - &val) - != eSIR_SUCCESS) - { + } else if (wlan_cfgGetStr(pMac, + (tANI_U16) (WNI_CFG_WEP_DEFAULT_KEY_1 + keyId), + defaultKey, &val) != eSIR_SUCCESS) { /// Could not get Default key from CFG. //Log error. limLog(pMac, LOGP, @@ -1377,9 +1366,9 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse return; } - if (psessionEntry->limSystemRole == eLIM_AP_ROLE || psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE || - psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) - { + if (LIM_IS_AP_ROLE(psessionEntry) || + LIM_IS_BT_AMP_AP_ROLE(psessionEntry) || + LIM_IS_IBSS_ROLE(psessionEntry)) { /** * Check if wep bit was set in FC. If not set, * reject with Authentication frame4 with diff --git a/CORE/MAC/src/pe/lim/limProcessCfgUpdates.c b/CORE/MAC/src/pe/lim/limProcessCfgUpdates.c index 174bd544bbfb..e1fba58aeb44 100644 --- a/CORE/MAC/src/pe/lim/limProcessCfgUpdates.c +++ b/CORE/MAC/src/pe/lim/limProcessCfgUpdates.c @@ -61,7 +61,7 @@ void limSetCfgProtection(tpAniSirGlobal pMac, tpPESession pesessionEntry) { tANI_U32 val = 0; - if(( pesessionEntry != NULL ) && (pesessionEntry->limSystemRole == eLIM_AP_ROLE )){ + if ((pesessionEntry != NULL) && LIM_IS_AP_ROLE(pesessionEntry)) { if (pesessionEntry->gLimProtectionControl == WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE ) vos_mem_set((void *)&pesessionEntry->cfgProtection, sizeof(tCfgProtection), 0); else{ @@ -621,11 +621,10 @@ limApplyConfiguration(tpAniSirGlobal pMac,tpPESession psessionEntry) /* Added for BT - AMP Support */ - if ( (psessionEntry->limSystemRole == eLIM_AP_ROLE) || - (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)|| - (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE)|| - (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE) ) - { + if (LIM_IS_AP_ROLE(psessionEntry) || + LIM_IS_BT_AMP_AP_ROLE(psessionEntry)|| + LIM_IS_IBSS_ROLE(psessionEntry)|| + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) { /* This check is required to ensure the beacon generation is not done as a part of join request for a BT-AMP station */ @@ -679,9 +678,7 @@ limUpdateConfig(tpAniSirGlobal pMac,tpPESession psessionEntry) psessionEntry->beaconParams.fShortPreamble = (val) ? 1 : 0; /* In STA case this parameter is filled during the join request */ - if (psessionEntry->limSystemRole == eLIM_AP_ROLE || - psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) - { + if (LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_IBSS_ROLE(psessionEntry)) { if (wlan_cfgGetInt(pMac, WNI_CFG_WME_ENABLED, &val) != eSIR_SUCCESS) limLog(pMac, LOGP, FL("cfg get wme enabled failed")); psessionEntry->limWmeEnabled = (val) ? 1 : 0; @@ -697,9 +694,7 @@ limUpdateConfig(tpAniSirGlobal pMac,tpPESession psessionEntry) psessionEntry->limWsmEnabled = 0; } /* In STA , this parameter is filled during the join request */ - if (psessionEntry->limSystemRole== eLIM_AP_ROLE || - psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) - { + if (LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_IBSS_ROLE(psessionEntry)) { if (wlan_cfgGetInt(pMac, WNI_CFG_QOS_ENABLED, &val) != eSIR_SUCCESS) limLog(pMac, LOGP, FL("cfg get qos enabled failed")); psessionEntry->limQosEnabled = (val) ? 1 : 0; @@ -715,7 +710,7 @@ limUpdateConfig(tpAniSirGlobal pMac,tpPESession psessionEntry) // AP: WSM should enable HCF as well, for STA enable WSM only after // association response is received - if (psessionEntry->limWsmEnabled && psessionEntry->limSystemRole == eLIM_AP_ROLE) + if (psessionEntry->limWsmEnabled && LIM_IS_AP_ROLE(psessionEntry)) psessionEntry->limHcfEnabled = 1; if (wlan_cfgGetInt(pMac, WNI_CFG_11D_ENABLED, &val) != eSIR_SUCCESS) diff --git a/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c b/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c index 2609c35ae18d..bab582019841 100644 --- a/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c +++ b/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c @@ -89,7 +89,7 @@ limProcessDeauthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession p pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); - if ((eLIM_STA_ROLE == psessionEntry->limSystemRole) && + if (LIM_IS_STA_ROLE(psessionEntry) && ((eLIM_SME_WT_DISASSOC_STATE == psessionEntry->limSmeState) || (eLIM_SME_WT_DEAUTH_STATE == psessionEntry->limSmeState))) { @@ -154,7 +154,7 @@ limProcessDeauthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession p MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->da), limMlmStateStr(psessionEntry->limMlmState), psessionEntry->limSmeState, - psessionEntry->limSystemRole, reasonCode, + GET_LIM_SYSTEM_ROLE(psessionEntry), reasonCode, limDot11ReasonStr(reasonCode), MAC_ADDR_ARRAY(pHdr->sa));) @@ -168,8 +168,8 @@ limProcessDeauthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession p } - if ( (psessionEntry->limSystemRole == eLIM_AP_ROLE )||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) ) - { + if (LIM_IS_AP_ROLE(psessionEntry) || + LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { switch (reasonCode) { case eSIR_MAC_UNSPEC_FAILURE_REASON: @@ -187,8 +187,8 @@ limProcessDeauthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession p break; } } - else if (psessionEntry->limSystemRole == eLIM_STA_ROLE ||psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE) - { + else if (LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) { switch (reasonCode) { case eSIR_MAC_UNSPEC_FAILURE_REASON: @@ -216,7 +216,7 @@ limProcessDeauthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession p // or un-known role. Log and ignore it limLog(pMac, LOGE, FL("received Deauth frame with reasonCode %d in role %d from " - MAC_ADDRESS_STR),reasonCode, psessionEntry->limSystemRole, + MAC_ADDRESS_STR),reasonCode, GET_LIM_SYSTEM_ROLE(psessionEntry), MAC_ADDR_ARRAY(pHdr->sa)); return; @@ -271,7 +271,7 @@ limProcessDeauthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession p /* If received DeAuth from AP other than the one we're trying to join with * nor associated with, then ignore deauth and delete Pre-auth entry. */ - if(psessionEntry->limSystemRole != eLIM_AP_ROLE ){ + if (!LIM_IS_AP_ROLE(psessionEntry)) { if (!IS_CURRENT_BSSID(pMac, pHdr->bssId, psessionEntry)) { PELOGE(limLog(pMac, LOGE, FL("received DeAuth from an AP other " @@ -290,7 +290,7 @@ limProcessDeauthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession p pStaDs = dphLookupHashEntry(pMac, pHdr->sa, &aid, &psessionEntry->dph.dphHashTable); // Check for pre-assoc states - switch (psessionEntry->limSystemRole) + switch (GET_LIM_SYSTEM_ROLE(psessionEntry)) { case eLIM_STA_ROLE: case eLIM_BT_AMP_STA_ROLE: @@ -531,7 +531,7 @@ limProcessDeauthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession p { pMac->lim.deauthMsgCnt = 0; } - if (eLIM_STA_ROLE == psessionEntry->limSystemRole) + if (LIM_IS_STA_ROLE(psessionEntry)) WDA_TxAbort(psessionEntry->smeSessionId); /// Deauthentication from peer MAC entity diff --git a/CORE/MAC/src/pe/lim/limProcessDisassocFrame.c b/CORE/MAC/src/pe/lim/limProcessDisassocFrame.c index 5a4312ef300a..0a98649ef32d 100644 --- a/CORE/MAC/src/pe/lim/limProcessDisassocFrame.c +++ b/CORE/MAC/src/pe/lim/limProcessDisassocFrame.c @@ -184,9 +184,7 @@ limProcessDisassocFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession } } - if ( (psessionEntry->limSystemRole == eLIM_AP_ROLE) || - (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) ) - { + if (LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { switch (reasonCode) { case eSIR_MAC_UNSPEC_FAILURE_REASON: @@ -208,14 +206,12 @@ limProcessDisassocFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession reasonCode, MAC_ADDR_ARRAY(pHdr->sa));) break; } - } - else if ( ((psessionEntry->limSystemRole == eLIM_STA_ROLE) || - (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) && + } else if ((LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) && ((psessionEntry->limSmeState != eLIM_SME_WT_JOIN_STATE) && (psessionEntry->limSmeState != eLIM_SME_WT_AUTH_STATE) && (psessionEntry->limSmeState != eLIM_SME_WT_ASSOC_STATE) && - (psessionEntry->limSmeState != eLIM_SME_WT_REASSOC_STATE) )) - { + (psessionEntry->limSmeState != eLIM_SME_WT_REASSOC_STATE))) { switch (reasonCode) { case eSIR_MAC_UNSPEC_FAILURE_REASON: @@ -262,7 +258,7 @@ limProcessDisassocFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession limLog(pMac, LOGE, FL("received Disassoc frame with invalid reasonCode %d in role " "%d in sme state %d from "MAC_ADDRESS_STR), reasonCode, - psessionEntry->limSystemRole, psessionEntry->limSmeState, + GET_LIM_SYSTEM_ROLE(psessionEntry), psessionEntry->limSmeState, MAC_ADDR_ARRAY(pHdr->sa)); return; diff --git a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c index 87237e3f6091..6bfe87f73110 100644 --- a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c +++ b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c @@ -432,7 +432,7 @@ static void limHandleUnknownA2IndexFrames(tpAniSirGlobal pMac, void *pRxPacketIn //limSendDisassocMgmtFrame(pMac, eSIR_MAC_CLASS3_FRAME_FROM_NON_ASSOC_STA_REASON,(tANI_U8 *) pRxPacketInfo); //TODO: verify this //This could be a public action frame. - if( psessionEntry->limSystemRole == eLIM_P2P_DEVICE_ROLE ) + if (LIM_IS_P2P_DEVICE_ROLE(psessionEntry)) limProcessActionFrameNoSession(pMac, (tANI_U8 *) pRxPacketInfo); #ifdef FEATURE_WLAN_TDLS @@ -449,7 +449,7 @@ static void limHandleUnknownA2IndexFrames(tpAniSirGlobal pMac, void *pRxPacketIn } /* TDLS_hklee: move down here to reject Addr2 == Group (first checking above) and also checking if SystemRole == STA */ - if (psessionEntry->limSystemRole == eLIM_STA_ROLE) + if (LIM_IS_STA_ROLE(psessionEntry)) { /* ADD handling of Public Action Frame */ LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, \ @@ -786,13 +786,10 @@ limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg) { case SIR_MAC_MGMT_ASSOC_REQ: // Make sure the role supports Association - if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) - || (psessionEntry->limSystemRole == eLIM_AP_ROLE) - ) + if (LIM_IS_BT_AMP_AP_ROLE(psessionEntry) || + LIM_IS_AP_ROLE(psessionEntry)) limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_ASSOC, psessionEntry); - - else - { + else { // Unwanted messages - Log error limLog(pMac, LOGE, FL("unexpected message received %X"),limMsg->type); } @@ -804,13 +801,10 @@ limHandle80211Frames(tpAniSirGlobal pMac, tpSirMsgQ limMsg, tANI_U8 *pDeferMsg) case SIR_MAC_MGMT_REASSOC_REQ: // Make sure the role supports Reassociation - if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) - || (psessionEntry->limSystemRole == eLIM_AP_ROLE) - ){ + if (LIM_IS_BT_AMP_AP_ROLE(psessionEntry) || + LIM_IS_AP_ROLE(psessionEntry)) { limProcessAssocReqFrame(pMac, pRxPacketInfo, LIM_REASSOC, psessionEntry); - } - else - { + } else { // Unwanted messages - Log error limLog(pMac, LOGE, FL("unexpected message received %X"),limMsg->type); } @@ -1108,8 +1102,7 @@ limProcessMessages(tpAniSirGlobal pMac, tpSirMsgQ limMsg) #if defined WLAN_FEATURE_VOWIFI_11R tpPESession pSession; #endif - if(pMac->gDriverType == eDRIVER_TYPE_MFG) - { + if (ANI_DRIVER_TYPE(pMac) == eDRIVER_TYPE_MFG) { vos_mem_free(limMsg->bodyptr); limMsg->bodyptr = NULL; return; diff --git a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c index 8fa511d942b5..3dd565194815 100644 --- a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c @@ -2080,14 +2080,14 @@ limProcessMlmPostJoinSuspendLink(tpAniSirGlobal pMac, eHalStatus status, tANI_U3 limLog(pMac, LOG1, FL("Sessionid %d prev lim state %d new lim state %d " "systemrole = %d"), psessionEntry->peSessionId, psessionEntry->limPrevMlmState, - psessionEntry->limMlmState,psessionEntry->limSystemRole); + psessionEntry->limMlmState, GET_LIM_SYSTEM_ROLE(psessionEntry)); limDeactivateAndChangeTimer(pMac, eLIM_JOIN_FAIL_TIMER); //assign appropriate sessionId to the timer object pMac->lim.limTimers.gLimJoinFailureTimer.sessionId = psessionEntry->peSessionId; - linkState = ((psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE) ? eSIR_LINK_BTAMP_PREASSOC_STATE : eSIR_LINK_PREASSOC_STATE); + linkState = LIM_IS_BT_AMP_STA_ROLE(psessionEntry) ? eSIR_LINK_BTAMP_PREASSOC_STATE : eSIR_LINK_PREASSOC_STATE; limLog(pMac, LOG1, FL("[limProcessMlmJoinReq]: linkState:%d"),linkState); if (limSetLinkState(pMac, linkState, @@ -2177,11 +2177,12 @@ limProcessMlmJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) goto error; } - if (( (psessionEntry->limSystemRole != eLIM_AP_ROLE ) && (psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE )) && - ( (psessionEntry->limMlmState == eLIM_MLM_IDLE_STATE) || - (psessionEntry->limMlmState == eLIM_MLM_JOINED_STATE)) && - (SIR_MAC_GET_ESS( ((tpLimMlmJoinReq) pMsgBuf)->bssDescription.capabilityInfo) != - SIR_MAC_GET_IBSS( ((tpLimMlmJoinReq) pMsgBuf)->bssDescription.capabilityInfo))) + if ((!LIM_IS_AP_ROLE(psessionEntry) && + !LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) && + ((psessionEntry->limMlmState == eLIM_MLM_IDLE_STATE) || + (psessionEntry->limMlmState == eLIM_MLM_JOINED_STATE)) && + (SIR_MAC_GET_ESS(((tpLimMlmJoinReq) pMsgBuf)->bssDescription.capabilityInfo) != + SIR_MAC_GET_IBSS( ((tpLimMlmJoinReq) pMsgBuf)->bssDescription.capabilityInfo))) { /// Hold onto Join request parameters @@ -2221,12 +2222,12 @@ limProcessMlmJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) */ PELOGE(limLog(pMac, LOGE, FL("Unexpected Join request for role %d state %X"), - psessionEntry->limSystemRole, + GET_LIM_SYSTEM_ROLE(psessionEntry), psessionEntry->limMlmState);) limPrintMlmState(pMac, LOGE, psessionEntry->limMlmState); limLog(pMac, LOGE, FL("SessionId:%d Unexpected Join request for role %d state %X "), - psessionEntry->peSessionId,psessionEntry->limSystemRole, + psessionEntry->peSessionId, GET_LIM_SYSTEM_ROLE(psessionEntry), psessionEntry->limMlmState); } @@ -2288,9 +2289,9 @@ limProcessMlmAuthReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) return; } - limLog(pMac, LOG1,FL("Process Auth Req on sessionID %d Systemrole %d" + limLog(pMac, LOG1,FL("Process Auth Req on sessionID %d Systemrole %d " "mlmstate %d from: "MAC_ADDRESS_STR" with authtype %d"), sessionId, - psessionEntry->limSystemRole,psessionEntry->limMlmState, + GET_LIM_SYSTEM_ROLE(psessionEntry), psessionEntry->limMlmState, MAC_ADDR_ARRAY(pMac->lim.gpLimMlmAuthReq->peerMacAddr), pMac->lim.gpLimMlmAuthReq->authType); @@ -2305,11 +2306,12 @@ limProcessMlmAuthReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) */ sirCopyMacAddr(currentBssId,psessionEntry->bssId); - if (((((psessionEntry->limSystemRole== eLIM_STA_ROLE) || (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) && + if ((((LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) && ((psessionEntry->limMlmState == eLIM_MLM_JOINED_STATE) || (psessionEntry->limMlmState == eLIM_MLM_LINK_ESTABLISHED_STATE))) || - ((psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) && + (LIM_IS_IBSS_ROLE(psessionEntry) && (psessionEntry->limMlmState == eLIM_MLM_BSS_STARTED_STATE))) && (limIsGroupAddr(pMac->lim.gpLimMlmAuthReq->peerMacAddr) == false) && @@ -2328,7 +2330,8 @@ limProcessMlmAuthReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) * If yes, return auth confirm immediately when * requested auth type is same as the one used before. */ - if ((((psessionEntry->limSystemRole == eLIM_STA_ROLE) ||(psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE) )&& + if (((LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) && (psessionEntry->limMlmState == eLIM_MLM_LINK_ESTABLISHED_STATE) && (((pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable)) != NULL) && @@ -2485,11 +2488,12 @@ limProcessMlmAssocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) sirCopyMacAddr(currentBssId,psessionEntry->bssId); - if ( (psessionEntry->limSystemRole != eLIM_AP_ROLE && psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE) && - (psessionEntry->limMlmState == eLIM_MLM_AUTHENTICATED_STATE || psessionEntry->limMlmState == eLIM_MLM_JOINED_STATE) && - (vos_mem_compare(pMlmAssocReq->peerMacAddr, currentBssId, sizeof(tSirMacAddr))) ) - { - + if ((!LIM_IS_AP_ROLE(psessionEntry) && + !LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) && + (psessionEntry->limMlmState == eLIM_MLM_AUTHENTICATED_STATE || + psessionEntry->limMlmState == eLIM_MLM_JOINED_STATE) && + (vos_mem_compare(pMlmAssocReq->peerMacAddr, currentBssId, + sizeof(tSirMacAddr)))) { /// map the session entry pointer to the AssocFailureTimer pMac->lim.limTimers.gLimAssocFailureTimer.sessionId = pMlmAssocReq->sessionId; @@ -2516,9 +2520,9 @@ limProcessMlmAssocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) limSendAssocReqMgmtFrame(pMac, pMlmAssocReq,psessionEntry); //Set the link state to postAssoc, so HW can start receiving frames from AP. - if ((psessionEntry->bssType == eSIR_BTAMP_STA_MODE)|| - ((psessionEntry->bssType == eSIR_BTAMP_AP_MODE) && (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE))) - { + if ((psessionEntry->bssType == eSIR_BTAMP_STA_MODE) || + ((psessionEntry->bssType == eSIR_BTAMP_AP_MODE) && + LIM_IS_BT_AMP_STA_ROLE(psessionEntry))) { if(limSetLinkState(pMac, eSIR_LINK_BTAMP_POSTASSOC_STATE, currentBssId, psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS) PELOGE(limLog(pMac, LOGE, FL("Failed to set the LinkState"));) @@ -2553,7 +2557,7 @@ limProcessMlmAssocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) PELOGW(limLog(pMac, LOGW, FL("received unexpected MLM_ASSOC_CNF in state %X for role=%d, MAC addr= " MAC_ADDRESS_STR), psessionEntry->limMlmState, - psessionEntry->limSystemRole, MAC_ADDR_ARRAY(pMlmAssocReq->peerMacAddr));) + GET_LIM_SYSTEM_ROLE(psessionEntry), MAC_ADDR_ARRAY(pMlmAssocReq->peerMacAddr));) limPrintMlmState(pMac, LOGW, psessionEntry->limMlmState); mlmAssocCnf.resultCode = eSIR_SME_INVALID_PARAMETERS; @@ -2617,14 +2621,14 @@ limProcessMlmReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) return; } - limLog(pMac, LOG1,FL("Process ReAssoc Req on sessionID %d Systemrole %d" + limLog(pMac, LOG1,FL("Process ReAssoc Req on sessionID %d Systemrole %d " "mlmstate %d from: "MAC_ADDRESS_STR), pMlmReassocReq->sessionId, - psessionEntry->limSystemRole, psessionEntry->limMlmState, + GET_LIM_SYSTEM_ROLE(psessionEntry), psessionEntry->limMlmState, MAC_ADDR_ARRAY(pMlmReassocReq->peerMacAddr)); - if (((psessionEntry->limSystemRole != eLIM_AP_ROLE) && (psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE)) && - (psessionEntry->limMlmState == eLIM_MLM_LINK_ESTABLISHED_STATE)) - { + if ((!LIM_IS_AP_ROLE(psessionEntry) && + !LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) && + (psessionEntry->limMlmState == eLIM_MLM_LINK_ESTABLISHED_STATE)) { if (psessionEntry->pLimMlmReassocReq) vos_mem_free(psessionEntry->pLimMlmReassocReq); @@ -2689,7 +2693,7 @@ limProcessMlmReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) FL("received unexpected MLM_REASSOC_CNF in state %X for role=%d, " "MAC addr= " MAC_ADDRESS_STR), psessionEntry->limMlmState, - psessionEntry->limSystemRole, + GET_LIM_SYSTEM_ROLE(psessionEntry), MAC_ADDR_ARRAY(pMlmReassocReq->peerMacAddr)); limPrintMlmState(pMac, LOGW, psessionEntry->limMlmState); @@ -2739,14 +2743,14 @@ limProcessMlmDisassocReqNtf(tpAniSirGlobal pMac, eHalStatus suspendStatus, tANI_ mlmDisassocCnf.resultCode = eSIR_SME_INVALID_PARAMETERS; goto end; } - limLog(pMac, LOG1,FL("Process DisAssoc Req on sessionID %d Systemrole %d" + limLog(pMac, LOG1,FL("Process DisAssoc Req on sessionID %d Systemrole %d " "mlmstate %d from: "MAC_ADDRESS_STR), pMlmDisassocReq->sessionId, - psessionEntry->limSystemRole, psessionEntry->limMlmState, + GET_LIM_SYSTEM_ROLE(psessionEntry), psessionEntry->limMlmState, MAC_ADDR_ARRAY(pMlmDisassocReq->peerMacAddr)); sirCopyMacAddr(currentBssId,psessionEntry->bssId); - switch (psessionEntry->limSystemRole) + switch (GET_LIM_SYSTEM_ROLE(psessionEntry)) { case eLIM_STA_ROLE: case eLIM_BT_AMP_STA_ROLE: @@ -2827,7 +2831,7 @@ limProcessMlmDisassocReqNtf(tpAniSirGlobal pMac, eHalStatus suspendStatus, tANI_ /* If the reason for disassociation is inactivity of STA, then dont wait for acknowledgement */ if ((pMlmDisassocReq->reasonCode == eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON) && - (psessionEntry->limSystemRole == eLIM_AP_ROLE)) + LIM_IS_AP_ROLE(psessionEntry)) { limSendDisassocMgmtFrame(pMac, @@ -2848,7 +2852,7 @@ limProcessMlmDisassocReqNtf(tpAniSirGlobal pMac, eHalStatus suspendStatus, tANI_ * Abort Tx so that data frames won't be sent to the AP * after sending Disassoc. */ - if (eLIM_STA_ROLE == psessionEntry->limSystemRole) + if (LIM_IS_STA_ROLE(psessionEntry)) WDA_TxAbort(psessionEntry->smeSessionId); } } @@ -3044,13 +3048,13 @@ limProcessMlmDeauthReqNtf(tpAniSirGlobal pMac, eHalStatus suspendStatus, tANI_U3 vos_mem_free(pMlmDeauthReq); return; } - limLog(pMac, LOG1,FL("Process Deauth Req on sessionID %d Systemrole %d" + limLog(pMac, LOG1,FL("Process Deauth Req on sessionID %d Systemrole %d " "mlmstate %d from: "MAC_ADDRESS_STR), pMlmDeauthReq->sessionId, - psessionEntry->limSystemRole, psessionEntry->limMlmState, + GET_LIM_SYSTEM_ROLE(psessionEntry), psessionEntry->limMlmState, MAC_ADDR_ARRAY(pMlmDeauthReq->peerMacAddr)); sirCopyMacAddr(currentBssId,psessionEntry->bssId); - switch (psessionEntry->limSystemRole) + switch (GET_LIM_SYSTEM_ROLE(psessionEntry)) { case eLIM_STA_ROLE: case eLIM_BT_AMP_STA_ROLE: @@ -3348,7 +3352,7 @@ tpPESession psessionEntry; sirCopyMacAddr(currentBssId,psessionEntry->bssId); - switch( psessionEntry->limSystemRole ) { + switch (GET_LIM_SYSTEM_ROLE(psessionEntry)) { case eLIM_STA_ROLE: case eLIM_BT_AMP_STA_ROLE: //In case of TDLS, peerMac address need not be BssId. Skip this check @@ -3411,7 +3415,8 @@ tpPESession psessionEntry; pStaDs = dphLookupHashEntry( pMac, pMlmSetKeysReq->peerMacAddr, &aid , &psessionEntry->dph.dphHashTable); if ((pStaDs == NULL) || - ((pStaDs->mlmStaContext.mlmState != eLIM_MLM_LINK_ESTABLISHED_STATE) && (psessionEntry->limSystemRole != eLIM_AP_ROLE))) { + ((pStaDs->mlmStaContext.mlmState != eLIM_MLM_LINK_ESTABLISHED_STATE) && + !LIM_IS_AP_ROLE(psessionEntry))) { /** * Received LIM_MLM_SETKEYS_REQ for STA * that does not have context or in some @@ -3532,15 +3537,13 @@ tLimMlmRemoveKeyCnf mlmRemoveKeyCnf; sirCopyMacAddr(currentBssId,psessionEntry->bssId); - switch( psessionEntry->limSystemRole ) - { - case eLIM_STA_ROLE: - case eLIM_BT_AMP_STA_ROLE: + switch (GET_LIM_SYSTEM_ROLE(psessionEntry)) { + case eLIM_STA_ROLE: + case eLIM_BT_AMP_STA_ROLE: if (( limIsAddrBC( pMlmRemoveKeyReq->peerMacAddr ) != true ) && (!vos_mem_compare(pMlmRemoveKeyReq->peerMacAddr, currentBssId, - sizeof(tSirMacAddr)))) - { + sizeof(tSirMacAddr)))) { limLog( pMac, LOGW, FL("Received MLM_REMOVEKEY_REQ with invalid BSSID")); limPrintMacAddr( pMac, pMlmRemoveKeyReq->peerMacAddr, LOGW ); @@ -3551,13 +3554,12 @@ tLimMlmRemoveKeyCnf mlmRemoveKeyCnf; } break; - case eLIM_STA_IN_IBSS_ROLE: - default: // eLIM_AP_ROLE - // Fall thru... - break; + case eLIM_STA_IN_IBSS_ROLE: + default: // eLIM_AP_ROLE + // Fall thru... + break; } - psessionEntry->limPrevMlmState = psessionEntry->limMlmState; if(limIsAddrBC( pMlmRemoveKeyReq->peerMacAddr )) //Second condition for IBSS or AP role. { @@ -4120,9 +4122,7 @@ limProcessAuthRspTimeout(tpAniSirGlobal pMac, tANI_U32 authIndex) return; } - if (psessionEntry->limSystemRole == eLIM_AP_ROLE || - psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) - { + if (LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_IBSS_ROLE(psessionEntry)) { if (pAuthNode->mlmState != eLIM_MLM_WT_AUTH_FRAME3_STATE) { /** @@ -4225,11 +4225,11 @@ limProcessAssocFailureTimeout(tpAniSirGlobal pMac, tANI_U32 MsgType) PELOG1(limLog(pMac, LOG1, FL("Re/Association Response not received before timeout "));) - if (( (psessionEntry->limSystemRole == eLIM_AP_ROLE) || (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) )|| - ( (psessionEntry->limMlmState != eLIM_MLM_WT_ASSOC_RSP_STATE) && - (psessionEntry->limMlmState != eLIM_MLM_WT_REASSOC_RSP_STATE) && - (psessionEntry->limMlmState != eLIM_MLM_WT_FT_REASSOC_RSP_STATE))) - { + if ((LIM_IS_AP_ROLE(psessionEntry) || + LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) || + ((psessionEntry->limMlmState != eLIM_MLM_WT_ASSOC_RSP_STATE) && + (psessionEntry->limMlmState != eLIM_MLM_WT_REASSOC_RSP_STATE) && + (psessionEntry->limMlmState != eLIM_MLM_WT_FT_REASSOC_RSP_STATE))) { /** * Re/Assoc failure timer should not have timedout on AP * or in a state other than wt_re/assoc_response. @@ -4238,12 +4238,9 @@ limProcessAssocFailureTimeout(tpAniSirGlobal pMac, tANI_U32 MsgType) // Log error limLog(pMac, LOGW, FL("received unexpected REASSOC failure timeout in state %X for role %d"), - psessionEntry->limMlmState, psessionEntry->limSystemRole); + psessionEntry->limMlmState, GET_LIM_SYSTEM_ROLE(psessionEntry)); limPrintMlmState(pMac, LOGW, psessionEntry->limMlmState); - } - else - { - + } else { if ((MsgType == LIM_ASSOC) || ((MsgType == LIM_REASSOC) && (psessionEntry->limMlmState == eLIM_MLM_WT_FT_REASSOC_RSP_STATE))) { diff --git a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c index 07b6ffd2e80f..23c509b14fc5 100644 --- a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c @@ -428,10 +428,8 @@ limProcessMlmStartCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) // request from upper layers to start the beacon transmission - if ( (eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole) || - ((eLIM_AP_ROLE == psessionEntry->limSystemRole) && - (vos_nv_getChannelEnabledState(channelId) != NV_CHANNEL_DFS)) ) - { + if (LIM_IS_IBSS_ROLE(psessionEntry) || (LIM_IS_AP_ROLE(psessionEntry) && + (vos_nv_getChannelEnabledState(channelId) != NV_CHANNEL_DFS))) { //Configure beacon and send beacons to HAL VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, FL("Start Beacon with ssid %s Ch %d"), @@ -704,8 +702,7 @@ limProcessMlmAuthCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) if (((psessionEntry->limSmeState != eLIM_SME_WT_AUTH_STATE) && (psessionEntry->limSmeState != eLIM_SME_WT_PRE_AUTH_STATE)) || - (psessionEntry->limSystemRole == eLIM_AP_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) - { + LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { /** * Should not have received AUTH confirm * from MLM in other states or on AP. @@ -865,8 +862,7 @@ limProcessMlmAssocCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) return; } if (psessionEntry->limSmeState != eLIM_SME_WT_ASSOC_STATE || - psessionEntry->limSystemRole == eLIM_AP_ROLE || psessionEntry ->limSystemRole == eLIM_BT_AMP_AP_ROLE) - { + LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { /** * Should not have received Assocication confirm * from MLM in other states OR on AP. @@ -945,17 +941,16 @@ limProcessMlmReassocCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) return; } if ((psessionEntry->limSmeState != eLIM_SME_WT_REASSOC_STATE) || - (psessionEntry->limSystemRole == eLIM_AP_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) - { + LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { /** * Should not have received Reassocication confirm * from MLM in other states OR on AP. * Log error */ PELOGE(limLog(pMac, LOGE, - FL("Rcv unexpected MLM_REASSOC_CNF in role %d, sme state 0x%X"), - psessionEntry->limSystemRole, psessionEntry->limSmeState);) - return; + FL("Rcv unexpected MLM_REASSOC_CNF in role %d, sme state 0x%X"), + GET_LIM_SYSTEM_ROLE(psessionEntry), psessionEntry->limSmeState);) + return; } if (psessionEntry->pLimReAssocReq) { vos_mem_free(psessionEntry->pLimReAssocReq); @@ -1351,20 +1346,20 @@ limProcessMlmDisassocInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) limLog(pMac, LOGP,FL("Session Does not exist for given sessionID")); return; } - switch (psessionEntry->limSystemRole) - { - case eLIM_STA_IN_IBSS_ROLE: - break; - case eLIM_STA_ROLE: - case eLIM_BT_AMP_STA_ROLE: + switch (GET_LIM_SYSTEM_ROLE(psessionEntry)) { + case eLIM_STA_IN_IBSS_ROLE: + break; + case eLIM_STA_ROLE: + case eLIM_BT_AMP_STA_ROLE: psessionEntry->limSmeState = eLIM_SME_WT_DISASSOC_STATE; - MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); - break; - default: // eLIM_AP_ROLE //eLIM_BT_AMP_AP_ROLE - PELOG1(limLog(pMac, LOG1, - FL("*** Peer staId=%d Disassociated ***"), - pMlmDisassocInd->aid);) - break; + MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); + break; + + default: // eLIM_AP_ROLE //eLIM_BT_AMP_AP_ROLE + PELOG1(limLog(pMac, LOG1, + FL("*** Peer staId=%d Disassociated ***"), + pMlmDisassocInd->aid);) + break; } // end switch (psessionEntry->limSystemRole) } /*** end limProcessMlmDisassocInd() ***/ @@ -1403,8 +1398,8 @@ limProcessMlmDisassocCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) eLIM_LINK_MONITORING_DISASSOC) ? eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE : pMlmDisassocCnf->resultCode; - if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) - { + if (LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) { // Disassociate Confirm from MLM if ( (psessionEntry->limSmeState != eLIM_SME_WT_DISASSOC_STATE) && (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE) ) @@ -1442,9 +1437,8 @@ limProcessMlmDisassocCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) pMlmDisassocCnf->disassocTrigger, pMlmDisassocCnf->aid,psessionEntry->smeSessionId,psessionEntry->transactionId,psessionEntry); } - } - else if ( (psessionEntry->limSystemRole == eLIM_AP_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) ) - { + } else if (LIM_IS_AP_ROLE(psessionEntry) || + LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { limSendSmeDisassocNtf(pMac, pMlmDisassocCnf->peerMacAddr, resultCode, pMlmDisassocCnf->disassocTrigger, @@ -1482,22 +1476,20 @@ limProcessMlmDeauthInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) PELOGE(limLog(pMac, LOGE,FL("session does not exist for given BSSId"));) return; } - switch (psessionEntry->limSystemRole) - { - case eLIM_STA_IN_IBSS_ROLE: - break; - case eLIM_STA_ROLE: - case eLIM_BT_AMP_STA_ROLE: - psessionEntry->limSmeState = eLIM_SME_WT_DEAUTH_STATE; - MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); - default: // eLIM_AP_ROLE - { - PELOG1(limLog(pMac, LOG1, - FL("*** Received Deauthentication from staId=%d ***"), - pMlmDeauthInd->aid);) - } - break; + switch (GET_LIM_SYSTEM_ROLE(psessionEntry)) { + case eLIM_STA_IN_IBSS_ROLE: + break; + case eLIM_STA_ROLE: + case eLIM_BT_AMP_STA_ROLE: + psessionEntry->limSmeState = eLIM_SME_WT_DEAUTH_STATE; + MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); + + default: // eLIM_AP_ROLE + PELOG1(limLog(pMac, LOG1, + FL("*** Received Deauthentication from staId=%d ***"), + pMlmDeauthInd->aid);) + break; } // end switch (psessionEntry->limSystemRole) } /*** end limProcessMlmDeauthInd() ***/ @@ -1544,10 +1536,9 @@ limProcessMlmDeauthCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) eLIM_LINK_MONITORING_DEAUTH) ? eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE : pMlmDeauthCnf->resultCode; - aid = (psessionEntry->limSystemRole == eLIM_AP_ROLE) ? - pMlmDeauthCnf->aid : 1; - if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) - { + aid = LIM_IS_AP_ROLE(psessionEntry) ? pMlmDeauthCnf->aid : 1; + if (LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) { // Deauth Confirm from MLM if (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE) { @@ -1618,14 +1609,14 @@ limProcessMlmPurgeStaInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) } // Purge STA indication from MLM resultCode = (tSirResultCodes) pMlmPurgeStaInd->reasonCode; - switch (psessionEntry->limSystemRole) + switch (GET_LIM_SYSTEM_ROLE(psessionEntry)) { case eLIM_STA_IN_IBSS_ROLE: break; case eLIM_STA_ROLE: case eLIM_BT_AMP_STA_ROLE: default: // eLIM_AP_ROLE - if ((psessionEntry->limSystemRole == eLIM_STA_ROLE) && + if (LIM_IS_STA_ROLE(psessionEntry) && (psessionEntry->limSmeState != eLIM_SME_WT_DISASSOC_STATE) && (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE)) @@ -1644,8 +1635,8 @@ limProcessMlmPurgeStaInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) PELOG1(limLog(pMac, LOG1, FL("*** Cleanup completed for staId=%d ***"), pMlmPurgeStaInd->aid);) - if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) - { + if (LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) { psessionEntry->limSmeState = eLIM_SME_IDLE_STATE; MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, psessionEntry->limSmeState)); @@ -1714,8 +1705,8 @@ limProcessMlmSetKeysCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) */ if (eSIR_SME_SUCCESS == pMlmSetKeysCnf->resultCode) { psessionEntry->isKeyInstalled = 1; - if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) || - (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) { + if (LIM_IS_AP_ROLE(psessionEntry) || + LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { pStaDs = dphLookupHashEntry(pMac, pMlmSetKeysCnf->peerMacAddr, &aid, &psessionEntry->dph.dphHashTable); if (pStaDs != NULL) @@ -1935,10 +1926,8 @@ void limProcessMlmAddStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession //in the case of nested request the new request initiated from the response will take care of resetting //the deffered flag. SET_LIM_PROCESS_DEFD_MESGS(pMac, true); - if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) - || (psessionEntry->limSystemRole == eLIM_AP_ROLE) - ) - { + if (LIM_IS_BT_AMP_AP_ROLE(psessionEntry) || + LIM_IS_AP_ROLE(psessionEntry)) { limProcessBtAmpApMlmAddStaRsp(pMac, limMsgQ,psessionEntry); return; } @@ -2076,12 +2065,10 @@ void limProcessMlmDelBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession SET_LIM_PROCESS_DEFD_MESGS(pMac, true); pMac->sys.gSysFrameCount[SIR_MAC_MGMT_FRAME][SIR_MAC_MGMT_DEAUTH] = 0; - if (((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) || - (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE) - || (psessionEntry->limSystemRole == eLIM_AP_ROLE) - ) && - (psessionEntry->statypeForBss == STA_ENTRY_SELF)) - { + if ((LIM_IS_BT_AMP_AP_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry) || + LIM_IS_AP_ROLE(psessionEntry)) && + (psessionEntry->statypeForBss == STA_ENTRY_SELF)) { limProcessBtAmpApMlmDelBssRsp(pMac, limMsgQ,psessionEntry); return; } @@ -2156,11 +2143,11 @@ void limProcessStaMlmDelBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESessi } if(pStaDs == NULL) return; - if ( ((psessionEntry->limSystemRole == eLIM_STA_ROLE) || (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) && - (psessionEntry->limSmeState != eLIM_SME_WT_DISASSOC_STATE && - psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE) && - pStaDs->mlmStaContext.cleanupTrigger != eLIM_JOIN_FAILURE) - { + if ((LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) && + (psessionEntry->limSmeState != eLIM_SME_WT_DISASSOC_STATE && + psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE) && + pStaDs->mlmStaContext.cleanupTrigger != eLIM_JOIN_FAILURE) { /** The Case where the DelBss is invoked from * context of other than normal DisAssoc / Deauth OR * as part of Join Failure. @@ -2263,10 +2250,8 @@ void limProcessMlmDelStaRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ ) return; } - if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) - || (psessionEntry->limSystemRole == eLIM_AP_ROLE) - ) - { + if (LIM_IS_BT_AMP_AP_ROLE(psessionEntry) || + LIM_IS_AP_ROLE(psessionEntry)) { limProcessBtAmpApMlmDelStaRsp(pMac,limMsgQ,psessionEntry); return; } @@ -4616,9 +4601,8 @@ limHandleDelBssInReAssocContext(tpAniSirGlobal pMac, tpDphHashNode pStaDs,tpPESe /** Set the SME State back to WT_Reassoc State*/ psessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE; limDeleteDphHashEntry(pMac, pStaDs->staAddr, pStaDs->assocId,psessionEntry); - if((psessionEntry->limSystemRole == eLIM_STA_ROLE)|| - (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) - { + if (LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) { psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE; } limPostSmeMessage(pMac, LIM_MLM_REASSOC_CNF, (tANI_U32 *) &mlmReassocCnf); @@ -4793,9 +4777,8 @@ limHandleAddBssInReAssocContext(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPES /** Set the SME State back to WT_Reassoc State*/ psessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE; limDeleteDphHashEntry(pMac, pStaDs->staAddr, pStaDs->assocId, psessionEntry); - if(psessionEntry->limSystemRole == eLIM_STA_ROLE) - { - psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE; + if (LIM_IS_STA_ROLE(psessionEntry)) { + psessionEntry->limMlmState = eLIM_MLM_IDLE_STATE; MTRACE(macTrace(pMac, TRACE_CODE_MLM_STATE, psessionEntry->peSessionId, psessionEntry->limMlmState)); } diff --git a/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c b/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c index c3e9dc412922..c5941908a770 100644 --- a/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c +++ b/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c @@ -378,12 +378,11 @@ limProcessProbeReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); - if ( (psessionEntry->limSystemRole == eLIM_AP_ROLE) || - (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)|| - (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)|| - ( (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) && - (WDA_GET_RX_BEACON_SENT(pRxPacketInfo)) ) ) - { + if (LIM_IS_AP_ROLE(psessionEntry) || + LIM_IS_BT_AMP_AP_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry) || + (LIM_IS_IBSS_ROLE(psessionEntry) && + (WDA_GET_RX_BEACON_SENT(pRxPacketInfo)))) { frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); PELOG3(limLog(pMac, LOG3, FL("Received Probe Request %d bytes from "), frameLen); @@ -440,9 +439,8 @@ limProcessProbeReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession return; } } - if ((psessionEntry->limSystemRole == eLIM_AP_ROLE)) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { if ( (psessionEntry->APWPSIEs.SirWPSProbeRspIE.FieldPresent & SIR_WPS_PROBRSP_VER_PRESENT) && (probeReq.wscIePresent == 1) && @@ -643,9 +641,7 @@ limProcessProbeReqFrame_multiple_BSS(tpAniSirGlobal pMac, tANI_U8 *pBd, tpPESes if (psessionEntry != NULL) { - if ((eLIM_AP_ROLE == psessionEntry->limSystemRole) - ) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { limIndicateProbeReqToHDD(pMac, pBd, psessionEntry); } limProcessProbeReqFrame(pMac,pBd,psessionEntry); @@ -657,17 +653,13 @@ limProcessProbeReqFrame_multiple_BSS(tpAniSirGlobal pMac, tANI_U8 *pBd, tpPESes psessionEntry = peFindSessionBySessionId(pMac,i); if ( (psessionEntry != NULL) ) { - if ((eLIM_AP_ROLE == psessionEntry->limSystemRole) - ) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { limIndicateProbeReqToHDD(pMac, pBd, psessionEntry); } - if ( (eLIM_AP_ROLE == psessionEntry->limSystemRole) || - (eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole) || - (eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) || - (eLIM_BT_AMP_STA_ROLE == psessionEntry->limSystemRole) - ) - { + if (LIM_IS_AP_ROLE(psessionEntry) || + LIM_IS_IBSS_ROLE(psessionEntry) || + LIM_IS_BT_AMP_AP_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) { limProcessProbeReqFrame(pMac,pBd,psessionEntry); } } diff --git a/CORE/MAC/src/pe/lim/limProcessProbeRspFrame.c b/CORE/MAC/src/pe/lim/limProcessProbeRspFrame.c index ddb1bb94072f..d8976751478c 100644 --- a/CORE/MAC/src/pe/lim/limProcessProbeRspFrame.c +++ b/CORE/MAC/src/pe/lim/limProcessProbeRspFrame.c @@ -166,7 +166,7 @@ limProcessProbeRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE) || //mlm state check should be global - 18th oct (psessionEntry->limMlmState == eLIM_MLM_WT_JOIN_BEACON_STATE) || (psessionEntry->limMlmState == eLIM_MLM_LINK_ESTABLISHED_STATE) )|| - ((GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_STA_IN_IBSS_ROLE) && + (LIM_IS_IBSS_ROLE(psessionEntry) && (psessionEntry->limMlmState == eLIM_MLM_BSS_STARTED_STATE)) || pMac->fScanOffload) { @@ -262,8 +262,7 @@ limProcessProbeRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession } - if (psessionEntry->limSystemRole == eLIM_STA_ROLE) - { + if (LIM_IS_STA_ROLE(psessionEntry)) { if (pProbeRsp->channelSwitchPresent) { limUpdateChannelSwitch(pMac, pProbeRsp, psessionEntry); @@ -316,7 +315,7 @@ limProcessProbeRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession limDetectChangeInApCapabilities(pMac, pProbeRsp, psessionEntry); } } - else if ((psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) && + else if (LIM_IS_IBSS_ROLE(psessionEntry) && (psessionEntry->limMlmState == eLIM_MLM_BSS_STARTED_STATE)) limHandleIBSScoalescing(pMac, pProbeRsp, pRxPacketInfo,psessionEntry); } // if ((pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) || ... diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c index 8951233da9cc..65436c51ec3d 100644 --- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c @@ -429,8 +429,7 @@ __limProcessSmeSysReadyInd(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) msg.bodyptr = pMsgBuf; msg.bodyval = 0; - if (pMac->gDriverType != eDRIVER_TYPE_MFG) - { + if (ANI_DRIVER_TYPE(pMac) != eDRIVER_TYPE_MFG) { peRegisterTLHandle(pMac); } PELOGW(limLog(pMac, LOGW, FL("sending WDA_SYS_READY_IND msg to HAL"));) @@ -884,8 +883,7 @@ __limHandleSmeStartBssRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) * */ limSetRSNieWPAiefromSmeStartBSSReqMessage(pMac,&pSmeStartBssReq->rsnIE,psessionEntry); - if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) - || (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE)) { + if (LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_IBSS_ROLE(psessionEntry)) { psessionEntry->gLimProtectionControl = pSmeStartBssReq->protEnabled; /*each byte will have the following info *bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 @@ -966,12 +964,10 @@ __limHandleSmeStartBssRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) pMlmStartReq->cbMode = pSmeStartBssReq->cbMode; pMlmStartReq->beaconPeriod = psessionEntry->beaconParams.beaconInterval; - if(psessionEntry->limSystemRole == eLIM_AP_ROLE ){ + if (LIM_IS_AP_ROLE(psessionEntry)) { pMlmStartReq->dtimPeriod = psessionEntry->dtimPeriod; pMlmStartReq->wps_state = psessionEntry->wps_state; - - }else - { + } else { if (wlan_cfgGetInt(pMac, WNI_CFG_DTIM_PERIOD, &val) != eSIR_SUCCESS) limLog(pMac, LOGP, FL("could not retrieve DTIM Period")); pMlmStartReq->dtimPeriod = (tANI_U8)val; @@ -2636,9 +2632,9 @@ __limProcessSmeDisassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) goto sendDisassoc; } - limLog(pMac, LOG1, FL("received DISASSOC_REQ message on sessionid %d" + limLog(pMac, LOG1, FL("received DISASSOC_REQ message on sessionid %d " "Systemrole %d Reason: %u SmeState: %d from: "MAC_ADDRESS_STR), - smesessionId,psessionEntry->limSystemRole, + smesessionId, GET_LIM_SYSTEM_ROLE(psessionEntry), smeDisassocReq.reasonCode, pMac->lim.gLimSmeState, MAC_ADDR_ARRAY(smeDisassocReq.peerMacAddr)); @@ -2651,7 +2647,7 @@ __limProcessSmeDisassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) psessionEntry->smeSessionId = smesessionId; psessionEntry->transactionId = smetransactionId; - switch (psessionEntry->limSystemRole) + switch (GET_LIM_SYSTEM_ROLE(psessionEntry)) { case eLIM_STA_ROLE: case eLIM_BT_AMP_STA_ROLE: @@ -2740,7 +2736,7 @@ __limProcessSmeDisassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) default: // eLIM_UNKNOWN_ROLE limLog(pMac, LOGE, FL("received unexpected SME_DISASSOC_REQ for role %d"), - psessionEntry->limSystemRole); + GET_LIM_SYSTEM_ROLE(psessionEntry)); retCode = eSIR_SME_UNEXPECTED_REQ_RESULT_CODE; disassocTrigger = eLIM_HOST_DISASSOC; @@ -2859,7 +2855,7 @@ __limProcessSmeDisassocCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) limDiagEventReport(pMac, WLAN_PE_DIAG_DEAUTH_CNF_EVENT, psessionEntry, (tANI_U16)smeDisassocCnf.statusCode, 0); #endif //FEATURE_WLAN_DIAG_SUPPORT - switch (psessionEntry->limSystemRole) + switch (GET_LIM_SYSTEM_ROLE(psessionEntry)) { case eLIM_STA_ROLE: case eLIM_BT_AMP_STA_ROLE: //To test reconn @@ -2882,17 +2878,14 @@ __limProcessSmeDisassocCnf(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) default: // eLIM_UNKNOWN_ROLE limLog(pMac, LOGE, FL("received unexpected SME_DISASSOC_CNF role %d"), - psessionEntry->limSystemRole); + GET_LIM_SYSTEM_ROLE(psessionEntry)); return; } - - if ( (psessionEntry->limSmeState == eLIM_SME_WT_DISASSOC_STATE) || - (psessionEntry->limSmeState == eLIM_SME_WT_DEAUTH_STATE) - || (psessionEntry->limSystemRole == eLIM_AP_ROLE ) - ) - { + if ((psessionEntry->limSmeState == eLIM_SME_WT_DISASSOC_STATE) || + (psessionEntry->limSmeState == eLIM_SME_WT_DEAUTH_STATE) || + LIM_IS_AP_ROLE(psessionEntry)) { pStaDs = dphLookupHashEntry(pMac, smeDisassocCnf.peerMacAddr, &aid, &psessionEntry->dph.dphHashTable); if (pStaDs == NULL) { @@ -2978,7 +2971,7 @@ __limProcessSmeDeauthReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) } limLog(pMac, LOG1,FL("received DEAUTH_REQ message on sessionid %d " "Systemrole %d with reasoncode %u in limSmestate %d from " - MAC_ADDRESS_STR), smesessionId, psessionEntry->limSystemRole, + MAC_ADDRESS_STR), smesessionId, GET_LIM_SYSTEM_ROLE(psessionEntry), smeDeauthReq.reasonCode, psessionEntry->limSmeState, MAC_ADDR_ARRAY(smeDeauthReq.peerMacAddr)); #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT @@ -2990,7 +2983,7 @@ __limProcessSmeDeauthReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) psessionEntry->transactionId = smetransactionId; - switch (psessionEntry->limSystemRole) + switch (GET_LIM_SYSTEM_ROLE(psessionEntry)) { case eLIM_STA_ROLE: case eLIM_BT_AMP_STA_ROLE: @@ -3073,7 +3066,7 @@ __limProcessSmeDeauthReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) default: limLog(pMac, LOGE, FL("received unexpected SME_DEAUTH_REQ for role %X"), - psessionEntry->limSystemRole); + GET_LIM_SYSTEM_ROLE(psessionEntry)); return; } // end switch (pMac->lim.gLimSystemRole) @@ -3212,12 +3205,13 @@ __limProcessSmeSetContextReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) #endif //FEATURE_WLAN_DIAG_SUPPORT - if ((((psessionEntry->limSystemRole == eLIM_STA_ROLE) || (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) && + if (((LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) && (psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE)) || - (((psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) || - (psessionEntry->limSystemRole == eLIM_AP_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) && - (psessionEntry->limSmeState == eLIM_SME_NORMAL_STATE))) - { + ((LIM_IS_IBSS_ROLE(psessionEntry) || + LIM_IS_AP_ROLE(psessionEntry) || + LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) && + (psessionEntry->limSmeState == eLIM_SME_NORMAL_STATE))) { // Trigger MLM_SETKEYS_REQ pMlmSetKeysReq = vos_mem_malloc(sizeof(tLimMlmSetKeysReq)); if ( NULL == pMlmSetKeysReq ) @@ -3250,9 +3244,9 @@ __limProcessSmeSetContextReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) FL("received SETCONTEXT_REQ message sessionId=%d"), pMlmSetKeysReq->sessionId);); #endif - if(((pSetContextReq->keyMaterial.edType == eSIR_ED_WEP40) || (pSetContextReq->keyMaterial.edType == eSIR_ED_WEP104)) - && (psessionEntry->limSystemRole == eLIM_AP_ROLE)) - { + if (((pSetContextReq->keyMaterial.edType == eSIR_ED_WEP40) || + (pSetContextReq->keyMaterial.edType == eSIR_ED_WEP104)) && + LIM_IS_AP_ROLE(psessionEntry)) { if(pSetContextReq->keyMaterial.key[0].keyLength) { tANI_U8 keyId; @@ -3276,7 +3270,7 @@ __limProcessSmeSetContextReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) { limLog(pMac, LOGE, FL("received unexpected SME_SETCONTEXT_REQ for role %d, state=%X"), - psessionEntry->limSystemRole, + GET_LIM_SYSTEM_ROLE(psessionEntry), psessionEntry->limSmeState); limSendSmeSetContextRsp(pMac, pSetContextReq->peerMacAddr, @@ -3376,12 +3370,13 @@ __limProcessSmeRemoveKeyReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) } - if ((((psessionEntry->limSystemRole == eLIM_STA_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE))&& + if (((LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) && (psessionEntry->limSmeState == eLIM_SME_LINK_EST_STATE)) || - (((psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) || - (psessionEntry->limSystemRole == eLIM_AP_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)) && - (psessionEntry->limSmeState == eLIM_SME_NORMAL_STATE))) - { + ((LIM_IS_IBSS_ROLE(psessionEntry) || + LIM_IS_AP_ROLE(psessionEntry) || + LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) && + (psessionEntry->limSmeState == eLIM_SME_NORMAL_STATE))) { // Trigger MLM_REMOVEKEYS_REQ pMlmRemoveKeyReq = vos_mem_malloc(sizeof(tLimMlmRemoveKeyReq)); if ( NULL == pMlmRemoveKeyReq ) @@ -3414,7 +3409,7 @@ __limProcessSmeRemoveKeyReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) { limLog(pMac, LOGE, FL("received unexpected SME_REMOVEKEY_REQ for role %d, state=%X"), - psessionEntry->limSystemRole, + GET_LIM_SYSTEM_ROLE(psessionEntry), psessionEntry->limSmeState); limSendSmeRemoveKeyRsp(pMac, @@ -3519,11 +3514,10 @@ void limProcessSmeGetAssocSTAsInfo(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) goto limAssocStaEnd; } - if (psessionEntry->limSystemRole != eLIM_AP_ROLE) - { + if (!LIM_IS_AP_ROLE(psessionEntry)) { limLog(pMac, LOGE, - FL("Received unexpected message in state %X, in role %X"), - psessionEntry->limSmeState, psessionEntry->limSystemRole); + FL("Received unexpected message in state %X, in role %X"), + psessionEntry->limSmeState, GET_LIM_SYSTEM_ROLE(psessionEntry)); goto limAssocStaEnd; } @@ -3623,11 +3617,10 @@ void limProcessSmeGetWPSPBCSessions(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) goto limGetWPSPBCSessionsEnd; } - if (psessionEntry->limSystemRole != eLIM_AP_ROLE) - { + if (!LIM_IS_AP_ROLE(psessionEntry)) { limLog(pMac, LOGE, - FL("Received unexpected message in role %X"), - psessionEntry->limSystemRole); + FL("Received unexpected message in role %X"), + GET_LIM_SYSTEM_ROLE(psessionEntry)); goto limGetWPSPBCSessionsEnd; } @@ -3684,12 +3677,10 @@ static void __limCounterMeasures(tpAniSirGlobal pMac, tpPESession psessionEntry) { tSirMacAddr mac = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; - if ( (psessionEntry->limSystemRole == eLIM_AP_ROLE) || (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) - || (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE) ) - + if (LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_BT_AMP_AP_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) limSendDisassocMgmtFrame(pMac, eSIR_MAC_MIC_FAILURE_REASON, mac, psessionEntry, FALSE); - -}; +} void @@ -3760,8 +3751,7 @@ __limHandleSmeStopBssRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) if ((psessionEntry->limSmeState != eLIM_SME_NORMAL_STATE) || /* Added For BT -AMP Support */ - (psessionEntry->limSystemRole == eLIM_STA_ROLE )) - { + LIM_IS_STA_ROLE(psessionEntry)) { /** * Should not have received STOP_BSS_REQ in states * other than 'normal' state or on STA in Infrastructure @@ -3769,14 +3759,13 @@ __limHandleSmeStopBssRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) */ limLog(pMac, LOGE, FL("received unexpected SME_STOP_BSS_REQ in state %X, for role %d"), - psessionEntry->limSmeState, psessionEntry->limSystemRole); + psessionEntry->limSmeState, GET_LIM_SYSTEM_ROLE(psessionEntry)); /// Send Stop BSS response to host limSendSmeRsp(pMac, eWNI_SME_STOP_BSS_RSP, eSIR_SME_UNEXPECTED_REQ_RESULT_CODE,smesessionId,smetransactionId); return; } - if (psessionEntry->limSystemRole == eLIM_AP_ROLE ) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { limWPSPBCClose(pMac, psessionEntry); } PELOGW(limLog(pMac, LOGW, FL("RECEIVED STOP_BSS_REQ with reason code=%d"), stopBssReq.reasonCode);) @@ -3791,8 +3780,8 @@ __limHandleSmeStopBssRequest(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) psessionEntry->transactionId = smetransactionId; /* BTAMP_STA and STA_IN_IBSS should NOT send Disassoc frame */ - if ( (eLIM_STA_IN_IBSS_ROLE != psessionEntry->limSystemRole) && (eLIM_BT_AMP_STA_ROLE != psessionEntry->limSystemRole) ) - { + if (!LIM_IS_IBSS_ROLE(psessionEntry) && + !LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) { tSirMacAddr bcAddr = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; if ((stopBssReq.reasonCode == eSIR_SME_MIC_COUNTER_MEASURES)) // Send disassoc all stations associated thru TKIP @@ -3932,11 +3921,14 @@ __limProcessSmeAssocCnfNew(tpAniSirGlobal pMac, tANI_U32 msgType, tANI_U32 *pMsg goto end; } - if ( ((psessionEntry->limSystemRole != eLIM_AP_ROLE) && (psessionEntry->limSystemRole != eLIM_BT_AMP_AP_ROLE)) || - ((psessionEntry->limSmeState != eLIM_SME_NORMAL_STATE) && (psessionEntry->limSmeState != eLIM_SME_NORMAL_CHANNEL_SCAN_STATE))) - { - limLog(pMac, LOGE, FL("Received unexpected message %X in state %X, in role %X"), - msgType, psessionEntry->limSmeState, psessionEntry->limSystemRole); + if ((!LIM_IS_AP_ROLE(psessionEntry) && + !LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) || + ((psessionEntry->limSmeState != eLIM_SME_NORMAL_STATE) && + (psessionEntry->limSmeState != eLIM_SME_NORMAL_CHANNEL_SCAN_STATE))) { + limLog(pMac, LOGE, + FL("Received unexpected message %X in state %X, in role %X"), + msgType, psessionEntry->limSmeState, + GET_LIM_SYSTEM_ROLE(psessionEntry)); goto end; } @@ -4073,8 +4065,8 @@ __limProcessSmeAddtsReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) pSirAddts->req.tspec.tsinfo.traffic.tsid, pSirAddts->req.tspec.tsinfo.traffic.userPrio);) - if ((psessionEntry->limSystemRole != eLIM_STA_ROLE)&&(psessionEntry->limSystemRole != eLIM_BT_AMP_STA_ROLE)) - { + if (!LIM_IS_STA_ROLE(psessionEntry) && + !LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) { PELOGE(limLog(pMac, LOGE, "AddTs received on AP - ignoring");) limSendSmeAddtsRsp(pMac, pSirAddts->rspReqd, eSIR_FAILURE, psessionEntry, pSirAddts->req.tspec, smesessionId,smetransactionId); @@ -4338,9 +4330,10 @@ limProcessSmeAddtsRspTimeout(tpAniSirGlobal pMac, tANI_U32 param) return; } - if ( (psessionEntry->limSystemRole != eLIM_STA_ROLE) && (psessionEntry->limSystemRole != eLIM_BT_AMP_STA_ROLE) ) - { - limLog(pMac, LOGW, "AddtsRspTimeout in non-Sta role (%d)", psessionEntry->limSystemRole); + if (!LIM_IS_STA_ROLE(psessionEntry) && + !LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) { + limLog(pMac, LOGW, "AddtsRspTimeout in non-Sta role (%d)", + GET_LIM_SYSTEM_ROLE(psessionEntry)); pMac->lim.gLimAddtsSent = false; return; } @@ -5933,7 +5926,7 @@ limProcessSmeChannelChangeRequest(tpAniSirGlobal pMac, tANI_U32 *pMsg) return; } - if (eLIM_AP_ROLE == psessionEntry->limSystemRole) + if (LIM_IS_AP_ROLE(psessionEntry)) psessionEntry->channelChangeReasonCode = LIM_SWITCH_CHANNEL_SAP_DFS; else psessionEntry->channelChangeReasonCode = LIM_SWITCH_CHANNEL_OPERATION; @@ -6418,11 +6411,9 @@ limProcessSmeDfsCsaIeRequest(tpAniSirGlobal pMac, tANI_U32 *pMsg) return; } - if (psessionEntry->valid && - eLIM_AP_ROLE != psessionEntry->limSystemRole) - { + if (psessionEntry->valid && !LIM_IS_AP_ROLE(psessionEntry)) { limLog(pMac, LOGE, FL("Invalid SystemRole %d"), - psessionEntry->limSystemRole); + GET_LIM_SYSTEM_ROLE(psessionEntry)); return; } diff --git a/CORE/MAC/src/pe/lim/limProcessTdls.c b/CORE/MAC/src/pe/lim/limProcessTdls.c index e3a3d24e87c3..1bceb507b742 100644 --- a/CORE/MAC/src/pe/lim/limProcessTdls.c +++ b/CORE/MAC/src/pe/lim/limProcessTdls.c @@ -2605,11 +2605,10 @@ tSirRetStatus limProcessSmeTdlsMgmtSendReq(tpAniSirGlobal pMac, } /* check if we are in proper state to work as TDLS client */ - if (psessionEntry->limSystemRole != eLIM_STA_ROLE) - { + if (!LIM_IS_STA_ROLE(psessionEntry)) { VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, "send mgmt received in wrong system Role %d", - psessionEntry->limSystemRole); + GET_LIM_SYSTEM_ROLE(psessionEntry)); goto lim_tdls_send_mgmt_error; } @@ -2805,11 +2804,10 @@ tSirRetStatus limProcessSmeTdlsAddStaReq(tpAniSirGlobal pMac, } /* check if we are in proper state to work as TDLS client */ - if (psessionEntry->limSystemRole != eLIM_STA_ROLE) - { + if (!LIM_IS_STA_ROLE(psessionEntry)) { VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - "send mgmt received in wrong system Role %d", - psessionEntry->limSystemRole); + "send mgmt received in wrong system Role %d", + GET_LIM_SYSTEM_ROLE(psessionEntry)); goto lim_tdls_add_sta_error; } @@ -2869,11 +2867,10 @@ tSirRetStatus limProcessSmeTdlsDelStaReq(tpAniSirGlobal pMac, } /* check if we are in proper state to work as TDLS client */ - if (psessionEntry->limSystemRole != eLIM_STA_ROLE) - { + if (!LIM_IS_STA_ROLE(psessionEntry)) { VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, "Del sta received in wrong system Role %d", - psessionEntry->limSystemRole); + GET_LIM_SYSTEM_ROLE(psessionEntry)); goto lim_tdls_del_sta_error; } @@ -2971,11 +2968,11 @@ tSirRetStatus limProcesSmeTdlsLinkEstablishReq(tpAniSirGlobal pMac, } /* check if we are in proper state to work as TDLS client */ - if (psessionEntry->limSystemRole != eLIM_STA_ROLE) + if (!LIM_IS_STA_ROLE(psessionEntry)) { VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, "TDLS Link Establish Request received in wrong system Role %d", - psessionEntry->limSystemRole); + GET_LIM_SYSTEM_ROLE(psessionEntry)); goto lim_tdls_link_establish_error; } diff --git a/CORE/MAC/src/pe/lim/limSecurityUtils.c b/CORE/MAC/src/pe/lim/limSecurityUtils.c index 8f8c10f78114..3608e72e0c17 100644 --- a/CORE/MAC/src/pe/lim/limSecurityUtils.c +++ b/CORE/MAC/src/pe/lim/limSecurityUtils.c @@ -86,10 +86,9 @@ limIsAuthAlgoSupported(tpAniSirGlobal pMac, tAniAuthType authType, tpPESession p if (authType == eSIR_OPEN_SYSTEM) { - - if(psessionEntry->limSystemRole == eLIM_AP_ROLE) - { - if((psessionEntry->authType == eSIR_OPEN_SYSTEM) || (psessionEntry->authType == eSIR_AUTO_SWITCH)) + if (LIM_IS_AP_ROLE(psessionEntry)) { + if ((psessionEntry->authType == eSIR_OPEN_SYSTEM) || + (psessionEntry->authType == eSIR_AUTO_SWITCH)) return true; else return false; @@ -113,19 +112,14 @@ limIsAuthAlgoSupported(tpAniSirGlobal pMac, tAniAuthType authType, tpPESession p else { - if(psessionEntry->limSystemRole == eLIM_AP_ROLE) - { - if((psessionEntry->authType == eSIR_SHARED_KEY) || (psessionEntry->authType == eSIR_AUTO_SWITCH)) + if (LIM_IS_AP_ROLE(psessionEntry)) { + if ((psessionEntry->authType == eSIR_SHARED_KEY) || + (psessionEntry->authType == eSIR_AUTO_SWITCH)) algoEnable = true; else algoEnable = false; - - } - else - - if (wlan_cfgGetInt(pMac, WNI_CFG_SHARED_KEY_AUTH_ENABLE, - &algoEnable) != eSIR_SUCCESS) - { + } else if (wlan_cfgGetInt(pMac, WNI_CFG_SHARED_KEY_AUTH_ENABLE, + &algoEnable) != eSIR_SUCCESS) { /** * Could not get AuthAlgo2 Enable value * from CFG. Log error. @@ -136,15 +130,10 @@ limIsAuthAlgoSupported(tpAniSirGlobal pMac, tAniAuthType authType, tpPESession p return false; } - if(psessionEntry->limSystemRole == eLIM_AP_ROLE) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { privacyOptImp = psessionEntry->privacy; - } - else - - if (wlan_cfgGetInt(pMac, WNI_CFG_PRIVACY_ENABLED, - &privacyOptImp) != eSIR_SUCCESS) - { + } else if (wlan_cfgGetInt(pMac, WNI_CFG_PRIVACY_ENABLED, + &privacyOptImp) != eSIR_SUCCESS) { /** * Could not get PrivacyOptionImplemented value * from CFG. Log error. @@ -1030,11 +1019,11 @@ void limSendSetStaKeyReq( tpAniSirGlobal pMac, SET_LIM_PROCESS_DEFD_MESGS(pMac, false); } - if(sessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE && !pMlmSetKeysReq->key[0].unicast) { + if (LIM_IS_IBSS_ROLE(sessionEntry) && !pMlmSetKeysReq->key[0].unicast) { if (sendRsp == eANI_BOOLEAN_TRUE) sessionEntry->limMlmState = eLIM_MLM_WT_SET_STA_BCASTKEY_STATE; msgQ.type = WDA_SET_STA_BCASTKEY_REQ; - }else { + } else { if (sendRsp == eANI_BOOLEAN_TRUE) sessionEntry->limMlmState = eLIM_MLM_WT_SET_STA_KEY_STATE; msgQ.type = WDA_SET_STAKEY_REQ; diff --git a/CORE/MAC/src/pe/lim/limSendManagementFrames.c b/CORE/MAC/src/pe/lim/limSendManagementFrames.c index 688daba7c1a9..eff1eb4aa45b 100644 --- a/CORE/MAC/src/pe/lim/limSendManagementFrames.c +++ b/CORE/MAC/src/pe/lim/limSendManagementFrames.c @@ -708,9 +708,10 @@ limSendProbeRspMgmtFrame(tpAniSirGlobal pMac, tANI_BOOLEAN isVHTEnabled = eANI_BOOLEAN_FALSE; tDot11fIEExtCap extractedExtCap; tANI_BOOLEAN extractedExtCapFlag = eANI_BOOLEAN_TRUE; - if(pMac->gDriverType == eDRIVER_TYPE_MFG) // We don't answer requests - { - return; // in this case. + + if (ANI_DRIVER_TYPE(pMac) == eDRIVER_TYPE_MFG) { + /* We don't answer requests in this case */ + return; } if(NULL == psessionEntry) @@ -744,12 +745,9 @@ limSendProbeRspMgmtFrame(tpAniSirGlobal pMac, // Timestamp to be updated by TFP, below. // Beacon Interval: - if(psessionEntry->limSystemRole == eLIM_AP_ROLE) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { pFrm->BeaconInterval.interval = pMac->sch.schObject.gSchBeaconInterval; - } - else - { + } else { nSirStatus = wlan_cfgGetInt( pMac, WNI_CFG_BEACON_INTERVAL, &cfg); if (eSIR_SUCCESS != nSirStatus) { @@ -770,15 +768,12 @@ limSendProbeRspMgmtFrame(tpAniSirGlobal pMac, PopulateDot11fIBSSParams( pMac, &pFrm->IBSSParams, psessionEntry ); - if(psessionEntry->limSystemRole == eLIM_AP_ROLE) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { if(psessionEntry->wps_state != SAP_WPS_DISABLED) { PopulateDot11fProbeResWPSIEs(pMac, &pFrm->WscProbeRes, psessionEntry); } - } - else - { + } else { if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_ENABLE, &tmp) != eSIR_SUCCESS) limLog(pMac, LOGP,"Failed to cfg get id %d", WNI_CFG_WPS_ENABLE ); @@ -1390,8 +1385,7 @@ limSendAssocRspMgmtFrame(tpAniSirGlobal pMac, pSta->supportedRates.llbRates, pSta->supportedRates.llaRates ); } - if(psessionEntry->limSystemRole == eLIM_AP_ROLE) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { if( pSta != NULL && eSIR_SUCCESS == statusCode ) { pAssocReq = @@ -1465,7 +1459,7 @@ limSendAssocRspMgmtFrame(tpAniSirGlobal pMac, vos_mem_set(( tANI_U8* )&beaconParams, sizeof( tUpdateBeaconParams), 0); - if( psessionEntry->limSystemRole == eLIM_AP_ROLE ){ + if (LIM_IS_AP_ROLE(psessionEntry)) { if(psessionEntry->gLimProtectionControl != WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE) limDecideApProtection(pMac, peerMacAddr, &beaconParams,psessionEntry); } @@ -3519,9 +3513,8 @@ limSendAuthMgmtFrame(tpAniSirGlobal pMac, pMacHdr->fc.wep = wepBit; // Prepare BSSId - if ((psessionEntry->limSystemRole == eLIM_AP_ROLE)|| - (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) ) - { + if (LIM_IS_AP_ROLE(psessionEntry) || + LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { vos_mem_copy( (tANI_U8 *) pMacHdr->bssId, (tANI_U8 *) psessionEntry->bssId, sizeof( tSirMacAddr )); @@ -3755,7 +3748,7 @@ eHalStatus limSendDisassocCnf(tpAniSirGlobal pMac) } #ifdef WLAN_FEATURE_VOWIFI_11R - if ( (psessionEntry->limSystemRole == eLIM_STA_ROLE ) && + if (LIM_IS_STA_ROLE(psessionEntry) && ( #ifdef FEATURE_WLAN_ESE (psessionEntry->isESEconnection ) || @@ -3787,7 +3780,7 @@ eHalStatus limSendDisassocCnf(tpAniSirGlobal pMac) " isLFR %d" #endif " is11r %d reason %d"), - psessionEntry->limSystemRole, + GET_LIM_SYSTEM_ROLE(psessionEntry), #ifdef FEATURE_WLAN_ESE psessionEntry->isESEconnection, #endif diff --git a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c index 8d86483acf66..ab79c333b00f 100644 --- a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c +++ b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c @@ -1455,9 +1455,9 @@ limSendSmeDisassocNtf(tpAniSirGlobal pMac, } /* Delete the PE session Created */ - if((psessionEntry != NULL) && ((psessionEntry ->limSystemRole == eLIM_STA_ROLE) || - (psessionEntry ->limSystemRole == eLIM_BT_AMP_STA_ROLE)) ) - { + if ((psessionEntry != NULL) && + (LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry))) { peDeleteSession(pMac,psessionEntry); } @@ -2784,8 +2784,7 @@ void limHandleCSAoffloadMsg(tpAniSirGlobal pMac,tpSirMsgQ MsgQ) } - if (psessionEntry->limSystemRole == eLIM_STA_ROLE) - { + if (LIM_IS_STA_ROLE(psessionEntry)) { psessionEntry->gLimChannelSwitch.switchMode = csa_params->switchmode; /* timer already started by firmware, switch immediately */ psessionEntry->gLimChannelSwitch.switchCount = 0; @@ -2877,16 +2876,11 @@ void limHandleDeleteBssRsp(tpAniSirGlobal pMac,tpSirMsgQ MsgQ) pDelBss->sessionId); return; } - if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) - { - limIbssDelBssRsp(pMac, MsgQ->bodyptr,psessionEntry); - } - else if(psessionEntry->limSystemRole == eLIM_UNKNOWN_ROLE) - { + if (LIM_IS_IBSS_ROLE(psessionEntry)) { + limIbssDelBssRsp(pMac, MsgQ->bodyptr, psessionEntry); + } else if(LIM_IS_UNKNOWN_ROLE(psessionEntry)) { limProcessSmeDelBssRsp(pMac, MsgQ->bodyval,psessionEntry); - } - - else + } else limProcessMlmDelBssRsp(pMac,MsgQ,psessionEntry); } @@ -3212,9 +3206,8 @@ limProcessBeaconTxSuccessInd(tpAniSirGlobal pMac, tANI_U16 msgType, void *event) return; } - if (eLIM_AP_ROLE == psessionEntry->limSystemRole && - VOS_TRUE == psessionEntry->dfsIncludeChanSwIe) - { + if (LIM_IS_AP_ROLE(psessionEntry) && + VOS_TRUE == psessionEntry->dfsIncludeChanSwIe) { /* Send only 5 beacons with CSA IE Set in when a radar is detected */ if (psessionEntry->gLimChannelSwitch.switchCount > 0) { diff --git a/CORE/MAC/src/pe/lim/limTimerUtils.c b/CORE/MAC/src/pe/lim/limTimerUtils.c index b2f42ba7ef3b..59ee8d4a4535 100644 --- a/CORE/MAC/src/pe/lim/limTimerUtils.c +++ b/CORE/MAC/src/pe/lim/limTimerUtils.c @@ -1730,9 +1730,8 @@ limReactivateHeartBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry) * the host causing the host to wakeup. Hence, offloading the HB * monitoring to LMAC */ - if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE && - IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE) - { + if (LIM_IS_IBSS_ROLE(psessionEntry) && + IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE) { if (tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer)!= TX_SUCCESS) { limLog(pMac, LOGP,FL("IBSS HeartBeat Offloaded, Could not deactivate Heartbeat timer")); @@ -1792,9 +1791,8 @@ v_UINT_t limActivateHearBeatTimer(tpAniSirGlobal pMac, tpPESession psessionEntry //consider 0 interval a ok case if( pMac->lim.limTimers.gLimHeartBeatTimer.initScheduleTimeInMsecs ) { - if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE && - IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE) - { + if (LIM_IS_IBSS_ROLE(psessionEntry) && + IS_IBSS_HEARTBEAT_OFFLOAD_FEATURE_ENABLE) { /* HB offload in IBSS mode */ status = tx_timer_deactivate(&pMac->lim.limTimers.gLimHeartBeatTimer); if (TX_SUCCESS != status) diff --git a/CORE/MAC/src/pe/lim/limUtils.c b/CORE/MAC/src/pe/lim/limUtils.c index c57ef8b0dc61..3825ce5482f0 100644 --- a/CORE/MAC/src/pe/lim/limUtils.c +++ b/CORE/MAC/src/pe/lim/limUtils.c @@ -1626,68 +1626,55 @@ limUpdateShortPreamble(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, PELOG1(limLog(pMac,LOG1,FL("Short Preamble is not enabled in Assoc Req from ")); limPrintMacAddr(pMac, peerMacAddr, LOG1);) - for (i=0; ilimSystemRole == eLIM_AP_ROLE ) && - psessionEntry->gLimNoShortParams.staNoShortCache[i].active) - { + for (i = 0; i < LIM_PROT_STA_CACHE_SIZE; i++) { + if (LIM_IS_AP_ROLE(psessionEntry) && + psessionEntry->gLimNoShortParams.staNoShortCache[i].active) { if (vos_mem_compare( psessionEntry->gLimNoShortParams.staNoShortCache[i].addr, peerMacAddr, sizeof(tSirMacAddr))) return; - }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE) - { - if (pMac->lim.gLimNoShortParams.staNoShortCache[i].active) - { - if (vos_mem_compare( + } else if (!LIM_IS_AP_ROLE(psessionEntry)) { + if (pMac->lim.gLimNoShortParams.staNoShortCache[i].active) { + if (vos_mem_compare( pMac->lim.gLimNoShortParams.staNoShortCache[i].addr, peerMacAddr, sizeof(tSirMacAddr))) - return; - } + return; + } } } - - for (i=0; ilimSystemRole == eLIM_AP_ROLE ) && + for (i = 0; i < LIM_PROT_STA_CACHE_SIZE; i++) { + if (LIM_IS_AP_ROLE(psessionEntry) && !psessionEntry->gLimNoShortParams.staNoShortCache[i].active) break; - else - { + else { if (!pMac->lim.gLimNoShortParams.staNoShortCache[i].active) break; } } - if (i >= LIM_PROT_STA_CACHE_SIZE) - { - if(psessionEntry->limSystemRole == eLIM_AP_ROLE){ + if (i >= LIM_PROT_STA_CACHE_SIZE) { + if (LIM_IS_AP_ROLE(psessionEntry)) { limLog(pMac, LOGE, FL("No space in Short cache (#active %d, #sta %d) for sta "), i, psessionEntry->gLimNoShortParams.numNonShortPreambleSta); limPrintMacAddr(pMac, peerMacAddr, LOGE); return; - } - else - { + } else { limLog(pMac, LOGE, FL("No space in Short cache (#active %d, #sta %d) for sta "), i, pMac->lim.gLimNoShortParams.numNonShortPreambleSta); limPrintMacAddr(pMac, peerMacAddr, LOGE); return; } - } - - if (psessionEntry->limSystemRole == eLIM_AP_ROLE){ - vos_mem_copy( psessionEntry->gLimNoShortParams.staNoShortCache[i].addr, - peerMacAddr, sizeof(tSirMacAddr)); + if (LIM_IS_AP_ROLE(psessionEntry)) { + vos_mem_copy(psessionEntry->gLimNoShortParams.staNoShortCache[i].addr, + peerMacAddr, sizeof(tSirMacAddr)); psessionEntry->gLimNoShortParams.staNoShortCache[i].active = true; psessionEntry->gLimNoShortParams.numNonShortPreambleSta++; - }else - { - vos_mem_copy( pMac->lim.gLimNoShortParams.staNoShortCache[i].addr, - peerMacAddr, sizeof(tSirMacAddr)); + } else { + vos_mem_copy(pMac->lim.gLimNoShortParams.staNoShortCache[i].addr, + peerMacAddr, sizeof(tSirMacAddr)); pMac->lim.gLimNoShortParams.staNoShortCache[i].active = true; pMac->lim.gLimNoShortParams.numNonShortPreambleSta++; } @@ -1738,18 +1725,15 @@ limUpdateShortSlotTime(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, { PELOG1(limLog(pMac, LOG1, FL("Short Slot Time is not enabled in Assoc Req from ")); limPrintMacAddr(pMac, peerMacAddr, LOG1);) - for (i=0; ilimSystemRole == eLIM_AP_ROLE ) && - psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].active) - { + if (LIM_IS_AP_ROLE(psessionEntry) && + psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].active) { if (vos_mem_compare( psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].addr, peerMacAddr, sizeof(tSirMacAddr))) return; - } - else if(psessionEntry->limSystemRole != eLIM_AP_ROLE ) - { + } else if (!LIM_IS_AP_ROLE(psessionEntry)) { if (pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].active) { if (vos_mem_compare( @@ -1760,27 +1744,23 @@ limUpdateShortSlotTime(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, } } - for (i=0; ilimSystemRole == eLIM_AP_ROLE ) && - !psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].active) + for (i = 0; i < LIM_PROT_STA_CACHE_SIZE; i++) { + if (LIM_IS_AP_ROLE(psessionEntry) && + !psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].active) break; - else - { - if (!pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].active) - break; + else { + if (!pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].active) + break; } } - if (i >= LIM_PROT_STA_CACHE_SIZE) - { - if(psessionEntry->limSystemRole == eLIM_AP_ROLE){ + if (i >= LIM_PROT_STA_CACHE_SIZE) { + if (LIM_IS_AP_ROLE(psessionEntry)) { limLog(pMac, LOGE, FL("No space in ShortSlot cache (#active %d, #sta %d) for sta "), i, psessionEntry->gLimNoShortSlotParams.numNonShortSlotSta); limPrintMacAddr(pMac, peerMacAddr, LOGE); return; - }else - { + } else { limLog(pMac, LOGE, FL("No space in ShortSlot cache (#active %d, #sta %d) for sta "), i, pMac->lim.gLimNoShortSlotParams.numNonShortSlotSta); limPrintMacAddr(pMac, peerMacAddr, LOGE); @@ -1788,14 +1768,12 @@ limUpdateShortSlotTime(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, } } - - if(psessionEntry->limSystemRole == eLIM_AP_ROLE){ - vos_mem_copy( psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].addr, - peerMacAddr, sizeof(tSirMacAddr)); + if (LIM_IS_AP_ROLE(psessionEntry)) { + vos_mem_copy(psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].addr, + peerMacAddr, sizeof(tSirMacAddr)); psessionEntry->gLimNoShortSlotParams.staNoShortSlotCache[i].active = true; psessionEntry->gLimNoShortSlotParams.numNonShortSlotSta++; - }else - { + } else { vos_mem_copy( pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].addr, peerMacAddr, sizeof(tSirMacAddr)); pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].active = true; @@ -1806,25 +1784,23 @@ limUpdateShortSlotTime(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, /* Here we check if we are AP role and short slot enabled (both admin and oper modes) but we have atleast one STA connected with * only long slot enabled, we need to change our beacon/pb rsp to broadcast short slot disabled */ - if ( (psessionEntry->limSystemRole == eLIM_AP_ROLE) && - (val && psessionEntry->gLimNoShortSlotParams.numNonShortSlotSta && psessionEntry->shortSlotTimeSupported)) - { + if ((LIM_IS_AP_ROLE(psessionEntry)) && (val && + psessionEntry->gLimNoShortSlotParams.numNonShortSlotSta && + psessionEntry->shortSlotTimeSupported)) { // enable long slot time pBeaconParams->fShortSlotTime = false; pBeaconParams->paramChangeBitmap |= PARAM_SHORT_SLOT_TIME_CHANGED; PELOG1(limLog(pMac, LOG1, FL("Disable short slot time. Enable long slot time."));) psessionEntry->shortSlotTimeSupported = false; - } - else if ( psessionEntry->limSystemRole != eLIM_AP_ROLE) - { - if (val && pMac->lim.gLimNoShortSlotParams.numNonShortSlotSta && psessionEntry->shortSlotTimeSupported) - { + } else if (!LIM_IS_AP_ROLE(psessionEntry)) { + if (val && pMac->lim.gLimNoShortSlotParams.numNonShortSlotSta && + psessionEntry->shortSlotTimeSupported) { // enable long slot time pBeaconParams->fShortSlotTime = false; pBeaconParams->paramChangeBitmap |= PARAM_SHORT_SLOT_TIME_CHANGED; PELOG1(limLog(pMac, LOG1, FL("Disable short slot time. Enable long slot time."));) psessionEntry->shortSlotTimeSupported = false; - } + } } } } @@ -2133,9 +2109,10 @@ void limProcessChannelSwitchTimeout(tpAniSirGlobal pMac) return; } - if (psessionEntry->limSystemRole != eLIM_STA_ROLE) - { - PELOGW(limLog(pMac, LOGW, "Channel switch can be done only in STA role, Current Role = %d", psessionEntry->limSystemRole);) + if (!LIM_IS_STA_ROLE(psessionEntry)) { + PELOGW(limLog(pMac, LOGW, + "Channel switch can be done only in STA role, Current Role = %d", + GET_LIM_SYSTEM_ROLE(psessionEntry));) return; } @@ -2347,7 +2324,7 @@ limUpdateChannelSwitch(struct sAniSirGlobal *pMac, tpSirProbeRespBeacon pBeacon, */ void limCancelDot11hChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry) { - if (psessionEntry->limSystemRole != eLIM_STA_ROLE) + if (!LIM_IS_STA_ROLE(psessionEntry)) return; PELOGW(limLog(pMac, LOGW, FL("Received a beacon without channel switch IE"));) @@ -2376,7 +2353,7 @@ void limCancelDot11hChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry -----------------------------------------------*/ void limCancelDot11hQuiet(tpAniSirGlobal pMac, tpPESession psessionEntry) { - if (psessionEntry->limSystemRole != eLIM_STA_ROLE) + if (!LIM_IS_STA_ROLE(psessionEntry)) return; if (psessionEntry->gLimSpecMgmt.quietState == eLIM_QUIET_BEGIN) @@ -2562,11 +2539,8 @@ void limProcessQuietBssTimeout( tpAniSirGlobal pMac ) } PELOG1(limLog(pMac, LOG1, FL("quietState = %d"), psessionEntry->gLimSpecMgmt.quietState);) - if (eLIM_AP_ROLE == psessionEntry->limSystemRole) - { - } - else - { + if (LIM_IS_AP_ROLE(psessionEntry)) { + } else { // eLIM_STA_ROLE switch( psessionEntry->gLimSpecMgmt.quietState ) { @@ -2639,9 +2613,9 @@ void limStartQuietTimer(tpAniSirGlobal pMac, tANI_U8 sessionId) return; } - - if (psessionEntry->limSystemRole != eLIM_STA_ROLE) + if (!LIM_IS_STA_ROLE(psessionEntry)) return; + // First, de-activate Timer, if its already active limCancelDot11hQuiet(pMac, psessionEntry); @@ -2982,7 +2956,7 @@ tAniBool limTriggerBackgroundScanDuringQuietBss( tpAniSirGlobal pMac ) tAniBool bScanTriggered = eSIR_FALSE; tpPESession psessionEntry = &pMac->lim.gpSession[0]; - if (psessionEntry->limSystemRole != eLIM_STA_ROLE) + if (!LIM_IS_STA_ROLE(psessionEntry)) return bScanTriggered; if( !psessionEntry->lim11hEnable ) @@ -3225,7 +3199,7 @@ tSirMacASCapabilityInfo macASCapabilityInfo = {0}; break; case eHT_OP_MODE: - if(psessionEntry->limSystemRole == eLIM_AP_ROLE ) + if (LIM_IS_AP_ROLE(psessionEntry)) retVal = psessionEntry->htOperMode; else retVal = pMac->lim.gHTOperMode; @@ -3285,15 +3259,11 @@ limEnable11aProtection(tpAniSirGlobal pMac, tANI_U8 enable, return eSIR_FAILURE; } //overlapping protection configuration check. - if(overlap) - { - } - else - { + if (overlap) { + } else { //normal protection config check - if ((psessionEntry->limSystemRole == eLIM_AP_ROLE) && - (!psessionEntry->cfgProtection.fromlla)) - { + if (LIM_IS_AP_ROLE(psessionEntry) && + (!psessionEntry->cfgProtection.fromlla)) { // protection disabled. PELOG3(limLog(pMac, LOG3, FL("protection from 11a is disabled"));) return eSIR_SUCCESS; @@ -3304,9 +3274,9 @@ limEnable11aProtection(tpAniSirGlobal pMac, tANI_U8 enable, { //If we are AP and HT capable, we need to set the HT OP mode //appropriately. - if(((eLIM_AP_ROLE == psessionEntry->limSystemRole)||(eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole))&& - (true == psessionEntry->htCapability)) - { + if ((LIM_IS_AP_ROLE(psessionEntry) || + LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) && + (true == psessionEntry->htCapability)) { if(overlap) { pMac->lim.gLimOverlap11aParams.protectionEnabled = true; @@ -3346,10 +3316,8 @@ limEnable11aProtection(tpAniSirGlobal pMac, tANI_U8 enable, //for AP role. //we need to take care of HT OP mode change if needed. //We need to take care of Overlap cases. - if(eLIM_AP_ROLE == psessionEntry->limSystemRole) - { - if(overlap) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { + if (overlap) { //Overlap Legacy protection disabled. pMac->lim.gLimOverlap11aParams.protectionEnabled = false; @@ -3442,24 +3410,17 @@ tSirRetStatus limEnable11gProtection(tpAniSirGlobal pMac, tANI_U8 enable, tANI_U8 overlap, tpUpdateBeaconParams pBeaconParams,tpPESession psessionEntry) { - //overlapping protection configuration check. - if(overlap) - { - } - else - { + if (overlap) { + } else { //normal protection config check - if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && - !psessionEntry->cfgProtection.fromllb) - { + if (LIM_IS_AP_ROLE(psessionEntry) && + !psessionEntry->cfgProtection.fromllb) { // protection disabled. PELOG1(limLog(pMac, LOG1, FL("protection from 11b is disabled"));) return eSIR_SUCCESS; - }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE) - { - if(!pMac->lim.cfgProtection.fromllb) - { + } else if (!LIM_IS_AP_ROLE(psessionEntry)) { + if(!pMac->lim.cfgProtection.fromllb) { // protection disabled. PELOG1(limLog(pMac, LOG1, FL("protection from 11b is disabled"));) return eSIR_SUCCESS; @@ -3471,8 +3432,7 @@ limEnable11gProtection(tpAniSirGlobal pMac, tANI_U8 enable, { //If we are AP and HT capable, we need to set the HT OP mode //appropriately. - if(eLIM_AP_ROLE == psessionEntry->limSystemRole) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { if(overlap) { psessionEntry->gLimOlbcParams.protectionEnabled = true; @@ -3506,9 +3466,8 @@ limEnable11gProtection(tpAniSirGlobal pMac, tANI_U8 enable, } } } - }else if ((eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) && - (true == psessionEntry->htCapability)) - { + }else if (LIM_IS_BT_AMP_AP_ROLE(psessionEntry) && + (true == psessionEntry->htCapability)) { if(overlap) { psessionEntry->gLimOlbcParams.protectionEnabled = true; @@ -3549,8 +3508,7 @@ limEnable11gProtection(tpAniSirGlobal pMac, tANI_U8 enable, //for AP role. //we need to take care of HT OP mode change if needed. //We need to take care of Overlap cases. - if(eLIM_AP_ROLE == psessionEntry->limSystemRole) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { if(overlap) { //Overlap Legacy protection disabled. @@ -3621,8 +3579,7 @@ limEnable11gProtection(tpAniSirGlobal pMac, tANI_U8 enable, pBeaconParams->llbCoexist = psessionEntry->beaconParams.llbCoexist = false; pBeaconParams->paramChangeBitmap |= PARAM_llBCOEXIST_CHANGED; } - }else if(eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) - { + }else if(LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { if(overlap) { //Overlap Legacy protection disabled. @@ -3718,45 +3675,39 @@ limEnableHtProtectionFrom11g(tpAniSirGlobal pMac, tANI_U8 enable, return eSIR_SUCCESS; // protection from 11g is only for HT stations. //overlapping protection configuration check. - if(overlap) - { - if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && (!psessionEntry->cfgProtection.overlapFromllg)) - { + if (overlap) { + if (LIM_IS_AP_ROLE(psessionEntry) && + (!psessionEntry->cfgProtection.overlapFromllg)) { // protection disabled. PELOG3(limLog(pMac, LOG3, FL("overlap protection from 11g is disabled"));); return eSIR_SUCCESS; - }else if ((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) && (!pMac->lim.cfgProtection.overlapFromllg)) - { + } else if (LIM_IS_BT_AMP_AP_ROLE(psessionEntry) && + (!pMac->lim.cfgProtection.overlapFromllg)) { // protection disabled. PELOG3(limLog(pMac, LOG3, FL("overlap protection from 11g is disabled"));); return eSIR_SUCCESS; } - } - else - { + } else { //normal protection config check - if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && - !psessionEntry->cfgProtection.fromllg){ + if (LIM_IS_AP_ROLE(psessionEntry) && + !psessionEntry->cfgProtection.fromllg) { // protection disabled. PELOG3(limLog(pMac, LOG3, FL("protection from 11g is disabled"));) return eSIR_SUCCESS; - }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE ) - { - if(!pMac->lim.cfgProtection.fromllg) - { + } else if(!LIM_IS_AP_ROLE(psessionEntry)) { + if (!pMac->lim.cfgProtection.fromllg) { // protection disabled. PELOG3(limLog(pMac, LOG3, FL("protection from 11g is disabled"));) return eSIR_SUCCESS; - } - } - } - if (enable) - { + } + } + } + + if (enable) { //If we are AP and HT capable, we need to set the HT OP mode //appropriately. - if(eLIM_AP_ROLE == psessionEntry->limSystemRole) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { if(overlap) { psessionEntry->gLimOverlap11gParams.protectionEnabled = true; @@ -3783,8 +3734,7 @@ limEnableHtProtectionFrom11g(tpAniSirGlobal pMac, tANI_U8 enable, limEnableHtOBSSProtection(pMac, true, overlap, pBeaconParams,psessionEntry); } } - }else if(eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) - { + } else if(LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { if(overlap) { pMac->lim.gLimOverlap11gParams.protectionEnabled = true; @@ -3832,10 +3782,8 @@ limEnableHtProtectionFrom11g(tpAniSirGlobal pMac, tANI_U8 enable, //we need to take care of HT OP mode change if needed. //We need to take care of Overlap cases. - if(eLIM_AP_ROLE == psessionEntry->limSystemRole) - { - if(overlap) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { + if (overlap) { //Overlap Legacy protection disabled. if (psessionEntry->gLim11gParams.numSta == 0) psessionEntry->gLimOverlap11gParams.protectionEnabled = false; @@ -3904,8 +3852,7 @@ limEnableHtProtectionFrom11g(tpAniSirGlobal pMac, tANI_U8 enable, pBeaconParams->llgCoexist = psessionEntry->beaconParams.llgCoexist = false; pBeaconParams->paramChangeBitmap |= PARAM_llGCOEXIST_CHANGED; } - }else if(eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) - { + } else if(LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { if(overlap) { //Overlap Legacy protection disabled. @@ -4009,15 +3956,13 @@ limEnableHtOBSSProtection(tpAniSirGlobal pMac, tANI_U8 enable, else { //normal protection config check - if((psessionEntry->limSystemRole == eLIM_AP_ROLE) && !psessionEntry->cfgProtection.obss) - { //ToDo Update this field + if (LIM_IS_AP_ROLE(psessionEntry) && + !psessionEntry->cfgProtection.obss) { //ToDo Update this field // protection disabled. PELOG1(limLog(pMac, LOG1, FL("protection from Obss is disabled"));) return eSIR_SUCCESS; - }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE) - { - if(!pMac->lim.cfgProtection.obss) - { //ToDo Update this field + } else if (!LIM_IS_AP_ROLE(psessionEntry)) { + if (!pMac->lim.cfgProtection.obss) { //ToDo Update this field // protection disabled. PELOG1(limLog(pMac, LOG1, FL("protection from Obss is disabled"));) return eSIR_SUCCESS; @@ -4026,7 +3971,7 @@ limEnableHtOBSSProtection(tpAniSirGlobal pMac, tANI_U8 enable, } - if (eLIM_AP_ROLE == psessionEntry->limSystemRole){ + if (LIM_IS_AP_ROLE(psessionEntry)) { if ((enable) && (false == psessionEntry->beaconParams.gHTObssMode) ) { PELOG1(limLog(pMac, LOG1, FL("=>obss protection enabled"));) @@ -4082,22 +4027,16 @@ limEnableHT20Protection(tpAniSirGlobal pMac, tANI_U8 enable, return eSIR_SUCCESS; // this protection is only for HT stations. //overlapping protection configuration check. - if(overlap) - { - } - else - { + if(overlap) { + } else { //normal protection config check - if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && - !psessionEntry->cfgProtection.ht20) - { + if (LIM_IS_AP_ROLE(psessionEntry) && + !psessionEntry->cfgProtection.ht20) { // protection disabled. PELOG3(limLog(pMac, LOG3, FL("protection from HT20 is disabled"));) return eSIR_SUCCESS; - }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE ) - { - if(!pMac->lim.cfgProtection.ht20) - { + } else if (!LIM_IS_AP_ROLE(psessionEntry)) { + if (!pMac->lim.cfgProtection.ht20) { // protection disabled. PELOG3(limLog(pMac, LOG3, FL("protection from HT20 is disabled"));) return eSIR_SUCCESS; @@ -4105,12 +4044,11 @@ limEnableHT20Protection(tpAniSirGlobal pMac, tANI_U8 enable, } } - if (enable) - { + if (enable) { //If we are AP and HT capable, we need to set the HT OP mode //appropriately. - if(eLIM_AP_ROLE == psessionEntry->limSystemRole){ + if (LIM_IS_AP_ROLE(psessionEntry)) { if(overlap) { psessionEntry->gLimOverlapHt20Params.protectionEnabled = true; @@ -4133,8 +4071,7 @@ limEnableHT20Protection(tpAniSirGlobal pMac, tANI_U8 enable, limEnableHtOBSSProtection(pMac, false, overlap, pBeaconParams,psessionEntry); } } - }else if(eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) - { + } else if(LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { if(overlap) { pMac->lim.gLimOverlapHt20Params.protectionEnabled = true; @@ -4170,7 +4107,7 @@ limEnableHT20Protection(tpAniSirGlobal pMac, tANI_U8 enable, //for AP role. //we need to take care of HT OP mode change if needed. //We need to take care of Overlap cases. - if(eLIM_AP_ROLE == psessionEntry->limSystemRole){ + if (LIM_IS_AP_ROLE(psessionEntry)) { if(overlap) { //Overlap Legacy protection disabled. @@ -4215,8 +4152,7 @@ limEnableHT20Protection(tpAniSirGlobal pMac, tANI_U8 enable, PELOG1(limLog(pMac, LOG1, FL("===> Protection from HT 20 Disabled"));) pBeaconParams->ht20MhzCoexist = psessionEntry->beaconParams.ht20Coexist = false; pBeaconParams->paramChangeBitmap |= PARAM_HT20MHZCOEXIST_CHANGED; - }else if(eLIM_BT_AMP_AP_ROLE == psessionEntry->limSystemRole) - { + } else if(LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { if(overlap) { //Overlap Legacy protection disabled. @@ -4290,30 +4226,25 @@ limEnableHTNonGfProtection(tpAniSirGlobal pMac, tANI_U8 enable, return eSIR_SUCCESS; // this protection is only for HT stations. //overlapping protection configuration check. - if(overlap) - { - } - else - { + if(overlap) { + } else { //normal protection config check - if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && - !psessionEntry->cfgProtection.nonGf) - { + if (LIM_IS_AP_ROLE(psessionEntry) && + !psessionEntry->cfgProtection.nonGf) { // protection disabled. PELOG3(limLog(pMac, LOG3, FL("protection from NonGf is disabled"));) return eSIR_SUCCESS; - }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE) - { + } else if(!LIM_IS_AP_ROLE(psessionEntry)) { //normal protection config check - if(!pMac->lim.cfgProtection.nonGf) - { + if (!pMac->lim.cfgProtection.nonGf) { // protection disabled. PELOG3(limLog(pMac, LOG3, FL("protection from NonGf is disabled"));) return eSIR_SUCCESS; - } + } } } - if(psessionEntry->limSystemRole == eLIM_AP_ROLE){ + + if (LIM_IS_AP_ROLE(psessionEntry)) { if ((enable) && (false == psessionEntry->beaconParams.llnNonGFCoexist)) { PELOG1(limLog(pMac, LOG1, FL(" => Protection from non GF Enabled"));) @@ -4326,8 +4257,7 @@ limEnableHTNonGfProtection(tpAniSirGlobal pMac, tANI_U8 enable, pBeaconParams->llnNonGFCoexist = psessionEntry->beaconParams.llnNonGFCoexist = false; pBeaconParams->paramChangeBitmap |= PARAM_NON_GF_DEVICES_PRESENT_CHANGED; } - }else - { + } else { if ((enable) && (false == psessionEntry->beaconParams.llnNonGFCoexist)) { PELOG1(limLog(pMac, LOG1, FL(" => Protection from non GF Enabled"));) @@ -4361,23 +4291,17 @@ limEnableHTLsigTxopProtection(tpAniSirGlobal pMac, tANI_U8 enable, return eSIR_SUCCESS; // this protection is only for HT stations. //overlapping protection configuration check. - if(overlap) - { - } - else - { + if(overlap) { + } else { //normal protection config check - if((psessionEntry->limSystemRole == eLIM_AP_ROLE ) && - !psessionEntry->cfgProtection.lsigTxop) - { + if (LIM_IS_AP_ROLE(psessionEntry) && + !psessionEntry->cfgProtection.lsigTxop) { // protection disabled. PELOG3(limLog(pMac, LOG3, FL(" protection from LsigTxop not supported is disabled"));) return eSIR_SUCCESS; - }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE) - { + } else if(!LIM_IS_AP_ROLE(psessionEntry)) { //normal protection config check - if(!pMac->lim.cfgProtection.lsigTxop) - { + if(!pMac->lim.cfgProtection.lsigTxop) { // protection disabled. PELOG3(limLog(pMac, LOG3, FL(" protection from LsigTxop not supported is disabled"));) return eSIR_SUCCESS; @@ -4385,8 +4309,7 @@ limEnableHTLsigTxopProtection(tpAniSirGlobal pMac, tANI_U8 enable, } } - - if(psessionEntry->limSystemRole == eLIM_AP_ROLE){ + if (LIM_IS_AP_ROLE(psessionEntry)) { if ((enable) && (false == psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport)) { PELOG1(limLog(pMac, LOG1, FL(" => Protection from LsigTxop Enabled"));) @@ -4399,8 +4322,7 @@ limEnableHTLsigTxopProtection(tpAniSirGlobal pMac, tANI_U8 enable, pBeaconParams->fLsigTXOPProtectionFullSupport= psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = false; pBeaconParams->paramChangeBitmap |= PARAM_LSIG_TXOP_FULL_SUPPORT_CHANGED; } - }else - { + } else { if ((enable) && (false == psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport)) { PELOG1(limLog(pMac, LOG1, FL(" => Protection from LsigTxop Enabled"));) @@ -4435,23 +4357,17 @@ limEnableHtRifsProtection(tpAniSirGlobal pMac, tANI_U8 enable, //overlapping protection configuration check. - if(overlap) - { - } - else - { + if(overlap) { + } else { //normal protection config check - if((psessionEntry->limSystemRole == eLIM_AP_ROLE) && - !psessionEntry->cfgProtection.rifs) - { + if (LIM_IS_AP_ROLE(psessionEntry) && + !psessionEntry->cfgProtection.rifs) { // protection disabled. PELOG3(limLog(pMac, LOG3, FL(" protection from Rifs is disabled"));) return eSIR_SUCCESS; - }else if(psessionEntry->limSystemRole != eLIM_AP_ROLE ) - { + } else if (!LIM_IS_AP_ROLE(psessionEntry)) { //normal protection config check - if(!pMac->lim.cfgProtection.rifs) - { + if(!pMac->lim.cfgProtection.rifs) { // protection disabled. PELOG3(limLog(pMac, LOG3, FL(" protection from Rifs is disabled"));) return eSIR_SUCCESS; @@ -4459,7 +4375,7 @@ limEnableHtRifsProtection(tpAniSirGlobal pMac, tANI_U8 enable, } } - if(psessionEntry->limSystemRole == eLIM_AP_ROLE){ + if (LIM_IS_AP_ROLE(psessionEntry)) { // Disabling the RIFS Protection means Enable the RIFS mode of operation in the BSS if ((!enable) && (false == psessionEntry->beaconParams.fRIFSMode)) { @@ -4535,8 +4451,7 @@ limEnableShortPreamble(tpAniSirGlobal pMac, tANI_U8 enable, tpUpdateBeaconParams if (!val) // 11G short preamble switching is disabled. return eSIR_SUCCESS; - if ( psessionEntry->limSystemRole == eLIM_AP_ROLE ) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { if (enable && (psessionEntry->beaconParams.fShortPreamble == 0)) { PELOG1(limLog(pMac, LOG1, FL("===> Short Preamble Enabled"));) @@ -4554,7 +4469,7 @@ limEnableShortPreamble(tpAniSirGlobal pMac, tANI_U8 enable, tpUpdateBeaconParams } return eSIR_SUCCESS; - } +} /** * limTxComplete @@ -4698,11 +4613,9 @@ void limUpdateStaRunTimeHTSwitchChnlParams( tpAniSirGlobal pMac, #endif //In case of IBSS, if STA should update HT Info IE in its beacons. - if (eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole) - { - schSetFixedBeaconFields(pMac,psessionEntry); - } - + if (LIM_IS_IBSS_ROLE(psessionEntry)) { + schSetFixedBeaconFields(pMac, psessionEntry); + } } } // End limUpdateStaRunTimeHTParams. @@ -4900,8 +4813,8 @@ limValidateDeltsReq(tpAniSirGlobal pMac, tpSirDeltsReq pDeltsReq, tSirMacAddr pe return eSIR_FAILURE; } - if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)||(psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE)) - { + if (LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) { tANI_U32 val; // station always talks to the AP @@ -4910,9 +4823,7 @@ limValidateDeltsReq(tpAniSirGlobal pMac, tpSirDeltsReq pDeltsReq, tSirMacAddr pe val = sizeof(tSirMacAddr); sirCopyMacAddr(peerMacAddr,psessionEntry->bssId); - } - else - { + } else { tANI_U16 assocId; tANI_U8 *macaddr = (tANI_U8 *) peerMacAddr; @@ -5168,11 +5079,10 @@ limDeleteBASessions(tpAniSirGlobal pMac, tpPESession pSessionEntry, { for(tid = 0; tid < STACFG_MAX_TC; tid++) { - if ((eLIM_AP_ROLE == pSessionEntry->limSystemRole) || - (pSessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) || - (eLIM_STA_IN_IBSS_ROLE == pSessionEntry->limSystemRole) || - (pSessionEntry->limSystemRole == eLIM_P2P_DEVICE_GO)) - { + if (LIM_IS_AP_ROLE(pSessionEntry) || + LIM_IS_BT_AMP_AP_ROLE(pSessionEntry) || + LIM_IS_IBSS_ROLE(pSessionEntry) || + LIM_IS_P2P_DEVICE_GO(pSessionEntry)) { for (i = 0; i < pMac->lim.maxStation; i++) { pSta = pSessionEntry->dph.dphHashTable.pDphNodeArray + i; @@ -5194,11 +5104,9 @@ limDeleteBASessions(tpAniSirGlobal pMac, tpPESession pSessionEntry, } } } - } - else if ((eLIM_STA_ROLE == pSessionEntry->limSystemRole) || - (eLIM_BT_AMP_STA_ROLE == pSessionEntry->limSystemRole) || - (eLIM_P2P_DEVICE_ROLE == pSessionEntry->limSystemRole)) - { + } else if (LIM_IS_STA_ROLE(pSessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(pSessionEntry) || + LIM_IS_P2P_DEVICE_ROLE(pSessionEntry)) { pSta = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &pSessionEntry->dph.dphHashTable); if (pSta && pSta->added) @@ -6205,7 +6113,7 @@ limRestorePreChannelSwitchState(tpAniSirGlobal pMac, tpPESession psessionEntry) tSirRetStatus retCode = eSIR_SUCCESS; tANI_U32 val = 0; - if (psessionEntry->limSystemRole != eLIM_STA_ROLE) + if (!LIM_IS_STA_ROLE(psessionEntry)) return retCode; /* Channel switch should be ready for the next time */ @@ -6342,7 +6250,7 @@ tSirRetStatus limRestorePreQuietState(tpAniSirGlobal pMac, tpPESession psessionE void limPrepareFor11hChannelSwitch(tpAniSirGlobal pMac, tpPESession psessionEntry) { - if (psessionEntry->limSystemRole != eLIM_STA_ROLE) + if (!LIM_IS_STA_ROLE(psessionEntry)) return; /* Flag to indicate 11h channel switch in progress */ @@ -6641,8 +6549,7 @@ void limHandleHeartBeatTimeoutForSession(tpAniSirGlobal pMac, tpPESession psessi limIbssHeartBeatHandle(pMac,psessionEntry); } if((psessionEntry->bssType == eSIR_INFRASTRUCTURE_MODE) && - (psessionEntry->limSystemRole == eLIM_STA_ROLE)) - { + LIM_IS_STA_ROLE(psessionEntry)) { limHandleHeartBeatFailure(pMac,psessionEntry); } } @@ -6651,8 +6558,7 @@ void limHandleHeartBeatTimeoutForSession(tpAniSirGlobal pMac, tpPESession psessi if(psessionEntry->valid == TRUE ) { if((psessionEntry->bssType == eSIR_INFRASTRUCTURE_MODE) && - (psessionEntry->limSystemRole == eLIM_STA_ROLE)) - { + LIM_IS_STA_ROLE(psessionEntry)) { if(psessionEntry->LimHBFailureStatus == eANI_BOOLEAN_TRUE) { /* Activate Probe After HeartBeat Timer in-case @@ -6703,7 +6609,7 @@ void limProcessAddStaRsp(tpAniSirGlobal pMac,tpSirMsgQ limMsgQ) return; } psessionEntry->csaOffloadEnable = pAddStaParams->csaOffloadEnable; - if (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) + if (LIM_IS_IBSS_ROLE(psessionEntry)) (void) limIbssAddStaRsp(pMac, limMsgQ->bodyptr,psessionEntry); #ifdef FEATURE_WLAN_TDLS else if(pMac->lim.gLimAddStaTdls) @@ -7495,10 +7401,7 @@ limSetProtectedBit(tpAniSirGlobal pMac, tANI_U16 aid; tpDphHashNode pStaDs; - if( (psessionEntry->limSystemRole == eLIM_AP_ROLE) || - (psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE) ) - { - + if (LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_BT_AMP_AP_ROLE(psessionEntry)) { pStaDs = dphLookupHashEntry( pMac, peer, &aid, &psessionEntry->dph.dphHashTable ); if( pStaDs != NULL ) diff --git a/CORE/MAC/src/pe/lim/limUtils.h b/CORE/MAC/src/pe/lim/limUtils.h index 7894f17e273b..2ee20a5acf89 100644 --- a/CORE/MAC/src/pe/lim/limUtils.h +++ b/CORE/MAC/src/pe/lim/limUtils.h @@ -221,9 +221,9 @@ static inline tSirRFBand limGetRFBand(tANI_U8 channel) static inline tSirRetStatus limGetMgmtStaid(tpAniSirGlobal pMac, tANI_U16 *staid, tpPESession psessionEntry) { - if (psessionEntry->limSystemRole == eLIM_AP_ROLE) + if (LIM_IS_AP_ROLE(psessionEntry)) *staid = 1; - else if (psessionEntry->limSystemRole == eLIM_STA_ROLE) + else if (LIM_IS_STA_ROLE(psessionEntry)) *staid = 0; else return eSIR_FAILURE; diff --git a/CORE/MAC/src/pe/sch/schApi.c b/CORE/MAC/src/pe/sch/schApi.c index 85d4c5f8b753..1ff92c57c85a 100644 --- a/CORE/MAC/src/pe/sch/schApi.c +++ b/CORE/MAC/src/pe/sch/schApi.c @@ -289,12 +289,9 @@ tSirRetStatus schSendBeaconReq( tpAniSirGlobal pMac, tANI_U8 *beaconPayload, tAN // Fill in tSendbeaconParams members vos_mem_copy(beaconParams->bssId, psessionEntry->bssId, sizeof(psessionEntry->bssId)); - if (eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole) - { + if (LIM_IS_IBSS_ROLE(psessionEntry)) { beaconParams->timIeOffset = 0; - } - else - { + } else { beaconParams->timIeOffset = psessionEntry->schBeaconOffsetBegin; } @@ -348,9 +345,8 @@ tSirRetStatus schSendBeaconReq( tpAniSirGlobal pMac, tANI_U8 *beaconPayload, tAN schLog( pMac, LOG2, FL("Successfully posted WDA_SEND_BEACON_REQ to HAL")); - if( (psessionEntry->limSystemRole == eLIM_AP_ROLE ) - && (pMac->sch.schObject.fBeaconChanged)) - { + if (LIM_IS_AP_ROLE(psessionEntry) && + pMac->sch.schObject.fBeaconChanged) { if(eSIR_SUCCESS != (retCode = limSendProbeRspTemplateToHal(pMac,psessionEntry, &psessionEntry->DefProbeRspIeBitmap[0]))) { diff --git a/CORE/MAC/src/pe/sch/schBeaconGen.c b/CORE/MAC/src/pe/sch/schBeaconGen.c index 78e074f93d7b..e7743bcb7586 100644 --- a/CORE/MAC/src/pe/sch/schBeaconGen.c +++ b/CORE/MAC/src/pe/sch/schBeaconGen.c @@ -266,8 +266,7 @@ tSirRetStatus schSetFixedBeaconFields(tpAniSirGlobal pMac,tpPESession psessionEn offset = sizeof( tAniBeaconStruct ); ptr = psessionEntry->pSchBeaconFrameBegin + offset; - if((psessionEntry->limSystemRole == eLIM_AP_ROLE)) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { /* Initialize the default IE bitmap to zero */ vos_mem_set(( tANI_U8* )&(psessionEntry->DefProbeRspIeBitmap), (sizeof( tANI_U32 ) * 8), 0); @@ -324,10 +323,9 @@ tSirRetStatus schSetFixedBeaconFields(tpAniSirGlobal pMac,tpPESession psessionEn PopulateDot11fTPCReport( pMac, &pBcn2->TPCReport, psessionEntry); /* Need to insert channel switch announcement here */ - if ((psessionEntry->limSystemRole == eLIM_AP_ROLE || - psessionEntry->limSystemRole == eLIM_P2P_DEVICE_GO) && - psessionEntry->dfsIncludeChanSwIe == VOS_TRUE) - { + if ((LIM_IS_AP_ROLE(psessionEntry) || + LIM_IS_P2P_DEVICE_GO(psessionEntry)) && + psessionEntry->dfsIncludeChanSwIe == VOS_TRUE) { /* Channel switch announcement only if radar is detected * and SAP has instructed to announce channel switch IEs * in beacon and probe responses @@ -394,8 +392,7 @@ tSirRetStatus schSetFixedBeaconFields(tpAniSirGlobal pMac,tpPESession psessionEn { PopulateDot11fWMM( pMac, &pBcn2->WMMInfoAp, &pBcn2->WMMParams, &pBcn2->WMMCaps, psessionEntry); } - if(psessionEntry->limSystemRole == eLIM_AP_ROLE) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { if(psessionEntry->wps_state != SAP_WPS_DISABLED) { PopulateDot11fBeaconWPSIEs( pMac, &pBcn2->WscBeacon, psessionEntry); @@ -426,8 +423,7 @@ tSirRetStatus schSetFixedBeaconFields(tpAniSirGlobal pMac,tpPESession psessionEn } } - if((psessionEntry->limSystemRole == eLIM_AP_ROLE)) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { /* Can be efficiently updated whenever new IE added in Probe response in future */ limUpdateProbeRspTemplateIeBitmapBeacon2(pMac,pBcn2,&psessionEntry->DefProbeRspIeBitmap[0], &psessionEntry->probeRespFrame); @@ -815,35 +811,36 @@ schProcessPreBeaconInd(tpAniSirGlobal pMac, tpSirMsgQ limMsg) goto end; } - switch(psessionEntry->limSystemRole){ - + switch(GET_LIM_SYSTEM_ROLE(psessionEntry)) { case eLIM_STA_IN_IBSS_ROLE: case eLIM_BT_AMP_AP_ROLE: case eLIM_BT_AMP_STA_ROLE: - // generate IBSS parameter set + /* Generate IBSS parameter set */ if(psessionEntry->statypeForBss == STA_ENTRY_SELF) - writeBeaconToMemory(pMac, (tANI_U16) beaconSize, (tANI_U16)beaconSize, psessionEntry); - else - PELOGE(schLog(pMac, LOGE, FL("can not send beacon for PEER session entry"));) + writeBeaconToMemory(pMac, (tANI_U16) beaconSize, + (tANI_U16)beaconSize, psessionEntry); + else + PELOGE(schLog(pMac, LOGE, FL("can not send beacon for PEER session entry"));) break; - case eLIM_AP_ROLE:{ + case eLIM_AP_ROLE: { tANI_U8 *ptr = &psessionEntry->pSchBeaconFrameBegin[psessionEntry->schBeaconOffsetBegin]; tANI_U16 timLength = 0; - if(psessionEntry->statypeForBss == STA_ENTRY_SELF){ + + if (psessionEntry->statypeForBss == STA_ENTRY_SELF) { pmmGenerateTIM(pMac, &ptr, &timLength, psessionEntry->dtimPeriod); - beaconSize += 2 + timLength; - writeBeaconToMemory(pMac, (tANI_U16) beaconSize, (tANI_U16)beaconSize, psessionEntry); - } - else - PELOGE(schLog(pMac, LOGE, FL("can not send beacon for PEER session entry"));) + beaconSize += 2 + timLength; + writeBeaconToMemory(pMac, (tANI_U16) beaconSize, + (tANI_U16)beaconSize, psessionEntry); + } else + PELOGE(schLog(pMac, LOGE, FL("can not send beacon for PEER session entry"));) } - break; - + break; default: - PELOGE(schLog(pMac, LOGE, FL("Error-PE has Receive PreBeconGenIndication when System is in %d role"), - psessionEntry->limSystemRole);) + PELOGE(schLog(pMac, LOGE, + FL("Error-PE has Receive PreBeconGenIndication when System is in %d role"), + GET_LIM_SYSTEM_ROLE(psessionEntry));) } end: diff --git a/CORE/MAC/src/pe/sch/schBeaconProcess.c b/CORE/MAC/src/pe/sch/schBeaconProcess.c index 083ecaf02f56..b5758643c2d1 100644 --- a/CORE/MAC/src/pe/sch/schBeaconProcess.c +++ b/CORE/MAC/src/pe/sch/schBeaconProcess.c @@ -350,13 +350,10 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, vos_mem_zero(&beaconParams, sizeof(tUpdateBeaconParams)); beaconParams.paramChangeBitmap = 0; - if(eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole ) - { + if (LIM_IS_IBSS_ROLE(psessionEntry)) { limHandleIBSScoalescing(pMac, pBeacon, pRxPacketInfo, psessionEntry); - } - else if( (eLIM_STA_ROLE == psessionEntry->limSystemRole) || - (eLIM_BT_AMP_STA_ROLE == psessionEntry->limSystemRole)) - { + } else if (LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry)) { /* * This handles two cases: * -- Infra STA receiving beacons from AP @@ -459,9 +456,9 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, limUpdateStaRunTimeHTSwitchChnlParams( pMac, &pBeacon->HTInfo, bssIdx,psessionEntry); } - if ( (psessionEntry->limSystemRole == eLIM_STA_ROLE) ||(psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE) || - (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) ) - { + if (LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry) || + LIM_IS_IBSS_ROLE(psessionEntry)) { /* Channel Switch information element updated */ if (pBeacon->channelSwitchPresent) { limUpdateChannelSwitch(pMac, pBeacon, psessionEntry); @@ -472,10 +469,9 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, } #ifdef WLAN_FEATURE_11AC - if ((psessionEntry->limSystemRole == eLIM_STA_ROLE) || - (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE) || - (psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE)) - { + if (LIM_IS_STA_ROLE(psessionEntry) || + LIM_IS_BT_AMP_STA_ROLE(psessionEntry) || + LIM_IS_IBSS_ROLE(psessionEntry)) { // check for VHT capability pStaDs = dphLookupHashEntry(pMac, pMh->sa, &aid, &psessionEntry->dph.dphHashTable); @@ -729,8 +725,7 @@ void schBeaconProcess(tpAniSirGlobal pMac, tANI_U8* pRxPacketInfo, tpPESession p #endif ) { - if (eLIM_AP_ROLE != pAPSession->limSystemRole) - { + if (!LIM_IS_AP_ROLE(pAPSession)) { continue; } diff --git a/CORE/MAC/src/pe/sch/schMessage.c b/CORE/MAC/src/pe/sch/schMessage.c index 2a3a9287e962..9e4ef9534712 100644 --- a/CORE/MAC/src/pe/sch/schMessage.c +++ b/CORE/MAC/src/pe/sch/schMessage.c @@ -162,7 +162,7 @@ void schProcessMessage(tpAniSirGlobal pMac,tpSirMsgQ pSchMsg) { case WNI_CFG_BEACON_INTERVAL: // What to do for IBSS ?? - TBD - if (psessionEntry->limSystemRole == eLIM_AP_ROLE) + if (LIM_IS_AP_ROLE(psessionEntry)) schSetBeaconInterval(pMac,psessionEntry); break; @@ -187,7 +187,7 @@ void schProcessMessage(tpAniSirGlobal pMac,tpSirMsgQ pSchMsg) case WNI_CFG_EDCA_WME_ACBE_LOCAL: case WNI_CFG_EDCA_WME_ACVI_LOCAL: case WNI_CFG_EDCA_WME_ACVO_LOCAL: - if (psessionEntry->limSystemRole == eLIM_AP_ROLE) + if (LIM_IS_AP_ROLE(psessionEntry)) schQosUpdateLocal(pMac, psessionEntry); break; @@ -199,8 +199,7 @@ void schProcessMessage(tpAniSirGlobal pMac,tpSirMsgQ pSchMsg) case WNI_CFG_EDCA_WME_ACBE: case WNI_CFG_EDCA_WME_ACVI: case WNI_CFG_EDCA_WME_ACVO: - if (psessionEntry->limSystemRole == eLIM_AP_ROLE) - { + if (LIM_IS_AP_ROLE(psessionEntry)) { psessionEntry->gLimEdcaParamSetCount++; schQosUpdateBroadcast(pMac, psessionEntry); } @@ -559,8 +558,7 @@ getWmmLocalParams(tpAniSirGlobal pMac, tANI_U32 params[][WNI_CFG_EDCA_ANI_ACBK void schEdcaProfileUpdate(tpAniSirGlobal pMac, tpPESession psessionEntry) { - if (psessionEntry->limSystemRole == eLIM_AP_ROLE || psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) - { + if (LIM_IS_AP_ROLE(psessionEntry) || LIM_IS_IBSS_ROLE(psessionEntry)) { schQosUpdateLocal(pMac, psessionEntry); psessionEntry->gLimEdcaParamSetCount++; schQosUpdateBroadcast(pMac, psessionEntry); diff --git a/CORE/SYS/legacy/src/system/src/macInitApi.c b/CORE/SYS/legacy/src/system/src/macInitApi.c index 344efcde3ca1..accc15c191e1 100644 --- a/CORE/SYS/legacy/src/system/src/macInitApi.c +++ b/CORE/SYS/legacy/src/system/src/macInitApi.c @@ -129,8 +129,7 @@ tSirRetStatus macStart(tHalHandle hHal, void* pHalMacStartParams) vos_mem_set(pMac->pResetMsg, sizeof(tSirMbMsg), 0); } - if (pMac->gDriverType != eDRIVER_TYPE_MFG) - { + if (ANI_DRIVER_TYPE(pMac) != eDRIVER_TYPE_MFG) { status = peStart(pMac); } @@ -204,9 +203,6 @@ tSirRetStatus macOpen(tHalHandle *pHalHandle, tHddHandle hHdd, tMacOpenParameter /* Initialize the pMac structure */ vos_mem_set(pMac, sizeof(tAniSirGlobal), 0); - /** Store the Driver type in pMac Global.*/ - //pMac->gDriverType = pMacOpenParms->driverType; - /* * Set various global fields of pMac here * (Could be platform dependant as some variables in pMac are platform diff --git a/CORE/SYS/legacy/src/utils/src/parserApi.c b/CORE/SYS/legacy/src/utils/src/parserApi.c index 05a271c2b9ac..81d38aed8137 100644 --- a/CORE/SYS/legacy/src/utils/src/parserApi.c +++ b/CORE/SYS/legacy/src/utils/src/parserApi.c @@ -632,8 +632,7 @@ PopulateDot11fHTCaps(tpAniSirGlobal pMac, if(!(IS_2X2_CHAIN(psessionEntry->chainMask))) { pDot11f->supportedMCSSet[1] = 0; - if (psessionEntry->limSystemRole == eLIM_STA_ROLE) - { + if (LIM_IS_STA_ROLE(psessionEntry)) { pDot11f->mimoPowerSave = psessionEntry->smpsMode; } } @@ -1118,18 +1117,21 @@ PopulateDot11fHTInfo(tpAniSirGlobal pMac, pHTInfoField1->recommendedTxWidthSet = psessionEntry->htRecommendedTxWidthSet; } - if((psessionEntry) && (psessionEntry->limSystemRole == eLIM_AP_ROLE)){ - CFG_GET_INT( nSirStatus, pMac, WNI_CFG_HT_INFO_FIELD2, nCfgValue ); - - uHTInfoField2.nCfgValue16 = nCfgValue & 0xFFFF; // this is added for fixing CRs on MDM9K platform - 257951, 259577 + if (psessionEntry && LIM_IS_AP_ROLE(psessionEntry)) { + CFG_GET_INT( nSirStatus, pMac, WNI_CFG_HT_INFO_FIELD2, nCfgValue ); - uHTInfoField2.infoField2.opMode = psessionEntry->htOperMode; - uHTInfoField2.infoField2.nonGFDevicesPresent = psessionEntry->beaconParams.llnNonGFCoexist; - uHTInfoField2.infoField2.obssNonHTStaPresent = psessionEntry->beaconParams.gHTObssMode; /*added for Obss */ + /* This is added for fixing CRs on MDM9K platform - 257951, 259577 */ + uHTInfoField2.nCfgValue16 = nCfgValue & 0xFFFF; - uHTInfoField2.infoField2.reserved = 0; + uHTInfoField2.infoField2.opMode = psessionEntry->htOperMode; + uHTInfoField2.infoField2.nonGFDevicesPresent = + psessionEntry->beaconParams.llnNonGFCoexist; + /* Added for Obss */ + uHTInfoField2.infoField2.obssNonHTStaPresent = + psessionEntry->beaconParams.gHTObssMode; - }else{ + uHTInfoField2.infoField2.reserved = 0; + } else { CFG_GET_INT( nSirStatus, pMac, WNI_CFG_HT_INFO_FIELD2, nCfgValue ); htInfoField2 = ( tANI_U16 ) nCfgValue; @@ -1137,7 +1139,9 @@ PopulateDot11fHTInfo(tpAniSirGlobal pMac, pHTInfoField2 = ( tSirMacHTInfoField2* ) &htInfoField2; pHTInfoField2->opMode = pMac->lim.gHTOperMode; pHTInfoField2->nonGFDevicesPresent = pMac->lim.gHTNonGFDevicesPresent; - pHTInfoField2->obssNonHTStaPresent = pMac->lim.gHTObssMode; /*added for Obss */ + + /* Added for Obss */ + pHTInfoField2->obssNonHTStaPresent = pMac->lim.gHTObssMode; pHTInfoField2->reserved = 0; } @@ -1191,8 +1195,7 @@ PopulateDot11fIBSSParams(tpAniSirGlobal pMac, tDot11fIEIBSSParams *pDot11f, tpPESession psessionEntry) { tANI_U32 val = 0; - if ( eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole ) - { + if (LIM_IS_IBSS_ROLE(psessionEntry)) { if(wlan_cfgGetInt(pMac, WNI_CFG_IBSS_ATIM_WIN_SIZE, &val) != eSIR_SUCCESS) { @@ -1566,21 +1569,12 @@ void PopulateDot11fWMM(tpAniSirGlobal pMac, { if ( psessionEntry->limWmeEnabled ) { - if ( eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole ) - { - //if ( ! sirIsPropCapabilityEnabled( pMac, SIR_MAC_PROP_CAPABILITY_WME ) ) - { - PopulateDot11fWMMInfoAp( pMac, pInfo, psessionEntry ); - } - } - else - { - { - PopulateDot11fWMMParams( pMac, pParams, psessionEntry); - } + if (LIM_IS_IBSS_ROLE(psessionEntry)) { + PopulateDot11fWMMInfoAp( pMac, pInfo, psessionEntry ); + } else { + PopulateDot11fWMMParams( pMac, pParams, psessionEntry); - if ( psessionEntry->limWsmEnabled ) - { + if (psessionEntry->limWsmEnabled) { PopulateDot11fWMMCaps( pCaps ); } } @@ -1623,18 +1617,14 @@ void PopulateDot11fWMMInfoAp(tpAniSirGlobal pMac, tDot11fIEWMMInfoAp *pInfo, /* WMM Specification 3.1.3, 3.2.3 * An IBSS staion shall always use its default WMM parameters. */ - if ( eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole ) - { + if (LIM_IS_IBSS_ROLE(psessionEntry)) { pInfo->param_set_count = 0; pInfo->uapsd = 0; - } - else - { + } else { pInfo->param_set_count = ( 0xf & psessionEntry->gLimEdcaParamSetCount ); - if(psessionEntry->limSystemRole == eLIM_AP_ROLE ){ + if (LIM_IS_AP_ROLE(psessionEntry)) { pInfo->uapsd = ( 0x1 & psessionEntry->apUapsdEnable ); - } - else + } else pInfo->uapsd = ( 0x1 & pMac->lim.gUapsdEnable ); } pInfo->present = 1; @@ -1682,7 +1672,7 @@ void PopulateDot11fWMMParams(tpAniSirGlobal pMac, { pParams->version = SIR_MAC_OUI_VERSION_1; - if(psessionEntry->limSystemRole == eLIM_AP_ROLE) + if (LIM_IS_AP_ROLE(psessionEntry)) pParams->qosInfo = (psessionEntry->apUapsdEnable << 7) | ((tANI_U8)(0x0f & psessionEntry->gLimEdcaParamSetCount)); else @@ -1704,7 +1694,7 @@ void PopulateDot11fWMMParams(tpAniSirGlobal pMac, pParams->acbk_acwmax = ( 0xf & psessionEntry->gLimEdcaParamsBC[1].cw.max ); pParams->acbk_txoplimit = psessionEntry->gLimEdcaParamsBC[1].txoplimit; - if(psessionEntry->limSystemRole == eLIM_AP_ROLE ) + if (LIM_IS_AP_ROLE(psessionEntry)) pParams->acvi_aifsn = ( 0xf & psessionEntry->gLimEdcaParamsBC[2].aci.aifsn ); else pParams->acvi_aifsn = ( 0xf & SET_AIFSN(psessionEntry->gLimEdcaParamsBC[2].aci.aifsn) ); @@ -1717,7 +1707,7 @@ void PopulateDot11fWMMParams(tpAniSirGlobal pMac, pParams->acvi_acwmax = ( 0xf & psessionEntry->gLimEdcaParamsBC[2].cw.max ); pParams->acvi_txoplimit = psessionEntry->gLimEdcaParamsBC[2].txoplimit; - if(psessionEntry->limSystemRole == eLIM_AP_ROLE ) + if (LIM_IS_AP_ROLE(psessionEntry)) pParams->acvo_aifsn = ( 0xf & psessionEntry->gLimEdcaParamsBC[3].aci.aifsn ); else pParams->acvo_aifsn = ( 0xf & SET_AIFSN(psessionEntry->gLimEdcaParamsBC[3].aci.aifsn) ); -- cgit v1.2.3 From 922a5aab4721e1d1771d1d7c5ffbc42071b2b43f Mon Sep 17 00:00:00 2001 From: Ryan Hsu Date: Wed, 5 Nov 2014 14:08:53 -0800 Subject: qcacld: hdd: add condition to check to acquire dfs wakelock When SAP operates in DFS channel, sap_dfs_ref_cnt is used to keep tracking the wakelock that has been acquired to prevent the system go into suspend. When start the SAP, it'll acquire the lock first, 0. acquire lock for old channel A (sap_dfs_ref_cnt++) And when radar comes in, the following logic will happen 1. acquire lock for new channel B (sap_dfs_ref_cnt++) 2. release lock for old channel A (sap_dfs_ref_cnt--) Also the bssState will be used as sainty checking, to decide if we've to acquire/release the lock or not. With above logic, the bssState is already BSS_START. So that the step#1 to acquire lock on new channel would never be able to done. And only the step#2 release lock on old channel will be done. This then allow the system goes into suspend state. Add the sap_df_ref_cnt as the combo condition to decide if we have to acquire the lock or not. Change-Id: Id2c565a2cd48c419d5245b276cabbf8279ab9c47 CRs-fixed: 751325 --- CORE/HDD/src/wlan_hdd_hostapd.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c index f4aaf180dbfa..65705593da74 100644 --- a/CORE/HDD/src/wlan_hdd_hostapd.c +++ b/CORE/HDD/src/wlan_hdd_hostapd.c @@ -157,6 +157,10 @@ void hdd_hostapd_channel_allow_suspend(hdd_adapter_t *pAdapter, hdd_hostapd_state_t *pHostapdState = WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter); + hddLog(LOG1, FL("bssState: %d, channel: %d, dfs_ref_cnt: %d"), + pHostapdState->bssState, channel, + atomic_read(&pHddCtx->sap_dfs_ref_cnt)); + /* Return if BSS is already stopped */ if (pHostapdState->bssState == BSS_STOP) return; @@ -190,8 +194,13 @@ void hdd_hostapd_channel_prevent_suspend(hdd_adapter_t *pAdapter, hdd_hostapd_state_t *pHostapdState = WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter); - /* Return if BSS is already started */ - if (pHostapdState->bssState == BSS_START) + hddLog(LOG1, FL("bssState: %d, channel: %d, dfs_ref_cnt: %d"), + pHostapdState->bssState, channel, + atomic_read(&pHddCtx->sap_dfs_ref_cnt)); + + /* Return if BSS is already started && wakelock is acquired */ + if ((pHostapdState->bssState == BSS_START) && + (atomic_read(&pHddCtx->sap_dfs_ref_cnt) > 1)) return; /* Acquire wakelock if we have at least one DFS channel in use */ -- cgit v1.2.3 From 746a172b076a061aa578bcf74188ba47905b276d Mon Sep 17 00:00:00 2001 From: Manikandan Mohan Date: Thu, 6 Nov 2014 17:16:34 -0800 Subject: qcacld HDD: Fix dynamic phymode change issues 1. Fix 11AC VHT20 advertising secondary ch offset by disabling channel bonding for 11AC VHT20 2. Fix hostapd restart failure after dynamic enabling of 5g channel bonding support. Change-Id: I978bf6562f1a312fb416878a6c921eca068f8781 CRs-fixed: 752170 --- CORE/HDD/src/wlan_hdd_wext.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c index fdc4e0a76be3..1089da8b8155 100644 --- a/CORE/HDD/src/wlan_hdd_wext.c +++ b/CORE/HDD/src/wlan_hdd_wext.c @@ -4661,6 +4661,7 @@ int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal, #ifdef WLAN_FEATURE_11AC switch (new_phymode) { case IEEE80211_MODE_11AC_VHT20: + chwidth = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; vhtchanwidth = eHT_CHANNEL_WIDTH_20MHZ; break; case IEEE80211_MODE_11AC_VHT40: @@ -4739,6 +4740,15 @@ int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal, "%s: could not update config_dat", __func__ ); return -EIO; } + + if (phddctx->cfg_ini->nChannelBondingMode5GHz) + phddctx->wiphy->bands[IEEE80211_BAND_5GHZ]->ht_cap.cap |= + IEEE80211_HT_CAP_SUP_WIDTH_20_40; + else + phddctx->wiphy->bands[IEEE80211_BAND_5GHZ]->ht_cap.cap &= + ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; + + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN, ("New_Phymode= %d " "ch_bonding=%d band=%d VHT_ch_width=%u"), phymode, chwidth, curr_band, vhtchanwidth); -- cgit v1.2.3 From c433b6af2be53cf52ff14d34b1c4bf2b2ad3dc77 Mon Sep 17 00:00:00 2001 From: Manikandan Mohan Date: Thu, 6 Nov 2014 12:22:10 -0800 Subject: qcacld SAP: Set ACS Scan as active scan type ACS scan type is set active scan to reduce the ACS scan delay and thereby improving the SAP startup time. Further even though scan type is give as active, the scan offload done in FW takes care of passive scan for DFS channels. Change-Id: I8512526c363886ac50ca2a9952d47b9afd38fbcd CRs-fixed: 746027 --- CORE/SAP/src/sapFsm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c index 632f5cb94b22..8147ff3d594b 100644 --- a/CORE/SAP/src/sapFsm.c +++ b/CORE/SAP/src/sapFsm.c @@ -2092,8 +2092,10 @@ sapGotoChannelSel #endif vos_mem_zero(&scanRequest, sizeof(scanRequest)); - /* Set scanType to Passive scan */ - scanRequest.scanType = eSIR_PASSIVE_SCAN; + /* Set scanType to Active scan. FW takes care of using passive + * scan for DFS and active for non DFS channels. + */ + scanRequest.scanType = eSIR_ACTIVE_SCAN; /* Set min and max channel time to zero */ scanRequest.minChnTime = 0; -- cgit v1.2.3 From 0aae856e1ad4f9c0c2065d3edc06548d96bd62d0 Mon Sep 17 00:00:00 2001 From: syeh Date: Tue, 4 Nov 2014 14:01:36 +0800 Subject: qcacld: BMI: Support SSR for SDIO interface in X86 Leverage the udev framework to reload the wlan SDIO driver to support SSR for SDIO interface in x86. We modify the driver code to report a KOBJ_OFFLINE event when SSR is triggered. And the udev user-level application would parse this event and trigger the script we provide (/etc/udev/rules.d/71-qcacld.rules, /etc/qcacld-restart.sh) to reload the SDIO driver. Besides, we might set "gEnableFwSelfRecovery=1" in qcom_cfg.ini to enable this fw recovery mechanism in the driver. When firmware crash occurs, it will trigger fw recovery and then wlan sdio driver will be reloaded. Change-Id: I8ef00565729e89f79034943ac7a94a5bfb4ef44c CRs-Fixed: 750263 --- CORE/SERVICES/BMI/ol_fw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CORE/SERVICES/BMI/ol_fw.c b/CORE/SERVICES/BMI/ol_fw.c index 2765cea879cc..42cd9bef6f17 100644 --- a/CORE/SERVICES/BMI/ol_fw.c +++ b/CORE/SERVICES/BMI/ol_fw.c @@ -945,6 +945,9 @@ static void ramdump_work_handler(struct work_struct *ramdump) /* Allocate memory to save ramdump */ if (ramdump_scn->enableFwSelfRecovery) { vos_set_logp_in_progress(VOS_MODULE_ID_VOSS, FALSE); +#if defined(HIF_SDIO) && defined(WLAN_OPEN_SOURCE) + kobject_uevent(&ramdump_scn->adf_dev->dev->kobj, KOBJ_OFFLINE); +#endif goto out_fail; } -- cgit v1.2.3 From 42f40abaaf48f34d9bb0b0cd65a1ea8906a4a602 Mon Sep 17 00:00:00 2001 From: Girish Gowli Date: Thu, 6 Nov 2014 23:35:15 +0530 Subject: wlan: qcacld: Enable DFS channel roam in ini file Enaable DFS channel roam in ini file using the ini parameter gAllowDFSChannelRoam Change-Id: I46cdbd3717bd499f36e7c43ba6fc0a0a98ce401b CRs-Fixed: 744321 --- firmware_bin/WCNSS_qcom_cfg.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/firmware_bin/WCNSS_qcom_cfg.ini b/firmware_bin/WCNSS_qcom_cfg.ini index c20c8f0ed14c..4946a0e20b4e 100755 --- a/firmware_bin/WCNSS_qcom_cfg.ini +++ b/firmware_bin/WCNSS_qcom_cfg.ini @@ -348,6 +348,9 @@ gEnableBypass11d=1 gEnableDFSChnlScan=1 +# Enable DFS channel roam +# 0: DISABLE, 1: ENABLED_NORMAL, 2: ENABLED_ACTIVE +gAllowDFSChannelRoam=1 gVhtChannelWidth=2 gEnableLogp=1 -- cgit v1.2.3 From 50d80c0934e919b5bc2fa87ba243228eacbd3de5 Mon Sep 17 00:00:00 2001 From: Girish Gowli Date: Thu, 6 Nov 2014 21:37:38 +0530 Subject: wlan: qcacld: Disable "gAllowDFSChannelRoam" by default in cfg file In cfg file, change default value of "gAllowDFSChannelRoam" to CFG_ROAMING_DFS_CHANNEL_DISABLED Change-Id: I664f4143300ab1a5cb67470db47e61fad1e5a053 CRs-Fixed: 744321 --- CORE/HDD/inc/wlan_hdd_cfg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index 19f1ca59e9b9..b4e41b427199 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -2349,7 +2349,7 @@ This feature requires the dependent cfg.ini "gRoamPrefer5GHz" set to 1 */ #define CFG_ROAMING_DFS_CHANNEL_ENABLED_ACTIVE (2) #define CFG_ROAMING_DFS_CHANNEL_MIN (CFG_ROAMING_DFS_CHANNEL_DISABLED) #define CFG_ROAMING_DFS_CHANNEL_MAX (CFG_ROAMING_DFS_CHANNEL_ENABLED_ACTIVE) -#define CFG_ROAMING_DFS_CHANNEL_DEFAULT (CFG_ROAMING_DFS_CHANNEL_ENABLED_NORMAL) +#define CFG_ROAMING_DFS_CHANNEL_DEFAULT (CFG_ROAMING_DFS_CHANNEL_DISABLED) #ifdef MSM_PLATFORM #define CFG_BUS_BANDWIDTH_HIGH_THRESHOLD "gBusBandwidthHighThreshold" -- cgit v1.2.3 From 4c9637f1ac4cd258470ce6f7ff537527cb1b4a7d Mon Sep 17 00:00:00 2001 From: Atul Mittal Date: Wed, 22 Oct 2014 16:19:31 +0530 Subject: qcacld: TDLS: Make tdls logging as per UMAC modules TDLS module uses different macros to enable/disable logging. Change the same to match other UMAC modules. This will enable the tdls logs to be routed to logger application. Change-Id: Ic406e74d3a7c93844a205b7f6cde89dc9bf5b62c CRs-Fixed: 691352 --- CORE/MAC/src/pe/lim/limProcessTdls.c | 499 ++++++++++++++++++----------------- 1 file changed, 262 insertions(+), 237 deletions(-) diff --git a/CORE/MAC/src/pe/lim/limProcessTdls.c b/CORE/MAC/src/pe/lim/limProcessTdls.c index 1bceb507b742..81183474a261 100644 --- a/CORE/MAC/src/pe/lim/limProcessTdls.c +++ b/CORE/MAC/src/pe/lim/limProcessTdls.c @@ -93,11 +93,6 @@ If there is other IOT issue because of this bandage, define NO_PAD... #define MIN_IEEE_8023_SIZE 46 #define MIN_VENDOR_SPECIFIC_IE_SIZE 5 #endif -#ifdef WLAN_FEATURE_TDLS_DEBUG -#define TDLS_DEBUG_LOG_LEVEL VOS_TRACE_LEVEL_ERROR -#else -#define TDLS_DEBUG_LOG_LEVEL VOS_TRACE_LEVEL_INFO -#endif static tSirRetStatus limTdlsSetupAddSta(tpAniSirGlobal pMac, tSirTdlsAddStaReq *pAddStaReq, @@ -300,11 +295,12 @@ static tANI_U32 limPrepareTdlsFrameHeader(tpAniSirGlobal pMac, tANI_U8* pFrame, (tANI_U8 *) (addr3), sizeof( tSirMacAddr )); - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_WARN, ("Preparing TDLS frame header to %s\n%02x:%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x:%02x"), - (tdlsLinkType == TDLS_LINK_AP) ? "AP" : "TD", - pMacHdr->addr1[0], pMacHdr->addr1[1], pMacHdr->addr1[2], pMacHdr->addr1[3], pMacHdr->addr1[4], pMacHdr->addr1[5], - pMacHdr->addr2[0], pMacHdr->addr2[1], pMacHdr->addr2[2], pMacHdr->addr2[3], pMacHdr->addr2[4], pMacHdr->addr2[5], - pMacHdr->addr3[0], pMacHdr->addr3[1], pMacHdr->addr3[2], pMacHdr->addr3[3], pMacHdr->addr3[4], pMacHdr->addr3[5])); + limLog(pMac, LOG1, + FL("Preparing TDLS frame header to %s A1:"MAC_ADDRESS_STR", A2:"MAC_ADDRESS_STR", A3:"MAC_ADDRESS_STR), + (tdlsLinkType == TDLS_LINK_AP) ? "AP" : "DIRECT", + MAC_ADDR_ARRAY(pMacHdr->addr1), + MAC_ADDR_ARRAY(pMacHdr->addr2), + MAC_ADDR_ARRAY(pMacHdr->addr3)); if (IS_QOS_ENABLED(psessionEntry)) { @@ -341,8 +337,8 @@ static tANI_U32 limPrepareTdlsFrameHeader(tpAniSirGlobal pMac, tANI_U8* pFrame, psessionEntry = peFindSessionBySessionId(pMac, pMac->lim.mgmtFrameSessionId); if (NULL == psessionEntry) { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("%s: sessionID %d is not found"), __func__, pMac->lim.mgmtFrameSessionId); + limLog(pMac, LOGE, FL("sessionID %d is not found"), + pMac->lim.mgmtFrameSessionId); return eHAL_STATUS_FAILURE; } limSendSmeMgmtTXCompletion(pMac, psessionEntry, txCompleteSuccess); @@ -374,7 +370,7 @@ tSirRetStatus limSendTdlsDisReqFrame(tpAniSirGlobal pMac, tSirMacAddr peer_mac, if (NULL == psessionEntry) { - limLog( pMac, LOGE, FL("psessionEntry is NULL" )); + limLog(pMac, LOGE, FL("psessionEntry is NULL")); return eSIR_FAILURE; } smeSessionId = psessionEntry->smeSessionId; @@ -405,16 +401,17 @@ tSirRetStatus limSendTdlsDisReqFrame(tpAniSirGlobal pMac, tSirMacAddr peer_mac, status = dot11fGetPackedTDLSDisReqSize( pMac, &tdlsDisReq, &nPayload); if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGP, FL("Failed to calculate the packed size f" - "or a discovery Request (0x%08x)."), status ); + limLog(pMac, LOGE, + FL("Failed to calculate the packed size for a discovery Request (0x%08x)."), + status ); /* We'll fall back on the worst case scenario: */ nPayload = sizeof( tDot11fTDLSDisReq ); } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while calculating " - "the packed size for a discovery Request (" - "0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while calculating the packed size for a discovery Request (0x%08x)."), + status ); } /* @@ -453,8 +450,9 @@ tSirRetStatus limSendTdlsDisReqFrame(tpAniSirGlobal pMac, tSirMacAddr peer_mac, ( void** ) &pPacket ); if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { - limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a TDLS" - "Discovery Request."), nBytes ); + limLog(pMac, LOGE, + FL("Failed to allocate %d bytes for a TDLS Discovery Request."), + nBytes ); return eSIR_MEM_ALLOC_FAILED; } @@ -476,16 +474,17 @@ tSirRetStatus limSendTdlsDisReqFrame(tpAniSirGlobal pMac, tSirMacAddr peer_mac, if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGE, FL("Failed to pack a TDLS discovery req " - "(0x%08x)."), status ); + limLog(pMac, LOGE, FL("Failed to pack a TDLS discovery req (0x%08x)."), + status ); palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while packing TDLS " - "Discovery Request (0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while packing TDLS Discovery Request (0x%08x)."), + status ); } #ifndef NO_PAD_TDLS_MIN_8023_SIZE @@ -500,8 +499,7 @@ tSirRetStatus limSendTdlsDisReqFrame(tpAniSirGlobal pMac, tSirMacAddr peer_mac, padVendorSpecific[3] = 0xA0; padVendorSpecific[4] = 0xC6; - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, ("Padding Vendor Specific Ie Len = %d"), - padLen )); + limLog(pMac, LOG1, FL("Padding Vendor Specific Ie Len = %d"), padLen); /* padding zero if more than 5 bytes are required */ if (padLen > MIN_VENDOR_SPECIFIC_IE_SIZE) @@ -510,8 +508,11 @@ tSirRetStatus limSendTdlsDisReqFrame(tpAniSirGlobal pMac, tSirMacAddr peer_mac, } #endif - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, TDLS_DEBUG_LOG_LEVEL, ("[TDLS] action %d (%s) -AP-> OTA "), - SIR_MAC_TDLS_DIS_REQ, limTraceTdlsActionString(SIR_MAC_TDLS_DIS_REQ) )); + limLog(pMac, LOG1, + FL("[TDLS] action %d (%s) -AP-> OTA peer="MAC_ADDRESS_STR), + SIR_MAC_TDLS_DIS_REQ, + limTraceTdlsActionString(SIR_MAC_TDLS_DIS_REQ), + MAC_ADDR_ARRAY(peer_mac)); pMac->lim.mgmtFrameSessionId = psessionEntry->peSessionId; halstatus = halTxFrameWithTxComplete( pMac, pPacket, ( tANI_U16 ) nBytes, @@ -525,7 +526,7 @@ tSirRetStatus limSendTdlsDisReqFrame(tpAniSirGlobal pMac, tSirMacAddr peer_mac, if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { pMac->lim.mgmtFrameSessionId = 0xff; - limLog( pMac, LOGE, FL("could not send TDLS Dis Request frame!" )); + limLog(pMac, LOGE, FL("could not send TDLS Discovery Request frame")); return eSIR_FAILURE; } @@ -620,7 +621,7 @@ static tSirRetStatus limSendTdlsDisRspFrame(tpAniSirGlobal pMac, if (NULL == psessionEntry) { - limLog( pMac, LOGE, FL("psessionEntry is NULL" )); + limLog(pMac, LOGE, FL("psessionEntry is NULL")); return eSIR_FAILURE; } smeSessionId = psessionEntry->smeSessionId; @@ -649,8 +650,7 @@ static tSirRetStatus limSendTdlsDisRspFrame(tpAniSirGlobal pMac, * Could not get Capabilities value * from CFG. Log error. */ - limLog(pMac, LOGP, - FL("could not retrieve Capabilities value")); + limLog(pMac, LOGP, FL("could not retrieve Capabilities value")); } swapBitField16(caps, ( tANI_U16* )&tdlsDisRsp.Capabilities ); @@ -681,16 +681,17 @@ static tSirRetStatus limSendTdlsDisRspFrame(tpAniSirGlobal pMac, status = dot11fGetPackedTDLSDisRspSize( pMac, &tdlsDisRsp, &nPayload); if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGP, FL("Failed to calculate the packed size f" - "or a discovery Request (0x%08x)."), status ); + limLog(pMac, LOGE, + FL("Failed to calculate the packed size for a Discovery Response (0x%08x)."), + status ); /* We'll fall back on the worst case scenario: */ nPayload = sizeof( tDot11fProbeRequest ); } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while calculating " - "the packed size for a discovery Request (" - "0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while calculating the packed size for a Discovery Response (0x%08x)."), + status); } /* @@ -709,8 +710,9 @@ static tSirRetStatus limSendTdlsDisRspFrame(tpAniSirGlobal pMac, ( void** ) &pPacket ); if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { - limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a TDLS" - "Discovery Request."), nBytes ); + limLog(pMac, LOGE, + FL("Failed to allocate %d bytes for a TDLS Discovery Response."), + nBytes ); return eSIR_MEM_ALLOC_FAILED; } @@ -741,30 +743,31 @@ static tSirRetStatus limSendTdlsDisRspFrame(tpAniSirGlobal pMac, if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGE, FL("Failed to pack a TDLS discovery req " - "(0x%08x)."), status ); + limLog(pMac, LOGE, + FL("Failed to pack a TDLS Discovery Response (0x%08x)."), + status ); palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while packing TDLS " - "Discovery Request (0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while packing TDLS Discovery Response (0x%08x)."), + status ); } if (0 != addIeLen) { - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("Copy Additional Ie Len = %d"), addIeLen )); + limLog(pMac, LOG1, FL("Copy Additional Ie Len = %d"), addIeLen ); vos_mem_copy(pFrame + sizeof(tSirMacMgmtHdr) + nPayload, addIe, addIeLen); } - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("transmitting Discovery response on direct link")) ; - - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, TDLS_DEBUG_LOG_LEVEL, ("[TDLS] action %d (%s) -DIRECT-> OTA"), - SIR_MAC_TDLS_DIS_RSP, limTraceTdlsActionString(SIR_MAC_TDLS_DIS_RSP) )); + limLog(pMac, LOG1, + FL("[TDLS] action %d (%s) -DIRECT-> OTA peer="MAC_ADDRESS_STR), + SIR_MAC_TDLS_DIS_RSP, + limTraceTdlsActionString(SIR_MAC_TDLS_DIS_RSP), + MAC_ADDR_ARRAY(peerMac)); pMac->lim.mgmtFrameSessionId = psessionEntry->peSessionId; @@ -786,7 +789,7 @@ static tSirRetStatus limSendTdlsDisRspFrame(tpAniSirGlobal pMac, if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { pMac->lim.mgmtFrameSessionId = 0xff; - limLog( pMac, LOGE, FL("could not send TDLS Dis Request frame!" )); + limLog(pMac, LOGE, FL("could not send TDLS Discovery Response frame!")); return eSIR_FAILURE; } @@ -822,15 +825,15 @@ static void PopulateDotfTdlsVhtAID(tpAniSirGlobal pMac, uint32 selfDot11Mode, else { Aid->present = 0; - limLog( pMac, LOGE, FL("pStaDs is NULL for " MAC_ADDRESS_STR ), - MAC_ADDR_ARRAY(peerMac)); + limLog(pMac, LOGE, FL("pStaDs is NULL for " MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(peerMac)); } } } else { Aid->present = 0; - limLog( pMac, LOGW, FL("Vht not enable from ini for 2.4GHz.")); + limLog(pMac, LOGW, FL("Vht not enable from ini for 2.4GHz.")); } } @@ -881,8 +884,7 @@ tSirRetStatus limSendTdlsLinkSetupReqFrame(tpAniSirGlobal pMac, * Could not get Capabilities value * from CFG. Log error. */ - limLog(pMac, LOGP, - FL("could not retrieve Capabilities value")); + limLog(pMac, LOGE, FL("could not retrieve Capabilities value")); } swapBitField16(caps, ( tANI_U16* )&tdlsSetupReq.Capabilities ); @@ -901,6 +903,7 @@ tSirRetStatus limSendTdlsLinkSetupReqFrame(tpAniSirGlobal pMac, { tANI_U32 val = 0; + limLog(pMac, LOG1, FL("populate WMM IE in Setup Request Frame")); /* include WMM IE */ tdlsSetupReq.WMMInfoStation.version = SIR_MAC_OUI_VERSION_1; tdlsSetupReq.WMMInfoStation.acvo_uapsd = @@ -913,8 +916,7 @@ tSirRetStatus limSendTdlsLinkSetupReqFrame(tpAniSirGlobal pMac, ((pMac->lim.gLimTDLSUapsdMask & 0x08) >> 3); if(wlan_cfgGetInt(pMac, WNI_CFG_MAX_SP_LENGTH, &val) != eSIR_SUCCESS) - PELOGE(limLog(pMac, LOGE, - FL("could not retrieve Max SP Length"));) + limLog(pMac, LOGE, FL("could not retrieve Max SP Length")); tdlsSetupReq.WMMInfoStation.max_sp_length = (tANI_U8)val; tdlsSetupReq.WMMInfoStation.present = 1; @@ -930,6 +932,7 @@ tSirRetStatus limSendTdlsLinkSetupReqFrame(tpAniSirGlobal pMac, /* Populate QOS info, needed for Peer U-APSD session */ /* TODO: Now hardcoded, because PopulateDot11fQOSCapsStation() depends on AP's capability, and TDLS doesn't want to depend on AP's capability */ + limLog(pMac, LOG1, FL("populate QOS IE in Setup Request Frame")); tdlsSetupReq.QOSCapsStation.present = 1; tdlsSetupReq.QOSCapsStation.max_sp_length = 0; tdlsSetupReq.QOSCapsStation.qack = 0; @@ -966,16 +969,17 @@ tSirRetStatus limSendTdlsLinkSetupReqFrame(tpAniSirGlobal pMac, &nPayload); if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGP, FL("Failed to calculate the packed size f" - "or a discovery Request (0x%08x)."), status ); + limLog(pMac, LOGE, + FL("Failed to calculate the packed size for a Setup Request (0x%08x)."), + status); /* We'll fall back on the worst case scenario: */ nPayload = sizeof( tDot11fProbeRequest ); } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while calculating " - "the packed size for a discovery Request (" - "0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while calculating the packed size for a Setup Request (0x%08x)."), + status); } @@ -999,8 +1003,9 @@ tSirRetStatus limSendTdlsLinkSetupReqFrame(tpAniSirGlobal pMac, ( void** ) &pPacket ); if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { - limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a TDLS" - "Discovery Request."), nBytes ); + limLog(pMac, LOGE, + FL("Failed to allocate %d bytes for a TDLS Setup Request."), + nBytes ); return eSIR_MEM_ALLOC_FAILED; } @@ -1017,25 +1022,29 @@ tSirRetStatus limSendTdlsLinkSetupReqFrame(tpAniSirGlobal pMac, header_offset = limPrepareTdlsFrameHeader(pMac, pFrame, LINK_IDEN_ADDR_OFFSET(tdlsSetupReq), TDLS_LINK_AP, TDLS_INITIATOR, TID_AC_BK, psessionEntry) ; - limLog( pMac, LOGW, FL("%s: SupportedChnlWidth %x rxMCSMap %x rxMCSMap %x txSupDataRate %x"), - __func__, tdlsSetupReq.VHTCaps.supportedChannelWidthSet, tdlsSetupReq.VHTCaps.rxMCSMap, - tdlsSetupReq.VHTCaps.txMCSMap, tdlsSetupReq.VHTCaps.txSupDataRate ); + limLog(pMac, LOGW, FL("SupportedChnlWidth %x rxMCSMap %x rxMCSMap %x txSupDataRate %x"), + tdlsSetupReq.VHTCaps.supportedChannelWidthSet, + tdlsSetupReq.VHTCaps.rxMCSMap, + tdlsSetupReq.VHTCaps.txMCSMap, + tdlsSetupReq.VHTCaps.txSupDataRate); status = dot11fPackTDLSSetupReq( pMac, &tdlsSetupReq, pFrame + header_offset, nPayload, &nPayload ); if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGE, FL("Failed to pack a TDLS discovery req " - "(0x%08x)."), status ); + limLog(pMac, LOGE, + FL("Failed to pack a TDLS Setup Request (0x%08x)."), + status); palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while packing TDLS " - "Discovery Request (0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while packing TDLS Setup Request (0x%08x)."), + status); } //Copy the additional IE. @@ -1044,13 +1053,15 @@ tSirRetStatus limSendTdlsLinkSetupReqFrame(tpAniSirGlobal pMac, //if there is any IOT issue. if( addIeLen != 0 ) { - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, ("Copy Additional Ie Len = %d"), - addIeLen )); - vos_mem_copy( pFrame + header_offset + nPayload, addIe, addIeLen ); + limLog(pMac, LOG1, FL("Copy Additional Ie Len = %d"), + addIeLen ); + vos_mem_copy( pFrame + header_offset + nPayload, addIe, addIeLen ); } - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, TDLS_DEBUG_LOG_LEVEL, ("[TDLS] action %d (%s) -AP-> OTA"), - SIR_MAC_TDLS_SETUP_REQ, limTraceTdlsActionString(SIR_MAC_TDLS_SETUP_REQ) )); + limLog(pMac, LOG1, FL("[TDLS] action %d (%s) -AP-> OTA peer="MAC_ADDRESS_STR), + SIR_MAC_TDLS_SETUP_REQ, + limTraceTdlsActionString(SIR_MAC_TDLS_SETUP_REQ), + MAC_ADDR_ARRAY(peerMac)); pMac->lim.mgmtFrameSessionId = psessionEntry->peSessionId; #if defined(CONFIG_HL_SUPPORT) @@ -1075,7 +1086,7 @@ tSirRetStatus limSendTdlsLinkSetupReqFrame(tpAniSirGlobal pMac, if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { pMac->lim.mgmtFrameSessionId = 0xff; - limLog( pMac, LOGE, FL("could not send TDLS Dis Request frame!" )); + limLog(pMac, LOGE, FL("could not send TDLS Setup Request frame!")); return eSIR_FAILURE; } @@ -1105,7 +1116,7 @@ tSirRetStatus limSendTdlsTeardownFrame(tpAniSirGlobal pMac, if (NULL == psessionEntry) { - limLog( pMac, LOGE, FL("psessionEntry is NULL" )); + limLog(pMac, LOGE, FL("psessionEntry is NULL")); return eSIR_FAILURE; } smeSessionId = psessionEntry->smeSessionId; @@ -1121,34 +1132,29 @@ tSirRetStatus limSendTdlsTeardownFrame(tpAniSirGlobal pMac, PopulateDot11fLinkIden( pMac, psessionEntry, &teardown.LinkIdentifier, peerMac, (responder == TRUE) ? TDLS_RESPONDER : TDLS_INITIATOR) ; - - /* * now we pack it. First, how much space are we going to need? */ status = dot11fGetPackedTDLSTeardownSize( pMac, &teardown, &nPayload); if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGP, FL("Failed to calculate the packed size f" - "or a discovery Request (0x%08x)."), status ); + limLog(pMac, LOGE, + FL("Failed to calculate the packed size for Teardown frame (0x%08x)."), + status); /* We'll fall back on the worst case scenario: */ nPayload = sizeof( tDot11fProbeRequest ); } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while calculating " - "the packed size for a discovery Request (" - "0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while calculating the packed size for Teardown frame (0x%08x)."), + status); } - - /* * This frame is going out from PE as data frames with special ethertype * 89-0d. * 8 bytes of RFC 1042 header */ - - nBytes = nPayload + ((IS_QOS_ENABLED(psessionEntry)) ? sizeof(tSirMacDataHdr3a) : sizeof(tSirMacMgmtHdr)) + sizeof( eth_890d_header ) @@ -1179,8 +1185,9 @@ tSirRetStatus limSendTdlsTeardownFrame(tpAniSirGlobal pMac, ( void** ) &pPacket ); if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { - limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a TDLS" - "Discovery Request."), nBytes ); + limLog(pMac, LOGE, + FL("Failed to allocate %d bytes for a TDLS Teardown Frame."), + nBytes); return eSIR_MEM_ALLOC_FAILED; } @@ -1191,37 +1198,36 @@ tSirRetStatus limSendTdlsTeardownFrame(tpAniSirGlobal pMac, * IE formation, memory allocation is completed, Now form TDLS discovery * request frame */ - + limLog(pMac, LOGE, FL("Reason of TDLS Teardown: %d"), reason); /* fill out the buffer descriptor */ - header_offset = limPrepareTdlsFrameHeader(pMac, pFrame, - LINK_IDEN_ADDR_OFFSET(teardown), + LINK_IDEN_ADDR_OFFSET(teardown), (reason == eSIR_MAC_TDLS_TEARDOWN_PEER_UNREACHABLE) ? TDLS_LINK_AP : TDLS_LINK_DIRECT, - (responder == TRUE) ? TDLS_RESPONDER : TDLS_INITIATOR, - TID_AC_VI, psessionEntry) ; + (responder == TRUE) ? TDLS_RESPONDER : TDLS_INITIATOR, + TID_AC_VI, psessionEntry); status = dot11fPackTDLSTeardown( pMac, &teardown, pFrame + header_offset, nPayload, &nPayload ); if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGE, FL("Failed to pack a TDLS Teardown req (0x%08x)."), - status ); + limLog(pMac, LOGE, FL("Failed to pack a TDLS Teardown frame (0x%08x)."), + status ); palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while packing TDLS " - "Teardown Request (0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while packing TDLS Teardown frame (0x%08x)."), + status); } if( addIeLen != 0 ) { - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, ("Copy Additional Ie Len = %d"), - addIeLen )); + limLog(pMac, LOG1, FL("Copy Additional Ie Len = %d"), addIeLen); vos_mem_copy( pFrame + header_offset + nPayload, addIe, addIeLen ); } @@ -1237,8 +1243,7 @@ tSirRetStatus limSendTdlsTeardownFrame(tpAniSirGlobal pMac, padVendorSpecific[3] = 0xA0; padVendorSpecific[4] = 0xC6; - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, ("Padding Vendor Specific Ie Len = %d"), - padLen )); + limLog(pMac, LOG1, FL("Padding Vendor Specific Ie Len = %d"), padLen); /* padding zero if more than 5 bytes are required */ if (padLen > MIN_VENDOR_SPECIFIC_IE_SIZE) @@ -1246,9 +1251,12 @@ tSirRetStatus limSendTdlsTeardownFrame(tpAniSirGlobal pMac, padLen - MIN_VENDOR_SPECIFIC_IE_SIZE, 0); } #endif - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, TDLS_DEBUG_LOG_LEVEL, ("[TDLS] action %d (%s) -%s-> OTA"), - SIR_MAC_TDLS_TEARDOWN, limTraceTdlsActionString(SIR_MAC_TDLS_TEARDOWN), - (reason == eSIR_MAC_TDLS_TEARDOWN_PEER_UNREACHABLE) ? "AP": "DIRECT" )); + limLog(pMac, LOG1, FL("[TDLS] action %d (%s) -%s-> OTA peer="MAC_ADDRESS_STR), + SIR_MAC_TDLS_TEARDOWN, + limTraceTdlsActionString(SIR_MAC_TDLS_TEARDOWN), + ((reason == eSIR_MAC_TDLS_TEARDOWN_PEER_UNREACHABLE) ? + "AP": "DIRECT"), + MAC_ADDR_ARRAY(peerMac)); pMac->lim.mgmtFrameSessionId = psessionEntry->peSessionId; #if defined(CONFIG_HL_SUPPORT) @@ -1275,7 +1283,7 @@ tSirRetStatus limSendTdlsTeardownFrame(tpAniSirGlobal pMac, if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { pMac->lim.mgmtFrameSessionId = 0xff; - limLog( pMac, LOGE, FL("could not send TDLS Dis Request frame!" )); + limLog(pMac, LOGE, FL("could not send TDLS Teardown frame")); return eSIR_FAILURE; } @@ -1309,7 +1317,7 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, if (NULL == psessionEntry) { - limLog( pMac, LOGE, FL("psessionEntry is NULL" )); + limLog(pMac, LOGE, FL("psessionEntry is NULL")); return eSIR_FAILURE; } smeSessionId = psessionEntry->smeSessionId; @@ -1337,8 +1345,7 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, * Could not get Capabilities value * from CFG. Log error. */ - limLog(pMac, LOGP, - FL("could not retrieve Capabilities value")); + limLog(pMac, LOGE, FL("could not retrieve Capabilities value")); } swapBitField16(caps, ( tANI_U16* )&tdlsSetupRsp.Capabilities ); @@ -1357,6 +1364,7 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, { tANI_U32 val = 0; + limLog(pMac, LOG1, FL("populate WMM IE in Setup Response frame")); /* include WMM IE */ tdlsSetupRsp.WMMInfoStation.version = SIR_MAC_OUI_VERSION_1; tdlsSetupRsp.WMMInfoStation.acvo_uapsd = @@ -1369,8 +1377,7 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, ((pMac->lim.gLimTDLSUapsdMask & 0x08) >> 3); if(wlan_cfgGetInt(pMac, WNI_CFG_MAX_SP_LENGTH, &val) != eSIR_SUCCESS) - PELOGE(limLog(pMac, LOGE, - FL("could not retrieve Max SP Length"));) + limLog(pMac, LOGE, FL("could not retrieve Max SP Length")); tdlsSetupRsp.WMMInfoStation.max_sp_length = (tANI_U8)val; tdlsSetupRsp.WMMInfoStation.present = 1; @@ -1386,6 +1393,7 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, /* Populate QOS info, needed for Peer U-APSD session */ /* TODO: Now hardcoded, because PopulateDot11fQOSCapsStation() depends on AP's capability, and TDLS doesn't want to depend on AP's capability */ + limLog(pMac, LOG1, FL("populate QOS IE in Setup Response frame")); tdlsSetupRsp.QOSCapsStation.present = 1; tdlsSetupRsp.QOSCapsStation.max_sp_length = 0; tdlsSetupRsp.QOSCapsStation.qack = 0; @@ -1418,16 +1426,17 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, &nPayload); if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGP, FL("Failed to calculate the packed size f" - "or a discovery Request (0x%08x)."), status ); + limLog(pMac, LOGE, + FL("Failed to calculate the packed size for a Setup Response (0x%08x)."), + status); /* We'll fall back on the worst case scenario: */ nPayload = sizeof( tDot11fProbeRequest ); } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while calculating " - "the packed size for a discovery Request (" - "0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while calculating the packed size for Setup Response (0x%08x)."), + status); } /* @@ -1450,8 +1459,9 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, ( void** ) &pPacket ); if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { - limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a TDLS" - "Discovery Request."), nBytes ); + limLog(pMac, LOGE, + FL("Failed to allocate %d bytes for a TDLS Setup Response."), + nBytes ); return eSIR_MEM_ALLOC_FAILED; } @@ -1470,24 +1480,29 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, TDLS_LINK_AP, TDLS_RESPONDER, TID_AC_BK, psessionEntry) ; - limLog( pMac, LOGW, FL("%s: SupportedChnlWidth %x rxMCSMap %x rxMCSMap %x txSupDataRate %x"), - __func__, tdlsSetupRsp.VHTCaps.supportedChannelWidthSet, tdlsSetupRsp.VHTCaps.rxMCSMap, - tdlsSetupRsp.VHTCaps.txMCSMap, tdlsSetupRsp.VHTCaps.txSupDataRate ); + limLog(pMac, LOG1, + FL("SupportedChnlWidth %x rxMCSMap %x rxMCSMap %x txSupDataRate %x"), + tdlsSetupRsp.VHTCaps.supportedChannelWidthSet, + tdlsSetupRsp.VHTCaps.rxMCSMap, + tdlsSetupRsp.VHTCaps.txMCSMap, + tdlsSetupRsp.VHTCaps.txSupDataRate); status = dot11fPackTDLSSetupRsp( pMac, &tdlsSetupRsp, pFrame + header_offset, nPayload, &nPayload ); if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGE, FL("Failed to pack a TDLS discovery req " - "(0x%08x)."), status ); + limLog(pMac, LOGE, + FL("Failed to pack a TDLS Setup Response (0x%08x)."), + status); palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while packing TDLS " - "Discovery Request (0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while packing TDLS Setup Response (0x%08x)."), + status); } //Copy the additional IE. @@ -1499,8 +1514,11 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, vos_mem_copy( pFrame + header_offset + nPayload, addIe, addIeLen ); } - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, TDLS_DEBUG_LOG_LEVEL, ("[TDLS] action %d (%s) -AP-> OTA"), - SIR_MAC_TDLS_SETUP_RSP, limTraceTdlsActionString(SIR_MAC_TDLS_SETUP_RSP) )); + limLog(pMac, LOG1, + FL("[TDLS] action %d (%s) -AP-> OTA peer="MAC_ADDRESS_STR), + SIR_MAC_TDLS_SETUP_RSP, + limTraceTdlsActionString(SIR_MAC_TDLS_SETUP_RSP), + MAC_ADDR_ARRAY(peerMac)); pMac->lim.mgmtFrameSessionId = psessionEntry->peSessionId; #if defined(CONFIG_HL_SUPPORT) @@ -1525,7 +1543,7 @@ static tSirRetStatus limSendTdlsSetupRspFrame(tpAniSirGlobal pMac, if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { pMac->lim.mgmtFrameSessionId = 0xff; - limLog( pMac, LOGE, FL("could not send TDLS Dis Request frame!" )); + limLog(pMac, LOGE, FL("could not send TDLS Setup Response")); return eSIR_FAILURE; } @@ -1586,6 +1604,7 @@ tSirRetStatus limSendTdlsLinkSetupCnfFrame(tpAniSirGlobal pMac, if ((1 == pMac->lim.gLimTDLSWmmMode) && (CHECK_BIT(peerCapability, TDLS_PEER_WMM_CAP))) { + limLog(pMac, LOG1, FL("populate WMM praram in Setup Confirm")); PopulateDot11fWMMParams(pMac, &tdlsSetupCnf.WMMParams, psessionEntry); } @@ -1609,25 +1628,23 @@ tSirRetStatus limSendTdlsLinkSetupCnfFrame(tpAniSirGlobal pMac, &nPayload); if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGP, FL("Failed to calculate the packed size f" - "or a discovery Request (0x%08x)."), status ); + limLog(pMac, LOGE, + FL("Failed to calculate the packed size for Setup Confirm (0x%08x)."), + status); /* We'll fall back on the worst case scenario: */ nPayload = sizeof( tDot11fProbeRequest ); } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while calculating " - "the packed size for a discovery Request (" - "0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while calculating the packed size for Setup Confirm (0x%08x)."), + status); } - /* * This frame is going out from PE as data frames with special ethertype * 89-0d. * 8 bytes of RFC 1042 header */ - - nBytes = nPayload + ((IS_QOS_ENABLED(psessionEntry)) ? sizeof(tSirMacDataHdr3a) : sizeof(tSirMacMgmtHdr)) + sizeof( eth_890d_header ) @@ -1659,8 +1676,9 @@ tSirRetStatus limSendTdlsLinkSetupCnfFrame(tpAniSirGlobal pMac, ( void** ) &pPacket ); if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { - limLog( pMac, LOGP, FL("Failed to allocate %d bytes for a TDLS" - "Discovery Request."), nBytes ); + limLog(pMac, LOGE, + FL("Failed to allocate %d bytes for a TDLS Setup Confirm."), + nBytes); return eSIR_MEM_ALLOC_FAILED; } @@ -1683,16 +1701,18 @@ tSirRetStatus limSendTdlsLinkSetupCnfFrame(tpAniSirGlobal pMac, if ( DOT11F_FAILED( status ) ) { - limLog( pMac, LOGE, FL("Failed to pack a TDLS discovery req " - "(0x%08x)."), status ); + limLog(pMac, LOGE, + FL("Failed to pack a TDLS Setup Confirm (0x%08x)."), + status); palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT, ( void* ) pFrame, ( void* ) pPacket ); return eSIR_FAILURE; } else if ( DOT11F_WARNED( status ) ) { - limLog( pMac, LOGW, FL("There were warnings while packing TDLS " - "Discovery Request (0x%08x)."), status ); + limLog(pMac, LOGW, + FL("There were warnings while packing TDLS Setup Confirm (0x%08x)."), + status); } //Copy the additional IE. //TODO : addIe is added at the end of the frame. This means it doesnt @@ -1715,8 +1735,7 @@ tSirRetStatus limSendTdlsLinkSetupCnfFrame(tpAniSirGlobal pMac, padVendorSpecific[3] = 0xA0; padVendorSpecific[4] = 0xC6; - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, ("Padding Vendor Specific Ie Len = %d"), - padLen )); + limLog(pMac, LOG1, FL("Padding Vendor Specific Ie Len = %d"), padLen); /* padding zero if more than 5 bytes are required */ if (padLen > MIN_VENDOR_SPECIFIC_IE_SIZE) @@ -1726,8 +1745,11 @@ tSirRetStatus limSendTdlsLinkSetupCnfFrame(tpAniSirGlobal pMac, #endif - LIM_LOG_TDLS(VOS_TRACE(VOS_MODULE_ID_PE, TDLS_DEBUG_LOG_LEVEL, ("[TDLS] action %d (%s) -AP-> OTA"), - SIR_MAC_TDLS_SETUP_CNF, limTraceTdlsActionString(SIR_MAC_TDLS_SETUP_CNF) )); + limLog(pMac, LOG1, + FL("[TDLS] action %d (%s) -AP-> OTA peer="MAC_ADDRESS_STR), + SIR_MAC_TDLS_SETUP_CNF, + limTraceTdlsActionString(SIR_MAC_TDLS_SETUP_CNF), + MAC_ADDR_ARRAY(peerMac)); pMac->lim.mgmtFrameSessionId = psessionEntry->peSessionId; #if defined(CONFIG_HL_SUPPORT) @@ -1753,7 +1775,7 @@ tSirRetStatus limSendTdlsLinkSetupCnfFrame(tpAniSirGlobal pMac, if ( ! HAL_STATUS_SUCCESS ( halstatus ) ) { pMac->lim.mgmtFrameSessionId = 0xff; - limLog( pMac, LOGE, FL("could not send TDLS Dis Request frame!" )); + limLog(pMac, LOGE, FL("could not send TDLS Setup Confirm frame")); return eSIR_FAILURE; } @@ -1815,9 +1837,14 @@ static tSirRetStatus limTdlsPopulateDot11fHTCaps(tpAniSirGlobal pMac, tpPESessio pDot11f->shortGI40MHz = 0; } - dot11fLog(pMac, LOG2, FL("SupportedChnlWidth: %d, mimoPS: %d, GF: %d, shortGI20:%d, shortGI40: %d, dsssCck: %d"), - pDot11f->supportedChannelWidthSet, pDot11f->mimoPowerSave, pDot11f->greenField, - pDot11f->shortGI20MHz, pDot11f->shortGI40MHz, pDot11f->dsssCckMode40MHz); + limLog(pMac, LOG1, + FL("SupportedChnlWidth: %d, mimoPS: %d, GF: %d, shortGI20:%d, shortGI40: %d, dsssCck: %d"), + pDot11f->supportedChannelWidthSet, + pDot11f->mimoPowerSave, + pDot11f->greenField, + pDot11f->shortGI20MHz, + pDot11f->shortGI40MHz, + pDot11f->dsssCckMode40MHz); nCfgValue = pTdlsAddStaReq->htCap.ampduParamsInfo; @@ -1828,7 +1855,7 @@ static tSirRetStatus limTdlsPopulateDot11fHTCaps(tpAniSirGlobal pMac, tpPESessio pDot11f->mpduDensity = pHTParametersInfo->mpduDensity; pDot11f->reserved1 = pHTParametersInfo->reserved; - dot11fLog( pMac, LOG2, FL( "AMPDU Param: %x" ), nCfgValue); + limLog(pMac, LOG1, FL("AMPDU Param: %x"), nCfgValue); vos_mem_copy( pDot11f->supportedMCSSet, pTdlsAddStaReq->htCap.suppMcsSet, SIZE_OF_SUPPORTED_MCS_SET); @@ -1968,7 +1995,7 @@ limTdlsPopulateMatchingRateSet(tpAniSirGlobal pMac, &val) != eSIR_SUCCESS) { /// Could not get rateset from CFG. Log error. - limLog(pMac, LOGP, FL("could not retrieve rateset")); + limLog(pMac, LOGE, FL("could not retrieve rateset")); val = 0; } tempRateSet.numRates = val; @@ -1986,7 +2013,7 @@ limTdlsPopulateMatchingRateSet(tpAniSirGlobal pMac, if ((tempRateSet.numRates + tempRateSet2.numRates) > 12) { - PELOGE(limLog(pMac, LOGE, FL("more than 12 rates in CFG"));) + limLog(pMac, LOGE, FL("more than 12 rates in CFG")); goto error; } @@ -2030,9 +2057,9 @@ limTdlsPopulateMatchingRateSet(tpAniSirGlobal pMac, */ if (supporteRatesLength > SIR_MAC_RATESET_EID_MAX) { - limLog( pMac, LOGW, FL("Supported rates length %d more than " - "the Max limit, reset to Max"), - supporteRatesLength); + limLog(pMac, LOGW, + FL("Supported rates length %d more than the Max limit, reset to Max"), + supporteRatesLength); supporteRatesLength = SIR_MAC_RATESET_EID_MAX; } @@ -2060,7 +2087,8 @@ limTdlsPopulateMatchingRateSet(tpAniSirGlobal pMac, if ((bRateIndex > HAL_NUM_11B_RATES) || (aRateIndex > HAL_NUM_11A_RATES)) { limLog(pMac, LOGE, FL("Invalid number of rates (11b->%d, 11a->%d)"), - bRateIndex, aRateIndex); + bRateIndex, + aRateIndex); return eSIR_FAILURE; } #endif @@ -2099,10 +2127,12 @@ limTdlsPopulateMatchingRateSet(tpAniSirGlobal pMac, for (i=0; isupportedRates.supportedMCSSet[i] = mcsSet[i] & pSupportedMCSSet[i]; - PELOG2(limLog(pMac, LOG2, FL("limPopulateMatchingRateSet: MCS Rate Set Bitmap from CFG and DPH :"));) + limLog(pMac, LOG1, FL("MCS Rate Set Bitmap from CFG and DPH:")); for (i=0; isupportedRates.supportedMCSSet[i]);) + limLog(pMac, LOG1, FL("%x %x"), + mcsSet[i], + pStaDs->supportedRates.supportedMCSSet[i]); } } @@ -2269,18 +2299,16 @@ static tSirRetStatus limTdlsSetupAddSta(tpAniSirGlobal pMac, if( !aid ) { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("%s: No more free AID for peer " MAC_ADDRESS_STR), - __func__, MAC_ADDR_ARRAY(pAddStaReq->peerMac)) ; + limLog(pMac, LOGE, FL("No more free AID for peer " MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pAddStaReq->peerMac)); return eSIR_FAILURE; } /* Set the aid in peerAIDBitmap as it has been assigned to TDLS peer */ SET_PEER_AID_BITMAP(psessionEntry->peerAIDBitmap, aid); - VOS_TRACE(VOS_MODULE_ID_PE, TDLS_DEBUG_LOG_LEVEL, - ("limTdlsSetupAddSta: Aid = %d, for peer =" MAC_ADDRESS_STR), - aid, MAC_ADDR_ARRAY(pAddStaReq->peerMac)); + limLog(pMac, LOG1, FL("Aid = %d, for peer =" MAC_ADDRESS_STR), + aid, MAC_ADDR_ARRAY(pAddStaReq->peerMac)); pStaDs = dphGetHashEntry(pMac, aid, &psessionEntry->dph.dphHashTable); if (pStaDs) @@ -2294,8 +2322,7 @@ static tSirRetStatus limTdlsSetupAddSta(tpAniSirGlobal pMac, if(NULL == pStaDs) { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - (" add hash entry failed")) ; + limLog(pMac, LOGE, FL("add hash entry failed")); VOS_ASSERT(0) ; return eSIR_FAILURE; } @@ -2331,14 +2358,11 @@ static tpDphHashNode limTdlsDelSta(tpAniSirGlobal pMac, tSirMacAddr peerMac, if(pStaDs) { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("DEL STA peer MAC: "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(pStaDs->staAddr)); - - VOS_TRACE(VOS_MODULE_ID_PE, TDLS_DEBUG_LOG_LEVEL, - ("limTdlsDelSta: STA type = %x, sta idx = %x"),pStaDs->staType, - pStaDs->staIndex) ; - + limLog(pMac, LOG1, FL("DEL STA peer MAC: "MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pStaDs->staAddr)); + limLog(pMac, LOG1, FL("STA type = %x, sta idx = %x"), + pStaDs->staType, + pStaDs->staIndex); status = limDelSta(pMac, pStaDs, false, psessionEntry) ; } @@ -2360,7 +2384,7 @@ static eHalStatus limSendSmeTdlsAddStaRsp(tpAniSirGlobal pMac, addStaRsp = vos_mem_malloc(sizeof(tSirTdlsAddStaRsp)); if ( NULL == addStaRsp ) { - PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));) + limLog(pMac, LOGE, FL("Failed to allocate memory")); return eSIR_FAILURE; } @@ -2404,15 +2428,14 @@ eHalStatus limProcessTdlsAddStaRsp(tpAniSirGlobal pMac, void *msg, tANI_U16 aid = 0 ; SET_LIM_PROCESS_DEFD_MESGS(pMac, true); - VOS_TRACE(VOS_MODULE_ID_PE, TDLS_DEBUG_LOG_LEVEL, - ("limTdlsAddStaRsp: staIdx=%d, staMac="MAC_ADDRESS_STR), pAddStaParams->staIdx, - MAC_ADDR_ARRAY(pAddStaParams->staMac)); + limLog(pMac, LOG1, FL("staIdx=%d, staMac="MAC_ADDRESS_STR), + pAddStaParams->staIdx, + MAC_ADDR_ARRAY(pAddStaParams->staMac)); if (pAddStaParams->status != eHAL_STATUS_SUCCESS) { VOS_ASSERT(0) ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("Add sta failed ")) ; + limLog(pMac, LOGE, FL("Add sta failed ")); status = eSIR_FAILURE; goto add_sta_error; } @@ -2421,8 +2444,7 @@ eHalStatus limProcessTdlsAddStaRsp(tpAniSirGlobal pMac, void *msg, &psessionEntry->dph.dphHashTable); if(NULL == pStaDs) { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - ("pStaDs is NULL ")) ; + limLog(pMac, LOGE, FL("pStaDs is NULL ")); status = eSIR_FAILURE; goto add_sta_error; } @@ -2460,8 +2482,7 @@ void PopulateDot11fTdlsOffchannelParams(tpAniSirGlobal pMac, * Could not get Valid channel list from CFG. * Log error. */ - limLog(pMac, LOGP, - FL("could not retrieve Valid channel list")); + limLog(pMac, LOGE, FL("could not retrieve valid channel list")); } /* validating the channel list for DFS channels */ @@ -2508,18 +2529,20 @@ void PopulateDot11fTdlsOffchannelParams(tpAniSirGlobal pMac, chanOffset); if (op_class == 0) { - PELOGE(limLog(pMac, LOGE, FL("Present Operating class is wrong, countryCodeCurrent: %s, currentOperChannel: %d, htSecondaryChannelOffset: %d, chanOffset: %d"), - pMac->scan.countryCodeCurrent, - psessionEntry->currentOperChannel, - psessionEntry->htSecondaryChannelOffset, - chanOffset);) + limLog(pMac, LOGE, + FL("Present Operating class is wrong, countryCodeCurrent: %s, currentOperChannel: %d, htSecondaryChannelOffset: %d, chanOffset: %d"), + pMac->scan.countryCodeCurrent, + psessionEntry->currentOperChannel, + psessionEntry->htSecondaryChannelOffset, + chanOffset); } else { - PELOGE(limLog(pMac, LOG1, FL("Present Operating channel: %d chanOffset: %d, op class=%d"), - psessionEntry->currentOperChannel, - chanOffset, - op_class);) + limLog(pMac, LOG1, + FL("Present Operating channel: %d chanOffset: %d, op class=%d"), + psessionEntry->currentOperChannel, + chanOffset, + op_class); } suppOperClasses->present = 1; suppOperClasses->classes[0] = op_class; @@ -2592,15 +2615,14 @@ tSirRetStatus limProcessSmeTdlsMgmtSendReq(tpAniSirGlobal pMac, tANI_U8 sessionId; tSirResultCodes resultCode = eSIR_SME_INVALID_PARAMETERS; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("Send Mgmt Recieved")) ; + limLog(pMac, LOG1, FL("Send Mgmt Recieved")); if((psessionEntry = peFindSessionByBssid(pMac, pSendMgmtReq->bssid, &sessionId)) == NULL) { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - "PE Session does not exist for given sme sessionId %d", - pSendMgmtReq->sessionId); + limLog(pMac, LOGE, + FL("PE Session does not exist for given sme sessionId %d"), + pSendMgmtReq->sessionId); goto lim_tdls_send_mgmt_error; } @@ -2620,16 +2642,15 @@ tSirRetStatus limProcessSmeTdlsMgmtSendReq(tpAniSirGlobal pMac, (psessionEntry->limSmeState != eLIM_SME_LINK_EST_STATE)) { - limLog(pMac, LOGE, "send mgmt received in invalid LIMsme " - "state (%d)", psessionEntry->limSmeState); + limLog(pMac, LOGE, FL("send mgmt received in invalid LIMsme state (%d)"), + psessionEntry->limSmeState); goto lim_tdls_send_mgmt_error; } switch( pSendMgmtReq->reqType ) { case SIR_MAC_TDLS_DIS_REQ: - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - "Transmit Discovery Request Frame") ; + limLog(pMac, LOG1, FL("Transmit Discovery Request Frame")); /* format TDLS discovery request frame and transmit it */ limSendTdlsDisReqFrame(pMac, pSendMgmtReq->peerMac, pSendMgmtReq->dialog, @@ -2638,6 +2659,7 @@ tSirRetStatus limProcessSmeTdlsMgmtSendReq(tpAniSirGlobal pMac, break; case SIR_MAC_TDLS_DIS_RSP: { + limLog(pMac, LOG1, FL("Transmit Discovery Response Frame")); //Send a response mgmt action frame limSendTdlsDisRspFrame(pMac, pSendMgmtReq->peerMac, pSendMgmtReq->dialog, psessionEntry, @@ -2648,6 +2670,7 @@ tSirRetStatus limProcessSmeTdlsMgmtSendReq(tpAniSirGlobal pMac, break; case SIR_MAC_TDLS_SETUP_REQ: { + limLog(pMac, LOG1, FL("Transmit Setup Request Frame")); limSendTdlsLinkSetupReqFrame(pMac, pSendMgmtReq->peerMac, pSendMgmtReq->dialog, psessionEntry, &pSendMgmtReq->addIe[0], (pSendMgmtReq->length - sizeof(tSirTdlsSendMgmtReq))); @@ -2656,6 +2679,7 @@ tSirRetStatus limProcessSmeTdlsMgmtSendReq(tpAniSirGlobal pMac, break; case SIR_MAC_TDLS_SETUP_RSP: { + limLog(pMac, LOG1, FL("Transmit Setup Response Frame")); limSendTdlsSetupRspFrame(pMac, pSendMgmtReq->peerMac, pSendMgmtReq->dialog, psessionEntry, pSendMgmtReq->statusCode, &pSendMgmtReq->addIe[0], (pSendMgmtReq->length - sizeof(tSirTdlsSendMgmtReq))); @@ -2664,6 +2688,7 @@ tSirRetStatus limProcessSmeTdlsMgmtSendReq(tpAniSirGlobal pMac, break; case SIR_MAC_TDLS_SETUP_CNF: { + limLog(pMac, LOG1, FL("Transmit Setup Confirm Frame")); limSendTdlsLinkSetupCnfFrame(pMac, pSendMgmtReq->peerMac, pSendMgmtReq->dialog, pSendMgmtReq->peerCapability, psessionEntry, &pSendMgmtReq->addIe[0], (pSendMgmtReq->length - sizeof(tSirTdlsSendMgmtReq))); resultCode = eSIR_SME_SUCCESS; @@ -2671,6 +2696,7 @@ tSirRetStatus limProcessSmeTdlsMgmtSendReq(tpAniSirGlobal pMac, break; case SIR_MAC_TDLS_TEARDOWN: { + limLog(pMac, LOG1, FL("Transmit Teardown Frame")); limSendTdlsTeardownFrame(pMac, pSendMgmtReq->peerMac, pSendMgmtReq->statusCode, pSendMgmtReq->responder, psessionEntry, &pSendMgmtReq->addIe[0], (pSendMgmtReq->length - sizeof(tSirTdlsSendMgmtReq))); @@ -2719,7 +2745,7 @@ void limSendSmeTdlsLinkEstablishReqRsp(tpAniSirGlobal pMac, pTdlsLinkEstablishReqRsp = vos_mem_malloc(sizeof(tSirTdlsLinkEstablishReqRsp)); if ( NULL == pTdlsLinkEstablishReqRsp ) { - PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));) + limLog(pMac, LOGE, FL("Failed to allocate memory")); return ; } pTdlsLinkEstablishReqRsp->statusCode = status ; @@ -2751,7 +2777,7 @@ static eHalStatus limSendSmeTdlsDelStaRsp(tpAniSirGlobal pMac, pDelSta = vos_mem_malloc(sizeof(tSirTdlsDelStaRsp)); if ( NULL == pDelSta ) { - PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));) + limLog(pMac, LOGE, FL("Failed to allocate memory")); return eSIR_FAILURE; } @@ -2791,15 +2817,14 @@ tSirRetStatus limProcessSmeTdlsAddStaReq(tpAniSirGlobal pMac, tpPESession psessionEntry; tANI_U8 sessionId; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("Send Mgmt Recieved")) ; + limLog(pMac, LOG1, FL("TDLS Add STA Request Recieved")); if((psessionEntry = peFindSessionByBssid(pMac, pAddStaReq->bssid, &sessionId)) == NULL) { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - "PE Session does not exist for given sme sessionId %d", - pAddStaReq->sessionId); + limLog(pMac, LOGE, + FL("PE Session does not exist for given sme sessionId %d"), + pAddStaReq->sessionId); goto lim_tdls_add_sta_error; } @@ -2819,8 +2844,9 @@ tSirRetStatus limProcessSmeTdlsAddStaReq(tpAniSirGlobal pMac, (psessionEntry->limSmeState != eLIM_SME_LINK_EST_STATE)) { - limLog(pMac, LOGE, "send mgmt received in invalid LIMsme " - "state (%d)", psessionEntry->limSmeState); + limLog(pMac, LOGE, + FL("Add STA received in invalid LIMsme state (%d)"), + psessionEntry->limSmeState); goto lim_tdls_add_sta_error; } @@ -2829,7 +2855,7 @@ tSirRetStatus limProcessSmeTdlsAddStaReq(tpAniSirGlobal pMac, /* To start with, send add STA request to HAL */ if (eSIR_FAILURE == limTdlsSetupAddSta(pMac, pAddStaReq, psessionEntry)) { - limLog(pMac, LOGE, "%s: Add TDLS Station request failed ", __func__); + limLog(pMac, LOGE, FL("Add TDLS Station request failed")); goto lim_tdls_add_sta_error; } return eSIR_SUCCESS; @@ -2852,15 +2878,14 @@ tSirRetStatus limProcessSmeTdlsDelStaReq(tpAniSirGlobal pMac, tANI_U8 sessionId; tpDphHashNode pStaDs = NULL ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("Send Mgmt Recieved")) ; + limLog(pMac, LOG1, FL("TDLS Delete STA Request Recieved")); if((psessionEntry = peFindSessionByBssid(pMac, pDelStaReq->bssid, &sessionId)) == NULL) { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - "PE Session does not exist for given sme sessionId %d", - pDelStaReq->sessionId); + limLog(pMac, LOGE, + FL("PE Session does not exist for given sme sessionId %d"), + pDelStaReq->sessionId); limSendSmeTdlsDelStaRsp(pMac, pDelStaReq->sessionId, pDelStaReq->peerMac, NULL, eSIR_FAILURE) ; return eSIR_FAILURE; @@ -2882,8 +2907,8 @@ tSirRetStatus limProcessSmeTdlsDelStaReq(tpAniSirGlobal pMac, (psessionEntry->limSmeState != eLIM_SME_LINK_EST_STATE)) { - limLog(pMac, LOGE, "Del Sta received in invalid LIMsme state (%d)", - psessionEntry->limSmeState); + limLog(pMac, LOGE, FL("Del Sta received in invalid LIMsme state (%d)"), + psessionEntry->limSmeState); goto lim_tdls_del_sta_error; } @@ -2953,15 +2978,14 @@ tSirRetStatus limProcesSmeTdlsLinkEstablishReq(tpAniSirGlobal pMac, tANI_U16 peerIdx = 0 ; tpDphHashNode pStaDs = NULL ; - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, - ("Send Mgmt Recieved")) ; + limLog(pMac, LOG1, FL("Link Establish Request Recieved")) ; if((psessionEntry = peFindSessionByBssid(pMac, pTdlsLinkEstablishReq->bssid, &sessionId)) == NULL) { - VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_ERROR, - "PE Session does not exist for given sme sessionId %d", - pTdlsLinkEstablishReq->sessionId); + limLog(pMac, LOGE, + FL("PE Session does not exist for given sme sessionId %d"), + pTdlsLinkEstablishReq->sessionId); limSendSmeTdlsLinkEstablishReqRsp(pMac, pTdlsLinkEstablishReq->sessionId, pTdlsLinkEstablishReq->peerMac, NULL, eSIR_FAILURE) ; return eSIR_FAILURE; @@ -2984,8 +3008,9 @@ tSirRetStatus limProcesSmeTdlsLinkEstablishReq(tpAniSirGlobal pMac, (psessionEntry->limSmeState != eLIM_SME_LINK_EST_STATE)) { - limLog(pMac, LOGE, "TDLS Link Establish Request received in " - "invalid LIMsme state (%d)", psessionEntry->limSmeState); + limLog(pMac, LOGE, + FL("TDLS Link Establish Request received in invalid LIMsme state (%d)"), + psessionEntry->limSmeState); goto lim_tdls_link_establish_error; } /*TODO Sunil , TDLSPeer Entry has the STA ID , Use it */ @@ -2993,15 +3018,15 @@ tSirRetStatus limProcesSmeTdlsLinkEstablishReq(tpAniSirGlobal pMac, &psessionEntry->dph.dphHashTable) ; if ( NULL == pStaDs ) { - limLog( pMac, LOGE, FL( "pStaDs is NULL" )); + limLog(pMac, LOGE, FL( "pStaDs is NULL")); goto lim_tdls_link_establish_error; } pMsgTdlsLinkEstablishReq = vos_mem_malloc(sizeof( tTdlsLinkEstablishParams )); if ( NULL == pMsgTdlsLinkEstablishReq ) { - limLog( pMac, LOGE, - FL( "Unable to allocate memory TDLS Link Establish Request" )); + limLog(pMac, LOGE, + FL("Unable to allocate memory TDLS Link Establish Request")); return eSIR_MEM_ALLOC_FAILED; } @@ -3026,7 +3051,7 @@ tSirRetStatus limProcesSmeTdlsLinkEstablishReq(tpAniSirGlobal pMac, * Could not get Valid channel list from CFG. * Log error. */ - limLog(pMac, LOGP, + limLog(pMac, LOGE, FL("could not retrieve Valid channel list")); } @@ -3080,7 +3105,7 @@ tSirRetStatus limDeleteTDLSPeers(tpAniSirGlobal pMac, tpPESession psessionEntry) if (NULL == psessionEntry) { - PELOGE(limLog(pMac, LOGE, FL("NULL psessionEntry"));) + limLog(pMac, LOGE, FL("NULL psessionEntry")); return eSIR_FAILURE; } @@ -3096,8 +3121,8 @@ tSirRetStatus limDeleteTDLSPeers(tpAniSirGlobal pMac, tpPESession psessionEntry) if (NULL != pStaDs) { - PELOGE(limLog(pMac, LOGE, FL("Deleting "MAC_ADDRESS_STR), - MAC_ADDR_ARRAY(pStaDs->staAddr));); + limLog(pMac, LOGE, FL("Deleting "MAC_ADDRESS_STR), + MAC_ADDR_ARRAY(pStaDs->staAddr)); limSendDeauthMgmtFrame(pMac, eSIR_MAC_DEAUTH_LEAVING_BSS_REASON, pStaDs->staAddr, psessionEntry, FALSE); -- cgit v1.2.3 From 32ca3366b931679ac0abeb8bb41b942de018cf34 Mon Sep 17 00:00:00 2001 From: AnjaneeDevi Kapparapu Date: Fri, 7 Nov 2014 16:14:49 +0530 Subject: Cafstaging Release 1.0.0.229 Cafstaging Release 1.0.0.229 Change-Id: Iefd5a6ca6bd131413ab873c4632861b23505e561 CRs-Fixed: 688141 --- CORE/MAC/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CORE/MAC/inc/qwlan_version.h b/CORE/MAC/inc/qwlan_version.h index 448634e67e55..49eb2eda5bce 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 228 +#define QWLAN_VERSION_BUILD 229 -#define QWLAN_VERSIONSTR "1.0.0.228" +#define QWLAN_VERSIONSTR "1.0.0.229" #define AR6320_REV1_VERSION 0x5000000 -- cgit v1.2.3