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