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