blob: 1adc7de2baaab7c8c3049241d565f62dd22309c7 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Satyanarayana Dash6f438272015-03-03 18:01:06 +05302 * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved.
Kiet Lam842dad02014-02-18 18:44:02 -08003 *
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 Nakkala92f07d82013-01-08 21:16:34 -080020 */
Kiet Lam842dad02014-02-18 18:44:02 -080021
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 Nakkala92f07d82013-01-08 21:16:34 -080028/*
Jeff Johnson295189b2012-06-20 16:38:30 -070029 *
Jeff Johnson295189b2012-06-20 16:38:30 -070030 * This file limSmeReqUtils.cc contains the utility functions
31 * for processing SME request messages.
32 * Author: Chandra Modumudi
33 * Date: 02/11/02
34 * History:-
35 * Date Modified by Modification Information
36 * --------------------------------------------------------------------
37 * 05/26/10 js WPA handling in (Re)Assoc frames
Jeff Johnson3c3e1782013-02-27 10:48:42 -080038 *
Jeff Johnson295189b2012-06-20 16:38:30 -070039 */
40
41#include "wniApi.h"
Satyanarayana Dash6f438272015-03-03 18:01:06 +053042#include "wniCfg.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070043#include "cfgApi.h"
44#include "sirApi.h"
45#include "schApi.h"
46#include "utilsApi.h"
47#include "limTypes.h"
48#include "limUtils.h"
49#include "limAssocUtils.h"
50#include "limSecurityUtils.h"
51#include "limSerDesUtils.h"
52
53
54
55/**
56 * limIsRSNieValidInSmeReqMessage()
57 *
58 *FUNCTION:
59 * This function is called to verify if the RSN IE
60 * received in various SME_REQ messages is valid or not
61 *
62 *LOGIC:
63 * RSN IE validity checks are performed in this function
64 *
65 *ASSUMPTIONS:
66 *
67 *NOTE:
68 *
69 * @param pMac Pointer to Global MAC structure
70 * @param pRSNie Pointer to received RSN IE
71 * @return true when RSN IE is valid, false otherwise
72 */
73
74static tANI_U8
75limIsRSNieValidInSmeReqMessage(tpAniSirGlobal pMac, tpSirRSNie pRSNie)
76{
77 tANI_U8 startPos = 0;
78 tANI_U32 privacy, val;
79 int len;
80
81 if (wlan_cfgGetInt(pMac, WNI_CFG_PRIVACY_ENABLED,
82 &privacy) != eSIR_SUCCESS)
83 {
84 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -070085 FL("Unable to retrieve POI from CFG"));
Jeff Johnson295189b2012-06-20 16:38:30 -070086 }
87
88 if (wlan_cfgGetInt(pMac, WNI_CFG_RSN_ENABLED,
89 &val) != eSIR_SUCCESS)
90 {
91 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -070092 FL("Unable to retrieve RSN_ENABLED from CFG"));
Jeff Johnson295189b2012-06-20 16:38:30 -070093 }
94
95 if (pRSNie->length && (!privacy || !val))
96 {
97 // Privacy & RSN not enabled in CFG.
98 /**
99 * In order to allow mixed mode for Guest access
100 * allow BSS creation/join with no Privacy capability
101 * yet advertising WPA IE
102 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700103 PELOG1(limLog(pMac, LOG1, FL("RSN ie len %d but PRIVACY %d RSN %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700104 pRSNie->length, privacy, val);)
105 }
106
107 if (pRSNie->length)
108 {
109 if ((pRSNie->rsnIEdata[0] != DOT11F_EID_RSN) &&
110 (pRSNie->rsnIEdata[0] != DOT11F_EID_WPA)
111#ifdef FEATURE_WLAN_WAPI
112 && (pRSNie->rsnIEdata[0] != DOT11F_EID_WAPI)
113#endif
114 )
115 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700116 limLog(pMac, LOGE, FL("RSN/WPA/WAPI EID %d not [%d || %d]"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700117 pRSNie->rsnIEdata[0], DOT11F_EID_RSN,
118 DOT11F_EID_WPA);
119 return false;
120 }
121
122 len = pRSNie->length;
123 startPos = 0;
124 while(len > 0)
125 {
126 // Check validity of RSN IE
127 if (pRSNie->rsnIEdata[startPos] == DOT11F_EID_RSN)
128 {
129 if((pRSNie->rsnIEdata[startPos+1] > DOT11F_IE_RSN_MAX_LEN) ||
130 (pRSNie->rsnIEdata[startPos+1] < DOT11F_IE_RSN_MIN_LEN))
Gopichand Nakkalacc8cf8e2013-04-25 06:03:10 -0700131 {
132 limLog(pMac, LOGE, FL("RSN IE len %d not [%d,%d]"),
133 pRSNie->rsnIEdata[startPos+1], DOT11F_IE_RSN_MIN_LEN,
134 DOT11F_IE_RSN_MAX_LEN);
135 return false;
136 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700137 }
138 else if(pRSNie->rsnIEdata[startPos] == DOT11F_EID_WPA)
Jeff Johnson295189b2012-06-20 16:38:30 -0700139 {
Gopichand Nakkalacc8cf8e2013-04-25 06:03:10 -0700140 // Check validity of WPA IE
141 if (SIR_MAC_MAX_IE_LENGTH > startPos)
142 {
Kiran Kumar Lokerea328bcd2013-04-22 22:02:05 -0700143 if (startPos <= (SIR_MAC_MAX_IE_LENGTH - sizeof(tANI_U32)))
144 val = sirReadU32((tANI_U8 *) &pRSNie->rsnIEdata[startPos + 2]);
Gopichand Nakkalacc8cf8e2013-04-25 06:03:10 -0700145 if((pRSNie->rsnIEdata[startPos + 1] < DOT11F_IE_WPA_MIN_LEN) ||
146 (pRSNie->rsnIEdata[startPos + 1] > DOT11F_IE_WPA_MAX_LEN) ||
147 (SIR_MAC_WPA_OUI != val))
148 {
149 limLog(pMac, LOGE,
150 FL("WPA IE len %d not [%d,%d] OR data 0x%x not 0x%x"),
151 pRSNie->rsnIEdata[startPos+1], DOT11F_IE_WPA_MIN_LEN,
152 DOT11F_IE_WPA_MAX_LEN, val, SIR_MAC_WPA_OUI);
Jeff Johnson295189b2012-06-20 16:38:30 -0700153
Gopichand Nakkalacc8cf8e2013-04-25 06:03:10 -0700154 return false;
155 }
156 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700157 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700158#ifdef FEATURE_WLAN_WAPI
159 else if(pRSNie->rsnIEdata[startPos] == DOT11F_EID_WAPI)
160 {
161 if((pRSNie->rsnIEdata[startPos+1] > DOT11F_IE_WAPI_MAX_LEN) ||
162 (pRSNie->rsnIEdata[startPos+1] < DOT11F_IE_WAPI_MIN_LEN))
Gopichand Nakkalacc8cf8e2013-04-25 06:03:10 -0700163 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700164 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700165 FL("WAPI IE len %d not [%d,%d]"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700166 pRSNie->rsnIEdata[startPos+1], DOT11F_IE_WAPI_MIN_LEN,
167 DOT11F_IE_WAPI_MAX_LEN);
168
169 return false;
170 }
Gopichand Nakkalacc8cf8e2013-04-25 06:03:10 -0700171 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700172#endif
173 else
Gopichand Nakkalacc8cf8e2013-04-25 06:03:10 -0700174 {
Jeff Johnson295189b2012-06-20 16:38:30 -0700175 //we will never be here, simply for completeness
Gopichand Nakkalacc8cf8e2013-04-25 06:03:10 -0700176 return false;
177 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700178 startPos += 2 + pRSNie->rsnIEdata[startPos+1]; //EID + length field + length
179 len -= startPos;
180 }//while
181
182 }
183
184 return true;
185} /*** end limIsRSNieValidInSmeReqMessage() ***/
186
187/**
188 * limIsAddieValidInSmeReqMessage()
189 *
190 *FUNCTION:
191 * This function is called to verify if the Add IE
192 * received in various SME_REQ messages is valid or not
193 *
194 *LOGIC:
195 * Add IE validity checks are performed on only length
196 *
197 *ASSUMPTIONS:
198 *
199 *NOTE:
200 *
201 * @param pMac Pointer to Global MAC structure
202 * @param pWSCie Pointer to received WSC IE
203 * @return true when WSC IE is valid, false otherwise
204 */
205
206static tANI_U8
207limIsAddieValidInSmeReqMessage(tpAniSirGlobal pMac, tpSirAddie pAddie)
208{
209 int left = pAddie->length;
210 tANI_U8 *ptr = pAddie->addIEdata;
211 tANI_U8 elem_id, elem_len;
212
213 if (left == 0)
214 return true;
215
216 while(left >= 2)
217 {
218 elem_id = ptr[0];
219 elem_len = ptr[1];
220 left -= 2;
221 if(elem_len > left)
222 {
223 limLog( pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700224 FL("****Invalid Add IEs eid = %d elem_len=%d left=%d*****"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700225 elem_id,elem_len,left);
226 return false;
227 }
228
229 left -= elem_len;
230 ptr += (elem_len + 2);
231 }
232 // there shouldn't be any left byte
233
234
235 return true;
236} /*** end limIsAddieValidInSmeReqMessage() ***/
237
Jeff Johnson295189b2012-06-20 16:38:30 -0700238/**
239 * limSetRSNieWPAiefromSmeStartBSSReqMessage()
240 *
241 *FUNCTION:
242 * This function is called to verify if the RSN IE
243 * received in various SME_REQ messages is valid or not
244 *
245 *LOGIC:
246 * RSN IE validity checks are performed in this function
247 *
248 *ASSUMPTIONS:
249 *
250 *NOTE:
251 *
252 * @param pMac Pointer to Global MAC structure
253 * @param pRSNie Pointer to received RSN IE
254 * @return true when RSN IE is valid, false otherwise
255 */
256
257tANI_U8
258limSetRSNieWPAiefromSmeStartBSSReqMessage(tpAniSirGlobal pMac,
259 tpSirRSNie pRSNie,
260 tpPESession pSessionEntry)
261{
262 tANI_U8 wpaIndex = 0;
263 tANI_U32 privacy, val;
264
265 if (wlan_cfgGetInt(pMac, WNI_CFG_PRIVACY_ENABLED,
266 &privacy) != eSIR_SUCCESS)
267 {
268 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700269 FL("Unable to retrieve POI from CFG"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700270 }
271
272 if (wlan_cfgGetInt(pMac, WNI_CFG_RSN_ENABLED,
273 &val) != eSIR_SUCCESS)
274 {
275 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700276 FL("Unable to retrieve RSN_ENABLED from CFG"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700277 }
278
279 if (pRSNie->length && (!privacy || !val))
280 {
281 // Privacy & RSN not enabled in CFG.
282 /**
283 * In order to allow mixed mode for Guest access
284 * allow BSS creation/join with no Privacy capability
285 * yet advertising WPA IE
286 */
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700287 PELOG1(limLog(pMac, LOG1, FL("RSN ie len %d but PRIVACY %d RSN %d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700288 pRSNie->length, privacy, val);)
289 }
290
291 if (pRSNie->length)
292 {
293 if ((pRSNie->rsnIEdata[0] != SIR_MAC_RSN_EID) &&
294 (pRSNie->rsnIEdata[0] != SIR_MAC_WPA_EID))
295 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700296 limLog(pMac, LOGE, FL("RSN/WPA EID %d not [%d || %d]"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700297 pRSNie->rsnIEdata[0], SIR_MAC_RSN_EID,
298 SIR_MAC_WPA_EID);
299 return false;
300 }
301
302 // Check validity of RSN IE
303 if ((pRSNie->rsnIEdata[0] == SIR_MAC_RSN_EID) &&
304#if 0 // Comparison always false
305 (pRSNie->rsnIEdata[1] > SIR_MAC_RSN_IE_MAX_LENGTH) ||
306#endif
307 (pRSNie->rsnIEdata[1] < SIR_MAC_RSN_IE_MIN_LENGTH))
308 {
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700309 limLog(pMac, LOGE, FL("RSN IE len %d not [%d,%d]"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700310 pRSNie->rsnIEdata[1], SIR_MAC_RSN_IE_MIN_LENGTH,
311 SIR_MAC_RSN_IE_MAX_LENGTH);
312 return false;
313 }
314
315 if (pRSNie->length > pRSNie->rsnIEdata[1] + 2)
316 {
317 if (pRSNie->rsnIEdata[0] != SIR_MAC_RSN_EID)
318 {
319 limLog(pMac,
320 LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700321 FL("First byte[%d] in rsnIEdata is not RSN_EID"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700322 pRSNie->rsnIEdata[1]);
323 return false;
324 }
325
326 limLog(pMac,
327 LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700328 FL("WPA IE is present along with WPA2 IE"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700329 wpaIndex = 2 + pRSNie->rsnIEdata[1];
330 }
331 else if ((pRSNie->length == pRSNie->rsnIEdata[1] + 2) &&
332 (pRSNie->rsnIEdata[0] == SIR_MAC_RSN_EID))
333 {
334 limLog(pMac,
335 LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700336 FL("Only RSN IE is present"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700337 dot11fUnpackIeRSN(pMac,&pRSNie->rsnIEdata[2],
Abhinav Kumare58f3bc2018-04-03 12:59:05 +0530338 pRSNie->rsnIEdata[1],
339 &pSessionEntry->gStartBssRSNIe);
340 return true;
Jeff Johnson295189b2012-06-20 16:38:30 -0700341 }
342 else if ((pRSNie->length == pRSNie->rsnIEdata[1] + 2) &&
343 (pRSNie->rsnIEdata[0] == SIR_MAC_WPA_EID))
344 {
345 limLog(pMac,
346 LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700347 FL("Only WPA IE is present"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700348
Abhinav Kumare58f3bc2018-04-03 12:59:05 +0530349 dot11fUnpackIeWPA(pMac,&pRSNie->rsnIEdata[6],
350 pRSNie->rsnIEdata[1] - 4,
351 &pSessionEntry->gStartBssWPAIe);
352 return true;
Jeff Johnson295189b2012-06-20 16:38:30 -0700353 }
354
355 // Check validity of WPA IE
Gopichand Nakkalafa9e2982013-03-29 00:48:18 +0530356 if(wpaIndex +4 < SIR_MAC_MAX_IE_LENGTH )
Jeff Johnson295189b2012-06-20 16:38:30 -0700357 {
Gopichand Nakkalafa9e2982013-03-29 00:48:18 +0530358 val = sirReadU32((tANI_U8 *) &pRSNie->rsnIEdata[wpaIndex + 2]);
Jeff Johnson295189b2012-06-20 16:38:30 -0700359
Gopichand Nakkalafa9e2982013-03-29 00:48:18 +0530360 if ((pRSNie->rsnIEdata[wpaIndex] == SIR_MAC_WPA_EID) &&
361#if 0 // Comparison always false
362 (pRSNie->rsnIEdata[wpaIndex + 1] > SIR_MAC_WPA_IE_MAX_LENGTH) ||
363#endif
364 ((pRSNie->rsnIEdata[wpaIndex + 1] < SIR_MAC_WPA_IE_MIN_LENGTH) ||
365 (SIR_MAC_WPA_OUI != val)))
366 {
367 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700368 FL("WPA IE len %d not [%d,%d] OR data 0x%x not 0x%x"),
Gopichand Nakkalafa9e2982013-03-29 00:48:18 +0530369 pRSNie->rsnIEdata[1], SIR_MAC_RSN_IE_MIN_LENGTH,
370 SIR_MAC_RSN_IE_MAX_LENGTH, val, SIR_MAC_WPA_OUI);
371
372 return false;
373 }
374 else
375 {
376 /* Both RSN and WPA IEs are present */
377 dot11fUnpackIeRSN(pMac,&pRSNie->rsnIEdata[2],
Abhinav Kumare58f3bc2018-04-03 12:59:05 +0530378 pRSNie->rsnIEdata[1], &pSessionEntry->gStartBssRSNIe);
Gopichand Nakkalafa9e2982013-03-29 00:48:18 +0530379
380 dot11fUnpackIeWPA(pMac,&pRSNie->rsnIEdata[wpaIndex + 6],
381 pRSNie->rsnIEdata[wpaIndex + 1]-4,
382 &pSessionEntry->gStartBssWPAIe);
383
384 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700385 }
386 else
387 {
Gopichand Nakkalafa9e2982013-03-29 00:48:18 +0530388 return false;
Jeff Johnson295189b2012-06-20 16:38:30 -0700389 }
390 }
391
392 return true;
393} /*** end limSetRSNieWPAiefromSmeStartBSSReqMessage() ***/
Jeff Johnson295189b2012-06-20 16:38:30 -0700394
Jeff Johnson295189b2012-06-20 16:38:30 -0700395
396
397
398/**
399 * limIsBssDescrValidInSmeReqMessage()
400 *
401 *FUNCTION:
402 * This function is called to verify if the BSS Descr
403 * received in various SME_REQ messages is valid or not
404 *
405 *LOGIC:
406 * BSS Descritipion validity checks are performed in this function
407 *
408 *ASSUMPTIONS:
409 *
410 *NOTE:
411 *
412 * @param pMac Pointer to Global MAC structure
413 * @param pBssDescr Pointer to received Bss Descritipion
414 * @return true when BSS description is valid, false otherwise
415 */
416
417static tANI_U8
418limIsBssDescrValidInSmeReqMessage(tpAniSirGlobal pMac,
419 tpSirBssDescription pBssDescr)
420{
421 tANI_U8 valid = true;
422
423 if (limIsAddrBC(pBssDescr->bssId) ||
424 !pBssDescr->channelId)
425 {
426 valid = false;
427 goto end;
428 }
429
430end:
431 return valid;
432} /*** end limIsBssDescrValidInSmeReqMessage() ***/
Jeff Johnson295189b2012-06-20 16:38:30 -0700433
434
435
436/**
437 * limIsSmeStartReqValid()
438 *
439 *FUNCTION:
440 * This function is called by limProcessSmeReqMessages() upon
441 * receiving SME_START_REQ message from application.
442 *
443 *LOGIC:
444 * Message validity checks are performed in this function
445 *
446 *ASSUMPTIONS:
447 *
448 *NOTE:
449 *
450 * @param pMsg - Pointer to received SME_START_BSS_REQ message
451 * @return true when received SME_START_REQ is formatted correctly
452 * false otherwise
453 */
454
455tANI_U8
456limIsSmeStartReqValid(tpAniSirGlobal pMac, tANI_U32 *pMsg)
457{
458 tANI_U8 valid = true;
459
460 if (((tpSirSmeStartReq) pMsg)->length != sizeof(tSirSmeStartReq))
461 {
462 /**
463 * Invalid length in START_REQ message
464 * Log error.
465 */
466 limLog(pMac, LOGW,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700467 FL("Invalid length %d in eWNI_SME_START_REQ"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700468 ((tpSirSmeStartReq) pMsg)->length);
469
470 valid = false;
471 goto end;
472 }
473
474end:
475 return valid;
476} /*** end limIsSmeStartReqValid() ***/
477
478
479
480/**
481 * limIsSmeStartBssReqValid()
482 *
483 *FUNCTION:
484 * This function is called by limProcessSmeReqMessages() upon
485 * receiving SME_START_BSS_REQ message from application.
486 *
487 *LOGIC:
488 * Message validity checks are performed in this function
489 *
490 *ASSUMPTIONS:
491 *
492 *NOTE:
493 *
494 * @param pMac Pointer to Global MAC structure
495 * @param pStartBssReq Pointer to received SME_START_BSS_REQ message
496 * @return true when received SME_START_BSS_REQ is formatted correctly
497 * false otherwise
498 */
499
500tANI_U8
501limIsSmeStartBssReqValid(tpAniSirGlobal pMac,
502 tpSirSmeStartBssReq pStartBssReq)
503{
504 tANI_U8 i = 0;
505 tANI_U8 valid = true;
506
507 PELOG1(limLog(pMac, LOG1,
Sushant Kaushike0d2cce2014-04-10 14:36:07 +0530508 FL("Parsed START_BSS_REQ fields are bssType=%s (%d), channelId=%d,"
509 " SSID len=%d, rsnIE len=%d, nwType=%d, rateset len=%d"),
510 lim_BssTypetoString(pStartBssReq->bssType),
Jeff Johnson295189b2012-06-20 16:38:30 -0700511 pStartBssReq->bssType,
512 pStartBssReq->channelId,
513 pStartBssReq->ssId.length,
514 pStartBssReq->rsnIE.length,
515 pStartBssReq->nwType,
516 pStartBssReq->operationalRateSet.numRates);)
517
518 switch (pStartBssReq->bssType)
519 {
520 case eSIR_INFRASTRUCTURE_MODE:
Jeff Johnson62c27982013-02-27 17:53:55 -0800521 /**
Jeff Johnson295189b2012-06-20 16:38:30 -0700522 * Should not have received start BSS req with bssType
523 * Infrastructure on STA.
524 * Log error.
525 */
Jeff Johnson62c27982013-02-27 17:53:55 -0800526 limLog(pMac, LOGE,
527 FL("Invalid bssType %d in eWNI_SME_START_BSS_REQ"),
528 pStartBssReq->bssType);
529 valid = false;
530 goto end;
531 break;
Jeff Johnson295189b2012-06-20 16:38:30 -0700532
533 case eSIR_IBSS_MODE:
534 break;
535
536 /* Added for BT AMP support */
537 case eSIR_BTAMP_STA_MODE:
538 break;
539
540 /* Added for BT AMP support */
541 case eSIR_BTAMP_AP_MODE:
542 break;
543
Jeff Johnson295189b2012-06-20 16:38:30 -0700544 /* Added for SoftAP support */
545 case eSIR_INFRA_AP_MODE:
546 break;
Jeff Johnson295189b2012-06-20 16:38:30 -0700547
548 default:
549 /**
550 * Should not have received start BSS req with bssType
551 * other than Infrastructure/IBSS.
552 * Log error
553 */
554 limLog(pMac, LOGW,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700555 FL("Invalid bssType %d in eWNI_SME_START_BSS_REQ"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700556 pStartBssReq->bssType);
557
558 valid = false;
559 goto end;
560 }
561
Jeff Johnson295189b2012-06-20 16:38:30 -0700562 /* This below code is client specific code. TODO */
563 if (pStartBssReq->bssType == eSIR_IBSS_MODE)
564 {
565 if (!pStartBssReq->ssId.length ||
566 (pStartBssReq->ssId.length > SIR_MAC_MAX_SSID_LENGTH))
567 {
568 // Invalid length for SSID.
569 // Reject START_BSS_REQ
570 limLog(pMac, LOGW,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700571 FL("Invalid SSID length in eWNI_SME_START_BSS_REQ"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700572
573 valid = false;
574 goto end;
575 }
576 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700577
Jeff Johnson295189b2012-06-20 16:38:30 -0700578
579 if (!limIsRSNieValidInSmeReqMessage(pMac, &pStartBssReq->rsnIE))
580 {
581 valid = false;
582 goto end;
583 }
584
585 if (pStartBssReq->nwType != eSIR_11A_NW_TYPE &&
586 pStartBssReq->nwType != eSIR_11B_NW_TYPE &&
587 pStartBssReq->nwType != eSIR_11G_NW_TYPE)
588 {
589 valid = false;
590 goto end;
591 }
592
593 if (pStartBssReq->nwType == eSIR_11A_NW_TYPE)
594 {
595 for (i = 0; i < pStartBssReq->operationalRateSet.numRates; i++)
596 if (!sirIsArate(pStartBssReq->operationalRateSet.rate[i] & 0x7F))
597 {
598 // Invalid Operational rates
599 // Reject START_BSS_REQ
600 limLog(pMac, LOGW,
Gopichand Nakkalacc8cf8e2013-04-25 06:03:10 -0700601 FL("Invalid operational rates in eWNI_SME_START_BSS_REQ"));
Mohit Khanna23863762012-09-11 17:40:09 -0700602 sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2,
Jeff Johnson295189b2012-06-20 16:38:30 -0700603 pStartBssReq->operationalRateSet.rate,
604 pStartBssReq->operationalRateSet.numRates);
605
606 valid = false;
607 goto end;
608 }
609 }
610 // check if all the rates in the operatioal rate set are legal 11G rates
611 else if (pStartBssReq->nwType == eSIR_11G_NW_TYPE)
612 {
613 for (i = 0; i < pStartBssReq->operationalRateSet.numRates; i++)
614 if (!sirIsGrate(pStartBssReq->operationalRateSet.rate[i] & 0x7F))
615 {
616 // Invalid Operational rates
617 // Reject START_BSS_REQ
618 limLog(pMac, LOGW,
Gopichand Nakkalacc8cf8e2013-04-25 06:03:10 -0700619 FL("Invalid operational rates in eWNI_SME_START_BSS_REQ"));
Mohit Khanna23863762012-09-11 17:40:09 -0700620 sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2,
Jeff Johnson295189b2012-06-20 16:38:30 -0700621 pStartBssReq->operationalRateSet.rate,
622 pStartBssReq->operationalRateSet.numRates);
623
624 valid = false;
625 goto end;
626 }
627 }
Jeff Johnson62c27982013-02-27 17:53:55 -0800628 else
Jeff Johnson295189b2012-06-20 16:38:30 -0700629 {
630 for (i = 0; i < pStartBssReq->operationalRateSet.numRates; i++)
631 if (!sirIsBrate(pStartBssReq->operationalRateSet.rate[i] & 0x7F))
632 {
633 // Invalid Operational rates
634 // Reject START_BSS_REQ
635 limLog(pMac, LOGW,
Gopichand Nakkalacc8cf8e2013-04-25 06:03:10 -0700636 FL("Invalid operational rates in eWNI_SME_START_BSS_REQ"));
Mohit Khanna23863762012-09-11 17:40:09 -0700637 sirDumpBuf(pMac, SIR_LIM_MODULE_ID, LOG2,
Jeff Johnson295189b2012-06-20 16:38:30 -0700638 pStartBssReq->operationalRateSet.rate,
639 pStartBssReq->operationalRateSet.numRates);
640
641 valid = false;
642 goto end;
643 }
644 }
645
646end:
647 return valid;
648} /*** end limIsSmeStartBssReqValid() ***/
649
650
651
652/**
653 * limIsSmeJoinReqValid()
654 *
655 *FUNCTION:
656 * This function is called by limProcessSmeReqMessages() upon
657 * receiving SME_JOIN_REQ message from application.
658 *
659 *LOGIC:
660 * Message validity checks are performed in this function
661 *
662 *ASSUMPTIONS:
663 *
664 *NOTE:
665 *
666 * @param pMac Pointer to Global MAC structure
667 * @param pJoinReq Pointer to received SME_JOIN_REQ message
668 * @return true when received SME_JOIN_REQ is formatted correctly
669 * false otherwise
670 */
671
672tANI_U8
673limIsSmeJoinReqValid(tpAniSirGlobal pMac, tpSirSmeJoinReq pJoinReq)
674{
675 tANI_U8 valid = true;
676
Jeff Johnson295189b2012-06-20 16:38:30 -0700677
678 if (!limIsRSNieValidInSmeReqMessage(pMac, &pJoinReq->rsnIE))
679 {
680 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700681 FL("received SME_JOIN_REQ with invalid RSNIE"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700682 valid = false;
683 goto end;
684 }
685
686 if (!limIsAddieValidInSmeReqMessage(pMac, &pJoinReq->addIEScan))
687 {
688 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700689 FL("received SME_JOIN_REQ with invalid additional IE for scan"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700690 valid = false;
691 goto end;
692 }
693
694 if (!limIsAddieValidInSmeReqMessage(pMac, &pJoinReq->addIEAssoc))
695 {
696 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700697 FL("received SME_JOIN_REQ with invalid additional IE for assoc"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700698 valid = false;
699 goto end;
700 }
701
702
Jeff Johnson295189b2012-06-20 16:38:30 -0700703 if (!limIsBssDescrValidInSmeReqMessage(pMac,
704 &pJoinReq->bssDescription))
Jeff Johnson295189b2012-06-20 16:38:30 -0700705 {
706 /// Received eWNI_SME_JOIN_REQ with invalid BSS Info
707 // Log the event
708 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700709 FL("received SME_JOIN_REQ with invalid bssInfo"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700710
711 valid = false;
712 goto end;
713 }
714
Jeff Johnsone7245742012-09-05 17:12:55 -0700715 /*
716 Reject Join Req if the Self Mac Address and
717 the Ap's Mac Address is same
718 */
Bansidhar Gopalachari72515da2013-07-11 11:14:27 +0530719 if ( vos_mem_compare( (tANI_U8* ) pJoinReq->selfMacAddr,
Jeff Johnsone7245742012-09-05 17:12:55 -0700720 (tANI_U8 *) pJoinReq->bssDescription.bssId,
721 (tANI_U8) (sizeof(tSirMacAddr))))
722 {
723 // Log the event
724 limLog(pMac, LOGE,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700725 FL("received SME_JOIN_REQ with Self Mac and BSSID Same"));
Jeff Johnsone7245742012-09-05 17:12:55 -0700726
727 valid = false;
728 goto end;
729 }
730
Jeff Johnson295189b2012-06-20 16:38:30 -0700731end:
732 return valid;
733} /*** end limIsSmeJoinReqValid() ***/
734
735
736
737/**
738 * limIsSmeDisassocReqValid()
739 *
740 *FUNCTION:
741 * This function is called by limProcessSmeReqMessages() upon
742 * receiving SME_DISASSOC_REQ message from application.
743 *
744 *LOGIC:
745 * Message validity checks are performed in this function
746 *
747 *ASSUMPTIONS:
748 *
749 *NOTE:
750 *
751 * @param pMac Pointer to Global MAC structure
752 * @param pDisassocReq Pointer to received SME_DISASSOC_REQ message
753 * @return true When received SME_DISASSOC_REQ is formatted
754 * correctly
755 * false otherwise
756 */
757
758tANI_U8
759limIsSmeDisassocReqValid(tpAniSirGlobal pMac,
760 tpSirSmeDisassocReq pDisassocReq, tpPESession psessionEntry)
761{
762 if (limIsGroupAddr(pDisassocReq->peerMacAddr) &&
763 !limIsAddrBC(pDisassocReq->peerMacAddr))
764 return false;
765
Jeff Johnson295189b2012-06-20 16:38:30 -0700766
767 return true;
768} /*** end limIsSmeDisassocReqValid() ***/
769
770
771
772/**
773 * limIsSmeDisassocCnfValid()
774 *
775 *FUNCTION:
776 * This function is called by limProcessSmeReqMessages() upon
777 * receiving SME_DISASSOC_CNF message from application.
778 *
779 *LOGIC:
780 * Message validity checks are performed in this function
781 *
782 *ASSUMPTIONS:
783 *
784 *NOTE:
785 *
786 * @param pMac Pointer to Global MAC structure
787 * @param pDisassocCnf Pointer to received SME_DISASSOC_REQ message
788 * @return true When received SME_DISASSOC_CNF is formatted
789 * correctly
790 * false otherwise
791 */
792
793tANI_U8
794limIsSmeDisassocCnfValid(tpAniSirGlobal pMac,
795 tpSirSmeDisassocCnf pDisassocCnf, tpPESession psessionEntry)
796{
797 if (limIsGroupAddr(pDisassocCnf->peerMacAddr))
798 return false;
799
Jeff Johnson295189b2012-06-20 16:38:30 -0700800 return true;
801} /*** end limIsSmeDisassocCnfValid() ***/
802
803
804
805/**
806 * limIsSmeDeauthReqValid()
807 *
808 *FUNCTION:
809 * This function is called by limProcessSmeReqMessages() upon
810 * receiving SME_DEAUTH_REQ message from application.
811 *
812 *LOGIC:
813 * Message validity checks are performed in this function
814 *
815 *ASSUMPTIONS:
816 *
817 *NOTE:
818 *
819 * @param pMac Pointer to Global MAC structure
820 * @param pDeauthReq Pointer to received SME_DEAUTH_REQ message
821 * @return true When received SME_DEAUTH_REQ is formatted correctly
822 * false otherwise
823 */
824
825tANI_U8
826limIsSmeDeauthReqValid(tpAniSirGlobal pMac, tpSirSmeDeauthReq pDeauthReq, tpPESession psessionEntry)
827{
828 if (limIsGroupAddr(pDeauthReq->peerMacAddr) &&
829 !limIsAddrBC(pDeauthReq->peerMacAddr))
830 return false;
831
Jeff Johnson295189b2012-06-20 16:38:30 -0700832 return true;
833} /*** end limIsSmeDeauthReqValid() ***/
834
835
836
837/**
838 * limIsSmeScanReqValid()
839 *
840 *FUNCTION:
841 * This function is called by limProcessSmeReqMessages() upon
842 * receiving SME_SCAN_REQ message from application.
843 *
844 *LOGIC:
845 * Message validity checks are performed in this function
846 *
847 *ASSUMPTIONS:
848 *
849 *NOTE:
850 *
851 * @param pScanReq Pointer to received SME_SCAN_REQ message
852 * @return true when received SME_SCAN_REQ is formatted correctly
853 * false otherwise
854 */
855
856tANI_U8
857limIsSmeScanReqValid(tpAniSirGlobal pMac, tpSirSmeScanReq pScanReq)
858{
859 tANI_U8 valid = true;
860 tANI_U8 i = 0;
861
Abhishek Singhd9205942015-04-29 14:45:36 +0530862 if (pScanReq->numSsid > SIR_SCAN_MAX_NUM_SSID)
863 {
864 valid = false;
865 limLog(pMac, LOGE, FL("Number of SSIDs > SIR_SCAN_MAX_NUM_SSID"));
866 goto end;
867 }
868
Jeff Johnson295189b2012-06-20 16:38:30 -0700869 for (i = 0; i < pScanReq->numSsid; i++)
870 {
871 if (pScanReq->ssId[i].length > SIR_MAC_MAX_SSID_LENGTH)
872 {
Rashmi Ramanna6c13a342014-01-07 11:44:07 +0530873 limLog(pMac, LOGE,
874 FL("Requested SSID length > SIR_MAC_MAX_SSID_LENGTH"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700875 valid = false;
876 goto end;
877 }
878 }
Abhishek Singhd9205942015-04-29 14:45:36 +0530879 if ((pScanReq->bssType < 0) || (pScanReq->bssType > eSIR_AUTO_MODE))
Rashmi Ramanna6c13a342014-01-07 11:44:07 +0530880 {
881 limLog(pMac, LOGE, FL("Invalid BSS Type"));
882 valid = false;
883 }
884 if (limIsGroupAddr(pScanReq->bssId) && !limIsAddrBC(pScanReq->bssId))
Jeff Johnson295189b2012-06-20 16:38:30 -0700885 {
886 valid = false;
Rashmi Ramanna6c13a342014-01-07 11:44:07 +0530887 limLog(pMac, LOGE, FL("BSSID is group addr and is not Broadcast Addr"));
888 }
889 if (!(pScanReq->scanType == eSIR_PASSIVE_SCAN || pScanReq->scanType == eSIR_ACTIVE_SCAN))
890 {
891 valid = false;
892 limLog(pMac, LOGE, FL("Invalid Scan Type"));
893 }
894 if (pScanReq->channelList.numChannels > SIR_MAX_NUM_CHANNELS)
895 {
896 valid = false;
897 limLog(pMac, LOGE, FL("Number of Channels > SIR_MAX_NUM_CHANNELS"));
Jeff Johnson295189b2012-06-20 16:38:30 -0700898 }
899
900 /*
901 ** check min/max channelTime range
902 **/
903
Rashmi Ramanna6c13a342014-01-07 11:44:07 +0530904 if (valid)
Jeff Johnson295189b2012-06-20 16:38:30 -0700905 {
Rashmi Ramanna6c13a342014-01-07 11:44:07 +0530906 if ((pScanReq->scanType == eSIR_ACTIVE_SCAN) &&
907 (pScanReq->maxChannelTime < pScanReq->minChannelTime))
908 {
909 limLog(pMac, LOGE, FL("Max Channel Time < Min Channel Time"));
910 valid = false;
911 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700912 }
913
914end:
915 return valid;
916} /*** end limIsSmeScanReqValid() ***/
917
918
919
920/**
921 * limIsSmeAuthReqValid()
922 *
923 *FUNCTION:
924 * This function is called by limProcessSmeReqMessages() upon
925 * receiving SME_AUTH_REQ message from application.
926 *
927 *LOGIC:
928 * Message validity checks are performed in this function
929 *
930 *ASSUMPTIONS:
931 *
932 *NOTE:
933 *
934 * @param pAuthReq Pointer to received SME_AUTH_REQ message
935 * @return true when received SME_AUTH_REQ is formatted correctly
936 * false otherwise
937 */
938
939tANI_U8
940limIsSmeAuthReqValid(tpSirSmeAuthReq pAuthReq)
941{
942 tANI_U8 valid = true;
943
944 if (limIsGroupAddr(pAuthReq->peerMacAddr) ||
945 (pAuthReq->authType > eSIR_AUTO_SWITCH) ||
946 !pAuthReq->channelNumber)
947 {
948 valid = false;
949 goto end;
950 }
951
952end:
953 return valid;
954} /*** end limIsSmeAuthReqValid() ***/
955
956
957
958/**
959 * limIsSmeSetContextReqValid()
960 *
961 *FUNCTION:
962 * This function is called by limProcessSmeReqMessages() upon
963 * receiving SME_SET_CONTEXT_REQ message from application.
964 *
965 *LOGIC:
966 * Message validity checks are performed in this function
967 *
968 *ASSUMPTIONS:
969 *
970 *NOTE:
971 *
972 * @param pMsg - Pointer to received SME_SET_CONTEXT_REQ message
973 * @return true when received SME_SET_CONTEXT_REQ is formatted correctly
974 * false otherwise
975 */
976
977tANI_U8
978limIsSmeSetContextReqValid(tpAniSirGlobal pMac, tpSirSmeSetContextReq pSetContextReq)
979{
980 tANI_U8 i = 0;
981 tANI_U8 valid = true;
982 tpSirKeys pKey = pSetContextReq->keyMaterial.key;
983
984 if ((pSetContextReq->keyMaterial.edType != eSIR_ED_WEP40) &&
985 (pSetContextReq->keyMaterial.edType != eSIR_ED_WEP104) &&
986 (pSetContextReq->keyMaterial.edType != eSIR_ED_NONE) &&
987#ifdef FEATURE_WLAN_WAPI
988 (pSetContextReq->keyMaterial.edType != eSIR_ED_WPI) &&
989#endif
990 !pSetContextReq->keyMaterial.numKeys)
991 {
992 /**
993 * No keys present in case of TKIP or CCMP
994 * Log error.
995 */
996 limLog(pMac, LOGW,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -0700997 FL("No keys present in SME_SETCONTEXT_REQ for edType=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700998 pSetContextReq->keyMaterial.edType);
999
1000 valid = false;
1001 goto end;
1002 }
1003
1004 if (pSetContextReq->keyMaterial.numKeys &&
1005 (pSetContextReq->keyMaterial.edType == eSIR_ED_NONE))
1006 {
1007 /**
1008 * Keys present in case of no ED policy
1009 * Log error.
1010 */
1011 limLog(pMac, LOGW,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001012 FL("Keys present in SME_SETCONTEXT_REQ for edType=%d"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001013 pSetContextReq->keyMaterial.edType);
1014
1015 valid = false;
1016 goto end;
1017 }
1018
1019 if (pSetContextReq->keyMaterial.edType >= eSIR_ED_NOT_IMPLEMENTED)
1020 {
1021 /**
1022 * Invalid edType in the message
1023 * Log error.
1024 */
1025 limLog(pMac, LOGW,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001026 FL("Invalid edType=%d in SME_SETCONTEXT_REQ"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001027 pSetContextReq->keyMaterial.edType);
1028
1029 valid = false;
1030 goto end;
1031 }
1032 else if (pSetContextReq->keyMaterial.edType > eSIR_ED_NONE)
1033 {
1034 tANI_U32 poi;
1035
1036 if (wlan_cfgGetInt(pMac, WNI_CFG_PRIVACY_ENABLED,
1037 &poi) != eSIR_SUCCESS)
1038 {
1039 limLog(pMac, LOGP,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001040 FL("Unable to retrieve POI from CFG"));
Jeff Johnson295189b2012-06-20 16:38:30 -07001041 }
1042
1043 if (!poi)
1044 {
1045 /**
1046 * Privacy is not enabled
1047 * In order to allow mixed mode for Guest access
1048 * allow BSS creation/join with no Privacy capability
1049 * yet advertising WPA IE
1050 */
1051 PELOG1(limLog(pMac, LOG1,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001052 FL("Privacy is not enabled, yet non-None EDtype=%d in SME_SETCONTEXT_REQ"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001053 pSetContextReq->keyMaterial.edType);)
1054 }
1055 }
1056
1057 for (i = 0; i < pSetContextReq->keyMaterial.numKeys; i++)
1058 {
1059 if (((pSetContextReq->keyMaterial.edType == eSIR_ED_WEP40) &&
1060 (pKey->keyLength != 5)) ||
1061 ((pSetContextReq->keyMaterial.edType == eSIR_ED_WEP104) &&
1062 (pKey->keyLength != 13)) ||
1063 ((pSetContextReq->keyMaterial.edType == eSIR_ED_TKIP) &&
1064 (pKey->keyLength != 32)) ||
1065#ifdef FEATURE_WLAN_WAPI
1066 ((pSetContextReq->keyMaterial.edType == eSIR_ED_WPI) &&
1067 (pKey->keyLength != 32)) ||
1068#endif
1069 ((pSetContextReq->keyMaterial.edType == eSIR_ED_CCMP) &&
1070 (pKey->keyLength != 16)))
1071 {
1072 /**
1073 * Invalid key length for a given ED type
1074 * Log error.
1075 */
1076 limLog(pMac, LOGW,
Kiran Kumar Lokere5be73a62013-04-01 18:40:00 -07001077 FL("Invalid keyLength =%d for edType=%d in SME_SETCONTEXT_REQ"),
Jeff Johnson295189b2012-06-20 16:38:30 -07001078 pKey->keyLength, pSetContextReq->keyMaterial.edType);
1079
1080 valid = false;
1081 goto end;
1082 }
1083 pKey++;
1084 }
1085
1086end:
1087 return valid;
1088} /*** end limIsSmeSetContextReqValid() ***/
1089
1090
1091
1092/**
1093 * limIsSmeStopBssReqValid()
1094 *
1095 *FUNCTION:
1096 * This function is called by limProcessSmeReqMessages() upon
1097 * receiving SME_STOP_BSS_REQ message from application.
1098 *
1099 *LOGIC:
1100 * Message validity checks are performed in this function
1101 *
1102 *ASSUMPTIONS:
1103 *
1104 *NOTE:
1105 *
1106 * @param pMsg - Pointer to received SME_STOP_BSS_REQ message
1107 * @return true when received SME_STOP_BSS_REQ is formatted correctly
1108 * false otherwise
1109 */
1110
1111tANI_U8
1112limIsSmeStopBssReqValid(tANI_U32 *pMsg)
1113{
1114 tANI_U8 valid = true;
1115
1116 return valid;
1117} /*** end limIsSmeStopBssReqValid() ***/
1118
1119
1120/**
1121 * limGetBssIdFromSmeJoinReqMsg()
1122 *
1123 *FUNCTION:
1124 * This function is called in various places to get BSSID
1125 * from BSS description/Neighbor BSS Info in the SME_JOIN_REQ/
1126 * SME_REASSOC_REQ message.
1127 *
1128 *PARAMS:
1129 *
1130 *LOGIC:
1131 *
1132 *ASSUMPTIONS:
1133 * NA
1134 *
1135 *NOTE:
1136 * NA
1137 *
1138 * @param pBuf - Pointer to received SME_JOIN/SME_REASSOC_REQ
1139 * message
1140 * @return pBssId - Pointer to BSSID
1141 */
1142
1143tANI_U8*
1144limGetBssIdFromSmeJoinReqMsg(tANI_U8 *pBuf)
1145{
1146 if (!pBuf)
1147 return NULL;
1148
1149 pBuf += sizeof(tANI_U32); // skip message header
1150
Jeff Johnson295189b2012-06-20 16:38:30 -07001151
1152 pBuf += limGetU16(pBuf) + sizeof(tANI_U16); // skip RSN IE
1153
Jeff Johnson295189b2012-06-20 16:38:30 -07001154 pBuf += sizeof(tANI_U16); // skip length of BSS description
Jeff Johnson295189b2012-06-20 16:38:30 -07001155
1156 return (pBuf);
1157} /*** end limGetBssIdFromSmeJoinReqMsg() ***/
1158
1159