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 | |
| 138 | if (limDeactivateMinChannelTimerDuringScan(pMac) != eSIR_SUCCESS) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 139 | { |
| 140 | palFreeMemory(pMac->hHdd, pProbeRsp); |
| 141 | return; |
| 142 | } |
Leela V Kiran Kumar Reddy Chirala | 6a45875 | 2013-02-16 15:41:27 -0800 | [diff] [blame] | 143 | // Validate IE information before processing Probe Response Frame |
| 144 | if (limValidateIEInformationInProbeRspFrame(pRxPacketInfo) != eSIR_SUCCESS) |
| 145 | { |
| 146 | PELOG1(limLog(pMac, LOG1, |
| 147 | FL("Parse error ProbeResponse, length=%d"), frameLen);) |
| 148 | palFreeMemory(pMac->hHdd, pProbeRsp); |
| 149 | return; |
| 150 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 151 | |
| 152 | /** |
| 153 | * Expect Probe Response only when |
| 154 | * 1. STA is in scan mode waiting for Beacon/Probe response or |
| 155 | * 2. STA is waiting for Beacon/Probe Response to announce |
| 156 | * join success or |
| 157 | * 3. STA is in IBSS mode in BSS started state or |
| 158 | * 4. STA/AP is in learn mode |
| 159 | * 5. STA in link established state. In this state, the probe response is |
| 160 | * expected for two scenarios: |
| 161 | * -- As part of heart beat mechanism, probe req is sent out |
| 162 | * -- If QoS Info IE in beacon has a different count for EDCA Params, |
| 163 | * and EDCA IE is not present in beacon, |
| 164 | * then probe req is sent out to get the EDCA params. |
| 165 | * |
| 166 | * Ignore Probe Response frame in all other states |
| 167 | */ |
| 168 | // TO SUPPORT BT-AMP |
| 169 | if (((pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) || //mlm state check should be global - 18th oct |
| 170 | (pMac->lim.gLimMlmState == eLIM_MLM_PASSIVE_SCAN_STATE) || //mlm state check should be global - 18th oct |
| 171 | (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE) || //mlm state check should be global - 18th oct |
| 172 | (psessionEntry->limMlmState == eLIM_MLM_WT_JOIN_BEACON_STATE) || |
| 173 | (psessionEntry->limMlmState == eLIM_MLM_LINK_ESTABLISHED_STATE) )|| |
| 174 | ((GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_STA_IN_IBSS_ROLE) && |
| 175 | (psessionEntry->limMlmState == eLIM_MLM_BSS_STARTED_STATE))) |
| 176 | { |
| 177 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 178 | |
| 179 | // Get pointer to Probe Response frame body |
| 180 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 181 | |
Leela V Kiran Kumar Reddy Chirala | 6a45875 | 2013-02-16 15:41:27 -0800 | [diff] [blame] | 182 | if (sirConvertProbeFrame2Struct(pMac, pBody, frameLen, pProbeRsp) == eSIR_FAILURE || |
| 183 | !pProbeRsp->ssidPresent) // Enforce Mandatory IEs |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 184 | { |
| 185 | PELOG1(limLog(pMac, LOG1, |
Leela V Kiran Kumar Reddy Chirala | 6a45875 | 2013-02-16 15:41:27 -0800 | [diff] [blame] | 186 | FL("Parse error ProbeResponse, length=%d"), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 187 | frameLen);) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 188 | palFreeMemory(pMac->hHdd, pProbeRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 189 | return; |
| 190 | } |
| 191 | //To Support BT-AMP |
| 192 | if ((pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) || //mlm state check should be global - 18th oct |
| 193 | (pMac->lim.gLimMlmState == eLIM_MLM_PASSIVE_SCAN_STATE)) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 194 | limCheckAndAddBssDescription(pMac, pProbeRsp, pRxPacketInfo, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 195 | ((pMac->lim.gLimHalScanState == eLIM_HAL_SCANNING_STATE) ? eANI_BOOLEAN_TRUE : eANI_BOOLEAN_FALSE), eANI_BOOLEAN_TRUE); |
| 196 | else if (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE) //mlm state check should be global - 18th oct |
| 197 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 198 | } |
| 199 | else if (psessionEntry->limMlmState == |
| 200 | eLIM_MLM_WT_JOIN_BEACON_STATE) |
| 201 | { |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 202 | 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] | 203 | { |
| 204 | palFreeMemory(pMac->hHdd, psessionEntry->beacon); |
| 205 | psessionEntry->beacon = NULL; |
Jeff Johnson | 43971f5 | 2012-07-17 12:26:56 -0700 | [diff] [blame] | 206 | } |
| 207 | psessionEntry->bcnLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 208 | if ((palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->beacon, |
| 209 | psessionEntry->bcnLen)) |
| 210 | != eHAL_STATUS_SUCCESS) |
| 211 | { |
| 212 | PELOGE(limLog(pMac, LOGE, |
| 213 | FL("Unable to allocate memory to store beacon"));) |
| 214 | } |
| 215 | else |
| 216 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 217 | //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] | 218 | palCopyMemory(pMac->hHdd, psessionEntry->beacon, |
| 219 | WDA_GET_RX_MPDU_DATA(pRxPacketInfo), |
| 220 | psessionEntry->bcnLen); |
| 221 | } |
| 222 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 223 | // STA in WT_JOIN_BEACON_STATE |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 224 | limCheckAndAnnounceJoinSuccess(pMac, pProbeRsp, pHdr, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 225 | } |
| 226 | else if(psessionEntry->limMlmState == eLIM_MLM_LINK_ESTABLISHED_STATE) |
| 227 | { |
| 228 | tpDphHashNode pStaDs = NULL; |
| 229 | /** |
| 230 | * Check if this Probe Response is for |
| 231 | * our Probe Request sent upon reaching |
| 232 | * heart beat threshold |
| 233 | */ |
| 234 | #if 0 |
| 235 | if (wlan_cfgGetStr(pMac, |
| 236 | WNI_CFG_BSSID, |
| 237 | currentBssId, |
| 238 | &cfg) != eSIR_SUCCESS) |
| 239 | { |
| 240 | /// Could not get BSSID from CFG. Log error. |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 241 | limLog(pMac, LOGP, FL("could not retrieve BSSID")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 242 | } |
| 243 | #endif //TO SUPPORT BT-AMP |
| 244 | sirCopyMacAddr(currentBssId,psessionEntry->bssId); |
| 245 | |
| 246 | if ( !palEqualMemory( pMac->hHdd,currentBssId, pHdr->bssId, sizeof(tSirMacAddr)) ) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 247 | { |
| 248 | palFreeMemory(pMac->hHdd, pProbeRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 249 | return; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 250 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 251 | |
| 252 | if (!LIM_IS_CONNECTION_ACTIVE(psessionEntry)) |
| 253 | { |
| 254 | limLog(pMac, LOGW, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 255 | FL("Received Probe Resp from AP. So it is alive!!")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 256 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 257 | if (pProbeRsp->HTInfo.present) |
| 258 | limReceivedHBHandler(pMac, (tANI_U8)pProbeRsp->HTInfo.primaryChannel, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 259 | else |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 260 | limReceivedHBHandler(pMac, (tANI_U8)pProbeRsp->channelNumber, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 261 | } |
| 262 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 263 | |
| 264 | if (psessionEntry->limSystemRole == eLIM_STA_ROLE) |
| 265 | { |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 266 | if (pProbeRsp->channelSwitchPresent || |
| 267 | pProbeRsp->propIEinfo.propChannelSwitchPresent) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 268 | { |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 269 | limUpdateChannelSwitch(pMac, pProbeRsp, psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 270 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 271 | else if (psessionEntry->gLimSpecMgmt.dot11hChanSwState == eLIM_11H_CHANSW_RUNNING) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 272 | { |
| 273 | limCancelDot11hChannelSwitch(pMac, psessionEntry); |
| 274 | } |
| 275 | } |
| 276 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 277 | |
| 278 | /** |
| 279 | * Now Process EDCA Parameters, if EDCAParamSet count is different. |
| 280 | * -- While processing beacons in link established state if it is determined that |
| 281 | * QoS Info IE has a different count for EDCA Params, |
| 282 | * and EDCA IE is not present in beacon, |
| 283 | * then probe req is sent out to get the EDCA params. |
| 284 | */ |
| 285 | |
| 286 | pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable); |
| 287 | |
| 288 | limGetQosMode(psessionEntry, &qosEnabled); |
| 289 | limGetWmeMode(psessionEntry, &wmeEnabled); |
| 290 | PELOG2(limLog(pMac, LOG2, |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 291 | 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] | 292 | pProbeRsp->wmeEdcaPresent, wmeEnabled, pProbeRsp->edcaPresent, qosEnabled, |
| 293 | pProbeRsp->edcaParams.qosInfo.count, psessionEntry->gLimEdcaParamSetCount);) |
| 294 | if (((pProbeRsp->wmeEdcaPresent && wmeEnabled) || |
| 295 | (pProbeRsp->edcaPresent && qosEnabled)) && |
| 296 | (pProbeRsp->edcaParams.qosInfo.count != psessionEntry->gLimEdcaParamSetCount)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 297 | { |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 298 | if (schBeaconEdcaProcess(pMac, &pProbeRsp->edcaParams, psessionEntry) != eSIR_SUCCESS) |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 299 | PELOGE(limLog(pMac, LOGE, FL("EDCA parameter processing error"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 300 | else if (pStaDs != NULL) |
| 301 | { |
| 302 | // If needed, downgrade the EDCA parameters |
| 303 | limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry); |
| 304 | |
| 305 | if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE) |
| 306 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE); |
| 307 | else |
| 308 | limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE); |
| 309 | } |
| 310 | else |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 311 | PELOGE(limLog(pMac, LOGE, FL("Self Entry missing in Hash Table"));) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 312 | |
| 313 | } |
Gopichand Nakkala | be8653b | 2013-04-10 08:16:05 +0530 | [diff] [blame^] | 314 | |
| 315 | if (psessionEntry->fWaitForProbeRsp == true) |
| 316 | { |
| 317 | limLog(pMac, LOGW, FL("Checking probe response for capability change\n") ); |
| 318 | limDetectChangeInApCapabilities(pMac, pProbeRsp, psessionEntry); |
| 319 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 320 | } |
| 321 | else if ((psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) && |
| 322 | (psessionEntry->limMlmState == eLIM_MLM_BSS_STARTED_STATE)) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 323 | limHandleIBSScoalescing(pMac, pProbeRsp, pRxPacketInfo,psessionEntry); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 324 | } // if ((pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) || ... |
| 325 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 326 | palFreeMemory(pMac->hHdd, pProbeRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 327 | // Ignore Probe Response frame in all other states |
| 328 | return; |
| 329 | } /*** end limProcessProbeRspFrame() ***/ |
| 330 | |
| 331 | |
| 332 | void |
| 333 | limProcessProbeRspFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo) |
| 334 | { |
| 335 | tANI_U8 *pBody; |
| 336 | tANI_U32 frameLen = 0; |
| 337 | tpSirMacMgmtHdr pHdr; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 338 | tSirProbeRespBeacon *pProbeRsp; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 339 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 340 | if(eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd, |
| 341 | (void **)&pProbeRsp, sizeof(tSirProbeRespBeacon))) |
| 342 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 343 | limLog(pMac, LOGE, FL("Unable to PAL allocate memory in limProcessProbeRspFrameNoSession") ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 344 | return; |
| 345 | } |
| 346 | |
| 347 | pProbeRsp->ssId.length = 0; |
| 348 | pProbeRsp->wpa.length = 0; |
| 349 | pProbeRsp->propIEinfo.apName.length = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 350 | |
| 351 | |
| 352 | pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo); |
| 353 | |
| 354 | |
| 355 | limLog(pMac, LOG2, |
| 356 | FL("Received Probe Response frame with length=%d from "), |
| 357 | WDA_GET_RX_MPDU_LEN(pRxPacketInfo)); |
| 358 | limPrintMacAddr(pMac, pHdr->sa, LOG2); |
| 359 | |
| 360 | if (limDeactivateMinChannelTimerDuringScan(pMac) != eSIR_SUCCESS) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 361 | { |
| 362 | palFreeMemory(pMac->hHdd, pProbeRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 363 | return; |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 364 | } |
Leela V Kiran Kumar Reddy Chirala | 6a45875 | 2013-02-16 15:41:27 -0800 | [diff] [blame] | 365 | // Validate IE information before processing Probe Response Frame |
| 366 | if (limValidateIEInformationInProbeRspFrame(pRxPacketInfo) != eSIR_SUCCESS) |
| 367 | { |
| 368 | PELOG1(limLog(pMac, LOG1,FL("Parse error ProbeResponse, length=%d"), |
| 369 | frameLen);) |
| 370 | palFreeMemory(pMac->hHdd, pProbeRsp); |
| 371 | return; |
| 372 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 373 | /* Since there is no psessionEntry, PE cannot be in the following states: |
| 374 | * - eLIM_MLM_WT_JOIN_BEACON_STATE |
| 375 | * - eLIM_MLM_LINK_ESTABLISHED_STATE |
| 376 | * - eLIM_MLM_BSS_STARTED_STATE |
| 377 | * Hence, expect Probe Response only when |
| 378 | * 1. STA is in scan mode waiting for Beacon/Probe response |
| 379 | * |
| 380 | * Ignore Probe Response frame in all other states |
| 381 | */ |
| 382 | if( (pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) || |
| 383 | (pMac->lim.gLimMlmState == eLIM_MLM_PASSIVE_SCAN_STATE) || //mlm state check should be global - 18th oct |
| 384 | (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE) ) |
| 385 | { |
| 386 | frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); |
| 387 | |
| 388 | // Get pointer to Probe Response frame body |
| 389 | pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo); |
| 390 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 391 | if (sirConvertProbeFrame2Struct(pMac, pBody, frameLen, pProbeRsp) == eSIR_FAILURE) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 392 | { |
Kiran Kumar Lokere | 531ca70 | 2013-04-01 13:24:23 -0700 | [diff] [blame] | 393 | limLog(pMac, LOG1, FL("Parse error ProbeResponse, length=%d"), frameLen); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 394 | palFreeMemory(pMac->hHdd, pProbeRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 395 | return; |
| 396 | } |
| 397 | |
| 398 | if( (pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) || |
| 399 | (pMac->lim.gLimMlmState == eLIM_MLM_PASSIVE_SCAN_STATE) ) |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 400 | limCheckAndAddBssDescription(pMac, pProbeRsp, pRxPacketInfo, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 401 | else if (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE) |
| 402 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 403 | } |
| 404 | } |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 405 | palFreeMemory(pMac->hHdd, pProbeRsp); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 406 | return; |
| 407 | } /*** end limProcessProbeRspFrameNew() ***/ |