blob: 50624f1c2836467bddbe958deda00c15383fcfaf [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,
296 tpPESession psessionEntry)
297{
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{
2169 tDot11fAssocRequest ar;
2170 tANI_U32 status;
2171
2172 // Zero-init our [out] parameter,
2173 palZeroMemory( pMac->hHdd, ( tANI_U8* )pAssocReq, sizeof(tSirAssocReq) );
2174 palZeroMemory( pMac->hHdd, ( tANI_U8* )&ar, sizeof( tDot11fAssocRequest ) );
2175
2176 // delegate to the framesc-generated code,
2177 status = dot11fUnpackAssocRequest( pMac, pFrame, nFrame, &ar );
2178 if ( DOT11F_FAILED( status ) )
2179 {
2180 limLog(pMac, LOGE, FL("Failed to parse an Association Request (0x%08x, %d bytes):\n"),
2181 status, nFrame);
2182 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
2183 return eSIR_FAILURE;
2184 }
2185 else if ( DOT11F_WARNED( status ) )
2186 {
2187 limLog( pMac, LOGW, FL("There were warnings while unpacking an Assoication Request (0x%08x, %d bytes):\n"),
2188 status, nFrame );
2189 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
2190 }
2191
2192 // & "transliterate" from a 'tDot11fAssocRequest' to a 'tSirAssocReq'...
2193
2194 // make sure this is seen as an assoc request
2195 pAssocReq->reassocRequest = 0;
2196
2197 // Capabilities
2198 pAssocReq->capabilityInfo.ess = ar.Capabilities.ess;
2199 pAssocReq->capabilityInfo.ibss = ar.Capabilities.ibss;
2200 pAssocReq->capabilityInfo.cfPollable = ar.Capabilities.cfPollable;
2201 pAssocReq->capabilityInfo.cfPollReq = ar.Capabilities.cfPollReq;
2202 pAssocReq->capabilityInfo.privacy = ar.Capabilities.privacy;
2203 pAssocReq->capabilityInfo.shortPreamble = ar.Capabilities.shortPreamble;
2204 pAssocReq->capabilityInfo.pbcc = ar.Capabilities.pbcc;
2205 pAssocReq->capabilityInfo.channelAgility = ar.Capabilities.channelAgility;
2206 pAssocReq->capabilityInfo.spectrumMgt = ar.Capabilities.spectrumMgt;
2207 pAssocReq->capabilityInfo.qos = ar.Capabilities.qos;
2208 pAssocReq->capabilityInfo.shortSlotTime = ar.Capabilities.shortSlotTime;
2209 pAssocReq->capabilityInfo.apsd = ar.Capabilities.apsd;
2210 pAssocReq->capabilityInfo.rrm = ar.Capabilities.rrm;
2211 pAssocReq->capabilityInfo.dsssOfdm = ar.Capabilities.dsssOfdm;
2212 pAssocReq->capabilityInfo.delayedBA = ar.Capabilities.delayedBA;
2213 pAssocReq->capabilityInfo.immediateBA = ar.Capabilities.immediateBA;
2214
2215 // Listen Interval
2216 pAssocReq->listenInterval = ar.ListenInterval.interval;
2217
2218 // SSID
2219 if ( ar.SSID.present )
2220 {
2221 pAssocReq->ssidPresent = 1;
2222 ConvertSSID( pMac, &pAssocReq->ssId, &ar.SSID );
2223 }
2224
2225 // Supported Rates
2226 if ( ar.SuppRates.present )
2227 {
2228 pAssocReq->suppRatesPresent = 1;
2229 ConvertSuppRates( pMac, &pAssocReq->supportedRates, &ar.SuppRates );
2230 }
2231
2232 // Extended Supported Rates
2233 if ( ar.ExtSuppRates.present )
2234 {
2235 pAssocReq->extendedRatesPresent = 1;
2236 ConvertExtSuppRates( pMac, &pAssocReq->extendedRates, &ar.ExtSuppRates );
2237 }
2238
2239 // QOS Capabilities:
2240 if ( ar.QOSCapsStation.present )
2241 {
2242 pAssocReq->qosCapabilityPresent = 1;
2243 ConvertQOSCapsStation( pMac, &pAssocReq->qosCapability, &ar.QOSCapsStation );
2244 }
2245
2246 // WPA
2247 if ( ar.WPAOpaque.present )
2248 {
2249 pAssocReq->wpaPresent = 1;
2250 ConvertWPAOpaque( pMac, &pAssocReq->wpa, &ar.WPAOpaque );
2251 }
2252
2253 // RSN
2254 if ( ar.RSNOpaque.present )
2255 {
2256 pAssocReq->rsnPresent = 1;
2257 ConvertRSNOpaque( pMac, &pAssocReq->rsn, &ar.RSNOpaque );
2258 }
2259
2260 // WSC IE
2261 if (ar.WscIEOpaque.present)
2262 {
2263 pAssocReq->addIEPresent = 1;
2264 ConvertWscOpaque(pMac, &pAssocReq->addIE, &ar.WscIEOpaque);
2265 }
2266
2267
2268#ifdef WLAN_FEATURE_P2P
2269 if(ar.P2PIEOpaque.present)
2270 {
2271 pAssocReq->addIEPresent = 1;
2272 ConvertP2POpaque( pMac, &pAssocReq->addIE, &ar.P2PIEOpaque);
2273 }
2274#endif
2275
Jeff Johnsone7245742012-09-05 17:12:55 -07002276#ifdef WLAN_FEATURE_WFD
2277 if(ar.WFDIEOpaque.present)
2278 {
2279 pAssocReq->addIEPresent = 1;
2280 ConvertWFDOpaque( pMac, &pAssocReq->addIE, &ar.WFDIEOpaque);
2281 }
2282#endif
2283
Jeff Johnson295189b2012-06-20 16:38:30 -07002284 // Power Capabilities
2285 if ( ar.PowerCaps.present )
2286 {
2287 pAssocReq->powerCapabilityPresent = 1;
2288 ConvertPowerCaps( pMac, &pAssocReq->powerCapability, &ar.PowerCaps );
2289 }
2290
2291 // Supported Channels
2292 if ( ar.SuppChannels.present )
2293 {
2294 pAssocReq->supportedChannelsPresent = 1;
2295 ConvertSuppChannels( pMac, &pAssocReq->supportedChannels, &ar.SuppChannels );
2296 }
2297
2298 if ( ar.HTCaps.present )
2299 {
2300 palCopyMemory( pMac, &pAssocReq->HTCaps, &ar.HTCaps, sizeof( tDot11fIEHTCaps ) );
2301 }
2302
2303 if ( ar.WMMInfoStation.present )
2304 {
2305 pAssocReq->wmeInfoPresent = 1;
2306#ifdef WLAN_SOFTAP_FEATURE
2307 palCopyMemory( pMac, &pAssocReq->WMMInfoStation, &ar.WMMInfoStation, sizeof( tDot11fIEWMMInfoStation ) );
2308#endif
2309
2310 }
2311
2312
2313 if ( ar.WMMCaps.present ) pAssocReq->wsmCapablePresent = 1;
2314
2315 if ( ! pAssocReq->ssidPresent )
2316 {
2317 PELOG2(limLog(pMac, LOG2, FL("Received Assoc without SSID IE.\n"));)
2318 return eSIR_FAILURE;
2319 }
2320
2321 if ( !pAssocReq->suppRatesPresent && !pAssocReq->extendedRatesPresent )
2322 {
2323 PELOG2(limLog(pMac, LOG2, FL("Received Assoc without supp rate IE.\n"));)
2324 return eSIR_FAILURE;
2325 }
2326
Jeff Johnsone7245742012-09-05 17:12:55 -07002327#ifdef WLAN_FEATURE_11AC
2328 if ( ar.VHTCaps.present )
2329 {
2330 palCopyMemory( pMac, &pAssocReq->VHTCaps, &ar.VHTCaps, sizeof( tDot11fIEVHTCaps ) );
2331 limLog( pMac, LOGW, FL("Received Assoc Req with VHT Cap\n"));
2332 limLogVHTCap( pMac, &pAssocReq->VHTCaps);
2333 }
Mohit Khanna7d5aeb22012-09-11 16:21:57 -07002334 if ( ar.OperatingMode.present )
2335 {
2336 palCopyMemory( pMac, &pAssocReq->operMode, &ar.OperatingMode, sizeof( tDot11fIEVHTCaps ) );
2337 limLog( pMac, LOGW, FL("Received Assoc Req with Operating Mode IE\n"));
2338 limLogOperatingMode( pMac, &pAssocReq->operMode);
2339 }
Jeff Johnsone7245742012-09-05 17:12:55 -07002340#endif
2341
Jeff Johnson295189b2012-06-20 16:38:30 -07002342 return eSIR_SUCCESS;
2343
2344} // End sirConvertAssocReqFrame2Struct.
2345
2346tSirRetStatus
2347sirConvertAssocRespFrame2Struct(tpAniSirGlobal pMac,
2348 tANI_U8 *pFrame,
2349 tANI_U32 nFrame,
2350 tpSirAssocRsp pAssocRsp)
2351{
2352 static tDot11fAssocResponse ar;
2353 tANI_U32 status;
2354 tANI_U8 cnt =0;
2355
2356 // Zero-init our [out] parameter,
2357 palZeroMemory( pMac->hHdd, ( tANI_U8* )pAssocRsp, sizeof(tSirAssocRsp) );
2358
2359 // delegate to the framesc-generated code,
2360 status = dot11fUnpackAssocResponse( pMac, pFrame, nFrame, &ar);
2361 if ( DOT11F_FAILED( status ) )
2362 {
2363 limLog(pMac, LOGE, FL("Failed to parse an Association Response (0x%08x, %d bytes):\n"),
2364 status, nFrame);
2365 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
2366 return eSIR_FAILURE;
2367 }
2368 else if ( DOT11F_WARNED( status ) )
2369 {
2370 limLog( pMac, LOGW, FL("There were warnings while unpacking an Association Response (0x%08x, %d bytes):\n"),
2371 status, nFrame );
2372 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
2373 }
2374
2375 // & "transliterate" from a 'tDot11fAssocResponse' a 'tSirAssocRsp'...
2376
2377 // Capabilities
2378 pAssocRsp->capabilityInfo.ess = ar.Capabilities.ess;
2379 pAssocRsp->capabilityInfo.ibss = ar.Capabilities.ibss;
2380 pAssocRsp->capabilityInfo.cfPollable = ar.Capabilities.cfPollable;
2381 pAssocRsp->capabilityInfo.cfPollReq = ar.Capabilities.cfPollReq;
2382 pAssocRsp->capabilityInfo.privacy = ar.Capabilities.privacy;
2383 pAssocRsp->capabilityInfo.shortPreamble = ar.Capabilities.shortPreamble;
2384 pAssocRsp->capabilityInfo.pbcc = ar.Capabilities.pbcc;
2385 pAssocRsp->capabilityInfo.channelAgility = ar.Capabilities.channelAgility;
2386 pAssocRsp->capabilityInfo.spectrumMgt = ar.Capabilities.spectrumMgt;
2387 pAssocRsp->capabilityInfo.qos = ar.Capabilities.qos;
2388 pAssocRsp->capabilityInfo.shortSlotTime = ar.Capabilities.shortSlotTime;
2389 pAssocRsp->capabilityInfo.apsd = ar.Capabilities.apsd;
2390 pAssocRsp->capabilityInfo.rrm = ar.Capabilities.rrm;
2391 pAssocRsp->capabilityInfo.dsssOfdm = ar.Capabilities.dsssOfdm;
2392 pAssocRsp->capabilityInfo.delayedBA = ar.Capabilities.delayedBA;
2393 pAssocRsp->capabilityInfo.immediateBA = ar.Capabilities.immediateBA;
2394
2395 pAssocRsp->statusCode = ar.Status.status;
2396 pAssocRsp->aid = ar.AID.associd;
2397
2398 if ( ! ar.SuppRates.present )
2399 {
2400 pAssocRsp->suppRatesPresent = 0;
2401 PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!\n"));)
2402 }
2403 else
2404 {
2405 pAssocRsp->suppRatesPresent = 1;
2406 ConvertSuppRates( pMac, &pAssocRsp->supportedRates, &ar.SuppRates );
2407 }
2408
2409 if ( ar.ExtSuppRates.present )
2410 {
2411 pAssocRsp->extendedRatesPresent = 1;
2412 ConvertExtSuppRates( pMac, &pAssocRsp->extendedRates, &ar.ExtSuppRates );
2413 }
2414
2415 if ( ar.EDCAParamSet.present )
2416 {
2417 pAssocRsp->edcaPresent = 1;
2418 ConvertEDCAParam( pMac, &pAssocRsp->edca, &ar.EDCAParamSet );
2419 }
2420
2421
2422 if ( ar.WMMParams.present )
2423 {
2424 pAssocRsp->wmeEdcaPresent = 1;
2425 ConvertWMMParams( pMac, &pAssocRsp->edca, &ar.WMMParams);
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -07002426 limLog(pMac, LOG1, FL("WMM Parameter Element present in Association Response Frame!"));
Jeff Johnson295189b2012-06-20 16:38:30 -07002427 __printWMMParams(pMac, &ar.WMMParams);
2428 }
2429
2430 if ( ar.HTCaps.present )
2431 {
2432 palCopyMemory( pMac, &pAssocRsp->HTCaps, &ar.HTCaps, sizeof( tDot11fIEHTCaps ) );
2433 }
2434
2435 if ( ar.HTInfo.present )
2436 {
2437 palCopyMemory( pMac, &pAssocRsp->HTInfo, &ar.HTInfo, sizeof( tDot11fIEHTInfo ) );
2438 }
2439
2440#ifdef WLAN_FEATURE_VOWIFI_11R
2441 if (ar.MobilityDomain.present)
2442 {
2443 // MobilityDomain
2444 pAssocRsp->mdiePresent = 1;
2445 palCopyMemory( pMac->hHdd, (tANI_U8 *)&(pAssocRsp->mdie[0]), (tANI_U8 *)&(ar.MobilityDomain.MDID), sizeof(tANI_U16) );
2446 pAssocRsp->mdie[2] = ((ar.MobilityDomain.overDSCap << 0) | (ar.MobilityDomain.resourceReqCap << 1));
2447#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -07002448 limLog(pMac, LOG1, FL("new mdie=%02x%02x%02x"), (unsigned int)pAssocRsp->mdie[0],
Jeff Johnson295189b2012-06-20 16:38:30 -07002449 (unsigned int)pAssocRsp->mdie[1], (unsigned int)pAssocRsp->mdie[2]);
2450#endif
2451 }
2452
2453 if ( ar.FTInfo.present )
2454 {
2455#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -07002456 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 -07002457 ar.FTInfo.R0KH_ID.present,
2458 ar.FTInfo.R1KH_ID.present);
2459#endif
2460 pAssocRsp->ftinfoPresent = 1;
2461 palCopyMemory( pMac, &pAssocRsp->FTInfo, &ar.FTInfo, sizeof(tDot11fIEFTInfo) );
2462 }
2463#endif
2464
2465#ifdef WLAN_FEATURE_VOWIFI_11R
2466 if (ar.num_RICDataDesc) {
2467 for (cnt=0; cnt < ar.num_RICDataDesc; cnt++) {
2468 if (ar.RICDataDesc[cnt].present) {
2469 palCopyMemory(pMac, &pAssocRsp->RICData[cnt], &ar.RICDataDesc[cnt], sizeof(tDot11fIERICDataDesc));
2470 }
2471 }
2472 pAssocRsp->num_RICData = ar.num_RICDataDesc;
2473 pAssocRsp->ricPresent = TRUE;
2474 }
2475#endif
2476
2477#ifdef FEATURE_WLAN_CCX
2478 if (ar.num_WMMTSPEC) {
2479 pAssocRsp->num_tspecs = ar.num_WMMTSPEC;
2480 for (cnt=0; cnt < ar.num_WMMTSPEC; cnt++) {
2481 palCopyMemory(pMac, &pAssocRsp->TSPECInfo[cnt], &ar.WMMTSPEC[cnt], (sizeof(tDot11fIEWMMTSPEC)*ar.num_WMMTSPEC));
2482 }
2483 pAssocRsp->tspecPresent = TRUE;
2484 }
2485
2486 if(ar.CCXTrafStrmMet.present)
2487 {
2488 pAssocRsp->tsmPresent = 1;
2489 palCopyMemory(pMac->hHdd,&pAssocRsp->tsmIE.tsid,
2490 &ar.CCXTrafStrmMet.tsid,sizeof(tSirMacCCXTSMIE));
2491 }
2492#endif
2493
Jeff Johnsone7245742012-09-05 17:12:55 -07002494#ifdef WLAN_FEATURE_11AC
2495 if ( ar.VHTCaps.present )
2496 {
2497 palCopyMemory( pMac, &pAssocRsp->VHTCaps, &ar.VHTCaps, sizeof( tDot11fIEVHTCaps ) );
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -07002498 limLog( pMac, LOG1, FL("Received Assoc Response with VHT Cap"));
Jeff Johnsone7245742012-09-05 17:12:55 -07002499 limLogVHTCap(pMac, &pAssocRsp->VHTCaps);
2500 }
2501 if ( ar.VHTOperation.present )
2502 {
2503 palCopyMemory( pMac, &pAssocRsp->VHTOperation, &ar.VHTOperation, sizeof( tDot11fIEVHTOperation) );
Madan Mohan Koyyalamudi8bdd3112012-09-24 13:55:14 -07002504 limLog( pMac, LOG1, FL("Received Assoc Response with VHT Operation"));
Jeff Johnsone7245742012-09-05 17:12:55 -07002505 limLogVHTOperation(pMac, &pAssocRsp->VHTOperation);
2506 }
2507#endif
2508
Jeff Johnson295189b2012-06-20 16:38:30 -07002509 return eSIR_SUCCESS;
2510
2511} // End sirConvertAssocRespFrame2Struct.
2512
2513tSirRetStatus
2514sirConvertReassocReqFrame2Struct(tpAniSirGlobal pMac,
2515 tANI_U8 *pFrame,
2516 tANI_U32 nFrame,
2517 tpSirAssocReq pAssocReq)
2518{
2519 static tDot11fReAssocRequest ar;
2520 tANI_U32 status;
2521
2522 // Zero-init our [out] parameter,
2523 palZeroMemory( pMac->hHdd, ( tANI_U8* )pAssocReq, sizeof(tSirAssocReq) );
2524
2525 // delegate to the framesc-generated code,
2526 status = dot11fUnpackReAssocRequest( pMac, pFrame, nFrame, &ar );
2527 if ( DOT11F_FAILED( status ) )
2528 {
2529 limLog(pMac, LOGE, FL("Failed to parse a Re-association Request (0x%08x, %d bytes):\n"),
2530 status, nFrame);
2531 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
2532 return eSIR_FAILURE;
2533 }
2534 else if ( DOT11F_WARNED( status ) )
2535 {
2536 limLog( pMac, LOGW, FL("There were warnings while unpacking a Re-association Request (0x%08x, %d bytes):\n"),
2537 status, nFrame );
2538 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
2539 }
2540
2541 // & "transliterate" from a 'tDot11fReAssocRequest' to a 'tSirAssocReq'...
2542
2543 // make sure this is seen as a re-assoc request
2544 pAssocReq->reassocRequest = 1;
2545
2546 // Capabilities
2547 pAssocReq->capabilityInfo.ess = ar.Capabilities.ess;
2548 pAssocReq->capabilityInfo.ibss = ar.Capabilities.ibss;
2549 pAssocReq->capabilityInfo.cfPollable = ar.Capabilities.cfPollable;
2550 pAssocReq->capabilityInfo.cfPollReq = ar.Capabilities.cfPollReq;
2551 pAssocReq->capabilityInfo.privacy = ar.Capabilities.privacy;
2552 pAssocReq->capabilityInfo.shortPreamble = ar.Capabilities.shortPreamble;
2553 pAssocReq->capabilityInfo.pbcc = ar.Capabilities.pbcc;
2554 pAssocReq->capabilityInfo.channelAgility = ar.Capabilities.channelAgility;
2555 pAssocReq->capabilityInfo.spectrumMgt = ar.Capabilities.spectrumMgt;
2556 pAssocReq->capabilityInfo.qos = ar.Capabilities.qos;
2557 pAssocReq->capabilityInfo.shortSlotTime = ar.Capabilities.shortSlotTime;
2558 pAssocReq->capabilityInfo.apsd = ar.Capabilities.apsd;
2559 pAssocReq->capabilityInfo.rrm = ar.Capabilities.rrm;
2560 pAssocReq->capabilityInfo.dsssOfdm = ar.Capabilities.dsssOfdm;
2561 pAssocReq->capabilityInfo.delayedBA = ar.Capabilities.delayedBA;
2562 pAssocReq->capabilityInfo.immediateBA = ar.Capabilities.immediateBA;
2563
2564 // Listen Interval
2565 pAssocReq->listenInterval = ar.ListenInterval.interval;
2566
2567 // SSID
2568 if ( ar.SSID.present )
2569 {
2570 pAssocReq->ssidPresent = 1;
2571 ConvertSSID( pMac, &pAssocReq->ssId, &ar.SSID );
2572 }
2573
2574 // Supported Rates
2575 if ( ar.SuppRates.present )
2576 {
2577 pAssocReq->suppRatesPresent = 1;
2578 ConvertSuppRates( pMac, &pAssocReq->supportedRates, &ar.SuppRates );
2579 }
2580
2581 // Extended Supported Rates
2582 if ( ar.ExtSuppRates.present )
2583 {
2584 pAssocReq->extendedRatesPresent = 1;
2585 ConvertExtSuppRates( pMac, &pAssocReq->extendedRates,
2586 &ar.ExtSuppRates );
2587 }
2588
2589 // QOS Capabilities:
2590 if ( ar.QOSCapsStation.present )
2591 {
2592 pAssocReq->qosCapabilityPresent = 1;
2593 ConvertQOSCapsStation( pMac, &pAssocReq->qosCapability, &ar.QOSCapsStation );
2594 }
2595
2596 // WPA
2597 if ( ar.WPAOpaque.present )
2598 {
2599 pAssocReq->wpaPresent = 1;
2600 ConvertWPAOpaque( pMac, &pAssocReq->wpa, &ar.WPAOpaque );
2601 }
2602
2603 // RSN
2604 if ( ar.RSNOpaque.present )
2605 {
2606 pAssocReq->rsnPresent = 1;
2607 ConvertRSNOpaque( pMac, &pAssocReq->rsn, &ar.RSNOpaque );
2608 }
2609
2610
2611 // Power Capabilities
2612 if ( ar.PowerCaps.present )
2613 {
2614 pAssocReq->powerCapabilityPresent = 1;
2615 ConvertPowerCaps( pMac, &pAssocReq->powerCapability, &ar.PowerCaps );
2616 }
2617
2618 // Supported Channels
2619 if ( ar.SuppChannels.present )
2620 {
2621 pAssocReq->supportedChannelsPresent = 1;
2622 ConvertSuppChannels( pMac, &pAssocReq->supportedChannels, &ar.SuppChannels );
2623 }
2624
2625 if ( ar.HTCaps.present )
2626 {
2627 palCopyMemory( pMac, &pAssocReq->HTCaps, &ar.HTCaps, sizeof( tDot11fIEHTCaps ) );
2628 }
2629
2630 if ( ar.WMMInfoStation.present )
2631 {
2632 pAssocReq->wmeInfoPresent = 1;
2633#ifdef WLAN_SOFTAP_FEATURE
2634 palCopyMemory( pMac, &pAssocReq->WMMInfoStation, &ar.WMMInfoStation, sizeof( tDot11fIEWMMInfoStation ) );
2635#endif
2636
2637 }
2638
2639 if ( ar.WMMCaps.present ) pAssocReq->wsmCapablePresent = 1;
2640
2641 if ( ! pAssocReq->ssidPresent )
2642 {
2643 PELOG2(limLog(pMac, LOG2, FL("Received Assoc without SSID IE.\n"));)
2644 return eSIR_FAILURE;
2645 }
2646
2647 if ( ! pAssocReq->suppRatesPresent && ! pAssocReq->extendedRatesPresent )
2648 {
2649 PELOG2(limLog(pMac, LOG2, FL("Received Assoc without supp rate IE.\n"));)
2650 return eSIR_FAILURE;
2651 }
2652
2653 // Why no call to 'updateAssocReqFromPropCapability' here, like
2654 // there is in 'sirConvertAssocReqFrame2Struct'?
2655
2656 // WSC IE
2657 if (ar.WscIEOpaque.present)
2658 {
2659 pAssocReq->addIEPresent = 1;
2660 ConvertWscOpaque(pMac, &pAssocReq->addIE, &ar.WscIEOpaque);
2661 }
2662
2663#ifdef WLAN_FEATURE_P2P
2664 if(ar.P2PIEOpaque.present)
2665 {
2666 pAssocReq->addIEPresent = 1;
2667 ConvertP2POpaque( pMac, &pAssocReq->addIE, &ar.P2PIEOpaque);
2668 }
2669#endif
2670
Jeff Johnsone7245742012-09-05 17:12:55 -07002671#ifdef WLAN_FEATURE_WFD
2672 if(ar.WFDIEOpaque.present)
2673 {
2674 pAssocReq->addIEPresent = 1;
2675 ConvertWFDOpaque( pMac, &pAssocReq->addIE, &ar.WFDIEOpaque);
2676 }
2677#endif
2678
2679#ifdef WLAN_FEATURE_11AC
2680 if ( ar.VHTCaps.present )
2681 {
2682 palCopyMemory( pMac, &pAssocReq->VHTCaps, &ar.VHTCaps, sizeof( tDot11fIEVHTCaps ) );
2683 }
Mohit Khanna7d5aeb22012-09-11 16:21:57 -07002684 if ( ar.OperatingMode.present )
2685 {
2686 palCopyMemory( pMac, &pAssocReq->operMode, &ar.OperatingMode, sizeof( tDot11fIEVHTCaps ) );
2687 limLog( pMac, LOGW, FL("Received Assoc Req with Operating Mode IE\n"));
2688 limLogOperatingMode( pMac, &pAssocReq->operMode);
2689 }
Jeff Johnsone7245742012-09-05 17:12:55 -07002690#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002691 return eSIR_SUCCESS;
2692
2693} // End sirConvertReassocReqFrame2Struct.
2694
2695tSirRetStatus
2696sirParseBeaconIE(tpAniSirGlobal pMac,
2697 tpSirProbeRespBeacon pBeaconStruct,
2698 tANI_U8 *pPayload,
2699 tANI_U32 nPayload)
2700{
2701 tDot11fBeaconIEs *pBies;
2702 tANI_U32 status;
2703
2704 // Zero-init our [out] parameter,
2705 palZeroMemory( pMac->hHdd, ( tANI_U8* )pBeaconStruct, sizeof(tSirProbeRespBeacon) );
2706
2707 status = palAllocateMemory(pMac->hHdd, (void **)&pBies, sizeof(tDot11fBeaconIEs));
2708 if(!HAL_STATUS_SUCCESS(status))
2709 {
2710 limLog(pMac, LOGE, FL("Failed to allocate memory\n") );
2711 return eSIR_FAILURE;
2712 }
2713 // delegate to the framesc-generated code,
2714 status = dot11fUnpackBeaconIEs( pMac, pPayload, nPayload, pBies );
2715
2716 if ( DOT11F_FAILED( status ) )
2717 {
2718 limLog(pMac, LOGE, FL("Failed to parse Beacon IEs (0x%08x, %d bytes):\n"),
2719 status, nPayload);
2720 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);)
2721 palFreeMemory(pMac->hHdd, pBies);
2722 return eSIR_FAILURE;
2723 }
2724 else if ( DOT11F_WARNED( status ) )
2725 {
2726 limLog( pMac, LOGW, FL("There were warnings while unpacking Beacon IEs (0x%08x, %d bytes):\n"),
2727 status, nPayload );
2728 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);)
2729 }
2730
2731 // & "transliterate" from a 'tDot11fBeaconIEs' to a 'tSirProbeRespBeacon'...
2732 if ( ! pBies->SSID.present )
2733 {
2734 PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!\n"));)
2735 }
2736 else
2737 {
2738 pBeaconStruct->ssidPresent = 1;
2739 ConvertSSID( pMac, &pBeaconStruct->ssId, &pBies->SSID );
2740 }
2741
2742 if ( ! pBies->SuppRates.present )
2743 {
2744 PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!\n"));)
2745 }
2746 else
2747 {
2748 pBeaconStruct->suppRatesPresent = 1;
2749 ConvertSuppRates( pMac, &pBeaconStruct->supportedRates, &pBies->SuppRates );
2750 }
2751
2752 if ( pBies->ExtSuppRates.present )
2753 {
2754 pBeaconStruct->extendedRatesPresent = 1;
2755 ConvertExtSuppRates( pMac, &pBeaconStruct->extendedRates, &pBies->ExtSuppRates );
2756 }
2757
2758 if ( pBies->CFParams.present )
2759 {
2760 pBeaconStruct->cfPresent = 1;
2761 ConvertCFParams( pMac, &pBeaconStruct->cfParamSet, &pBies->CFParams );
2762 }
2763
2764 if ( pBies->TIM.present )
2765 {
2766 pBeaconStruct->timPresent = 1;
2767 ConvertTIM( pMac, &pBeaconStruct->tim, &pBies->TIM );
2768 }
2769
2770 if ( pBies->Country.present )
2771 {
2772 pBeaconStruct->countryInfoPresent = 1;
2773 ConvertCountry( pMac, &pBeaconStruct->countryInfoParam, &pBies->Country );
2774 }
2775
2776 // 11h IEs
2777 if(pBies->TPCReport.present)
2778 {
2779 pBeaconStruct->tpcReportPresent = 1;
2780 palCopyMemory(pMac,
2781 &pBeaconStruct->tpcReport,
2782 &pBies->TPCReport,
2783 sizeof( tDot11fIETPCReport));
2784 }
2785
2786 if(pBies->PowerConstraints.present)
2787 {
2788 pBeaconStruct->powerConstraintPresent = 1;
2789 palCopyMemory(pMac,
2790 &pBeaconStruct->localPowerConstraint,
2791 &pBies->PowerConstraints,
2792 sizeof(tDot11fIEPowerConstraints));
2793 }
2794#ifdef FEATURE_WLAN_CCX
2795 if(pBies->CCXTxmitPower.present)
2796 {
2797 pBeaconStruct->ccxTxPwr.present = 1;
2798 pBeaconStruct->ccxTxPwr.power_limit = pBies->CCXTxmitPower.power_limit;
2799 }
2800 if (pBies->QBSSLoad.present)
2801 {
2802 palCopyMemory(pMac->hHdd, &pBeaconStruct->QBSSLoad, &pBies->QBSSLoad, sizeof(tDot11fIEQBSSLoad));
2803 }
2804#endif
2805
2806 if ( pBies->EDCAParamSet.present )
2807 {
2808 pBeaconStruct->edcaPresent = 1;
2809 ConvertEDCAParam( pMac, &pBeaconStruct->edcaParams, &pBies->EDCAParamSet );
2810 }
2811
2812 // QOS Capabilities:
2813 if ( pBies->QOSCapsAp.present )
2814 {
2815 pBeaconStruct->qosCapabilityPresent = 1;
2816 ConvertQOSCaps( pMac, &pBeaconStruct->qosCapability, &pBies->QOSCapsAp );
2817 }
2818
2819
2820
2821 if ( pBies->ChanSwitchAnn.present )
2822 {
2823 pBeaconStruct->channelSwitchPresent = 1;
2824 palCopyMemory(pMac->hHdd, &pBeaconStruct->channelSwitchIE, &pBies->ChanSwitchAnn,
2825 sizeof(tDot11fIEChanSwitchAnn));
2826 }
2827
2828 if ( pBies->ExtChanSwitchAnn.present)
2829 {
2830 pBeaconStruct->extChannelSwitchPresent= 1;
2831 palCopyMemory(pMac->hHdd, &pBeaconStruct->extChannelSwitchIE, &pBies->ExtChanSwitchAnn,
2832 sizeof(tDot11fIEExtChanSwitchAnn));
2833 }
2834
2835 if ( pBies->Quiet.present )
2836 {
2837 pBeaconStruct->quietIEPresent = 1;
2838 palCopyMemory( pMac, &pBeaconStruct->quietIE, &pBies->Quiet, sizeof(tDot11fIEQuiet) );
2839 }
2840
2841 if ( pBies->HTCaps.present )
2842 {
2843 palCopyMemory( pMac, &pBeaconStruct->HTCaps, &pBies->HTCaps, sizeof( tDot11fIEHTCaps ) );
2844 }
2845
2846 if ( pBies->HTInfo.present )
2847 {
2848 palCopyMemory( pMac, &pBeaconStruct->HTInfo, &pBies->HTInfo, sizeof( tDot11fIEHTInfo ) );
2849 }
2850
2851 if ( pBies->DSParams.present )
2852 {
2853 pBeaconStruct->dsParamsPresent = 1;
2854 pBeaconStruct->channelNumber = pBies->DSParams.curr_channel;
2855 }
2856 else if(pBies->HTInfo.present)
2857 {
2858 pBeaconStruct->channelNumber = pBies->HTInfo.primaryChannel;
2859 }
2860
2861 if ( pBies->RSN.present )
2862 {
2863 pBeaconStruct->rsnPresent = 1;
2864 ConvertRSN( pMac, &pBeaconStruct->rsn, &pBies->RSN );
2865 }
2866
2867 if ( pBies->WPA.present )
2868 {
2869 pBeaconStruct->wpaPresent = 1;
2870 ConvertWPA( pMac, &pBeaconStruct->wpa, &pBies->WPA );
2871 }
2872
2873 if ( pBies->WMMParams.present )
2874 {
2875 pBeaconStruct->wmeEdcaPresent = 1;
2876 ConvertWMMParams( pMac, &pBeaconStruct->edcaParams, &pBies->WMMParams );
2877 }
2878
2879 if ( pBies->WMMInfoAp.present )
2880 {
2881 pBeaconStruct->wmeInfoPresent = 1;
2882 }
2883
2884 if ( pBies->WMMCaps.present )
2885 {
2886 pBeaconStruct->wsmCapablePresent = 1;
2887 }
2888
2889
2890 if ( pBies->ERPInfo.present )
2891 {
2892 pBeaconStruct->erpPresent = 1;
2893 ConvertERPInfo( pMac, &pBeaconStruct->erpIEInfo, &pBies->ERPInfo );
2894 }
2895
Jeff Johnsone7245742012-09-05 17:12:55 -07002896#ifdef WLAN_FEATURE_11AC
2897 if ( pBies->VHTCaps.present )
2898 {
2899 pBeaconStruct->VHTCaps.present = 1;
2900 palCopyMemory( pMac, &pBeaconStruct->VHTCaps, &pBies->VHTCaps, sizeof( tDot11fIEVHTCaps ) );
2901 }
2902 if ( pBies->VHTOperation.present )
2903 {
2904 pBeaconStruct->VHTOperation.present = 1;
2905 palCopyMemory( pMac, &pBeaconStruct->VHTOperation, &pBies->VHTOperation, sizeof( tDot11fIEVHTOperation) );
2906 }
2907 if ( pBies->VHTExtBssLoad.present )
2908 {
2909 pBeaconStruct->VHTExtBssLoad.present = 1;
2910 palCopyMemory( pMac, &pBeaconStruct->VHTExtBssLoad, &pBies->VHTExtBssLoad, sizeof( tDot11fIEVHTExtBssLoad) );
2911 }
Mohit Khanna4a70d262012-09-11 16:30:12 -07002912 if( pBies->OperatingMode.present)
2913 {
2914 pBeaconStruct->OperatingMode.present = 1;
2915 palCopyMemory( pMac, &pBeaconStruct->OperatingMode, &pBies->OperatingMode, sizeof( tDot11fIEOperatingMode) );
2916 }
2917
Jeff Johnsone7245742012-09-05 17:12:55 -07002918#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002919 palFreeMemory(pMac->hHdd, pBies);
2920
Jeff Johnsone7245742012-09-05 17:12:55 -07002921
Jeff Johnson295189b2012-06-20 16:38:30 -07002922 return eSIR_SUCCESS;
2923
2924} // End sirParseBeaconIE.
2925
2926tSirRetStatus
2927sirConvertBeaconFrame2Struct(tpAniSirGlobal pMac,
2928 tANI_U8 *pFrame,
2929 tpSirProbeRespBeacon pBeaconStruct)
2930{
Jeff Johnson32d95a32012-09-10 13:15:23 -07002931 tDot11fBeacon *pBeacon;
Jeff Johnson295189b2012-06-20 16:38:30 -07002932 tANI_U32 status, nPayload;
2933 tANI_U8 *pPayload;
2934 tpSirMacMgmtHdr pHdr;
2935 tANI_U8 mappedRXCh;
2936
2937 pPayload = WDA_GET_RX_MPDU_DATA( pFrame );
2938 nPayload = WDA_GET_RX_PAYLOAD_LEN( pFrame );
2939 pHdr = WDA_GET_RX_MAC_HEADER( pFrame );
2940 mappedRXCh = WDA_GET_RX_CH( pFrame );
2941
2942 // Zero-init our [out] parameter,
2943 palZeroMemory( pMac->hHdd, ( tANI_U8* )pBeaconStruct, sizeof(tSirProbeRespBeacon) );
Jeff Johnson32d95a32012-09-10 13:15:23 -07002944
2945 status = palAllocateMemory(pMac->hHdd, (void **)&pBeacon, sizeof(tDot11fBeacon));
2946 if(!HAL_STATUS_SUCCESS(status))
2947 {
2948 limLog(pMac, LOGE, FL("Failed to allocate memory\n") );
2949 return eSIR_FAILURE;
2950 }
2951
2952 palZeroMemory( pMac->hHdd, ( tANI_U8* )pBeacon, sizeof(tDot11fBeacon) );
Jeff Johnson295189b2012-06-20 16:38:30 -07002953
2954 // get the MAC address out of the BD,
2955 palCopyMemory( pMac->hHdd, pBeaconStruct->bssid, pHdr->sa, 6 );
2956
2957 // delegate to the framesc-generated code,
Jeff Johnson32d95a32012-09-10 13:15:23 -07002958 status = dot11fUnpackBeacon( pMac, pPayload, nPayload, pBeacon );
Jeff Johnson295189b2012-06-20 16:38:30 -07002959 if ( DOT11F_FAILED( status ) )
2960 {
2961 limLog(pMac, LOGE, FL("Failed to parse Beacon IEs (0x%08x, %d bytes):\n"),
2962 status, nPayload);
2963 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);)
Jeff Johnson32d95a32012-09-10 13:15:23 -07002964 palFreeMemory(pMac->hHdd, pBeacon);
Jeff Johnson295189b2012-06-20 16:38:30 -07002965 return eSIR_FAILURE;
2966 }
2967 else if ( DOT11F_WARNED( status ) )
2968 {
2969 limLog( pMac, LOGW, FL("There were warnings while unpacking Beacon IEs (0x%08x, %d bytes):\n"),
2970 status, nPayload );
2971 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);)
2972 }
2973
2974 // & "transliterate" from a 'tDot11fBeacon' to a 'tSirProbeRespBeacon'...
2975 // Timestamp
Jeff Johnson32d95a32012-09-10 13:15:23 -07002976 palCopyMemory( pMac->hHdd, ( tANI_U8* )pBeaconStruct->timeStamp, ( tANI_U8* )&pBeacon->TimeStamp, sizeof(tSirMacTimeStamp) );
Jeff Johnson295189b2012-06-20 16:38:30 -07002977
2978 // Beacon Interval
Jeff Johnson32d95a32012-09-10 13:15:23 -07002979 pBeaconStruct->beaconInterval = pBeacon->BeaconInterval.interval;
Jeff Johnson295189b2012-06-20 16:38:30 -07002980
2981 // Capabilities
Jeff Johnson32d95a32012-09-10 13:15:23 -07002982 pBeaconStruct->capabilityInfo.ess = pBeacon->Capabilities.ess;
2983 pBeaconStruct->capabilityInfo.ibss = pBeacon->Capabilities.ibss;
2984 pBeaconStruct->capabilityInfo.cfPollable = pBeacon->Capabilities.cfPollable;
2985 pBeaconStruct->capabilityInfo.cfPollReq = pBeacon->Capabilities.cfPollReq;
2986 pBeaconStruct->capabilityInfo.privacy = pBeacon->Capabilities.privacy;
2987 pBeaconStruct->capabilityInfo.shortPreamble = pBeacon->Capabilities.shortPreamble;
2988 pBeaconStruct->capabilityInfo.pbcc = pBeacon->Capabilities.pbcc;
2989 pBeaconStruct->capabilityInfo.channelAgility = pBeacon->Capabilities.channelAgility;
2990 pBeaconStruct->capabilityInfo.spectrumMgt = pBeacon->Capabilities.spectrumMgt;
2991 pBeaconStruct->capabilityInfo.qos = pBeacon->Capabilities.qos;
2992 pBeaconStruct->capabilityInfo.shortSlotTime = pBeacon->Capabilities.shortSlotTime;
2993 pBeaconStruct->capabilityInfo.apsd = pBeacon->Capabilities.apsd;
2994 pBeaconStruct->capabilityInfo.rrm = pBeacon->Capabilities.rrm;
2995 pBeaconStruct->capabilityInfo.dsssOfdm = pBeacon->Capabilities.dsssOfdm;
2996 pBeaconStruct->capabilityInfo.delayedBA = pBeacon->Capabilities.delayedBA;
2997 pBeaconStruct->capabilityInfo.immediateBA = pBeacon->Capabilities.immediateBA;
Jeff Johnson295189b2012-06-20 16:38:30 -07002998
Jeff Johnson32d95a32012-09-10 13:15:23 -07002999 if ( ! pBeacon->SSID.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003000 {
3001 PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!\n"));)
3002 }
3003 else
3004 {
3005 pBeaconStruct->ssidPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003006 ConvertSSID( pMac, &pBeaconStruct->ssId, &pBeacon->SSID );
Jeff Johnson295189b2012-06-20 16:38:30 -07003007 }
3008
Jeff Johnson32d95a32012-09-10 13:15:23 -07003009 if ( ! pBeacon->SuppRates.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003010 {
3011 PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!\n"));)
3012 }
3013 else
3014 {
3015 pBeaconStruct->suppRatesPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003016 ConvertSuppRates( pMac, &pBeaconStruct->supportedRates, &pBeacon->SuppRates );
Jeff Johnson295189b2012-06-20 16:38:30 -07003017 }
3018
Jeff Johnson32d95a32012-09-10 13:15:23 -07003019 if ( pBeacon->ExtSuppRates.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003020 {
3021 pBeaconStruct->extendedRatesPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003022 ConvertExtSuppRates( pMac, &pBeaconStruct->extendedRates, &pBeacon->ExtSuppRates );
Jeff Johnson295189b2012-06-20 16:38:30 -07003023 }
3024
3025
Jeff Johnson32d95a32012-09-10 13:15:23 -07003026 if ( pBeacon->CFParams.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003027 {
3028 pBeaconStruct->cfPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003029 ConvertCFParams( pMac, &pBeaconStruct->cfParamSet, &pBeacon->CFParams );
Jeff Johnson295189b2012-06-20 16:38:30 -07003030 }
3031
Jeff Johnson32d95a32012-09-10 13:15:23 -07003032 if ( pBeacon->TIM.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003033 {
3034 pBeaconStruct->timPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003035 ConvertTIM( pMac, &pBeaconStruct->tim, &pBeacon->TIM );
Jeff Johnson295189b2012-06-20 16:38:30 -07003036 }
3037
Jeff Johnson32d95a32012-09-10 13:15:23 -07003038 if ( pBeacon->Country.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003039 {
3040 pBeaconStruct->countryInfoPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003041 ConvertCountry( pMac, &pBeaconStruct->countryInfoParam, &pBeacon->Country );
Jeff Johnson295189b2012-06-20 16:38:30 -07003042 }
3043
3044 // QOS Capabilities:
Jeff Johnson32d95a32012-09-10 13:15:23 -07003045 if ( pBeacon->QOSCapsAp.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003046 {
3047 pBeaconStruct->qosCapabilityPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003048 ConvertQOSCaps( pMac, &pBeaconStruct->qosCapability, &pBeacon->QOSCapsAp );
Jeff Johnson295189b2012-06-20 16:38:30 -07003049 }
3050
Jeff Johnson32d95a32012-09-10 13:15:23 -07003051 if ( pBeacon->EDCAParamSet.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003052 {
3053 pBeaconStruct->edcaPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003054 ConvertEDCAParam( pMac, &pBeaconStruct->edcaParams, &pBeacon->EDCAParamSet );
Jeff Johnson295189b2012-06-20 16:38:30 -07003055 }
3056
Jeff Johnson32d95a32012-09-10 13:15:23 -07003057 if ( pBeacon->ChanSwitchAnn.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003058 {
3059 pBeaconStruct->channelSwitchPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003060 palCopyMemory( pMac, &pBeaconStruct->channelSwitchIE, &pBeacon->ChanSwitchAnn,
Jeff Johnson295189b2012-06-20 16:38:30 -07003061 sizeof(tDot11fIEChanSwitchAnn) );
3062 }
3063
Jeff Johnson32d95a32012-09-10 13:15:23 -07003064 if ( pBeacon->ExtChanSwitchAnn.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003065 {
3066 pBeaconStruct->extChannelSwitchPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003067 palCopyMemory( pMac, &pBeaconStruct->extChannelSwitchIE, &pBeacon->ExtChanSwitchAnn,
Jeff Johnson295189b2012-06-20 16:38:30 -07003068 sizeof(tDot11fIEExtChanSwitchAnn) );
3069 }
3070
Jeff Johnson32d95a32012-09-10 13:15:23 -07003071 if( pBeacon->TPCReport.present)
Jeff Johnson295189b2012-06-20 16:38:30 -07003072 {
3073 pBeaconStruct->tpcReportPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003074 palCopyMemory(pMac->hHdd, &pBeaconStruct->tpcReport, &pBeacon->TPCReport,
Jeff Johnson295189b2012-06-20 16:38:30 -07003075 sizeof(tDot11fIETPCReport));
3076 }
3077
Jeff Johnson32d95a32012-09-10 13:15:23 -07003078 if( pBeacon->PowerConstraints.present)
Jeff Johnson295189b2012-06-20 16:38:30 -07003079 {
3080 pBeaconStruct->powerConstraintPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003081 palCopyMemory(pMac->hHdd, &pBeaconStruct->localPowerConstraint, &pBeacon->PowerConstraints,
Jeff Johnson295189b2012-06-20 16:38:30 -07003082 sizeof(tDot11fIEPowerConstraints));
3083 }
Jeff Johnson32d95a32012-09-10 13:15:23 -07003084
3085 if ( pBeacon->Quiet.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003086 {
3087 pBeaconStruct->quietIEPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003088 palCopyMemory( pMac, &pBeaconStruct->quietIE, &pBeacon->Quiet, sizeof(tDot11fIEQuiet));
Jeff Johnson295189b2012-06-20 16:38:30 -07003089 }
3090
Jeff Johnson32d95a32012-09-10 13:15:23 -07003091 if ( pBeacon->HTCaps.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003092 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07003093 palCopyMemory( pMac, &pBeaconStruct->HTCaps, &pBeacon->HTCaps, sizeof( tDot11fIEHTCaps ) );
Jeff Johnson295189b2012-06-20 16:38:30 -07003094 }
3095
Jeff Johnson32d95a32012-09-10 13:15:23 -07003096 if ( pBeacon->HTInfo.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003097 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07003098 palCopyMemory( pMac, &pBeaconStruct->HTInfo, &pBeacon->HTInfo, sizeof( tDot11fIEHTInfo) );
Jeff Johnson295189b2012-06-20 16:38:30 -07003099
3100 }
3101
Jeff Johnson32d95a32012-09-10 13:15:23 -07003102 if ( pBeacon->DSParams.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003103 {
3104 pBeaconStruct->dsParamsPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003105 pBeaconStruct->channelNumber = pBeacon->DSParams.curr_channel;
Jeff Johnson295189b2012-06-20 16:38:30 -07003106 }
Jeff Johnson32d95a32012-09-10 13:15:23 -07003107 else if(pBeacon->HTInfo.present)
Jeff Johnson295189b2012-06-20 16:38:30 -07003108 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07003109 pBeaconStruct->channelNumber = pBeacon->HTInfo.primaryChannel;
Jeff Johnson295189b2012-06-20 16:38:30 -07003110 }
3111 else
3112 {
3113 pBeaconStruct->channelNumber = limUnmapChannel(mappedRXCh);
3114 }
3115
Jeff Johnson32d95a32012-09-10 13:15:23 -07003116 if ( pBeacon->RSN.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003117 {
3118 pBeaconStruct->rsnPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003119 ConvertRSN( pMac, &pBeaconStruct->rsn, &pBeacon->RSN );
Jeff Johnson295189b2012-06-20 16:38:30 -07003120 }
3121
Jeff Johnson32d95a32012-09-10 13:15:23 -07003122 if ( pBeacon->WPA.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003123 {
3124 pBeaconStruct->wpaPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003125 ConvertWPA( pMac, &pBeaconStruct->wpa, &pBeacon->WPA );
Jeff Johnson295189b2012-06-20 16:38:30 -07003126 }
3127
Jeff Johnson32d95a32012-09-10 13:15:23 -07003128 if ( pBeacon->WMMParams.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003129 {
3130 pBeaconStruct->wmeEdcaPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003131 ConvertWMMParams( pMac, &pBeaconStruct->edcaParams, &pBeacon->WMMParams );
Jeff Johnson295189b2012-06-20 16:38:30 -07003132 PELOG1(limLog(pMac, LOG1, FL("WMM Parameter present in Beacon Frame!\n"));
Jeff Johnson32d95a32012-09-10 13:15:23 -07003133 __printWMMParams(pMac, &pBeacon->WMMParams); )
Jeff Johnson295189b2012-06-20 16:38:30 -07003134 }
3135
Jeff Johnson32d95a32012-09-10 13:15:23 -07003136 if ( pBeacon->WMMInfoAp.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003137 {
3138 pBeaconStruct->wmeInfoPresent = 1;
3139 PELOG1(limLog(pMac, LOG1, FL("WMM Info present in Beacon Frame!\n"));)
3140 }
3141
Jeff Johnson32d95a32012-09-10 13:15:23 -07003142 if ( pBeacon->WMMCaps.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003143 {
3144 pBeaconStruct->wsmCapablePresent = 1;
3145 }
3146
Jeff Johnson32d95a32012-09-10 13:15:23 -07003147 if ( pBeacon->ERPInfo.present )
Jeff Johnson295189b2012-06-20 16:38:30 -07003148 {
3149 pBeaconStruct->erpPresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003150 ConvertERPInfo( pMac, &pBeaconStruct->erpIEInfo, &pBeacon->ERPInfo );
Jeff Johnson295189b2012-06-20 16:38:30 -07003151 }
3152
3153#ifdef WLAN_FEATURE_VOWIFI_11R
Jeff Johnson32d95a32012-09-10 13:15:23 -07003154 if (pBeacon->MobilityDomain.present)
Jeff Johnson295189b2012-06-20 16:38:30 -07003155 {
3156 // MobilityDomain
3157 pBeaconStruct->mdiePresent = 1;
Jeff Johnson32d95a32012-09-10 13:15:23 -07003158 palCopyMemory( pMac->hHdd, (tANI_U8 *)&(pBeaconStruct->mdie[0]), (tANI_U8 *)&(pBeacon->MobilityDomain.MDID), sizeof(tANI_U16) );
3159 pBeaconStruct->mdie[2] = ((pBeacon->MobilityDomain.overDSCap << 0) | (pBeacon->MobilityDomain.resourceReqCap << 1));
Jeff Johnson295189b2012-06-20 16:38:30 -07003160
3161 }
3162#endif
3163
Jeff Johnsone7245742012-09-05 17:12:55 -07003164#ifdef WLAN_FEATURE_11AC
Jeff Johnson32d95a32012-09-10 13:15:23 -07003165 if ( pBeacon->VHTCaps.present )
Jeff Johnsone7245742012-09-05 17:12:55 -07003166 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07003167 palCopyMemory( pMac, &pBeaconStruct->VHTCaps, &pBeacon->VHTCaps, sizeof( tDot11fIEVHTCaps ) );
Jeff Johnsone7245742012-09-05 17:12:55 -07003168 }
Jeff Johnson32d95a32012-09-10 13:15:23 -07003169 if ( pBeacon->VHTOperation.present )
Jeff Johnsone7245742012-09-05 17:12:55 -07003170 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07003171 palCopyMemory( pMac, &pBeaconStruct->VHTOperation, &pBeacon->VHTOperation, sizeof( tDot11fIEVHTOperation) );
Jeff Johnsone7245742012-09-05 17:12:55 -07003172 }
Jeff Johnson32d95a32012-09-10 13:15:23 -07003173 if ( pBeacon->VHTExtBssLoad.present )
Jeff Johnsone7245742012-09-05 17:12:55 -07003174 {
Jeff Johnson32d95a32012-09-10 13:15:23 -07003175 palCopyMemory( pMac, &pBeaconStruct->VHTExtBssLoad, &pBeacon->VHTExtBssLoad, sizeof( tDot11fIEVHTExtBssLoad) );
Jeff Johnsone7245742012-09-05 17:12:55 -07003176 }
Mohit Khanna4a70d262012-09-11 16:30:12 -07003177 if(pBeacon->OperatingMode.present)
3178 {
3179 palCopyMemory( pMac, &pBeaconStruct->OperatingMode, &pBeacon->OperatingMode, sizeof( tDot11fIEOperatingMode) );
3180 }
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -07003181 if(pBeacon->WiderBWChanSwitchAnn.present)
3182 {
3183 pBeaconStruct->WiderBWChanSwitchAnnPresent = 1;
3184 palCopyMemory( pMac, &pBeaconStruct->WiderBWChanSwitchAnn, &pBeacon->WiderBWChanSwitchAnn, sizeof( tDot11fIEWiderBWChanSwitchAnn));
3185 }
Jeff Johnsone7245742012-09-05 17:12:55 -07003186#endif
3187
Jeff Johnson32d95a32012-09-10 13:15:23 -07003188 palFreeMemory(pMac->hHdd, pBeacon);
Jeff Johnson295189b2012-06-20 16:38:30 -07003189 return eSIR_SUCCESS;
3190
3191} // End sirConvertBeaconFrame2Struct.
3192
3193tSirRetStatus
3194sirConvertAuthFrame2Struct(tpAniSirGlobal pMac,
3195 tANI_U8 *pFrame,
3196 tANI_U32 nFrame,
3197 tpSirMacAuthFrameBody pAuth)
3198{
3199 static tDot11fAuthentication auth;
3200 tANI_U32 status;
3201
3202 // Zero-init our [out] parameter,
3203 palZeroMemory( pMac->hHdd, ( tANI_U8* )pAuth, sizeof(tSirMacAuthFrameBody) );
3204
3205 // delegate to the framesc-generated code,
3206 status = dot11fUnpackAuthentication( pMac, pFrame, nFrame, &auth );
3207 if ( DOT11F_FAILED( status ) )
3208 {
3209 limLog(pMac, LOGE, FL("Failed to parse an Authentication frame (0x%08x, %d bytes):\n"),
3210 status, nFrame);
3211 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3212 return eSIR_FAILURE;
3213 }
3214 else if ( DOT11F_WARNED( status ) )
3215 {
3216 limLog( pMac, LOGW, FL("There were warnings while unpacking an Authentication frame (0x%08x, %d bytes):\n"),
3217 status, nFrame );
3218 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3219 }
3220
3221 // & "transliterate" from a 'tDot11fAuthentication' to a 'tSirMacAuthFrameBody'...
3222 pAuth->authAlgoNumber = auth.AuthAlgo.algo;
3223 pAuth->authTransactionSeqNumber = auth.AuthSeqNo.no;
3224 pAuth->authStatusCode = auth.Status.status;
3225
3226 if ( auth.ChallengeText.present )
3227 {
3228 pAuth->type = SIR_MAC_CHALLENGE_TEXT_EID;
3229 pAuth->length = auth.ChallengeText.num_text;
3230 palCopyMemory( pMac->hHdd, pAuth->challengeText, auth.ChallengeText.text, auth.ChallengeText.num_text );
3231 }
3232
3233 return eSIR_SUCCESS;
3234
3235} // End sirConvertAuthFrame2Struct.
3236
3237tSirRetStatus
3238sirConvertAddtsReq2Struct(tpAniSirGlobal pMac,
3239 tANI_U8 *pFrame,
3240 tANI_U32 nFrame,
3241 tSirAddtsReqInfo *pAddTs)
3242{
3243 tDot11fAddTSRequest addts = {{0}};
3244 tDot11fWMMAddTSRequest wmmaddts = {{0}};
3245 tANI_U8 j;
3246 tANI_U16 i;
3247 tANI_U32 status;
3248
3249 if ( SIR_MAC_QOS_ADD_TS_REQ != *( pFrame + 1 ) )
3250 {
3251 limLog( pMac, LOGE, FL("sirConvertAddtsReq2Struct invoked "
3252 "with an Action of %d; this is not "
3253 "supported & is probably an error."),
3254 *( pFrame + 1 ) );
3255 return eSIR_FAILURE;
3256 }
3257
3258 // Zero-init our [out] parameter,
3259 palZeroMemory( pMac->hHdd, ( tANI_U8* )pAddTs, sizeof(tSirAddtsReqInfo) );
3260
3261 // delegate to the framesc-generated code,
3262 switch ( *pFrame )
3263 {
3264 case SIR_MAC_ACTION_QOS_MGMT:
3265 status = dot11fUnpackAddTSRequest( pMac, pFrame, nFrame, &addts );
3266 break;
3267 case SIR_MAC_ACTION_WME:
3268 status = dot11fUnpackWMMAddTSRequest( pMac, pFrame, nFrame, &wmmaddts );
3269 break;
3270 default:
3271 limLog( pMac, LOGE, FL("sirConvertAddtsReq2Struct invoked "
3272 "with a Category of %d; this is not"
3273 " supported & is probably an error."),
3274 *pFrame );
3275 return eSIR_FAILURE;
3276 }
3277
3278 if ( DOT11F_FAILED( status ) )
3279 {
3280 limLog(pMac, LOGE, FL("Failed to parse an Add TS Request f"
3281 "rame (0x%08x, %d bytes):\n"),
3282 status, nFrame);
3283 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3284 return eSIR_FAILURE;
3285 }
3286 else if ( DOT11F_WARNED( status ) )
3287 {
3288 limLog( pMac, LOGW, FL("There were warnings while unpackin"
3289 "g an Add TS Request frame (0x%08x,"
3290 "%d bytes):\n"),
3291 status, nFrame );
3292 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3293 }
3294
3295 // & "transliterate" from a 'tDot11fAddTSRequest' or a
3296 // 'tDot11WMMAddTSRequest' to a 'tSirMacAddtsReqInfo'...
3297 if ( SIR_MAC_ACTION_QOS_MGMT == *pFrame )
3298 {
3299 pAddTs->dialogToken = addts.DialogToken.token;
3300
3301 if ( addts.TSPEC.present )
3302 {
3303 ConvertTSPEC( pMac, &pAddTs->tspec, &addts.TSPEC );
3304 }
3305 else
3306 {
3307 limLog( pMac, LOGE, FL("Mandatory TSPEC element missing in Add TS Request.\n") );
3308 return eSIR_FAILURE;
3309 }
3310
3311 if ( addts.num_TCLAS )
3312 {
3313 pAddTs->numTclas = (tANI_U8)addts.num_TCLAS;
3314
3315 for ( i = 0U; i < addts.num_TCLAS; ++i )
3316 {
3317 if ( eSIR_SUCCESS != ConvertTCLAS( pMac, &( pAddTs->tclasInfo[i] ), &( addts.TCLAS[i] ) ) )
3318 {
3319 limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.\n") );
3320 return eSIR_FAILURE;
3321 }
3322 }
3323 }
3324
3325 if ( addts.TCLASSPROC.present )
3326 {
3327 pAddTs->tclasProcPresent = 1;
3328 pAddTs->tclasProc = addts.TCLASSPROC.processing;
3329 }
3330
3331 if ( addts.WMMTSPEC.present )
3332 {
3333 pAddTs->wsmTspecPresent = 1;
3334 ConvertWMMTSPEC( pMac, &pAddTs->tspec, &addts.WMMTSPEC );
3335 }
3336
3337 if ( addts.num_WMMTCLAS )
3338 {
3339 j = (tANI_U8)(pAddTs->numTclas + addts.num_WMMTCLAS);
3340 if ( SIR_MAC_TCLASIE_MAXNUM > j ) j = SIR_MAC_TCLASIE_MAXNUM;
3341
3342 for ( i = pAddTs->numTclas; i < j; ++i )
3343 {
3344 if ( eSIR_SUCCESS != ConvertWMMTCLAS( pMac, &( pAddTs->tclasInfo[i] ), &( addts.WMMTCLAS[i] ) ) )
3345 {
3346 limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.\n") );
3347 return eSIR_FAILURE;
3348 }
3349 }
3350 }
3351
3352 if ( addts.WMMTCLASPROC.present )
3353 {
3354 pAddTs->tclasProcPresent = 1;
3355 pAddTs->tclasProc = addts.WMMTCLASPROC.processing;
3356 }
3357
3358 if ( 1 < pAddTs->numTclas && ( ! pAddTs->tclasProcPresent ) )
3359 {
3360 limLog( pMac, LOGE, FL("%d TCLAS IE but not TCLASPROC IE.\n"),
3361 pAddTs->numTclas );
3362 return eSIR_FAILURE;
3363 }
3364 }
3365 else
3366 {
3367 pAddTs->dialogToken = wmmaddts.DialogToken.token;
3368
3369 if ( wmmaddts.WMMTSPEC.present )
3370 {
3371 pAddTs->wmeTspecPresent = 1;
3372 ConvertWMMTSPEC( pMac, &pAddTs->tspec, &wmmaddts.WMMTSPEC );
3373 }
3374 else
3375 {
3376 limLog( pMac, LOGE, FL("Mandatory WME TSPEC element missing!\n") );
3377 return eSIR_FAILURE;
3378 }
3379 }
3380
3381 return eSIR_SUCCESS;
3382
3383} // End sirConvertAddtsReq2Struct.
3384
3385tSirRetStatus
3386sirConvertAddtsRsp2Struct(tpAniSirGlobal pMac,
3387 tANI_U8 *pFrame,
3388 tANI_U32 nFrame,
3389 tSirAddtsRspInfo *pAddTs)
3390{
3391 tDot11fAddTSResponse addts = {{0}};
3392 tDot11fWMMAddTSResponse wmmaddts = {{0}};
3393 tANI_U8 j;
3394 tANI_U16 i;
3395 tANI_U32 status;
3396
3397 if ( SIR_MAC_QOS_ADD_TS_RSP != *( pFrame + 1 ) )
3398 {
3399 limLog( pMac, LOGE, FL("sirConvertAddtsRsp2Struct invoked "
3400 "with an Action of %d; this is not "
3401 "supported & is probably an error."),
3402 *( pFrame + 1 ) );
3403 return eSIR_FAILURE;
3404 }
3405
3406 // Zero-init our [out] parameter,
3407 palZeroMemory( pMac->hHdd, ( tANI_U8* )pAddTs, sizeof(tSirAddtsRspInfo) );
3408 palZeroMemory( pMac->hHdd, ( tANI_U8* )&addts, sizeof(tDot11fAddTSResponse) );
3409 palZeroMemory( pMac->hHdd, ( tANI_U8* )&wmmaddts, sizeof(tDot11fWMMAddTSResponse) );
3410
3411
3412 // delegate to the framesc-generated code,
3413 switch ( *pFrame )
3414 {
3415 case SIR_MAC_ACTION_QOS_MGMT:
3416 status = dot11fUnpackAddTSResponse( pMac, pFrame, nFrame, &addts );
3417 break;
3418 case SIR_MAC_ACTION_WME:
3419 status = dot11fUnpackWMMAddTSResponse( pMac, pFrame, nFrame, &wmmaddts );
3420 break;
3421 default:
3422 limLog( pMac, LOGE, FL("sirConvertAddtsRsp2Struct invoked "
3423 "with a Category of %d; this is not"
3424 " supported & is probably an error."),
3425 *pFrame );
3426 return eSIR_FAILURE;
3427 }
3428
3429 if ( DOT11F_FAILED( status ) )
3430 {
3431 limLog(pMac, LOGE, FL("Failed to parse an Add TS Response f"
3432 "rame (0x%08x, %d bytes):\n"),
3433 status, nFrame);
3434 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3435 return eSIR_FAILURE;
3436 }
3437 else if ( DOT11F_WARNED( status ) )
3438 {
3439 limLog( pMac, LOGW, FL("There were warnings while unpackin"
3440 "g an Add TS Response frame (0x%08x,"
3441 "%d bytes):\n"),
3442 status, nFrame );
3443 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3444 }
3445
3446 // & "transliterate" from a 'tDot11fAddTSResponse' or a
3447 // 'tDot11WMMAddTSResponse' to a 'tSirMacAddtsRspInfo'...
3448 if ( SIR_MAC_ACTION_QOS_MGMT == *pFrame )
3449 {
3450 pAddTs->dialogToken = addts.DialogToken.token;
3451 pAddTs->status = ( tSirMacStatusCodes )addts.Status.status;
3452
3453 if ( addts.TSDelay.present )
3454 {
3455 ConvertTSDelay( pMac, &pAddTs->delay, &addts.TSDelay );
3456 }
3457
3458 // TS Delay is present iff status indicates its presence
3459 if ( eSIR_MAC_TS_NOT_CREATED_STATUS == pAddTs->status && ! addts.TSDelay.present )
3460 {
3461 limLog( pMac, LOGW, FL("Missing TSDelay IE.\n") );
3462 }
3463
3464 if ( addts.TSPEC.present )
3465 {
3466 ConvertTSPEC( pMac, &pAddTs->tspec, &addts.TSPEC );
3467 }
3468 else
3469 {
3470 limLog( pMac, LOGE, FL("Mandatory TSPEC element missing in Add TS Response.\n") );
3471 return eSIR_FAILURE;
3472 }
3473
3474 if ( addts.num_TCLAS )
3475 {
3476 pAddTs->numTclas = (tANI_U8)addts.num_TCLAS;
3477
3478 for ( i = 0U; i < addts.num_TCLAS; ++i )
3479 {
3480 if ( eSIR_SUCCESS != ConvertTCLAS( pMac, &( pAddTs->tclasInfo[i] ), &( addts.TCLAS[i] ) ) )
3481 {
3482 limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.\n") );
3483 return eSIR_FAILURE;
3484 }
3485 }
3486 }
3487
3488 if ( addts.TCLASSPROC.present )
3489 {
3490 pAddTs->tclasProcPresent = 1;
3491 pAddTs->tclasProc = addts.TCLASSPROC.processing;
3492 }
3493#ifdef FEATURE_WLAN_CCX
3494 if(addts.CCXTrafStrmMet.present)
3495 {
3496 pAddTs->tsmPresent = 1;
3497 palCopyMemory(pMac->hHdd,&pAddTs->tsmIE.tsid,
3498 &addts.CCXTrafStrmMet.tsid,sizeof(tSirMacCCXTSMIE));
3499 }
3500#endif
3501 if ( addts.Schedule.present )
3502 {
3503 pAddTs->schedulePresent = 1;
3504 ConvertSchedule( pMac, &pAddTs->schedule, &addts.Schedule );
3505 }
3506
3507 if ( addts.WMMSchedule.present )
3508 {
3509 pAddTs->schedulePresent = 1;
3510 ConvertWMMSchedule( pMac, &pAddTs->schedule, &addts.WMMSchedule );
3511 }
3512
3513 if ( addts.WMMTSPEC.present )
3514 {
3515 pAddTs->wsmTspecPresent = 1;
3516 ConvertWMMTSPEC( pMac, &pAddTs->tspec, &addts.WMMTSPEC );
3517 }
3518
3519 if ( addts.num_WMMTCLAS )
3520 {
3521 j = (tANI_U8)(pAddTs->numTclas + addts.num_WMMTCLAS);
3522 if ( SIR_MAC_TCLASIE_MAXNUM > j ) j = SIR_MAC_TCLASIE_MAXNUM;
3523
3524 for ( i = pAddTs->numTclas; i < j; ++i )
3525 {
3526 if ( eSIR_SUCCESS != ConvertWMMTCLAS( pMac, &( pAddTs->tclasInfo[i] ), &( addts.WMMTCLAS[i] ) ) )
3527 {
3528 limLog( pMac, LOGE, FL("Failed to convert a TCLAS IE.\n") );
3529 return eSIR_FAILURE;
3530 }
3531 }
3532 }
3533
3534 if ( addts.WMMTCLASPROC.present )
3535 {
3536 pAddTs->tclasProcPresent = 1;
3537 pAddTs->tclasProc = addts.WMMTCLASPROC.processing;
3538 }
3539
3540 if ( 1 < pAddTs->numTclas && ( ! pAddTs->tclasProcPresent ) )
3541 {
3542 limLog( pMac, LOGE, FL("%d TCLAS IE but not TCLASPROC IE.\n"),
3543 pAddTs->numTclas );
3544 return eSIR_FAILURE;
3545 }
3546 }
3547 else
3548 {
3549 pAddTs->dialogToken = wmmaddts.DialogToken.token;
3550 pAddTs->status = ( tSirMacStatusCodes )wmmaddts.StatusCode.statusCode;
3551
3552 if ( wmmaddts.WMMTSPEC.present )
3553 {
3554 pAddTs->wmeTspecPresent = 1;
3555 ConvertWMMTSPEC( pMac, &pAddTs->tspec, &wmmaddts.WMMTSPEC );
3556 }
3557 else
3558 {
3559 limLog( pMac, LOGE, FL("Mandatory WME TSPEC element missing!\n") );
3560 return eSIR_FAILURE;
3561 }
3562
3563#ifdef FEATURE_WLAN_CCX
3564 if(wmmaddts.CCXTrafStrmMet.present)
3565 {
3566 pAddTs->tsmPresent = 1;
3567 palCopyMemory(pMac->hHdd,&pAddTs->tsmIE.tsid,
3568 &wmmaddts.CCXTrafStrmMet.tsid,sizeof(tSirMacCCXTSMIE));
3569 }
3570#endif
3571
3572 }
3573
3574 return eSIR_SUCCESS;
3575
3576} // End sirConvertAddtsRsp2Struct.
3577
3578tSirRetStatus
3579sirConvertDeltsReq2Struct(tpAniSirGlobal pMac,
3580 tANI_U8 *pFrame,
3581 tANI_U32 nFrame,
3582 tSirDeltsReqInfo *pDelTs)
3583{
3584 tDot11fDelTS delts = {{0}};
3585 tDot11fWMMDelTS wmmdelts = {{0}};
3586 tANI_U32 status;
3587
3588 if ( SIR_MAC_QOS_DEL_TS_REQ != *( pFrame + 1 ) )
3589 {
3590 limLog( pMac, LOGE, FL("sirConvertDeltsRsp2Struct invoked "
3591 "with an Action of %d; this is not "
3592 "supported & is probably an error."),
3593 *( pFrame + 1 ) );
3594 return eSIR_FAILURE;
3595 }
3596
3597 // Zero-init our [out] parameter,
3598 palZeroMemory( pMac->hHdd, ( tANI_U8* )pDelTs, sizeof(tSirDeltsReqInfo) );
3599
3600 // delegate to the framesc-generated code,
3601 switch ( *pFrame )
3602 {
3603 case SIR_MAC_ACTION_QOS_MGMT:
3604 status = dot11fUnpackDelTS( pMac, pFrame, nFrame, &delts );
3605 break;
3606 case SIR_MAC_ACTION_WME:
3607 status = dot11fUnpackWMMDelTS( pMac, pFrame, nFrame, &wmmdelts );
3608 break;
3609 default:
3610 limLog( pMac, LOGE, FL("sirConvertDeltsRsp2Struct invoked "
3611 "with a Category of %d; this is not"
3612 " supported & is probably an error."),
3613 *pFrame );
3614 return eSIR_FAILURE;
3615 }
3616
3617 if ( DOT11F_FAILED( status ) )
3618 {
3619 limLog(pMac, LOGE, FL("Failed to parse an Del TS Request f"
3620 "rame (0x%08x, %d bytes):\n"),
3621 status, nFrame);
3622 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3623 return eSIR_FAILURE;
3624 }
3625 else if ( DOT11F_WARNED( status ) )
3626 {
3627 dot11fLog( pMac, LOGW, FL("There were warnings while unpackin"
3628 "g an Del TS Request frame (0x%08x,"
3629 "%d bytes):\n"),
3630 status, nFrame );
3631 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3632 }
3633
3634 // & "transliterate" from a 'tDot11fDelTSResponse' or a
3635 // 'tDot11WMMDelTSResponse' to a 'tSirMacDeltsReqInfo'...
3636 if ( SIR_MAC_ACTION_QOS_MGMT == *pFrame )
3637 {
3638 pDelTs->tsinfo.traffic.trafficType = (tANI_U16)delts.TSInfo.traffic_type;
3639 pDelTs->tsinfo.traffic.tsid = (tANI_U16)delts.TSInfo.tsid;
3640 pDelTs->tsinfo.traffic.direction = (tANI_U16)delts.TSInfo.direction;
3641 pDelTs->tsinfo.traffic.accessPolicy = (tANI_U16)delts.TSInfo.access_policy;
3642 pDelTs->tsinfo.traffic.aggregation = (tANI_U16)delts.TSInfo.aggregation;
3643 pDelTs->tsinfo.traffic.psb = (tANI_U16)delts.TSInfo.psb;
3644 pDelTs->tsinfo.traffic.userPrio = (tANI_U16)delts.TSInfo.user_priority;
3645 pDelTs->tsinfo.traffic.ackPolicy = (tANI_U16)delts.TSInfo.tsinfo_ack_pol;
3646
3647 pDelTs->tsinfo.schedule.schedule = (tANI_U8)delts.TSInfo.schedule;
3648 }
3649 else
3650 {
3651 if ( wmmdelts.WMMTSPEC.present )
3652 {
3653 pDelTs->wmeTspecPresent = 1;
3654 ConvertWMMTSPEC( pMac, &pDelTs->tspec, &wmmdelts.WMMTSPEC );
3655 }
3656 else
3657 {
3658 dot11fLog( pMac, LOGE, FL("Mandatory WME TSPEC element missing!\n") );
3659 return eSIR_FAILURE;
3660 }
3661 }
3662
3663 return eSIR_SUCCESS;
3664
3665} // End sirConvertDeltsReq2Struct.
3666
3667
3668#ifdef ANI_SUPPORT_11H
3669tSirRetStatus
3670sirConvertTpcReqFrame2Struct(tpAniSirGlobal pMac,
3671 tANI_U8 *pFrame,
3672 tpSirMacTpcReqActionFrame pTpcReqFrame,
3673 tANI_U32 nFrame)
3674{
3675 tDot11fTPCRequest req;
3676 tANI_U32 status;
3677
3678 // Zero-init our [out] parameter,
3679 palZeroMemory( pMac->hHdd, ( tANI_U8* )pTpcReqFrame, sizeof(tSirMacTpcReqActionFrame) );
3680
3681 // delegate to the framesc-generated code,
3682 status = dot11fUnpackTPCRequest( pMac, pFrame, nFrame, &req );
3683 if ( DOT11F_FAILED( status ) )
3684 {
3685 dot11fLog(pMac, LOGE, FL("Failed to parse a TPC Request frame (0x%08x, %d bytes):\n"),
3686 status, nFrame);
3687 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3688 return eSIR_FAILURE;
3689 }
3690 else if ( DOT11F_WARNED( status ) )
3691 {
3692 dot11fLog( pMac, LOGW, FL("There were warnings while unpacking a TPC Request frame (0x%08x, %d bytes):\n"),
3693 status, nFrame );
3694 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3695 }
3696
3697 // & "transliterate" from a 'tDot11fTPCRequest' to a
3698 // 'tSirMacTpcReqActionFrame'...
3699 pTpcReqFrame->actionHeader.category = req.Category.category;
3700 pTpcReqFrame->actionHeader.actionID = req.Action.action;
3701 pTpcReqFrame->actionHeader.dialogToken = req.DialogToken.token;
3702 if ( req.TPCRequest.present )
3703 {
3704 pTpcReqFrame->type = DOT11F_EID_TPCREQUEST;
3705 pTpcReqFrame->length = 0;
3706 }
3707 else
3708 {
3709 dot11fLog( pMac, LOGW, FL("!!!Rcv TPC Req of inalid type!\n") );
3710 return eSIR_FAILURE;
3711 }
3712
3713 return eSIR_SUCCESS;
3714
3715} // End sirConvertTpcReqFrame2Struct.
3716
3717
3718tSirRetStatus
3719sirConvertMeasReqFrame2Struct(tpAniSirGlobal pMac,
3720 tANI_U8 *pFrame,
3721 tpSirMacMeasReqActionFrame pMeasReqFrame,
3722 tANI_U32 nFrame)
3723{
3724 tDot11fMeasurementRequest mr;
3725 tANI_U32 status;
3726
3727 // Zero-init our [out] parameter,
3728 palZeroMemory( pMac->hHdd, ( tANI_U8* )pMeasReqFrame, sizeof(tpSirMacMeasReqActionFrame) );
3729
3730 // delegate to the framesc-generated code,
3731 status = dot11fUnpackMeasurementRequest( pMac, pFrame, nFrame, &mr );
3732 if ( DOT11F_FAILED( status ) )
3733 {
3734 dot11fLog(pMac, LOGE, FL("Failed to parse a Measurement Request frame (0x%08x, %d bytes):\n"),
3735 status, nFrame);
3736 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3737 return eSIR_FAILURE;
3738 }
3739 else if ( DOT11F_WARNED( status ) )
3740 {
3741 dot11fLog( pMac, LOGW, FL("There were warnings while unpacking a Measurement Request frame (0x%08x, %d bytes):\n"),
3742 status, nFrame );
3743 PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
3744 }
3745
3746 // & "transliterate" from a 'tDot11fMeasurementRequest' to a
3747 // 'tpSirMacMeasReqActionFrame'...
3748 pMeasReqFrame->actionHeader.category = mr.Category.category;
3749 pMeasReqFrame->actionHeader.actionID = mr.Action.action;
3750 pMeasReqFrame->actionHeader.dialogToken = mr.DialogToken.token;
3751
3752 if ( 0 == mr.num_MeasurementRequest )
3753 {
3754 dot11fLog( pMac, LOGE, FL("Missing mandatory IE in Measurement Request Frame.\n") );
3755 return eSIR_FAILURE;
3756 }
3757 else if ( 1 < mr.num_MeasurementRequest )
3758 {
3759 limLog( pMac, LOGW, FL("Warning: dropping extra Measurement Request IEs!") );
3760 }
3761
3762 pMeasReqFrame->measReqIE.type = DOT11F_EID_MEASUREMENTREQUEST;
3763 pMeasReqFrame->measReqIE.length = DOT11F_IE_MEASUREMENTREQUEST_MIN_LEN;
3764 pMeasReqFrame->measReqIE.measToken = mr.MeasurementRequest[0].measurement_token;
3765 pMeasReqFrame->measReqIE.measReqMode = ( mr.MeasurementRequest[0].reserved << 3 ) |
3766 ( mr.MeasurementRequest[0].enable << 2 ) |
3767 ( mr.MeasurementRequest[0].request << 1 ) |
3768 ( mr.MeasurementRequest[0].report /*<< 0*/ );
3769 pMeasReqFrame->measReqIE.measType = mr.MeasurementRequest[0].measurement_type;
3770
3771 pMeasReqFrame->measReqIE.measReqField.channelNumber = mr.MeasurementRequest[0].channel_no;
3772
3773 palCopyMemory( pMac->hHdd, pMeasReqFrame->measReqIE.measReqField.measStartTime,
3774 mr.MeasurementRequest[0].meas_start_time, 8 );
3775
3776 pMeasReqFrame->measReqIE.measReqField.measDuration = mr.MeasurementRequest[0].meas_duration;
3777
3778 return eSIR_SUCCESS;
3779
3780} // End sirConvertMeasReqFrame2Struct.
3781#endif
3782
3783
3784void
3785PopulateDot11fTSPEC(tSirMacTspecIE *pOld,
3786 tDot11fIETSPEC *pDot11f)
3787{
3788 pDot11f->traffic_type = pOld->tsinfo.traffic.trafficType;
3789 pDot11f->tsid = pOld->tsinfo.traffic.tsid;
3790 pDot11f->direction = pOld->tsinfo.traffic.direction;
3791 pDot11f->access_policy = pOld->tsinfo.traffic.accessPolicy;
3792 pDot11f->aggregation = pOld->tsinfo.traffic.aggregation;
3793 pDot11f->psb = pOld->tsinfo.traffic.psb;
3794 pDot11f->user_priority = pOld->tsinfo.traffic.userPrio;
3795 pDot11f->tsinfo_ack_pol = pOld->tsinfo.traffic.ackPolicy;
3796 pDot11f->schedule = pOld->tsinfo.schedule.schedule;
3797 /* As defined in IEEE 802.11-2007, section 7.3.2.30
3798 * Nominal MSDU size: Bit[0:14]=Size, Bit[15]=Fixed
3799 */
3800 pDot11f->size = ( pOld->nomMsduSz & 0x7fff );
3801 pDot11f->fixed = ( pOld->nomMsduSz & 0x8000 ) ? 1 : 0;
3802 pDot11f->max_msdu_size = pOld->maxMsduSz;
3803 pDot11f->min_service_int = pOld->minSvcInterval;
3804 pDot11f->max_service_int = pOld->maxSvcInterval;
3805 pDot11f->inactivity_int = pOld->inactInterval;
3806 pDot11f->suspension_int = pOld->suspendInterval;
3807 pDot11f->service_start_time = pOld->svcStartTime;
3808 pDot11f->min_data_rate = pOld->minDataRate;
3809 pDot11f->mean_data_rate = pOld->meanDataRate;
3810 pDot11f->peak_data_rate = pOld->peakDataRate;
3811 pDot11f->burst_size = pOld->maxBurstSz;
3812 pDot11f->delay_bound = pOld->delayBound;
3813 pDot11f->min_phy_rate = pOld->minPhyRate;
3814 pDot11f->surplus_bw_allowance = pOld->surplusBw;
3815 pDot11f->medium_time = pOld->mediumTime;
3816
3817 pDot11f->present = 1;
3818
3819} // End PopulateDot11fTSPEC.
3820
3821void
3822PopulateDot11fWMMTSPEC(tSirMacTspecIE *pOld,
3823 tDot11fIEWMMTSPEC *pDot11f)
3824{
3825 pDot11f->traffic_type = pOld->tsinfo.traffic.trafficType;
3826 pDot11f->tsid = pOld->tsinfo.traffic.tsid;
3827 pDot11f->direction = pOld->tsinfo.traffic.direction;
3828 pDot11f->access_policy = pOld->tsinfo.traffic.accessPolicy;
3829 pDot11f->aggregation = pOld->tsinfo.traffic.aggregation;
3830 pDot11f->psb = pOld->tsinfo.traffic.psb;
3831 pDot11f->user_priority = pOld->tsinfo.traffic.userPrio;
3832 pDot11f->tsinfo_ack_pol = pOld->tsinfo.traffic.ackPolicy;
3833 pDot11f->burst_size_defn = pOld->tsinfo.traffic.burstSizeDefn;
3834 /* As defined in IEEE 802.11-2007, section 7.3.2.30
3835 * Nominal MSDU size: Bit[0:14]=Size, Bit[15]=Fixed
3836 */
3837 pDot11f->size = ( pOld->nomMsduSz & 0x7fff );
3838 pDot11f->fixed = ( pOld->nomMsduSz & 0x8000 ) ? 1 : 0;
3839 pDot11f->max_msdu_size = pOld->maxMsduSz;
3840 pDot11f->min_service_int = pOld->minSvcInterval;
3841 pDot11f->max_service_int = pOld->maxSvcInterval;
3842 pDot11f->inactivity_int = pOld->inactInterval;
3843 pDot11f->suspension_int = pOld->suspendInterval;
3844 pDot11f->service_start_time = pOld->svcStartTime;
3845 pDot11f->min_data_rate = pOld->minDataRate;
3846 pDot11f->mean_data_rate = pOld->meanDataRate;
3847 pDot11f->peak_data_rate = pOld->peakDataRate;
3848 pDot11f->burst_size = pOld->maxBurstSz;
3849 pDot11f->delay_bound = pOld->delayBound;
3850 pDot11f->min_phy_rate = pOld->minPhyRate;
3851 pDot11f->surplus_bw_allowance = pOld->surplusBw;
3852 pDot11f->medium_time = pOld->mediumTime;
3853
3854 pDot11f->version = 1;
3855 pDot11f->present = 1;
3856
3857} // End PopulateDot11fWMMTSPEC.
3858
3859#ifdef FEATURE_WLAN_CCX
3860void PopulateDot11TSRSIE(tpAniSirGlobal pMac,
3861 tSirMacCCXTSRSIE *pOld,
3862 tDot11fIECCXTrafStrmRateSet *pDot11f,
3863 tANI_U8 rate_length)
3864{
3865 pDot11f->tsid = pOld->tsid;
3866 palCopyMemory(pMac->hHdd,pDot11f->tsrates, pOld->rates,rate_length);
3867 pDot11f->num_tsrates = rate_length;
3868 pDot11f->present = 1;
3869}
3870#endif
3871
3872
3873tSirRetStatus
3874PopulateDot11fTCLAS(tpAniSirGlobal pMac,
3875 tSirTclasInfo *pOld,
3876 tDot11fIETCLAS *pDot11f)
3877{
3878 pDot11f->user_priority = pOld->tclas.userPrio;
3879 pDot11f->classifier_type = pOld->tclas.classifierType;
3880 pDot11f->classifier_mask = pOld->tclas.classifierMask;
3881
3882 switch ( pDot11f->classifier_type )
3883 {
3884 case SIR_MAC_TCLASTYPE_ETHERNET:
3885 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.EthParams.source,
3886 ( tANI_U8* )&pOld->tclasParams.eth.srcAddr, 6 );
3887 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.EthParams.dest,
3888 ( tANI_U8* )&pOld->tclasParams.eth.dstAddr, 6 );
3889 pDot11f->info.EthParams.type = pOld->tclasParams.eth.type;
3890 break;
3891 case SIR_MAC_TCLASTYPE_TCPUDPIP:
3892 pDot11f->info.IpParams.version = pOld->version;
3893 if ( SIR_MAC_TCLAS_IPV4 == pDot11f->info.IpParams.version )
3894 {
3895 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
3896 IpV4Params.source,
3897 ( tANI_U8* )pOld->tclasParams.ipv4.srcIpAddr, 4 );
3898 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
3899 IpV4Params.dest,
3900 ( tANI_U8* )pOld->tclasParams.ipv4.dstIpAddr, 4 );
3901 pDot11f->info.IpParams.params.IpV4Params.src_port =
3902 pOld->tclasParams.ipv4.srcPort;
3903 pDot11f->info.IpParams.params.IpV4Params.dest_port =
3904 pOld->tclasParams.ipv4.dstPort;
3905 pDot11f->info.IpParams.params.IpV4Params.DSCP =
3906 pOld->tclasParams.ipv4.dscp;
3907 pDot11f->info.IpParams.params.IpV4Params.proto =
3908 pOld->tclasParams.ipv4.protocol;
3909 pDot11f->info.IpParams.params.IpV4Params.reserved =
3910 pOld->tclasParams.ipv4.rsvd;
3911 }
3912 else
3913 {
3914 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
3915 IpV6Params.source,
3916 ( tANI_U8* )pOld->tclasParams.ipv6.srcIpAddr, 16 );
3917 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
3918 IpV6Params.dest,
3919 ( tANI_U8* )pOld->tclasParams.ipv6.dstIpAddr, 16 );
3920 pDot11f->info.IpParams.params.IpV6Params.src_port =
3921 pOld->tclasParams.ipv6.srcPort;
3922 pDot11f->info.IpParams.params.IpV6Params.dest_port =
3923 pOld->tclasParams.ipv6.dstPort;
3924 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
3925 IpV6Params.flow_label,
3926 ( tANI_U8* )pOld->tclasParams.ipv6.flowLabel, 3 );
3927 }
3928 break;
3929 case SIR_MAC_TCLASTYPE_8021DQ:
3930 pDot11f->info.Params8021dq.tag_type = pOld->tclasParams.t8021dq.tag;
3931 break;
3932 default:
3933 limLog( pMac, LOGE, FL("Bad TCLAS type %d in PopulateDot11fTCLAS.\n"),
3934 pDot11f->classifier_type );
3935 return eSIR_FAILURE;
3936 }
3937
3938 pDot11f->present = 1;
3939
3940 return eSIR_SUCCESS;
3941
3942} // End PopulateDot11fTCLAS.
3943
3944tSirRetStatus
3945PopulateDot11fWMMTCLAS(tpAniSirGlobal pMac,
3946 tSirTclasInfo *pOld,
3947 tDot11fIEWMMTCLAS *pDot11f)
3948{
3949 pDot11f->version = 1;
3950 pDot11f->user_priority = pOld->tclas.userPrio;
3951 pDot11f->classifier_type = pOld->tclas.classifierType;
3952 pDot11f->classifier_mask = pOld->tclas.classifierMask;
3953
3954 switch ( pDot11f->classifier_type )
3955 {
3956 case SIR_MAC_TCLASTYPE_ETHERNET:
3957 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.EthParams.source,
3958 ( tANI_U8* )&pOld->tclasParams.eth.srcAddr, 6 );
3959 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.EthParams.dest,
3960 ( tANI_U8* )&pOld->tclasParams.eth.dstAddr, 6 );
3961 pDot11f->info.EthParams.type = pOld->tclasParams.eth.type;
3962 break;
3963 case SIR_MAC_TCLASTYPE_TCPUDPIP:
3964 pDot11f->info.IpParams.version = pOld->version;
3965 if ( SIR_MAC_TCLAS_IPV4 == pDot11f->info.IpParams.version )
3966 {
3967 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
3968 IpV4Params.source,
3969 ( tANI_U8* )pOld->tclasParams.ipv4.srcIpAddr, 4 );
3970 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
3971 IpV4Params.dest,
3972 ( tANI_U8* )pOld->tclasParams.ipv4.dstIpAddr, 4 );
3973 pDot11f->info.IpParams.params.IpV4Params.src_port =
3974 pOld->tclasParams.ipv4.srcPort;
3975 pDot11f->info.IpParams.params.IpV4Params.dest_port =
3976 pOld->tclasParams.ipv4.dstPort;
3977 pDot11f->info.IpParams.params.IpV4Params.DSCP =
3978 pOld->tclasParams.ipv4.dscp;
3979 pDot11f->info.IpParams.params.IpV4Params.proto =
3980 pOld->tclasParams.ipv4.protocol;
3981 pDot11f->info.IpParams.params.IpV4Params.reserved =
3982 pOld->tclasParams.ipv4.rsvd;
3983 }
3984 else
3985 {
3986 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
3987 IpV6Params.source,
3988 ( tANI_U8* )pOld->tclasParams.ipv6.srcIpAddr, 16 );
3989 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
3990 IpV6Params.dest,
3991 ( tANI_U8* )pOld->tclasParams.ipv6.dstIpAddr, 16 );
3992 pDot11f->info.IpParams.params.IpV6Params.src_port =
3993 pOld->tclasParams.ipv6.srcPort;
3994 pDot11f->info.IpParams.params.IpV6Params.dest_port =
3995 pOld->tclasParams.ipv6.dstPort;
3996 palCopyMemory( pMac->hHdd, ( tANI_U8* )&pDot11f->info.IpParams.params.
3997 IpV6Params.flow_label,
3998 ( tANI_U8* )pOld->tclasParams.ipv6.flowLabel, 3 );
3999 }
4000 break;
4001 case SIR_MAC_TCLASTYPE_8021DQ:
4002 pDot11f->info.Params8021dq.tag_type = pOld->tclasParams.t8021dq.tag;
4003 break;
4004 default:
4005 limLog( pMac, LOGE, FL("Bad TCLAS type %d in PopulateDot11fTCLAS.\n"),
4006 pDot11f->classifier_type );
4007 return eSIR_FAILURE;
4008 }
4009
4010 pDot11f->present = 1;
4011
4012 return eSIR_SUCCESS;
4013
4014} // End PopulateDot11fWMMTCLAS.
4015
4016#if ( WNI_POLARIS_FW_PRODUCT == AP )
4017
4018tSirRetStatus
4019PopulateDot11fCFParams(tpAniSirGlobal pMac,
4020 tDot11fFfCapabilities *pCaps,
4021 tDot11fIECFParams *pDot11f)
4022{
4023 tANI_U32 cfg;
4024 tSirRetStatus nSirStatus;
4025
4026 if ( pCaps->cfPollable || pCaps->cfPollReq )
4027 {
4028 pDot11f->cfp_count = schGetCFPCount( pMac );
4029
4030 CFG_GET_INT( nSirStatus, pMac, WNI_CFG_CFP_PERIOD, cfg );
4031 pDot11f->cfp_period = ( cfg & 0x000000ff );
4032
4033 CFG_GET_INT( nSirStatus, pMac, WNI_CFG_CFP_MAX_DURATION, cfg );
4034 pDot11f->cfp_maxduration = ( cfg & 0x0000ffff );
4035
4036 pDot11f->cfp_durremaining = schGetCFPDurRemaining( pMac );
4037
4038 pDot11f->present = 1;
4039 }
4040
4041 return eSIR_SUCCESS;
4042} // End PopulateDot11fCFParams.
4043
4044void
4045PopulateDot11fQuiet(tpAniSirGlobal pMac,
4046 tDot11fIEQuiet *pDot11f)
4047{
4048 // Quiet Count - Num TBTTs until start of quiet interval
4049 pDot11f->count = (tANI_U8) pMac->lim.gLimSpecMgmt.quietCount;
4050 // Quiet Period
4051 pDot11f->period = 0;
4052 // Quiet Duration (in TU's)
4053 pDot11f->duration = ( tANI_U16 ) pMac->lim.gLimSpecMgmt.quietDuration_TU;
4054 // Quiet Offset
4055 pDot11f->offset = 0;
4056
4057 dot11fLog( pMac, LOG2,
4058 FL("Filling QuietBSS IE: %d, Len %d, QC %1d, QP 0, QD "
4059 "%2d(TU)/%2d(TICKS), QO 0\n"),
4060 SIR_MAC_QUIET_EID, DOT11F_IE_QUIET_MIN_LEN,
4061 pMac->lim.gLimSpecMgmt.quietCount,
4062 pMac->lim.gLimSpecMgmt.quietDuration_TU,
4063 pMac->lim.gLimSpecMgmt.quietDuration );
4064
4065 pDot11f->present = 1;
4066
4067} // End PopulateDot11fQuiet.
4068
4069tSirRetStatus
4070PopulateDot11fAPName(tpAniSirGlobal pMac,
4071 tANI_U32 capEnable,
4072 tDot11fIEAPName *pDot11f)
4073{
4074 tANI_U32 nName;
4075 tSirRetStatus nSirStatus;
4076
4077 CFG_GET_STR( nSirStatus, pMac, WNI_CFG_AP_NODE_NAME, pDot11f->name,
4078 nName, SIR_MAC_MAX_SSID_LENGTH );
4079 pDot11f->num_name = ( tANI_U8 ) nName;
4080 pDot11f->present = 1;
4081
4082 return eSIR_SUCCESS;
4083} // End PopulateDot11fAPName.
4084
4085void
4086PopulateDot11fPropQuietBSS(tpAniSirGlobal pMac,
4087 tANI_U32 capsEnable,
4088 tDot11fIEPropQuietBSS *pDot11f)
4089{
4090 // Populate Proprietary Quiet BSS IE, ONLY IF 11H is NOT enabled! If 11H
4091 // IS enabled, then the Quiet IE will be appropriately sent as per the
4092 // 11H spec and hence need NOT be sent in the Proprietary IE as well
4093 if ( ( eLIM_QUIET_RUNNING == pMac->lim.gLimSpecMgmt.quietState ) &&
4094 !pMac->lim.gLim11hEnable &&
4095 PROP_CAPABILITY_GET( TITAN, capsEnable ) )
4096 {
4097 // Quiet Count - Num TBTTs until start of quiet interval
4098 pDot11f->quiet_count = pMac->lim.gLimSpecMgmt.quietCount;
4099 // Quiet Period
4100 pDot11f->quiet_period = 0;
4101 // Quiet Duration (in TU's)
4102 pDot11f->quiet_duration = ( tANI_U16 ) pMac->lim.gLimSpecMgmt.quietDuration_TU;
4103 // Quiet Offset
4104 pDot11f->quiet_offset = 0;
4105
4106 pDot11f->present = 1;
4107 }
4108} // End PopulateDot11fPropQuietBSS.
4109
4110void
4111PopulateDot11fTrigStaBkScan(tpAniSirGlobal pMac,
4112 tANI_U32 capsEnable,
4113 tDot11fIETriggerStaBgScan *pDot11f)
4114{
4115 if ( PROP_CAPABILITY_GET( TITAN, capsEnable ) )
4116 {
4117 pDot11f->enable = pMac->lim.gLimTriggerBackgroundScanDuringQuietBss;
4118 pDot11f->present = 1;
4119 }
4120} // End PopulateDot11fTrigStaBkScan.
4121
4122#if (WNI_POLARIS_FW_PACKAGE == ADVANCED)
4123
4124tSirRetStatus
4125PopulateDot11fWDS(tpAniSirGlobal pMac,
4126 tANI_U32 capEnable,
4127 tDot11fIEWDS *pDot11f )
4128{
4129 tpPESession psessionEntry = &pMac->lim.gpSession[0]; //TBD-RAJESH HOW TO GET sessionEntry?????
4130
4131 if ( psessionEntry->pLimStartBssReq->wdsInfo.wdsLength )
4132 {
4133 if ( psessionEntry->pLimStartBssReq->wdsInfo.wdsLength > 64)
4134 {
4135 limLog( pMac, LOG3, FL("WDS Length overflow in PopulateDot11fWDS.") );
4136 return eSIR_FAILURE;
4137 }
4138
4139 pDot11f->num_wdsData = psessionEntry->pLimStartBssReq->wdsInfo.wdsLength;
4140 palCopyMemory( pMac->hHdd, pDot11f->wdsData,
4141 psessionEntry->pLimStartBssReq->wdsInfo.wdsBytes,
4142 pDot11f->num_wdsData );
4143 pDot11f->present = 1;
4144 }
4145
4146 return eSIR_SUCCESS;
4147} // End PopulateDot11fWDS.
4148
4149#endif // WNI_POLARIS_FW_PACKAGE == ADVANCED
4150
4151#endif // WNI_POLARIS_FW_PRODUCT == AP
4152
4153tSirRetStatus PopulateDot11fWsc(tpAniSirGlobal pMac,
4154 tDot11fIEWscBeacon *pDot11f)
4155{
4156
4157 tANI_U32 wpsState;
4158
4159 pDot11f->Version.present = 1;
4160 pDot11f->Version.major = 0x01;
4161 pDot11f->Version.minor = 0x00;
4162
4163 if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_STATE, &wpsState) != eSIR_SUCCESS)
4164 limLog(pMac, LOGP,"Failed to cfg get id %d\n", WNI_CFG_WPS_STATE );
4165
4166 pDot11f->WPSState.present = 1;
4167 pDot11f->WPSState.state = (tANI_U8) wpsState;
4168
4169 pDot11f->APSetupLocked.present = 0;
4170
4171 pDot11f->SelectedRegistrar.present = 0;
4172
4173 pDot11f->DevicePasswordID.present = 0;
4174
4175 pDot11f->SelectedRegistrarConfigMethods.present = 0;
4176
4177 pDot11f->UUID_E.present = 0;
4178
4179 pDot11f->RFBands.present = 0;
4180
4181 pDot11f->present = 1;
4182 return eSIR_SUCCESS;
4183}
4184
4185tSirRetStatus PopulateDot11fWscRegistrarInfo(tpAniSirGlobal pMac,
4186 tDot11fIEWscBeacon *pDot11f)
4187{
4188 const struct sLimWscIeInfo *const pWscIeInfo = &(pMac->lim.wscIeInfo);
4189 tANI_U32 devicepasswdId;
4190
4191
4192 pDot11f->APSetupLocked.present = 1;
4193 pDot11f->APSetupLocked.fLocked = pWscIeInfo->apSetupLocked;
4194
4195 pDot11f->SelectedRegistrar.present = 1;
4196 pDot11f->SelectedRegistrar.selected = pWscIeInfo->selectedRegistrar;
4197
4198 if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_DEVICE_PASSWORD_ID, &devicepasswdId) != eSIR_SUCCESS)
4199 limLog(pMac, LOGP,"Failed to cfg get id %d\n", WNI_CFG_WPS_DEVICE_PASSWORD_ID );
4200
4201 pDot11f->DevicePasswordID.present = 1;
4202 pDot11f->DevicePasswordID.id = (tANI_U16) devicepasswdId;
4203
4204 pDot11f->SelectedRegistrarConfigMethods.present = 1;
4205 pDot11f->SelectedRegistrarConfigMethods.methods = pWscIeInfo->selectedRegistrarConfigMethods;
4206
4207 // UUID_E and RF Bands are applicable only for dual band AP
4208
4209 return eSIR_SUCCESS;
4210}
4211
4212tSirRetStatus DePopulateDot11fWscRegistrarInfo(tpAniSirGlobal pMac,
4213 tDot11fIEWscBeacon *pDot11f)
4214{
4215 pDot11f->APSetupLocked.present = 0;
4216 pDot11f->SelectedRegistrar.present = 0;
4217 pDot11f->DevicePasswordID.present = 0;
4218 pDot11f->SelectedRegistrarConfigMethods.present = 0;
4219
4220 return eSIR_SUCCESS;
4221}
4222#ifdef WLAN_SOFTAP_FEATURE
4223tSirRetStatus PopulateDot11fProbeResWPSIEs(tpAniSirGlobal pMac, tDot11fIEWscProbeRes *pDot11f, tpPESession psessionEntry)
4224{
4225
4226 tSirWPSProbeRspIE *pSirWPSProbeRspIE;
4227
4228 pSirWPSProbeRspIE = &psessionEntry->APWPSIEs.SirWPSProbeRspIE;
4229
4230
4231 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_VER_PRESENT)
4232 {
4233 pDot11f->present = 1;
4234 pDot11f->Version.present = 1;
4235 pDot11f->Version.major = (tANI_U8) ((pSirWPSProbeRspIE->Version & 0xF0)>>4);
4236 pDot11f->Version.minor = (tANI_U8) (pSirWPSProbeRspIE->Version & 0x0F);
4237 }
4238 else
4239 {
4240 pDot11f->present = 0;
4241 pDot11f->Version.present = 0;
4242 }
4243
4244 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_STATE_PRESENT)
4245 {
4246
4247 pDot11f->WPSState.present = 1;
4248 pDot11f->WPSState.state = (tANI_U8)pSirWPSProbeRspIE->wpsState;
4249 }
4250 else
4251 pDot11f->WPSState.present = 0;
4252
4253 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_APSETUPLOCK_PRESENT)
4254 {
4255 pDot11f->APSetupLocked.present = 1;
4256 pDot11f->APSetupLocked.fLocked = pSirWPSProbeRspIE->APSetupLocked;
4257 }
4258 else
4259 pDot11f->APSetupLocked.present = 0;
4260
4261 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_SELECTEDREGISTRA_PRESENT)
4262 {
4263 pDot11f->SelectedRegistrar.present = 1;
4264 pDot11f->SelectedRegistrar.selected = pSirWPSProbeRspIE->SelectedRegistra;
4265 }
4266 else
4267 pDot11f->SelectedRegistrar.present = 0;
4268
4269 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_DEVICEPASSWORDID_PRESENT)
4270 {
4271 pDot11f->DevicePasswordID.present = 1;
4272 pDot11f->DevicePasswordID.id = pSirWPSProbeRspIE->DevicePasswordID;
4273 }
4274 else
4275 pDot11f->DevicePasswordID.present = 0;
4276
4277 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_SELECTEDREGISTRACFGMETHOD_PRESENT)
4278 {
4279 pDot11f->SelectedRegistrarConfigMethods.present = 1;
4280 pDot11f->SelectedRegistrarConfigMethods.methods = pSirWPSProbeRspIE->SelectedRegistraCfgMethod;
4281 }
4282 else
4283 pDot11f->SelectedRegistrarConfigMethods.present = 0;
4284
4285 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_RESPONSETYPE_PRESENT)
4286 {
4287 pDot11f->ResponseType.present = 1;
4288 pDot11f->ResponseType.resType = pSirWPSProbeRspIE->ResponseType;
4289 }
4290 else
4291 pDot11f->ResponseType.present = 0;
4292
4293 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_UUIDE_PRESENT)
4294 {
4295 pDot11f->UUID_E.present = 1;
4296 palCopyMemory(pMac->hHdd, pDot11f->UUID_E.uuid, pSirWPSProbeRspIE->UUID_E, WNI_CFG_WPS_UUID_LEN);
4297 }
4298 else
4299 pDot11f->UUID_E.present = 0;
4300
4301 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_MANUFACTURE_PRESENT)
4302 {
4303 pDot11f->Manufacturer.present = 1;
4304 pDot11f->Manufacturer.num_name = pSirWPSProbeRspIE->Manufacture.num_name;
4305 palCopyMemory(pMac->hHdd, pDot11f->Manufacturer.name, pSirWPSProbeRspIE->Manufacture.name, pSirWPSProbeRspIE->Manufacture.num_name);
4306 }
4307 else
4308 pDot11f->Manufacturer.present = 0;
4309
4310 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_MODELNUMBER_PRESENT)
4311 {
4312 pDot11f->ModelName.present = 1;
4313 pDot11f->ModelName.num_text = pSirWPSProbeRspIE->ModelName.num_text;
4314 palCopyMemory(pMac->hHdd, pDot11f->ModelName.text, pSirWPSProbeRspIE->ModelName.text, pDot11f->ModelName.num_text);
4315 }
4316 else
4317 pDot11f->ModelName.present = 0;
4318
4319 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_MODELNUMBER_PRESENT)
4320 {
4321 pDot11f->ModelNumber.present = 1;
4322 pDot11f->ModelNumber.num_text = pSirWPSProbeRspIE->ModelNumber.num_text;
4323 palCopyMemory(pMac->hHdd, pDot11f->ModelNumber.text, pSirWPSProbeRspIE->ModelNumber.text, pDot11f->ModelNumber.num_text);
4324 }
4325 else
4326 pDot11f->ModelNumber.present = 0;
4327
4328 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_SERIALNUMBER_PRESENT)
4329 {
4330 pDot11f->SerialNumber.present = 1;
4331 pDot11f->SerialNumber.num_text = pSirWPSProbeRspIE->SerialNumber.num_text;
4332 palCopyMemory(pMac->hHdd, pDot11f->SerialNumber.text, pSirWPSProbeRspIE->SerialNumber.text, pDot11f->SerialNumber.num_text);
4333 }
4334 else
4335 pDot11f->SerialNumber.present = 0;
4336
4337 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_PRIMARYDEVICETYPE_PRESENT)
4338 {
4339 pDot11f->PrimaryDeviceType.present = 1;
4340 palCopyMemory(pMac->hHdd, pDot11f->PrimaryDeviceType.oui, pSirWPSProbeRspIE->PrimaryDeviceOUI, sizeof(pSirWPSProbeRspIE->PrimaryDeviceOUI));
4341 pDot11f->PrimaryDeviceType.primary_category = (tANI_U16)pSirWPSProbeRspIE->PrimaryDeviceCategory;
4342 pDot11f->PrimaryDeviceType.sub_category = (tANI_U16)pSirWPSProbeRspIE->DeviceSubCategory;
4343 }
4344 else
4345 pDot11f->PrimaryDeviceType.present = 0;
4346
4347 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_DEVICENAME_PRESENT)
4348 {
4349 pDot11f->DeviceName.present = 1;
4350 pDot11f->DeviceName.num_text = pSirWPSProbeRspIE->DeviceName.num_text;
4351 palCopyMemory(pMac->hHdd, pDot11f->DeviceName.text, pSirWPSProbeRspIE->DeviceName.text, pDot11f->DeviceName.num_text);
4352 }
4353 else
4354 pDot11f->DeviceName.present = 0;
4355
4356 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_CONFIGMETHODS_PRESENT)
4357 {
4358 pDot11f->ConfigMethods.present = 1;
4359 pDot11f->ConfigMethods.methods = pSirWPSProbeRspIE->ConfigMethod;
4360 }
4361 else
4362 pDot11f->ConfigMethods.present = 0;
4363
4364
4365 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_RF_BANDS_PRESENT)
4366 {
4367 pDot11f->RFBands.present = 1;
4368 pDot11f->RFBands.bands = pSirWPSProbeRspIE->RFBand;
4369 }
4370 else
4371 pDot11f->RFBands.present = 0;
4372
4373 return eSIR_SUCCESS;
4374}
4375tSirRetStatus PopulateDot11fAssocResWPSIEs(tpAniSirGlobal pMac, tDot11fIEWscAssocRes *pDot11f, tpPESession psessionEntry)
4376{
4377 tSirWPSProbeRspIE *pSirWPSProbeRspIE;
4378
4379 pSirWPSProbeRspIE = &psessionEntry->APWPSIEs.SirWPSProbeRspIE;
4380
4381 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_VER_PRESENT)
4382 {
4383 pDot11f->present = 1;
4384 pDot11f->Version.present = 1;
4385 pDot11f->Version.major = (tANI_U8) ((pSirWPSProbeRspIE->Version & 0xF0)>>4);
4386 pDot11f->Version.minor = (tANI_U8) (pSirWPSProbeRspIE->Version & 0x0F);
4387 }
4388 else
4389 {
4390 pDot11f->present = 0;
4391 pDot11f->Version.present = 0;
4392 }
4393
4394 if(pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_RESPONSETYPE_PRESENT)
4395 {
4396 pDot11f->ResponseType.present = 1;
4397 pDot11f->ResponseType.resType = pSirWPSProbeRspIE->ResponseType;
4398 }
4399 else
4400 pDot11f->ResponseType.present = 0;
4401
4402 return eSIR_SUCCESS;
4403}
4404
4405tSirRetStatus PopulateDot11fBeaconWPSIEs(tpAniSirGlobal pMac, tDot11fIEWscBeacon *pDot11f, tpPESession psessionEntry)
4406{
4407
4408 tSirWPSBeaconIE *pSirWPSBeaconIE;
4409
4410 pSirWPSBeaconIE = &psessionEntry->APWPSIEs.SirWPSBeaconIE;
4411
4412
4413 if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_PROBRSP_VER_PRESENT)
4414 {
4415 pDot11f->present = 1;
4416 pDot11f->Version.present = 1;
4417 pDot11f->Version.major = (tANI_U8) ((pSirWPSBeaconIE->Version & 0xF0)>>4);
4418 pDot11f->Version.minor = (tANI_U8) (pSirWPSBeaconIE->Version & 0x0F);
4419 }
4420 else
4421 {
4422 pDot11f->present = 0;
4423 pDot11f->Version.present = 0;
4424 }
4425
4426 if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_STATE_PRESENT)
4427 {
4428
4429 pDot11f->WPSState.present = 1;
4430 pDot11f->WPSState.state = (tANI_U8)pSirWPSBeaconIE->wpsState;
4431 }
4432 else
4433 pDot11f->WPSState.present = 0;
4434
4435 if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_APSETUPLOCK_PRESENT)
4436 {
4437 pDot11f->APSetupLocked.present = 1;
4438 pDot11f->APSetupLocked.fLocked = pSirWPSBeaconIE->APSetupLocked;
4439 }
4440 else
4441 pDot11f->APSetupLocked.present = 0;
4442
4443 if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_SELECTEDREGISTRA_PRESENT)
4444 {
4445 pDot11f->SelectedRegistrar.present = 1;
4446 pDot11f->SelectedRegistrar.selected = pSirWPSBeaconIE->SelectedRegistra;
4447 }
4448 else
4449 pDot11f->SelectedRegistrar.present = 0;
4450
4451 if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_DEVICEPASSWORDID_PRESENT)
4452 {
4453 pDot11f->DevicePasswordID.present = 1;
4454 pDot11f->DevicePasswordID.id = pSirWPSBeaconIE->DevicePasswordID;
4455 }
4456 else
4457 pDot11f->DevicePasswordID.present = 0;
4458
4459 if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_SELECTEDREGISTRACFGMETHOD_PRESENT)
4460 {
4461 pDot11f->SelectedRegistrarConfigMethods.present = 1;
4462 pDot11f->SelectedRegistrarConfigMethods.methods = pSirWPSBeaconIE->SelectedRegistraCfgMethod;
4463 }
4464 else
4465 pDot11f->SelectedRegistrarConfigMethods.present = 0;
4466
4467 if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_UUIDE_PRESENT)
4468 {
4469 pDot11f->UUID_E.present = 1;
4470 palCopyMemory(pMac->hHdd, pDot11f->UUID_E.uuid, pSirWPSBeaconIE->UUID_E, WNI_CFG_WPS_UUID_LEN);
4471 }
4472 else
4473 pDot11f->UUID_E.present = 0;
4474
4475
4476 if(pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_RF_BANDS_PRESENT)
4477 {
4478 pDot11f->RFBands.present = 1;
4479 pDot11f->RFBands.bands = pSirWPSBeaconIE->RFBand;
4480 }
4481 else
4482 pDot11f->RFBands.present = 0;
4483
4484 return eSIR_SUCCESS;
4485}
4486#endif
4487tSirRetStatus PopulateDot11fWscInProbeRes(tpAniSirGlobal pMac,
4488 tDot11fIEWscProbeRes *pDot11f)
4489{
4490 tANI_U32 cfgMethods;
4491 tANI_U32 cfgStrLen;
4492 tANI_U32 val;
4493 tANI_U32 wpsVersion, wpsState;
4494
4495
4496 if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_VERSION, &wpsVersion) != eSIR_SUCCESS)
4497 limLog(pMac, LOGP,"Failed to cfg get id %d\n", WNI_CFG_WPS_VERSION );
4498
4499 pDot11f->Version.present = 1;
4500 pDot11f->Version.major = (tANI_U8) ((wpsVersion & 0xF0)>>4);
4501 pDot11f->Version.minor = (tANI_U8) (wpsVersion & 0x0F);
4502
4503 if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_STATE, &wpsState) != eSIR_SUCCESS)
4504 limLog(pMac, LOGP,"Failed to cfg get id %d\n", WNI_CFG_WPS_STATE );
4505
4506 pDot11f->WPSState.present = 1;
4507 pDot11f->WPSState.state = (tANI_U8) wpsState;
4508
4509 pDot11f->APSetupLocked.present = 0;
4510
4511 pDot11f->SelectedRegistrar.present = 0;
4512
4513 pDot11f->DevicePasswordID.present = 0;
4514
4515 pDot11f->SelectedRegistrarConfigMethods.present = 0;
4516
4517 pDot11f->ResponseType.present = 1;
4518 if ((pMac->lim.wscIeInfo.reqType == REQ_TYPE_REGISTRAR) ||
4519 (pMac->lim.wscIeInfo.reqType == REQ_TYPE_WLAN_MANAGER_REGISTRAR)){
4520 pDot11f->ResponseType.resType = RESP_TYPE_ENROLLEE_OPEN_8021X;
4521 }
4522 else{
4523 pDot11f->ResponseType.resType = RESP_TYPE_AP;
4524 }
4525
4526 /* UUID is a 16 byte long binary. Still use wlan_cfgGetStr to get it. */
4527 pDot11f->UUID_E.present = 1;
4528 cfgStrLen = WNI_CFG_WPS_UUID_LEN;
4529 if (wlan_cfgGetStr(pMac,
4530 WNI_CFG_WPS_UUID,
4531 pDot11f->UUID_E.uuid,
4532 &cfgStrLen) != eSIR_SUCCESS)
4533 {
4534 *(pDot11f->UUID_E.uuid) = '\0';
4535 }
4536
4537 pDot11f->Manufacturer.present = 1;
4538 cfgStrLen = WNI_CFG_MANUFACTURER_NAME_LEN - 1;
4539 if (wlan_cfgGetStr(pMac,
4540 WNI_CFG_MANUFACTURER_NAME,
4541 pDot11f->Manufacturer.name,
4542 &cfgStrLen) != eSIR_SUCCESS)
4543 {
4544 pDot11f->Manufacturer.num_name = 0;
4545 *(pDot11f->Manufacturer.name) = '\0';
4546 }
4547 else
4548 {
4549 pDot11f->Manufacturer.num_name = (tANI_U8) (cfgStrLen & 0x000000FF);
4550 pDot11f->Manufacturer.name[cfgStrLen] = '\0';
4551 }
4552
4553 pDot11f->ModelName.present = 1;
4554 cfgStrLen = WNI_CFG_MODEL_NAME_LEN - 1;
4555 if (wlan_cfgGetStr(pMac,
4556 WNI_CFG_MODEL_NAME,
4557 pDot11f->ModelName.text,
4558 &cfgStrLen) != eSIR_SUCCESS)
4559 {
4560 pDot11f->ModelName.num_text = 0;
4561 *(pDot11f->ModelName.text) = '\0';
4562 }
4563 else
4564 {
4565 pDot11f->ModelName.num_text = (tANI_U8) (cfgStrLen & 0x000000FF);
4566 pDot11f->ModelName.text[cfgStrLen] = '\0';
4567 }
4568
4569 pDot11f->ModelNumber.present = 1;
4570 cfgStrLen = WNI_CFG_MODEL_NUMBER_LEN - 1;
4571 if (wlan_cfgGetStr(pMac,
4572 WNI_CFG_MODEL_NUMBER,
4573 pDot11f->ModelNumber.text,
4574 &cfgStrLen) != eSIR_SUCCESS)
4575 {
4576 pDot11f->ModelNumber.num_text = 0;
4577 *(pDot11f->ModelNumber.text) = '\0';
4578 }
4579 else
4580 {
4581 pDot11f->ModelNumber.num_text = (tANI_U8) (cfgStrLen & 0x000000FF);
4582 pDot11f->ModelNumber.text[cfgStrLen] = '\0';
4583 }
4584
4585 pDot11f->SerialNumber.present = 1;
4586 cfgStrLen = WNI_CFG_MANUFACTURER_PRODUCT_VERSION_LEN - 1;
4587 if (wlan_cfgGetStr(pMac,
4588 WNI_CFG_MANUFACTURER_PRODUCT_VERSION,
4589 pDot11f->SerialNumber.text,
4590 &cfgStrLen) != eSIR_SUCCESS)
4591 {
4592 pDot11f->SerialNumber.num_text = 0;
4593 *(pDot11f->SerialNumber.text) = '\0';
4594 }
4595 else
4596 {
4597 pDot11f->SerialNumber.num_text = (tANI_U8) (cfgStrLen & 0x000000FF);
4598 pDot11f->SerialNumber.text[cfgStrLen] = '\0';
4599 }
4600
4601 pDot11f->PrimaryDeviceType.present = 1;
4602
4603 if (wlan_cfgGetInt(pMac, WNI_CFG_WPS_PRIMARY_DEVICE_CATEGORY, &val) != eSIR_SUCCESS)
4604 {
4605 limLog(pMac, LOGP, FL("cfg get prim device category failed\n"));
4606 }
4607 else
4608 pDot11f->PrimaryDeviceType.primary_category = (tANI_U16) val;
4609
4610 if (wlan_cfgGetInt(pMac, WNI_CFG_WPS_PIMARY_DEVICE_OUI, &val) != eSIR_SUCCESS)
4611 {
4612 limLog(pMac, LOGP, FL("cfg get prim device OUI failed\n"));
4613 }
4614 else
4615 {
4616 *(pDot11f->PrimaryDeviceType.oui) = (tANI_U8)((val >> 24)& 0xff);
4617 *(pDot11f->PrimaryDeviceType.oui+1) = (tANI_U8)((val >> 16)& 0xff);
4618 *(pDot11f->PrimaryDeviceType.oui+2) = (tANI_U8)((val >> 8)& 0xff);
4619 *(pDot11f->PrimaryDeviceType.oui+3) = (tANI_U8)((val & 0xff));
4620 }
4621
4622 if (wlan_cfgGetInt(pMac, WNI_CFG_WPS_DEVICE_SUB_CATEGORY, &val) != eSIR_SUCCESS)
4623 {
4624 limLog(pMac, LOGP, FL("cfg get prim device sub category failed\n"));
4625 }
4626 else
4627 pDot11f->PrimaryDeviceType.sub_category = (tANI_U16) val;
4628
4629 pDot11f->DeviceName.present = 1;
4630 cfgStrLen = WNI_CFG_MANUFACTURER_PRODUCT_NAME_LEN - 1;
4631 if (wlan_cfgGetStr(pMac,
4632 WNI_CFG_MANUFACTURER_PRODUCT_NAME,
4633 pDot11f->DeviceName.text,
4634 &cfgStrLen) != eSIR_SUCCESS)
4635 {
4636 pDot11f->DeviceName.num_text = 0;
4637 *(pDot11f->DeviceName.text) = '\0';
4638 }
4639 else
4640 {
4641 pDot11f->DeviceName.num_text = (tANI_U8) (cfgStrLen & 0x000000FF);
4642 pDot11f->DeviceName.text[cfgStrLen] = '\0';
4643 }
4644
4645 if (wlan_cfgGetInt(pMac,
4646 WNI_CFG_WPS_CFG_METHOD,
4647 &cfgMethods) != eSIR_SUCCESS)
4648 {
4649 pDot11f->ConfigMethods.present = 0;
4650 pDot11f->ConfigMethods.methods = 0;
4651 }
4652 else
4653 {
4654 pDot11f->ConfigMethods.present = 1;
4655 pDot11f->ConfigMethods.methods = (tANI_U16) (cfgMethods & 0x0000FFFF);
4656 }
4657
4658 pDot11f->RFBands.present = 0;
4659
4660 pDot11f->present = 1;
4661 return eSIR_SUCCESS;
4662}
4663
4664tSirRetStatus PopulateDot11fWscRegistrarInfoInProbeRes(tpAniSirGlobal pMac,
4665 tDot11fIEWscProbeRes *pDot11f)
4666{
4667 const struct sLimWscIeInfo *const pWscIeInfo = &(pMac->lim.wscIeInfo);
4668 tANI_U32 devicepasswdId;
4669
4670 pDot11f->APSetupLocked.present = 1;
4671 pDot11f->APSetupLocked.fLocked = pWscIeInfo->apSetupLocked;
4672
4673 pDot11f->SelectedRegistrar.present = 1;
4674 pDot11f->SelectedRegistrar.selected = pWscIeInfo->selectedRegistrar;
4675
4676 if (wlan_cfgGetInt(pMac, (tANI_U16) WNI_CFG_WPS_DEVICE_PASSWORD_ID, &devicepasswdId) != eSIR_SUCCESS)
4677 limLog(pMac, LOGP,"Failed to cfg get id %d\n", WNI_CFG_WPS_DEVICE_PASSWORD_ID );
4678
4679 pDot11f->DevicePasswordID.present = 1;
4680 pDot11f->DevicePasswordID.id = (tANI_U16) devicepasswdId;
4681
4682 pDot11f->SelectedRegistrarConfigMethods.present = 1;
4683 pDot11f->SelectedRegistrarConfigMethods.methods = pWscIeInfo->selectedRegistrarConfigMethods;
4684
4685 // UUID_E and RF Bands are applicable only for dual band AP
4686
4687 return eSIR_SUCCESS;
4688}
4689
4690tSirRetStatus DePopulateDot11fWscRegistrarInfoInProbeRes(tpAniSirGlobal pMac,
4691 tDot11fIEWscProbeRes *pDot11f)
4692{
4693 pDot11f->APSetupLocked.present = 0;
4694 pDot11f->SelectedRegistrar.present = 0;
4695 pDot11f->DevicePasswordID.present = 0;
4696 pDot11f->SelectedRegistrarConfigMethods.present = 0;
4697
4698 return eSIR_SUCCESS;
4699}
4700
4701tSirRetStatus PopulateDot11fAssocResWscIE(tpAniSirGlobal pMac,
4702 tDot11fIEWscAssocRes *pDot11f,
4703 tpSirAssocReq pRcvdAssocReq)
4704{
4705 tDot11fIEWscAssocReq parsedWscAssocReq = { 0, };
4706 tANI_U8 *wscIe;
4707
4708
4709 wscIe = limGetWscIEPtr(pMac, pRcvdAssocReq->addIE.addIEdata, pRcvdAssocReq->addIE.length);
4710 if(wscIe != NULL)
4711 {
4712 // retreive WSC IE from given AssocReq
4713 dot11fUnpackIeWscAssocReq( pMac,
4714 wscIe + 2 + 4, // EID, length, OUI
4715 wscIe[ 1 ] - 4, // length without OUI
4716 &parsedWscAssocReq );
4717 pDot11f->present = 1;
4718 // version has to be 0x10
4719 pDot11f->Version.present = 1;
4720 pDot11f->Version.major = 0x1;
4721 pDot11f->Version.minor = 0x0;
4722
4723 pDot11f->ResponseType.present = 1;
4724
4725 if ((parsedWscAssocReq.RequestType.reqType == REQ_TYPE_REGISTRAR) ||
4726 (parsedWscAssocReq.RequestType.reqType == REQ_TYPE_WLAN_MANAGER_REGISTRAR))
4727 {
4728 pDot11f->ResponseType.resType = RESP_TYPE_ENROLLEE_OPEN_8021X;
4729 }
4730 else
4731 {
4732 pDot11f->ResponseType.resType = RESP_TYPE_AP;
4733 }
4734 // Version infomration should be taken from our capability as well as peers
4735 // TODO: currently it takes from peers only
4736 if(parsedWscAssocReq.VendorExtension.present &&
4737 parsedWscAssocReq.VendorExtension.Version2.present)
4738 {
4739 pDot11f->VendorExtension.present = 1;
4740 pDot11f->VendorExtension.vendorId[0] = 0x00;
4741 pDot11f->VendorExtension.vendorId[1] = 0x37;
4742 pDot11f->VendorExtension.vendorId[2] = 0x2A;
4743 pDot11f->VendorExtension.Version2.present = 1;
4744 pDot11f->VendorExtension.Version2.major = parsedWscAssocReq.VendorExtension.Version2.major;
4745 pDot11f->VendorExtension.Version2.minor = parsedWscAssocReq.VendorExtension.Version2.minor;
4746 }
4747 }
4748 return eSIR_SUCCESS;
4749}
4750
4751#ifdef WLAN_FEATURE_P2P
4752tSirRetStatus PopulateDot11AssocResP2PIE(tpAniSirGlobal pMac,
4753 tDot11fIEP2PAssocRes *pDot11f,
4754 tpSirAssocReq pRcvdAssocReq)
4755{
4756 tANI_U8 *p2pIe;
4757
4758 p2pIe = limGetP2pIEPtr(pMac, pRcvdAssocReq->addIE.addIEdata, pRcvdAssocReq->addIE.length);
4759 if(p2pIe != NULL)
4760 {
4761 pDot11f->present = 1;
4762 pDot11f->P2PStatus.present = 1;
4763 pDot11f->P2PStatus.status = eSIR_SUCCESS;
4764 pDot11f->ExtendedListenTiming.present = 0;
4765 }
4766 return eSIR_SUCCESS;
4767}
4768#endif
4769
4770#if defined WLAN_FEATURE_VOWIFI
4771
4772tSirRetStatus PopulateDot11fWFATPC( tpAniSirGlobal pMac,
4773 tDot11fIEWFATPC *pDot11f, tANI_U8 txPower, tANI_U8 linkMargin )
4774{
4775 pDot11f->txPower = txPower;
4776 pDot11f->linkMargin = linkMargin;
4777 pDot11f->present = 1;
4778
4779 return eSIR_SUCCESS;
4780}
4781
4782tSirRetStatus PopulateDot11fBeaconReport( tpAniSirGlobal pMac, tDot11fIEMeasurementReport *pDot11f, tSirMacBeaconReport *pBeaconReport )
4783{
4784
4785 pDot11f->report.Beacon.regClass = pBeaconReport->regClass;
4786 pDot11f->report.Beacon.channel = pBeaconReport->channel;
4787 palCopyMemory( pMac->hHdd, pDot11f->report.Beacon.meas_start_time, pBeaconReport->measStartTime, sizeof(pDot11f->report.Beacon.meas_start_time) );
4788 pDot11f->report.Beacon.meas_duration = pBeaconReport->measDuration;
4789 pDot11f->report.Beacon.condensed_PHY = pBeaconReport->phyType;
4790 pDot11f->report.Beacon.reported_frame_type = !pBeaconReport->bcnProbeRsp;
4791 pDot11f->report.Beacon.RCPI = pBeaconReport->rcpi;
4792 pDot11f->report.Beacon.RSNI = pBeaconReport->rsni;
4793 palCopyMemory( pMac->hHdd, pDot11f->report.Beacon.BSSID, pBeaconReport->bssid, sizeof(tSirMacAddr));
4794 pDot11f->report.Beacon.antenna_id = pBeaconReport->antennaId;
4795 pDot11f->report.Beacon.parent_TSF = pBeaconReport->parentTSF;
4796
4797 if( pBeaconReport->numIes )
4798 {
4799 pDot11f->report.Beacon.BeaconReportFrmBody.present = 1;
4800 palCopyMemory( pMac->hHdd, pDot11f->report.Beacon.BeaconReportFrmBody.reportedFields, pBeaconReport->Ies, pBeaconReport->numIes );
4801 pDot11f->report.Beacon.BeaconReportFrmBody.num_reportedFields = pBeaconReport->numIes;
4802 }
4803
4804 return eSIR_SUCCESS;
4805
4806}
4807
4808tSirRetStatus PopulateDot11fRRMIe( tpAniSirGlobal pMac, tDot11fIERRMEnabledCap *pDot11f, tpPESession psessionEntry )
4809{
4810 tpRRMCaps pRrmCaps;
4811
4812 pRrmCaps = rrmGetCapabilities( pMac, psessionEntry );
4813
4814 pDot11f->LinkMeasurement = pRrmCaps->LinkMeasurement ;
4815 pDot11f->NeighborRpt = pRrmCaps->NeighborRpt ;
4816 pDot11f->parallel = pRrmCaps->parallel ;
4817 pDot11f->repeated = pRrmCaps->repeated ;
4818 pDot11f->BeaconPassive = pRrmCaps->BeaconPassive ;
4819 pDot11f->BeaconActive = pRrmCaps->BeaconActive ;
4820 pDot11f->BeaconTable = pRrmCaps->BeaconTable ;
4821 pDot11f->BeaconRepCond = pRrmCaps->BeaconRepCond ;
4822 pDot11f->FrameMeasurement = pRrmCaps->FrameMeasurement ;
4823 pDot11f->ChannelLoad = pRrmCaps->ChannelLoad ;
4824 pDot11f->NoiseHistogram = pRrmCaps->NoiseHistogram ;
4825 pDot11f->statistics = pRrmCaps->statistics ;
4826 pDot11f->LCIMeasurement = pRrmCaps->LCIMeasurement ;
4827 pDot11f->LCIAzimuth = pRrmCaps->LCIAzimuth ;
4828 pDot11f->TCMCapability = pRrmCaps->TCMCapability ;
4829 pDot11f->triggeredTCM = pRrmCaps->triggeredTCM ;
4830 pDot11f->APChanReport = pRrmCaps->APChanReport ;
4831 pDot11f->RRMMIBEnabled = pRrmCaps->RRMMIBEnabled ;
4832 pDot11f->operatingChanMax = pRrmCaps->operatingChanMax ;
4833 pDot11f->nonOperatinChanMax = pRrmCaps->nonOperatingChanMax ;
4834 pDot11f->MeasurementPilot = pRrmCaps->MeasurementPilot ;
4835 pDot11f->MeasurementPilotEnabled = pRrmCaps->MeasurementPilotEnabled ;
4836 pDot11f->NeighborTSFOffset = pRrmCaps->NeighborTSFOffset ;
4837 pDot11f->RCPIMeasurement = pRrmCaps->RCPIMeasurement ;
4838 pDot11f->RSNIMeasurement = pRrmCaps->RSNIMeasurement ;
4839 pDot11f->BssAvgAccessDelay = pRrmCaps->BssAvgAccessDelay ;
4840 pDot11f->BSSAvailAdmission = pRrmCaps->BSSAvailAdmission ;
4841 pDot11f->AntennaInformation = pRrmCaps->AntennaInformation ;
4842
4843 pDot11f->present = 1;
4844 return eSIR_SUCCESS;
4845}
4846#endif
4847
4848#if defined WLAN_FEATURE_VOWIFI_11R
4849void PopulateMDIE( tpAniSirGlobal pMac,
4850 tDot11fIEMobilityDomain *pDot11f, tANI_U8 mdie[SIR_MDIE_SIZE] )
4851{
4852 pDot11f->present = 1;
4853 pDot11f->MDID = (tANI_U16)((mdie[1] << 8) | (mdie[0]));
4854
4855 // Plugfest fix
4856 pDot11f->overDSCap = (mdie[2] & 0x01);
4857 pDot11f->resourceReqCap = ((mdie[2] >> 1) & 0x01);
4858
4859}
4860
4861void PopulateFTInfo( tpAniSirGlobal pMac,
4862 tDot11fIEFTInfo *pDot11f )
4863{
4864 pDot11f->present = 1;
4865 pDot11f->IECount = 0; //TODO: put valid data during reassoc.
4866 //All other info is zero.
4867
4868}
4869#endif
4870
4871void PopulateDot11fAssocRspRates ( tpAniSirGlobal pMac, tDot11fIESuppRates *pSupp,
4872 tDot11fIEExtSuppRates *pExt, tANI_U16 *_11bRates, tANI_U16 *_11aRates )
4873{
4874 tANI_U8 num_supp = 0, num_ext = 0;
4875 tANI_U8 i,j;
4876
4877 for( i = 0 ; (i < SIR_NUM_11B_RATES && _11bRates[i]) ; i++, num_supp++ )
4878 {
4879 pSupp->rates[num_supp] = (tANI_U8)_11bRates[i];
4880 }
4881 for( j = 0 ; (j < SIR_NUM_11A_RATES && _11aRates[j]) ; j++ )
4882 {
4883 if( num_supp < 8 )
4884 pSupp->rates[num_supp++] = (tANI_U8)_11aRates[j];
4885 else
4886 pExt->rates[num_ext++] = (tANI_U8)_11aRates[j];
4887 }
4888
4889 if( num_supp )
4890 {
4891 pSupp->num_rates = num_supp;
4892 pSupp->present = 1;
4893 }
4894 if( num_ext )
4895 {
4896 pExt->num_rates = num_ext;
4897 pExt->present = 1;
4898 }
4899}
4900// parserApi.c ends here.