blob: cced12883dfb1043eb064adaa98c52b373f50e41 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08002 * 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 Johnson32d95a32012-09-10 13:15:23 -070022 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -070023 *
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"
56#ifdef ANI_PRODUCT_TYPE_AP
57#include "wniCfgAp.h"
58#else
59#include "wniCfgSta.h"
60#endif
61#include "aniGlobal.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070062#include "schApi.h"
63#include "utilsApi.h"
64#include "limApi.h"
65#include "limTypes.h"
66#include "limUtils.h"
67#include "limAssocUtils.h"
68#include "limPropExtsUtils.h"
69#include "limSerDesUtils.h"
70#include "limSendMessages.h"
71
72#include "parserApi.h"
73
Leela V Kiran Kumar Reddy Chirala6a458752013-02-16 15:41:27 -080074tSirRetStatus
75limValidateIEInformationInProbeRspFrame (tANI_U8 *pRxPacketInfo)
76{
77 tSirRetStatus status = eSIR_SUCCESS;
78
79 if (WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo) < (SIR_MAC_B_PR_SSID_OFFSET + SIR_MAC_MIN_IE_LEN))
80 {
81 status = eSIR_FAILURE;
82 }
83
84 return status;
85}
86
Jeff Johnson295189b2012-06-20 16:38:30 -070087/**
88 * limProcessProbeRspFrame
89 *
90 *FUNCTION:
91 * This function is called by limProcessMessageQueue() upon
92 * Probe Response frame reception.
93 *
94 *LOGIC:
95 * This function processes received Probe Response frame.
96 *
97 *ASSUMPTIONS:
98 *
99 *NOTE:
100 * 1. Frames with out-of-order IEs are dropped.
101 * 2. In case of IBSS, join 'success' makes MLM state machine
102 * transition into 'BSS started' state. This may have to change
103 * depending on supporting what kinda Authentication in IBSS.
104 *
105 * @param pMac Pointer to Global MAC structure
106 * @param *pRxPacketInfo A pointer to Buffer descriptor + associated PDUs
107 * @return None
108 */
109
110
111void
112limProcessProbeRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession psessionEntry)
113{
114 tANI_U8 *pBody;
115 tANI_U32 frameLen = 0;
116 tSirMacAddr currentBssId;
117 tpSirMacMgmtHdr pHdr;
Jeff Johnson32d95a32012-09-10 13:15:23 -0700118 tSirProbeRespBeacon *pProbeRsp;
Jeff Johnson295189b2012-06-20 16:38:30 -0700119 tANI_U8 qosEnabled = false;
120 tANI_U8 wmeEnabled = false;
121
Jeff Johnson32d95a32012-09-10 13:15:23 -0700122 if(eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd,
123 (void **)&pProbeRsp, sizeof(tSirProbeRespBeacon)))
124 {
125 limLog(pMac, LOGE, FL("Unable to PAL allocate memory in limProcessProbeRspFrame\n") );
126 return;
127 }
128
129 pProbeRsp->ssId.length = 0;
130 pProbeRsp->wpa.length = 0;
131 pProbeRsp->propIEinfo.apName.length = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -0700132#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
Jeff Johnson32d95a32012-09-10 13:15:23 -0700133 pProbeRsp->propIEinfo.aniIndicator = 0;
134 pProbeRsp->propIEinfo.wdsLength = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -0700135#endif
136
137
138 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
139
140
141 PELOG2(limLog(pMac, LOG2,
142 FL("Received Probe Response frame with length=%d from "),
143 WDA_GET_RX_MPDU_LEN(pRxPacketInfo));
144 limPrintMacAddr(pMac, pHdr->sa, LOG2);)
145
146 if (limDeactivateMinChannelTimerDuringScan(pMac) != eSIR_SUCCESS)
Jeff Johnson32d95a32012-09-10 13:15:23 -0700147 {
148 palFreeMemory(pMac->hHdd, pProbeRsp);
149 return;
150 }
Leela V Kiran Kumar Reddy Chirala6a458752013-02-16 15:41:27 -0800151 // Validate IE information before processing Probe Response Frame
152 if (limValidateIEInformationInProbeRspFrame(pRxPacketInfo) != eSIR_SUCCESS)
153 {
154 PELOG1(limLog(pMac, LOG1,
155 FL("Parse error ProbeResponse, length=%d"), frameLen);)
156 palFreeMemory(pMac->hHdd, pProbeRsp);
157 return;
158 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700159
160 /**
161 * Expect Probe Response only when
162 * 1. STA is in scan mode waiting for Beacon/Probe response or
163 * 2. STA is waiting for Beacon/Probe Response to announce
164 * join success or
165 * 3. STA is in IBSS mode in BSS started state or
166 * 4. STA/AP is in learn mode
167 * 5. STA in link established state. In this state, the probe response is
168 * expected for two scenarios:
169 * -- As part of heart beat mechanism, probe req is sent out
170 * -- If QoS Info IE in beacon has a different count for EDCA Params,
171 * and EDCA IE is not present in beacon,
172 * then probe req is sent out to get the EDCA params.
173 *
174 * Ignore Probe Response frame in all other states
175 */
176 // TO SUPPORT BT-AMP
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) || //mlm state check should be global - 18th oct
179 (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE) || //mlm state check should be global - 18th oct
180 (psessionEntry->limMlmState == eLIM_MLM_WT_JOIN_BEACON_STATE) ||
181 (psessionEntry->limMlmState == eLIM_MLM_LINK_ESTABLISHED_STATE) )||
182 ((GET_LIM_SYSTEM_ROLE(psessionEntry) == eLIM_STA_IN_IBSS_ROLE) &&
183 (psessionEntry->limMlmState == eLIM_MLM_BSS_STARTED_STATE)))
184 {
185 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
186
187 // Get pointer to Probe Response frame body
188 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
189
Leela V Kiran Kumar Reddy Chirala6a458752013-02-16 15:41:27 -0800190 if (sirConvertProbeFrame2Struct(pMac, pBody, frameLen, pProbeRsp) == eSIR_FAILURE ||
191 !pProbeRsp->ssidPresent) // Enforce Mandatory IEs
Jeff Johnson295189b2012-06-20 16:38:30 -0700192 {
193 PELOG1(limLog(pMac, LOG1,
Leela V Kiran Kumar Reddy Chirala6a458752013-02-16 15:41:27 -0800194 FL("Parse error ProbeResponse, length=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700195 frameLen);)
Jeff Johnson32d95a32012-09-10 13:15:23 -0700196 palFreeMemory(pMac->hHdd, pProbeRsp);
Jeff Johnson295189b2012-06-20 16:38:30 -0700197 return;
198 }
199 //To Support BT-AMP
200 if ((pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) || //mlm state check should be global - 18th oct
201 (pMac->lim.gLimMlmState == eLIM_MLM_PASSIVE_SCAN_STATE))
Jeff Johnson32d95a32012-09-10 13:15:23 -0700202 limCheckAndAddBssDescription(pMac, pProbeRsp, pRxPacketInfo,
Jeff Johnson295189b2012-06-20 16:38:30 -0700203 ((pMac->lim.gLimHalScanState == eLIM_HAL_SCANNING_STATE) ? eANI_BOOLEAN_TRUE : eANI_BOOLEAN_FALSE), eANI_BOOLEAN_TRUE);
204 else if (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE) //mlm state check should be global - 18th oct
205 {
206#if defined(ANI_PRODUCT_TYPE_AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
207 // STA/AP is in learn mode
208 /* Not sure whether the below 2 lines are needed for the station. TODO If yes, this should be
209 * uncommented. Also when we tested enabling this, there is a crash as soon as the station
210 * comes up which needs to be fixed*/
211 //if (pMac->lim.gLimSystemRole == eLIM_STA_ROLE)
Jeff Johnson32d95a32012-09-10 13:15:23 -0700212 // limCheckAndAddBssDescription(pMac, pProbeRsp, pRxPacketInfo, eANI_BOOLEAN_TRUE);
213 limCollectMeasurementData(pMac, pRxPacketInfo, pProbeRsp);
Jeff Johnson295189b2012-06-20 16:38:30 -0700214 PELOG3(limLog(pMac, LOG3,
215 FL("Parsed WDS info in ProbeRsp frames: wdsLength=%d\n"),
Jeff Johnson32d95a32012-09-10 13:15:23 -0700216 pProbeRsp->propIEinfo.wdsLength);)
Jeff Johnson295189b2012-06-20 16:38:30 -0700217#endif
218 }
219 else if (psessionEntry->limMlmState ==
220 eLIM_MLM_WT_JOIN_BEACON_STATE)
221 {
Jeff Johnson43971f52012-07-17 12:26:56 -0700222 if( psessionEntry->beacon != NULL )//Either Beacon/probe response is required. Hence store it in same buffer.
Jeff Johnson295189b2012-06-20 16:38:30 -0700223 {
224 palFreeMemory(pMac->hHdd, psessionEntry->beacon);
225 psessionEntry->beacon = NULL;
Jeff Johnson43971f52012-07-17 12:26:56 -0700226 }
227 psessionEntry->bcnLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
228 if ((palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->beacon,
229 psessionEntry->bcnLen))
230 != eHAL_STATUS_SUCCESS)
231 {
232 PELOGE(limLog(pMac, LOGE,
233 FL("Unable to allocate memory to store beacon"));)
234 }
235 else
236 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700237 //Store the Beacon/ProbeRsp. This is sent to csr/hdd in join cnf response.
Jeff Johnson43971f52012-07-17 12:26:56 -0700238 palCopyMemory(pMac->hHdd, psessionEntry->beacon,
239 WDA_GET_RX_MPDU_DATA(pRxPacketInfo),
240 psessionEntry->bcnLen);
241 }
242
Jeff Johnson295189b2012-06-20 16:38:30 -0700243 // STA in WT_JOIN_BEACON_STATE
Jeff Johnson32d95a32012-09-10 13:15:23 -0700244 limCheckAndAnnounceJoinSuccess(pMac, pProbeRsp, pHdr, psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -0700245 }
246 else if(psessionEntry->limMlmState == eLIM_MLM_LINK_ESTABLISHED_STATE)
247 {
248 tpDphHashNode pStaDs = NULL;
249 /**
250 * Check if this Probe Response is for
251 * our Probe Request sent upon reaching
252 * heart beat threshold
253 */
254 #if 0
255 if (wlan_cfgGetStr(pMac,
256 WNI_CFG_BSSID,
257 currentBssId,
258 &cfg) != eSIR_SUCCESS)
259 {
260 /// Could not get BSSID from CFG. Log error.
261 limLog(pMac, LOGP, FL("could not retrieve BSSID\n"));
262 }
263 #endif //TO SUPPORT BT-AMP
264 sirCopyMacAddr(currentBssId,psessionEntry->bssId);
265
266 if ( !palEqualMemory( pMac->hHdd,currentBssId, pHdr->bssId, sizeof(tSirMacAddr)) )
Jeff Johnson32d95a32012-09-10 13:15:23 -0700267 {
268 palFreeMemory(pMac->hHdd, pProbeRsp);
Jeff Johnson295189b2012-06-20 16:38:30 -0700269 return;
Jeff Johnson32d95a32012-09-10 13:15:23 -0700270 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700271
272 if (!LIM_IS_CONNECTION_ACTIVE(psessionEntry))
273 {
274 limLog(pMac, LOGW,
275 FL("Received Probe Resp from AP. So it is alive!!\n"));
276
Jeff Johnson32d95a32012-09-10 13:15:23 -0700277 if (pProbeRsp->HTInfo.present)
278 limReceivedHBHandler(pMac, (tANI_U8)pProbeRsp->HTInfo.primaryChannel, psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -0700279 else
Jeff Johnson32d95a32012-09-10 13:15:23 -0700280 limReceivedHBHandler(pMac, (tANI_U8)pProbeRsp->channelNumber, psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -0700281 }
282
283#if defined ANI_PRODUCT_TYPE_CLIENT || defined (ANI_AP_CLIENT_SDK)
284
285 if (psessionEntry->limSystemRole == eLIM_STA_ROLE)
286 {
Jeff Johnson32d95a32012-09-10 13:15:23 -0700287 if (pProbeRsp->channelSwitchPresent ||
288 pProbeRsp->propIEinfo.propChannelSwitchPresent)
Jeff Johnson295189b2012-06-20 16:38:30 -0700289 {
Jeff Johnson32d95a32012-09-10 13:15:23 -0700290 limUpdateChannelSwitch(pMac, pProbeRsp, psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -0700291 }
Jeff Johnsone7245742012-09-05 17:12:55 -0700292 else if (psessionEntry->gLimSpecMgmt.dot11hChanSwState == eLIM_11H_CHANSW_RUNNING)
Jeff Johnson295189b2012-06-20 16:38:30 -0700293 {
294 limCancelDot11hChannelSwitch(pMac, psessionEntry);
295 }
296 }
297
298#endif
299
300 /**
301 * Now Process EDCA Parameters, if EDCAParamSet count is different.
302 * -- While processing beacons in link established state if it is determined that
303 * QoS Info IE has a different count for EDCA Params,
304 * and EDCA IE is not present in beacon,
305 * then probe req is sent out to get the EDCA params.
306 */
307
308 pStaDs = dphGetHashEntry(pMac, DPH_STA_HASH_INDEX_PEER, &psessionEntry->dph.dphHashTable);
309
310 limGetQosMode(psessionEntry, &qosEnabled);
311 limGetWmeMode(psessionEntry, &wmeEnabled);
312 PELOG2(limLog(pMac, LOG2,
313 FL("wmeEdcaPresent: %d wmeEnabled: %d, edcaPresent: %d, qosEnabled: %d, edcaParams.qosInfo.count: %d schObject.gLimEdcaParamSetCount: %d\n"),
Jeff Johnson32d95a32012-09-10 13:15:23 -0700314 pProbeRsp->wmeEdcaPresent, wmeEnabled, pProbeRsp->edcaPresent, qosEnabled,
315 pProbeRsp->edcaParams.qosInfo.count, psessionEntry->gLimEdcaParamSetCount);)
316 if (((pProbeRsp->wmeEdcaPresent && wmeEnabled) ||
317 (pProbeRsp->edcaPresent && qosEnabled)) &&
318 (pProbeRsp->edcaParams.qosInfo.count != psessionEntry->gLimEdcaParamSetCount))
Jeff Johnson295189b2012-06-20 16:38:30 -0700319 {
Jeff Johnson32d95a32012-09-10 13:15:23 -0700320 if (schBeaconEdcaProcess(pMac, &pProbeRsp->edcaParams, psessionEntry) != eSIR_SUCCESS)
Jeff Johnson295189b2012-06-20 16:38:30 -0700321 PELOGE(limLog(pMac, LOGE, FL("EDCA parameter processing error\n"));)
322 else if (pStaDs != NULL)
323 {
324 // If needed, downgrade the EDCA parameters
325 limSetActiveEdcaParams(pMac, psessionEntry->gLimEdcaParams, psessionEntry);
326
327 if (pStaDs->aniPeer == eANI_BOOLEAN_TRUE)
328 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_TRUE);
329 else
330 limSendEdcaParams(pMac, psessionEntry->gLimEdcaParamsActive, pStaDs->bssId, eANI_BOOLEAN_FALSE);
331 }
332 else
333 PELOGE(limLog(pMac, LOGE, FL("Self Entry missing in Hash Table\n"));)
334
335 }
336 }
337 else if ((psessionEntry->limSystemRole == eLIM_STA_IN_IBSS_ROLE) &&
338 (psessionEntry->limMlmState == eLIM_MLM_BSS_STARTED_STATE))
Jeff Johnson32d95a32012-09-10 13:15:23 -0700339 limHandleIBSScoalescing(pMac, pProbeRsp, pRxPacketInfo,psessionEntry);
Jeff Johnson295189b2012-06-20 16:38:30 -0700340 } // if ((pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) || ...
341
Jeff Johnson32d95a32012-09-10 13:15:23 -0700342 palFreeMemory(pMac->hHdd, pProbeRsp);
Jeff Johnson295189b2012-06-20 16:38:30 -0700343 // Ignore Probe Response frame in all other states
344 return;
345} /*** end limProcessProbeRspFrame() ***/
346
347
348void
349limProcessProbeRspFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo)
350{
351 tANI_U8 *pBody;
352 tANI_U32 frameLen = 0;
353 tpSirMacMgmtHdr pHdr;
Jeff Johnson32d95a32012-09-10 13:15:23 -0700354 tSirProbeRespBeacon *pProbeRsp;
Jeff Johnson295189b2012-06-20 16:38:30 -0700355
Jeff Johnson32d95a32012-09-10 13:15:23 -0700356 if(eHAL_STATUS_SUCCESS != palAllocateMemory(pMac->hHdd,
357 (void **)&pProbeRsp, sizeof(tSirProbeRespBeacon)))
358 {
359 limLog(pMac, LOGE, FL("Unable to PAL allocate memory in limProcessProbeRspFrameNoSession\n") );
360 return;
361 }
362
363 pProbeRsp->ssId.length = 0;
364 pProbeRsp->wpa.length = 0;
365 pProbeRsp->propIEinfo.apName.length = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -0700366#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
Jeff Johnson32d95a32012-09-10 13:15:23 -0700367 pProbeRsp->propIEinfo.aniIndicator = 0;
368 pProbeRsp->propIEinfo.wdsLength = 0;
Jeff Johnson295189b2012-06-20 16:38:30 -0700369#endif
370
371
372 pHdr = WDA_GET_RX_MAC_HEADER(pRxPacketInfo);
373
374
375 limLog(pMac, LOG2,
376 FL("Received Probe Response frame with length=%d from "),
377 WDA_GET_RX_MPDU_LEN(pRxPacketInfo));
378 limPrintMacAddr(pMac, pHdr->sa, LOG2);
379
380 if (limDeactivateMinChannelTimerDuringScan(pMac) != eSIR_SUCCESS)
Jeff Johnson32d95a32012-09-10 13:15:23 -0700381 {
382 palFreeMemory(pMac->hHdd, pProbeRsp);
Jeff Johnson295189b2012-06-20 16:38:30 -0700383 return;
Jeff Johnson32d95a32012-09-10 13:15:23 -0700384 }
Leela V Kiran Kumar Reddy Chirala6a458752013-02-16 15:41:27 -0800385 // Validate IE information before processing Probe Response Frame
386 if (limValidateIEInformationInProbeRspFrame(pRxPacketInfo) != eSIR_SUCCESS)
387 {
388 PELOG1(limLog(pMac, LOG1,FL("Parse error ProbeResponse, length=%d"),
389 frameLen);)
390 palFreeMemory(pMac->hHdd, pProbeRsp);
391 return;
392 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700393 /* Since there is no psessionEntry, PE cannot be in the following states:
394 * - eLIM_MLM_WT_JOIN_BEACON_STATE
395 * - eLIM_MLM_LINK_ESTABLISHED_STATE
396 * - eLIM_MLM_BSS_STARTED_STATE
397 * Hence, expect Probe Response only when
398 * 1. STA is in scan mode waiting for Beacon/Probe response
399 *
400 * Ignore Probe Response frame in all other states
401 */
402 if( (pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) ||
403 (pMac->lim.gLimMlmState == eLIM_MLM_PASSIVE_SCAN_STATE) || //mlm state check should be global - 18th oct
404 (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE) )
405 {
406 frameLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
407
408 // Get pointer to Probe Response frame body
409 pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
410
Jeff Johnson32d95a32012-09-10 13:15:23 -0700411 if (sirConvertProbeFrame2Struct(pMac, pBody, frameLen, pProbeRsp) == eSIR_FAILURE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700412 {
413 limLog(pMac, LOG1, FL("Parse error ProbeResponse, length=%d\n"), frameLen);
Jeff Johnson32d95a32012-09-10 13:15:23 -0700414 palFreeMemory(pMac->hHdd, pProbeRsp);
Jeff Johnson295189b2012-06-20 16:38:30 -0700415 return;
416 }
417
418 if( (pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) ||
419 (pMac->lim.gLimMlmState == eLIM_MLM_PASSIVE_SCAN_STATE) )
Jeff Johnson32d95a32012-09-10 13:15:23 -0700420 limCheckAndAddBssDescription(pMac, pProbeRsp, pRxPacketInfo, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE);
Jeff Johnson295189b2012-06-20 16:38:30 -0700421 else if (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE)
422 {
423#if defined(ANI_PRODUCT_TYPE_AP) && (WNI_POLARIS_FW_PACKAGE == ADVANCED)
424 // STA/AP is in learn mode
425 /* Not sure whether the below 2 lines are needed for the station. TODO If yes, this should be
426 * uncommented. Also when we tested enabling this, there is a crash as soon as the station
427 * comes up which needs to be fixed*/
428 //if (pMac->lim.gLimSystemRole == eLIM_STA_ROLE)
Jeff Johnson32d95a32012-09-10 13:15:23 -0700429 // limCheckAndAddBssDescription(pMac, pProbeRsp, pRxPacketInfo, eANI_BOOLEAN_TRUE);
430 limCollectMeasurementData(pMac, pRxPacketInfo, pProbeRsp);
Jeff Johnson295189b2012-06-20 16:38:30 -0700431 limLog(pMac, LOG3,
432 FL("Parsed WDS info in ProbeRsp frames: wdsLength=%d\n"),
Jeff Johnson32d95a32012-09-10 13:15:23 -0700433 pProbeRsp->propIEinfo.wdsLength);
Jeff Johnson295189b2012-06-20 16:38:30 -0700434#endif
435 }
436 }
Jeff Johnson32d95a32012-09-10 13:15:23 -0700437 palFreeMemory(pMac->hHdd, pProbeRsp);
Jeff Johnson295189b2012-06-20 16:38:30 -0700438 return;
439} /*** end limProcessProbeRspFrameNew() ***/