Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame^] | 2 | * Copyright (c) 2012-2013 Qualcomm Atheros, Inc. |
| 3 | * All Rights Reserved. |
| 4 | * Qualcomm Atheros Confidential and Proprietary. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 5 | */ |
| 6 | /* |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7 | * |
| 8 | * Airgo Networks, Inc proprietary. All rights reserved. |
| 9 | * This file limProcessProbeRspFrame.cc contains the code |
| 10 | * for processing Probe Response Frame. |
| 11 | * Author: Chandra Modumudi |
| 12 | * Date: 03/01/02 |
| 13 | * History:- |
| 14 | * Date Modified by Modification Information |
| 15 | * -------------------------------------------------------------------- |
| 16 | * |
| 17 | */ |
| 18 | |
| 19 | #include "wniApi.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 20 | #include "wniCfgSta.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 21 | #include "aniGlobal.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 22 | #include "schApi.h" |
| 23 | #include "utilsApi.h" |
| 24 | #include "limApi.h" |
| 25 | #include "limTypes.h" |
| 26 | #include "limUtils.h" |
| 27 | #include "limAssocUtils.h" |
| 28 | #include "limPropExtsUtils.h" |
| 29 | #include "limSerDesUtils.h" |
| 30 | #include "limSendMessages.h" |
| 31 | |
| 32 | #include "parserApi.h" |
| 33 | |
Leela V Kiran Kumar Reddy Chirala | 6a45875 | 2013-02-16 15:41:27 -0800 | [diff] [blame] | 34 | tSirRetStatus |
| 35 | limValidateIEInformationInProbeRspFrame (tANI_U8 *pRxPacketInfo) |
| 36 | { |
| 37 | tSirRetStatus status = eSIR_SUCCESS; |
| 38 | |
| 39 | if (WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo) < (SIR_MAC_B_PR_SSID_OFFSET + SIR_MAC_MIN_IE_LEN)) |
| 40 | { |
| 41 | status = eSIR_FAILURE; |
| 42 | } |
| 43 | |
| 44 | return status; |
| 45 | } |
| 46 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 47 | /** |
| 48 | * limProcessProbeRspFrame |
| 49 | * |
| 50 | *FUNCTION: |
| 51 | * This function is called by limProcessMessageQueue() upon |
| 52 | * Probe Response frame reception. |
| 53 | * |
| 54 | *LOGIC: |
| 55 | * This function processes received Probe Response frame. |
| 56 | * |
| 57 | *ASSUMPTIONS: |
| 58 | * |
| 59 | *NOTE: |
| 60 | * 1. Frames with out-of-order IEs are dropped. |
| 61 | * 2. In case of IBSS, join 'success' makes MLM state machine |
| 62 | * transition into 'BSS started' state. This may have to change |
| 63 | * depending on supporting what kinda Authentication in IBSS. |
| 64 | * |
| 65 | * @param pMac Pointer to Global MAC structure |
| 66 | * @param *pRxPacketInfo A pointer to Buffer descriptor + associated PDUs |
| 67 | * @return None |
| 68 | */ |
| 69 | |
| 70 | |
| 71 | void |
| 72 | limProcessProbeRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry) |
| 73 | { |
| 74 | tANI_U8 *pBody; |
| 75 | tANI_U32 frameLen = 0; |
| 76 | tSirMacAddr currentBssId; |
| 77 | tpSirMacMgmtHdr pHdr; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 78 | tSirProbeRespBeacon *pProbeRsp; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 79 | tANI_U8 qosEnabled = false; |
| 80 | tANI_U8 wmeEnabled = false; |
| 81 | |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 82 | pProbeRsp = vos_mem_malloc(sizeof(tSirProbeRespBeacon)); |
| 83 | if ( NULL == pProbeRsp ) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 84 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 85 | limLog(pMac, LOGE, FL("Unable to allocate memory in limProcessProbeRspFrame") ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 86 | return; |
| 87 | } |
| 88 | |
| 89 | pProbeRsp->ssId.length = 0; |
| 90 | pProbeRsp->wpa.length = 0; |
| 91 | pProbeRsp->propIEinfo.apName.length = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 92 | |
| 93 | |
| 94 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 95 | |
| 96 | |
| 97 | PELOG2(limLog(pMac, LOG2, |
| 98 | FL("Received Probe Response frame with length=%d from "), |
| 99 | WDA_GET_RX_MPDU_LEN(pRxPacketInfo)); |
| 100 | limPrintMacAddr(pMac, pHdr->sa, LOG2);) |
| 101 | |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 102 | if (!pMac->fScanOffload) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 103 | { |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 104 | if (limDeactivateMinChannelTimerDuringScan(pMac) != eSIR_SUCCESS) |
| 105 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 106 | vos_mem_free(pProbeRsp); |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 107 | return; |
| 108 | } |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 109 | } |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 110 | |
Leela V Kiran Kumar Reddy Chirala | 6a45875 | 2013-02-16 15:41:27 -0800 | [diff] [blame] | 111 | // Validate IE information before processing Probe Response Frame |
| 112 | if (limValidateIEInformationInProbeRspFrame(pRxPacketInfo) != eSIR_SUCCESS) |
| 113 | { |
| 114 | PELOG1(limLog(pMac, LOG1, |
| 115 | FL("Parse error ProbeResponse, length=%d"), frameLen);) |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 116 | vos_mem_free(pProbeRsp); |
Leela V Kiran Kumar Reddy Chirala | 6a45875 | 2013-02-16 15:41:27 -0800 | [diff] [blame] | 117 | return; |
| 118 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 119 | |
| 120 | /** |
| 121 | * Expect Probe Response only when |
| 122 | * 1. STA is in scan mode waiting for Beacon/Probe response or |
| 123 | * 2. STA is waiting for Beacon/Probe Response to announce |
| 124 | * join success or |
| 125 | * 3. STA is in IBSS mode in BSS started state or |
| 126 | * 4. STA/AP is in learn mode |
| 127 | * 5. STA in link established state. In this state, the probe response is |
| 128 | * expected for two scenarios: |
| 129 | * -- As part of heart beat mechanism, probe req is sent out |
| 130 | * -- If QoS Info IE in beacon has a different count for EDCA Params, |
| 131 | * and EDCA IE is not present in beacon, |
| 132 | * then probe req is sent out to get the EDCA params. |
| 133 | * |
| 134 | * Ignore Probe Response frame in all other states |
| 135 | */ |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 136 | /* */ |
| 137 | // TO SUPPORT BT-AMP |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 138 | if (((pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) || //mlm state check should be global - 18th oct |
| 139 | (pMac->lim.gLimMlmState == eLIM_MLM_PASSIVE_SCAN_STATE) || //mlm state check should be global - 18th oct |
| 140 | (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE) || //mlm state check should be global - 18th oct |
| 141 | (psessionEntry->limMlmState == eLIM_MLM_WT_JOIN_BEACON_STATE) || |
| 142 | (psessionEntry->limMlmState == eLIM_MLM_LINK_ESTABLISHED_STATE) )|| |
| 143 | ((GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_STA_IN_IBSS_ROLE) && |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 144 | (psessionEntry->limMlmState == eLIM_MLM_BSS_STARTED_STATE)) || |
| 145 | pMac->fScanOffload) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 146 | { |
| 147 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 148 | |
Chet Lanctot | c6fbce7 | 2013-05-20 17:52:15 -0700 | [diff] [blame] | 149 | if (pMac->lim.gLimBackgroundScanMode == eSIR_ROAMING_SCAN) |
| 150 | { |
| 151 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 152 | FL("Probe Resp Frame Received: BSSID " MAC_ADDRESS_STR " (RSSI %d)"), |
| 153 | MAC_ADDR_ARRAY(pHdr->bssId), |
| 154 | (uint)abs((tANI_S8)WDA_GET_RX_RSSI_DB(pRxPacketInfo))); |
| 155 | } |
| 156 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 157 | // Get pointer to Probe Response frame body |
| 158 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 159 | |
Leela V Kiran Kumar Reddy Chirala | 6a45875 | 2013-02-16 15:41:27 -0800 | [diff] [blame] | 160 | if (sirConvertProbeFrame2Struct(pMac, pBody, frameLen, pProbeRsp) == eSIR_FAILURE || |
| 161 | !pProbeRsp->ssidPresent) // Enforce Mandatory IEs |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 162 | { |
| 163 | PELOG1(limLog(pMac, LOG1, |
Leela V Kiran Kumar Reddy Chirala | 6a45875 | 2013-02-16 15:41:27 -0800 | [diff] [blame] | 164 | FL("Parse error ProbeResponse, length=%d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 165 | frameLen);) |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 166 | vos_mem_free(pProbeRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 167 | return; |
| 168 | } |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 169 | |
| 170 | if (pMac->fScanOffload) |
| 171 | { |
| 172 | limCheckAndAddBssDescription(pMac, pProbeRsp, pRxPacketInfo, |
| 173 | eANI_BOOLEAN_FALSE, eANI_BOOLEAN_TRUE); |
| 174 | } |
| 175 | |
| 176 | //To Support BT-AMP |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 177 | if ((pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) || //mlm state check should be global - 18th oct |
| 178 | (pMac->lim.gLimMlmState == eLIM_MLM_PASSIVE_SCAN_STATE)) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 179 | limCheckAndAddBssDescription(pMac, pProbeRsp, pRxPacketInfo, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 180 | ((pMac->lim.gLimHalScanState == eLIM_HAL_SCANNING_STATE) ? eANI_BOOLEAN_TRUE : eANI_BOOLEAN_FALSE), eANI_BOOLEAN_TRUE); |
| 181 | else if (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE) //mlm state check should be global - 18th oct |
| 182 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 183 | } |
| 184 | else if (psessionEntry->limMlmState == |
| 185 | eLIM_MLM_WT_JOIN_BEACON_STATE) |
| 186 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 187 | if( psessionEntry->beacon != NULL )//Either Beacon/probe response is required. Hence store it in same buffer. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 188 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 189 | vos_mem_free(psessionEntry->beacon); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 190 | psessionEntry->beacon = NULL; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 191 | } |
| 192 | psessionEntry->bcnLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 193 | |
| 194 | psessionEntry->beacon = vos_mem_malloc(psessionEntry->bcnLen); |
| 195 | if ( NULL == psessionEntry->beacon ) |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 196 | { |
| 197 | PELOGE(limLog(pMac, LOGE, |
| 198 | FL("Unable to allocate memory to store beacon"));) |
| 199 | } |
| 200 | else |
| 201 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 202 | //Store the Beacon/ProbeRsp. This is sent to csr/hdd in join cnf response. |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 203 | vos_mem_copy(psessionEntry->beacon, |
| 204 | WDA_GET_RX_MPDU_DATA(pRxPacketInfo), |
| 205 | psessionEntry->bcnLen); |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 206 | } |
| 207 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 208 | // STA in WT_JOIN_BEACON_STATE |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 209 | limCheckAndAnnounceJoinSuccess(pMac, pProbeRsp, pHdr, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 210 | } |
| 211 | else if(psessionEntry->limMlmState == eLIM_MLM_LINK_ESTABLISHED_STATE) |
| 212 | { |
| 213 | tpDphHashNode pStaDs = NULL; |
| 214 | /** |
| 215 | * Check if this Probe Response is for |
| 216 | * our Probe Request sent upon reaching |
| 217 | * heart beat threshold |
| 218 | */ |
| 219 | #if 0 |
| 220 | if (wlan_cfgGetStr(pMac, |
| 221 | WNI_CFG_BSSID, |
| 222 | currentBssId, |
| 223 | &cfg) != eSIR_SUCCESS) |
| 224 | { |
| 225 | /// Could not get BSSID from CFG. Log error. |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 226 | limLog(pMac, LOGP, FL("could not retrieve BSSID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 227 | } |
| 228 | #endif //TO SUPPORT BT-AMP |
| 229 | sirCopyMacAddr(currentBssId,psessionEntry->bssId); |
| 230 | |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 231 | if ( !vos_mem_compare(currentBssId, pHdr->bssId, sizeof(tSirMacAddr)) ) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 232 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 233 | vos_mem_free(pProbeRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 234 | return; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 235 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 236 | |
| 237 | if (!LIM_IS_CONNECTION_ACTIVE(psessionEntry)) |
| 238 | { |
| 239 | limLog(pMac, LOGW, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 240 | FL("Received Probe Resp from AP. So it is alive!!")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 241 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 242 | if (pProbeRsp->HTInfo.present) |
| 243 | limReceivedHBHandler(pMac, (tANI_U8)pProbeRsp->HTInfo.primaryChannel, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 244 | else |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 245 | limReceivedHBHandler(pMac, (tANI_U8)pProbeRsp->channelNumber, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 246 | } |
| 247 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 248 | |
| 249 | if (psessionEntry->limSystemRole == eLIM_STA_ROLE) |
| 250 | { |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 251 | if (pProbeRsp->channelSwitchPresent || |
| 252 | pProbeRsp->propIEinfo.propChannelSwitchPresent) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 253 | { |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 254 | limUpdateChannelSwitch(pMac, pProbeRsp, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 255 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 256 | else if (psessionEntry->gLimSpecMgmt.dot11hChanSwState == eLIM_11H_CHANSW_RUNNING) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 257 | { |
| 258 | limCancelDot11hChannelSwitch(pMac, psessionEntry); |
| 259 | } |
| 260 | } |
| 261 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 262 | |
| 263 | /** |
| 264 | * Now Process EDCA Parameters, if EDCAParamSet count is different. |
| 265 | * -- While processing beacons in link established state if it is determined that |
| 266 | * QoS Info IE has a different count for EDCA Params, |
| 267 | * and EDCA IE is not present in beacon, |
| 268 | * then probe req is sent out to get the EDCA params. |
| 269 | */ |
| 270 | |
| 271 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 272 | |
| 273 | limGetQosMode(psessionEntry, &qosEnabled); |
| 274 | limGetWmeMode(psessionEntry, &wmeEnabled); |
| 275 | PELOG2(limLog(pMac, LOG2, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 276 | FL("wmeEdcaPresent: %d wmeEnabled: %d, edcaPresent: %d, qosEnabled: %d, edcaParams.qosInfo.count: %d schObject.gLimEdcaParamSetCount: %d"), |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 277 | pProbeRsp->wmeEdcaPresent, wmeEnabled, pProbeRsp->edcaPresent, qosEnabled, |
| 278 | pProbeRsp->edcaParams.qosInfo.count, psessionEntry->gLimEdcaParamSetCount);) |
| 279 | if (((pProbeRsp->wmeEdcaPresent && wmeEnabled) || |
| 280 | (pProbeRsp->edcaPresent && qosEnabled)) && |
| 281 | (pProbeRsp->edcaParams.qosInfo.count != psessionEntry->gLimEdcaParamSetCount)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 282 | { |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 283 | if (schBeaconEdcaProcess(pMac, &pProbeRsp->edcaParams, psessionEntry) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 284 | PELOGE(limLog(pMac, LOGE, FL("EDCA parameter processing error"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 285 | else if (pStaDs != NULL) |
| 286 | { |
| 287 | // If needed, downgrade the EDCA parameters |
| 288 | limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry); |
| 289 | |
| 290 | if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE) |
| 291 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE); |
| 292 | else |
| 293 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE); |
| 294 | } |
| 295 | else |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 296 | PELOGE(limLog(pMac, LOGE, FL("Self Entry missing in Hash Table"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 297 | |
| 298 | } |
Gopichand Nakkala | be8653b | 2013-04-10 08:16:05 +0530 | [diff] [blame] | 299 | |
| 300 | if (psessionEntry->fWaitForProbeRsp == true) |
| 301 | { |
| 302 | limLog(pMac, LOGW, FL("Checking probe response for capability change\n") ); |
| 303 | limDetectChangeInApCapabilities(pMac, pProbeRsp, psessionEntry); |
| 304 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 305 | } |
| 306 | else if ((psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) && |
| 307 | (psessionEntry->limMlmState == eLIM_MLM_BSS_STARTED_STATE)) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 308 | limHandleIBSScoalescing(pMac, pProbeRsp, pRxPacketInfo,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 309 | } // if ((pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) || ... |
| 310 | |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 311 | vos_mem_free(pProbeRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 312 | // Ignore Probe Response frame in all other states |
| 313 | return; |
| 314 | } /*** end limProcessProbeRspFrame() ***/ |
| 315 | |
| 316 | |
| 317 | void |
| 318 | limProcessProbeRspFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) |
| 319 | { |
| 320 | tANI_U8 *pBody; |
| 321 | tANI_U32 frameLen = 0; |
| 322 | tpSirMacMgmtHdr pHdr; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 323 | tSirProbeRespBeacon *pProbeRsp; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 324 | |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 325 | pProbeRsp = vos_mem_malloc(sizeof(tSirProbeRespBeacon)); |
| 326 | if ( NULL == pProbeRsp ) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 327 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 328 | limLog(pMac, LOGE, FL("Unable to allocate memory in limProcessProbeRspFrameNoSession") ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 329 | return; |
| 330 | } |
| 331 | |
| 332 | pProbeRsp->ssId.length = 0; |
| 333 | pProbeRsp->wpa.length = 0; |
| 334 | pProbeRsp->propIEinfo.apName.length = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 335 | |
| 336 | |
| 337 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 338 | |
| 339 | |
| 340 | limLog(pMac, LOG2, |
| 341 | FL("Received Probe Response frame with length=%d from "), |
| 342 | WDA_GET_RX_MPDU_LEN(pRxPacketInfo)); |
| 343 | limPrintMacAddr(pMac, pHdr->sa, LOG2); |
| 344 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 345 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 346 | if (!(WDA_GET_OFFLOADSCANLEARN(pRxPacketInfo) || |
| 347 | WDA_GET_ROAMCANDIDATEIND(pRxPacketInfo))) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 348 | { |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 349 | #endif |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 350 | if (!pMac->fScanOffload) |
| 351 | { |
| 352 | if (limDeactivateMinChannelTimerDuringScan(pMac) != eSIR_SUCCESS) |
| 353 | { |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 354 | vos_mem_free(pProbeRsp); |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 355 | return; |
| 356 | } |
| 357 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 358 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 359 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 360 | #endif |
Leela V Kiran Kumar Reddy Chirala | 6a45875 | 2013-02-16 15:41:27 -0800 | [diff] [blame] | 361 | // Validate IE information before processing Probe Response Frame |
| 362 | if (limValidateIEInformationInProbeRspFrame(pRxPacketInfo) != eSIR_SUCCESS) |
| 363 | { |
| 364 | PELOG1(limLog(pMac, LOG1,FL("Parse error ProbeResponse, length=%d"), |
| 365 | frameLen);) |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 366 | vos_mem_free(pProbeRsp); |
Leela V Kiran Kumar Reddy Chirala | 6a45875 | 2013-02-16 15:41:27 -0800 | [diff] [blame] | 367 | return; |
| 368 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 369 | /* Since there is no psessionEntry, PE cannot be in the following states: |
| 370 | * - eLIM_MLM_WT_JOIN_BEACON_STATE |
| 371 | * - eLIM_MLM_LINK_ESTABLISHED_STATE |
| 372 | * - eLIM_MLM_BSS_STARTED_STATE |
| 373 | * Hence, expect Probe Response only when |
| 374 | * 1. STA is in scan mode waiting for Beacon/Probe response |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 375 | * 2. LFR logic in FW sends up candidate frames |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 376 | * |
| 377 | * Ignore Probe Response frame in all other states |
| 378 | */ |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 379 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 380 | if (WDA_GET_OFFLOADSCANLEARN(pRxPacketInfo)) |
| 381 | { |
| 382 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 383 | |
Chet Lanctot | c6fbce7 | 2013-05-20 17:52:15 -0700 | [diff] [blame] | 384 | if (pMac->lim.gLimBackgroundScanMode == eSIR_ROAMING_SCAN) |
| 385 | { |
| 386 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 387 | FL("Probe Resp Frame Received: BSSID " MAC_ADDRESS_STR " (RSSI %d)"), |
| 388 | MAC_ADDR_ARRAY(pHdr->bssId), |
| 389 | (uint)abs((tANI_S8)WDA_GET_RX_RSSI_DB(pRxPacketInfo))); |
| 390 | } |
| 391 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 392 | // Get pointer to Probe Response frame body |
| 393 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 394 | |
| 395 | if (sirConvertProbeFrame2Struct(pMac, pBody, frameLen, pProbeRsp) == eSIR_FAILURE) |
| 396 | { |
| 397 | limLog(pMac, LOG1, FL("Parse error ProbeResponse, length=%d\n"), frameLen); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 398 | vos_mem_free(pProbeRsp); |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 399 | return; |
| 400 | } |
| 401 | limLog( pMac, LOG2, FL("Save this probe rsp in LFR cache")); |
| 402 | limCheckAndAddBssDescription(pMac, pProbeRsp, pRxPacketInfo, |
| 403 | eANI_BOOLEAN_FALSE, eANI_BOOLEAN_TRUE); |
| 404 | } |
| 405 | else |
| 406 | #endif |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 407 | if (pMac->fScanOffload) |
| 408 | { |
| 409 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 410 | |
| 411 | // Get pointer to Probe Response frame body |
| 412 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 413 | |
| 414 | if (sirConvertProbeFrame2Struct(pMac, pBody, frameLen, pProbeRsp) |
| 415 | == eSIR_FAILURE) |
| 416 | { |
| 417 | limLog(pMac, LOG1, |
| 418 | FL("Parse error ProbeResponse, length=%d\n"), frameLen); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 419 | vos_mem_free(pProbeRsp); |
Gopichand Nakkala | 2c231c8 | 2013-06-11 17:49:16 +0530 | [diff] [blame] | 420 | return; |
| 421 | } |
| 422 | limCheckAndAddBssDescription(pMac, pProbeRsp, pRxPacketInfo, |
| 423 | eANI_BOOLEAN_FALSE, eANI_BOOLEAN_TRUE); |
| 424 | } |
| 425 | else if( (pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) || |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 426 | (pMac->lim.gLimMlmState == eLIM_MLM_PASSIVE_SCAN_STATE) || //mlm state check should be global - 18th oct |
| 427 | (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE) ) |
| 428 | { |
| 429 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 430 | |
Chet Lanctot | c6fbce7 | 2013-05-20 17:52:15 -0700 | [diff] [blame] | 431 | if (pMac->lim.gLimBackgroundScanMode == eSIR_ROAMING_SCAN) |
| 432 | { |
| 433 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 434 | FL("Probe Resp Frame Received: BSSID " MAC_ADDRESS_STR " (RSSI %d)"), |
| 435 | MAC_ADDR_ARRAY(pHdr->bssId), |
| 436 | (uint)abs((tANI_S8)WDA_GET_RX_RSSI_DB(pRxPacketInfo))); |
| 437 | } |
| 438 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 439 | // Get pointer to Probe Response frame body |
| 440 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 441 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 442 | if (sirConvertProbeFrame2Struct(pMac, pBody, frameLen, pProbeRsp) == eSIR_FAILURE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 443 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 444 | limLog(pMac, LOG1, FL("Parse error ProbeResponse, length=%d"), frameLen); |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 445 | vos_mem_free(pProbeRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 446 | return; |
| 447 | } |
| 448 | |
| 449 | if( (pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) || |
| 450 | (pMac->lim.gLimMlmState == eLIM_MLM_PASSIVE_SCAN_STATE) ) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 451 | limCheckAndAddBssDescription(pMac, pProbeRsp, pRxPacketInfo, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 452 | else if (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE) |
| 453 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 454 | } |
| 455 | } |
Bansidhar Gopalachari | 1d9c616 | 2013-07-11 10:24:30 +0530 | [diff] [blame] | 456 | vos_mem_free(pProbeRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 457 | return; |
| 458 | } /*** end limProcessProbeRspFrameNew() ***/ |