blob: 180e1717b9040d2b59bad97dfc36c91eaa4f27e2 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Jeff Johnson32d95a32012-09-10 13:15:23 -07002 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -07003 *
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
22/*
23 * Airgo Networks, Inc proprietary. All rights reserved.
24 * This file parserApi.cc contains the code for parsing
25 * 802.11 messages.
26 * Author: Pierre Vandwalle
27 * Date: 03/18/02
28 * History:-
29 * Date Modified by Modification Information
30 * --------------------------------------------------------------------
31 *
32 */
33
34#include "sirApi.h"
35#include "aniGlobal.h"
36#include "parserApi.h"
37#include "cfgApi.h"
38#include "limUtils.h"
39#include "utilsParser.h"
40#include "limSerDesUtils.h"
41#include "schApi.h"
42#include "palApi.h"
43#include "wmmApsd.h"
44#if defined WLAN_FEATURE_VOWIFI
45#include "rrmApi.h"
46#endif
47
48
49
50////////////////////////////////////////////////////////////////////////
51void dot11fLog(tpAniSirGlobal pMac, int loglevel, const char *pString,...)
52{
53#ifdef WLAN_DEBUG
54 if( (tANI_U32)loglevel > pMac->utils.gLogDbgLevel[LOG_INDEX_FOR_MODULE( SIR_DBG_MODULE_ID )] )
55 {
56 return;
57 }
58 else
59 {
60 va_list marker;
61
62 va_start( marker, pString ); /* Initialize variable arguments. */
63
64 logDebug(pMac, SIR_DBG_MODULE_ID, loglevel, pString, marker);
65
66 va_end( marker ); /* Reset variable arguments. */
67 }
68#endif
69}
70
71void
72swapBitField16(tANI_U16 in, tANI_U16 *out)
73{
74# ifdef ANI_LITTLE_BIT_ENDIAN
75 *out = in;
76# else // Big-Endian...
77 *out = ( ( in & 0x8000 ) >> 15 ) |
78 ( ( in & 0x4000 ) >> 13 ) |
79 ( ( in & 0x2000 ) >> 11 ) |
80 ( ( in & 0x1000 ) >> 9 ) |
81 ( ( in & 0x0800 ) >> 7 ) |
82 ( ( in & 0x0400 ) >> 5 ) |
83 ( ( in & 0x0200 ) >> 3 ) |
84 ( ( in & 0x0100 ) >> 1 ) |
85 ( ( in & 0x0080 ) << 1 ) |
86 ( ( in & 0x0040 ) << 3 ) |
87 ( ( in & 0x0020 ) << 5 ) |
88 ( ( in & 0x0010 ) << 7 ) |
89 ( ( in & 0x0008 ) << 9 ) |
90 ( ( in & 0x0004 ) << 11 ) |
91 ( ( in & 0x0002 ) << 13 ) |
92 ( ( in & 0x0001 ) << 15 );
93# endif // ANI_LITTLE_BIT_ENDIAN
94}
95
96void
97swapBitField32(tANI_U32 in, tANI_U32 *out)
98{
99# ifdef ANI_LITTLE_BIT_ENDIAN
100 *out = in;
101# else // Big-Endian...
102 *out = ( ( in & 0x80000000 ) >> 31 ) |
103 ( ( in & 0x40000000 ) >> 29 ) |
104 ( ( in & 0x20000000 ) >> 27 ) |
105 ( ( in & 0x10000000 ) >> 25 ) |
106 ( ( in & 0x08000000 ) >> 23 ) |
107 ( ( in & 0x04000000 ) >> 21 ) |
108 ( ( in & 0x02000000 ) >> 19 ) |
109 ( ( in & 0x01000000 ) >> 17 ) |
110 ( ( in & 0x00800000 ) >> 15 ) |
111 ( ( in & 0x00400000 ) >> 13 ) |
112 ( ( in & 0x00200000 ) >> 11 ) |
113 ( ( in & 0x00100000 ) >> 9 ) |
114 ( ( in & 0x00080000 ) >> 7 ) |
115 ( ( in & 0x00040000 ) >> 5 ) |
116 ( ( in & 0x00020000 ) >> 3 ) |
117 ( ( in & 0x00010000 ) >> 1 ) |
118 ( ( in & 0x00008000 ) << 1 ) |
119 ( ( in & 0x00004000 ) << 3 ) |
120 ( ( in & 0x00002000 ) << 5 ) |
121 ( ( in & 0x00001000 ) << 7 ) |
122 ( ( in & 0x00000800 ) << 9 ) |
123 ( ( in & 0x00000400 ) << 11 ) |
124 ( ( in & 0x00000200 ) << 13 ) |
125 ( ( in & 0x00000100 ) << 15 ) |
126 ( ( in & 0x00000080 ) << 17 ) |
127 ( ( in & 0x00000040 ) << 19 ) |
128 ( ( in & 0x00000020 ) << 21 ) |
129 ( ( in & 0x00000010 ) << 23 ) |
130 ( ( in & 0x00000008 ) << 25 ) |
131 ( ( in & 0x00000004 ) << 27 ) |
132 ( ( in & 0x00000002 ) << 29 ) |
133 ( ( in & 0x00000001 ) << 31 );
134# endif // ANI_LITTLE_BIT_ENDIAN
135}
136
137inline static void __printWMMParams(tpAniSirGlobal pMac, tDot11fIEWMMParams *pWmm)
138{
139 limLog(pMac, LOG1, FL("WMM Parameters Received: \n"));
140 limLog(pMac, LOG1, FL("BE: aifsn %d, acm %d, aci %d, cwmin %d, cwmax %d, txop %d \n"),
141 pWmm->acbe_aifsn, pWmm->acbe_acm, pWmm->acbe_aci, pWmm->acbe_acwmin, pWmm->acbe_acwmax, pWmm->acbe_txoplimit);
142
143 limLog(pMac, LOG1, FL("BK: aifsn %d, acm %d, aci %d, cwmin %d, cwmax %d, txop %d \n"),
144 pWmm->acbk_aifsn, pWmm->acbk_acm, pWmm->acbk_aci, pWmm->acbk_acwmin, pWmm->acbk_acwmax, pWmm->acbk_txoplimit);
145
146 limLog(pMac, LOG1, FL("VI: aifsn %d, acm %d, aci %d, cwmin %d, cwmax %d, txop %d \n"),
147 pWmm->acvi_aifsn, pWmm->acvi_acm, pWmm->acvi_aci, pWmm->acvi_acwmin, pWmm->acvi_acwmax, pWmm->acvi_txoplimit);
148
149 limLog(pMac, LOG1, FL("VO: aifsn %d, acm %d, aci %d, cwmin %d, cwmax %d, txop %d \n"),
150 pWmm->acvo_aifsn, pWmm->acvo_acm, pWmm->acvo_aci, pWmm->acvo_acwmin, pWmm->acvo_acwmax, pWmm->acvo_txoplimit);
151
152 return;
153}
154
155////////////////////////////////////////////////////////////////////////
156// Functions for populating "dot11f" style IEs
157
158
159// return: >= 0, the starting location of the IE in rsnIEdata inside tSirRSNie
160// < 0, cannot find
161int FindIELocation( tpAniSirGlobal pMac,
162 tpSirRSNie pRsnIe,
163 tANI_U8 EID)
164{
165 int idx, ieLen, bytesLeft;
166
167 // Here's what's going on: 'rsnIe' looks like this:
168
169 // typedef struct sSirRSNie
170 // {
171 // tANI_U16 length;
172 // tANI_U8 rsnIEdata[SIR_MAC_MAX_IE_LENGTH+2];
173 // } tSirRSNie, *tpSirRSNie;
174
175 // other code records both the WPA & RSN IEs (including their EIDs &
176 // lengths) into the array 'rsnIEdata'. We may have:
177
178 // With WAPI support, there may be 3 IEs here
179 // It can be only WPA IE, or only RSN IE or only WAPI IE
180 // Or two or all three of them with no particular ordering
181
182 // The if/then/else statements that follow are here to figure out
183 // whether we have the WPA IE, and where it is if we *do* have it.
184
185 //Save the first IE length
186 ieLen = pRsnIe->rsnIEdata[ 1 ] + 2;
187 idx = 0;
188 bytesLeft = pRsnIe->length;
189
190 while( 1 )
191 {
192 if ( EID == pRsnIe->rsnIEdata[ idx ] )
193 {
194 //Found it
195 return (idx);
196 }
197 else if ( EID != pRsnIe->rsnIEdata[ idx ] &&
198 // & if no more IE,
199 bytesLeft <= (tANI_U16)( ieLen ) )
200 {
201 dot11fLog( pMac, LOG3, FL("No IE (%d) in FindIELocation.\n"), EID );
202 return (-1);
203 }
204 bytesLeft -= ieLen;
205 ieLen = pRsnIe->rsnIEdata[ idx + 1 ] + 2;
206 idx += ieLen;
207 }
208
209 return (-1);
210}
211
212
213tSirRetStatus
214PopulateDot11fCapabilities(tpAniSirGlobal pMac,
215 tDot11fFfCapabilities *pDot11f,
216 tpPESession psessionEntry)
217{
218 tANI_U16 cfg;
219 tSirRetStatus nSirStatus;
220
221 nSirStatus = cfgGetCapabilityInfo( pMac, &cfg,psessionEntry );
222 if ( eSIR_SUCCESS != nSirStatus )
223 {
224 dot11fLog( pMac, LOGP, FL("Failed to retrieve the Capabilities b"
225 "itfield from CFG (%d).\n"), nSirStatus );
226 return nSirStatus;
227 }
228
229#if 0
230 if ( sirIsPropCapabilityEnabled( pMac, SIR_MAC_PROP_CAPABILITY_11EQOS ) )
231 {
232 SIR_MAC_CLEAR_CAPABILITY( cfg, QOS );
233 }
234#endif
235 swapBitField16( cfg, ( tANI_U16* )pDot11f );
236
237 return eSIR_SUCCESS;
238} // End PopulateDot11fCapabilities.
239
240tSirRetStatus
241PopulateDot11fCapabilities2(tpAniSirGlobal pMac,
242 tDot11fFfCapabilities *pDot11f,
243 tpDphHashNode pSta,
244 tpPESession psessionEntry)
245{
246 tANI_U16 cfg;
247 tSirRetStatus nSirStatus;
248 nSirStatus = cfgGetCapabilityInfo( pMac, &cfg ,psessionEntry);
249 if ( eSIR_SUCCESS != nSirStatus )
250 {
251 dot11fLog( pMac, LOGP, FL("Failed to retrieve the Capabilities b"
252 "itfield from CFG (%d).\n"), nSirStatus );
253 return nSirStatus;
254 }
255
256 if ( ( NULL != pSta ) && pSta->aniPeer &&
257 PROP_CAPABILITY_GET( 11EQOS, pSta->propCapability ) )
258 {
259 SIR_MAC_CLEAR_CAPABILITY( cfg, QOS );
260 }
261
262 swapBitField16( cfg, ( tANI_U16* )pDot11f );
263
264 return eSIR_SUCCESS;
265
266} // End PopulateDot11fCapabilities2.
267
268void
269PopulateDot11fChanSwitchAnn(tpAniSirGlobal pMac,
Jeff Johnsone7245742012-09-05 17:12:55 -0700270 tDot11fIEChanSwitchAnn *pDot11f,
271 tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -0700272{
Jeff Johnsone7245742012-09-05 17:12:55 -0700273 pDot11f->switchMode = psessionEntry->gLimChannelSwitch.switchMode;
274 pDot11f->newChannel = psessionEntry->gLimChannelSwitch.primaryChannel;
275 pDot11f->switchCount = ( tANI_U8 ) psessionEntry->gLimChannelSwitch.switchCount;
Jeff Johnson295189b2012-06-20 16:38:30 -0700276
277 pDot11f->present = 1;
278} // End PopulateDot11fChanSwitchAnn.
279
280void
281PopulateDot11fExtChanSwitchAnn(tpAniSirGlobal pMac,
Jeff Johnsone7245742012-09-05 17:12:55 -0700282 tDot11fIEExtChanSwitchAnn *pDot11f,
283 tpPESession psessionEntry)
Jeff Johnson295189b2012-06-20 16:38:30 -0700284{
285 //Has to be updated on the cb state basis
286 pDot11f->secondaryChannelOffset =
Jeff Johnsone7245742012-09-05 17:12:55 -0700287 psessionEntry->gLimChannelSwitch.secondarySubBand;
Jeff Johnson295189b2012-06-20 16:38:30 -0700288
289 pDot11f->present = 1;
290}
291
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700292#ifdef WLAN_FEATURE_11AC
293void
294PopulateDot11fWiderBWChanSwitchAnn(tpAniSirGlobal pMac,
295 tDot11fIEWiderBWChanSwitchAnn *pDot11f,
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -0700296 tpPESession psessionEntry)
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -0700297{
298 pDot11f->present = 1;
299 pDot11f->newChanWidth = psessionEntry->gLimWiderBWChannelSwitch.newChanWidth;
300 pDot11f->newCenterChanFreq0 = psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq0;
301 pDot11f->newCenterChanFreq1 = psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq1;
302}
303#endif
304
Jeff Johnson295189b2012-06-20 16:38:30 -0700305tSirRetStatus
306PopulateDot11fCountry(tpAniSirGlobal pMac,
307 tDot11fIECountry *pDot11f,
308 tpPESession psessionEntry)
309{
310 tANI_U32 len, maxlen, codelen;
311 tANI_U16 item;
312 tSirRetStatus nSirStatus;
313 tSirRFBand rfBand;
314 tANI_U8 temp[CFG_MAX_STR_LEN], code[3];
315
316 if (psessionEntry->lim11dEnabled )
317 {
318 limGetRfBand(pMac, &rfBand, psessionEntry);
319 if (rfBand == SIR_BAND_5_GHZ)
320 {
321 item = WNI_CFG_MAX_TX_POWER_5;
322 maxlen = WNI_CFG_MAX_TX_POWER_5_LEN;
323 }
324 else
325 {
326 item = WNI_CFG_MAX_TX_POWER_2_4;
327 maxlen = WNI_CFG_MAX_TX_POWER_2_4_LEN;
328 }
329
330 CFG_GET_STR( nSirStatus, pMac, item, temp, len, maxlen );
331
332 if ( 3 > len )
333 {
334 // no limit on tx power, cannot include the IE because at least
335 // one (channel,num,tx power) must be present
336 return eSIR_SUCCESS;
337 }
338
339 CFG_GET_STR( nSirStatus, pMac, WNI_CFG_COUNTRY_CODE,
340 code, codelen, 3 );
341
342 palCopyMemory( pMac->hHdd, pDot11f->country, code, codelen );
343
344 if(len > MAX_SIZE_OF_TRIPLETS_IN_COUNTRY_IE)
345 {
346 dot11fLog( pMac, LOGE, FL("len:%d is out of bounds, resetting.\n"), len);
347 len = MAX_SIZE_OF_TRIPLETS_IN_COUNTRY_IE;
348 }
349
350 pDot11f->num_triplets = ( tANI_U8 ) ( len / 3 );
351 palCopyMemory( pMac->hHdd, ( tANI_U8* )pDot11f->triplets, temp, len );
352
353 pDot11f->present = 1;
354 }
355
356 return eSIR_SUCCESS;
357} // End PopulateDot11fCountry.
358
359tSirRetStatus
360PopulateDot11fDSParams(tpAniSirGlobal pMac,
361 tDot11fIEDSParams *pDot11f, tANI_U8 channel,
362 tpPESession psessionEntry)
363{
364// tSirRetStatus nSirStatus;
365 tANI_U32 nPhyMode;
366
367 // Get PHY mode and based on that add DS Parameter Set IE
368 limGetPhyMode(pMac, &nPhyMode, psessionEntry);
369
370 if ( WNI_CFG_PHY_MODE_11A != nPhyMode )
371 {
372 // .11b/g mode PHY => Include the DS Parameter Set IE:
373 #if 0
374 CFG_GET_INT( nSirStatus, pMac, WNI_CFG_CURRENT_CHANNEL, cfg );
375 #endif //TO SUPPORT BT-AMP
376 pDot11f->curr_channel = channel;
377 pDot11f->present = 1;
378 }
379
380 return eSIR_SUCCESS;
381} // End PopulateDot11fDSParams.
382
383#define SET_AIFSN(aifsn) (((aifsn) < 2) ? 2 : (aifsn))
384
385
386void
387PopulateDot11fEDCAParamSet(tpAniSirGlobal pMac,
388 tDot11fIEEDCAParamSet *pDot11f,
389 tpPESession psessionEntry)
390{
391
392 if ( psessionEntry->limQosEnabled )
393 {
394 //change to bitwise operation, after this is fixed in frames.
395 pDot11f->qos = (tANI_U8)(0xf0 & (psessionEntry->gLimEdcaParamSetCount << 4) );
396
397 // Fill each EDCA parameter set in order: be, bk, vi, vo
398 pDot11f->acbe_aifsn = ( 0xf & SET_AIFSN(psessionEntry->gLimEdcaParamsBC[0].aci.aifsn) );
399 pDot11f->acbe_acm = ( 0x1 & psessionEntry->gLimEdcaParamsBC[0].aci.acm );
400 pDot11f->acbe_aci = ( 0x3 & SIR_MAC_EDCAACI_BESTEFFORT );
401 pDot11f->acbe_acwmin = ( 0xf & psessionEntry->gLimEdcaParamsBC[0].cw.min );
402 pDot11f->acbe_acwmax = ( 0xf & psessionEntry->gLimEdcaParamsBC[0].cw.max );
403 pDot11f->acbe_txoplimit = psessionEntry->gLimEdcaParamsBC[0].txoplimit;
404
405 pDot11f->acbk_aifsn = ( 0xf & SET_AIFSN(psessionEntry->gLimEdcaParamsBC[1].aci.aifsn) );
406 pDot11f->acbk_acm = ( 0x1 & psessionEntry->gLimEdcaParamsBC[1].aci.acm );
407 pDot11f->acbk_aci = ( 0x3 & SIR_MAC_EDCAACI_BACKGROUND );
408 pDot11f->acbk_acwmin = ( 0xf & psessionEntry->gLimEdcaParamsBC[1].cw.min );
409 pDot11f->acbk_acwmax = ( 0xf & psessionEntry->gLimEdcaParamsBC[1].cw.max );
410 pDot11f->acbk_txoplimit = psessionEntry->gLimEdcaParamsBC[1].txoplimit;
411
412 pDot11f->acvi_aifsn = ( 0xf & SET_AIFSN(psessionEntry->gLimEdcaParamsBC[2].aci.aifsn) );
413 pDot11f->acvi_acm = ( 0x1 & psessionEntry->gLimEdcaParamsBC[2].aci.acm );
414 pDot11f->acvi_aci = ( 0x3 & SIR_MAC_EDCAACI_VIDEO );
415 pDot11f->acvi_acwmin = ( 0xf & psessionEntry->gLimEdcaParamsBC[2].cw.min );
416 pDot11f->acvi_acwmax = ( 0xf & psessionEntry->gLimEdcaParamsBC[2].cw.max );
417 pDot11f->acvi_txoplimit = psessionEntry->gLimEdcaParamsBC[2].txoplimit;
418
419 pDot11f->acvo_aifsn = ( 0xf & SET_AIFSN(psessionEntry->gLimEdcaParamsBC[3].aci.aifsn) );
420 pDot11f->acvo_acm = ( 0x1 & psessionEntry->gLimEdcaParamsBC[3].aci.acm );
421 pDot11f->acvo_aci = ( 0x3 & SIR_MAC_EDCAACI_VOICE );
422 pDot11f->acvo_acwmin = ( 0xf & psessionEntry->gLimEdcaParamsBC[3].cw.min );
423 pDot11f->acvo_acwmax = ( 0xf & psessionEntry->gLimEdcaParamsBC[3].cw.max );
424 pDot11f->acvo_txoplimit = psessionEntry->gLimEdcaParamsBC[3].txoplimit;
425
426 pDot11f->present = 1;
427 }
428
429} // End PopluateDot11fEDCAParamSet.
430
431tSirRetStatus
432PopulateDot11fERPInfo(tpAniSirGlobal pMac,
433 tDot11fIEERPInfo *pDot11f,
434 tpPESession psessionEntry)
435{
436 tSirRetStatus nSirStatus;
437 tANI_U32 val;
438 tSirRFBand rfBand = SIR_BAND_UNKNOWN;
439
440 limGetRfBand(pMac, &rfBand, psessionEntry);
441 if(SIR_BAND_2_4_GHZ == rfBand)
442 {
443 pDot11f->present = 1;
444
445 val = psessionEntry->cfgProtection.fromllb;
446 if(!val ){
447 dot11fLog( pMac, LOGE, FL("11B protection not enabled. Not populating ERP IE %d\n" ),val );
448 return eSIR_SUCCESS;
449 }
450
451 if (psessionEntry->gLim11bParams.protectionEnabled)
452 {
453 pDot11f->non_erp_present = 1;
454 pDot11f->use_prot = 1;
455 }
456
457 if ( psessionEntry->gLimOlbcParams.protectionEnabled )
458 {
459 //FIXME_PROTECTION: we should be setting non_erp present also.
460 //check the test plan first.
461 pDot11f->use_prot = 1;
462 }
463
464
465 if((psessionEntry->gLimNoShortParams.numNonShortPreambleSta)
466 || !psessionEntry->beaconParams.fShortPreamble){
467 pDot11f->barker_preamble = 1;
468
469 }
470 // if protection always flag is set, advertise protection enabled
471 // regardless of legacy stations presence
472 CFG_GET_INT( nSirStatus, pMac, WNI_CFG_11G_PROTECTION_ALWAYS, val );
473
474 if ( val )
475 {
476 pDot11f->use_prot = 1;
477 }
478 }
479
480 return eSIR_SUCCESS;
481} // End PopulateDot11fERPInfo.
482
483tSirRetStatus
484PopulateDot11fExtSuppRates(tpAniSirGlobal pMac, tANI_U8 nChannelNum,
485 tDot11fIEExtSuppRates *pDot11f,
486 tpPESession psessionEntry)
487{
488 tSirRetStatus nSirStatus;
489 tANI_U32 nRates = 0;
490 tANI_U8 rates[WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET_LEN];
491
492 /* Use the ext rates present in session entry whenever nChannelNum is set to OPERATIONAL
493 else use the ext supported rate set from CFG, which is fixed and does not change dynamically and is used for
494 sending mgmt frames (lile probe req) which need to go out before any session is present.
495 */
496 if(POPULATE_DOT11F_RATES_OPERATIONAL == nChannelNum )
497 {
498 if(psessionEntry != NULL)
499 {
500 nRates = psessionEntry->extRateSet.numRates;
501 palCopyMemory(pMac->hHdd, rates, psessionEntry->extRateSet.rate,
502 nRates);
503 }
504 else
505 {
506 dot11fLog( pMac, LOGE, FL("no session context exists while"
507 " populating Operational Rate Set\n"));
508 }
509 }
510 else if ( HIGHEST_24GHZ_CHANNEL_NUM >= nChannelNum )
511 {
512 CFG_GET_STR( nSirStatus, pMac, WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET,
513 rates, nRates, WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET_LEN );
514 }
515
516 if ( 0 != nRates )
517 {
518 pDot11f->num_rates = ( tANI_U8 )nRates;
519 palCopyMemory( pMac->hHdd, pDot11f->rates, rates, nRates );
520 pDot11f->present = 1;
521 }
522
523 return eSIR_SUCCESS;
524
525} // End PopulateDot11fExtSuppRates.
526
527tSirRetStatus
528PopulateDot11fExtSuppRates1(tpAniSirGlobal pMac,
529 tANI_U8 nChannelNum,
530 tDot11fIEExtSuppRates *pDot11f)
531{
532 tANI_U32 nRates;
533 tSirRetStatus nSirStatus;
534 tANI_U8 rates[SIR_MAC_MAX_NUMBER_OF_RATES];
535
536 if ( 14 < nChannelNum )
537 {
538 pDot11f->present = 0;
539 return eSIR_SUCCESS;
540 }
541
542 // N.B. I have *no* idea why we're calling 'wlan_cfgGetStr' with an argument
543 // of WNI_CFG_SUPPORTED_RATES_11A here, but that's what was done
544 // previously & I'm afraid to change it!
545 CFG_GET_STR( nSirStatus, pMac, WNI_CFG_SUPPORTED_RATES_11A,
546 rates, nRates, SIR_MAC_MAX_NUMBER_OF_RATES );
547
548 if ( 0 != nRates )
549 {
550 pDot11f->num_rates = ( tANI_U8 ) nRates;
551 palCopyMemory( pMac->hHdd, pDot11f->rates, rates, nRates );
552 pDot11f->present = 1;
553 }
554
555 return eSIR_SUCCESS;
556} // PopulateDot11fExtSuppRates1.
557
558tSirRetStatus
559PopulateDot11fHTCaps(tpAniSirGlobal pMac,
Jeff Johnsone7245742012-09-05 17:12:55 -0700560 tpPESession psessionEntry,
561 tDot11fIEHTCaps *pDot11f)
Jeff Johnson295189b2012-06-20 16:38:30 -0700562{
563 tANI_U32 nCfgValue, nCfgLen;
564 tANI_U8 nCfgValue8;
565 tSirRetStatus nSirStatus;
566 tSirMacHTParametersInfo *pHTParametersInfo;
567#ifdef WLAN_SOFTAP_FEATURE // this is added for fixing CRs on MDM9K platform - 257951, 259577
568 union {
569 tANI_U16 nCfgValue16;
570 tSirMacHTCapabilityInfo htCapInfo;
571 tSirMacExtendedHTCapabilityInfo extHtCapInfo;
572 } uHTCapabilityInfo;
573#else
574 tANI_U16 nCfgValue16;
575 tSirMacHTCapabilityInfo *pHTCapabilityInfo;
576 tSirMacExtendedHTCapabilityInfo *pExtendedHTCapabilityInfo;
577#endif
578
579 tSirMacTxBFCapabilityInfo *pTxBFCapabilityInfo;
580 tSirMacASCapabilityInfo *pASCapabilityInfo;
581
582 CFG_GET_INT( nSirStatus, pMac, WNI_CFG_HT_CAP_INFO, nCfgValue );
583
584#ifdef WLAN_SOFTAP_FEATURE // this is added for fixing CRs on MDM9K platform - 257951, 259577
585 uHTCapabilityInfo.nCfgValue16 = nCfgValue & 0xFFFF;
586#else
587 nCfgValue16 = ( tANI_U16 ) nCfgValue;
588 pHTCapabilityInfo = ( tSirMacHTCapabilityInfo* ) &nCfgValue16;
589#endif
590
Jeff Johnson295189b2012-06-20 16:38:30 -0700591#ifdef WLAN_SOFTAP_FEATURE // this is added for fixing CRs on MDM9K platform - 257951, 259577
592 pDot11f->advCodingCap = uHTCapabilityInfo.htCapInfo.advCodingCap;
Jeff Johnson295189b2012-06-20 16:38:30 -0700593 pDot11f->mimoPowerSave = uHTCapabilityInfo.htCapInfo.mimoPowerSave;
594 pDot11f->greenField = uHTCapabilityInfo.htCapInfo.greenField;
595 pDot11f->shortGI20MHz = uHTCapabilityInfo.htCapInfo.shortGI20MHz;
596 pDot11f->shortGI40MHz = uHTCapabilityInfo.htCapInfo.shortGI40MHz;
597 pDot11f->txSTBC = uHTCapabilityInfo.htCapInfo.txSTBC;
598 pDot11f->rxSTBC = uHTCapabilityInfo.htCapInfo.rxSTBC;
599 pDot11f->delayedBA = uHTCapabilityInfo.htCapInfo.delayedBA;
600 pDot11f->maximalAMSDUsize = uHTCapabilityInfo.htCapInfo.maximalAMSDUsize;
601 pDot11f->dsssCckMode40MHz = uHTCapabilityInfo.htCapInfo.dsssCckMode40MHz;
602 pDot11f->psmp = uHTCapabilityInfo.htCapInfo.psmp;
603 pDot11f->stbcControlFrame = uHTCapabilityInfo.htCapInfo.stbcControlFrame;
604 pDot11f->lsigTXOPProtection = uHTCapabilityInfo.htCapInfo.lsigTXOPProtection;
605#else
606 pDot11f->advCodingCap = pHTCapabilityInfo->advCodingCap;
Jeff Johnson295189b2012-06-20 16:38:30 -0700607 pDot11f->mimoPowerSave = pHTCapabilityInfo->mimoPowerSave;
608 pDot11f->greenField = pHTCapabilityInfo->greenField;
609 pDot11f->shortGI20MHz = pHTCapabilityInfo->shortGI20MHz;
610 pDot11f->shortGI40MHz = pHTCapabilityInfo->shortGI40MHz;
611 pDot11f->txSTBC = pHTCapabilityInfo->txSTBC;
612 pDot11f->rxSTBC = pHTCapabilityInfo->rxSTBC;
613 pDot11f->delayedBA = pHTCapabilityInfo->delayedBA;
614 pDot11f->maximalAMSDUsize = pHTCapabilityInfo->maximalAMSDUsize;
615 pDot11f->dsssCckMode40MHz = pHTCapabilityInfo->dsssCckMode40MHz;
616 pDot11f->psmp = pHTCapabilityInfo->psmp;
617 pDot11f->stbcControlFrame = pHTCapabilityInfo->stbcControlFrame;
618 pDot11f->lsigTXOPProtection = pHTCapabilityInfo->lsigTXOPProtection;
619#endif
620
Jeff Johnsone7245742012-09-05 17:12:55 -0700621 // All sessionized entries will need the check below
622 if (psessionEntry == NULL) // Only in case of NO session
623 {
624 pDot11f->supportedChannelWidthSet = uHTCapabilityInfo.htCapInfo.supportedChannelWidthSet;
625 }
626 else
627 {
628 pDot11f->supportedChannelWidthSet = psessionEntry->htSupportedChannelWidthSet;
629 }
630
Jeff Johnson295189b2012-06-20 16:38:30 -0700631 /* Ensure that shortGI40MHz is Disabled if supportedChannelWidthSet is
632 eHT_CHANNEL_WIDTH_20MHZ */
633 if(pDot11f->supportedChannelWidthSet == eHT_CHANNEL_WIDTH_20MHZ)
634 {
635 pDot11f->shortGI40MHz = 0;
636 }
637
Mohit Khanna23863762012-09-11 17:40:09 -0700638 dot11fLog(pMac, LOG2, FL("SupportedChnlWidth: %d, mimoPS: %d, GF: %d, shortGI20:%d, shortGI40: %d, dsssCck: %d\n"),
Jeff Johnson295189b2012-06-20 16:38:30 -0700639 pDot11f->supportedChannelWidthSet, pDot11f->mimoPowerSave, pDot11f->greenField,
640 pDot11f->shortGI20MHz, pDot11f->shortGI40MHz, pDot11f->dsssCckMode40MHz);
641
642
643 CFG_GET_INT( nSirStatus, pMac, WNI_CFG_HT_AMPDU_PARAMS, nCfgValue );
644
645 nCfgValue8 = ( tANI_U8 ) nCfgValue;
646 pHTParametersInfo = ( tSirMacHTParametersInfo* ) &nCfgValue8;
647
648 pDot11f->maxRxAMPDUFactor = pHTParametersInfo->maxRxAMPDUFactor;
649 pDot11f->mpduDensity = pHTParametersInfo->mpduDensity;
650 pDot11f->reserved1 = pHTParametersInfo->reserved;
651
Mohit Khanna23863762012-09-11 17:40:09 -0700652 dot11fLog( pMac, LOG2, FL( "AMPDU Param: %x\n" ), nCfgValue);
Jeff Johnson295189b2012-06-20 16:38:30 -0700653
654
655 CFG_GET_STR( nSirStatus, pMac, WNI_CFG_SUPPORTED_MCS_SET,
656 pDot11f->supportedMCSSet, nCfgLen,
657 SIZE_OF_SUPPORTED_MCS_SET );
658
659
660 CFG_GET_INT( nSirStatus, pMac, WNI_CFG_EXT_HT_CAP_INFO, nCfgValue );
661
662#ifdef WLAN_SOFTAP_FEATURE // this is added for fixing CRs on MDM9K platform - 257951, 259577
663 uHTCapabilityInfo.nCfgValue16 = nCfgValue & 0xFFFF;
664
665 pDot11f->pco = uHTCapabilityInfo.extHtCapInfo.pco;
666 pDot11f->transitionTime = uHTCapabilityInfo.extHtCapInfo.transitionTime;
667 pDot11f->mcsFeedback = uHTCapabilityInfo.extHtCapInfo.mcsFeedback;
668
669#else
670 nCfgValue16 = ( tANI_U16 ) nCfgValue ;
671 pExtendedHTCapabilityInfo = ( tSirMacExtendedHTCapabilityInfo* ) &nCfgValue16;
672 pDot11f->pco = pExtendedHTCapabilityInfo->pco;
673 pDot11f->transitionTime = pExtendedHTCapabilityInfo->transitionTime;
674 pDot11f->mcsFeedback = pExtendedHTCapabilityInfo->mcsFeedback;
675#endif
676
677 CFG_GET_INT( nSirStatus, pMac, WNI_CFG_TX_BF_CAP, nCfgValue );
678
679 pTxBFCapabilityInfo = ( tSirMacTxBFCapabilityInfo* ) &nCfgValue;
680 pDot11f->txBF = pTxBFCapabilityInfo->txBF;
681 pDot11f->rxStaggeredSounding = pTxBFCapabilityInfo->rxStaggeredSounding;
682 pDot11f->txStaggeredSounding = pTxBFCapabilityInfo->txStaggeredSounding;
683 pDot11f->rxZLF = pTxBFCapabilityInfo->rxZLF;
684 pDot11f->txZLF = pTxBFCapabilityInfo->txZLF;
685 pDot11f->implicitTxBF = pTxBFCapabilityInfo->implicitTxBF;
686 pDot11f->calibration = pTxBFCapabilityInfo->calibration;
687 pDot11f->explicitCSITxBF = pTxBFCapabilityInfo->explicitCSITxBF;
688 pDot11f->explicitUncompressedSteeringMatrix = pTxBFCapabilityInfo->explicitUncompressedSteeringMatrix;
689 pDot11f->explicitBFCSIFeedback = pTxBFCapabilityInfo->explicitBFCSIFeedback;
690 pDot11f->explicitUncompressedSteeringMatrixFeedback = pTxBFCapabilityInfo->explicitUncompressedSteeringMatrixFeedback;
691 pDot11f->explicitCompressedSteeringMatrixFeedback = pTxBFCapabilityInfo->explicitCompressedSteeringMatrixFeedback;
692 pDot11f->csiNumBFAntennae = pTxBFCapabilityInfo->csiNumBFAntennae;
693 pDot11f->uncompressedSteeringMatrixBFAntennae = pTxBFCapabilityInfo->uncompressedSteeringMatrixBFAntennae;
694 pDot11f->compressedSteeringMatrixBFAntennae = pTxBFCapabilityInfo->compressedSteeringMatrixBFAntennae;
695
696 CFG_GET_INT( nSirStatus, pMac, WNI_CFG_AS_CAP, nCfgValue );
697
698 nCfgValue8 = ( tANI_U8 ) nCfgValue;
699
700 pASCapabilityInfo = ( tSirMacASCapabilityInfo* ) &nCfgValue8;
701 pDot11f->antennaSelection = pASCapabilityInfo->antennaSelection;
702 pDot11f->explicitCSIFeedbackTx = pASCapabilityInfo->explicitCSIFeedbackTx;
703 pDot11f->antennaIndicesFeedbackTx = pASCapabilityInfo->antennaIndicesFeedbackTx;
704 pDot11f->explicitCSIFeedback = pASCapabilityInfo->explicitCSIFeedback;
705 pDot11f->antennaIndicesFeedback = pASCapabilityInfo->antennaIndicesFeedback;
706 pDot11f->rxAS = pASCapabilityInfo->rxAS;
707 pDot11f->txSoundingPPDUs = pASCapabilityInfo->txSoundingPPDUs;
708
709 pDot11f->present = 1;
710
711 return eSIR_SUCCESS;
712
713} // End PopulateDot11fHTCaps.
Jeff Johnsone7245742012-09-05 17:12:55 -0700714#ifdef WLAN_FEATURE_11AC
Jeff Johnson295189b2012-06-20 16:38:30 -0700715
Jeff Johnsone7245742012-09-05 17:12:55 -0700716void limLogVHTCap(tpAniSirGlobal pMac,
717 tDot11fIEVHTCaps *pDot11f)
718{
Madan Mohan Koyyalamudi2208f7b2012-09-28 14:29:07 -0700719#ifdef DUMP_MGMT_CNTNTS
Madan Mohan Koyyalamudi3bd22cd2012-09-24 13:42:49 -0700720 limLog(pMac, LOG1, FL("maxMPDULen (2): %d\n"), pDot11f->maxMPDULen);
721 limLog(pMac, LOG1, FL("supportedChannelWidthSet (2): %d\n"), pDot11f->supportedChannelWidthSet);
722 limLog(pMac, LOG1, FL("ldpcCodingCap (1): %d\n"), pDot11f->ldpcCodingCap);
723 limLog(pMac, LOG1, FL("shortGI80MHz (1): %d\n"), pDot11f->shortGI80MHz);
724 limLog(pMac, LOG1, FL("shortGI160and80plus80MHz (1): %d\n"), pDot11f->shortGI160and80plus80MHz);
725 limLog(pMac, LOG1, FL("txSTBC (1): %d\n"), pDot11f->txSTBC);
726 limLog(pMac, LOG1, FL("rxSTBC (3): %d\n"), pDot11f->rxSTBC);
727 limLog(pMac, LOG1, FL("suBeamFormerCap (1): %d\n"), pDot11f->suBeamFormerCap);
728 limLog(pMac, LOG1, FL("suBeamformeeCap (1): %d\n"), pDot11f->suBeamformeeCap);
729 limLog(pMac, LOG1, FL("csnofBeamformerAntSup (3): %d\n"), pDot11f->csnofBeamformerAntSup);
730 limLog(pMac, LOG1, FL("numSoundingDim (3): %d\n"), pDot11f->numSoundingDim);
731 limLog(pMac, LOG1, FL("muBeamformerCap (1): %d\n"), pDot11f->muBeamformerCap);
732 limLog(pMac, LOG1, FL("muBeamformeeCap (1): %d\n"), pDot11f->muBeamformeeCap);
733 limLog(pMac, LOG1, FL("vhtTXOPPS (1): %d\n"), pDot11f->vhtTXOPPS);
734 limLog(pMac, LOG1, FL("htcVHTCap (1): %d\n"), pDot11f->htcVHTCap);
735 limLog(pMac, LOG1, FL("maxAMPDULenExp (3): %d\n"), pDot11f->maxAMPDULenExp);
736 limLog(pMac, LOG1, FL("vhtLinkAdaptCap (2): %d\n"), pDot11f->vhtLinkAdaptCap);
737 limLog(pMac, LOG1, FL("rxAntPattern (1): %d\n"), pDot11f->vhtLinkAdaptCap);
738 limLog(pMac, LOG1, FL("txAntPattern (1): %d\n"), pDot11f->vhtLinkAdaptCap);
739 limLog(pMac, LOG1, FL("reserved1 (2): %d\n"), pDot11f->reserved1);
740 limLog(pMac, LOG1, FL("rxMCSMap (16): %d\n"), pDot11f->rxMCSMap);
741 limLog(pMac, LOG1, FL("rxHighSupDataRate (13): %d\n"), pDot11f->rxHighSupDataRate);
742 limLog(pMac, LOG1, FL("reserve (3): %d\n"), pDot11f->reserved2);
743 limLog(pMac, LOG1, FL("txMCSMap (16): %d\n"), pDot11f->txMCSMap);
744 limLog(pMac, LOG1, FL("txSupDataRate (13): %d\n"), pDot11f->txSupDataRate);
745 limLog(pMac, LOG1, FL("reserv (3): %d\n"), pDot11f->reserved3);
Madan Mohan Koyyalamudi2208f7b2012-09-28 14:29:07 -0700746#endif /* DUMP_MGMT_CNTNTS */
Jeff Johnsone7245742012-09-05 17:12:55 -0700747}
748
749void limLogVHTOperation(tpAniSirGlobal pMac,
750 tDot11fIEVHTOperation *pDot11f)
751{
Madan Mohan Koyyalamudi2208f7b2012-09-28 14:29:07 -0700752#ifdef DUMP_MGMT_CNTNTS
Madan Mohan Koyyalamudi3bd22cd2012-09-24 13:42:49 -0700753 limLog(pMac, LOG1, FL("chanWidth : %d\n"), pDot11f->chanWidth);
754 limLog(pMac, LOG1, FL("chanCenterFreqSeg1: %d\n"), pDot11f->chanCenterFreqSeg1);
755 limLog(pMac, LOG1, FL("chanCenterFreqSeg2: %d\n"), pDot11f->chanCenterFreqSeg2);
756 limLog(pMac, LOG1, FL("basicMCSSet: %d\n"), pDot11f->basicMCSSet);
Madan Mohan Koyyalamudi2208f7b2012-09-28 14:29:07 -0700757#endif /* DUMP_MGMT_CNTNTS */
Jeff Johnsone7245742012-09-05 17:12:55 -0700758}
759
760void limLogVHTExtBssLoad(tpAniSirGlobal pMac,
761 tDot11fIEVHTExtBssLoad *pDot11f)
762{
Madan Mohan Koyyalamudi2208f7b2012-09-28 14:29:07 -0700763#ifdef DUMP_MGMT_CNTNTS
Madan Mohan Koyyalamudi3bd22cd2012-09-24 13:42:49 -0700764 limLog(pMac, LOG1, FL("muMIMOCapStaCount : %d\n"), pDot11f->muMIMOCapStaCount);
765 limLog(pMac, LOG1, FL("ssUnderUtil: %d\n"), pDot11f->ssUnderUtil);
766 limLog(pMac, LOG1, FL("FortyMHzUtil: %d\n"), pDot11f->FortyMHzUtil);
767 limLog(pMac, LOG1, FL("EightyMHzUtil: %d\n"), pDot11f->EightyMHzUtil);
768 limLog(pMac, LOG1, FL("OneSixtyMHzUtil: %d\n"), pDot11f->OneSixtyMHzUtil);
Madan Mohan Koyyalamudi2208f7b2012-09-28 14:29:07 -0700769#endif /* DUMP_MGMT_CNTNTS */
Jeff Johnsone7245742012-09-05 17:12:55 -0700770}
771
772
Mohit Khanna7d5aeb22012-09-11 16:21:57 -0700773void limLogOperatingMode( tpAniSirGlobal pMac,
774 tDot11fIEOperatingMode *pDot11f)
775{
Madan Mohan Koyyalamudi2208f7b2012-09-28 14:29:07 -0700776#ifdef DUMP_MGMT_CNTNTS
Madan Mohan Koyyalamudi3bd22cd2012-09-24 13:42:49 -0700777 limLog(pMac, LOG1, FL("ChanWidth : %d\n"), pDot11f->chanWidth);
778 limLog(pMac, LOG1, FL("reserved: %d\n"), pDot11f->reserved);
779 limLog(pMac, LOG1, FL("rxNSS: %d\n"), pDot11f->rxNSS);
780 limLog(pMac, LOG1, FL("rxNSS Type: %d\n"), pDot11f->rxNSSType);
Madan Mohan Koyyalamudi2208f7b2012-09-28 14:29:07 -0700781#endif /* DUMP_MGMT_CNTNTS */
Mohit Khanna7d5aeb22012-09-11 16:21:57 -0700782}
783
784
Jeff Johnsone7245742012-09-05 17:12:55 -0700785tSirRetStatus
786PopulateDot11fVHTCaps(tpAniSirGlobal pMac,
787 tDot11fIEVHTCaps *pDot11f)
788{
789 tSirRetStatus nStatus;
790 tANI_U32 nCfgValue=0;
791
792 pDot11f->present = 1;
793
794 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_MAX_MPDU_LENGTH, nCfgValue );
795 pDot11f->maxMPDULen = (nCfgValue & 0x0003);
796
797 nCfgValue = 0;
798 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET,
799 nCfgValue );
800 pDot11f->supportedChannelWidthSet = (nCfgValue & 0x0003);
801
802 nCfgValue = 0;
803 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_LDPC_CODING_CAP, nCfgValue );
804 pDot11f->ldpcCodingCap = (nCfgValue & 0x0001);
805
806 nCfgValue = 0;
807 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_SHORT_GI_80MHZ, nCfgValue );
808 pDot11f->shortGI80MHz= (nCfgValue & 0x0001);
809
810 nCfgValue = 0;
811 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ,
812 nCfgValue );
813 pDot11f->shortGI160and80plus80MHz = (nCfgValue & 0x0001);
814
815 nCfgValue = 0;
816 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_TXSTBC, nCfgValue );
817 pDot11f->txSTBC = (nCfgValue & 0x0001);
818
819 nCfgValue = 0;
820 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_RXSTBC, nCfgValue );
821 pDot11f->rxSTBC = (nCfgValue & 0x0007);
822
823 nCfgValue = 0;
824 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_SU_BEAMFORMER_CAP, nCfgValue );
825 pDot11f->suBeamFormerCap = (nCfgValue & 0x0001);
826
827 nCfgValue = 0;
828 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_SU_BEAMFORMEE_CAP, nCfgValue );
829 pDot11f->suBeamformeeCap = (nCfgValue & 0x0001);
830
831 nCfgValue = 0;
832 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED,
833 nCfgValue );
834 pDot11f->csnofBeamformerAntSup = (nCfgValue & 0x0007);
835
836 nCfgValue = 0;
837 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS,
838 nCfgValue );
839 pDot11f->numSoundingDim = (nCfgValue & 0x0007);
840
841 nCfgValue = 0;
842 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_MU_BEAMFORMER_CAP, nCfgValue );
843 pDot11f->muBeamformerCap = (nCfgValue & 0x0001);
844
845 nCfgValue = 0;
846 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_MU_BEAMFORMEE_CAP, nCfgValue );
847 pDot11f->muBeamformeeCap = (nCfgValue & 0x0001);
848
849 nCfgValue = 0;
850 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_TXOP_PS, nCfgValue );
851 pDot11f->vhtTXOPPS = (nCfgValue & 0x0001);
852
853 nCfgValue = 0;
854 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_HTC_VHTC_CAP, nCfgValue );
855 pDot11f->htcVHTCap = (nCfgValue & 0x0001);
856
857 nCfgValue = 0;
858 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_AMPDU_LEN_EXPONENT, nCfgValue );
859 pDot11f->maxAMPDULenExp = (nCfgValue & 0x0007);
860
861 nCfgValue = 0;
862 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_LINK_ADAPTATION_CAP, nCfgValue );
863 pDot11f->vhtLinkAdaptCap = (nCfgValue & 0x0003);
864
865 nCfgValue = 0;
866 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_RX_ANT_PATTERN, nCfgValue );
867 pDot11f->rxAntPattern = nCfgValue;
868
869 nCfgValue = 0;
870 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_TX_ANT_PATTERN, nCfgValue );
871 pDot11f->txAntPattern = nCfgValue;
872
873 pDot11f->reserved1= 0;
874
875 nCfgValue = 0;
876 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_RX_MCS_MAP, nCfgValue );
877 pDot11f->rxMCSMap = (nCfgValue & 0x0000FFFF);
878
879 nCfgValue = 0;
880 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE,
881 nCfgValue );
882 pDot11f->rxHighSupDataRate = (nCfgValue & 0x00001FFF);
883
884 pDot11f->reserved2= 0;
885
886 nCfgValue = 0;
887 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_TX_MCS_MAP, nCfgValue );
888 pDot11f->txMCSMap = (nCfgValue & 0x0000FFFF);
889
890 nCfgValue = 0;
891 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE,
892 nCfgValue );
893 pDot11f->txSupDataRate = (nCfgValue & 0x00001FFF);
894
895 pDot11f->reserved3= 0;
896
897 limLogVHTCap(pMac, pDot11f);
898
899 return eSIR_SUCCESS;
900
901}
902
903tSirRetStatus
904PopulateDot11fVHTOperation(tpAniSirGlobal pMac,
905 tDot11fIEVHTOperation *pDot11f)
906{
907 tSirRetStatus nStatus;
908 tANI_U32 nCfgValue=0;
909
910 pDot11f->present = 1;
911
912 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_CHANNEL_WIDTH, nCfgValue );
913 pDot11f->chanWidth = (tANI_U8)nCfgValue;
914
915 nCfgValue = 0;
916 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT1,
917 nCfgValue );
918 pDot11f->chanCenterFreqSeg1 = (tANI_U8)nCfgValue;
919
920 nCfgValue = 0;
921 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_CHANNEL_CENTER_FREQ_SEGMENT2,
922 nCfgValue );
923 pDot11f->chanCenterFreqSeg2 = (tANI_U8)nCfgValue;
924
925 nCfgValue = 0;
926 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_BASIC_MCS_SET,nCfgValue );
927 pDot11f->basicMCSSet = (tANI_U16)nCfgValue;
928
929 limLogVHTOperation(pMac,pDot11f);
930
931 return eSIR_SUCCESS;
932
933}
934
935tSirRetStatus
936PopulateDot11fVHTExtBssLoad(tpAniSirGlobal pMac,
937 tDot11fIEVHTExtBssLoad *pDot11f)
938{
939 tSirRetStatus nStatus;
940 tANI_U32 nCfgValue=0;
941
942 pDot11f->present = 1;
943
944 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_MU_MIMO_CAP_STA_COUNT,
945 nCfgValue );
946 pDot11f->muMIMOCapStaCount = (tANI_U8)nCfgValue;
947
948 nCfgValue = 0;
949 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_SS_UNDER_UTIL,nCfgValue );
950 pDot11f->ssUnderUtil = (tANI_U8)nCfgValue;
951
952 nCfgValue=0;
953 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_40MHZ_UTILIZATION,nCfgValue );
954 pDot11f->FortyMHzUtil = (tANI_U8)nCfgValue;
955
956 nCfgValue=0;
957 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_80MHZ_UTILIZATION,nCfgValue );
958 pDot11f->EightyMHzUtil = (tANI_U8)nCfgValue;
959
960 nCfgValue=0;
961 CFG_GET_INT( nStatus, pMac, WNI_CFG_VHT_160MHZ_UTILIZATION,nCfgValue );
962 pDot11f->EightyMHzUtil = (tANI_U8)nCfgValue;
963
964 limLogVHTExtBssLoad(pMac,pDot11f);
965
966 return eSIR_SUCCESS;
967}
968
Mohit Khanna4a70d262012-09-11 16:30:12 -0700969tSirRetStatus
970PopulateDot11fExtCap(tpAniSirGlobal pMac,
971 tDot11fIEExtCap *pDot11f)
972{
973 pDot11f->present = 1;
974 pDot11f->operModeNotification = 1;
975
976 return eSIR_SUCCESS;
977}
978
979tSirRetStatus
980PopulateDot11fOperatingMode(tpAniSirGlobal pMac,
981 tDot11fIEOperatingMode *pDot11f,
982 tpPESession psessionEntry)
983{
984 pDot11f->present = 1;
985
986 pDot11f->chanWidth = psessionEntry->gLimOperatingMode.chanWidth;
987 pDot11f->rxNSS = psessionEntry->gLimOperatingMode.rxNSS;
988 pDot11f->rxNSSType = psessionEntry->gLimOperatingMode.rxNSSType;
989
990 return eSIR_SUCCESS;
991}
Jeff Johnsone7245742012-09-05 17:12:55 -0700992
993#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700994#ifdef WLAN_SOFTAP_FEATURE
995tSirRetStatus
996PopulateDot11fHTInfo(tpAniSirGlobal pMac,
997 tDot11fIEHTInfo *pDot11f,
998 tpPESession psessionEntry )
999#else
1000tSirRetStatus
1001PopulateDot11fHTInfo(tpAniSirGlobal pMac,
1002 tDot11fIEHTInfo *pDot11f)
1003#endif
1004{
1005 tANI_U32 nCfgValue, nCfgLen;
1006 tANI_U8 htInfoField1;
1007 tANI_U16 htInfoField2;
1008 tSirRetStatus nSirStatus;
1009 tSirMacHTInfoField1 *pHTInfoField1;
1010 tSirMacHTInfoField2 *pHTInfoField2;
1011#ifdef WLAN_SOFTAP_FEATURE // this is added for fixing CRs on MDM9K platform - 257951, 259577
1012 union {
1013 tANI_U16 nCfgValue16;
1014 tSirMacHTInfoField3 infoField3;
1015 }uHTInfoField;
1016 union {
1017 tANI_U16 nCfgValue16;
1018 tSirMacHTInfoField2 infoField2;
1019 }uHTInfoField2={0};
1020#else
1021 tANI_U16 htInfoField3;
1022 tSirMacHTInfoField3 *pHTInfoField3;
1023#endif
1024
1025#ifndef WLAN_SOFTAP_FEATURE
1026 tpPESession psessionEntry = &pMac->lim.gpSession[0]; //TBD-RAJESH HOW TO GET sessionEntry?????
1027#endif
1028
1029 #if 0
1030 CFG_GET_INT( nSirStatus, pMac, WNI_CFG_CURRENT_CHANNEL, nCfgValue );
1031 #endif // TO SUPPORT BT-AMP
1032
1033 pDot11f->primaryChannel = psessionEntry->currentOperChannel;
1034
1035 CFG_GET_INT( nSirStatus, pMac, WNI_CFG_HT_INFO_FIELD1, nCfgValue );
1036
1037 htInfoField1 = ( tANI_U8 ) nCfgValue;
1038
1039 pHTInfoField1 = ( tSirMacHTInfoField1* ) &htInfoField1;
Jeff Johnson295189b2012-06-20 16:38:30 -07001040 pHTInfoField1->rifsMode = psessionEntry->beaconParams.fRIFSMode;
1041 pHTInfoField1->serviceIntervalGranularity = pMac->lim.gHTServiceIntervalGranularity;
1042
Jeff Johnsone7245742012-09-05 17:12:55 -07001043 if (psessionEntry == NULL)
1044 {
1045 PELOGE(limLog(pMac, LOG1,
1046 FL("Keep the value retrieved from cfg for secondary channel offset and recommended Tx Width set\n"));)
1047 }
1048 else
1049 {
1050 pHTInfoField1->secondaryChannelOffset = psessionEntry->htSecondaryChannelOffset;
1051 pHTInfoField1->recommendedTxWidthSet = psessionEntry->htRecommendedTxWidthSet;
1052 }
Jeff Johnson295189b2012-06-20 16:38:30 -07001053
1054#ifdef WLAN_SOFTAP_FEATURE
1055 if(psessionEntry->limSystemRole == eLIM_AP_ROLE ){
1056 CFG_GET_INT( nSirStatus, pMac, WNI_CFG_HT_INFO_FIELD2, nCfgValue );
1057
1058 uHTInfoField2.nCfgValue16 = nCfgValue & 0xFFFF; // this is added for fixing CRs on MDM9K platform - 257951, 259577
1059
1060 uHTInfoField2.infoField2.opMode = psessionEntry->htOperMode;
1061 uHTInfoField2.infoField2.nonGFDevicesPresent = psessionEntry->beaconParams.llnNonGFCoexist;
1062 uHTInfoField2.infoField2.obssNonHTStaPresent = psessionEntry->beaconParams.gHTObssMode; /*added for Obss */
1063
1064 uHTInfoField2.infoField2.reserved = 0;
1065
1066 }else{
1067#endif
1068 CFG_GET_INT( nSirStatus, pMac, WNI_CFG_HT_INFO_FIELD2, nCfgValue );
1069
1070 htInfoField2 = ( tANI_U16 ) nCfgValue;
1071
1072 pHTInfoField2 = ( tSirMacHTInfoField2* ) &htInfoField2;
1073 pHTInfoField2->opMode = pMac->lim.gHTOperMode;
1074 pHTInfoField2->nonGFDevicesPresent = pMac->lim.gHTNonGFDevicesPresent;
1075 pHTInfoField2->obssNonHTStaPresent = pMac->lim.gHTObssMode; /*added for Obss */
1076
1077 pHTInfoField2->reserved = 0;
1078#ifdef WLAN_SOFTAP_FEATURE
1079 }
1080#endif
1081
1082 CFG_GET_INT( nSirStatus, pMac, WNI_CFG_HT_INFO_FIELD3, nCfgValue );
1083
1084
1085#ifdef WLAN_SOFTAP_FEATURE // this is added for fixing CRs on MDM9K platform - 257951, 259577
1086 uHTInfoField.nCfgValue16 = nCfgValue & 0xFFFF;
1087
1088
1089 uHTInfoField.infoField3.basicSTBCMCS = pMac->lim.gHTSTBCBasicMCS;
1090 uHTInfoField.infoField3.dualCTSProtection = pMac->lim.gHTDualCTSProtection;
1091 uHTInfoField.infoField3.secondaryBeacon = pMac->lim.gHTSecondaryBeacon;
1092 uHTInfoField.infoField3.lsigTXOPProtectionFullSupport = psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport;
1093 uHTInfoField.infoField3.pcoActive = pMac->lim.gHTPCOActive;
1094 uHTInfoField.infoField3.pcoPhase = pMac->lim.gHTPCOPhase;
1095 uHTInfoField.infoField3.reserved = 0;
1096
1097#else
1098 htInfoField3 = (tANI_U16) nCfgValue;
1099
1100 pHTInfoField3 = ( tSirMacHTInfoField3* ) &htInfoField3;
1101 pHTInfoField3->basicSTBCMCS = pMac->lim.gHTSTBCBasicMCS;
1102 pHTInfoField3->dualCTSProtection = pMac->lim.gHTDualCTSProtection;
1103 pHTInfoField3->secondaryBeacon = pMac->lim.gHTSecondaryBeacon;
1104 pHTInfoField3->lsigTXOPProtectionFullSupport = psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport;
1105 pHTInfoField3->pcoActive = pMac->lim.gHTPCOActive;
1106 pHTInfoField3->pcoPhase = pMac->lim.gHTPCOPhase;
1107 pHTInfoField3->reserved = 0;
1108#endif
1109
1110 pDot11f->secondaryChannelOffset = pHTInfoField1->secondaryChannelOffset;
1111 pDot11f->recommendedTxWidthSet = pHTInfoField1->recommendedTxWidthSet;
1112 pDot11f->rifsMode = pHTInfoField1->rifsMode;
1113 pDot11f->controlledAccessOnly = pHTInfoField1->controlledAccessOnly;
1114 pDot11f->serviceIntervalGranularity = pHTInfoField1->serviceIntervalGranularity;
1115
1116#ifdef WLAN_SOFTAP_FEATURE // this is added for fixing CRs on MDM9K platform - 257951, 259577
1117 pDot11f->opMode = uHTInfoField2.infoField2.opMode;
1118 pDot11f->nonGFDevicesPresent = uHTInfoField2.infoField2.nonGFDevicesPresent;
1119 pDot11f->obssNonHTStaPresent = uHTInfoField2.infoField2.obssNonHTStaPresent;
1120 pDot11f->reserved = uHTInfoField2.infoField2.reserved;
1121
1122#else
1123 pDot11f->opMode = pHTInfoField2->opMode;
1124 pDot11f->nonGFDevicesPresent = pHTInfoField2->nonGFDevicesPresent;
1125 pDot11f->obssNonHTStaPresent = pHTInfoField2->obssNonHTStaPresent;
1126 pDot11f->reserved = pHTInfoField2->reserved;
1127#endif
1128
1129#ifdef WLAN_SOFTAP_FEATURE // this is added for fixing CRs on MDM9K platform - 257951, 259577
1130 pDot11f->basicSTBCMCS = uHTInfoField.infoField3.basicSTBCMCS;
1131 pDot11f->dualCTSProtection = uHTInfoField.infoField3.dualCTSProtection;
1132 pDot11f->secondaryBeacon = uHTInfoField.infoField3.secondaryBeacon;
1133 pDot11f->lsigTXOPProtectionFullSupport = uHTInfoField.infoField3.lsigTXOPProtectionFullSupport;
1134 pDot11f->pcoActive = uHTInfoField.infoField3.pcoActive;
1135 pDot11f->pcoPhase = uHTInfoField.infoField3.pcoPhase;
1136 pDot11f->reserved2 = uHTInfoField.infoField3.reserved;
1137#else
1138 pDot11f->basicSTBCMCS = pHTInfoField3->basicSTBCMCS;
1139 pDot11f->dualCTSProtection = pHTInfoField3->dualCTSProtection;
1140 pDot11f->secondaryBeacon = pHTInfoField3->secondaryBeacon;
1141 pDot11f->lsigTXOPProtectionFullSupport = pHTInfoField3->lsigTXOPProtectionFullSupport;
1142 pDot11f->pcoActive = pHTInfoField3->pcoActive;
1143 pDot11f->pcoPhase = pHTInfoField3->pcoPhase;
1144 pDot11f->reserved2 = pHTInfoField3->reserved;
1145#endif
1146 CFG_GET_STR( nSirStatus, pMac, WNI_CFG_BASIC_MCS_SET,
1147 pDot11f->basicMCSSet, nCfgLen,
1148 SIZE_OF_BASIC_MCS_SET );
1149
1150 pDot11f->present = 1;
1151
1152 return eSIR_SUCCESS;
1153
1154} // End PopulateDot11fHTInfo.
1155
1156void
1157PopulateDot11fIBSSParams(tpAniSirGlobal pMac,
1158 tDot11fIEIBSSParams *pDot11f, tpPESession psessionEntry)
1159{
1160 if ( eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole )
1161 {
1162 pDot11f->present = 1;
1163 // ATIM duration is always set to 0
1164 pDot11f->atim = 0;
1165 }
1166
1167} // End PopulateDot11fIBSSParams.
1168
1169
1170#ifdef ANI_SUPPORT_11H
1171tSirRetStatus
1172PopulateDot11fMeasurementReport0(tpAniSirGlobal pMac,
1173 tpSirMacMeasReqActionFrame pReq,
1174 tDot11fIEMeasurementReport *pDot11f)
1175{
1176 pDot11f->token = pReq->measReqIE.measToken;
1177 pDot11f->late = 0;
1178 pDot11f->incapable = 0;
1179 pDot11f->refused = 1;
1180 pDot11f->type = SIR_MAC_BASIC_MEASUREMENT_TYPE;
1181
1182 pDot11f->present = 1;
1183
1184 return eSIR_SUCCESS;
1185
1186} // End PopulatedDot11fMeasurementReport0.
1187
1188tSirRetStatus
1189PopulateDot11fMeasurementReport1(tpAniSirGlobal pMac,
1190 tpSirMacMeasReqActionFrame pReq,
1191 tDot11fIEMeasurementReport *pDot11f)
1192{
1193 pDot11f->token = pReq->measReqIE.measToken;
1194 pDot11f->late = 0;
1195 pDot11f->incapable = 0;
1196 pDot11f->refused = 1;
1197 pDot11f->type = SIR_MAC_CCA_MEASUREMENT_TYPE;
1198
1199 pDot11f->present = 1;
1200
1201 return eSIR_SUCCESS;
1202
1203} // End PopulatedDot11fMeasurementReport1.
1204
1205tSirRetStatus
1206PopulateDot11fMeasurementReport2(tpAniSirGlobal pMac,
1207 tpSirMacMeasReqActionFrame pReq,
1208 tDot11fIEMeasurementReport *pDot11f)
1209{
1210 pDot11f->token = pReq->measReqIE.measToken;
1211 pDot11f->late = 0;
1212 pDot11f->incapable = 0;
1213 pDot11f->refused = 1;
1214 pDot11f->type = SIR_MAC_RPI_MEASUREMENT_TYPE;
1215
1216 pDot11f->present = 1;
1217
1218 return eSIR_SUCCESS;
1219
1220} // End PopulatedDot11fMeasurementReport2.
1221#endif
1222
1223void
1224PopulateDot11fPowerCaps(tpAniSirGlobal pMac,
1225 tDot11fIEPowerCaps *pCaps,
1226 tANI_U8 nAssocType,
1227 tpPESession psessionEntry)
1228{
1229 if (nAssocType == LIM_REASSOC)
1230 {
1231 pCaps->minTxPower = psessionEntry->pLimReAssocReq->powerCap.minTxPower;
1232 pCaps->maxTxPower = psessionEntry->pLimReAssocReq->powerCap.maxTxPower;
1233 }else
1234 {
1235 pCaps->minTxPower = psessionEntry->pLimJoinReq->powerCap.minTxPower;
1236 pCaps->maxTxPower = psessionEntry->pLimJoinReq->powerCap.maxTxPower;
1237
1238 }
1239
1240 pCaps->present = 1;
1241} // End PopulateDot11fPowerCaps.
1242
1243tSirRetStatus
1244PopulateDot11fPowerConstraints(tpAniSirGlobal pMac,
1245 tDot11fIEPowerConstraints *pDot11f)
1246{
1247 tANI_U32 cfg;
1248 tSirRetStatus nSirStatus;
1249
1250 CFG_GET_INT( nSirStatus, pMac, WNI_CFG_LOCAL_POWER_CONSTRAINT, cfg );
1251
1252 pDot11f->localPowerConstraints = ( tANI_U8 )cfg;
1253 pDot11f->present = 1;
1254
1255 return eSIR_SUCCESS;
1256} // End PopulateDot11fPowerConstraints.
1257
1258void
1259PopulateDot11fQOSCapsAp(tpAniSirGlobal pMac,
1260 tDot11fIEQOSCapsAp *pDot11f, tpPESession psessionEntry)
1261{
1262 pDot11f->count = psessionEntry->gLimEdcaParamSetCount;
1263 pDot11f->reserved = 0;
1264 pDot11f->txopreq = 0;
1265 pDot11f->qreq = 0;
1266 pDot11f->qack = 0;
1267 pDot11f->present = 1;
1268} // End PopulatedDot11fQOSCaps.
1269
1270void
1271PopulateDot11fQOSCapsStation(tpAniSirGlobal pMac,
1272 tDot11fIEQOSCapsStation *pDot11f)
1273{
1274 tANI_U32 val = 0;
1275
1276 if(wlan_cfgGetInt(pMac, WNI_CFG_MAX_SP_LENGTH, &val) != eSIR_SUCCESS)
1277 PELOGE(limLog(pMac, LOGE, FL("could not retrieve Max SP Length \n"));)
1278
1279 pDot11f->more_data_ack = 0;
1280 pDot11f->max_sp_length = (tANI_U8)val;
1281 pDot11f->qack = 0;
1282
1283 if (pMac->lim.gUapsdEnable)
1284 {
1285 pDot11f->acbe_uapsd = LIM_UAPSD_GET(ACBE, pMac->lim.gUapsdPerAcBitmask);
1286 pDot11f->acbk_uapsd = LIM_UAPSD_GET(ACBK, pMac->lim.gUapsdPerAcBitmask);
1287 pDot11f->acvi_uapsd = LIM_UAPSD_GET(ACVI, pMac->lim.gUapsdPerAcBitmask);
1288 pDot11f->acvo_uapsd = LIM_UAPSD_GET(ACVO, pMac->lim.gUapsdPerAcBitmask);
1289 }
1290 pDot11f->present = 1;
1291} // End PopulatedDot11fQOSCaps.
1292
1293tSirRetStatus
1294PopulateDot11fRSN(tpAniSirGlobal pMac,
1295 tpSirRSNie pRsnIe,
1296 tDot11fIERSN *pDot11f)
1297{
1298 tANI_U32 status;
1299 int idx;
1300
1301 if ( pRsnIe->length )
1302 {
1303 if( 0 <= ( idx = FindIELocation( pMac, pRsnIe, DOT11F_EID_RSN ) ) )
1304 {
1305 status = dot11fUnpackIeRSN( pMac,
1306 pRsnIe->rsnIEdata + idx + 2, //EID, length
1307 pRsnIe->rsnIEdata[ idx + 1 ],
1308 pDot11f );
1309 if ( DOT11F_FAILED( status ) )
1310 {
1311 dot11fLog( pMac, LOGE, FL("Parse failure in PopulateDot11fRS"
1312 "N (0x%08x).\n"),
1313 status );
1314 return eSIR_FAILURE;
1315 }
1316 dot11fLog( pMac, LOG2, FL("dot11fUnpackIeRSN returned 0x%08x in "
1317 "PopulateDot11fRSN.\n"), status );
1318 }
1319
1320 }
1321
1322 return eSIR_SUCCESS;
1323} // End PopulateDot11fRSN.
1324
1325tSirRetStatus PopulateDot11fRSNOpaque( tpAniSirGlobal pMac,
1326 tpSirRSNie pRsnIe,
1327 tDot11fIERSNOpaque *pDot11f )
1328{
1329 int idx;
1330
1331 if ( pRsnIe->length )
1332 {
1333 if( 0 <= ( idx = FindIELocation( pMac, pRsnIe, DOT11F_EID_RSN ) ) )
1334 {
1335 pDot11f->present = 1;
1336 pDot11f->num_data = pRsnIe->rsnIEdata[ idx + 1 ];
1337 palCopyMemory( pMac->hHdd, pDot11f->data,
1338 pRsnIe->rsnIEdata + idx + 2, // EID, len
1339 pRsnIe->rsnIEdata[ idx + 1 ] );
1340 }
1341 }
1342
1343 return eSIR_SUCCESS;
1344
1345} // End PopulateDot11fRSNOpaque.
1346
1347
1348
1349#if defined(FEATURE_WLAN_WAPI)
1350
1351tSirRetStatus
1352PopulateDot11fWAPI(tpAniSirGlobal pMac,
1353 tpSirRSNie pRsnIe,
1354 tDot11fIEWAPI *pDot11f)
1355 {
1356 tANI_U32 status;
1357 int idx;
1358
1359 if ( pRsnIe->length )
1360 {
1361 if( 0 <= ( idx = FindIELocation( pMac, pRsnIe, DOT11F_EID_WAPI ) ) )
1362 {
1363 status = dot11fUnpackIeWAPI( pMac,
1364 pRsnIe->rsnIEdata + idx + 2, //EID, length
1365 pRsnIe->rsnIEdata[ idx + 1 ],
1366 pDot11f );
1367 if ( DOT11F_FAILED( status ) )
1368 {
1369 dot11fLog( pMac, LOGE, FL("Parse failure in PopulateDot11fWAPI (0x%08x).\n"),
1370 status );
1371 return eSIR_FAILURE;
1372 }
1373 dot11fLog( pMac, LOG2, FL("dot11fUnpackIeRSN returned 0x%08x in "
1374 "PopulateDot11fWAPI.\n"), status );
1375 }
1376 }
1377
1378 return eSIR_SUCCESS;
1379} // End PopulateDot11fWAPI.
1380
1381tSirRetStatus PopulateDot11fWAPIOpaque( tpAniSirGlobal pMac,
1382 tpSirRSNie pRsnIe,
1383 tDot11fIEWAPIOpaque *pDot11f )
1384{
1385 int idx;
1386
1387 if ( pRsnIe->length )
1388 {
1389 if( 0 <= ( idx = FindIELocation( pMac, pRsnIe, DOT11F_EID_WAPI ) ) )
1390 {
1391 pDot11f->present = 1;
1392 pDot11f->num_data = pRsnIe->rsnIEdata[ idx + 1 ];
1393 palCopyMemory( pMac->hHdd, pDot11f->data,
1394 pRsnIe->rsnIEdata + idx + 2, // EID, len
1395 pRsnIe->rsnIEdata[ idx + 1 ] );
1396 }
1397 }
1398
1399 return eSIR_SUCCESS;
1400
1401} // End PopulateDot11fWAPIOpaque.
1402
1403
1404#endif //defined(FEATURE_WLAN_WAPI)
1405
1406void
1407PopulateDot11fSSID(tpAniSirGlobal pMac,
1408 tSirMacSSid *pInternal,
1409 tDot11fIESSID *pDot11f)
1410{
1411 pDot11f->present = 1;
1412 pDot11f->num_ssid = pInternal->length;
1413 if ( pInternal->length )
1414 {
1415 palCopyMemory( pMac->hHdd, ( tANI_U8* )pDot11f->ssid, ( tANI_U8* )&pInternal->ssId,
1416 pInternal->length );
1417 }
1418} // End PopulateDot11fSSID.
1419
1420tSirRetStatus
1421PopulateDot11fSSID2(tpAniSirGlobal pMac,
1422 tDot11fIESSID *pDot11f)
1423{
1424 tANI_U32 nCfg;
1425 tSirRetStatus nSirStatus;
1426
1427 CFG_GET_STR( nSirStatus, pMac, WNI_CFG_SSID, pDot11f->ssid, nCfg, 32 );
1428 pDot11f->num_ssid = ( tANI_U8 )nCfg;
1429 pDot11f->present = 1;
1430 return eSIR_SUCCESS;
1431} // End PopulateDot11fSSID2.
1432
1433void
1434PopulateDot11fSchedule(tSirMacScheduleIE *pSchedule,
1435 tDot11fIESchedule *pDot11f)
1436{
1437 pDot11f->aggregation = pSchedule->info.aggregation;
1438 pDot11f->tsid = pSchedule->info.tsid;
1439 pDot11f->direction = pSchedule->info.direction;
1440 pDot11f->reserved = pSchedule->info.rsvd;
1441 pDot11f->service_start_time = pSchedule->svcStartTime;
1442 pDot11f->service_interval = pSchedule->svcInterval;
1443 pDot11f->max_service_dur = pSchedule->maxSvcDuration;
1444 pDot11f->spec_interval = pSchedule->specInterval;
1445
1446 pDot11f->present = 1;
1447} // End PopulateDot11fSchedule.
1448
1449void
1450PopulateDot11fSuppChannels(tpAniSirGlobal pMac,
1451 tDot11fIESuppChannels *pDot11f,
1452 tANI_U8 nAssocType,
1453 tpPESession psessionEntry)
1454{
1455 tANI_U8 i;
1456 tANI_U8 *p;
1457
1458 if (nAssocType == LIM_REASSOC)
1459 {
1460 p = ( tANI_U8* )psessionEntry->pLimReAssocReq->supportedChannels.channelList;
1461 pDot11f->num_bands = psessionEntry->pLimReAssocReq->supportedChannels.numChnl;
1462 }else
1463 {
1464 p = ( tANI_U8* )psessionEntry->pLimJoinReq->supportedChannels.channelList;
1465 pDot11f->num_bands = psessionEntry->pLimJoinReq->supportedChannels.numChnl;
1466 }
1467 for ( i = 0U; i < pDot11f->num_bands; ++i, ++p)
1468 {
1469 pDot11f->bands[i][0] = *p;
1470 pDot11f->bands[i][1] = 1;
1471 }
1472
1473 pDot11f->present = 1;
1474
1475} // End PopulateDot11fSuppChannels.
1476
1477tSirRetStatus
1478PopulateDot11fSuppRates(tpAniSirGlobal pMac,
1479 tANI_U8 nChannelNum,
1480 tDot11fIESuppRates *pDot11f,tpPESession psessionEntry)
1481{
1482 tSirRetStatus nSirStatus;
1483 tANI_U32 nRates;
1484 tANI_U8 rates[SIR_MAC_MAX_NUMBER_OF_RATES];
1485
1486 /* Use the operational rates present in session entry whenever nChannelNum is set to OPERATIONAL
1487 else use the supported rate set from CFG, which is fixed and does not change dynamically and is used for
1488 sending mgmt frames (lile probe req) which need to go out before any session is present.
1489 */
1490 if(POPULATE_DOT11F_RATES_OPERATIONAL == nChannelNum )
1491 {
1492 #if 0
1493 CFG_GET_STR( nSirStatus, pMac, WNI_CFG_OPERATIONAL_RATE_SET,
1494 rates, nRates, SIR_MAC_MAX_NUMBER_OF_RATES );
1495 #endif //TO SUPPORT BT-AMP
1496 if(psessionEntry != NULL)
1497 {
1498 nRates = psessionEntry->rateSet.numRates;
1499 palCopyMemory(pMac->hHdd, rates, psessionEntry->rateSet.rate,
1500 nRates);
1501 }
1502 else
1503 {
1504 dot11fLog( pMac, LOGE, FL("no session context exists while populating Operational Rate Set\n"));
1505 nRates = 0;
1506 }
1507 }
1508 else if ( 14 >= nChannelNum )
1509 {
1510 CFG_GET_STR( nSirStatus, pMac, WNI_CFG_SUPPORTED_RATES_11B,
1511 rates, nRates, SIR_MAC_MAX_NUMBER_OF_RATES );
1512 }
1513 else
1514 {
1515 CFG_GET_STR( nSirStatus, pMac, WNI_CFG_SUPPORTED_RATES_11A,
1516 rates, nRates, SIR_MAC_MAX_NUMBER_OF_RATES );
1517 }
1518
1519 if ( 0 != nRates )
1520 {
1521 pDot11f->num_rates = ( tANI_U8 )nRates;
1522 palCopyMemory( pMac->hHdd, pDot11f->rates, rates, nRates );
1523 pDot11f->present = 1;
1524 }
1525
1526 return eSIR_SUCCESS;
1527
1528} // End PopulateDot11fSuppRates.
1529
1530tSirRetStatus
1531PopulateDot11fTPCReport(tpAniSirGlobal pMac,
1532 tDot11fIETPCReport *pDot11f,
1533 tpPESession psessionEntry)
1534{
1535 tANI_U16 staid, txPower;
1536 tSirRetStatus nSirStatus;
1537
1538 nSirStatus = limGetMgmtStaid( pMac, &staid, psessionEntry);
1539 if ( eSIR_SUCCESS != nSirStatus )
1540 {
1541 dot11fLog( pMac, LOG1, FL("Failed to get the STAID in Populat"
1542 "eDot11fTPCReport; limGetMgmtStaid "
1543 "returned status %d.\n"),
1544 nSirStatus );
1545 return eSIR_FAILURE;
1546 }
1547
1548 // FramesToDo: This function was "misplaced" in the move to Gen4_TVM...
1549 // txPower = halGetRateToPwrValue( pMac, staid, pMac->lim.gLimCurrentChannelId, isBeacon );
1550 txPower = 0;
1551 pDot11f->tx_power = ( tANI_U8 )txPower;
1552 pDot11f->link_margin = 0;
1553 pDot11f->present = 1;
1554
1555 return eSIR_SUCCESS;
1556} // End PopulateDot11fTPCReport.
1557
1558
1559void PopulateDot11fTSInfo(tSirMacTSInfo *pInfo,
1560 tDot11fFfTSInfo *pDot11f)
1561{
1562 pDot11f->traffic_type = pInfo->traffic.trafficType;
1563 pDot11f->tsid = pInfo->traffic.tsid;
1564 pDot11f->direction = pInfo->traffic.direction;
1565 pDot11f->access_policy = pInfo->traffic.accessPolicy;
1566 pDot11f->aggregation = pInfo->traffic.aggregation;
1567 pDot11f->psb = pInfo->traffic.psb;
1568 pDot11f->user_priority = pInfo->traffic.userPrio;
1569 pDot11f->tsinfo_ack_pol = pInfo->traffic.ackPolicy;
1570 pDot11f->schedule = pInfo->schedule.schedule;
1571} // End PopulatedDot11fTSInfo.
1572
1573void PopulateDot11fWMM(tpAniSirGlobal pMac,
1574 tDot11fIEWMMInfoAp *pInfo,
1575 tDot11fIEWMMParams *pParams,
1576 tDot11fIEWMMCaps *pCaps,
1577 tpPESession psessionEntry)
1578{
1579 if ( psessionEntry->limWmeEnabled )
1580 {
1581 if ( eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole )
1582 {
1583 //if ( ! sirIsPropCapabilityEnabled( pMac, SIR_MAC_PROP_CAPABILITY_WME ) )
1584 {
1585 PopulateDot11fWMMInfoAp( pMac, pInfo, psessionEntry );
1586 }
1587 }
1588 else
1589 {
1590 {
1591 PopulateDot11fWMMParams( pMac, pParams, psessionEntry);
1592 }
1593
1594 if ( psessionEntry->limWsmEnabled )
1595 {
1596 PopulateDot11fWMMCaps( pCaps );
1597 }
1598 }
1599 }
1600} // End PopulateDot11fWMM.
1601
1602void PopulateDot11fWMMCaps(tDot11fIEWMMCaps *pCaps)
1603{
1604 pCaps->version = SIR_MAC_OUI_VERSION_1;
1605 pCaps->qack = 0;
1606 pCaps->queue_request = 1;
1607 pCaps->txop_request = 0;
1608 pCaps->more_ack = 0;
1609 pCaps->present = 1;
1610} // End PopulateDot11fWmmCaps.
1611
1612#ifdef FEATURE_WLAN_CCX
1613void PopulateDot11fReAssocTspec(tpAniSirGlobal pMac, tDot11fReAssocRequest *pReassoc, tpPESession psessionEntry)
1614{
1615 tANI_U8 numTspecs = 0, idx;
1616 tTspecInfo *pTspec = NULL;
1617
1618 numTspecs = psessionEntry->pLimReAssocReq->ccxTspecInfo.numTspecs;
1619 pTspec = &psessionEntry->pLimReAssocReq->ccxTspecInfo.tspec[0];
1620 pReassoc->num_WMMTSPEC = numTspecs;
1621 if (numTspecs) {
1622 for (idx=0; idx<numTspecs; idx++) {
1623 PopulateDot11fWMMTSPEC(&pTspec->tspec, &pReassoc->WMMTSPEC[idx]);
1624 pTspec++;
1625 }
1626 }
1627}
1628#endif
1629
1630void PopulateDot11fWMMInfoAp(tpAniSirGlobal pMac, tDot11fIEWMMInfoAp *pInfo,
1631 tpPESession psessionEntry)
1632{
1633 pInfo->version = SIR_MAC_OUI_VERSION_1;
1634
1635 /* WMM Specification 3.1.3, 3.2.3
1636 * An IBSS staion shall always use its default WMM parameters.
1637 */
1638 if ( eLIM_STA_IN_IBSS_ROLE == psessionEntry->limSystemRole )
1639 {
1640 pInfo->param_set_count = 0;
1641 pInfo->uapsd = 0;
1642 }
1643 else
1644 {
1645 pInfo->param_set_count = ( 0xf & psessionEntry->gLimEdcaParamSetCount );
1646#ifdef WLAN_SOFTAP_FEATURE
1647 if(psessionEntry->limSystemRole == eLIM_AP_ROLE ){
1648 pInfo->uapsd = ( 0x1 & psessionEntry->apUapsdEnable );
1649 }
1650 else
1651#endif
1652 pInfo->uapsd = ( 0x1 & pMac->lim.gUapsdEnable );
1653 }
1654 pInfo->present = 1;
1655}
1656
1657void PopulateDot11fWMMInfoStation(tpAniSirGlobal pMac, tDot11fIEWMMInfoStation *pInfo)
1658{
1659 tANI_U32 val = 0;
1660
1661 pInfo->version = SIR_MAC_OUI_VERSION_1;
1662 pInfo->acvo_uapsd = LIM_UAPSD_GET(ACVO, pMac->lim.gUapsdPerAcBitmask);
1663 pInfo->acvi_uapsd = LIM_UAPSD_GET(ACVI, pMac->lim.gUapsdPerAcBitmask);
1664 pInfo->acbk_uapsd = LIM_UAPSD_GET(ACBK, pMac->lim.gUapsdPerAcBitmask);
1665 pInfo->acbe_uapsd = LIM_UAPSD_GET(ACBE, pMac->lim.gUapsdPerAcBitmask);
1666
1667 if(wlan_cfgGetInt(pMac, WNI_CFG_MAX_SP_LENGTH, &val) != eSIR_SUCCESS)
1668 PELOGE(limLog(pMac, LOGE, FL("could not retrieve Max SP Length \n"));)
1669
1670 pInfo->max_sp_length = (tANI_U8)val;
1671 pInfo->present = 1;
1672}
1673
1674#ifdef WLAN_SOFTAP_FEATURE
1675void PopulateDot11fWMMParams(tpAniSirGlobal pMac,
1676 tDot11fIEWMMParams *pParams,
1677 tpPESession psessionEntry)
1678#else
1679void PopulateDot11fWMMParams(tpAniSirGlobal pMac,
1680 tDot11fIEWMMParams *pParams)
1681#endif
1682{
1683 pParams->version = SIR_MAC_OUI_VERSION_1;
1684
1685#ifdef WLAN_SOFTAP_FEATURE
1686 if(psessionEntry->limSystemRole == eLIM_AP_ROLE)
1687 pParams->qosInfo =
1688 (psessionEntry->apUapsdEnable << 7) | ((tANI_U8)(0x0f & psessionEntry->gLimEdcaParamSetCount));
1689 else
1690#endif
1691 pParams->qosInfo =
1692 (pMac->lim.gUapsdEnable << 7) | ((tANI_U8)(0x0f & psessionEntry->gLimEdcaParamSetCount));
1693
1694 // Fill each EDCA parameter set in order: be, bk, vi, vo
1695 pParams->acbe_aifsn = ( 0xf & SET_AIFSN(psessionEntry->gLimEdcaParamsBC[0].aci.aifsn) );
1696 pParams->acbe_acm = ( 0x1 & psessionEntry->gLimEdcaParamsBC[0].aci.acm );
1697 pParams->acbe_aci = ( 0x3 & SIR_MAC_EDCAACI_BESTEFFORT );
1698 pParams->acbe_acwmin = ( 0xf & psessionEntry->gLimEdcaParamsBC[0].cw.min );
1699 pParams->acbe_acwmax = ( 0xf & psessionEntry->gLimEdcaParamsBC[0].cw.max );
1700 pParams->acbe_txoplimit = psessionEntry->gLimEdcaParamsBC[0].txoplimit;
1701
1702 pParams->acbk_aifsn = ( 0xf & SET_AIFSN(psessionEntry->gLimEdcaParamsBC[1].aci.aifsn) );
1703 pParams->acbk_acm = ( 0x1 & psessionEntry->gLimEdcaParamsBC[1].aci.acm );
1704 pParams->acbk_aci = ( 0x3 & SIR_MAC_EDCAACI_BACKGROUND );
1705 pParams->acbk_acwmin = ( 0xf & psessionEntry->gLimEdcaParamsBC[1].cw.min );
1706 pParams->acbk_acwmax = ( 0xf & psessionEntry->gLimEdcaParamsBC[1].cw.max );
1707 pParams->acbk_txoplimit = psessionEntry->gLimEdcaParamsBC[1].txoplimit;
1708
1709#ifdef WLAN_SOFTAP_FEATURE
1710 if(psessionEntry->limSystemRole == eLIM_AP_ROLE )
1711 pParams->acvi_aifsn = ( 0xf & psessionEntry->gLimEdcaParamsBC[2].aci.aifsn );
1712 else
1713#endif
1714 pParams->acvi_aifsn = ( 0xf & SET_AIFSN(psessionEntry->gLimEdcaParamsBC[2].aci.aifsn) );
1715
1716
1717
1718 pParams->acvi_acm = ( 0x1 & psessionEntry->gLimEdcaParamsBC[2].aci.acm );
1719 pParams->acvi_aci = ( 0x3 & SIR_MAC_EDCAACI_VIDEO );
1720 pParams->acvi_acwmin = ( 0xf & psessionEntry->gLimEdcaParamsBC[2].cw.min );
1721 pParams->acvi_acwmax = ( 0xf & psessionEntry->gLimEdcaParamsBC[2].cw.max );
1722 pParams->acvi_txoplimit = psessionEntry->gLimEdcaParamsBC[2].txoplimit;
1723
1724#ifdef WLAN_SOFTAP_FEATURE
1725 if(psessionEntry->limSystemRole == eLIM_AP_ROLE )
1726 pParams->acvo_aifsn = ( 0xf & psessionEntry->gLimEdcaParamsBC[3].aci.aifsn );
1727 else
1728#endif
1729 pParams->acvo_aifsn = ( 0xf & SET_AIFSN(psessionEntry->gLimEdcaParamsBC[3].aci.aifsn) );
1730
1731 pParams->acvo_acm = ( 0x1 & psessionEntry->gLimEdcaParamsBC[3].aci.acm );
1732 pParams->acvo_aci = ( 0x3 & SIR_MAC_EDCAACI_VOICE );
1733 pParams->acvo_acwmin = ( 0xf & psessionEntry->gLimEdcaParamsBC[3].cw.min );
1734 pParams->acvo_acwmax = ( 0xf & psessionEntry->gLimEdcaParamsBC[3].cw.max );
1735 pParams->acvo_txoplimit = psessionEntry->gLimEdcaParamsBC[3].txoplimit;
1736
1737 pParams->present = 1;
1738
1739} // End PopulateDot11fWMMParams.
1740
1741void PopulateDot11fWMMSchedule(tSirMacScheduleIE *pSchedule,
1742 tDot11fIEWMMSchedule *pDot11f)
1743{
1744 pDot11f->version = 1;
1745 pDot11f->aggregation = pSchedule->info.aggregation;
1746 pDot11f->tsid = pSchedule->info.tsid;
1747 pDot11f->direction = pSchedule->info.direction;
1748 pDot11f->reserved = pSchedule->info.rsvd;
1749 pDot11f->service_start_time = pSchedule->svcStartTime;
1750 pDot11f->service_interval = pSchedule->svcInterval;
1751 pDot11f->max_service_dur = pSchedule->maxSvcDuration;
1752 pDot11f->spec_interval = pSchedule->specInterval;
1753
1754 pDot11f->present = 1;
1755} // End PopulateDot11fWMMSchedule.
1756
1757tSirRetStatus
1758PopulateDot11fWPA(tpAniSirGlobal pMac,
1759 tpSirRSNie pRsnIe,
1760 tDot11fIEWPA *pDot11f)
1761{
1762 tANI_U32 status;
1763 int idx;
1764
1765 if ( pRsnIe->length )
1766 {
1767 if( 0 <= ( idx = FindIELocation( pMac, pRsnIe, DOT11F_EID_WPA ) ) )
1768 {
1769 status = dot11fUnpackIeWPA( pMac,
1770 pRsnIe->rsnIEdata + idx + 2 + 4, // EID, length, OUI
1771 pRsnIe->rsnIEdata[ idx + 1 ] - 4, // OUI
1772 pDot11f );
1773 if ( DOT11F_FAILED( status ) )
1774 {
1775 dot11fLog( pMac, LOGE, FL("Parse failure in PopulateDot11fWP"
1776 "A (0x%08x).\n"),
1777 status );
1778 return eSIR_FAILURE;
1779 }
1780 }
1781 }
1782
1783 return eSIR_SUCCESS;
1784} // End PopulateDot11fWPA.
1785
1786
1787
1788tSirRetStatus PopulateDot11fWPAOpaque( tpAniSirGlobal pMac,
1789 tpSirRSNie pRsnIe,
1790 tDot11fIEWPAOpaque *pDot11f )
1791{
1792 int idx;
1793
1794 if ( pRsnIe->length )
1795 {
1796 if( 0 <= ( idx = FindIELocation( pMac, pRsnIe, DOT11F_EID_WPA ) ) )
1797 {
1798 pDot11f->present = 1;
1799 pDot11f->num_data = pRsnIe->rsnIEdata[ idx + 1 ] - 4;
1800 palCopyMemory( pMac->hHdd, pDot11f->data,
1801 pRsnIe->rsnIEdata + idx + 2 + 4, // EID, len, OUI
1802 pRsnIe->rsnIEdata[ idx + 1 ] - 4 ); // OUI
1803 }
1804 }
1805
1806 return eSIR_SUCCESS;
1807
1808} // End PopulateDot11fWPAOpaque.
1809
1810////////////////////////////////////////////////////////////////////////
1811
1812tSirRetStatus
1813sirGetCfgPropCaps(tpAniSirGlobal pMac, tANI_U16 *caps)
1814{
1815#if 0
1816 tANI_U32 val;
1817
1818 *caps = 0;
1819 if (wlan_cfgGetInt(pMac, WNI_CFG_PROPRIETARY_ANI_FEATURES_ENABLED, &val)
1820 != eSIR_SUCCESS)
1821 {
1822 limLog(pMac, LOGP, FL("could not retrieve PropFeature enabled flag\n"));
1823 return eSIR_FAILURE;
1824 }
1825 if (wlan_cfgGetInt(pMac, WNI_CFG_PROP_CAPABILITY, &val) != eSIR_SUCCESS)
1826 {
1827 limLog(pMac, LOGP, FL("could not retrieve PROP_CAPABLITY flag\n"));
1828 return eSIR_FAILURE;
1829 }
1830
1831 *caps = (tANI_U16) val;
1832#endif
1833 return eSIR_SUCCESS;
1834}
1835
1836tSirRetStatus
1837sirConvertProbeReqFrame2Struct(tpAniSirGlobal pMac,
1838 tANI_U8 *pFrame,
1839 tANI_U32 nFrame,
1840 tpSirProbeReq pProbeReq)
1841{
1842 tANI_U32 status;
1843 tDot11fProbeRequest pr;
1844
1845 // Ok, zero-init our [out] parameter,
1846 palZeroMemory( pMac->hHdd, (tANI_U8*)pProbeReq, sizeof(tSirProbeReq));
1847
1848 // delegate to the framesc-generated code,
1849 status = dot11fUnpackProbeRequest(pMac, pFrame, nFrame, &pr);
1850 if ( DOT11F_FAILED( status ) )
1851 {
1852 limLog(pMac, LOGE, FL("Failed to parse a Probe Request (0x%08x, %d bytes):\n"),
1853 status, nFrame);
1854 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
1855 return eSIR_FAILURE;
1856 }
1857 else if ( DOT11F_WARNED( status ) )
1858 {
1859 limLog( pMac, LOGW, FL("There were warnings while unpacking a Probe Request (0x%08x, %d bytes):\n"),
1860 status, nFrame );
1861 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
1862 }
1863
1864 // & "transliterate" from a 'tDot11fProbeRequestto' a 'tSirProbeReq'...
1865 if ( ! pr.SSID.present )
1866 {
1867 PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!\n"));)
1868 }
1869 else
1870 {
1871 pProbeReq->ssidPresent = 1;
1872 ConvertSSID( pMac, &pProbeReq->ssId, &pr.SSID );
1873 }
1874
1875 if ( ! pr.SuppRates.present )
1876 {
1877 PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!\n"));)
1878 return eSIR_FAILURE;
1879 }
1880 else
1881 {
1882 pProbeReq->suppRatesPresent = 1;
1883 ConvertSuppRates( pMac, &pProbeReq->supportedRates, &pr.SuppRates );
1884 }
1885
1886 if ( pr.ExtSuppRates.present )
1887 {
1888 pProbeReq->extendedRatesPresent = 1;
1889 ConvertExtSuppRates( pMac, &pProbeReq->extendedRates, &pr.ExtSuppRates );
1890 }
1891
1892 if ( pr.HTCaps.present )
1893 {
1894 palCopyMemory( pMac, &pProbeReq->HTCaps, &pr.HTCaps, sizeof( tDot11fIEHTCaps ) );
1895 }
1896
1897 if ( pr.WscProbeReq.present )
1898 {
1899 pProbeReq->wscIePresent = 1;
1900 memcpy(&pProbeReq->probeReqWscIeInfo, &pr.WscProbeReq, sizeof(tDot11fIEWscProbeReq));
1901 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001902#ifdef WLAN_FEATURE_11AC
1903 if ( pr.VHTCaps.present )
1904 {
1905 palCopyMemory( pMac, &pProbeReq->VHTCaps, &pr.VHTCaps, sizeof( tDot11fIEVHTCaps ) );
1906 }
1907#endif
1908
Jeff Johnson295189b2012-06-20 16:38:30 -07001909
1910 if ( pr.P2PProbeReq.present )
1911 {
1912 pProbeReq->p2pIePresent = 1;
1913 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001914
Jeff Johnson295189b2012-06-20 16:38:30 -07001915 return eSIR_SUCCESS;
1916
1917} // End sirConvertProbeReqFrame2Struct.
1918
1919tSirRetStatus sirConvertProbeFrame2Struct(tpAniSirGlobal pMac,
1920 tANI_U8 *pFrame,
1921 tANI_U32 nFrame,
1922 tpSirProbeRespBeacon pProbeResp)
1923{
1924 tANI_U32 status;
Jeff Johnson32d95a32012-09-10 13:15:23 -07001925 tDot11fProbeResponse *pr;
Jeff Johnson295189b2012-06-20 16:38:30 -07001926
1927 // Ok, zero-init our [out] parameter,
1928 palZeroMemory( pMac->hHdd, ( tANI_U8* )pProbeResp, sizeof(tSirProbeRespBeacon) );
Jeff Johnson295189b2012-06-20 16:38:30 -07001929
Jeff Johnson32d95a32012-09-10 13:15:23 -07001930 status = palAllocateMemory(pMac->hHdd, (void **)&pr, sizeof(tDot11fProbeResponse));
1931 if(!HAL_STATUS_SUCCESS(status))
1932 {
1933 limLog(pMac, LOGE, FL("Failed to allocate memory\n") );
1934 return eSIR_FAILURE;
1935 }
1936
1937 palZeroMemory( pMac->hHdd, ( tANI_U8* )pr, sizeof(tDot11fProbeResponse) );
1938
Jeff Johnson295189b2012-06-20 16:38:30 -07001939 // delegate to the framesc-generated code,
Jeff Johnson32d95a32012-09-10 13:15:23 -07001940 status = dot11fUnpackProbeResponse( pMac, pFrame, nFrame, pr );
Jeff Johnson295189b2012-06-20 16:38:30 -07001941 if ( DOT11F_FAILED( status ) )
1942 {
1943 limLog(pMac, LOGE, FL("Failed to parse a Probe Response (0x%08x, %d bytes):\n"),
1944 status, nFrame);
1945 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
Jeff Johnson32d95a32012-09-10 13:15:23 -07001946 palFreeMemory(pMac->hHdd, pr);
Jeff Johnson295189b2012-06-20 16:38:30 -07001947 return eSIR_FAILURE;
1948 }
1949 else if ( DOT11F_WARNED( status ) )
1950 {
1951 limLog( pMac, LOGW, FL("There were warnings while unpacking a Probe Response (0x%08x, %d bytes):\n"),
1952 status, nFrame );
1953 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
1954 }
1955
1956 // & "transliterate" from a 'tDot11fProbeResponse' to a 'tSirProbeRespBeacon'...
1957
1958 // Timestamp
Jeff Johnson32d95a32012-09-10 13:15:23 -07001959 palCopyMemory( pMac->hHdd, ( tANI_U8* )pProbeResp->timeStamp, ( tANI_U8* )&pr->TimeStamp, sizeof(tSirMacTimeStamp) );
Jeff Johnson295189b2012-06-20 16:38:30 -07001960
1961 // Beacon Interval
Jeff Johnson32d95a32012-09-10 13:15:23 -07001962 pProbeResp->beaconInterval = pr->BeaconInterval.interval;
Jeff Johnson295189b2012-06-20 16:38:30 -07001963
1964 // Capabilities
Jeff Johnson32d95a32012-09-10 13:15:23 -07001965 pProbeResp->capabilityInfo.ess = pr->Capabilities.ess;
1966 pProbeResp->capabilityInfo.ibss = pr->Capabilities.ibss;
1967 pProbeResp->capabilityInfo.cfPollable = pr->Capabilities.cfPollable;
1968 pProbeResp->capabilityInfo.cfPollReq = pr->Capabilities.cfPollReq;
1969 pProbeResp->capabilityInfo.privacy = pr->Capabilities.privacy;
1970 pProbeResp->capabilityInfo.shortPreamble = pr->Capabilities.shortPreamble;
1971 pProbeResp->capabilityInfo.pbcc = pr->Capabilities.pbcc;
1972 pProbeResp->capabilityInfo.channelAgility = pr->Capabilities.channelAgility;
1973 pProbeResp->capabilityInfo.spectrumMgt = pr->Capabilities.spectrumMgt;
1974 pProbeResp->capabilityInfo.qos = pr->Capabilities.qos;
1975 pProbeResp->capabilityInfo.shortSlotTime = pr->Capabilities.shortSlotTime;
1976 pProbeResp->capabilityInfo.apsd = pr->Capabilities.apsd;
1977 pProbeResp->capabilityInfo.rrm = pr->Capabilities.rrm;
1978 pProbeResp->capabilityInfo.dsssOfdm = pr->Capabilities.dsssOfdm;
1979 pProbeResp->capabilityInfo.delayedBA = pr->Capabilities.delayedBA;
1980 pProbeResp->capabilityInfo.immediateBA = pr->Capabilities.immediateBA;
Jeff Johnson295189b2012-06-20 16:38:30 -07001981
Jeff Johnson32d95a32012-09-10 13:15:23 -07001982 if ( ! pr->SSID.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07001983 {
1984 PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!\n"));)
1985 }
1986 else
1987 {
1988 pProbeResp->ssidPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07001989 ConvertSSID( pMac, &pProbeResp->ssId, &pr->SSID );
Jeff Johnson295189b2012-06-20 16:38:30 -07001990 }
1991
Jeff Johnson32d95a32012-09-10 13:15:23 -07001992 if ( ! pr->SuppRates.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07001993 {
1994 PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!\n"));)
1995 }
1996 else
1997 {
1998 pProbeResp->suppRatesPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07001999 ConvertSuppRates( pMac, &pProbeResp->supportedRates, &pr->SuppRates );
Jeff Johnson295189b2012-06-20 16:38:30 -07002000 }
2001
Jeff Johnson32d95a32012-09-10 13:15:23 -07002002 if ( pr->ExtSuppRates.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002003 {
2004 pProbeResp->extendedRatesPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07002005 ConvertExtSuppRates( pMac, &pProbeResp->extendedRates, &pr->ExtSuppRates );
Jeff Johnson295189b2012-06-20 16:38:30 -07002006 }
2007
2008
Jeff Johnson32d95a32012-09-10 13:15:23 -07002009 if ( pr->CFParams.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002010 {
2011 pProbeResp->cfPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07002012 ConvertCFParams( pMac, &pProbeResp->cfParamSet, &pr->CFParams );
Jeff Johnson295189b2012-06-20 16:38:30 -07002013 }
2014
Jeff Johnson32d95a32012-09-10 13:15:23 -07002015 if ( pr->Country.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002016 {
2017 pProbeResp->countryInfoPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07002018 ConvertCountry( pMac, &pProbeResp->countryInfoParam, &pr->Country );
Jeff Johnson295189b2012-06-20 16:38:30 -07002019 }
2020
Jeff Johnson32d95a32012-09-10 13:15:23 -07002021 if ( pr->EDCAParamSet.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002022 {
2023 pProbeResp->edcaPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07002024 ConvertEDCAParam( pMac, &pProbeResp->edcaParams, &pr->EDCAParamSet );
Jeff Johnson295189b2012-06-20 16:38:30 -07002025 }
2026
Jeff Johnson32d95a32012-09-10 13:15:23 -07002027 if ( pr->ChanSwitchAnn.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002028 {
2029 pProbeResp->channelSwitchPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07002030 palCopyMemory( pMac, &pProbeResp->channelSwitchIE, &pr->ChanSwitchAnn,
Jeff Johnson295189b2012-06-20 16:38:30 -07002031 sizeof(tDot11fIEExtChanSwitchAnn) );
2032 }
2033
Jeff Johnson32d95a32012-09-10 13:15:23 -07002034 if ( pr->ExtChanSwitchAnn.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002035 {
2036 pProbeResp->extChannelSwitchPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07002037 palCopyMemory( pMac, &pProbeResp->extChannelSwitchIE, &pr->ExtChanSwitchAnn,
Jeff Johnson295189b2012-06-20 16:38:30 -07002038 sizeof(tDot11fIEExtChanSwitchAnn) );
2039 }
2040
Jeff Johnson32d95a32012-09-10 13:15:23 -07002041 if( pr->TPCReport.present)
Jeff Johnson295189b2012-06-20 16:38:30 -07002042 {
2043 pProbeResp->tpcReportPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07002044 palCopyMemory(pMac->hHdd, &pProbeResp->tpcReport, &pr->TPCReport, sizeof(tDot11fIETPCReport));
Jeff Johnson295189b2012-06-20 16:38:30 -07002045 }
2046
Jeff Johnson32d95a32012-09-10 13:15:23 -07002047 if( pr->PowerConstraints.present)
Jeff Johnson295189b2012-06-20 16:38:30 -07002048 {
2049 pProbeResp->powerConstraintPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07002050 palCopyMemory(pMac->hHdd, &pProbeResp->localPowerConstraint, &pr->PowerConstraints, sizeof(tDot11fIEPowerConstraints));
Jeff Johnson295189b2012-06-20 16:38:30 -07002051 }
2052
Jeff Johnson32d95a32012-09-10 13:15:23 -07002053 if ( pr->Quiet.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002054 {
2055 pProbeResp->quietIEPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07002056 palCopyMemory( pMac, &pProbeResp->quietIE, &pr->Quiet, sizeof(tDot11fIEQuiet) );
Jeff Johnson295189b2012-06-20 16:38:30 -07002057 }
2058
Jeff Johnson32d95a32012-09-10 13:15:23 -07002059 if ( pr->HTCaps.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002060 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07002061 palCopyMemory( pMac, &pProbeResp->HTCaps, &pr->HTCaps, sizeof( tDot11fIEHTCaps ) );
Jeff Johnson295189b2012-06-20 16:38:30 -07002062 }
2063
Jeff Johnson32d95a32012-09-10 13:15:23 -07002064 if ( pr->HTInfo.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002065 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07002066 palCopyMemory( pMac, &pProbeResp->HTInfo, &pr->HTInfo, sizeof( tDot11fIEHTInfo ) );
Jeff Johnson295189b2012-06-20 16:38:30 -07002067 }
2068
Jeff Johnson32d95a32012-09-10 13:15:23 -07002069 if ( pr->DSParams.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002070 {
2071 pProbeResp->dsParamsPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07002072 pProbeResp->channelNumber = pr->DSParams.curr_channel;
Jeff Johnson295189b2012-06-20 16:38:30 -07002073 }
Jeff Johnson32d95a32012-09-10 13:15:23 -07002074 else if(pr->HTInfo.present)
Jeff Johnson295189b2012-06-20 16:38:30 -07002075 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07002076 pProbeResp->channelNumber = pr->HTInfo.primaryChannel;
Jeff Johnson295189b2012-06-20 16:38:30 -07002077 }
2078
Jeff Johnson32d95a32012-09-10 13:15:23 -07002079 if ( pr->RSN.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002080 {
2081 pProbeResp->rsnPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07002082 ConvertRSN( pMac, &pProbeResp->rsn, &pr->RSN );
Jeff Johnson295189b2012-06-20 16:38:30 -07002083 }
2084
Jeff Johnson32d95a32012-09-10 13:15:23 -07002085 if ( pr->WPA.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002086 {
2087 pProbeResp->wpaPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07002088 ConvertWPA( pMac, &pProbeResp->wpa, &pr->WPA );
Jeff Johnson295189b2012-06-20 16:38:30 -07002089 }
2090
Jeff Johnson32d95a32012-09-10 13:15:23 -07002091 if ( pr->WMMParams.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002092 {
2093 pProbeResp->wmeEdcaPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07002094 ConvertWMMParams( pMac, &pProbeResp->edcaParams, &pr->WMMParams );
Jeff Johnson295189b2012-06-20 16:38:30 -07002095 PELOG1(limLog(pMac, LOG1, FL("WMM Parameter present in Probe Response Frame!\n"));
Jeff Johnson32d95a32012-09-10 13:15:23 -07002096 __printWMMParams(pMac, &pr->WMMParams);)
Jeff Johnson295189b2012-06-20 16:38:30 -07002097 }
2098
Jeff Johnson32d95a32012-09-10 13:15:23 -07002099 if ( pr->WMMInfoAp.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002100 {
2101 pProbeResp->wmeInfoPresent = 1;
2102 PELOG1(limLog(pMac, LOG1, FL("WMM Information Element present in Probe Response Frame!\n"));)
2103 }
2104
Jeff Johnson32d95a32012-09-10 13:15:23 -07002105 if ( pr->WMMCaps.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002106 {
2107 pProbeResp->wsmCapablePresent = 1;
2108 }
2109
2110
Jeff Johnson32d95a32012-09-10 13:15:23 -07002111 if ( pr->ERPInfo.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002112 {
2113 pProbeResp->erpPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07002114 ConvertERPInfo( pMac, &pProbeResp->erpIEInfo, &pr->ERPInfo );
Jeff Johnson295189b2012-06-20 16:38:30 -07002115 }
2116
2117#ifdef WLAN_FEATURE_VOWIFI_11R
Jeff Johnson32d95a32012-09-10 13:15:23 -07002118 if (pr->MobilityDomain.present)
Jeff Johnson295189b2012-06-20 16:38:30 -07002119 {
2120 // MobilityDomain
2121 pProbeResp->mdiePresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07002122 palCopyMemory( pMac->hHdd, (tANI_U8 *)&(pProbeResp->mdie[0]), (tANI_U8 *)&(pr->MobilityDomain.MDID), sizeof(tANI_U16) );
2123 pProbeResp->mdie[2] = ((pr->MobilityDomain.overDSCap << 0) | (pr->MobilityDomain.resourceReqCap << 1));
Jeff Johnson295189b2012-06-20 16:38:30 -07002124#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -07002125 limLog(pMac, LOG2, FL("mdie=%02x%02x%02x\n"), (unsigned int)pProbeResp->mdie[0],
Jeff Johnson295189b2012-06-20 16:38:30 -07002126 (unsigned int)pProbeResp->mdie[1], (unsigned int)pProbeResp->mdie[2]);
2127#endif
2128 }
2129#endif
2130
2131#if defined FEATURE_WLAN_CCX
Jeff Johnson32d95a32012-09-10 13:15:23 -07002132 if (pr->QBSSLoad.present)
Jeff Johnson295189b2012-06-20 16:38:30 -07002133 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07002134 palCopyMemory(pMac->hHdd, &pProbeResp->QBSSLoad, &pr->QBSSLoad, sizeof(tDot11fIEQBSSLoad));
Jeff Johnson295189b2012-06-20 16:38:30 -07002135 }
2136#endif
2137#ifdef WLAN_FEATURE_P2P
Jeff Johnson32d95a32012-09-10 13:15:23 -07002138 if (pr->P2PProbeRes.present)
Jeff Johnson295189b2012-06-20 16:38:30 -07002139 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07002140 palCopyMemory( pMac, &pProbeResp->P2PProbeRes, &pr->P2PProbeRes,
Jeff Johnson295189b2012-06-20 16:38:30 -07002141 sizeof(tDot11fIEP2PProbeRes) );
2142 }
2143#endif
Jeff Johnsone7245742012-09-05 17:12:55 -07002144#ifdef WLAN_FEATURE_11AC
Jeff Johnson32d95a32012-09-10 13:15:23 -07002145 if ( pr->VHTCaps.present )
Jeff Johnsone7245742012-09-05 17:12:55 -07002146 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07002147 palCopyMemory( pMac, &pProbeResp->VHTCaps, &pr->VHTCaps, sizeof( tDot11fIEVHTCaps ) );
Jeff Johnsone7245742012-09-05 17:12:55 -07002148 }
Jeff Johnson32d95a32012-09-10 13:15:23 -07002149 if ( pr->VHTOperation.present )
Jeff Johnsone7245742012-09-05 17:12:55 -07002150 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07002151 palCopyMemory( pMac, &pProbeResp->VHTOperation, &pr->VHTOperation, sizeof( tDot11fIEVHTOperation) );
Jeff Johnsone7245742012-09-05 17:12:55 -07002152 }
Jeff Johnson32d95a32012-09-10 13:15:23 -07002153 if ( pr->VHTExtBssLoad.present )
Jeff Johnsone7245742012-09-05 17:12:55 -07002154 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07002155 palCopyMemory( pMac, &pProbeResp->VHTExtBssLoad, &pr->VHTExtBssLoad, sizeof( tDot11fIEVHTExtBssLoad) );
Jeff Johnsone7245742012-09-05 17:12:55 -07002156 }
2157#endif
Madan Mohan Koyyalamudi31a91142012-09-18 17:07:59 -07002158 palFreeMemory(pMac->hHdd, pr);
Jeff Johnson295189b2012-06-20 16:38:30 -07002159 return eSIR_SUCCESS;
2160
2161} // End sirConvertProbeFrame2Struct.
2162
2163tSirRetStatus
2164sirConvertAssocReqFrame2Struct(tpAniSirGlobal pMac,
2165 tANI_U8 *pFrame,
2166 tANI_U32 nFrame,
2167 tpSirAssocReq pAssocReq)
2168{
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002169 tDot11fAssocRequest *ar;
Jeff Johnson295189b2012-06-20 16:38:30 -07002170 tANI_U32 status;
2171
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002172 status = palAllocateMemory(pMac->hHdd, (void **)&ar, sizeof(tDot11fAssocRequest));
2173 if(!HAL_STATUS_SUCCESS(status))
2174 {
2175 limLog(pMac, LOGE, FL("Failed to allocate memory\n") );
2176 return eSIR_FAILURE;
2177 }
2178 // Zero-init our [out] parameter,
Jeff Johnson295189b2012-06-20 16:38:30 -07002179 palZeroMemory( pMac->hHdd, ( tANI_U8* )pAssocReq, sizeof(tSirAssocReq) );
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002180 palZeroMemory( pMac->hHdd, ( tANI_U8* )ar, sizeof( tDot11fAssocRequest ) );
Jeff Johnson295189b2012-06-20 16:38:30 -07002181
2182 // delegate to the framesc-generated code,
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002183 status = dot11fUnpackAssocRequest( pMac, pFrame, nFrame, ar );
Jeff Johnson295189b2012-06-20 16:38:30 -07002184 if ( DOT11F_FAILED( status ) )
2185 {
2186 limLog(pMac, LOGE, FL("Failed to parse an Association Request (0x%08x, %d bytes):\n"),
2187 status, nFrame);
2188 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002189 palFreeMemory(pMac->hHdd, ar);
Jeff Johnson295189b2012-06-20 16:38:30 -07002190 return eSIR_FAILURE;
2191 }
2192 else if ( DOT11F_WARNED( status ) )
2193 {
2194 limLog( pMac, LOGW, FL("There were warnings while unpacking an Assoication Request (0x%08x, %d bytes):\n"),
2195 status, nFrame );
2196 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
2197 }
2198
2199 // & "transliterate" from a 'tDot11fAssocRequest' to a 'tSirAssocReq'...
2200
2201 // make sure this is seen as an assoc request
2202 pAssocReq->reassocRequest = 0;
2203
2204 // Capabilities
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002205 pAssocReq->capabilityInfo.ess = ar->Capabilities.ess;
2206 pAssocReq->capabilityInfo.ibss = ar->Capabilities.ibss;
2207 pAssocReq->capabilityInfo.cfPollable = ar->Capabilities.cfPollable;
2208 pAssocReq->capabilityInfo.cfPollReq = ar->Capabilities.cfPollReq;
2209 pAssocReq->capabilityInfo.privacy = ar->Capabilities.privacy;
2210 pAssocReq->capabilityInfo.shortPreamble = ar->Capabilities.shortPreamble;
2211 pAssocReq->capabilityInfo.pbcc = ar->Capabilities.pbcc;
2212 pAssocReq->capabilityInfo.channelAgility = ar->Capabilities.channelAgility;
2213 pAssocReq->capabilityInfo.spectrumMgt = ar->Capabilities.spectrumMgt;
2214 pAssocReq->capabilityInfo.qos = ar->Capabilities.qos;
2215 pAssocReq->capabilityInfo.shortSlotTime = ar->Capabilities.shortSlotTime;
2216 pAssocReq->capabilityInfo.apsd = ar->Capabilities.apsd;
2217 pAssocReq->capabilityInfo.rrm = ar->Capabilities.rrm;
2218 pAssocReq->capabilityInfo.dsssOfdm = ar->Capabilities.dsssOfdm;
2219 pAssocReq->capabilityInfo.delayedBA = ar->Capabilities.delayedBA;
2220 pAssocReq->capabilityInfo.immediateBA = ar->Capabilities.immediateBA;
Jeff Johnson295189b2012-06-20 16:38:30 -07002221
2222 // Listen Interval
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002223 pAssocReq->listenInterval = ar->ListenInterval.interval;
Jeff Johnson295189b2012-06-20 16:38:30 -07002224
2225 // SSID
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002226 if ( ar->SSID.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002227 {
2228 pAssocReq->ssidPresent = 1;
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002229 ConvertSSID( pMac, &pAssocReq->ssId, &ar->SSID );
Jeff Johnson295189b2012-06-20 16:38:30 -07002230 }
2231
2232 // Supported Rates
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002233 if ( ar->SuppRates.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002234 {
2235 pAssocReq->suppRatesPresent = 1;
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002236 ConvertSuppRates( pMac, &pAssocReq->supportedRates, &ar->SuppRates );
Jeff Johnson295189b2012-06-20 16:38:30 -07002237 }
2238
2239 // Extended Supported Rates
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002240 if ( ar->ExtSuppRates.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002241 {
2242 pAssocReq->extendedRatesPresent = 1;
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002243 ConvertExtSuppRates( pMac, &pAssocReq->extendedRates, &ar->ExtSuppRates );
Jeff Johnson295189b2012-06-20 16:38:30 -07002244 }
2245
2246 // QOS Capabilities:
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002247 if ( ar->QOSCapsStation.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002248 {
2249 pAssocReq->qosCapabilityPresent = 1;
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002250 ConvertQOSCapsStation( pMac, &pAssocReq->qosCapability, &ar->QOSCapsStation );
Jeff Johnson295189b2012-06-20 16:38:30 -07002251 }
2252
2253 // WPA
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002254 if ( ar->WPAOpaque.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002255 {
2256 pAssocReq->wpaPresent = 1;
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002257 ConvertWPAOpaque( pMac, &pAssocReq->wpa, &ar->WPAOpaque );
Jeff Johnson295189b2012-06-20 16:38:30 -07002258 }
2259
2260 // RSN
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002261 if ( ar->RSNOpaque.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002262 {
2263 pAssocReq->rsnPresent = 1;
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002264 ConvertRSNOpaque( pMac, &pAssocReq->rsn, &ar->RSNOpaque );
Jeff Johnson295189b2012-06-20 16:38:30 -07002265 }
2266
2267 // WSC IE
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002268 if (ar->WscIEOpaque.present)
Jeff Johnson295189b2012-06-20 16:38:30 -07002269 {
2270 pAssocReq->addIEPresent = 1;
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002271 ConvertWscOpaque(pMac, &pAssocReq->addIE, &ar->WscIEOpaque);
Jeff Johnson295189b2012-06-20 16:38:30 -07002272 }
2273
2274
2275#ifdef WLAN_FEATURE_P2P
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002276 if(ar->P2PIEOpaque.present)
Jeff Johnson295189b2012-06-20 16:38:30 -07002277 {
2278 pAssocReq->addIEPresent = 1;
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002279 ConvertP2POpaque( pMac, &pAssocReq->addIE, &ar->P2PIEOpaque);
Jeff Johnson295189b2012-06-20 16:38:30 -07002280 }
2281#endif
Jeff Johnsone7245742012-09-05 17:12:55 -07002282#ifdef WLAN_FEATURE_WFD
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002283 if(ar->WFDIEOpaque.present)
Jeff Johnsone7245742012-09-05 17:12:55 -07002284 {
2285 pAssocReq->addIEPresent = 1;
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002286 ConvertWFDOpaque( pMac, &pAssocReq->addIE, &ar->WFDIEOpaque);
Jeff Johnsone7245742012-09-05 17:12:55 -07002287 }
2288#endif
2289
Jeff Johnson295189b2012-06-20 16:38:30 -07002290 // Power Capabilities
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002291 if ( ar->PowerCaps.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002292 {
2293 pAssocReq->powerCapabilityPresent = 1;
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002294 ConvertPowerCaps( pMac, &pAssocReq->powerCapability, &ar->PowerCaps );
Jeff Johnson295189b2012-06-20 16:38:30 -07002295 }
2296
2297 // Supported Channels
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002298 if ( ar->SuppChannels.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002299 {
2300 pAssocReq->supportedChannelsPresent = 1;
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002301 ConvertSuppChannels( pMac, &pAssocReq->supportedChannels, &ar->SuppChannels );
Jeff Johnson295189b2012-06-20 16:38:30 -07002302 }
2303
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002304 if ( ar->HTCaps.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002305 {
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002306 palCopyMemory( pMac, &pAssocReq->HTCaps, &ar->HTCaps, sizeof( tDot11fIEHTCaps ) );
Jeff Johnson295189b2012-06-20 16:38:30 -07002307 }
2308
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002309 if ( ar->WMMInfoStation.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07002310 {
2311 pAssocReq->wmeInfoPresent = 1;
2312#ifdef WLAN_SOFTAP_FEATURE
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002313 palCopyMemory( pMac, &pAssocReq->WMMInfoStation, &ar->WMMInfoStation, sizeof( tDot11fIEWMMInfoStation ) );
Jeff Johnson295189b2012-06-20 16:38:30 -07002314#endif
2315
2316 }
2317
2318
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002319 if ( ar->WMMCaps.present ) pAssocReq->wsmCapablePresent = 1;
Jeff Johnson295189b2012-06-20 16:38:30 -07002320
2321 if ( ! pAssocReq->ssidPresent )
2322 {
2323 PELOG2(limLog(pMac, LOG2, FL("Received Assoc without SSID IE.\n"));)
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002324 palFreeMemory(pMac->hHdd, ar);
Jeff Johnson295189b2012-06-20 16:38:30 -07002325 return eSIR_FAILURE;
2326 }
2327
2328 if ( !pAssocReq->suppRatesPresent && !pAssocReq->extendedRatesPresent )
2329 {
2330 PELOG2(limLog(pMac, LOG2, FL("Received Assoc without supp rate IE.\n"));)
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002331 palFreeMemory(pMac->hHdd, ar);
Jeff Johnson295189b2012-06-20 16:38:30 -07002332 return eSIR_FAILURE;
2333 }
2334
Jeff Johnsone7245742012-09-05 17:12:55 -07002335#ifdef WLAN_FEATURE_11AC
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002336 if ( ar->VHTCaps.present )
Jeff Johnsone7245742012-09-05 17:12:55 -07002337 {
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002338 palCopyMemory( pMac, &pAssocReq->VHTCaps, &ar->VHTCaps, sizeof( tDot11fIEVHTCaps ) );
Jeff Johnsone7245742012-09-05 17:12:55 -07002339 limLog( pMac, LOGW, FL("Received Assoc Req with VHT Cap\n"));
2340 limLogVHTCap( pMac, &pAssocReq->VHTCaps);
2341 }
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002342 if ( ar->OperatingMode.present )
Mohit Khanna7d5aeb22012-09-11 16:21:57 -07002343 {
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002344 palCopyMemory( pMac, &pAssocReq->operMode, &ar->OperatingMode, sizeof( tDot11fIEVHTCaps ) );
Mohit Khanna7d5aeb22012-09-11 16:21:57 -07002345 limLog( pMac, LOGW, FL("Received Assoc Req with Operating Mode IE\n"));
2346 limLogOperatingMode( pMac, &pAssocReq->operMode);
2347 }
Jeff Johnsone7245742012-09-05 17:12:55 -07002348#endif
Madan Mohan Koyyalamudi19032762012-10-21 12:42:11 -07002349 palFreeMemory(pMac->hHdd, ar);
Jeff Johnson295189b2012-06-20 16:38:30 -07002350 return eSIR_SUCCESS;
2351
2352} // End sirConvertAssocReqFrame2Struct.
2353
2354tSirRetStatus
2355sirConvertAssocRespFrame2Struct(tpAniSirGlobal pMac,
2356 tANI_U8 *pFrame,
2357 tANI_U32 nFrame,
2358 tpSirAssocRsp pAssocRsp)
2359{
2360 static tDot11fAssocResponse ar;
2361 tANI_U32 status;
2362 tANI_U8 cnt =0;
2363
2364 // Zero-init our [out] parameter,
2365 palZeroMemory( pMac->hHdd, ( tANI_U8* )pAssocRsp, sizeof(tSirAssocRsp) );
2366
2367 // delegate to the framesc-generated code,
2368 status = dot11fUnpackAssocResponse( pMac, pFrame, nFrame, &ar);
2369 if ( DOT11F_FAILED( status ) )
2370 {
2371 limLog(pMac, LOGE, FL("Failed to parse an Association Response (0x%08x, %d bytes):\n"),
2372 status, nFrame);
2373 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
2374 return eSIR_FAILURE;
2375 }
2376 else if ( DOT11F_WARNED( status ) )
2377 {
2378 limLog( pMac, LOGW, FL("There were warnings while unpacking an Association Response (0x%08x, %d bytes):\n"),
2379 status, nFrame );
2380 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
2381 }
2382
2383 // & "transliterate" from a 'tDot11fAssocResponse' a 'tSirAssocRsp'...
2384
2385 // Capabilities
2386 pAssocRsp->capabilityInfo.ess = ar.Capabilities.ess;
2387 pAssocRsp->capabilityInfo.ibss = ar.Capabilities.ibss;
2388 pAssocRsp->capabilityInfo.cfPollable = ar.Capabilities.cfPollable;
2389 pAssocRsp->capabilityInfo.cfPollReq = ar.Capabilities.cfPollReq;
2390 pAssocRsp->capabilityInfo.privacy = ar.Capabilities.privacy;
2391 pAssocRsp->capabilityInfo.shortPreamble = ar.Capabilities.shortPreamble;
2392 pAssocRsp->capabilityInfo.pbcc = ar.Capabilities.pbcc;
2393 pAssocRsp->capabilityInfo.channelAgility = ar.Capabilities.channelAgility;
2394 pAssocRsp->capabilityInfo.spectrumMgt = ar.Capabilities.spectrumMgt;
2395 pAssocRsp->capabilityInfo.qos = ar.Capabilities.qos;
2396 pAssocRsp->capabilityInfo.shortSlotTime = ar.Capabilities.shortSlotTime;
2397 pAssocRsp->capabilityInfo.apsd = ar.Capabilities.apsd;
2398 pAssocRsp->capabilityInfo.rrm = ar.Capabilities.rrm;
2399 pAssocRsp->capabilityInfo.dsssOfdm = ar.Capabilities.dsssOfdm;
2400 pAssocRsp->capabilityInfo.delayedBA = ar.Capabilities.delayedBA;
2401 pAssocRsp->capabilityInfo.immediateBA = ar.Capabilities.immediateBA;
2402
2403 pAssocRsp->statusCode = ar.Status.status;
2404 pAssocRsp->aid = ar.AID.associd;
2405
2406 if ( ! ar.SuppRates.present )
2407 {
2408 pAssocRsp->suppRatesPresent = 0;
2409 PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!\n"));)
2410 }
2411 else
2412 {
2413 pAssocRsp->suppRatesPresent = 1;
2414 ConvertSuppRates( pMac, &pAssocRsp->supportedRates, &ar.SuppRates );
2415 }
2416
2417 if ( ar.ExtSuppRates.present )
2418 {
2419 pAssocRsp->extendedRatesPresent = 1;
2420 ConvertExtSuppRates( pMac, &pAssocRsp->extendedRates, &ar.ExtSuppRates );
2421 }
2422
2423 if ( ar.EDCAParamSet.present )
2424 {
2425 pAssocRsp->edcaPresent = 1;
2426 ConvertEDCAParam( pMac, &pAssocRsp->edca, &ar.EDCAParamSet );
2427 }
2428
2429
2430 if ( ar.WMMParams.present )
2431 {
2432 pAssocRsp->wmeEdcaPresent = 1;
2433 ConvertWMMParams( pMac, &pAssocRsp->edca, &ar.WMMParams);
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -07002434 limLog(pMac, LOG1, FL("WMM Parameter Element present in Association Response Frame!"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002435 __printWMMParams(pMac, &ar.WMMParams);
2436 }
2437
2438 if ( ar.HTCaps.present )
2439 {
2440 palCopyMemory( pMac, &pAssocRsp->HTCaps, &ar.HTCaps, sizeof( tDot11fIEHTCaps ) );
2441 }
2442
2443 if ( ar.HTInfo.present )
2444 {
2445 palCopyMemory( pMac, &pAssocRsp->HTInfo, &ar.HTInfo, sizeof( tDot11fIEHTInfo ) );
2446 }
2447
2448#ifdef WLAN_FEATURE_VOWIFI_11R
2449 if (ar.MobilityDomain.present)
2450 {
2451 // MobilityDomain
2452 pAssocRsp->mdiePresent = 1;
2453 palCopyMemory( pMac->hHdd, (tANI_U8 *)&(pAssocRsp->mdie[0]), (tANI_U8 *)&(ar.MobilityDomain.MDID), sizeof(tANI_U16) );
2454 pAssocRsp->mdie[2] = ((ar.MobilityDomain.overDSCap << 0) | (ar.MobilityDomain.resourceReqCap << 1));
2455#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -07002456 limLog(pMac, LOG1, FL("new mdie=%02x%02x%02x"), (unsigned int)pAssocRsp->mdie[0],
Jeff Johnson295189b2012-06-20 16:38:30 -07002457 (unsigned int)pAssocRsp->mdie[1], (unsigned int)pAssocRsp->mdie[2]);
2458#endif
2459 }
2460
2461 if ( ar.FTInfo.present )
2462 {
2463#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -07002464 limLog(pMac, LOG1, FL("FT Info present %d %d %d"), ar.FTInfo.R0KH_ID.num_PMK_R0_ID,
Jeff Johnson295189b2012-06-20 16:38:30 -07002465 ar.FTInfo.R0KH_ID.present,
2466 ar.FTInfo.R1KH_ID.present);
2467#endif
2468 pAssocRsp->ftinfoPresent = 1;
2469 palCopyMemory( pMac, &pAssocRsp->FTInfo, &ar.FTInfo, sizeof(tDot11fIEFTInfo) );
2470 }
2471#endif
2472
2473#ifdef WLAN_FEATURE_VOWIFI_11R
2474 if (ar.num_RICDataDesc) {
2475 for (cnt=0; cnt < ar.num_RICDataDesc; cnt++) {
2476 if (ar.RICDataDesc[cnt].present) {
2477 palCopyMemory(pMac, &pAssocRsp->RICData[cnt], &ar.RICDataDesc[cnt], sizeof(tDot11fIERICDataDesc));
2478 }
2479 }
2480 pAssocRsp->num_RICData = ar.num_RICDataDesc;
2481 pAssocRsp->ricPresent = TRUE;
2482 }
2483#endif
2484
2485#ifdef FEATURE_WLAN_CCX
2486 if (ar.num_WMMTSPEC) {
2487 pAssocRsp->num_tspecs = ar.num_WMMTSPEC;
2488 for (cnt=0; cnt < ar.num_WMMTSPEC; cnt++) {
2489 palCopyMemory(pMac, &pAssocRsp->TSPECInfo[cnt], &ar.WMMTSPEC[cnt], (sizeof(tDot11fIEWMMTSPEC)*ar.num_WMMTSPEC));
2490 }
2491 pAssocRsp->tspecPresent = TRUE;
2492 }
2493
2494 if(ar.CCXTrafStrmMet.present)
2495 {
2496 pAssocRsp->tsmPresent = 1;
2497 palCopyMemory(pMac->hHdd,&pAssocRsp->tsmIE.tsid,
2498 &ar.CCXTrafStrmMet.tsid,sizeof(tSirMacCCXTSMIE));
2499 }
2500#endif
2501
Jeff Johnsone7245742012-09-05 17:12:55 -07002502#ifdef WLAN_FEATURE_11AC
2503 if ( ar.VHTCaps.present )
2504 {
2505 palCopyMemory( pMac, &pAssocRsp->VHTCaps, &ar.VHTCaps, sizeof( tDot11fIEVHTCaps ) );
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -07002506 limLog( pMac, LOG1, FL("Received Assoc Response with VHT Cap"));
Jeff Johnsone7245742012-09-05 17:12:55 -07002507 limLogVHTCap(pMac, &pAssocRsp->VHTCaps);
2508 }
2509 if ( ar.VHTOperation.present )
2510 {
2511 palCopyMemory( pMac, &pAssocRsp->VHTOperation, &ar.VHTOperation, sizeof( tDot11fIEVHTOperation) );
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -07002512 limLog( pMac, LOG1, FL("Received Assoc Response with VHT Operation"));
Jeff Johnsone7245742012-09-05 17:12:55 -07002513 limLogVHTOperation(pMac, &pAssocRsp->VHTOperation);
2514 }
2515#endif
2516
Jeff Johnson295189b2012-06-20 16:38:30 -07002517 return eSIR_SUCCESS;
2518
2519} // End sirConvertAssocRespFrame2Struct.
2520
2521tSirRetStatus
2522sirConvertReassocReqFrame2Struct(tpAniSirGlobal pMac,
2523 tANI_U8 *pFrame,
2524 tANI_U32 nFrame,
2525 tpSirAssocReq pAssocReq)
2526{
2527 static tDot11fReAssocRequest ar;
2528 tANI_U32 status;
2529
2530 // Zero-init our [out] parameter,
2531 palZeroMemory( pMac->hHdd, ( tANI_U8* )pAssocReq, sizeof(tSirAssocReq) );
2532
2533 // delegate to the framesc-generated code,
2534 status = dot11fUnpackReAssocRequest( pMac, pFrame, nFrame, &ar );
2535 if ( DOT11F_FAILED( status ) )
2536 {
2537 limLog(pMac, LOGE, FL("Failed to parse a Re-association Request (0x%08x, %d bytes):\n"),
2538 status, nFrame);
2539 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
2540 return eSIR_FAILURE;
2541 }
2542 else if ( DOT11F_WARNED( status ) )
2543 {
2544 limLog( pMac, LOGW, FL("There were warnings while unpacking a Re-association Request (0x%08x, %d bytes):\n"),
2545 status, nFrame );
2546 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
2547 }
2548
2549 // & "transliterate" from a 'tDot11fReAssocRequest' to a 'tSirAssocReq'...
2550
2551 // make sure this is seen as a re-assoc request
2552 pAssocReq->reassocRequest = 1;
2553
2554 // Capabilities
2555 pAssocReq->capabilityInfo.ess = ar.Capabilities.ess;
2556 pAssocReq->capabilityInfo.ibss = ar.Capabilities.ibss;
2557 pAssocReq->capabilityInfo.cfPollable = ar.Capabilities.cfPollable;
2558 pAssocReq->capabilityInfo.cfPollReq = ar.Capabilities.cfPollReq;
2559 pAssocReq->capabilityInfo.privacy = ar.Capabilities.privacy;
2560 pAssocReq->capabilityInfo.shortPreamble = ar.Capabilities.shortPreamble;
2561 pAssocReq->capabilityInfo.pbcc = ar.Capabilities.pbcc;
2562 pAssocReq->capabilityInfo.channelAgility = ar.Capabilities.channelAgility;
2563 pAssocReq->capabilityInfo.spectrumMgt = ar.Capabilities.spectrumMgt;
2564 pAssocReq->capabilityInfo.qos = ar.Capabilities.qos;
2565 pAssocReq->capabilityInfo.shortSlotTime = ar.Capabilities.shortSlotTime;
2566 pAssocReq->capabilityInfo.apsd = ar.Capabilities.apsd;
2567 pAssocReq->capabilityInfo.rrm = ar.Capabilities.rrm;
2568 pAssocReq->capabilityInfo.dsssOfdm = ar.Capabilities.dsssOfdm;
2569 pAssocReq->capabilityInfo.delayedBA = ar.Capabilities.delayedBA;
2570 pAssocReq->capabilityInfo.immediateBA = ar.Capabilities.immediateBA;
2571
2572 // Listen Interval
2573 pAssocReq->listenInterval = ar.ListenInterval.interval;
2574
2575 // SSID
2576 if ( ar.SSID.present )
2577 {
2578 pAssocReq->ssidPresent = 1;
2579 ConvertSSID( pMac, &pAssocReq->ssId, &ar.SSID );
2580 }
2581
2582 // Supported Rates
2583 if ( ar.SuppRates.present )
2584 {
2585 pAssocReq->suppRatesPresent = 1;
2586 ConvertSuppRates( pMac, &pAssocReq->supportedRates, &ar.SuppRates );
2587 }
2588
2589 // Extended Supported Rates
2590 if ( ar.ExtSuppRates.present )
2591 {
2592 pAssocReq->extendedRatesPresent = 1;
2593 ConvertExtSuppRates( pMac, &pAssocReq->extendedRates,
2594 &ar.ExtSuppRates );
2595 }
2596
2597 // QOS Capabilities:
2598 if ( ar.QOSCapsStation.present )
2599 {
2600 pAssocReq->qosCapabilityPresent = 1;
2601 ConvertQOSCapsStation( pMac, &pAssocReq->qosCapability, &ar.QOSCapsStation );
2602 }
2603
2604 // WPA
2605 if ( ar.WPAOpaque.present )
2606 {
2607 pAssocReq->wpaPresent = 1;
2608 ConvertWPAOpaque( pMac, &pAssocReq->wpa, &ar.WPAOpaque );
2609 }
2610
2611 // RSN
2612 if ( ar.RSNOpaque.present )
2613 {
2614 pAssocReq->rsnPresent = 1;
2615 ConvertRSNOpaque( pMac, &pAssocReq->rsn, &ar.RSNOpaque );
2616 }
2617
2618
2619 // Power Capabilities
2620 if ( ar.PowerCaps.present )
2621 {
2622 pAssocReq->powerCapabilityPresent = 1;
2623 ConvertPowerCaps( pMac, &pAssocReq->powerCapability, &ar.PowerCaps );
2624 }
2625
2626 // Supported Channels
2627 if ( ar.SuppChannels.present )
2628 {
2629 pAssocReq->supportedChannelsPresent = 1;
2630 ConvertSuppChannels( pMac, &pAssocReq->supportedChannels, &ar.SuppChannels );
2631 }
2632
2633 if ( ar.HTCaps.present )
2634 {
2635 palCopyMemory( pMac, &pAssocReq->HTCaps, &ar.HTCaps, sizeof( tDot11fIEHTCaps ) );
2636 }
2637
2638 if ( ar.WMMInfoStation.present )
2639 {
2640 pAssocReq->wmeInfoPresent = 1;
2641#ifdef WLAN_SOFTAP_FEATURE
2642 palCopyMemory( pMac, &pAssocReq->WMMInfoStation, &ar.WMMInfoStation, sizeof( tDot11fIEWMMInfoStation ) );
2643#endif
2644
2645 }
2646
2647 if ( ar.WMMCaps.present ) pAssocReq->wsmCapablePresent = 1;
2648
2649 if ( ! pAssocReq->ssidPresent )
2650 {
2651 PELOG2(limLog(pMac, LOG2, FL("Received Assoc without SSID IE.\n"));)
2652 return eSIR_FAILURE;
2653 }
2654
2655 if ( ! pAssocReq->suppRatesPresent && ! pAssocReq->extendedRatesPresent )
2656 {
2657 PELOG2(limLog(pMac, LOG2, FL("Received Assoc without supp rate IE.\n"));)
2658 return eSIR_FAILURE;
2659 }
2660
2661 // Why no call to 'updateAssocReqFromPropCapability' here, like
2662 // there is in 'sirConvertAssocReqFrame2Struct'?
2663
2664 // WSC IE
2665 if (ar.WscIEOpaque.present)
2666 {
2667 pAssocReq->addIEPresent = 1;
2668 ConvertWscOpaque(pMac, &pAssocReq->addIE, &ar.WscIEOpaque);
2669 }
2670
2671#ifdef WLAN_FEATURE_P2P
2672 if(ar.P2PIEOpaque.present)
2673 {
2674 pAssocReq->addIEPresent = 1;
2675 ConvertP2POpaque( pMac, &pAssocReq->addIE, &ar.P2PIEOpaque);
2676 }
2677#endif
2678
Jeff Johnsone7245742012-09-05 17:12:55 -07002679#ifdef WLAN_FEATURE_WFD
2680 if(ar.WFDIEOpaque.present)
2681 {
2682 pAssocReq->addIEPresent = 1;
2683 ConvertWFDOpaque( pMac, &pAssocReq->addIE, &ar.WFDIEOpaque);
2684 }
2685#endif
2686
2687#ifdef WLAN_FEATURE_11AC
2688 if ( ar.VHTCaps.present )
2689 {
2690 palCopyMemory( pMac, &pAssocReq->VHTCaps, &ar.VHTCaps, sizeof( tDot11fIEVHTCaps ) );
2691 }
Mohit Khanna7d5aeb22012-09-11 16:21:57 -07002692 if ( ar.OperatingMode.present )
2693 {
2694 palCopyMemory( pMac, &pAssocReq->operMode, &ar.OperatingMode, sizeof( tDot11fIEVHTCaps ) );
2695 limLog( pMac, LOGW, FL("Received Assoc Req with Operating Mode IE\n"));
2696 limLogOperatingMode( pMac, &pAssocReq->operMode);
2697 }
Jeff Johnsone7245742012-09-05 17:12:55 -07002698#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002699 return eSIR_SUCCESS;
2700
2701} // End sirConvertReassocReqFrame2Struct.
2702
2703tSirRetStatus
2704sirParseBeaconIE(tpAniSirGlobal pMac,
2705 tpSirProbeRespBeacon pBeaconStruct,
2706 tANI_U8 *pPayload,
2707 tANI_U32 nPayload)
2708{
2709 tDot11fBeaconIEs *pBies;
2710 tANI_U32 status;
2711
2712 // Zero-init our [out] parameter,
2713 palZeroMemory( pMac->hHdd, ( tANI_U8* )pBeaconStruct, sizeof(tSirProbeRespBeacon) );
2714
2715 status = palAllocateMemory(pMac->hHdd, (void **)&pBies, sizeof(tDot11fBeaconIEs));
2716 if(!HAL_STATUS_SUCCESS(status))
2717 {
2718 limLog(pMac, LOGE, FL("Failed to allocate memory\n") );
2719 return eSIR_FAILURE;
2720 }
2721 // delegate to the framesc-generated code,
2722 status = dot11fUnpackBeaconIEs( pMac, pPayload, nPayload, pBies );
2723
2724 if ( DOT11F_FAILED( status ) )
2725 {
2726 limLog(pMac, LOGE, FL("Failed to parse Beacon IEs (0x%08x, %d bytes):\n"),
2727 status, nPayload);
2728 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);)
2729 palFreeMemory(pMac->hHdd, pBies);
2730 return eSIR_FAILURE;
2731 }
2732 else if ( DOT11F_WARNED( status ) )
2733 {
2734 limLog( pMac, LOGW, FL("There were warnings while unpacking Beacon IEs (0x%08x, %d bytes):\n"),
2735 status, nPayload );
2736 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);)
2737 }
2738
2739 // & "transliterate" from a 'tDot11fBeaconIEs' to a 'tSirProbeRespBeacon'...
2740 if ( ! pBies->SSID.present )
2741 {
2742 PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!\n"));)
2743 }
2744 else
2745 {
2746 pBeaconStruct->ssidPresent = 1;
2747 ConvertSSID( pMac, &pBeaconStruct->ssId, &pBies->SSID );
2748 }
2749
2750 if ( ! pBies->SuppRates.present )
2751 {
2752 PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!\n"));)
2753 }
2754 else
2755 {
2756 pBeaconStruct->suppRatesPresent = 1;
2757 ConvertSuppRates( pMac, &pBeaconStruct->supportedRates, &pBies->SuppRates );
2758 }
2759
2760 if ( pBies->ExtSuppRates.present )
2761 {
2762 pBeaconStruct->extendedRatesPresent = 1;
2763 ConvertExtSuppRates( pMac, &pBeaconStruct->extendedRates, &pBies->ExtSuppRates );
2764 }
2765
2766 if ( pBies->CFParams.present )
2767 {
2768 pBeaconStruct->cfPresent = 1;
2769 ConvertCFParams( pMac, &pBeaconStruct->cfParamSet, &pBies->CFParams );
2770 }
2771
2772 if ( pBies->TIM.present )
2773 {
2774 pBeaconStruct->timPresent = 1;
2775 ConvertTIM( pMac, &pBeaconStruct->tim, &pBies->TIM );
2776 }
2777
2778 if ( pBies->Country.present )
2779 {
2780 pBeaconStruct->countryInfoPresent = 1;
2781 ConvertCountry( pMac, &pBeaconStruct->countryInfoParam, &pBies->Country );
2782 }
2783
2784 // 11h IEs
2785 if(pBies->TPCReport.present)
2786 {
2787 pBeaconStruct->tpcReportPresent = 1;
2788 palCopyMemory(pMac,
2789 &pBeaconStruct->tpcReport,
2790 &pBies->TPCReport,
2791 sizeof( tDot11fIETPCReport));
2792 }
2793
2794 if(pBies->PowerConstraints.present)
2795 {
2796 pBeaconStruct->powerConstraintPresent = 1;
2797 palCopyMemory(pMac,
2798 &pBeaconStruct->localPowerConstraint,
2799 &pBies->PowerConstraints,
2800 sizeof(tDot11fIEPowerConstraints));
2801 }
2802#ifdef FEATURE_WLAN_CCX
2803 if(pBies->CCXTxmitPower.present)
2804 {
2805 pBeaconStruct->ccxTxPwr.present = 1;
2806 pBeaconStruct->ccxTxPwr.power_limit = pBies->CCXTxmitPower.power_limit;
2807 }
2808 if (pBies->QBSSLoad.present)
2809 {
2810 palCopyMemory(pMac->hHdd, &pBeaconStruct->QBSSLoad, &pBies->QBSSLoad, sizeof(tDot11fIEQBSSLoad));
2811 }
2812#endif
2813
2814 if ( pBies->EDCAParamSet.present )
2815 {
2816 pBeaconStruct->edcaPresent = 1;
2817 ConvertEDCAParam( pMac, &pBeaconStruct->edcaParams, &pBies->EDCAParamSet );
2818 }
2819
2820 // QOS Capabilities:
2821 if ( pBies->QOSCapsAp.present )
2822 {
2823 pBeaconStruct->qosCapabilityPresent = 1;
2824 ConvertQOSCaps( pMac, &pBeaconStruct->qosCapability, &pBies->QOSCapsAp );
2825 }
2826
2827
2828
2829 if ( pBies->ChanSwitchAnn.present )
2830 {
2831 pBeaconStruct->channelSwitchPresent = 1;
2832 palCopyMemory(pMac->hHdd, &pBeaconStruct->channelSwitchIE, &pBies->ChanSwitchAnn,
2833 sizeof(tDot11fIEChanSwitchAnn));
2834 }
2835
2836 if ( pBies->ExtChanSwitchAnn.present)
2837 {
2838 pBeaconStruct->extChannelSwitchPresent= 1;
2839 palCopyMemory(pMac->hHdd, &pBeaconStruct->extChannelSwitchIE, &pBies->ExtChanSwitchAnn,
2840 sizeof(tDot11fIEExtChanSwitchAnn));
2841 }
2842
2843 if ( pBies->Quiet.present )
2844 {
2845 pBeaconStruct->quietIEPresent = 1;
2846 palCopyMemory( pMac, &pBeaconStruct->quietIE, &pBies->Quiet, sizeof(tDot11fIEQuiet) );
2847 }
2848
2849 if ( pBies->HTCaps.present )
2850 {
2851 palCopyMemory( pMac, &pBeaconStruct->HTCaps, &pBies->HTCaps, sizeof( tDot11fIEHTCaps ) );
2852 }
2853
2854 if ( pBies->HTInfo.present )
2855 {
2856 palCopyMemory( pMac, &pBeaconStruct->HTInfo, &pBies->HTInfo, sizeof( tDot11fIEHTInfo ) );
2857 }
2858
2859 if ( pBies->DSParams.present )
2860 {
2861 pBeaconStruct->dsParamsPresent = 1;
2862 pBeaconStruct->channelNumber = pBies->DSParams.curr_channel;
2863 }
2864 else if(pBies->HTInfo.present)
2865 {
2866 pBeaconStruct->channelNumber = pBies->HTInfo.primaryChannel;
2867 }
2868
2869 if ( pBies->RSN.present )
2870 {
2871 pBeaconStruct->rsnPresent = 1;
2872 ConvertRSN( pMac, &pBeaconStruct->rsn, &pBies->RSN );
2873 }
2874
2875 if ( pBies->WPA.present )
2876 {
2877 pBeaconStruct->wpaPresent = 1;
2878 ConvertWPA( pMac, &pBeaconStruct->wpa, &pBies->WPA );
2879 }
2880
2881 if ( pBies->WMMParams.present )
2882 {
2883 pBeaconStruct->wmeEdcaPresent = 1;
2884 ConvertWMMParams( pMac, &pBeaconStruct->edcaParams, &pBies->WMMParams );
2885 }
2886
2887 if ( pBies->WMMInfoAp.present )
2888 {
2889 pBeaconStruct->wmeInfoPresent = 1;
2890 }
2891
2892 if ( pBies->WMMCaps.present )
2893 {
2894 pBeaconStruct->wsmCapablePresent = 1;
2895 }
2896
2897
2898 if ( pBies->ERPInfo.present )
2899 {
2900 pBeaconStruct->erpPresent = 1;
2901 ConvertERPInfo( pMac, &pBeaconStruct->erpIEInfo, &pBies->ERPInfo );
2902 }
2903
Jeff Johnsone7245742012-09-05 17:12:55 -07002904#ifdef WLAN_FEATURE_11AC
2905 if ( pBies->VHTCaps.present )
2906 {
2907 pBeaconStruct->VHTCaps.present = 1;
2908 palCopyMemory( pMac, &pBeaconStruct->VHTCaps, &pBies->VHTCaps, sizeof( tDot11fIEVHTCaps ) );
2909 }
2910 if ( pBies->VHTOperation.present )
2911 {
2912 pBeaconStruct->VHTOperation.present = 1;
2913 palCopyMemory( pMac, &pBeaconStruct->VHTOperation, &pBies->VHTOperation, sizeof( tDot11fIEVHTOperation) );
2914 }
2915 if ( pBies->VHTExtBssLoad.present )
2916 {
2917 pBeaconStruct->VHTExtBssLoad.present = 1;
2918 palCopyMemory( pMac, &pBeaconStruct->VHTExtBssLoad, &pBies->VHTExtBssLoad, sizeof( tDot11fIEVHTExtBssLoad) );
2919 }
Mohit Khanna4a70d262012-09-11 16:30:12 -07002920 if( pBies->OperatingMode.present)
2921 {
2922 pBeaconStruct->OperatingMode.present = 1;
2923 palCopyMemory( pMac, &pBeaconStruct->OperatingMode, &pBies->OperatingMode, sizeof( tDot11fIEOperatingMode) );
2924 }
2925
Jeff Johnsone7245742012-09-05 17:12:55 -07002926#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002927 palFreeMemory(pMac->hHdd, pBies);
2928
Jeff Johnsone7245742012-09-05 17:12:55 -07002929
Jeff Johnson295189b2012-06-20 16:38:30 -07002930 return eSIR_SUCCESS;
2931
2932} // End sirParseBeaconIE.
2933
2934tSirRetStatus
2935sirConvertBeaconFrame2Struct(tpAniSirGlobal pMac,
2936 tANI_U8 *pFrame,
2937 tpSirProbeRespBeacon pBeaconStruct)
2938{
Jeff Johnson32d95a32012-09-10 13:15:23 -07002939 tDot11fBeacon *pBeacon;
Jeff Johnson295189b2012-06-20 16:38:30 -07002940 tANI_U32 status, nPayload;
2941 tANI_U8 *pPayload;
2942 tpSirMacMgmtHdr pHdr;
2943 tANI_U8 mappedRXCh;
2944
2945 pPayload = WDA_GET_RX_MPDU_DATA( pFrame );
2946 nPayload = WDA_GET_RX_PAYLOAD_LEN( pFrame );
2947 pHdr = WDA_GET_RX_MAC_HEADER( pFrame );
2948 mappedRXCh = WDA_GET_RX_CH( pFrame );
2949
2950 // Zero-init our [out] parameter,
2951 palZeroMemory( pMac->hHdd, ( tANI_U8* )pBeaconStruct, sizeof(tSirProbeRespBeacon) );
Jeff Johnson32d95a32012-09-10 13:15:23 -07002952
2953 status = palAllocateMemory(pMac->hHdd, (void **)&pBeacon, sizeof(tDot11fBeacon));
2954 if(!HAL_STATUS_SUCCESS(status))
2955 {
2956 limLog(pMac, LOGE, FL("Failed to allocate memory\n") );
2957 return eSIR_FAILURE;
2958 }
2959
2960 palZeroMemory( pMac->hHdd, ( tANI_U8* )pBeacon, sizeof(tDot11fBeacon) );
Jeff Johnson295189b2012-06-20 16:38:30 -07002961
2962 // get the MAC address out of the BD,
2963 palCopyMemory( pMac->hHdd, pBeaconStruct->bssid, pHdr->sa, 6 );
2964
2965 // delegate to the framesc-generated code,
Jeff Johnson32d95a32012-09-10 13:15:23 -07002966 status = dot11fUnpackBeacon( pMac, pPayload, nPayload, pBeacon );
Jeff Johnson295189b2012-06-20 16:38:30 -07002967 if ( DOT11F_FAILED( status ) )
2968 {
2969 limLog(pMac, LOGE, FL("Failed to parse Beacon IEs (0x%08x, %d bytes):\n"),
2970 status, nPayload);
2971 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);)
Jeff Johnson32d95a32012-09-10 13:15:23 -07002972 palFreeMemory(pMac->hHdd, pBeacon);
Jeff Johnson295189b2012-06-20 16:38:30 -07002973 return eSIR_FAILURE;
2974 }
2975 else if ( DOT11F_WARNED( status ) )
2976 {
2977 limLog( pMac, LOGW, FL("There were warnings while unpacking Beacon IEs (0x%08x, %d bytes):\n"),
2978 status, nPayload );
2979 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);)
2980 }
2981
2982 // & "transliterate" from a 'tDot11fBeacon' to a 'tSirProbeRespBeacon'...
2983 // Timestamp
Jeff Johnson32d95a32012-09-10 13:15:23 -07002984 palCopyMemory( pMac->hHdd, ( tANI_U8* )pBeaconStruct->timeStamp, ( tANI_U8* )&pBeacon->TimeStamp, sizeof(tSirMacTimeStamp) );
Jeff Johnson295189b2012-06-20 16:38:30 -07002985
2986 // Beacon Interval
Jeff Johnson32d95a32012-09-10 13:15:23 -07002987 pBeaconStruct->beaconInterval = pBeacon->BeaconInterval.interval;
Jeff Johnson295189b2012-06-20 16:38:30 -07002988
2989 // Capabilities
Jeff Johnson32d95a32012-09-10 13:15:23 -07002990 pBeaconStruct->capabilityInfo.ess = pBeacon->Capabilities.ess;
2991 pBeaconStruct->capabilityInfo.ibss = pBeacon->Capabilities.ibss;
2992 pBeaconStruct->capabilityInfo.cfPollable = pBeacon->Capabilities.cfPollable;
2993 pBeaconStruct->capabilityInfo.cfPollReq = pBeacon->Capabilities.cfPollReq;
2994 pBeaconStruct->capabilityInfo.privacy = pBeacon->Capabilities.privacy;
2995 pBeaconStruct->capabilityInfo.shortPreamble = pBeacon->Capabilities.shortPreamble;
2996 pBeaconStruct->capabilityInfo.pbcc = pBeacon->Capabilities.pbcc;
2997 pBeaconStruct->capabilityInfo.channelAgility = pBeacon->Capabilities.channelAgility;
2998 pBeaconStruct->capabilityInfo.spectrumMgt = pBeacon->Capabilities.spectrumMgt;
2999 pBeaconStruct->capabilityInfo.qos = pBeacon->Capabilities.qos;
3000 pBeaconStruct->capabilityInfo.shortSlotTime = pBeacon->Capabilities.shortSlotTime;
3001 pBeaconStruct->capabilityInfo.apsd = pBeacon->Capabilities.apsd;
3002 pBeaconStruct->capabilityInfo.rrm = pBeacon->Capabilities.rrm;
3003 pBeaconStruct->capabilityInfo.dsssOfdm = pBeacon->Capabilities.dsssOfdm;
3004 pBeaconStruct->capabilityInfo.delayedBA = pBeacon->Capabilities.delayedBA;
3005 pBeaconStruct->capabilityInfo.immediateBA = pBeacon->Capabilities.immediateBA;
Jeff Johnson295189b2012-06-20 16:38:30 -07003006
Jeff Johnson32d95a32012-09-10 13:15:23 -07003007 if ( ! pBeacon->SSID.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003008 {
3009 PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!\n"));)
3010 }
3011 else
3012 {
3013 pBeaconStruct->ssidPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003014 ConvertSSID( pMac, &pBeaconStruct->ssId, &pBeacon->SSID );
Jeff Johnson295189b2012-06-20 16:38:30 -07003015 }
3016
Jeff Johnson32d95a32012-09-10 13:15:23 -07003017 if ( ! pBeacon->SuppRates.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003018 {
3019 PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!\n"));)
3020 }
3021 else
3022 {
3023 pBeaconStruct->suppRatesPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003024 ConvertSuppRates( pMac, &pBeaconStruct->supportedRates, &pBeacon->SuppRates );
Jeff Johnson295189b2012-06-20 16:38:30 -07003025 }
3026
Jeff Johnson32d95a32012-09-10 13:15:23 -07003027 if ( pBeacon->ExtSuppRates.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003028 {
3029 pBeaconStruct->extendedRatesPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003030 ConvertExtSuppRates( pMac, &pBeaconStruct->extendedRates, &pBeacon->ExtSuppRates );
Jeff Johnson295189b2012-06-20 16:38:30 -07003031 }
3032
3033
Jeff Johnson32d95a32012-09-10 13:15:23 -07003034 if ( pBeacon->CFParams.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003035 {
3036 pBeaconStruct->cfPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003037 ConvertCFParams( pMac, &pBeaconStruct->cfParamSet, &pBeacon->CFParams );
Jeff Johnson295189b2012-06-20 16:38:30 -07003038 }
3039
Jeff Johnson32d95a32012-09-10 13:15:23 -07003040 if ( pBeacon->TIM.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003041 {
3042 pBeaconStruct->timPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003043 ConvertTIM( pMac, &pBeaconStruct->tim, &pBeacon->TIM );
Jeff Johnson295189b2012-06-20 16:38:30 -07003044 }
3045
Jeff Johnson32d95a32012-09-10 13:15:23 -07003046 if ( pBeacon->Country.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003047 {
3048 pBeaconStruct->countryInfoPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003049 ConvertCountry( pMac, &pBeaconStruct->countryInfoParam, &pBeacon->Country );
Jeff Johnson295189b2012-06-20 16:38:30 -07003050 }
3051
3052 // QOS Capabilities:
Jeff Johnson32d95a32012-09-10 13:15:23 -07003053 if ( pBeacon->QOSCapsAp.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003054 {
3055 pBeaconStruct->qosCapabilityPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003056 ConvertQOSCaps( pMac, &pBeaconStruct->qosCapability, &pBeacon->QOSCapsAp );
Jeff Johnson295189b2012-06-20 16:38:30 -07003057 }
3058
Jeff Johnson32d95a32012-09-10 13:15:23 -07003059 if ( pBeacon->EDCAParamSet.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003060 {
3061 pBeaconStruct->edcaPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003062 ConvertEDCAParam( pMac, &pBeaconStruct->edcaParams, &pBeacon->EDCAParamSet );
Jeff Johnson295189b2012-06-20 16:38:30 -07003063 }
3064
Jeff Johnson32d95a32012-09-10 13:15:23 -07003065 if ( pBeacon->ChanSwitchAnn.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003066 {
3067 pBeaconStruct->channelSwitchPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003068 palCopyMemory( pMac, &pBeaconStruct->channelSwitchIE, &pBeacon->ChanSwitchAnn,
Jeff Johnson295189b2012-06-20 16:38:30 -07003069 sizeof(tDot11fIEChanSwitchAnn) );
3070 }
3071
Jeff Johnson32d95a32012-09-10 13:15:23 -07003072 if ( pBeacon->ExtChanSwitchAnn.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003073 {
3074 pBeaconStruct->extChannelSwitchPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003075 palCopyMemory( pMac, &pBeaconStruct->extChannelSwitchIE, &pBeacon->ExtChanSwitchAnn,
Jeff Johnson295189b2012-06-20 16:38:30 -07003076 sizeof(tDot11fIEExtChanSwitchAnn) );
3077 }
3078
Jeff Johnson32d95a32012-09-10 13:15:23 -07003079 if( pBeacon->TPCReport.present)
Jeff Johnson295189b2012-06-20 16:38:30 -07003080 {
3081 pBeaconStruct->tpcReportPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003082 palCopyMemory(pMac->hHdd, &pBeaconStruct->tpcReport, &pBeacon->TPCReport,
Jeff Johnson295189b2012-06-20 16:38:30 -07003083 sizeof(tDot11fIETPCReport));
3084 }
3085
Jeff Johnson32d95a32012-09-10 13:15:23 -07003086 if( pBeacon->PowerConstraints.present)
Jeff Johnson295189b2012-06-20 16:38:30 -07003087 {
3088 pBeaconStruct->powerConstraintPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003089 palCopyMemory(pMac->hHdd, &pBeaconStruct->localPowerConstraint, &pBeacon->PowerConstraints,
Jeff Johnson295189b2012-06-20 16:38:30 -07003090 sizeof(tDot11fIEPowerConstraints));
3091 }
Jeff Johnson32d95a32012-09-10 13:15:23 -07003092
3093 if ( pBeacon->Quiet.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003094 {
3095 pBeaconStruct->quietIEPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003096 palCopyMemory( pMac, &pBeaconStruct->quietIE, &pBeacon->Quiet, sizeof(tDot11fIEQuiet));
Jeff Johnson295189b2012-06-20 16:38:30 -07003097 }
3098
Jeff Johnson32d95a32012-09-10 13:15:23 -07003099 if ( pBeacon->HTCaps.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003100 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07003101 palCopyMemory( pMac, &pBeaconStruct->HTCaps, &pBeacon->HTCaps, sizeof( tDot11fIEHTCaps ) );
Jeff Johnson295189b2012-06-20 16:38:30 -07003102 }
3103
Jeff Johnson32d95a32012-09-10 13:15:23 -07003104 if ( pBeacon->HTInfo.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003105 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07003106 palCopyMemory( pMac, &pBeaconStruct->HTInfo, &pBeacon->HTInfo, sizeof( tDot11fIEHTInfo) );
Jeff Johnson295189b2012-06-20 16:38:30 -07003107
3108 }
3109
Jeff Johnson32d95a32012-09-10 13:15:23 -07003110 if ( pBeacon->DSParams.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003111 {
3112 pBeaconStruct->dsParamsPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003113 pBeaconStruct->channelNumber = pBeacon->DSParams.curr_channel;
Jeff Johnson295189b2012-06-20 16:38:30 -07003114 }
Jeff Johnson32d95a32012-09-10 13:15:23 -07003115 else if(pBeacon->HTInfo.present)
Jeff Johnson295189b2012-06-20 16:38:30 -07003116 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07003117 pBeaconStruct->channelNumber = pBeacon->HTInfo.primaryChannel;
Jeff Johnson295189b2012-06-20 16:38:30 -07003118 }
3119 else
3120 {
3121 pBeaconStruct->channelNumber = limUnmapChannel(mappedRXCh);
3122 }
3123
Jeff Johnson32d95a32012-09-10 13:15:23 -07003124 if ( pBeacon->RSN.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003125 {
3126 pBeaconStruct->rsnPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003127 ConvertRSN( pMac, &pBeaconStruct->rsn, &pBeacon->RSN );
Jeff Johnson295189b2012-06-20 16:38:30 -07003128 }
3129
Jeff Johnson32d95a32012-09-10 13:15:23 -07003130 if ( pBeacon->WPA.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003131 {
3132 pBeaconStruct->wpaPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003133 ConvertWPA( pMac, &pBeaconStruct->wpa, &pBeacon->WPA );
Jeff Johnson295189b2012-06-20 16:38:30 -07003134 }
3135
Jeff Johnson32d95a32012-09-10 13:15:23 -07003136 if ( pBeacon->WMMParams.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003137 {
3138 pBeaconStruct->wmeEdcaPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003139 ConvertWMMParams( pMac, &pBeaconStruct->edcaParams, &pBeacon->WMMParams );
Jeff Johnson295189b2012-06-20 16:38:30 -07003140 PELOG1(limLog(pMac, LOG1, FL("WMM Parameter present in Beacon Frame!\n"));
Jeff Johnson32d95a32012-09-10 13:15:23 -07003141 __printWMMParams(pMac, &pBeacon->WMMParams); )
Jeff Johnson295189b2012-06-20 16:38:30 -07003142 }
3143
Jeff Johnson32d95a32012-09-10 13:15:23 -07003144 if ( pBeacon->WMMInfoAp.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003145 {
3146 pBeaconStruct->wmeInfoPresent = 1;
3147 PELOG1(limLog(pMac, LOG1, FL("WMM Info present in Beacon Frame!\n"));)
3148 }
3149
Jeff Johnson32d95a32012-09-10 13:15:23 -07003150 if ( pBeacon->WMMCaps.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003151 {
3152 pBeaconStruct->wsmCapablePresent = 1;
3153 }
3154
Jeff Johnson32d95a32012-09-10 13:15:23 -07003155 if ( pBeacon->ERPInfo.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003156 {
3157 pBeaconStruct->erpPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003158 ConvertERPInfo( pMac, &pBeaconStruct->erpIEInfo, &pBeacon->ERPInfo );
Jeff Johnson295189b2012-06-20 16:38:30 -07003159 }
3160
3161#ifdef WLAN_FEATURE_VOWIFI_11R
Jeff Johnson32d95a32012-09-10 13:15:23 -07003162 if (pBeacon->MobilityDomain.present)
Jeff Johnson295189b2012-06-20 16:38:30 -07003163 {
3164 // MobilityDomain
3165 pBeaconStruct->mdiePresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003166 palCopyMemory( pMac->hHdd, (tANI_U8 *)&(pBeaconStruct->mdie[0]), (tANI_U8 *)&(pBeacon->MobilityDomain.MDID), sizeof(tANI_U16) );
3167 pBeaconStruct->mdie[2] = ((pBeacon->MobilityDomain.overDSCap << 0) | (pBeacon->MobilityDomain.resourceReqCap << 1));
Jeff Johnson295189b2012-06-20 16:38:30 -07003168
3169 }
3170#endif
3171
Jeff Johnsone7245742012-09-05 17:12:55 -07003172#ifdef WLAN_FEATURE_11AC
Jeff Johnson32d95a32012-09-10 13:15:23 -07003173 if ( pBeacon->VHTCaps.present )
Jeff Johnsone7245742012-09-05 17:12:55 -07003174 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07003175 palCopyMemory( pMac, &pBeaconStruct->VHTCaps, &pBeacon->VHTCaps, sizeof( tDot11fIEVHTCaps ) );
Jeff Johnsone7245742012-09-05 17:12:55 -07003176 }
Jeff Johnson32d95a32012-09-10 13:15:23 -07003177 if ( pBeacon->VHTOperation.present )
Jeff Johnsone7245742012-09-05 17:12:55 -07003178 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07003179 palCopyMemory( pMac, &pBeaconStruct->VHTOperation, &pBeacon->VHTOperation, sizeof( tDot11fIEVHTOperation) );
Jeff Johnsone7245742012-09-05 17:12:55 -07003180 }
Jeff Johnson32d95a32012-09-10 13:15:23 -07003181 if ( pBeacon->VHTExtBssLoad.present )
Jeff Johnsone7245742012-09-05 17:12:55 -07003182 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07003183 palCopyMemory( pMac, &pBeaconStruct->VHTExtBssLoad, &pBeacon->VHTExtBssLoad, sizeof( tDot11fIEVHTExtBssLoad) );
Jeff Johnsone7245742012-09-05 17:12:55 -07003184 }
Mohit Khanna4a70d262012-09-11 16:30:12 -07003185 if(pBeacon->OperatingMode.present)
3186 {
3187 palCopyMemory( pMac, &pBeaconStruct->OperatingMode, &pBeacon->OperatingMode, sizeof( tDot11fIEOperatingMode) );
3188 }
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -07003189 if(pBeacon->WiderBWChanSwitchAnn.present)
3190 {
3191 pBeaconStruct->WiderBWChanSwitchAnnPresent = 1;
3192 palCopyMemory( pMac, &pBeaconStruct->WiderBWChanSwitchAnn, &pBeacon->WiderBWChanSwitchAnn, sizeof( tDot11fIEWiderBWChanSwitchAnn));
3193 }
Jeff Johnsone7245742012-09-05 17:12:55 -07003194#endif
3195
Jeff Johnson32d95a32012-09-10 13:15:23 -07003196 palFreeMemory(pMac->hHdd, pBeacon);
Jeff Johnson295189b2012-06-20 16:38:30 -07003197 return eSIR_SUCCESS;
3198
3199} // End sirConvertBeaconFrame2Struct.
3200
3201tSirRetStatus
3202sirConvertAuthFrame2Struct(tpAniSirGlobal pMac,
3203 tANI_U8 *pFrame,
3204 tANI_U32 nFrame,
3205 tpSirMacAuthFrameBody pAuth)
3206{
3207 static tDot11fAuthentication auth;
3208 tANI_U32 status;
3209
3210 // Zero-init our [out] parameter,
3211 palZeroMemory( pMac->hHdd, ( tANI_U8* )pAuth, sizeof(tSirMacAuthFrameBody) );
3212
3213 // delegate to the framesc-generated code,
3214 status = dot11fUnpackAuthentication( pMac, pFrame, nFrame, &auth );
3215 if ( DOT11F_FAILED( status ) )
3216 {
3217 limLog(pMac, LOGE, FL("Failed to parse an Authentication frame (0x%08x, %d bytes):\n"),
3218 status, nFrame);
3219 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3220 return eSIR_FAILURE;
3221 }
3222 else if ( DOT11F_WARNED( status ) )
3223 {
3224 limLog( pMac, LOGW, FL("There were warnings while unpacking an Authentication frame (0x%08x, %d bytes):\n"),
3225 status, nFrame );
3226 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3227 }
3228
3229 // & "transliterate" from a 'tDot11fAuthentication' to a 'tSirMacAuthFrameBody'...
3230 pAuth->authAlgoNumber = auth.AuthAlgo.algo;
3231 pAuth->authTransactionSeqNumber = auth.AuthSeqNo.no;
3232 pAuth->authStatusCode = auth.Status.status;
3233
3234 if ( auth.ChallengeText.present )
3235 {
3236 pAuth->type = SIR_MAC_CHALLENGE_TEXT_EID;
3237 pAuth->length = auth.ChallengeText.num_text;
3238 palCopyMemory( pMac->hHdd, pAuth->challengeText, auth.ChallengeText.text, auth.ChallengeText.num_text );
3239 }
3240
3241 return eSIR_SUCCESS;
3242
3243} // End sirConvertAuthFrame2Struct.
3244
3245tSirRetStatus
3246sirConvertAddtsReq2Struct(tpAniSirGlobal pMac,
3247 tANI_U8 *pFrame,
3248 tANI_U32 nFrame,
3249 tSirAddtsReqInfo *pAddTs)
3250{
3251 tDot11fAddTSRequest addts = {{0}};
3252 tDot11fWMMAddTSRequest wmmaddts = {{0}};
3253 tANI_U8 j;
3254 tANI_U16 i;
3255 tANI_U32 status;
3256
3257 if ( SIR_MAC_QOS_ADD_TS_REQ != *( pFrame + 1 ) )
3258 {
3259 limLog( pMac, LOGE, FL("sirConvertAddtsReq2Struct invoked "
3260 "with an Action of %d; this is not "
3261 "supported & is probably an error."),
3262 *( pFrame + 1 ) );
3263 return eSIR_FAILURE;
3264 }
3265
3266 // Zero-init our [out] parameter,
3267 palZeroMemory( pMac->hHdd, ( tANI_U8* )pAddTs, sizeof(tSirAddtsReqInfo) );
3268
3269 // delegate to the framesc-generated code,
3270 switch ( *pFrame )
3271 {
3272 case SIR_MAC_ACTION_QOS_MGMT:
3273 status = dot11fUnpackAddTSRequest( pMac, pFrame, nFrame, &addts );
3274 break;
3275 case SIR_MAC_ACTION_WME:
3276 status = dot11fUnpackWMMAddTSRequest( pMac, pFrame, nFrame, &wmmaddts );
3277 break;
3278 default:
3279 limLog( pMac, LOGE, FL("sirConvertAddtsReq2Struct invoked "
3280 "with a Category of %d; this is not"
3281 " supported & is probably an error."),
3282 *pFrame );
3283 return eSIR_FAILURE;
3284 }
3285
3286 if ( DOT11F_FAILED( status ) )
3287 {
3288 limLog(pMac, LOGE, FL("Failed to parse an Add TS Request f"
3289 "rame (0x%08x, %d bytes):\n"),
3290 status, nFrame);
3291 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3292 return eSIR_FAILURE;
3293 }
3294 else if ( DOT11F_WARNED( status ) )
3295 {
3296 limLog( pMac, LOGW, FL("There were warnings while unpackin"
3297 "g an Add TS Request frame (0x%08x,"
3298 "%d bytes):\n"),
3299 status, nFrame );
3300 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3301 }
3302
3303 // & "transliterate" from a 'tDot11fAddTSRequest' or a
3304 // 'tDot11WMMAddTSRequest' to a 'tSirMacAddtsReqInfo'...
3305 if ( SIR_MAC_ACTION_QOS_MGMT == *pFrame )
3306 {
3307 pAddTs->dialogToken = addts.DialogToken.token;
3308
3309 if ( addts.TSPEC.present )
3310 {
3311 ConvertTSPEC( pMac, &pAddTs->tspec, &addts.TSPEC );
3312 }
3313 else
3314 {
3315 limLog( pMac, LOGE, FL("Mandatory TSPEC element missing in Add TS Request.\n") );
3316 return eSIR_FAILURE;
3317 }
3318
3319 if ( addts.num_TCLAS )
3320 {
3321 pAddTs->numTclas = (tANI_U8)addts.num_TCLAS;
3322
3323 for ( i = 0U; i < addts.num_TCLAS; ++i )
3324 {
3325 if ( eSIR_SUCCESS != ConvertTCLAS( pMac, &( pAddTs->tclasInfo[i] ), &( addts.TCLAS[i] ) ) )
3326 {
3327 limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.\n") );
3328 return eSIR_FAILURE;
3329 }
3330 }
3331 }
3332
3333 if ( addts.TCLASSPROC.present )
3334 {
3335 pAddTs->tclasProcPresent = 1;
3336 pAddTs->tclasProc = addts.TCLASSPROC.processing;
3337 }
3338
3339 if ( addts.WMMTSPEC.present )
3340 {
3341 pAddTs->wsmTspecPresent = 1;
3342 ConvertWMMTSPEC( pMac, &pAddTs->tspec, &addts.WMMTSPEC );
3343 }
3344
3345 if ( addts.num_WMMTCLAS )
3346 {
3347 j = (tANI_U8)(pAddTs->numTclas + addts.num_WMMTCLAS);
3348 if ( SIR_MAC_TCLASIE_MAXNUM > j ) j = SIR_MAC_TCLASIE_MAXNUM;
3349
3350 for ( i = pAddTs->numTclas; i < j; ++i )
3351 {
3352 if ( eSIR_SUCCESS != ConvertWMMTCLAS( pMac, &( pAddTs->tclasInfo[i] ), &( addts.WMMTCLAS[i] ) ) )
3353 {
3354 limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.\n") );
3355 return eSIR_FAILURE;
3356 }
3357 }
3358 }
3359
3360 if ( addts.WMMTCLASPROC.present )
3361 {
3362 pAddTs->tclasProcPresent = 1;
3363 pAddTs->tclasProc = addts.WMMTCLASPROC.processing;
3364 }
3365
3366 if ( 1 < pAddTs->numTclas && ( ! pAddTs->tclasProcPresent ) )
3367 {
3368 limLog( pMac, LOGE, FL("%d TCLAS IE but not TCLASPROC IE.\n"),
3369 pAddTs->numTclas );
3370 return eSIR_FAILURE;
3371 }
3372 }
3373 else
3374 {
3375 pAddTs->dialogToken = wmmaddts.DialogToken.token;
3376
3377 if ( wmmaddts.WMMTSPEC.present )
3378 {
3379 pAddTs->wmeTspecPresent = 1;
3380 ConvertWMMTSPEC( pMac, &pAddTs->tspec, &wmmaddts.WMMTSPEC );
3381 }
3382 else
3383 {
3384 limLog( pMac, LOGE, FL("Mandatory WME TSPEC element missing!\n") );
3385 return eSIR_FAILURE;
3386 }
3387 }
3388
3389 return eSIR_SUCCESS;
3390
3391} // End sirConvertAddtsReq2Struct.
3392
3393tSirRetStatus
3394sirConvertAddtsRsp2Struct(tpAniSirGlobal pMac,
3395 tANI_U8 *pFrame,
3396 tANI_U32 nFrame,
3397 tSirAddtsRspInfo *pAddTs)
3398{
3399 tDot11fAddTSResponse addts = {{0}};
3400 tDot11fWMMAddTSResponse wmmaddts = {{0}};
3401 tANI_U8 j;
3402 tANI_U16 i;
3403 tANI_U32 status;
3404
3405 if ( SIR_MAC_QOS_ADD_TS_RSP != *( pFrame + 1 ) )
3406 {
3407 limLog( pMac, LOGE, FL("sirConvertAddtsRsp2Struct invoked "
3408 "with an Action of %d; this is not "
3409 "supported & is probably an error."),
3410 *( pFrame + 1 ) );
3411 return eSIR_FAILURE;
3412 }
3413
3414 // Zero-init our [out] parameter,
3415 palZeroMemory( pMac->hHdd, ( tANI_U8* )pAddTs, sizeof(tSirAddtsRspInfo) );
3416 palZeroMemory( pMac->hHdd, ( tANI_U8* )&addts, sizeof(tDot11fAddTSResponse) );
3417 palZeroMemory( pMac->hHdd, ( tANI_U8* )&wmmaddts, sizeof(tDot11fWMMAddTSResponse) );
3418
3419
3420 // delegate to the framesc-generated code,
3421 switch ( *pFrame )
3422 {
3423 case SIR_MAC_ACTION_QOS_MGMT:
3424 status = dot11fUnpackAddTSResponse( pMac, pFrame, nFrame, &addts );
3425 break;
3426 case SIR_MAC_ACTION_WME:
3427 status = dot11fUnpackWMMAddTSResponse( pMac, pFrame, nFrame, &wmmaddts );
3428 break;
3429 default:
3430 limLog( pMac, LOGE, FL("sirConvertAddtsRsp2Struct invoked "
3431 "with a Category of %d; this is not"
3432 " supported & is probably an error."),
3433 *pFrame );
3434 return eSIR_FAILURE;
3435 }
3436
3437 if ( DOT11F_FAILED( status ) )
3438 {
3439 limLog(pMac, LOGE, FL("Failed to parse an Add TS Response f"
3440 "rame (0x%08x, %d bytes):\n"),
3441 status, nFrame);
3442 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3443 return eSIR_FAILURE;
3444 }
3445 else if ( DOT11F_WARNED( status ) )
3446 {
3447 limLog( pMac, LOGW, FL("There were warnings while unpackin"
3448 "g an Add TS Response frame (0x%08x,"
3449 "%d bytes):\n"),
3450 status, nFrame );
3451 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3452 }
3453
3454 // & "transliterate" from a 'tDot11fAddTSResponse' or a
3455 // 'tDot11WMMAddTSResponse' to a 'tSirMacAddtsRspInfo'...
3456 if ( SIR_MAC_ACTION_QOS_MGMT == *pFrame )
3457 {
3458 pAddTs->dialogToken = addts.DialogToken.token;
3459 pAddTs->status = ( tSirMacStatusCodes )addts.Status.status;
3460
3461 if ( addts.TSDelay.present )
3462 {
3463 ConvertTSDelay( pMac, &pAddTs->delay, &addts.TSDelay );
3464 }
3465
3466 // TS Delay is present iff status indicates its presence
3467 if ( eSIR_MAC_TS_NOT_CREATED_STATUS == pAddTs->status && ! addts.TSDelay.present )
3468 {
3469 limLog( pMac, LOGW, FL("Missing TSDelay IE.\n") );
3470 }
3471
3472 if ( addts.TSPEC.present )
3473 {
3474 ConvertTSPEC( pMac, &pAddTs->tspec, &addts.TSPEC );
3475 }
3476 else
3477 {
3478 limLog( pMac, LOGE, FL("Mandatory TSPEC element missing in Add TS Response.\n") );
3479 return eSIR_FAILURE;
3480 }
3481
3482 if ( addts.num_TCLAS )
3483 {
3484 pAddTs->numTclas = (tANI_U8)addts.num_TCLAS;
3485
3486 for ( i = 0U; i < addts.num_TCLAS; ++i )
3487 {
3488 if ( eSIR_SUCCESS != ConvertTCLAS( pMac, &( pAddTs->tclasInfo[i] ), &( addts.TCLAS[i] ) ) )
3489 {
3490 limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.\n") );
3491 return eSIR_FAILURE;
3492 }
3493 }
3494 }
3495
3496 if ( addts.TCLASSPROC.present )
3497 {
3498 pAddTs->tclasProcPresent = 1;
3499 pAddTs->tclasProc = addts.TCLASSPROC.processing;
3500 }
3501#ifdef FEATURE_WLAN_CCX
3502 if(addts.CCXTrafStrmMet.present)
3503 {
3504 pAddTs->tsmPresent = 1;
3505 palCopyMemory(pMac->hHdd,&pAddTs->tsmIE.tsid,
3506 &addts.CCXTrafStrmMet.tsid,sizeof(tSirMacCCXTSMIE));
3507 }
3508#endif
3509 if ( addts.Schedule.present )
3510 {
3511 pAddTs->schedulePresent = 1;
3512 ConvertSchedule( pMac, &pAddTs->schedule, &addts.Schedule );
3513 }
3514
3515 if ( addts.WMMSchedule.present )
3516 {
3517 pAddTs->schedulePresent = 1;
3518 ConvertWMMSchedule( pMac, &pAddTs->schedule, &addts.WMMSchedule );
3519 }
3520
3521 if ( addts.WMMTSPEC.present )
3522 {
3523 pAddTs->wsmTspecPresent = 1;
3524 ConvertWMMTSPEC( pMac, &pAddTs->tspec, &addts.WMMTSPEC );
3525 }
3526
3527 if ( addts.num_WMMTCLAS )
3528 {
3529 j = (tANI_U8)(pAddTs->numTclas + addts.num_WMMTCLAS);
3530 if ( SIR_MAC_TCLASIE_MAXNUM > j ) j = SIR_MAC_TCLASIE_MAXNUM;
3531
3532 for ( i = pAddTs->numTclas; i < j; ++i )
3533 {
3534 if ( eSIR_SUCCESS != ConvertWMMTCLAS( pMac, &( pAddTs->tclasInfo[i] ), &( addts.WMMTCLAS[i] ) ) )
3535 {
3536 limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.\n") );
3537 return eSIR_FAILURE;
3538 }
3539 }
3540 }
3541
3542 if ( addts.WMMTCLASPROC.present )
3543 {
3544 pAddTs->tclasProcPresent = 1;
3545 pAddTs->tclasProc = addts.WMMTCLASPROC.processing;
3546 }
3547
3548 if ( 1 < pAddTs->numTclas && ( ! pAddTs->tclasProcPresent ) )
3549 {
3550 limLog( pMac, LOGE, FL("%d TCLAS IE but not TCLASPROC IE.\n"),
3551 pAddTs->numTclas );
3552 return eSIR_FAILURE;
3553 }
3554 }
3555 else
3556 {
3557 pAddTs->dialogToken = wmmaddts.DialogToken.token;
3558 pAddTs->status = ( tSirMacStatusCodes )wmmaddts.StatusCode.statusCode;
3559
3560 if ( wmmaddts.WMMTSPEC.present )
3561 {
3562 pAddTs->wmeTspecPresent = 1;
3563 ConvertWMMTSPEC( pMac, &pAddTs->tspec, &wmmaddts.WMMTSPEC );
3564 }
3565 else
3566 {
3567 limLog( pMac, LOGE, FL("Mandatory WME TSPEC element missing!\n") );
3568 return eSIR_FAILURE;
3569 }
3570
3571#ifdef FEATURE_WLAN_CCX
3572 if(wmmaddts.CCXTrafStrmMet.present)
3573 {
3574 pAddTs->tsmPresent = 1;
3575 palCopyMemory(pMac->hHdd,&pAddTs->tsmIE.tsid,
3576 &wmmaddts.CCXTrafStrmMet.tsid,sizeof(tSirMacCCXTSMIE));
3577 }
3578#endif
3579
3580 }
3581
3582 return eSIR_SUCCESS;
3583
3584} // End sirConvertAddtsRsp2Struct.
3585
3586tSirRetStatus
3587sirConvertDeltsReq2Struct(tpAniSirGlobal pMac,
3588 tANI_U8 *pFrame,
3589 tANI_U32 nFrame,
3590 tSirDeltsReqInfo *pDelTs)
3591{
3592 tDot11fDelTS delts = {{0}};
3593 tDot11fWMMDelTS wmmdelts = {{0}};
3594 tANI_U32 status;
3595
3596 if ( SIR_MAC_QOS_DEL_TS_REQ != *( pFrame + 1 ) )
3597 {
3598 limLog( pMac, LOGE, FL("sirConvertDeltsRsp2Struct invoked "
3599 "with an Action of %d; this is not "
3600 "supported & is probably an error."),
3601 *( pFrame + 1 ) );
3602 return eSIR_FAILURE;
3603 }
3604
3605 // Zero-init our [out] parameter,
3606 palZeroMemory( pMac->hHdd, ( tANI_U8* )pDelTs, sizeof(tSirDeltsReqInfo) );
3607
3608 // delegate to the framesc-generated code,
3609 switch ( *pFrame )
3610 {
3611 case SIR_MAC_ACTION_QOS_MGMT:
3612 status = dot11fUnpackDelTS( pMac, pFrame, nFrame, &delts );
3613 break;
3614 case SIR_MAC_ACTION_WME:
3615 status = dot11fUnpackWMMDelTS( pMac, pFrame, nFrame, &wmmdelts );
3616 break;
3617 default:
3618 limLog( pMac, LOGE, FL("sirConvertDeltsRsp2Struct invoked "
3619 "with a Category of %d; this is not"
3620 " supported & is probably an error."),
3621 *pFrame );
3622 return eSIR_FAILURE;
3623 }
3624
3625 if ( DOT11F_FAILED( status ) )
3626 {
3627 limLog(pMac, LOGE, FL("Failed to parse an Del TS Request f"
3628 "rame (0x%08x, %d bytes):\n"),
3629 status, nFrame);
3630 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3631 return eSIR_FAILURE;
3632 }
3633 else if ( DOT11F_WARNED( status ) )
3634 {
3635 dot11fLog( pMac, LOGW, FL("There were warnings while unpackin"
3636 "g an Del TS Request frame (0x%08x,"
3637 "%d bytes):\n"),
3638 status, nFrame );
3639 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3640 }
3641
3642 // & "transliterate" from a 'tDot11fDelTSResponse' or a
3643 // 'tDot11WMMDelTSResponse' to a 'tSirMacDeltsReqInfo'...
3644 if ( SIR_MAC_ACTION_QOS_MGMT == *pFrame )
3645 {
3646 pDelTs->tsinfo.traffic.trafficType = (tANI_U16)delts.TSInfo.traffic_type;
3647 pDelTs->tsinfo.traffic.tsid = (tANI_U16)delts.TSInfo.tsid;
3648 pDelTs->tsinfo.traffic.direction = (tANI_U16)delts.TSInfo.direction;
3649 pDelTs->tsinfo.traffic.accessPolicy = (tANI_U16)delts.TSInfo.access_policy;
3650 pDelTs->tsinfo.traffic.aggregation = (tANI_U16)delts.TSInfo.aggregation;
3651 pDelTs->tsinfo.traffic.psb = (tANI_U16)delts.TSInfo.psb;
3652 pDelTs->tsinfo.traffic.userPrio = (tANI_U16)delts.TSInfo.user_priority;
3653 pDelTs->tsinfo.traffic.ackPolicy = (tANI_U16)delts.TSInfo.tsinfo_ack_pol;
3654
3655 pDelTs->tsinfo.schedule.schedule = (tANI_U8)delts.TSInfo.schedule;
3656 }
3657 else
3658 {
3659 if ( wmmdelts.WMMTSPEC.present )
3660 {
3661 pDelTs->wmeTspecPresent = 1;
3662 ConvertWMMTSPEC( pMac, &pDelTs->tspec, &wmmdelts.WMMTSPEC );
3663 }
3664 else
3665 {
3666 dot11fLog( pMac, LOGE, FL("Mandatory WME TSPEC element missing!\n") );
3667 return eSIR_FAILURE;
3668 }
3669 }
3670
3671 return eSIR_SUCCESS;
3672
3673} // End sirConvertDeltsReq2Struct.
3674
3675
3676#ifdef ANI_SUPPORT_11H
3677tSirRetStatus
3678sirConvertTpcReqFrame2Struct(tpAniSirGlobal pMac,
3679 tANI_U8 *pFrame,
3680 tpSirMacTpcReqActionFrame pTpcReqFrame,
3681 tANI_U32 nFrame)
3682{
3683 tDot11fTPCRequest req;
3684 tANI_U32 status;
3685
3686 // Zero-init our [out] parameter,
3687 palZeroMemory( pMac->hHdd, ( tANI_U8* )pTpcReqFrame, sizeof(tSirMacTpcReqActionFrame) );
3688
3689 // delegate to the framesc-generated code,
3690 status = dot11fUnpackTPCRequest( pMac, pFrame, nFrame, &req );
3691 if ( DOT11F_FAILED( status ) )
3692 {
3693 dot11fLog(pMac, LOGE, FL("Failed to parse a TPC Request frame (0x%08x, %d bytes):\n"),
3694 status, nFrame);
3695 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3696 return eSIR_FAILURE;
3697 }
3698 else if ( DOT11F_WARNED( status ) )
3699 {
3700 dot11fLog( pMac, LOGW, FL("There were warnings while unpacking a TPC Request frame (0x%08x, %d bytes):\n"),
3701 status, nFrame );
3702 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3703 }
3704
3705 // & "transliterate" from a 'tDot11fTPCRequest' to a
3706 // 'tSirMacTpcReqActionFrame'...
3707 pTpcReqFrame->actionHeader.category = req.Category.category;
3708 pTpcReqFrame->actionHeader.actionID = req.Action.action;
3709 pTpcReqFrame->actionHeader.dialogToken = req.DialogToken.token;
3710 if ( req.TPCRequest.present )
3711 {
3712 pTpcReqFrame->type = DOT11F_EID_TPCREQUEST;
3713 pTpcReqFrame->length = 0;
3714 }
3715 else
3716 {
3717 dot11fLog( pMac, LOGW, FL("!!!Rcv TPC Req of inalid type!\n") );
3718 return eSIR_FAILURE;
3719 }
3720
3721 return eSIR_SUCCESS;
3722
3723} // End sirConvertTpcReqFrame2Struct.
3724
3725
3726tSirRetStatus
3727sirConvertMeasReqFrame2Struct(tpAniSirGlobal pMac,
3728 tANI_U8 *pFrame,
3729 tpSirMacMeasReqActionFrame pMeasReqFrame,
3730 tANI_U32 nFrame)
3731{
3732 tDot11fMeasurementRequest mr;
3733 tANI_U32 status;
3734
3735 // Zero-init our [out] parameter,
3736 palZeroMemory( pMac->hHdd, ( tANI_U8* )pMeasReqFrame, sizeof(tpSirMacMeasReqActionFrame) );
3737
3738 // delegate to the framesc-generated code,
3739 status = dot11fUnpackMeasurementRequest( pMac, pFrame, nFrame, &mr );
3740 if ( DOT11F_FAILED( status ) )
3741 {
3742 dot11fLog(pMac, LOGE, FL("Failed to parse a Measurement Request frame (0x%08x, %d bytes):\n"),
3743 status, nFrame);
3744 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3745 return eSIR_FAILURE;
3746 }
3747 else if ( DOT11F_WARNED( status ) )
3748 {
3749 dot11fLog( pMac, LOGW, FL("There were warnings while unpacking a Measurement Request frame (0x%08x, %d bytes):\n"),
3750 status, nFrame );
3751 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3752 }
3753
3754 // & "transliterate" from a 'tDot11fMeasurementRequest' to a
3755 // 'tpSirMacMeasReqActionFrame'...
3756 pMeasReqFrame->actionHeader.category = mr.Category.category;
3757 pMeasReqFrame->actionHeader.actionID = mr.Action.action;
3758 pMeasReqFrame->actionHeader.dialogToken = mr.DialogToken.token;
3759
3760 if ( 0 == mr.num_MeasurementRequest )
3761 {
3762 dot11fLog( pMac, LOGE, FL("Missing mandatory IE in Measurement Request Frame.\n") );
3763 return eSIR_FAILURE;
3764 }
3765 else if ( 1 < mr.num_MeasurementRequest )
3766 {
3767 limLog( pMac, LOGW, FL("Warning: dropping extra Measurement Request IEs!") );
3768 }
3769
3770 pMeasReqFrame->measReqIE.type = DOT11F_EID_MEASUREMENTREQUEST;
3771 pMeasReqFrame->measReqIE.length = DOT11F_IE_MEASUREMENTREQUEST_MIN_LEN;
3772 pMeasReqFrame->measReqIE.measToken = mr.MeasurementRequest[0].measurement_token;
3773 pMeasReqFrame->measReqIE.measReqMode = ( mr.MeasurementRequest[0].reserved << 3 ) |
3774 ( mr.MeasurementRequest[0].enable << 2 ) |
3775 ( mr.MeasurementRequest[0].request << 1 ) |
3776 ( mr.MeasurementRequest[0].report /*<< 0*/ );
3777 pMeasReqFrame->measReqIE.measType = mr.MeasurementRequest[0].measurement_type;
3778
3779 pMeasReqFrame->measReqIE.measReqField.channelNumber = mr.MeasurementRequest[0].channel_no;
3780
3781 palCopyMemory( pMac->hHdd, pMeasReqFrame->measReqIE.measReqField.measStartTime,
3782 mr.MeasurementRequest[0].meas_start_time, 8 );
3783
3784 pMeasReqFrame->measReqIE.measReqField.measDuration = mr.MeasurementRequest[0].meas_duration;
3785
3786 return eSIR_SUCCESS;
3787
3788} // End sirConvertMeasReqFrame2Struct.
3789#endif
3790
3791
3792void
3793PopulateDot11fTSPEC(tSirMacTspecIE *pOld,
3794 tDot11fIETSPEC *pDot11f)
3795{
3796 pDot11f->traffic_type = pOld->tsinfo.traffic.trafficType;
3797 pDot11f->tsid = pOld->tsinfo.traffic.tsid;
3798 pDot11f->direction = pOld->tsinfo.traffic.direction;
3799 pDot11f->access_policy = pOld->tsinfo.traffic.accessPolicy;
3800 pDot11f->aggregation = pOld->tsinfo.traffic.aggregation;
3801 pDot11f->psb = pOld->tsinfo.traffic.psb;
3802 pDot11f->user_priority = pOld->tsinfo.traffic.userPrio;
3803 pDot11f->tsinfo_ack_pol = pOld->tsinfo.traffic.ackPolicy;
3804 pDot11f->schedule = pOld->tsinfo.schedule.schedule;
3805 /* As defined in IEEE 802.11-2007, section 7.3.2.30
3806 * Nominal MSDU size: Bit[0:14]=Size, Bit[15]=Fixed
3807 */
3808 pDot11f->size = ( pOld->nomMsduSz & 0x7fff );
3809 pDot11f->fixed = ( pOld->nomMsduSz & 0x8000 ) ? 1 : 0;
3810 pDot11f->max_msdu_size = pOld->maxMsduSz;
3811 pDot11f->min_service_int = pOld->minSvcInterval;
3812 pDot11f->max_service_int = pOld->maxSvcInterval;
3813 pDot11f->inactivity_int = pOld->inactInterval;
3814 pDot11f->suspension_int = pOld->suspendInterval;
3815 pDot11f->service_start_time = pOld->svcStartTime;
3816 pDot11f->min_data_rate = pOld->minDataRate;
3817 pDot11f->mean_data_rate = pOld->meanDataRate;
3818 pDot11f->peak_data_rate = pOld->peakDataRate;
3819 pDot11f->burst_size = pOld->maxBurstSz;
3820 pDot11f->delay_bound = pOld->delayBound;
3821 pDot11f->min_phy_rate = pOld->minPhyRate;
3822 pDot11f->surplus_bw_allowance = pOld->surplusBw;
3823 pDot11f->medium_time = pOld->mediumTime;
3824
3825 pDot11f->present = 1;
3826
3827} // End PopulateDot11fTSPEC.
3828
3829void
3830PopulateDot11fWMMTSPEC(tSirMacTspecIE *pOld,
3831 tDot11fIEWMMTSPEC *pDot11f)
3832{
3833 pDot11f->traffic_type = pOld->tsinfo.traffic.trafficType;
3834 pDot11f->tsid = pOld->tsinfo.traffic.tsid;
3835 pDot11f->direction = pOld->tsinfo.traffic.direction;
3836 pDot11f->access_policy = pOld->tsinfo.traffic.accessPolicy;
3837 pDot11f->aggregation = pOld->tsinfo.traffic.aggregation;
3838 pDot11f->psb = pOld->tsinfo.traffic.psb;
3839 pDot11f->user_priority = pOld->tsinfo.traffic.userPrio;
3840 pDot11f->tsinfo_ack_pol = pOld->tsinfo.traffic.ackPolicy;
3841 pDot11f->burst_size_defn = pOld->tsinfo.traffic.burstSizeDefn;
3842 /* As defined in IEEE 802.11-2007, section 7.3.2.30
3843 * Nominal MSDU size: Bit[0:14]=Size, Bit[15]=Fixed
3844 */
3845 pDot11f->size = ( pOld->nomMsduSz & 0x7fff );
3846 pDot11f->fixed = ( pOld->nomMsduSz & 0x8000 ) ? 1 : 0;
3847 pDot11f->max_msdu_size = pOld->maxMsduSz;
3848 pDot11f->min_service_int = pOld->minSvcInterval;
3849 pDot11f->max_service_int = pOld->maxSvcInterval;
3850 pDot11f->inactivity_int = pOld->inactInterval;
3851 pDot11f->suspension_int = pOld->suspendInterval;
3852 pDot11f->service_start_time = pOld->svcStartTime;
3853 pDot11f->min_data_rate = pOld->minDataRate;
3854 pDot11f->mean_data_rate = pOld->meanDataRate;
3855 pDot11f->peak_data_rate = pOld->peakDataRate;
3856 pDot11f->burst_size = pOld->maxBurstSz;
3857 pDot11f->delay_bound = pOld->delayBound;
3858 pDot11f->min_phy_rate = pOld->minPhyRate;
3859 pDot11f->surplus_bw_allowance = pOld->surplusBw;
3860 pDot11f->medium_time = pOld->mediumTime;
3861
3862 pDot11f->version = 1;
3863 pDot11f->present = 1;
3864
3865} // End PopulateDot11fWMMTSPEC.
3866
3867#ifdef FEATURE_WLAN_CCX
3868void PopulateDot11TSRSIE(tpAniSirGlobal pMac,
3869 tSirMacCCXTSRSIE *pOld,
3870 tDot11fIECCXTrafStrmRateSet *pDot11f,
3871 tANI_U8 rate_length)
3872{
3873 pDot11f->tsid = pOld->tsid;
3874 palCopyMemory(pMac->hHdd,pDot11f->tsrates, pOld->rates,rate_length);
3875 pDot11f->num_tsrates = rate_length;
3876 pDot11f->present = 1;
3877}
3878#endif
3879
3880
3881tSirRetStatus
3882PopulateDot11fTCLAS(tpAniSirGlobal pMac,
3883 tSirTclasInfo *pOld,
3884 tDot11fIETCLAS *pDot11f)
3885{
3886 pDot11f->user_priority = pOld->tclas.userPrio;
3887 pDot11f->classifier_type = pOld->tclas.classifierType;
3888 pDot11f->classifier_mask = pOld->tclas.classifierMask;
3889
3890 switch ( pDot11f->classifier_type )
3891 {
3892 case SIR_MAC_TCLASTYPE_ETHERNET:
3893 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.EthParams.source,
3894 ( tANI_U8* )&pOld->tclasParams.eth.srcAddr, 6 );
3895 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.EthParams.dest,
3896 ( tANI_U8* )&pOld->tclasParams.eth.dstAddr, 6 );
3897 pDot11f->info.EthParams.type = pOld->tclasParams.eth.type;
3898 break;
3899 case SIR_MAC_TCLASTYPE_TCPUDPIP:
3900 pDot11f->info.IpParams.version = pOld->version;
3901 if ( SIR_MAC_TCLAS_IPV4 == pDot11f->info.IpParams.version )
3902 {
3903 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
3904 IpV4Params.source,
3905 ( tANI_U8* )pOld->tclasParams.ipv4.srcIpAddr, 4 );
3906 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
3907 IpV4Params.dest,
3908 ( tANI_U8* )pOld->tclasParams.ipv4.dstIpAddr, 4 );
3909 pDot11f->info.IpParams.params.IpV4Params.src_port =
3910 pOld->tclasParams.ipv4.srcPort;
3911 pDot11f->info.IpParams.params.IpV4Params.dest_port =
3912 pOld->tclasParams.ipv4.dstPort;
3913 pDot11f->info.IpParams.params.IpV4Params.DSCP =
3914 pOld->tclasParams.ipv4.dscp;
3915 pDot11f->info.IpParams.params.IpV4Params.proto =
3916 pOld->tclasParams.ipv4.protocol;
3917 pDot11f->info.IpParams.params.IpV4Params.reserved =
3918 pOld->tclasParams.ipv4.rsvd;
3919 }
3920 else
3921 {
3922 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
3923 IpV6Params.source,
3924 ( tANI_U8* )pOld->tclasParams.ipv6.srcIpAddr, 16 );
3925 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
3926 IpV6Params.dest,
3927 ( tANI_U8* )pOld->tclasParams.ipv6.dstIpAddr, 16 );
3928 pDot11f->info.IpParams.params.IpV6Params.src_port =
3929 pOld->tclasParams.ipv6.srcPort;
3930 pDot11f->info.IpParams.params.IpV6Params.dest_port =
3931 pOld->tclasParams.ipv6.dstPort;
3932 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
3933 IpV6Params.flow_label,
3934 ( tANI_U8* )pOld->tclasParams.ipv6.flowLabel, 3 );
3935 }
3936 break;
3937 case SIR_MAC_TCLASTYPE_8021DQ:
3938 pDot11f->info.Params8021dq.tag_type = pOld->tclasParams.t8021dq.tag;
3939 break;
3940 default:
3941 limLog( pMac, LOGE, FL("Bad TCLAS type %d in PopulateDot11fTCLAS.\n"),
3942 pDot11f->classifier_type );
3943 return eSIR_FAILURE;
3944 }
3945
3946 pDot11f->present = 1;
3947
3948 return eSIR_SUCCESS;
3949
3950} // End PopulateDot11fTCLAS.
3951
3952tSirRetStatus
3953PopulateDot11fWMMTCLAS(tpAniSirGlobal pMac,
3954 tSirTclasInfo *pOld,
3955 tDot11fIEWMMTCLAS *pDot11f)
3956{
3957 pDot11f->version = 1;
3958 pDot11f->user_priority = pOld->tclas.userPrio;
3959 pDot11f->classifier_type = pOld->tclas.classifierType;
3960 pDot11f->classifier_mask = pOld->tclas.classifierMask;
3961
3962 switch ( pDot11f->classifier_type )
3963 {
3964 case SIR_MAC_TCLASTYPE_ETHERNET:
3965 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.EthParams.source,
3966 ( tANI_U8* )&pOld->tclasParams.eth.srcAddr, 6 );
3967 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.EthParams.dest,
3968 ( tANI_U8* )&pOld->tclasParams.eth.dstAddr, 6 );
3969 pDot11f->info.EthParams.type = pOld->tclasParams.eth.type;
3970 break;
3971 case SIR_MAC_TCLASTYPE_TCPUDPIP:
3972 pDot11f->info.IpParams.version = pOld->version;
3973 if ( SIR_MAC_TCLAS_IPV4 == pDot11f->info.IpParams.version )
3974 {
3975 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
3976 IpV4Params.source,
3977 ( tANI_U8* )pOld->tclasParams.ipv4.srcIpAddr, 4 );
3978 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
3979 IpV4Params.dest,
3980 ( tANI_U8* )pOld->tclasParams.ipv4.dstIpAddr, 4 );
3981 pDot11f->info.IpParams.params.IpV4Params.src_port =
3982 pOld->tclasParams.ipv4.srcPort;
3983 pDot11f->info.IpParams.params.IpV4Params.dest_port =
3984 pOld->tclasParams.ipv4.dstPort;
3985 pDot11f->info.IpParams.params.IpV4Params.DSCP =
3986 pOld->tclasParams.ipv4.dscp;
3987 pDot11f->info.IpParams.params.IpV4Params.proto =
3988 pOld->tclasParams.ipv4.protocol;
3989 pDot11f->info.IpParams.params.IpV4Params.reserved =
3990 pOld->tclasParams.ipv4.rsvd;
3991 }
3992 else
3993 {
3994 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
3995 IpV6Params.source,
3996 ( tANI_U8* )pOld->tclasParams.ipv6.srcIpAddr, 16 );
3997 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
3998 IpV6Params.dest,
3999 ( tANI_U8* )pOld->tclasParams.ipv6.dstIpAddr, 16 );
4000 pDot11f->info.IpParams.params.IpV6Params.src_port =
4001 pOld->tclasParams.ipv6.srcPort;
4002 pDot11f->info.IpParams.params.IpV6Params.dest_port =
4003 pOld->tclasParams.ipv6.dstPort;
4004 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
4005 IpV6Params.flow_label,
4006 ( tANI_U8* )pOld->tclasParams.ipv6.flowLabel, 3 );
4007 }
4008 break;
4009 case SIR_MAC_TCLASTYPE_8021DQ:
4010 pDot11f->info.Params8021dq.tag_type = pOld->tclasParams.t8021dq.tag;
4011 break;
4012 default:
4013 limLog( pMac, LOGE, FL("Bad TCLAS type %d in PopulateDot11fTCLAS.\n"),
4014 pDot11f->classifier_type );
4015 return eSIR_FAILURE;
4016 }
4017
4018 pDot11f->present = 1;
4019
4020 return eSIR_SUCCESS;
4021
4022} // End PopulateDot11fWMMTCLAS.
4023
4024#if ( WNI_POLARIS_FW_PRODUCT == AP )
4025
4026tSirRetStatus
4027PopulateDot11fCFParams(tpAniSirGlobal pMac,
4028 tDot11fFfCapabilities *pCaps,
4029 tDot11fIECFParams *pDot11f)
4030{
4031 tANI_U32 cfg;
4032 tSirRetStatus nSirStatus;
4033
4034 if ( pCaps->cfPollable || pCaps->cfPollReq )
4035 {
4036 pDot11f->cfp_count = schGetCFPCount( pMac );
4037
4038 CFG_GET_INT( nSirStatus, pMac, WNI_CFG_CFP_PERIOD, cfg );
4039 pDot11f->cfp_period = ( cfg & 0x000000ff );
4040
4041 CFG_GET_INT( nSirStatus, pMac, WNI_CFG_CFP_MAX_DURATION, cfg );
4042 pDot11f->cfp_maxduration = ( cfg & 0x0000ffff );
4043
4044 pDot11f->cfp_durremaining = schGetCFPDurRemaining( pMac );
4045
4046 pDot11f->present = 1;
4047 }
4048
4049 return eSIR_SUCCESS;
4050} // End PopulateDot11fCFParams.
4051
4052void
4053PopulateDot11fQuiet(tpAniSirGlobal pMac,
4054 tDot11fIEQuiet *pDot11f)
4055{
4056 // Quiet Count - Num TBTTs until start of quiet interval
4057 pDot11f->count = (tANI_U8) pMac->lim.gLimSpecMgmt.quietCount;
4058 // Quiet Period
4059 pDot11f->period = 0;
4060 // Quiet Duration (in TU's)
4061 pDot11f->duration = ( tANI_U16 ) pMac->lim.gLimSpecMgmt.quietDuration_TU;
4062 // Quiet Offset
4063 pDot11f->offset = 0;
4064
4065 dot11fLog( pMac, LOG2,
4066 FL("Filling QuietBSS IE: %d, Len %d, QC %1d, QP 0, QD "
4067 "%2d(TU)/%2d(TICKS), QO 0\n"),
4068 SIR_MAC_QUIET_EID, DOT11F_IE_QUIET_MIN_LEN,
4069 pMac->lim.gLimSpecMgmt.quietCount,
4070 pMac->lim.gLimSpecMgmt.quietDuration_TU,
4071 pMac->lim.gLimSpecMgmt.quietDuration );
4072
4073 pDot11f->present = 1;
4074
4075} // End PopulateDot11fQuiet.
4076
4077tSirRetStatus
4078PopulateDot11fAPName(tpAniSirGlobal pMac,
4079 tANI_U32 capEnable,
4080 tDot11fIEAPName *pDot11f)
4081{
4082 tANI_U32 nName;
4083 tSirRetStatus nSirStatus;
4084
4085 CFG_GET_STR( nSirStatus, pMac, WNI_CFG_AP_NODE_NAME, pDot11f->name,
4086 nName, SIR_MAC_MAX_SSID_LENGTH );
4087 pDot11f->num_name = ( tANI_U8 ) nName;
4088 pDot11f->present = 1;
4089
4090 return eSIR_SUCCESS;
4091} // End PopulateDot11fAPName.
4092
4093void
4094PopulateDot11fPropQuietBSS(tpAniSirGlobal pMac,
4095 tANI_U32 capsEnable,
4096 tDot11fIEPropQuietBSS *pDot11f)
4097{
4098 // Populate Proprietary Quiet BSS IE, ONLY IF 11H is NOT enabled! If 11H
4099 // IS enabled, then the Quiet IE will be appropriately sent as per the
4100 // 11H spec and hence need NOT be sent in the Proprietary IE as well
4101 if ( ( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState ) &&
4102 !pMac->lim.gLim11hEnable &&
4103 PROP_CAPABILITY_GET( TITAN, capsEnable ) )
4104 {
4105 // Quiet Count - Num TBTTs until start of quiet interval
4106 pDot11f->quiet_count = pMac->lim.gLimSpecMgmt.quietCount;
4107 // Quiet Period
4108 pDot11f->quiet_period = 0;
4109 // Quiet Duration (in TU's)
4110 pDot11f->quiet_duration = ( tANI_U16 ) pMac->lim.gLimSpecMgmt.quietDuration_TU;
4111 // Quiet Offset
4112 pDot11f->quiet_offset = 0;
4113
4114 pDot11f->present = 1;
4115 }
4116} // End PopulateDot11fPropQuietBSS.
4117
4118void
4119PopulateDot11fTrigStaBkScan(tpAniSirGlobal pMac,
4120 tANI_U32 capsEnable,
4121 tDot11fIETriggerStaBgScan *pDot11f)
4122{
4123 if ( PROP_CAPABILITY_GET( TITAN, capsEnable ) )
4124 {
4125 pDot11f->enable = pMac->lim.gLimTriggerBackgroundScanDuringQuietBss;
4126 pDot11f->present = 1;
4127 }
4128} // End PopulateDot11fTrigStaBkScan.
4129
4130#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
4131
4132tSirRetStatus
4133PopulateDot11fWDS(tpAniSirGlobal pMac,
4134 tANI_U32 capEnable,
4135 tDot11fIEWDS *pDot11f )
4136{
4137 tpPESession psessionEntry = &pMac->lim.gpSession[0]; //TBD-RAJESH HOW TO GET sessionEntry?????
4138
4139 if ( psessionEntry->pLimStartBssReq->wdsInfo.wdsLength )
4140 {
4141 if ( psessionEntry->pLimStartBssReq->wdsInfo.wdsLength > 64)
4142 {
4143 limLog( pMac, LOG3, FL("WDS Length overflow in PopulateDot11fWDS.") );
4144 return eSIR_FAILURE;
4145 }
4146
4147 pDot11f->num_wdsData = psessionEntry->pLimStartBssReq->wdsInfo.wdsLength;
4148 palCopyMemory( pMac->hHdd, pDot11f->wdsData,
4149 psessionEntry->pLimStartBssReq->wdsInfo.wdsBytes,
4150 pDot11f->num_wdsData );
4151 pDot11f->present = 1;
4152 }
4153
4154 return eSIR_SUCCESS;
4155} // End PopulateDot11fWDS.
4156
4157#endif // WNI_POLARIS_FW_PACKAGE == ADVANCED
4158
4159#endif // WNI_POLARIS_FW_PRODUCT == AP
4160
4161tSirRetStatus PopulateDot11fWsc(tpAniSirGlobal pMac,
4162 tDot11fIEWscBeacon *pDot11f)
4163{
4164
4165 tANI_U32 wpsState;
4166
4167 pDot11f->Version.present = 1;
4168 pDot11f->Version.major = 0x01;
4169 pDot11f->Version.minor = 0x00;
4170
4171 if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_STATE, &wpsState) != eSIR_SUCCESS)
4172 limLog(pMac, LOGP,"Failed to cfg get id %d\n", WNI_CFG_WPS_STATE );
4173
4174 pDot11f->WPSState.present = 1;
4175 pDot11f->WPSState.state = (tANI_U8) wpsState;
4176
4177 pDot11f->APSetupLocked.present = 0;
4178
4179 pDot11f->SelectedRegistrar.present = 0;
4180
4181 pDot11f->DevicePasswordID.present = 0;
4182
4183 pDot11f->SelectedRegistrarConfigMethods.present = 0;
4184
4185 pDot11f->UUID_E.present = 0;
4186
4187 pDot11f->RFBands.present = 0;
4188
4189 pDot11f->present = 1;
4190 return eSIR_SUCCESS;
4191}
4192
4193tSirRetStatus PopulateDot11fWscRegistrarInfo(tpAniSirGlobal pMac,
4194 tDot11fIEWscBeacon *pDot11f)
4195{
4196 const struct sLimWscIeInfo *const pWscIeInfo = &(pMac->lim.wscIeInfo);
4197 tANI_U32 devicepasswdId;
4198
4199
4200 pDot11f->APSetupLocked.present = 1;
4201 pDot11f->APSetupLocked.fLocked = pWscIeInfo->apSetupLocked;
4202
4203 pDot11f->SelectedRegistrar.present = 1;
4204 pDot11f->SelectedRegistrar.selected = pWscIeInfo->selectedRegistrar;
4205
4206 if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_DEVICE_PASSWORD_ID, &devicepasswdId) != eSIR_SUCCESS)
4207 limLog(pMac, LOGP,"Failed to cfg get id %d\n", WNI_CFG_WPS_DEVICE_PASSWORD_ID );
4208
4209 pDot11f->DevicePasswordID.present = 1;
4210 pDot11f->DevicePasswordID.id = (tANI_U16) devicepasswdId;
4211
4212 pDot11f->SelectedRegistrarConfigMethods.present = 1;
4213 pDot11f->SelectedRegistrarConfigMethods.methods = pWscIeInfo->selectedRegistrarConfigMethods;
4214
4215 // UUID_E and RF Bands are applicable only for dual band AP
4216
4217 return eSIR_SUCCESS;
4218}
4219
4220tSirRetStatus DePopulateDot11fWscRegistrarInfo(tpAniSirGlobal pMac,
4221 tDot11fIEWscBeacon *pDot11f)
4222{
4223 pDot11f->APSetupLocked.present = 0;
4224 pDot11f->SelectedRegistrar.present = 0;
4225 pDot11f->DevicePasswordID.present = 0;
4226 pDot11f->SelectedRegistrarConfigMethods.present = 0;
4227
4228 return eSIR_SUCCESS;
4229}
4230#ifdef WLAN_SOFTAP_FEATURE
4231tSirRetStatus PopulateDot11fProbeResWPSIEs(tpAniSirGlobal pMac, tDot11fIEWscProbeRes *pDot11f, tpPESession psessionEntry)
4232{
4233
4234 tSirWPSProbeRspIE *pSirWPSProbeRspIE;
4235
4236 pSirWPSProbeRspIE = &psessionEntry->APWPSIEs.SirWPSProbeRspIE;
4237
4238
4239 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_VER_PRESENT)
4240 {
4241 pDot11f->present = 1;
4242 pDot11f->Version.present = 1;
4243 pDot11f->Version.major = (tANI_U8) ((pSirWPSProbeRspIE->Version & 0xF0)>>4);
4244 pDot11f->Version.minor = (tANI_U8) (pSirWPSProbeRspIE->Version & 0x0F);
4245 }
4246 else
4247 {
4248 pDot11f->present = 0;
4249 pDot11f->Version.present = 0;
4250 }
4251
4252 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_STATE_PRESENT)
4253 {
4254
4255 pDot11f->WPSState.present = 1;
4256 pDot11f->WPSState.state = (tANI_U8)pSirWPSProbeRspIE->wpsState;
4257 }
4258 else
4259 pDot11f->WPSState.present = 0;
4260
4261 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_APSETUPLOCK_PRESENT)
4262 {
4263 pDot11f->APSetupLocked.present = 1;
4264 pDot11f->APSetupLocked.fLocked = pSirWPSProbeRspIE->APSetupLocked;
4265 }
4266 else
4267 pDot11f->APSetupLocked.present = 0;
4268
4269 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_SELECTEDREGISTRA_PRESENT)
4270 {
4271 pDot11f->SelectedRegistrar.present = 1;
4272 pDot11f->SelectedRegistrar.selected = pSirWPSProbeRspIE->SelectedRegistra;
4273 }
4274 else
4275 pDot11f->SelectedRegistrar.present = 0;
4276
4277 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_DEVICEPASSWORDID_PRESENT)
4278 {
4279 pDot11f->DevicePasswordID.present = 1;
4280 pDot11f->DevicePasswordID.id = pSirWPSProbeRspIE->DevicePasswordID;
4281 }
4282 else
4283 pDot11f->DevicePasswordID.present = 0;
4284
4285 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_SELECTEDREGISTRACFGMETHOD_PRESENT)
4286 {
4287 pDot11f->SelectedRegistrarConfigMethods.present = 1;
4288 pDot11f->SelectedRegistrarConfigMethods.methods = pSirWPSProbeRspIE->SelectedRegistraCfgMethod;
4289 }
4290 else
4291 pDot11f->SelectedRegistrarConfigMethods.present = 0;
4292
4293 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_RESPONSETYPE_PRESENT)
4294 {
4295 pDot11f->ResponseType.present = 1;
4296 pDot11f->ResponseType.resType = pSirWPSProbeRspIE->ResponseType;
4297 }
4298 else
4299 pDot11f->ResponseType.present = 0;
4300
4301 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_UUIDE_PRESENT)
4302 {
4303 pDot11f->UUID_E.present = 1;
4304 palCopyMemory(pMac->hHdd, pDot11f->UUID_E.uuid, pSirWPSProbeRspIE->UUID_E, WNI_CFG_WPS_UUID_LEN);
4305 }
4306 else
4307 pDot11f->UUID_E.present = 0;
4308
4309 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_MANUFACTURE_PRESENT)
4310 {
4311 pDot11f->Manufacturer.present = 1;
4312 pDot11f->Manufacturer.num_name = pSirWPSProbeRspIE->Manufacture.num_name;
4313 palCopyMemory(pMac->hHdd, pDot11f->Manufacturer.name, pSirWPSProbeRspIE->Manufacture.name, pSirWPSProbeRspIE->Manufacture.num_name);
4314 }
4315 else
4316 pDot11f->Manufacturer.present = 0;
4317
4318 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_MODELNUMBER_PRESENT)
4319 {
4320 pDot11f->ModelName.present = 1;
4321 pDot11f->ModelName.num_text = pSirWPSProbeRspIE->ModelName.num_text;
4322 palCopyMemory(pMac->hHdd, pDot11f->ModelName.text, pSirWPSProbeRspIE->ModelName.text, pDot11f->ModelName.num_text);
4323 }
4324 else
4325 pDot11f->ModelName.present = 0;
4326
4327 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_MODELNUMBER_PRESENT)
4328 {
4329 pDot11f->ModelNumber.present = 1;
4330 pDot11f->ModelNumber.num_text = pSirWPSProbeRspIE->ModelNumber.num_text;
4331 palCopyMemory(pMac->hHdd, pDot11f->ModelNumber.text, pSirWPSProbeRspIE->ModelNumber.text, pDot11f->ModelNumber.num_text);
4332 }
4333 else
4334 pDot11f->ModelNumber.present = 0;
4335
4336 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_SERIALNUMBER_PRESENT)
4337 {
4338 pDot11f->SerialNumber.present = 1;
4339 pDot11f->SerialNumber.num_text = pSirWPSProbeRspIE->SerialNumber.num_text;
4340 palCopyMemory(pMac->hHdd, pDot11f->SerialNumber.text, pSirWPSProbeRspIE->SerialNumber.text, pDot11f->SerialNumber.num_text);
4341 }
4342 else
4343 pDot11f->SerialNumber.present = 0;
4344
4345 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_PRIMARYDEVICETYPE_PRESENT)
4346 {
4347 pDot11f->PrimaryDeviceType.present = 1;
4348 palCopyMemory(pMac->hHdd, pDot11f->PrimaryDeviceType.oui, pSirWPSProbeRspIE->PrimaryDeviceOUI, sizeof(pSirWPSProbeRspIE->PrimaryDeviceOUI));
4349 pDot11f->PrimaryDeviceType.primary_category = (tANI_U16)pSirWPSProbeRspIE->PrimaryDeviceCategory;
4350 pDot11f->PrimaryDeviceType.sub_category = (tANI_U16)pSirWPSProbeRspIE->DeviceSubCategory;
4351 }
4352 else
4353 pDot11f->PrimaryDeviceType.present = 0;
4354
4355 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_DEVICENAME_PRESENT)
4356 {
4357 pDot11f->DeviceName.present = 1;
4358 pDot11f->DeviceName.num_text = pSirWPSProbeRspIE->DeviceName.num_text;
4359 palCopyMemory(pMac->hHdd, pDot11f->DeviceName.text, pSirWPSProbeRspIE->DeviceName.text, pDot11f->DeviceName.num_text);
4360 }
4361 else
4362 pDot11f->DeviceName.present = 0;
4363
4364 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_CONFIGMETHODS_PRESENT)
4365 {
4366 pDot11f->ConfigMethods.present = 1;
4367 pDot11f->ConfigMethods.methods = pSirWPSProbeRspIE->ConfigMethod;
4368 }
4369 else
4370 pDot11f->ConfigMethods.present = 0;
4371
4372
4373 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_RF_BANDS_PRESENT)
4374 {
4375 pDot11f->RFBands.present = 1;
4376 pDot11f->RFBands.bands = pSirWPSProbeRspIE->RFBand;
4377 }
4378 else
4379 pDot11f->RFBands.present = 0;
4380
4381 return eSIR_SUCCESS;
4382}
4383tSirRetStatus PopulateDot11fAssocResWPSIEs(tpAniSirGlobal pMac, tDot11fIEWscAssocRes *pDot11f, tpPESession psessionEntry)
4384{
4385 tSirWPSProbeRspIE *pSirWPSProbeRspIE;
4386
4387 pSirWPSProbeRspIE = &psessionEntry->APWPSIEs.SirWPSProbeRspIE;
4388
4389 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_VER_PRESENT)
4390 {
4391 pDot11f->present = 1;
4392 pDot11f->Version.present = 1;
4393 pDot11f->Version.major = (tANI_U8) ((pSirWPSProbeRspIE->Version & 0xF0)>>4);
4394 pDot11f->Version.minor = (tANI_U8) (pSirWPSProbeRspIE->Version & 0x0F);
4395 }
4396 else
4397 {
4398 pDot11f->present = 0;
4399 pDot11f->Version.present = 0;
4400 }
4401
4402 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_RESPONSETYPE_PRESENT)
4403 {
4404 pDot11f->ResponseType.present = 1;
4405 pDot11f->ResponseType.resType = pSirWPSProbeRspIE->ResponseType;
4406 }
4407 else
4408 pDot11f->ResponseType.present = 0;
4409
4410 return eSIR_SUCCESS;
4411}
4412
4413tSirRetStatus PopulateDot11fBeaconWPSIEs(tpAniSirGlobal pMac, tDot11fIEWscBeacon *pDot11f, tpPESession psessionEntry)
4414{
4415
4416 tSirWPSBeaconIE *pSirWPSBeaconIE;
4417
4418 pSirWPSBeaconIE = &psessionEntry->APWPSIEs.SirWPSBeaconIE;
4419
4420
4421 if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_PROBRSP_VER_PRESENT)
4422 {
4423 pDot11f->present = 1;
4424 pDot11f->Version.present = 1;
4425 pDot11f->Version.major = (tANI_U8) ((pSirWPSBeaconIE->Version & 0xF0)>>4);
4426 pDot11f->Version.minor = (tANI_U8) (pSirWPSBeaconIE->Version & 0x0F);
4427 }
4428 else
4429 {
4430 pDot11f->present = 0;
4431 pDot11f->Version.present = 0;
4432 }
4433
4434 if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_STATE_PRESENT)
4435 {
4436
4437 pDot11f->WPSState.present = 1;
4438 pDot11f->WPSState.state = (tANI_U8)pSirWPSBeaconIE->wpsState;
4439 }
4440 else
4441 pDot11f->WPSState.present = 0;
4442
4443 if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_APSETUPLOCK_PRESENT)
4444 {
4445 pDot11f->APSetupLocked.present = 1;
4446 pDot11f->APSetupLocked.fLocked = pSirWPSBeaconIE->APSetupLocked;
4447 }
4448 else
4449 pDot11f->APSetupLocked.present = 0;
4450
4451 if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_SELECTEDREGISTRA_PRESENT)
4452 {
4453 pDot11f->SelectedRegistrar.present = 1;
4454 pDot11f->SelectedRegistrar.selected = pSirWPSBeaconIE->SelectedRegistra;
4455 }
4456 else
4457 pDot11f->SelectedRegistrar.present = 0;
4458
4459 if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_DEVICEPASSWORDID_PRESENT)
4460 {
4461 pDot11f->DevicePasswordID.present = 1;
4462 pDot11f->DevicePasswordID.id = pSirWPSBeaconIE->DevicePasswordID;
4463 }
4464 else
4465 pDot11f->DevicePasswordID.present = 0;
4466
4467 if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_SELECTEDREGISTRACFGMETHOD_PRESENT)
4468 {
4469 pDot11f->SelectedRegistrarConfigMethods.present = 1;
4470 pDot11f->SelectedRegistrarConfigMethods.methods = pSirWPSBeaconIE->SelectedRegistraCfgMethod;
4471 }
4472 else
4473 pDot11f->SelectedRegistrarConfigMethods.present = 0;
4474
4475 if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_UUIDE_PRESENT)
4476 {
4477 pDot11f->UUID_E.present = 1;
4478 palCopyMemory(pMac->hHdd, pDot11f->UUID_E.uuid, pSirWPSBeaconIE->UUID_E, WNI_CFG_WPS_UUID_LEN);
4479 }
4480 else
4481 pDot11f->UUID_E.present = 0;
4482
4483
4484 if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_RF_BANDS_PRESENT)
4485 {
4486 pDot11f->RFBands.present = 1;
4487 pDot11f->RFBands.bands = pSirWPSBeaconIE->RFBand;
4488 }
4489 else
4490 pDot11f->RFBands.present = 0;
4491
4492 return eSIR_SUCCESS;
4493}
4494#endif
4495tSirRetStatus PopulateDot11fWscInProbeRes(tpAniSirGlobal pMac,
4496 tDot11fIEWscProbeRes *pDot11f)
4497{
4498 tANI_U32 cfgMethods;
4499 tANI_U32 cfgStrLen;
4500 tANI_U32 val;
4501 tANI_U32 wpsVersion, wpsState;
4502
4503
4504 if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_VERSION, &wpsVersion) != eSIR_SUCCESS)
4505 limLog(pMac, LOGP,"Failed to cfg get id %d\n", WNI_CFG_WPS_VERSION );
4506
4507 pDot11f->Version.present = 1;
4508 pDot11f->Version.major = (tANI_U8) ((wpsVersion & 0xF0)>>4);
4509 pDot11f->Version.minor = (tANI_U8) (wpsVersion & 0x0F);
4510
4511 if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_STATE, &wpsState) != eSIR_SUCCESS)
4512 limLog(pMac, LOGP,"Failed to cfg get id %d\n", WNI_CFG_WPS_STATE );
4513
4514 pDot11f->WPSState.present = 1;
4515 pDot11f->WPSState.state = (tANI_U8) wpsState;
4516
4517 pDot11f->APSetupLocked.present = 0;
4518
4519 pDot11f->SelectedRegistrar.present = 0;
4520
4521 pDot11f->DevicePasswordID.present = 0;
4522
4523 pDot11f->SelectedRegistrarConfigMethods.present = 0;
4524
4525 pDot11f->ResponseType.present = 1;
4526 if ((pMac->lim.wscIeInfo.reqType == REQ_TYPE_REGISTRAR) ||
4527 (pMac->lim.wscIeInfo.reqType == REQ_TYPE_WLAN_MANAGER_REGISTRAR)){
4528 pDot11f->ResponseType.resType = RESP_TYPE_ENROLLEE_OPEN_8021X;
4529 }
4530 else{
4531 pDot11f->ResponseType.resType = RESP_TYPE_AP;
4532 }
4533
4534 /* UUID is a 16 byte long binary. Still use wlan_cfgGetStr to get it. */
4535 pDot11f->UUID_E.present = 1;
4536 cfgStrLen = WNI_CFG_WPS_UUID_LEN;
4537 if (wlan_cfgGetStr(pMac,
4538 WNI_CFG_WPS_UUID,
4539 pDot11f->UUID_E.uuid,
4540 &cfgStrLen) != eSIR_SUCCESS)
4541 {
4542 *(pDot11f->UUID_E.uuid) = '\0';
4543 }
4544
4545 pDot11f->Manufacturer.present = 1;
4546 cfgStrLen = WNI_CFG_MANUFACTURER_NAME_LEN - 1;
4547 if (wlan_cfgGetStr(pMac,
4548 WNI_CFG_MANUFACTURER_NAME,
4549 pDot11f->Manufacturer.name,
4550 &cfgStrLen) != eSIR_SUCCESS)
4551 {
4552 pDot11f->Manufacturer.num_name = 0;
4553 *(pDot11f->Manufacturer.name) = '\0';
4554 }
4555 else
4556 {
4557 pDot11f->Manufacturer.num_name = (tANI_U8) (cfgStrLen & 0x000000FF);
4558 pDot11f->Manufacturer.name[cfgStrLen] = '\0';
4559 }
4560
4561 pDot11f->ModelName.present = 1;
4562 cfgStrLen = WNI_CFG_MODEL_NAME_LEN - 1;
4563 if (wlan_cfgGetStr(pMac,
4564 WNI_CFG_MODEL_NAME,
4565 pDot11f->ModelName.text,
4566 &cfgStrLen) != eSIR_SUCCESS)
4567 {
4568 pDot11f->ModelName.num_text = 0;
4569 *(pDot11f->ModelName.text) = '\0';
4570 }
4571 else
4572 {
4573 pDot11f->ModelName.num_text = (tANI_U8) (cfgStrLen & 0x000000FF);
4574 pDot11f->ModelName.text[cfgStrLen] = '\0';
4575 }
4576
4577 pDot11f->ModelNumber.present = 1;
4578 cfgStrLen = WNI_CFG_MODEL_NUMBER_LEN - 1;
4579 if (wlan_cfgGetStr(pMac,
4580 WNI_CFG_MODEL_NUMBER,
4581 pDot11f->ModelNumber.text,
4582 &cfgStrLen) != eSIR_SUCCESS)
4583 {
4584 pDot11f->ModelNumber.num_text = 0;
4585 *(pDot11f->ModelNumber.text) = '\0';
4586 }
4587 else
4588 {
4589 pDot11f->ModelNumber.num_text = (tANI_U8) (cfgStrLen & 0x000000FF);
4590 pDot11f->ModelNumber.text[cfgStrLen] = '\0';
4591 }
4592
4593 pDot11f->SerialNumber.present = 1;
4594 cfgStrLen = WNI_CFG_MANUFACTURER_PRODUCT_VERSION_LEN - 1;
4595 if (wlan_cfgGetStr(pMac,
4596 WNI_CFG_MANUFACTURER_PRODUCT_VERSION,
4597 pDot11f->SerialNumber.text,
4598 &cfgStrLen) != eSIR_SUCCESS)
4599 {
4600 pDot11f->SerialNumber.num_text = 0;
4601 *(pDot11f->SerialNumber.text) = '\0';
4602 }
4603 else
4604 {
4605 pDot11f->SerialNumber.num_text = (tANI_U8) (cfgStrLen & 0x000000FF);
4606 pDot11f->SerialNumber.text[cfgStrLen] = '\0';
4607 }
4608
4609 pDot11f->PrimaryDeviceType.present = 1;
4610
4611 if (wlan_cfgGetInt(pMac, WNI_CFG_WPS_PRIMARY_DEVICE_CATEGORY, &val) != eSIR_SUCCESS)
4612 {
4613 limLog(pMac, LOGP, FL("cfg get prim device category failed\n"));
4614 }
4615 else
4616 pDot11f->PrimaryDeviceType.primary_category = (tANI_U16) val;
4617
4618 if (wlan_cfgGetInt(pMac, WNI_CFG_WPS_PIMARY_DEVICE_OUI, &val) != eSIR_SUCCESS)
4619 {
4620 limLog(pMac, LOGP, FL("cfg get prim device OUI failed\n"));
4621 }
4622 else
4623 {
4624 *(pDot11f->PrimaryDeviceType.oui) = (tANI_U8)((val >> 24)& 0xff);
4625 *(pDot11f->PrimaryDeviceType.oui+1) = (tANI_U8)((val >> 16)& 0xff);
4626 *(pDot11f->PrimaryDeviceType.oui+2) = (tANI_U8)((val >> 8)& 0xff);
4627 *(pDot11f->PrimaryDeviceType.oui+3) = (tANI_U8)((val & 0xff));
4628 }
4629
4630 if (wlan_cfgGetInt(pMac, WNI_CFG_WPS_DEVICE_SUB_CATEGORY, &val) != eSIR_SUCCESS)
4631 {
4632 limLog(pMac, LOGP, FL("cfg get prim device sub category failed\n"));
4633 }
4634 else
4635 pDot11f->PrimaryDeviceType.sub_category = (tANI_U16) val;
4636
4637 pDot11f->DeviceName.present = 1;
4638 cfgStrLen = WNI_CFG_MANUFACTURER_PRODUCT_NAME_LEN - 1;
4639 if (wlan_cfgGetStr(pMac,
4640 WNI_CFG_MANUFACTURER_PRODUCT_NAME,
4641 pDot11f->DeviceName.text,
4642 &cfgStrLen) != eSIR_SUCCESS)
4643 {
4644 pDot11f->DeviceName.num_text = 0;
4645 *(pDot11f->DeviceName.text) = '\0';
4646 }
4647 else
4648 {
4649 pDot11f->DeviceName.num_text = (tANI_U8) (cfgStrLen & 0x000000FF);
4650 pDot11f->DeviceName.text[cfgStrLen] = '\0';
4651 }
4652
4653 if (wlan_cfgGetInt(pMac,
4654 WNI_CFG_WPS_CFG_METHOD,
4655 &cfgMethods) != eSIR_SUCCESS)
4656 {
4657 pDot11f->ConfigMethods.present = 0;
4658 pDot11f->ConfigMethods.methods = 0;
4659 }
4660 else
4661 {
4662 pDot11f->ConfigMethods.present = 1;
4663 pDot11f->ConfigMethods.methods = (tANI_U16) (cfgMethods & 0x0000FFFF);
4664 }
4665
4666 pDot11f->RFBands.present = 0;
4667
4668 pDot11f->present = 1;
4669 return eSIR_SUCCESS;
4670}
4671
4672tSirRetStatus PopulateDot11fWscRegistrarInfoInProbeRes(tpAniSirGlobal pMac,
4673 tDot11fIEWscProbeRes *pDot11f)
4674{
4675 const struct sLimWscIeInfo *const pWscIeInfo = &(pMac->lim.wscIeInfo);
4676 tANI_U32 devicepasswdId;
4677
4678 pDot11f->APSetupLocked.present = 1;
4679 pDot11f->APSetupLocked.fLocked = pWscIeInfo->apSetupLocked;
4680
4681 pDot11f->SelectedRegistrar.present = 1;
4682 pDot11f->SelectedRegistrar.selected = pWscIeInfo->selectedRegistrar;
4683
4684 if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_DEVICE_PASSWORD_ID, &devicepasswdId) != eSIR_SUCCESS)
4685 limLog(pMac, LOGP,"Failed to cfg get id %d\n", WNI_CFG_WPS_DEVICE_PASSWORD_ID );
4686
4687 pDot11f->DevicePasswordID.present = 1;
4688 pDot11f->DevicePasswordID.id = (tANI_U16) devicepasswdId;
4689
4690 pDot11f->SelectedRegistrarConfigMethods.present = 1;
4691 pDot11f->SelectedRegistrarConfigMethods.methods = pWscIeInfo->selectedRegistrarConfigMethods;
4692
4693 // UUID_E and RF Bands are applicable only for dual band AP
4694
4695 return eSIR_SUCCESS;
4696}
4697
4698tSirRetStatus DePopulateDot11fWscRegistrarInfoInProbeRes(tpAniSirGlobal pMac,
4699 tDot11fIEWscProbeRes *pDot11f)
4700{
4701 pDot11f->APSetupLocked.present = 0;
4702 pDot11f->SelectedRegistrar.present = 0;
4703 pDot11f->DevicePasswordID.present = 0;
4704 pDot11f->SelectedRegistrarConfigMethods.present = 0;
4705
4706 return eSIR_SUCCESS;
4707}
4708
4709tSirRetStatus PopulateDot11fAssocResWscIE(tpAniSirGlobal pMac,
4710 tDot11fIEWscAssocRes *pDot11f,
4711 tpSirAssocReq pRcvdAssocReq)
4712{
4713 tDot11fIEWscAssocReq parsedWscAssocReq = { 0, };
4714 tANI_U8 *wscIe;
4715
4716
4717 wscIe = limGetWscIEPtr(pMac, pRcvdAssocReq->addIE.addIEdata, pRcvdAssocReq->addIE.length);
4718 if(wscIe != NULL)
4719 {
4720 // retreive WSC IE from given AssocReq
4721 dot11fUnpackIeWscAssocReq( pMac,
4722 wscIe + 2 + 4, // EID, length, OUI
4723 wscIe[ 1 ] - 4, // length without OUI
4724 &parsedWscAssocReq );
4725 pDot11f->present = 1;
4726 // version has to be 0x10
4727 pDot11f->Version.present = 1;
4728 pDot11f->Version.major = 0x1;
4729 pDot11f->Version.minor = 0x0;
4730
4731 pDot11f->ResponseType.present = 1;
4732
4733 if ((parsedWscAssocReq.RequestType.reqType == REQ_TYPE_REGISTRAR) ||
4734 (parsedWscAssocReq.RequestType.reqType == REQ_TYPE_WLAN_MANAGER_REGISTRAR))
4735 {
4736 pDot11f->ResponseType.resType = RESP_TYPE_ENROLLEE_OPEN_8021X;
4737 }
4738 else
4739 {
4740 pDot11f->ResponseType.resType = RESP_TYPE_AP;
4741 }
4742 // Version infomration should be taken from our capability as well as peers
4743 // TODO: currently it takes from peers only
4744 if(parsedWscAssocReq.VendorExtension.present &&
4745 parsedWscAssocReq.VendorExtension.Version2.present)
4746 {
4747 pDot11f->VendorExtension.present = 1;
4748 pDot11f->VendorExtension.vendorId[0] = 0x00;
4749 pDot11f->VendorExtension.vendorId[1] = 0x37;
4750 pDot11f->VendorExtension.vendorId[2] = 0x2A;
4751 pDot11f->VendorExtension.Version2.present = 1;
4752 pDot11f->VendorExtension.Version2.major = parsedWscAssocReq.VendorExtension.Version2.major;
4753 pDot11f->VendorExtension.Version2.minor = parsedWscAssocReq.VendorExtension.Version2.minor;
4754 }
4755 }
4756 return eSIR_SUCCESS;
4757}
4758
4759#ifdef WLAN_FEATURE_P2P
4760tSirRetStatus PopulateDot11AssocResP2PIE(tpAniSirGlobal pMac,
4761 tDot11fIEP2PAssocRes *pDot11f,
4762 tpSirAssocReq pRcvdAssocReq)
4763{
4764 tANI_U8 *p2pIe;
4765
4766 p2pIe = limGetP2pIEPtr(pMac, pRcvdAssocReq->addIE.addIEdata, pRcvdAssocReq->addIE.length);
4767 if(p2pIe != NULL)
4768 {
4769 pDot11f->present = 1;
4770 pDot11f->P2PStatus.present = 1;
4771 pDot11f->P2PStatus.status = eSIR_SUCCESS;
4772 pDot11f->ExtendedListenTiming.present = 0;
4773 }
4774 return eSIR_SUCCESS;
4775}
4776#endif
4777
4778#if defined WLAN_FEATURE_VOWIFI
4779
4780tSirRetStatus PopulateDot11fWFATPC( tpAniSirGlobal pMac,
4781 tDot11fIEWFATPC *pDot11f, tANI_U8 txPower, tANI_U8 linkMargin )
4782{
4783 pDot11f->txPower = txPower;
4784 pDot11f->linkMargin = linkMargin;
4785 pDot11f->present = 1;
4786
4787 return eSIR_SUCCESS;
4788}
4789
4790tSirRetStatus PopulateDot11fBeaconReport( tpAniSirGlobal pMac, tDot11fIEMeasurementReport *pDot11f, tSirMacBeaconReport *pBeaconReport )
4791{
4792
4793 pDot11f->report.Beacon.regClass = pBeaconReport->regClass;
4794 pDot11f->report.Beacon.channel = pBeaconReport->channel;
4795 palCopyMemory( pMac->hHdd, pDot11f->report.Beacon.meas_start_time, pBeaconReport->measStartTime, sizeof(pDot11f->report.Beacon.meas_start_time) );
4796 pDot11f->report.Beacon.meas_duration = pBeaconReport->measDuration;
4797 pDot11f->report.Beacon.condensed_PHY = pBeaconReport->phyType;
4798 pDot11f->report.Beacon.reported_frame_type = !pBeaconReport->bcnProbeRsp;
4799 pDot11f->report.Beacon.RCPI = pBeaconReport->rcpi;
4800 pDot11f->report.Beacon.RSNI = pBeaconReport->rsni;
4801 palCopyMemory( pMac->hHdd, pDot11f->report.Beacon.BSSID, pBeaconReport->bssid, sizeof(tSirMacAddr));
4802 pDot11f->report.Beacon.antenna_id = pBeaconReport->antennaId;
4803 pDot11f->report.Beacon.parent_TSF = pBeaconReport->parentTSF;
4804
4805 if( pBeaconReport->numIes )
4806 {
4807 pDot11f->report.Beacon.BeaconReportFrmBody.present = 1;
4808 palCopyMemory( pMac->hHdd, pDot11f->report.Beacon.BeaconReportFrmBody.reportedFields, pBeaconReport->Ies, pBeaconReport->numIes );
4809 pDot11f->report.Beacon.BeaconReportFrmBody.num_reportedFields = pBeaconReport->numIes;
4810 }
4811
4812 return eSIR_SUCCESS;
4813
4814}
4815
4816tSirRetStatus PopulateDot11fRRMIe( tpAniSirGlobal pMac, tDot11fIERRMEnabledCap *pDot11f, tpPESession psessionEntry )
4817{
4818 tpRRMCaps pRrmCaps;
4819
4820 pRrmCaps = rrmGetCapabilities( pMac, psessionEntry );
4821
4822 pDot11f->LinkMeasurement = pRrmCaps->LinkMeasurement ;
4823 pDot11f->NeighborRpt = pRrmCaps->NeighborRpt ;
4824 pDot11f->parallel = pRrmCaps->parallel ;
4825 pDot11f->repeated = pRrmCaps->repeated ;
4826 pDot11f->BeaconPassive = pRrmCaps->BeaconPassive ;
4827 pDot11f->BeaconActive = pRrmCaps->BeaconActive ;
4828 pDot11f->BeaconTable = pRrmCaps->BeaconTable ;
4829 pDot11f->BeaconRepCond = pRrmCaps->BeaconRepCond ;
4830 pDot11f->FrameMeasurement = pRrmCaps->FrameMeasurement ;
4831 pDot11f->ChannelLoad = pRrmCaps->ChannelLoad ;
4832 pDot11f->NoiseHistogram = pRrmCaps->NoiseHistogram ;
4833 pDot11f->statistics = pRrmCaps->statistics ;
4834 pDot11f->LCIMeasurement = pRrmCaps->LCIMeasurement ;
4835 pDot11f->LCIAzimuth = pRrmCaps->LCIAzimuth ;
4836 pDot11f->TCMCapability = pRrmCaps->TCMCapability ;
4837 pDot11f->triggeredTCM = pRrmCaps->triggeredTCM ;
4838 pDot11f->APChanReport = pRrmCaps->APChanReport ;
4839 pDot11f->RRMMIBEnabled = pRrmCaps->RRMMIBEnabled ;
4840 pDot11f->operatingChanMax = pRrmCaps->operatingChanMax ;
4841 pDot11f->nonOperatinChanMax = pRrmCaps->nonOperatingChanMax ;
4842 pDot11f->MeasurementPilot = pRrmCaps->MeasurementPilot ;
4843 pDot11f->MeasurementPilotEnabled = pRrmCaps->MeasurementPilotEnabled ;
4844 pDot11f->NeighborTSFOffset = pRrmCaps->NeighborTSFOffset ;
4845 pDot11f->RCPIMeasurement = pRrmCaps->RCPIMeasurement ;
4846 pDot11f->RSNIMeasurement = pRrmCaps->RSNIMeasurement ;
4847 pDot11f->BssAvgAccessDelay = pRrmCaps->BssAvgAccessDelay ;
4848 pDot11f->BSSAvailAdmission = pRrmCaps->BSSAvailAdmission ;
4849 pDot11f->AntennaInformation = pRrmCaps->AntennaInformation ;
4850
4851 pDot11f->present = 1;
4852 return eSIR_SUCCESS;
4853}
4854#endif
4855
4856#if defined WLAN_FEATURE_VOWIFI_11R
4857void PopulateMDIE( tpAniSirGlobal pMac,
4858 tDot11fIEMobilityDomain *pDot11f, tANI_U8 mdie[SIR_MDIE_SIZE] )
4859{
4860 pDot11f->present = 1;
4861 pDot11f->MDID = (tANI_U16)((mdie[1] << 8) | (mdie[0]));
4862
4863 // Plugfest fix
4864 pDot11f->overDSCap = (mdie[2] & 0x01);
4865 pDot11f->resourceReqCap = ((mdie[2] >> 1) & 0x01);
4866
4867}
4868
4869void PopulateFTInfo( tpAniSirGlobal pMac,
4870 tDot11fIEFTInfo *pDot11f )
4871{
4872 pDot11f->present = 1;
4873 pDot11f->IECount = 0; //TODO: put valid data during reassoc.
4874 //All other info is zero.
4875
4876}
4877#endif
4878
4879void PopulateDot11fAssocRspRates ( tpAniSirGlobal pMac, tDot11fIESuppRates *pSupp,
4880 tDot11fIEExtSuppRates *pExt, tANI_U16 *_11bRates, tANI_U16 *_11aRates )
4881{
4882 tANI_U8 num_supp = 0, num_ext = 0;
4883 tANI_U8 i,j;
4884
4885 for( i = 0 ; (i < SIR_NUM_11B_RATES && _11bRates[i]) ; i++, num_supp++ )
4886 {
4887 pSupp->rates[num_supp] = (tANI_U8)_11bRates[i];
4888 }
4889 for( j = 0 ; (j < SIR_NUM_11A_RATES && _11aRates[j]) ; j++ )
4890 {
4891 if( num_supp < 8 )
4892 pSupp->rates[num_supp++] = (tANI_U8)_11aRates[j];
4893 else
4894 pExt->rates[num_ext++] = (tANI_U8)_11aRates[j];
4895 }
4896
4897 if( num_supp )
4898 {
4899 pSupp->num_rates = num_supp;
4900 pSupp->present = 1;
4901 }
4902 if( num_ext )
4903 {
4904 pExt->num_rates = num_ext;
4905 pExt->present = 1;
4906 }
4907}
4908// parserApi.c ends here.