blob: be36cd590b58cb8ff30675015507cbe0085c52d7 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08002 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21/*
Jeff Johnson32d95a32012-09-10 13:15:23 -070022 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -070023 *
24 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
25 *
26 *
27 * Permission to use, copy, modify, and/or distribute this software for
28 * any purpose with or without fee is hereby granted, provided that the
29 * above copyright notice and this permission notice appear in all
30 * copies.
31 *
32 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
33 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
34 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
35 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
36 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
37 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
38 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39 * PERFORMANCE OF THIS SOFTWARE.
40 */
41
42/*============================================================================
43limLogDump.c
44
45Implements the dump commands specific to the lim module.
46
47Copyright (c) 2007 QUALCOMM Incorporated.
48All Rights Reserved.
49Qualcomm Confidential and Proprietary
50 ============================================================================*/
51
52#include "vos_types.h"
53#include "limApi.h"
54
55#if defined(ANI_LOGDUMP)
56
57
58#include "limUtils.h"
59#include "limSecurityUtils.h"
60#include "schApi.h"
61#include "limSerDesUtils.h"
62#include "limAssocUtils.h"
63#include "limSendMessages.h"
64#include "logDump.h"
65#include "limTrace.h"
66#if defined WLAN_FEATURE_VOWIFI
67#include "rrmApi.h"
68#endif
69#if defined WLAN_FEATURE_VOWIFI_11R
70#include <limFT.h>
71#endif
72#include "smeInside.h"
73
74static char *getRole( tLimSystemRole role )
75{
76 switch (role)
77 {
78 case eLIM_UNKNOWN_ROLE:
79 return "eLIM_UNKNOWN_ROLE";
80 case eLIM_AP_ROLE:
81 return "eLIM_AP_ROLE";
82 case eLIM_STA_IN_IBSS_ROLE:
83 return "eLIM_STA_IN_IBSS_ROLE";
84 case eLIM_STA_ROLE:
85 return "eLIM_STA_ROLE";
86 case eLIM_BT_AMP_STA_ROLE:
87 return "eLIM_BT_AMP_STA_ROLE";
88 case eLIM_BT_AMP_AP_ROLE:
89 return "eLIM_BT_AMP_AP_ROLE";
90 default:
91 return "UNKNOWN";
92 }
93}
94
95#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
96static char *
97dumpMacAddr(tpAniSirGlobal pMac, char *p, tANI_U8 *addr)
98{
99 p += log_sprintf( pMac,p, "%2x:%2x:%2x:%2x:%2x:%2x",
100 addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
101 return p;
102}
103#endif
104
105
Jeff Johnsone7245742012-09-05 17:12:55 -0700106char *dumpLim( tpAniSirGlobal pMac, char *p, tANI_U32 sessionId)
Jeff Johnson295189b2012-06-20 16:38:30 -0700107{
108 #ifdef FIXME_GEN6
109 //iterate through the sessionTable and dump sta entries for each session.
110 //Keep this code under 'WLAN_DEBUG' compile flag.
111
112 tANI_U16 i, j;
113
Jeff Johnsone7245742012-09-05 17:12:55 -0700114 tpPESession psessionEntry = peFindSessionBySessionId(pMac, sessionId);
115
116 if (psessionEntry == NULL)
117 {
118 p += log_sprintf( pMac, p, "Invalid sessionId: %d \n ", sessionId);
119 return p;
120 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700121
122 p += log_sprintf( pMac,p, "\n ----- LIM Debug Information ----- \n");
123 p += log_sprintf( pMac,p, "LIM Role = (%d) %s\n",
124 pMac->lim.gLimSystemRole, getRole(pMac->lim.gLimSystemRole));
125 p += log_sprintf( pMac,p, "SME State = (%d) %s",
126 pMac->lim.gLimSmeState, limSmeStateStr(pMac->lim.gLimSmeState));
127 p += log_sprintf( pMac,p, "MLM State = (%d) %s",
128 pMac->lim.gLimMlmState, limMlmStateStr(pMac->lim.gLimMlmState));
Jeff Johnsone7245742012-09-05 17:12:55 -0700129 p += log_sprintf( pMac,p, "802.11n session HT Capability: %s\n",
130 (psessionEntry->htCapability == 1) ? "Enabled" : "Disabled");
Jeff Johnson295189b2012-06-20 16:38:30 -0700131 p += log_sprintf( pMac,p, "gLimProcessDefdMsgs: %s\n",
132 (pMac->lim.gLimProcessDefdMsgs == 1) ? "Enabled" : "Disabled");
133
134 if (pMac->lim.gLimSystemRole == eLIM_STA_ROLE)
135 {
136 p += log_sprintf( pMac,p, "AID = %X\t\t\n", pMac->lim.gLimAID);
137 p += log_sprintf( pMac,p, "SSID mismatch in Beacon Count = %d\n",
138 pMac->lim.gLimBcnSSIDMismatchCnt);
139 p += log_sprintf( pMac,p, "Number of link establishments = %d\n",
140 pMac->lim.gLimNumLinkEsts);
141 }
142 else if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE)
143 {
144 p += log_sprintf( pMac,p, "Num of STAs associated = %d\n",
145 pMac->lim.gLimNumOfCurrentSTAs);
146
147 p += log_sprintf( pMac,p, "Num of Pre-auth contexts = %d\n",
148 pMac->lim.gLimNumPreAuthContexts);
149
150 p += log_sprintf( pMac,p, "Num of AssocReq dropped in invalid State = %d\n",
151 pMac->lim.gLimNumAssocReqDropInvldState);
152
153 p += log_sprintf( pMac,p, "Num of ReassocReq dropped in invalid State = %d\n",
154 pMac->lim.gLimNumReassocReqDropInvldState);
155
156 p += log_sprintf( pMac,p, "Num of Hash Miss Event ignored = %d\n",
157 pMac->lim.gLimNumHashMissIgnored);
Jeff Johnson295189b2012-06-20 16:38:30 -0700158 }
159
160 p += log_sprintf( pMac,p, "Num of RxCleanup Count = %d\n",
161 pMac->lim.gLimNumRxCleanup);
162 p += log_sprintf( pMac,p, "Unexpected Beacon Count = %d\n",
163 pMac->lim.gLimUnexpBcnCnt);
164 p += log_sprintf( pMac,p, "Number of Re/Assoc rejects of 11b STAs = %d\n",
165 pMac->lim.gLim11bStaAssocRejectCount);
166 p += log_sprintf( pMac,p, "No. of HeartBeat Failures in LinkEst State = %d\n",
167 pMac->lim.gLimHBfailureCntInLinkEstState);
168 p += log_sprintf( pMac,p, "No. of Probe Failures after HB failed = %d\n",
169 pMac->lim.gLimProbeFailureAfterHBfailedCnt);
170 p += log_sprintf( pMac,p, "No. of HeartBeat Failures in Other States = %d\n",
171 pMac->lim.gLimHBfailureCntInOtherStates);
172 p += log_sprintf( pMac,p, "No. of Beacons Rxed During HB Interval = %d\n",
173 pMac->lim.gLimRxedBeaconCntDuringHB);
174 p += log_sprintf( pMac,p, "Self Operating Mode = %s\n", limDot11ModeStr(pMac, (tANI_U8)pMac->lim.gLimDot11Mode));
Jeff Johnson295189b2012-06-20 16:38:30 -0700175 p += log_sprintf( pMac,p, "\n");
176
177 if (pMac->lim.gLimSystemRole == eLIM_AP_ROLE)
178 i = 2;
179 else
180 i = 1;
181
182
183 for (; i< pMac->lim.maxStation; i++)
184 {
185 tpDphHashNode pSta = dphGetHashEntry(pMac, (unsigned short)i);
186 if (pSta && pSta->added)
187 {
188 p += log_sprintf( pMac,p, "\nSTA AID: %d STA ID: %d Valid: %d AuthType: %d MLM State: %s",
189 i, pSta->staIndex, pSta->valid,
190 pSta->mlmStaContext.authType,
191 limMlmStateStr(pSta->mlmStaContext.mlmState));
192
193 p += log_sprintf( pMac,p, "\tAID:%-2d OpRateMode:%s ShPrmbl:%d HT:%d GF:%d TxChWidth:%d MimoPS:%d LsigProt:%d\n",
194 pSta->assocId, limStaOpRateModeStr(pSta->supportedRates.opRateMode),
195 pSta->shortPreambleEnabled, pSta->mlmStaContext.htCapability,
196 pSta->htGreenfield, pSta->htSupportedChannelWidthSet,
197 pSta->htMIMOPSState, pSta->htLsigTXOPProtection);
198
199 p += log_sprintf( pMac,p, "\tAMPDU [MaxSz(Factor):%d, Dens: %d] AMSDU-MaxLen: %d\n",
200 pSta->htMaxRxAMpduFactor, pSta->htAMpduDensity,pSta->htMaxAmsduLength);
201 p += log_sprintf( pMac,p, "\tDSSCCkMode40Mhz: %d, SGI20: %d, SGI40: %d\n",
202 pSta->htDsssCckRate40MHzSupport, pSta->htShortGI20Mhz,
203 pSta->htShortGI40Mhz);
204
205 p += log_sprintf( pMac,p, "\t11b Rates: ");
206 for(j=0; j<SIR_NUM_11B_RATES; j++)
207 if(pSta->supportedRates.llbRates[j] > 0)
208 p += log_sprintf( pMac,p, "%d ", pSta->supportedRates.llbRates[j]);
209
210 p += log_sprintf( pMac,p, "\n\t11a Rates: ");
211 for(j=0; j<SIR_NUM_11A_RATES; j++)
212 if(pSta->supportedRates.llaRates[j] > 0)
213 p += log_sprintf( pMac,p, "%d ", pSta->supportedRates.llaRates[j]);
214
215 p += log_sprintf( pMac,p, "\n\tPolaris Rates: ");
216 for(j=0; j<SIR_NUM_POLARIS_RATES; j++)
217 if(pSta->supportedRates.aniLegacyRates[j] > 0)
218 p += log_sprintf( pMac,p, "%d ", pSta->supportedRates.aniLegacyRates[j]);
219
220 p += log_sprintf( pMac,p, "\n\tTitan and Taurus Proprietary Rate Bitmap: %08x\n",
221 pSta->supportedRates.aniEnhancedRateBitmap);
222 p += log_sprintf( pMac,p, "\tMCS Rate Set Bitmap: ");
223 for(j=0; j<SIR_MAC_MAX_SUPPORTED_MCS_SET; j++)
224 p += log_sprintf( pMac,p, "%x ", pSta->supportedRates.supportedMCSSet[j]);
225
226 }
227 }
228 p += log_sprintf( pMac,p, "\nProbe response disable = %d\n",
229 pMac->lim.gLimProbeRespDisableFlag);
230
231#if (WNI_POLARIS_FW_PRODUCT == WLAN_STA)
232 p += log_sprintf( pMac,p, "Scan mode enable = %d\n",
233 pMac->sys.gSysEnableScanMode);
234 p += log_sprintf( pMac,p, "BackgroundScanDisable = %d\n",
235 pMac->lim.gLimBackgroundScanDisable);
236 p += log_sprintf( pMac,p, "ForceBackgroundScanDisable = %d\n",
237 pMac->lim.gLimForceBackgroundScanDisable);
238 p += log_sprintf( pMac,p, "LinkMonitor mode enable = %d\n",
239 pMac->sys.gSysEnableLinkMonitorMode);
240 p += log_sprintf( pMac,p, "Qos Capable = %d\n",
241 SIR_MAC_GET_QOS(pMac->lim.gLimCurrentBssCaps));
242 p += log_sprintf( pMac,p, "Wme Capable = %d\n",
243 LIM_BSS_CAPS_GET(WME, pMac->lim.gLimCurrentBssQosCaps));
244 p += log_sprintf( pMac,p, "Wsm Capable = %d\n",
245 LIM_BSS_CAPS_GET(WSM, pMac->lim.gLimCurrentBssQosCaps));
246 if (pMac->lim.gLimSystemRole == eLIM_STA_IN_IBSS_ROLE)
247 {
248 p += log_sprintf( pMac,p, "Number of peers in IBSS = %d\n",
249 pMac->lim.gLimNumIbssPeers);
250 if (pMac->lim.gLimNumIbssPeers)
251 {
252 tLimIbssPeerNode *pTemp;
253 pTemp = pMac->lim.gLimIbssPeerList;
254 p += log_sprintf( pMac,p, "MAC-Addr Ani Edca WmeInfo HT Caps #S,#E(Rates)\n");
255 while (pTemp != NULL)
256 {
257 p += log_sprintf( pMac,p, "%02X:%02X:%02X:%02X:%02X:%02X ",
258 pTemp->peerMacAddr[0],
259 pTemp->peerMacAddr[1],
260 pTemp->peerMacAddr[2],
261 pTemp->peerMacAddr[3],
262 pTemp->peerMacAddr[4],
263 pTemp->peerMacAddr[5]);
264 p += log_sprintf( pMac,p, " %d %d,%d %d %d %04X %d,%d\n",
265 pTemp->aniIndicator,
266 pTemp->edcaPresent, pTemp->wmeEdcaPresent,
267 pTemp->wmeInfoPresent,
268 pTemp->htCapable,
269 pTemp->capabilityInfo,
270 pTemp->supportedRates.numRates,
271 pTemp->extendedRates.numRates);
272 pTemp = pTemp->next;
273 }
274 }
275 }
276#else
277 p += log_sprintf( pMac,p, "Measurements enabled = %d\n",
278 pMac->sys.gSysEnableLearnMode);
279 p += log_sprintf( pMac,p, "Scan Mode for Learn Mode enable = %d\n",
280 pMac->lim.gLimUseScanModeForLearnMode);
281#endif
282 p += log_sprintf( pMac,p, "System Scan/Learn Mode bit = %d\n",
283 pMac->lim.gLimSystemInScanLearnMode);
284 p += log_sprintf( pMac,p, "Scan override = %d\n",
285 pMac->lim.gLimScanOverride);
286 p += log_sprintf( pMac,p, "CB State protection = %d\n",
287 pMac->lim.gLimCBStateProtection);
288 p += log_sprintf( pMac,p, "Count of Titan STA's = %d\n",
289 pMac->lim.gLimTitanStaCount);
290
291 //current BSS capability
292 p += log_sprintf( pMac,p, "**********Current BSS Capability********\n");
293 p += log_sprintf( pMac,p, "Ess = %d, ", SIR_MAC_GET_ESS(pMac->lim.gLimCurrentBssCaps));
294 p += log_sprintf( pMac,p, "Privacy = %d, ", SIR_MAC_GET_PRIVACY(pMac->lim.gLimCurrentBssCaps));
295 p += log_sprintf( pMac,p, "Short Preamble = %d, ", SIR_MAC_GET_SHORT_PREAMBLE(pMac->lim.gLimCurrentBssCaps));
296 p += log_sprintf( pMac,p, "Short Slot = %d, ", SIR_MAC_GET_SHORT_SLOT_TIME(pMac->lim.gLimCurrentBssCaps));
297 p += log_sprintf( pMac,p, "Qos = %d\n", SIR_MAC_GET_QOS(pMac->lim.gLimCurrentBssCaps));
298
299 //Protection related information
300 p += log_sprintf( pMac,p, "*****Protection related information******\n");
301 p += log_sprintf( pMac,p, "Protection %s\n", pMac->lim.gLimProtectionControl ? "Enabled" : "Disabled");
302
303 p += log_sprintf( pMac,p, "OBSS MODE = %d\n", pMac->lim.gHTObssMode);
304#if (defined(ANI_PRODUCT_TYPE_AP) || defined(ANI_PRODUCT_TYPE_AP_SDK))
305
306 p += log_sprintf( pMac,p, "\nNumber of active OLBC detected = %d\n",
307 pMac->lim.gLimOlbcParams.numSta);
308 if (pMac->lim.gLimOlbcParams.protectionEnabled)
309 p += log_sprintf( pMac,p, "Protection due to OLBC is ON\n");
310 else
311 p += log_sprintf( pMac,p, "Protection due to OLBC is OFF\n");
312
313 p += log_sprintf( pMac,p, "Content of OLBC cache: \n");
314 for (i=0; i<LIM_PROT_STA_OVERLAP_CACHE_SIZE; i++)
315 {
316 if (pMac->lim.protStaOverlapCache[i].active)
317 {
318 p = dumpMacAddr(pMac, p, pMac->lim.protStaOverlapCache[i].addr);
319 p += log_sprintf( pMac,p, "\n");
320 }
321 }
322
323 p += log_sprintf( pMac,p, "Content of Protection cache: \n");
324 for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++)
325 {
326 if (pMac->lim.protStaCache[i].active)
327 {
328 p = dumpMacAddr(pMac, p, pMac->lim.protStaCache[i].addr);
329 if(pMac->lim.protStaCache[i].protStaCacheType == eLIM_PROT_STA_CACHE_TYPE_HT20)
330 p += log_sprintf( pMac,p, " Type: HT20\n");
331 else if(pMac->lim.protStaCache[i].protStaCacheType == eLIM_PROT_STA_CACHE_TYPE_llB)
332 p += log_sprintf( pMac,p, " Type: 11B\n");
333 else if(pMac->lim.protStaCache[i].protStaCacheType == eLIM_PROT_STA_CACHE_TYPE_llG)
334 p += log_sprintf( pMac,p, " Type: 11G\n");
335
336 p += log_sprintf( pMac,p, "\n");
337 }
338 }
339 p += log_sprintf( pMac,p, "Count of different type sta associated\n");
340 p += log_sprintf( pMac,p, "11B = %d, Protection: %d\n", pMac->lim.gLim11bParams.numSta, pMac->lim.gLim11bParams.protectionEnabled);
341 p += log_sprintf( pMac,p, "11G = %d, Protection: %d\n", pMac->lim.gLim11gParams.numSta, pMac->lim.gLim11gParams.protectionEnabled);
342 p += log_sprintf( pMac,p, "nonGF = %d, Protection: %d\n", pMac->lim.gLimNonGfParams.numSta, pMac->lim.gLimNonGfParams.protectionEnabled);
343 p += log_sprintf( pMac,p, "!LsigTxop = %d, Protection: %d\n", pMac->lim.gLimLsigTxopParams.numSta, pMac->lim.gLimLsigTxopParams.protectionEnabled);
344 p += log_sprintf( pMac,p, "ht20 = %d Protection: %d\n", pMac->lim.gLimHt20Params.numSta, pMac->lim.gLimHt20Params.protectionEnabled);
345
346 p += log_sprintf( pMac,p, "\nNumber of STA do not support short preamble = %d\n",
347 pMac->lim.gLimNoShortParams.numNonShortPreambleSta);
348 for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++)
349 {
350 if (pMac->lim.gLimNoShortParams.staNoShortCache[i].active)
351 {
352 p = dumpMacAddr(pMac, p, pMac->lim.gLimNoShortParams.staNoShortCache[i].addr);
353 p += log_sprintf( pMac,p, "\n");
354 }
355 }
356
357 p += log_sprintf( pMac,p, "\nNumber of STA do not support short slot time = %d\n",
358 pMac->lim.gLimNoShortSlotParams.numNonShortSlotSta);
359 for (i=0; i<LIM_PROT_STA_CACHE_SIZE; i++)
360 {
361 if (pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].active)
362 {
363 p = dumpMacAddr(pMac, p, pMac->lim.gLimNoShortSlotParams.staNoShortSlotCache[i].addr);
364 p += log_sprintf( pMac,p, "\n");
365 }
366 }
Jeff Johnson295189b2012-06-20 16:38:30 -0700367#endif
368 p += log_sprintf( pMac, p, "HT operating Mode = %d, llbCoexist = %d, llgCoexist = %d, ht20Coexist = %d, nonGfPresent = %d, RifsMode = %d, lsigTxop = %d\n",
369 pMac->lim.gHTOperMode, pMac->lim.llbCoexist, pMac->lim.llgCoexist,
370 pMac->lim.ht20MhzCoexist, pMac->lim.gHTNonGFDevicesPresent,
371 pMac->lim.gHTRifsMode, pMac->lim.gHTLSigTXOPFullSupport);
Jeff Johnson295189b2012-06-20 16:38:30 -0700372 p += log_sprintf(pMac, p, "2nd Channel offset = %d\n",
Jeff Johnsone7245742012-09-05 17:12:55 -0700373 psessionEntry->hHTSecondaryChannelOffset);
Jeff Johnson295189b2012-06-20 16:38:30 -0700374#endif
375 return p;
376}
377
378/*******************************************
379 * FUNCTION: triggerBeaconGen()
380 *
381 * This logdump sends SIR_SCH_BEACON_GEN_IND to SCH.
382 * SCH then proceeds to generate a beacon template
383 * and copy it to the Host/SoftMAC shared memory
384 *
385 * TODO - This routine can safely be deleted once
386 * beacon generation is working
387 ******************************************/
388char *triggerBeaconGen( tpAniSirGlobal pMac, char *p )
389{
390 tSirMsgQ mesg = { (tANI_U16) SIR_LIM_BEACON_GEN_IND, (tANI_U16) 0, (tANI_U32) 0 };
391
392 pMac->lim.gLimSmeState = eLIM_SME_NORMAL_STATE;
Jeff Johnsone7245742012-09-05 17:12:55 -0700393 MTRACE(macTrace(pMac, TRACE_CODE_SME_STATE, NO_SESSION, pMac->lim.gLimSmeState));
Jeff Johnson295189b2012-06-20 16:38:30 -0700394 pMac->lim.gLimSystemRole = eLIM_AP_ROLE;
395
396 p += log_sprintf( pMac, p,
397 "Posted SIR_LIM_BEACON_GEN_IND with result = %s\n",
398 (eSIR_SUCCESS == limPostMsgApi( pMac, &mesg ))?
399 "Success": "Failure" );
400
401 return p;
402}
403
404
405/*******************************************
406 * FUNCTION: testLimSendProbeRsp()
407 *
408 * This logdump sends SIR_MAC_MGMT_PROBE_RSP
409 *
410 * TODO - This routine can safely be deleted once
411 * the MGMT frame transmission is working
412 ******************************************/
413char *testLimSendProbeRsp( tpAniSirGlobal pMac, char *p )
414{
415 tSirMacAddr peerMacAddr = { 0, 1, 2, 3, 4, 5 };
416 tAniSSID ssId;
417 tANI_U32 len = SIR_MAC_MAX_SSID_LENGTH;
418 tpPESession psessionEntry = &pMac->lim.gpSession[0]; //TBD-RAJESH HOW TO GET sessionEntry?????
419
420
421 if( eSIR_SUCCESS != wlan_cfgGetStr( pMac,
422 WNI_CFG_SSID,
423 (tANI_U8 *) &ssId.ssId,
424 (tANI_U32 *) &len ))
425 {
426 // Could not get SSID from CFG. Log error.
427 p += log_sprintf( pMac, p, "Unable to retrieve SSID\n" );
428 return p;
429 }
430 else
431 ssId.length = (tANI_U8) len;
432
433 p += log_sprintf( pMac, p, "Calling limSendProbeRspMgmtFrame...\n" );
434 limSendProbeRspMgmtFrame( pMac, peerMacAddr, &ssId, -1, 1, psessionEntry , 0);
435
436 return p;
437}
438
439
440static char *sendSmeScanReq(tpAniSirGlobal pMac, char *p)
441{
442 tSirMsgQ msg;
443 tSirSmeScanReq scanReq, *pScanReq;
444
445 p += log_sprintf( pMac,p, "sendSmeScanReq: Preparing eWNI_SME_SCAN_REQ message\n");
446
447 pScanReq = (tSirSmeScanReq *) &scanReq;
448
449 if (palAllocateMemory(pMac->hHdd, (void **)&pScanReq, sizeof(tSirSmeScanReq)) != eHAL_STATUS_SUCCESS)
450 {
451 p += log_sprintf( pMac,p,"sendSmeScanReq: palAllocateMemory() failed \n");
452 return p;
453 }
454
455 pScanReq->messageType = eWNI_SME_SCAN_REQ;
456 pScanReq->minChannelTime = 30;
457 pScanReq->maxChannelTime = 130;
458 pScanReq->bssType = eSIR_INFRASTRUCTURE_MODE;
459 limGetMyMacAddr(pMac, pScanReq->bssId);
460 pScanReq->numSsid = 1;
461 palCopyMemory(pMac->hHdd, (void *) &pScanReq->ssId[0].ssId, (void *)"Ivan", 4);
462 pScanReq->ssId[0].length = 4;
463 pScanReq->scanType = eSIR_ACTIVE_SCAN;
464 pScanReq->returnAfterFirstMatch = 0;
465 pScanReq->returnUniqueResults = 0;
466 pScanReq->returnFreshResults = SIR_BG_SCAN_PURGE_RESUTLS|SIR_BG_SCAN_RETURN_FRESH_RESULTS;
467 pScanReq->channelList.numChannels = 1;
468 pScanReq->channelList.channelNumber[0] = 6;
469 pScanReq->uIEFieldLen = 0;
470 pScanReq->uIEFieldOffset = sizeof(tSirSmeScanReq);
471 pScanReq->sessionId = 0;
472
473 msg.type = eWNI_SME_SCAN_REQ;
474 msg.bodyptr = pScanReq;
475 msg.bodyval = 0;
476 p += log_sprintf( pMac,p, "sendSmeScanReq: limPostMsgApi(eWNI_SME_SCAN_REQ) \n");
477 limPostMsgApi(pMac, &msg);
478
479 return p;
480}
481
482static char *sendSmeDisAssocReq(tpAniSirGlobal pMac, char *p,tANI_U32 arg1 ,tANI_U32 arg2)
483{
484
485 tpDphHashNode pStaDs;
486 tSirMsgQ msg;
487 tSirSmeDisassocReq *pDisAssocReq;
488 tpPESession psessionEntry;
489
490 //arg1 - assocId
491 //arg2 - sessionId
492 if( arg1 < 1 )
493 {
494 p += log_sprintf( pMac,p,"Invalid session OR Assoc ID \n");
495 return p;
496 }
497
498 if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg2) )== NULL)
499 {
500 p += log_sprintf( pMac,p,"Session does not exist for given session Id \n");
501 return p;
502 }
503
504 pStaDs = dphGetHashEntry(pMac, (tANI_U16)arg1, &psessionEntry->dph.dphHashTable);
505
506 if(NULL == pStaDs)
507 {
508 p += log_sprintf( pMac,p, "Could not find station with assocId = %d\n", arg1);
509 return p;
510 }
511
512 if (palAllocateMemory(pMac->hHdd, (void **)&pDisAssocReq, sizeof(tSirSmeDisassocReq)) != eHAL_STATUS_SUCCESS)
513 {
514 p += log_sprintf( pMac,p,"sendSmeDisAssocReq: palAllocateMemory() failed \n");
515 return p;
516 }
517
518 if( ( (psessionEntry->limSystemRole == eLIM_STA_ROLE) ||
519 (psessionEntry ->limSystemRole == eLIM_BT_AMP_STA_ROLE) ) &&
520 (psessionEntry->statypeForBss == STA_ENTRY_PEER))
521 {
522 sirCopyMacAddr(pDisAssocReq->bssId,psessionEntry->bssId);
523 sirCopyMacAddr(pDisAssocReq->peerMacAddr,psessionEntry->bssId);
524 }
525 if((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)
526#ifdef WLAN_SOFTAP_FEATURE
527 || (psessionEntry->limSystemRole == eLIM_AP_ROLE)
528#endif
529 )
530 {
531 sirCopyMacAddr(pDisAssocReq->peerMacAddr,pStaDs->staAddr);
532 sirCopyMacAddr(pDisAssocReq->bssId,psessionEntry->bssId);
533 }
534
535 pDisAssocReq->messageType = eWNI_SME_DISASSOC_REQ;
536
537 pDisAssocReq->length = sizeof(tSirSmeDisassocReq);
538
539 pDisAssocReq->reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
540
541 pDisAssocReq->sessionId = 0;
542
543 pDisAssocReq->transactionId = 0;
544
545 msg.type = eWNI_SME_DISASSOC_REQ;
546 msg.bodyptr = pDisAssocReq;
547 msg.bodyval = 0;
548
549 p += log_sprintf( pMac,p, "sendSmeDisAssocReq: limPostMsgApi(eWNI_SME_DISASSOC_REQ) \n");
550 limPostMsgApi(pMac, &msg);
551
552 return p;
553}
554
555
556static char *sendSmeStartBssReq(tpAniSirGlobal pMac, char *p,tANI_U32 arg1)
557{
558 tSirMsgQ msg;
559 tSirSmeStartBssReq *pStartBssReq;
560 unsigned char *pBuf;
Jeff Johnsone7245742012-09-05 17:12:55 -0700561 ePhyChanBondState cbMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700562 tSirNwType nwType;
563
564 p += log_sprintf( pMac,p, "sendSmeStartBssReq: Preparing eWNI_SME_START_BSS_REQ message\n");
565
566 if(arg1 > 2)
567 {
568 p += log_sprintf( pMac,p,"Invalid Argument1 \n");
569 return p;
570 }
571
572 if (palAllocateMemory(pMac->hHdd, (void **)&pStartBssReq, sizeof(tSirSmeStartBssReq)) != eHAL_STATUS_SUCCESS)
573 {
574 p += log_sprintf( pMac,p,"sendSmeStartBssReq: palAllocateMemory() failed \n");
575 return p;
576 }
577
578 pStartBssReq->messageType = eWNI_SME_START_BSS_REQ;
579 pStartBssReq->length = 29; // 0x1d
580
581 if(arg1 == 0) //BTAMP STATION
582 {
583 pStartBssReq->bssType = eSIR_BTAMP_STA_MODE;
584
585 pStartBssReq->ssId.length = 5;
586 palCopyMemory(pMac->hHdd, (void *) &pStartBssReq->ssId.ssId, (void *)"BTSTA", 5);
587 }
588 else if(arg1 == 1) //BTAMP AP
589 {
590 pStartBssReq->bssType = eSIR_BTAMP_AP_MODE;
591 pStartBssReq->ssId.length = 4;
592 palCopyMemory(pMac->hHdd, (void *) &pStartBssReq->ssId.ssId, (void *)"BTAP", 4);
593 }
594 else //IBSS
595 {
596 pStartBssReq->bssType = eSIR_IBSS_MODE;
597 pStartBssReq->ssId.length = 4;
598 palCopyMemory(pMac->hHdd, (void *) &pStartBssReq->ssId.ssId, (void *)"Ibss", 4);
599 }
600
601 // Filling in channel ID 6
602 pBuf = &(pStartBssReq->ssId.ssId[pStartBssReq->ssId.length]);
603 *pBuf = 6;
604 pBuf++;
605
606 // Filling in CB mode
Jeff Johnsone7245742012-09-05 17:12:55 -0700607 cbMode = PHY_SINGLE_CHANNEL_CENTERED;
608 palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&cbMode, sizeof(ePhyChanBondState) );
609 pBuf += sizeof(ePhyChanBondState);
Jeff Johnson295189b2012-06-20 16:38:30 -0700610
611 // Filling in RSN IE Length to zero
612 palZeroMemory( pMac->hHdd, pBuf, sizeof(tANI_U16) ); //tSirRSNie->length
613 pBuf += sizeof(tANI_U16);
614
615 // Filling in NW Type
616 nwType = eSIR_11G_NW_TYPE;
617 palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&nwType, sizeof(tSirNwType) );
618 pBuf += sizeof(tSirNwType);
619
620 /* ---- To be filled by LIM later ----
621 pStartBssReq->operationalRateSet
622 pStartBssReq->extendedRateSet
623 pStartBssReq->dot11mode
624 pStartBssReq->bssId
625 pStartBssReq->selfMacAddr
626 pStartBssReq->beaconInterval
627 pStartBssReq->sessionId = 0;
628 pStartBssReq->transactionId = 0;
629 * ------------------------------------ */
630
631 msg.type = eWNI_SME_START_BSS_REQ;
632 msg.bodyptr = pStartBssReq;
633 msg.bodyval = 0;
634 p += log_sprintf( pMac,p, "sendSmeStartBssReq: limPostMsgApi(eWNI_SME_START_BSS_REQ) \n");
635 limPostMsgApi(pMac, &msg);
636
637 return p;
638}
639
640static char *sendSmeStopBssReq(tpAniSirGlobal pMac, char *p, tANI_U32 sessionId)
641{
642 tSirMsgQ msg;
643 tSirSmeStopBssReq stopBssReq, *pStopBssReq;
644 tANI_U16 msgLen = 0;
645 tpPESession psessionEntry;
646
647 psessionEntry = peFindSessionBySessionId(pMac, (tANI_U8)sessionId);
648 if ( psessionEntry == NULL )
649 {
650 limLog(pMac, LOGP, FL("Session entry does not exist for given sessionID \n"));
651 return p;
652 }
653
654 p += log_sprintf( pMac,p, "sendSmeStopBssReq: Preparing eWNI_SME_STOP_BSS_REQ message\n");
655 pStopBssReq = (tSirSmeStopBssReq *) &stopBssReq;
656
657 if (palAllocateMemory(pMac->hHdd, (void **)&pStopBssReq, sizeof(tSirSmeStopBssReq)) != eHAL_STATUS_SUCCESS)
658 {
659 p += log_sprintf( pMac,p,"sendSmeStopBssReq: palAllocateMemory() failed \n");
660 return p;
661 }
662
663 pStopBssReq->messageType = eWNI_SME_STOP_BSS_REQ;
664 msgLen += sizeof(tANI_U32); // msgType + length
665
666 pStopBssReq->reasonCode = eSIR_SME_SUCCESS;
667 msgLen += sizeof(tSirResultCodes);
668
669 palCopyMemory(pMac->hHdd, (void *) &pStopBssReq->bssId, (void *)psessionEntry->bssId, 6);
670 msgLen += sizeof(tSirMacAddr);
671
672 pStopBssReq->sessionId = (tANI_U8)sessionId;
673 msgLen += sizeof(tANI_U8);
674
675 pStopBssReq->transactionId = 0;
676 msgLen += sizeof(tANI_U16);
677
678 pStopBssReq->length = msgLen;
679
680 msg.type = eWNI_SME_STOP_BSS_REQ;
681 msg.bodyptr = pStopBssReq;
682 msg.bodyval = 0;
683 p += log_sprintf( pMac,p, "sendSmeStopBssReq: limPostMsgApi(eWNI_SME_STOP_BSS_REQ) \n");
684 limPostMsgApi(pMac, &msg);
685
686 return p;
687}
688
689static char *sendSmeJoinReq(tpAniSirGlobal pMac, char *p)
690{
691 tSirMsgQ msg;
692 tSirSmeJoinReq *pJoinReq;
693 unsigned char *pBuf;
694 tANI_U16 msgLen = 307;
695
696 tANI_U8 msgDump[307] = {
697 0x06, 0x12, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
698 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00,
699 0xDE, 0xAD, 0xBA, 0xEF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
700 0x00, 0x00, 0x00, 0x64, 0x00, 0x21, 0x04, 0x02, 0x00, 0x00,
701 0x00, 0x01, 0x1E, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x18,
702 0x00, 0x00, 0x00, 0xA8, 0x85, 0x4F, 0x7A, 0x00, 0x06, 0x41,
703 0x6E, 0x69, 0x4E, 0x65, 0x74, 0x01, 0x04, 0x82, 0x84, 0x8B,
704 0x96, 0x03, 0x01, 0x06, 0x07, 0x06, 0x55, 0x53, 0x49, 0x01,
705 0x0E, 0x1E, 0x2A, 0x01, 0x00, 0x32, 0x08, 0x0C, 0x12, 0x18,
706 0x24, 0x30, 0x48, 0x60, 0x6C, 0x2D, 0x1A, 0xEE, 0x11, 0x03,
707 0xFF, 0xFF, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
708 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
709 0x00, 0x00, 0x00, 0x3D, 0x16, 0x06, 0x07, 0x11, 0x00, 0x00,
710 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
711 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDD, 0x18, 0x00,
712 0x50, 0xF2, 0x02, 0x01, 0x01, 0x01, 0x00, 0x03, 0xA4, 0x00,
713 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62,
714 0x32, 0x2F, 0x00, 0xDD, 0x14, 0x00, 0x0A, 0xF5, 0x00, 0x03,
715 0x01, 0x03, 0x05, 0x0A, 0x02, 0x80, 0xC0, 0x12, 0x06, 0xFF,
716 0xFF, 0xFF, 0xFF, 0xB6, 0x0D, 0xDD, 0x6E, 0x00, 0x50, 0xF2,
717 0x04, 0x10, 0x4A, 0x00, 0x01, 0x10, 0x10, 0x44, 0x00, 0x01,
718 0x01, 0x10, 0x3B, 0x00, 0x01, 0x03, 0x10, 0x47, 0x00, 0x10,
719 0xDB, 0xC6, 0x77, 0x28, 0xB9, 0xF3, 0xD8, 0x58, 0x86, 0xFF,
720 0xFC, 0x6B, 0xB6, 0xB9, 0x27, 0x79, 0x10, 0x21, 0x00, 0x08,
721 0x51, 0x75, 0x61, 0x6C, 0x63, 0x6F, 0x6D, 0x6D, 0x10, 0x23,
722 0x00, 0x07, 0x57, 0x46, 0x52, 0x34, 0x30, 0x33, 0x31, 0x10,
723 0x24, 0x00, 0x06, 0x4D, 0x4E, 0x31, 0x32, 0x33, 0x34, 0x10,
724 0x42, 0x00, 0x06, 0x53, 0x4E, 0x31, 0x32, 0x33, 0x34, 0x10,
725 0x54, 0x00, 0x08, 0x00, 0x06, 0x00, 0x50, 0xF2, 0x04, 0x00,
726 0x01, 0x10, 0x11, 0x00, 0x06, 0x31, 0x31, 0x6E, 0x2D, 0x41,
727 0x50, 0x10, 0x08, 0x00, 0x02, 0x01, 0x8E
728 };
729
730 if (palAllocateMemory(pMac->hHdd, (void **)&pJoinReq, msgLen) != eHAL_STATUS_SUCCESS)
731 {
732 p += log_sprintf( pMac,p,"sendSmeJoinReq: palAllocateMemory() failed \n");
733 return p;
734 }
735
736 pBuf = (unsigned char *)pJoinReq;
737 palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)msgDump, msgLen );
738
739 msg.type = eWNI_SME_JOIN_REQ;
740 msg.bodyptr = pJoinReq;
741 msg.bodyval = 0;
742 limPostMsgApi(pMac, &msg);
743
744 return p;
745}
746
747
748static char *printSessionInfo(tpAniSirGlobal pMac, char *p)
749{
750 tpPESession psessionEntry = &pMac->lim.gpSession[0];
751 tANI_U8 i;
752
753 p += log_sprintf( pMac, p, "Dump PE Session \n");
754
755 for(i=0; i < pMac->lim.maxBssId; i++)
756 {
757 if( pMac->lim.gpSession[i].valid )
758 {
759 psessionEntry = &pMac->lim.gpSession[i];
760 p += log_sprintf( pMac,p, "*****************************************\n");
761 p += log_sprintf( pMac,p, " PE Session [%d] \n", i);
762 p += log_sprintf( pMac,p, "available: %d \n", psessionEntry->available);
763 p += log_sprintf( pMac,p, "peSessionId: %d, smeSessionId: %d, transactionId: %d \n",
764 psessionEntry->peSessionId, psessionEntry->smeSessionId, psessionEntry->smeSessionId);
765 p += log_sprintf( pMac,p, "bssId: %02X:%02X:%02X:%02X:%02X:%02X \n",
766 psessionEntry->bssId[0], psessionEntry->bssId[1], psessionEntry->bssId[2],
767 psessionEntry->bssId[3], psessionEntry->bssId[4], psessionEntry->bssId[5]);
768 p += log_sprintf( pMac,p, "selfMacAddr: %02X:%02X:%02X:%02X:%02X:%02X \n",
769 psessionEntry->selfMacAddr[0], psessionEntry->selfMacAddr[1], psessionEntry->selfMacAddr[2],
770 psessionEntry->selfMacAddr[3], psessionEntry->selfMacAddr[4], psessionEntry->selfMacAddr[5]);
771 p += log_sprintf( pMac,p, "bssIdx: %d \n", psessionEntry->bssIdx);
772 p += log_sprintf( pMac,p, "valid: %d \n", psessionEntry->valid);
773 p += log_sprintf( pMac,p, "limMlmState: (%d) %s ", psessionEntry->limMlmState, limMlmStateStr(psessionEntry->limMlmState) );
774 p += log_sprintf( pMac,p, "limPrevMlmState: (%d) %s ", psessionEntry->limPrevMlmState, limMlmStateStr(psessionEntry->limMlmState) );
775 p += log_sprintf( pMac,p, "limSmeState: (%d) %s ", psessionEntry->limSmeState, limSmeStateStr(psessionEntry->limSmeState) );
776 p += log_sprintf( pMac,p, "limPrevSmeState: (%d) %s ", psessionEntry->limPrevSmeState, limSmeStateStr(psessionEntry->limPrevSmeState) );
777 p += log_sprintf( pMac,p, "limSystemRole: (%d) %s \n", psessionEntry->limSystemRole, getRole(psessionEntry->limSystemRole) );
778 p += log_sprintf( pMac,p, "bssType: (%d) %s \n", psessionEntry->bssType, limBssTypeStr(psessionEntry->bssType));
779 p += log_sprintf( pMac,p, "operMode: %d \n", psessionEntry->operMode);
780 p += log_sprintf( pMac,p, "dot11mode: %d \n", psessionEntry->dot11mode);
Jeff Johnsone7245742012-09-05 17:12:55 -0700781 p += log_sprintf( pMac,p, "htCapability: %d \n", psessionEntry->htCapability);
Jeff Johnson295189b2012-06-20 16:38:30 -0700782 p += log_sprintf( pMac,p, "limRFBand: %d \n", psessionEntry->limRFBand);
783 p += log_sprintf( pMac,p, "limIbssActive: %d \n", psessionEntry->limIbssActive);
784 p += log_sprintf( pMac,p, "limCurrentAuthType: %d \n", psessionEntry->limCurrentAuthType);
785 p += log_sprintf( pMac,p, "limCurrentBssCaps: %d \n", psessionEntry->limCurrentBssCaps);
786 p += log_sprintf( pMac,p, "limCurrentBssQosCaps: %d \n", psessionEntry->limCurrentBssQosCaps);
787 p += log_sprintf( pMac,p, "limCurrentBssPropCap: %d \n", psessionEntry->limCurrentBssPropCap);
788 p += log_sprintf( pMac,p, "limSentCapsChangeNtf: %d \n", psessionEntry->limSentCapsChangeNtf);
789 p += log_sprintf( pMac,p, "LimAID: %d \n", psessionEntry->limAID);
790 p += log_sprintf( pMac,p, "ReassocbssId: %02X:%02X:%02X:%02X:%02X:%02X \n",
791 psessionEntry->limReAssocbssId[0], psessionEntry->limReAssocbssId[1], psessionEntry->limReAssocbssId[2],
792 psessionEntry->limReAssocbssId[3], psessionEntry->limReAssocbssId[4], psessionEntry->limReAssocbssId[5]);
793 p += log_sprintf( pMac,p, "limReassocChannelId: %d \n", psessionEntry->limReassocChannelId);
794 p += log_sprintf( pMac,p, "limReassocBssCaps: %d \n", psessionEntry->limReassocBssCaps);
795 p += log_sprintf( pMac,p, "limReassocBssQosCaps: %d \n", psessionEntry->limReassocBssQosCaps);
796 p += log_sprintf( pMac,p, "limReassocBssPropCap: %d \n", psessionEntry->limReassocBssPropCap);
Jeff Johnson295189b2012-06-20 16:38:30 -0700797 p += log_sprintf( pMac,p, "********************************************\n");
798 }
799 }
800 return p;
801}
802
803void
804limSetEdcaBcastACMFlag(tpAniSirGlobal pMac, tANI_U32 ac, tANI_U32 acmFlag)
805{
806 tpPESession psessionEntry = &pMac->lim.gpSession[0]; //TBD-RAJESH HOW TO GET sessionEntry?????
807 psessionEntry->gLimEdcaParamsBC[ac].aci.acm = (tANI_U8)acmFlag;
808 psessionEntry->gLimEdcaParamSetCount++;
809 schSetFixedBeaconFields(pMac,psessionEntry);
810}
811
812static char *
813limDumpEdcaParams(tpAniSirGlobal pMac, char *p)
814{
815 tANI_U8 i = 0;
816 tpPESession psessionEntry = &pMac->lim.gpSession[0]; //TBD-RAJESH HOW TO GET sessionEntry?????
817 p += log_sprintf( pMac,p, "EDCA parameter set count = %d\n", psessionEntry->gLimEdcaParamSetCount);
818 p += log_sprintf( pMac,p, "Broadcast parameters\n");
819 p += log_sprintf( pMac,p, "AC\tACI\tACM\tAIFSN\tCWMax\tCWMin\tTxopLimit\t\n");
820 for(i = 0; i < MAX_NUM_AC; i++)
821 {
822 //right now I am just interested in ACM bit. this can be extended for all other EDCA paramters.
823 p += log_sprintf( pMac,p, "%d\t%d\t%d\t%d\t%d\t%d\t%d\n", i,
824 psessionEntry->gLimEdcaParamsBC[i].aci.aci, psessionEntry->gLimEdcaParamsBC[i].aci.acm,
825 psessionEntry->gLimEdcaParamsBC[i].aci.aifsn, psessionEntry->gLimEdcaParamsBC[i].cw.max,
826 psessionEntry->gLimEdcaParamsBC[i].cw.min, psessionEntry->gLimEdcaParamsBC[i].txoplimit);
827 }
828
829 p += log_sprintf( pMac,p, "\nLocal parameters\n");
830 p += log_sprintf( pMac,p, "AC\tACI\tACM\tAIFSN\tCWMax\tCWMin\tTxopLimit\t\n");
831 for(i = 0; i < MAX_NUM_AC; i++)
832 {
833 //right now I am just interested in ACM bit. this can be extended for all other EDCA paramters.
834 p += log_sprintf( pMac,p, "%d\t%d\t%d\t%d\t%d\t%d\t%d\n", i,
835 psessionEntry->gLimEdcaParams[i].aci.aci, psessionEntry->gLimEdcaParams[i].aci.acm,
836 psessionEntry->gLimEdcaParams[i].aci.aifsn, psessionEntry->gLimEdcaParams[i].cw.max,
837 psessionEntry->gLimEdcaParams[i].cw.min, psessionEntry->gLimEdcaParams[i].txoplimit);
838 }
839
840 return p;
841}
842
843
844static char* limDumpTspecEntry(tpAniSirGlobal pMac, char *p, tANI_U32 tspecEntryNo)
845{
846 tpLimTspecInfo pTspecList;
847 if(tspecEntryNo >= LIM_NUM_TSPEC_MAX)
848 {
849 p += log_sprintf( pMac,p, "Tspec Entry no. %d is out of allowed range(0 .. %d)\n",
850 tspecEntryNo, (LIM_NUM_TSPEC_MAX - 1));
851 return p;
852 }
853 pTspecList = &pMac->lim.tspecInfo[tspecEntryNo];
854 if (pTspecList->inuse)
855 p += log_sprintf( pMac,p, "Entry %d is VALID\n", tspecEntryNo);
856 else
857 {
858 p += log_sprintf( pMac,p, "Entry %d is UNUSED\n", tspecEntryNo);
859 return p;
860 }
861 p += log_sprintf( pMac,p, "\tSta %0x:%0x:%0x:%0x:%0x:%0x, AID %d, Index %d\n",
862 pTspecList->staAddr[0], pTspecList->staAddr[1],
863 pTspecList->staAddr[2], pTspecList->staAddr[3],
864 pTspecList->staAddr[4], pTspecList->staAddr[5],
865 pTspecList->assocId, pTspecList->idx);
866 p += log_sprintf( pMac,p, "\tType %d, Length %d, ackPolicy %d, userPrio %d, accessPolicy = %d, Dir %d, tsid %d\n",
867 pTspecList->tspec.type, pTspecList->tspec.length,
868 pTspecList->tspec.tsinfo.traffic.ackPolicy, pTspecList->tspec.tsinfo.traffic.userPrio,
869 pTspecList->tspec.tsinfo.traffic.accessPolicy, pTspecList->tspec.tsinfo.traffic.direction,
870 pTspecList->tspec.tsinfo.traffic.tsid);
871 p += log_sprintf( pMac,p, "\tPsb %d, Agg %d, TrafficType %d, schedule %d; msduSz: nom %d, max %d\n",
872 pTspecList->tspec.tsinfo.traffic.psb, pTspecList->tspec.tsinfo.traffic.aggregation,
873 pTspecList->tspec.tsinfo.traffic.trafficType, pTspecList->tspec.tsinfo.schedule.schedule,
874 pTspecList->tspec.nomMsduSz, pTspecList->tspec.maxMsduSz);
875 p += log_sprintf( pMac,p, "\tSvcInt: Min %d, Max %d; dataRate: Min %d, mean %d, peak %d\n",
876 pTspecList->tspec.minSvcInterval, pTspecList->tspec.maxSvcInterval,
877 pTspecList->tspec.minDataRate, pTspecList->tspec.meanDataRate,
878 pTspecList->tspec.peakDataRate);
879 p += log_sprintf( pMac,p, "\tmaxBurstSz %d, delayBound %d, minPhyRate %d, surplusBw %d, mediumTime %d\n",
880 pTspecList->tspec.maxBurstSz, pTspecList->tspec.delayBound,
881 pTspecList->tspec.minPhyRate, pTspecList->tspec.surplusBw,
882 pTspecList->tspec.mediumTime);
883
884 return p;
885}
886
887static char* dumpTspecTableSummary(tpAniSirGlobal pMac, tpLimTspecInfo pTspecList, char *p, int ctspec)
888{
889 p += log_sprintf( pMac, p, "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n",
890 ctspec, pTspecList->idx, pTspecList->assocId,
891 pTspecList->tspec.tsinfo.traffic.ackPolicy, pTspecList->tspec.tsinfo.traffic.userPrio,
892 pTspecList->tspec.tsinfo.traffic.psb, pTspecList->tspec.tsinfo.traffic.aggregation,
893 pTspecList->tspec.tsinfo.traffic.accessPolicy, pTspecList->tspec.tsinfo.traffic.direction,
894 pTspecList->tspec.tsinfo.traffic.tsid, pTspecList->tspec.tsinfo.traffic.trafficType);
895
896 return p;
897}
898
899
900static char* limDumpDphTableSummary(tpAniSirGlobal pMac,char *p)
901{
902 tANI_U8 i, j;
903 p += log_sprintf( pMac,p, "DPH Table dump\n");
904
905 for(j=0; j < pMac->lim.maxBssId; j++)
906 {
907 /* Find first free room in session table */
908 if(pMac->lim.gpSession[j].valid)
909 {
910 p += log_sprintf( pMac,p, "aid staId bssid encPol qosMode wme 11e wsm staaddr\n");
911 for(i = 0; i < pMac->lim.gpSession[j].dph.dphHashTable.size; i++)
912 {
913 if (pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].added)
914 {
915 p += log_sprintf( pMac,p, "%d %d %d %d %d %d %d %d %x:%x:%x:%x:%x:%x\n",
916 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].assocId,
917 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].staIndex,
918 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].bssId,
919 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].encPolicy,
920 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].qosMode,
921 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].wmeEnabled,
922 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].lleEnabled,
923 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].wsmEnabled,
924 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].staAuthenticated,
925 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].staAddr[0],
926 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].staAddr[1],
927 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].staAddr[2],
928 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].staAddr[3],
929 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].staAddr[4],
930 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].staAddr[5]);
931 }
932 }
933 }
934 }
935 return p;
936}
937
938// add the specified tspec to the tspec list
939static char* limDumpTsecTable( tpAniSirGlobal pMac, char* p)
940{
941 int ctspec;
942 tpLimTspecInfo pTspecList = &pMac->lim.tspecInfo[0];
943
944 p += log_sprintf( pMac,p, "=======LIM TSPEC TABLE DUMP\n");
945 p += log_sprintf( pMac,p, "Num\tIdx\tAID\tAckPol\tUP\tPSB\tAgg\tAccessPol\tDir\tTSID\ttraffic\n");
946
947 for (ctspec = 0; ctspec < LIM_NUM_TSPEC_MAX; ctspec++, pTspecList++)
948 {
949 if (pTspecList->inuse)
950 p = dumpTspecTableSummary(pMac, pTspecList, p, ctspec);
951 }
952 return p;
953}
954
955static char *
956dump_lim_tspec_table( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
957{
958 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
959 p = limDumpTsecTable(pMac, p);
960 return p;
961}
962
963static char *
964dump_lim_tspec_entry( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
965{
966 (void) arg2; (void) arg3; (void) arg4;
967 p = limDumpTspecEntry(pMac, p, arg1);
968 return p;
969}
970
971static char *
972dump_lim_dph_table_summary( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
973{
974 (void) arg2; (void) arg3; (void) arg4;
975 p = limDumpDphTableSummary(pMac, p);
976 return p;
977}
978
979
980static char *
981dump_lim_link_monitor_stats( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
982{
983 tANI_U32 ind, val;
984
985 (void) arg2; (void) arg3; (void) arg4;
986 p += log_sprintf( pMac,p, "\n ----- LIM Heart Beat Stats ----- \n");
987 p += log_sprintf( pMac,p, "No. of HeartBeat Failures in LinkEst State = %d\n",
988 pMac->lim.gLimHBfailureCntInLinkEstState);
989 p += log_sprintf( pMac,p, "No. of Probe Failures after HB failed = %d\n",
990 pMac->lim.gLimProbeFailureAfterHBfailedCnt);
991 p += log_sprintf( pMac,p, "No. of HeartBeat Failures in Other States = %d\n",
992 pMac->lim.gLimHBfailureCntInOtherStates);
993
994 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val) == eSIR_SUCCESS)
995 p += log_sprintf( pMac,p, "Cfg HeartBeat Threshold = %d\n", val);
996
997 p += log_sprintf( pMac,p, "# Beacons Rcvd in HB interval # of times\n");
998
999 for (ind = 1; ind < MAX_NO_BEACONS_PER_HEART_BEAT_INTERVAL; ind++)
1000 {
1001 p += log_sprintf( pMac,p, "\t\t\t\t\t\t\t\t%2d\t\t\t\t\t\t\t\t\t\t\t%8d\n", ind,
1002 pMac->lim.gLimHeartBeatBeaconStats[ind]);
1003 }
1004 p += log_sprintf( pMac,p, "\t\t\t\t\t\t\t\t%2d>\t\t\t\t\t\t\t\t\t\t%8d\n",
1005 MAX_NO_BEACONS_PER_HEART_BEAT_INTERVAL-1,
1006 pMac->lim.gLimHeartBeatBeaconStats[0]);
1007
1008 if (arg1 != 0)
1009 {
1010 for (ind = 0; ind < MAX_NO_BEACONS_PER_HEART_BEAT_INTERVAL; ind++)
1011 pMac->lim.gLimHeartBeatBeaconStats[ind] = 0;
1012
1013 pMac->lim.gLimHBfailureCntInLinkEstState = 0;
1014 pMac->lim.gLimProbeFailureAfterHBfailedCnt = 0;
1015 pMac->lim.gLimHBfailureCntInOtherStates = 0;
1016
1017 p += log_sprintf( pMac,p, "\nReset HeartBeat Statistics\n");
1018 }
1019 return p;
1020}
1021
1022static char *
1023dump_lim_edca_params( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1024{
1025 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1026 p = limDumpEdcaParams(pMac, p);
1027 return p;
1028}
1029
1030static char *
1031dump_lim_acm_set( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1032{
1033 (void) arg3; (void) arg4;
1034 limSetEdcaBcastACMFlag(pMac, arg1 /*ac(0..3)*/, arg2 /*(acmFlag = 1 to set ACM*/);
1035 return p;
1036}
1037
1038static char *
1039dump_lim_bgscan_toggle( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1040{
1041 (void) arg2; (void) arg3; (void) arg4;
1042 pMac->lim.gLimForceBackgroundScanDisable = (arg1 == 0) ? 1 : 0;
1043 p += log_sprintf( pMac,p, "Bgnd scan is now %s\n",
1044 (pMac->lim.gLimForceBackgroundScanDisable) ? "Disabled" : "On");
1045 return p;
1046}
1047
1048static char *
1049dump_lim_linkmonitor_toggle( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1050{
1051 (void) arg2; (void) arg3; (void) arg4;
1052 pMac->sys.gSysEnableLinkMonitorMode = (arg1 == 0) ? 0 : 1;
1053 p += log_sprintf( pMac,p, "LinkMonitor mode enable = %s\n",
1054 (pMac->sys.gSysEnableLinkMonitorMode) ? "On" : "Off");
1055 return p;
1056}
1057
1058static char *
1059dump_lim_proberesp_toggle( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1060{
1061 (void) arg2; (void) arg3; (void) arg4;
1062 pMac->lim.gLimProbeRespDisableFlag = (arg1 == 0) ? 0 : 1;
1063 p += log_sprintf( pMac,p, "ProbeResponse mode disable = %s\n",
1064 (pMac->lim.gLimProbeRespDisableFlag) ? "On" : "Off");
1065 return p;
1066}
1067
1068static char *
1069dump_lim_add_sta( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1070{
1071#ifdef FIXME_GEN6
1072 tpDphHashNode pStaDs;
1073 tpPESession psessionEntry = &pMac->lim.gpSession[0]; //TBD-RAJESH HOW TO GET sessionEntry?????
1074 tSirMacAddr staMac = {0};
1075 tANI_U16 aid;
1076 if(arg2 > 5)
1077 goto addStaFail;
1078 aid = limAssignAID(pMac);
1079 pStaDs = dphGetHashEntry(pMac, aid);
1080 if(NULL == pStaDs)
1081 {
1082 staMac[5] = (tANI_U8) arg1;
1083 pStaDs = dphAddHashEntry(pMac, staMac, aid, &psessionEntry->dph.dphHashTable);
1084 if(NULL == pStaDs)
1085 goto addStaFail;
1086
1087 pStaDs->staType = STA_ENTRY_PEER;
1088 switch(arg2)
1089 {
1090 //11b station
1091 case 0:
1092 {
1093 pStaDs->mlmStaContext.htCapability = 0;
1094 pStaDs->erpEnabled = 0;
1095 p += log_sprintf( pMac,p, "11b");
1096 }
1097 break;
1098 //11g station
1099 case 1:
1100 {
1101 pStaDs->mlmStaContext.htCapability = 0;
1102 pStaDs->erpEnabled = 1;
1103 p += log_sprintf( pMac,p, "11g");
1104 }
1105 break;
1106 //ht20 station non-GF
1107 case 2:
1108 {
1109 pStaDs->mlmStaContext.htCapability = 1;
1110 pStaDs->erpEnabled = 1;
1111 pStaDs->htSupportedChannelWidthSet = 0;
1112 pStaDs->htGreenfield = 0;
1113 p += log_sprintf( pMac,p, "HT20 non-GF");
1114 }
1115 break;
1116 //ht20 station GF
1117 case 3:
1118 {
1119 pStaDs->mlmStaContext.htCapability = 1;
1120 pStaDs->erpEnabled = 1;
1121 pStaDs->htSupportedChannelWidthSet = 0;
1122 pStaDs->htGreenfield = 1;
1123 p += log_sprintf( pMac,p, "HT20 GF");
1124 }
1125 break;
1126 //ht40 station non-GF
1127 case 4:
1128 {
1129 pStaDs->mlmStaContext.htCapability = 1;
1130 pStaDs->erpEnabled = 1;
1131 pStaDs->htSupportedChannelWidthSet = 1;
1132 pStaDs->htGreenfield = 0;
1133 p += log_sprintf( pMac,p, "HT40 non-GF");
1134 }
1135 break;
1136 //ht40 station GF
1137 case 5:
1138 {
1139 pStaDs->mlmStaContext.htCapability = 1;
1140 pStaDs->erpEnabled = 1;
1141 pStaDs->htSupportedChannelWidthSet = 1;
1142 pStaDs->htGreenfield = 1;
1143 p += log_sprintf( pMac,p, "HT40 GF");
1144 }
1145 break;
1146 default:
1147 {
1148 p += log_sprintf( pMac,p, "arg2 not in range [0..3]. Station not added.\n");
1149 goto addStaFail;
1150 }
1151 break;
1152 }
1153
1154 pStaDs->added = 1;
1155 p += log_sprintf( pMac,p, " station with mac address 00:00:00:00:00:%x added.\n", (tANI_U8)arg1);
1156 limAddSta(pMac, pStaDs,psessionEntry);
1157 }
1158 else
1159 {
1160addStaFail:
1161 p += log_sprintf( pMac,p, "Could not add station\n");
1162 p += log_sprintf( pMac,p, "arg1: 6th byte of the station MAC address\n");
1163 p += log_sprintf( pMac,p, "arg2[0..5] : station type as described below\n");
1164 p += log_sprintf( pMac,p, "\t 0: 11b, 1: 11g, 2: HT20 non-GF, 3: HT20 GF, 4: HT40 non-GF, 5: HT40 GF\n");
1165 }
1166#endif
1167 return p;
1168}
1169
1170static char *
1171dump_lim_del_sta( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1172{
1173
1174 tpDphHashNode pStaDs;
1175 tLimMlmDisassocInd mlmDisassocInd;
1176 tpPESession psessionEntry;
1177 tANI_U8 reasonCode = eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON;
1178
1179 if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg2) )== NULL)
1180 {
1181 p += log_sprintf( pMac,p,"Session does not exist for given session Id \n");
1182 return p;
1183 }
1184
1185 pStaDs = dphGetHashEntry(pMac, (tANI_U16)arg1, &psessionEntry->dph.dphHashTable);
1186
1187 if(NULL == pStaDs)
1188 {
1189 p += log_sprintf( pMac,p, "Could not find station with assocId = %d\n", arg1);
1190 return p;
1191 }
1192
1193 if (pStaDs->mlmStaContext.mlmState != eLIM_MLM_LINK_ESTABLISHED_STATE)
1194 {
1195 p += log_sprintf( pMac,p, "received Disassoc frame from peer that is in state %X \n", pStaDs->mlmStaContext.mlmState);
1196 return p;
1197 }
1198
1199 pStaDs->mlmStaContext.cleanupTrigger = eLIM_PEER_ENTITY_DISASSOC;
1200 pStaDs->mlmStaContext.disassocReason = (tSirMacReasonCodes) reasonCode;
1201
1202 // Issue Disassoc Indication to SME.
1203 palCopyMemory( pMac->hHdd, (tANI_U8 *) &mlmDisassocInd.peerMacAddr,
1204 (tANI_U8 *) pStaDs->staAddr, sizeof(tSirMacAddr));
1205 mlmDisassocInd.reasonCode = reasonCode;
1206#if (WNI_POLARIS_FW_PRODUCT == AP)
1207 mlmDisassocInd.aid = pStaDs->assocId;
1208#endif
1209 mlmDisassocInd.disassocTrigger = eLIM_PEER_ENTITY_DISASSOC;
1210
1211 mlmDisassocInd.sessionId = psessionEntry->peSessionId;
1212
1213 limPostSmeMessage(pMac, LIM_MLM_DISASSOC_IND, (tANI_U32 *) &mlmDisassocInd);
1214 // Receive path cleanup
1215 limCleanupRxPath(pMac, pStaDs,psessionEntry);
1216 return p;
1217}
1218
1219
1220
1221
1222static char *
1223set_lim_prot_cfg( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1224{
1225
1226/**********************************
1227* Protection Enable
1228*
1229*LOWER byte for associated stations
1230*UPPER byte for overlapping stations.
1231*11g ==> protection from 11g
1232*11b ==> protection from 11b
1233*each byte will have the following info
1234*bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
1235*reserved reserved RIFS Lsig n-GF ht20 11g 11b
1236**********************************
1237WNI_CFG_PROTECTION_ENABLED I 4 9
1238V RW NP RESTART
1239LIM
12400 0xff 0xff
1241V RW NP RESTART
1242LIM
12430 0xffff 0xffff
1244
1245#ENUM FROM_llB 0
1246#ENUM FROM_llG 1
1247#ENUM HT_20 2
1248#ENUM NON_GF 3
1249#ENUM LSIG_TXOP 4
1250#ENUM RIFS 5
1251#ENUM OLBC_FROM_llB 8
1252#ENUM OLBC_FROM_llG 9
1253#ENUM OLBC_HT20 10
1254#ENUM OLBC_NON_GF 11
1255#ENUM OLBC_LSIG_TXOP 12
1256#ENUM OLBC_RIFS 13
1257******************************************/
1258 if(1 == arg1)
1259 dump_cfg_set(pMac, WNI_CFG_PROTECTION_ENABLED, 0xff, arg3, arg4, p);
1260 else if(2 == arg1)
1261 dump_cfg_set(pMac, WNI_CFG_PROTECTION_ENABLED, arg2 & 0xff, arg3, arg4, p);
1262 else
1263 {
1264 p += log_sprintf( pMac,p, "To set protection config:\n");
1265 p += log_sprintf( pMac,p, "arg1: operation type(1 -> set to Default 0xff, 2-> set to a arg2, else print help)\n");
1266 }
1267 return p;
1268}
1269
1270
1271static char *
1272dump_lim_set_protection_control( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1273{
1274 dump_cfg_set(pMac, WNI_CFG_FORCE_POLICY_PROTECTION, arg1, arg2, arg3, p);
1275#ifdef WLAN_SOFTAP_FEATURE
1276 limSetCfgProtection(pMac, NULL);
1277#else
1278 limSetCfgProtection(pMac);
1279#endif
1280 return p;
1281}
1282
1283
1284static char *
1285dump_lim_send_SM_Power_Mode( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1286{
1287 tSirMsgQ msg;
1288 tpSirMbMsg pMBMsg;
1289 tSirMacHTMIMOPowerSaveState state;
1290
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001291 p += log_sprintf( pMac,p, "%s: Verifying the Arguments\n", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001292 if ((arg1 > 3) || (arg1 == 2))
1293 {
1294 p += log_sprintf( pMac,p, "Invalid Argument , enter one of the valid states\n");
1295 return p;
1296 }
1297
1298 state = (tSirMacHTMIMOPowerSaveState) arg1;
1299
1300 palAllocateMemory(pMac->hHdd, (void **)&pMBMsg, WNI_CFG_MB_HDR_LEN + sizeof(tSirMacHTMIMOPowerSaveState));
1301 if(NULL == pMBMsg)
1302 {
1303 p += log_sprintf( pMac,p, "pMBMsg is NULL\n");
1304 return p;
1305 }
1306 pMBMsg->type = eWNI_PMC_SMPS_STATE_IND;
1307 pMBMsg->msgLen = (tANI_U16)(WNI_CFG_MB_HDR_LEN + sizeof(tSirMacHTMIMOPowerSaveState));
1308 palCopyMemory(pMac->hHdd, pMBMsg->data, &state, sizeof(tSirMacHTMIMOPowerSaveState));
1309
1310 msg.type = eWNI_PMC_SMPS_STATE_IND;
1311 msg.bodyptr = pMBMsg;
1312 msg.bodyval = 0;
1313
1314 if (limPostMsgApi(pMac, &msg) != TX_SUCCESS)
1315 {
1316 p += log_sprintf( pMac,p, "Updating the SMPower Request has failed \n");
1317 palFreeMemory(pMac->hHdd, pMBMsg);
1318 }
1319 else
1320 {
1321 p += log_sprintf( pMac,p, "Updating the SMPower Request is Done \n");
1322 }
1323
1324 return p;
1325}
1326
1327
1328
1329
1330static char *
1331dump_lim_addba_req( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1332{
1333tSirRetStatus status;
1334tpDphHashNode pSta;
1335 tpPESession psessionEntry = &pMac->lim.gpSession[0]; //TBD-RAJESH HOW TO GET sessionEntry?????
1336
1337
1338 (void) arg4;
1339
1340 // Get DPH Sta entry for this ASSOC ID
1341 pSta = dphGetHashEntry( pMac, (tANI_U16) arg1, &psessionEntry->dph.dphHashTable);
1342 if( NULL == pSta )
1343 {
1344 p += log_sprintf( pMac, p,
1345 "\n%s: Could not find entry in DPH table for assocId = %d\n",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001346 __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07001347 arg1 );
1348 }
1349 else
1350 {
1351 status = limPostMlmAddBAReq( pMac, pSta, (tANI_U8) arg2, (tANI_U16) arg3,psessionEntry);
1352 p += log_sprintf( pMac, p,
1353 "\n%s: Attempted to send an ADDBA Req to STA Index %d, for TID %d. Send Status = %s\n",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001354 __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07001355 pSta->staIndex,
1356 arg2,
1357 limResultCodeStr( status ));
1358 }
1359
1360 return p;
1361}
1362
1363static char *
1364dump_lim_delba_req( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1365{
1366tSirRetStatus status;
1367tpDphHashNode pSta;
1368 tpPESession psessionEntry = &pMac->lim.gpSession[0]; //TBD-RAJESH HOW TO GET sessionEntry?????
1369
1370 // Get DPH Sta entry for this ASSOC ID
1371 pSta = dphGetHashEntry( pMac, (tANI_U16) arg1, &psessionEntry->dph.dphHashTable );
1372 if( NULL == pSta )
1373 {
1374 p += log_sprintf( pMac, p,
1375 "\n%s: Could not find entry in DPH table for assocId = %d\n",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001376 __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07001377 arg1 );
1378 }
1379 else
1380 {
1381 status = limPostMlmDelBAReq( pMac, pSta, (tANI_U8) arg2, (tANI_U8) arg3, (tANI_U16) arg4 ,psessionEntry);
1382 p += log_sprintf( pMac, p,
1383 "\n%s: Attempted to send a DELBA Ind to STA Index %d, "
1384 "as the BA \"%s\" for TID %d, with Reason code %d. "
1385 "Send Status = %s\n",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001386 __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07001387 pSta->staIndex,
1388 (arg2 == 1)? "Initiator": "Recipient",
1389 arg3, // TID
1390 arg4, // Reason Code
1391 limResultCodeStr( status ));
1392 }
1393
1394 return p;
1395}
1396
1397static char *
1398dump_lim_ba_timeout( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1399{
1400
1401/* FIXME: NO HAL IN UMAC for PRIMA */
1402#if !defined( FEATURE_WLAN_INTEGRATED_SOC )
1403 // Call HAL API to trigger deletion of BA due to timeout
1404 (void)halMsg_PostBADeleteInd( pMac, (tANI_U16) arg1, (tANI_U8) arg2, (tANI_U8) arg3,
1405 HAL_BA_ERR_TIMEOUT );
1406#endif
1407
1408 p += log_sprintf( pMac, p,
1409 "\n%s: Attempted to trigger a BA Timeout Ind to STA Index %d, for TID %d, Direction %d\n",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001410 __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07001411 arg1, // STA index
1412 arg2, // TID
1413 arg3 ); // BA Direction
1414
1415 return p;
1416}
1417
1418static char *
1419dump_lim_list_active_ba( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1420{
1421tANI_U32 i;
1422tpDphHashNode pSta;
1423
1424//TBD-RAJESH HOW TO GET sessionEntry?????
1425
1426tpPESession psessionEntry = &pMac->lim.gpSession[0]; //TBD-RAJESH
1427
1428 (void) arg2; (void) arg3; (void) arg4;
1429
1430 // Get DPH Sta entry for this ASSOC ID
1431 pSta = dphGetHashEntry( pMac, (tANI_U16) arg1, &psessionEntry->dph.dphHashTable);
1432 if( NULL == pSta )
1433 {
1434 p += log_sprintf( pMac, p,
1435 "\n%s: Could not find entry in DPH table for assocId = %d\n",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001436 __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07001437 arg1 );
1438 }
1439 else
1440 {
1441 p += log_sprintf( pMac, p,
1442 "\nList of Active BA sessions for STA Index %d with Assoc ID %d\n",
1443 pSta->staIndex,
1444 arg1 );
1445
1446 p += log_sprintf( pMac, p, "TID\tRxBA\tTxBA\tRxBufferSize\tTxBufferSize\tRxBATimeout\tTxBATimeout\n");
1447 for( i = 0; i < STACFG_MAX_TC; i ++ )
1448 p += log_sprintf( pMac, p,
1449 "%d\t%d\t%d\t%d\t%d\t%d\t%d\n",
1450 i, // TID
1451 pSta->tcCfg[i].fUseBARx,
1452 pSta->tcCfg[i].fUseBATx,
1453 pSta->tcCfg[i].rxBufSize,
1454 pSta->tcCfg[i].txBufSize,
1455 pSta->tcCfg[i].tuRxBAWaitTimeout,
1456 pSta->tcCfg[i].tuTxBAWaitTimeout );
1457 }
1458
1459 return p;
1460}
1461
1462
1463static char *
1464dump_lim_AddBA_DeclineStat( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1465{
1466
1467 int Tid, Enable=(arg1 & 0x1);
1468 tANI_U8 val;
1469
1470 if (arg1 > 1) {
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001471 log_sprintf( pMac,p, "%s:Invalid Value is entered for Enable/Disable \n", __func__ );
Jeff Johnson295189b2012-06-20 16:38:30 -07001472 arg1 &= 1;
1473 }
1474
1475 val = pMac->lim.gAddBA_Declined;
1476
1477 if (arg2 > 7) {
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001478 log_sprintf( pMac,p, "%s:Invalid Value is entered for Tid \n", __func__ );
Jeff Johnson295189b2012-06-20 16:38:30 -07001479 Tid = arg2 & 0x7;
1480 } else
1481 Tid = arg2;
1482
1483
1484 if ( Enable)
1485 val |= Enable << Tid;
1486 else
1487 val &= ~(0x1 << Tid);
1488
1489 if (cfgSetInt(pMac, (tANI_U16)WNI_CFG_ADDBA_REQ_DECLINE, (tANI_U32) val) != eSIR_SUCCESS)
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001490 log_sprintf( pMac,p, "%s:Config Set for ADDBA REQ Decline has failed \n", __func__ );
Jeff Johnson295189b2012-06-20 16:38:30 -07001491
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001492 log_sprintf( pMac,p, "%s:Decline value %d is being set for TID %d ,\n \tAddBA_Decline Cfg value is %d \n", __func__ , arg1, Tid, (int) val);
Jeff Johnson295189b2012-06-20 16:38:30 -07001493
1494 return p;
1495}
1496static char *
1497dump_lim_set_dot11_mode( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1498{
1499
1500 tpPESession psessionEntry =&pMac->lim.gpSession[0]; //TBD-RAJESH HOW TO GET sessionEntry?????
1501 dump_cfg_set(pMac, WNI_CFG_DOT11_MODE, arg1, arg2, arg3, p);
1502 if ( (limGetSystemRole(psessionEntry) == eLIM_AP_ROLE) ||
1503 (limGetSystemRole(psessionEntry) == eLIM_STA_IN_IBSS_ROLE))
1504 schSetFixedBeaconFields(pMac,psessionEntry);
1505 p += log_sprintf( pMac,p, "The Dot11 Mode is set to %s", limDot11ModeStr(pMac, (tANI_U8)psessionEntry->dot11mode));
1506 return p;
1507}
1508
1509
1510static char* dump_lim_update_cb_Mode(tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1511{
1512 tANI_U32 localPwrConstraint;
Jeff Johnsone7245742012-09-05 17:12:55 -07001513 tpPESession psessionEntry = peFindSessionBySessionId(pMac, arg1);
1514
1515 if (psessionEntry == NULL)
1516 {
1517 p += log_sprintf( pMac, p, "Invalid sessionId: %d \n ", arg1);
1518 return p;
1519 }
1520
1521 if ( !psessionEntry->htCapability )
Jeff Johnson295189b2012-06-20 16:38:30 -07001522 {
1523 p += log_sprintf( pMac,p, "Error: Dot11 mode is non-HT, can not change the CB mode.\n");
1524 return p;
1525 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001526
1527 psessionEntry->htSupportedChannelWidthSet = arg2?1:0;
1528 psessionEntry->htRecommendedTxWidthSet = psessionEntry->htSupportedChannelWidthSet;
1529 psessionEntry->htSecondaryChannelOffset = arg2;
Jeff Johnson295189b2012-06-20 16:38:30 -07001530
1531 if(eSIR_SUCCESS != cfgSetInt(pMac, WNI_CFG_CHANNEL_BONDING_MODE,
Jeff Johnsone7245742012-09-05 17:12:55 -07001532 arg2 ? WNI_CFG_CHANNEL_BONDING_MODE_ENABLE : WNI_CFG_CHANNEL_BONDING_MODE_DISABLE))
Jeff Johnson295189b2012-06-20 16:38:30 -07001533 p += log_sprintf(pMac,p, "cfgSetInt failed for WNI_CFG_CHANNEL_BONDING_MODE\n");
Jeff Johnsone7245742012-09-05 17:12:55 -07001534
Jeff Johnson295189b2012-06-20 16:38:30 -07001535 wlan_cfgGetInt(pMac, WNI_CFG_LOCAL_POWER_CONSTRAINT, &localPwrConstraint);
Jeff Johnsone7245742012-09-05 17:12:55 -07001536
1537 limSendSwitchChnlParams(pMac, psessionEntry->currentOperChannel, psessionEntry->htSecondaryChannelOffset,
Jeff Johnson295189b2012-06-20 16:38:30 -07001538 (tPowerdBm) localPwrConstraint, psessionEntry->peSessionId);
1539 if ( (limGetSystemRole(psessionEntry) == eLIM_AP_ROLE) ||
1540 (limGetSystemRole(psessionEntry) == eLIM_STA_IN_IBSS_ROLE))
1541 schSetFixedBeaconFields(pMac,psessionEntry);
1542 return p;
Jeff Johnsone7245742012-09-05 17:12:55 -07001543
Jeff Johnson295189b2012-06-20 16:38:30 -07001544}
1545
1546static char* dump_lim_abort_scan(tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1547{
1548 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1549 //csrScanAbortMacScan(pMac);
1550 return p;
1551
1552}
1553
1554static char* dump_lim_start_stop_bg_scan(tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1555{
1556 (void) arg2; (void) arg3; (void) arg4;
1557
1558 if (TX_TIMER_VALID(pMac->lim.limTimers.gLimBackgroundScanTimer))
1559 {
1560 limDeactivateAndChangeTimer(pMac, eLIM_BACKGROUND_SCAN_TIMER);
1561 }
1562
1563 if(arg1 == 1)
1564 {
1565 if (tx_timer_activate(
1566 &pMac->lim.limTimers.gLimBackgroundScanTimer) != TX_SUCCESS)
1567 {
1568 pMac->lim.gLimBackgroundScanTerminate = TRUE;
1569 }
1570 else
1571 {
1572 pMac->lim.gLimBackgroundScanTerminate = FALSE;
1573 pMac->lim.gLimBackgroundScanDisable = false;
1574 pMac->lim.gLimForceBackgroundScanDisable = false;
1575 }
1576 }
1577 else
1578 {
1579 pMac->lim.gLimBackgroundScanTerminate = TRUE;
1580 pMac->lim.gLimBackgroundScanChannelId = 0;
1581 pMac->lim.gLimBackgroundScanDisable = true;
1582 pMac->lim.gLimForceBackgroundScanDisable = true;
1583 }
1584 return p;
1585
1586}
1587
1588static char*
1589dump_lim_get_pe_statistics(tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1590{
1591 eHalStatus status = eHAL_STATUS_SUCCESS;
1592 tpAniGetPEStatsReq pReq;
1593 tANI_U32 statsMask;
1594
1595 (void) arg2; (void) arg3; (void) arg4;
1596
1597
1598 switch(arg1)
1599 {
1600 case 1:
1601 statsMask = PE_SUMMARY_STATS_INFO;
1602 break;
1603 case 2:
1604 statsMask = PE_GLOBAL_CLASS_A_STATS_INFO;
1605 break;
1606 case 3:
1607 statsMask = PE_GLOBAL_CLASS_B_STATS_INFO;
1608 break;
1609 case 4:
1610 statsMask = PE_GLOBAL_CLASS_C_STATS_INFO;
1611 break;
1612 case 5:
1613 statsMask = PE_PER_STA_STATS_INFO;
1614 break;
1615 default:
1616 return p;
1617 }
1618
1619
1620 if( eHAL_STATUS_SUCCESS != (status = palAllocateMemory (pMac->hHdd, (void**) &pReq, sizeof(tAniGetPEStatsReq))))
1621 {
1622 p += log_sprintf( pMac,p, "Error: Unable to allocate memory.\n");
1623 return p;
1624 }
1625
1626 palZeroMemory( pMac, pReq, sizeof(*pReq));
1627
1628 pReq->msgType = eWNI_SME_GET_STATISTICS_REQ;
1629 pReq->statsMask = statsMask;
1630 pReq->staId = (tANI_U16)arg2;
1631
1632 pMac->lim.gLimRspReqd = eANI_BOOLEAN_TRUE;
1633 limPostSmeMessage(pMac, eWNI_SME_GET_STATISTICS_REQ, (tANI_U32 *) pReq);
1634
1635 return p;
1636
1637}
1638
1639extern char* setLOGLevel( tpAniSirGlobal pMac, char *p, tANI_U32 module, tANI_U32 level );
1640static char *
1641dump_lim_set_log_level( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1642{
1643 p = setLOGLevel(pMac, p, arg1, arg2);
1644 return p;
1645}
1646
1647static char *
1648dump_lim_update_log_level( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1649{
1650 vos_trace_setLevel( arg1, arg2 );
1651 return p;
1652}
1653
1654static char *
1655dump_lim_scan_req_send( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1656{
1657 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1658 p = sendSmeScanReq(pMac, p);
1659 return p;
1660}
1661
1662static char *
1663dump_lim_send_start_bss_req( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1664{
1665 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1666 p = sendSmeStartBssReq(pMac, p,arg1);
1667 return p;
1668}
1669
1670static char *
1671dump_lim_send_join_req( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1672{
1673 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1674 p = sendSmeJoinReq(pMac, p);
1675 return p;
1676}
1677
1678static char *
1679dump_lim_send_disassoc_req( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1680{
1681 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1682
1683 p = sendSmeDisAssocReq(pMac, p, arg1 ,arg2);
1684 return p;
1685}
1686
1687static char *
1688dump_lim_stop_bss_req( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1689{
1690 (void) arg2; (void) arg3; (void) arg4;
1691 p = sendSmeStopBssReq(pMac, p, arg1);
1692 return p;
1693}
1694
1695
1696static char *
1697dump_lim_session_print( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1698{
1699 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1700 p = printSessionInfo(pMac, p);
1701 return p;
1702}
1703
1704static char *
1705dump_lim_sme_reassoc_req( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1706{
1707 tANI_U32 sessionId = arg1;
1708 tCsrRoamModifyProfileFields modifyProfileFields;
1709 tANI_U32 roamId;
1710
1711 (void) arg2; (void) arg3; (void) arg4;
1712
1713 if( CSR_IS_SESSION_VALID( pMac, sessionId ) )
1714 {
1715 if(HAL_STATUS_SUCCESS(sme_AcquireGlobalLock( &pMac->sme )))
1716 {
1717 csrGetModifyProfileFields(pMac, sessionId, &modifyProfileFields);
1718 csrReassoc( pMac, sessionId, &modifyProfileFields, &roamId, 0);
1719 sme_ReleaseGlobalLock( &pMac->sme );
1720 }
1721 }
1722 else
1723 {
1724 p += log_sprintf( pMac,p, "Invalid session = %d\n", sessionId);
1725 }
1726
1727 return p;
1728}
1729
1730static char *
1731dump_lim_dot11h_stats( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1732{
Jeff Johnsone7245742012-09-05 17:12:55 -07001733#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001734 unsigned int i;
1735 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1736
1737 p += log_sprintf(pMac, p, "11h Enabled = %s\n", pMac->lim.gLim11hEnable? "TRUE": "FALSE");
1738
1739#if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
1740 p += log_sprintf(pMac, p, "Measurement request issued by WSM = %s\n",
1741 (pMac->lim.gpLimMeasReq != NULL)? "ISSUED": "NOT ISSUED");
1742 p += log_sprintf(pMac, p, "Measurement request details...\n");
1743 if (pMac->lim.gpLimMeasReq != NULL)
1744 {
1745 p += log_sprintf(pMac, p, "numChannels = %d, periodicMeasEnabled = %d, measIndPeriod = %d,"
1746 "shortTermPeriod = %d, averagingPeriod = %d, shortChannelScanDuration = %d,"
1747 "longChannelScanDuration = %d, SYS_TICK_DUR_MS = %d\n",
1748 pMac->lim.gpLimMeasReq->channelList.numChannels, pMac->lim.gpLimMeasReq->measControl.periodicMeasEnabled,
1749 pMac->lim.gpLimMeasReq->measIndPeriod, pMac->lim.gpLimMeasReq->measDuration.shortTermPeriod,
1750 pMac->lim.gpLimMeasReq->measDuration.averagingPeriod,
1751 pMac->lim.gpLimMeasReq->measDuration.shortChannelScanDuration,
1752 pMac->lim.gpLimMeasReq->measDuration.longChannelScanDuration, SYS_TICK_DUR_MS );
1753
1754 p += log_sprintf(pMac, p, "Measurement channels...\n");
1755 for (i = 0; i < pMac->lim.gpLimMeasReq->channelList.numChannels; i++)
1756 {
1757 p += log_sprintf(pMac, p, "%d ", pMac->lim.gpLimMeasReq->channelList.channelNumber[i]);
1758 }
1759 p += log_sprintf(pMac, p, "\n");
1760 p += log_sprintf(pMac, p, "Total Number of BSS learned = %d\n", pMac->lim.gpLimMeasData->numBssWds);
1761 p += log_sprintf(pMac, p, "Total Number of Channels learned = %d\n", pMac->lim.gpLimMeasData->numMatrixNodes);
1762 p += log_sprintf(pMac, p, "Duration of learning = %d\n", pMac->lim.gpLimMeasData->duration);
1763 p += log_sprintf(pMac, p, "Is measurement Indication timer active = %s\n",
1764 (pMac->lim.gLimMeasParams.isMeasIndTimerActive)?"YES": "NO");
1765 p += log_sprintf(pMac, p, "Next learn channel Id = %d\n", pMac->lim.gLimMeasParams.nextLearnChannelId);
1766 }
1767 p += log_sprintf(pMac, p, "Measurement running = %s\n",
1768 pMac->sys.gSysEnableLearnMode?"TRUE": "FALSE");
1769#endif
1770 p += log_sprintf(pMac, p, "Is system in learn mode = %s\n",
1771 pMac->lim.gLimSystemInScanLearnMode?"YES": "NO");
1772
1773 p += log_sprintf(pMac, p, "Quiet Enabled = %s\n", (pMac->lim.gLimSpecMgmt.fQuietEnabled)?"YES": "NO");
1774 p += log_sprintf(pMac, p, "Quiet state = %d\n", pMac->lim.gLimSpecMgmt.quietState);
1775 p += log_sprintf(pMac, p, "Quiet Count = %d\n", pMac->lim.gLimSpecMgmt.quietCount);
1776 p += log_sprintf(pMac, p, "Quiet Duration in ticks = %d\n", pMac->lim.gLimSpecMgmt.quietDuration);
1777 p += log_sprintf(pMac, p, "Quiet Duration in TU = %d\n", pMac->lim.gLimSpecMgmt.quietDuration_TU);
1778
1779 p += log_sprintf(pMac, p, "Channel switch state = %d\n", pMac->lim.gLimSpecMgmt.dot11hChanSwState);
1780 p += log_sprintf(pMac, p, "Channel switch mode = %s\n",
1781 (pMac->lim.gLimChannelSwitch.switchMode == eSIR_CHANSW_MODE_SILENT)?"SILENT": "NORMAL");
1782 p += log_sprintf(pMac, p, "Channel switch primary channel = %d\n",
1783 pMac->lim.gLimChannelSwitch.primaryChannel);
1784 p += log_sprintf(pMac, p, "Channel switch secondary sub band = %d\n",
1785 pMac->lim.gLimChannelSwitch.secondarySubBand);
1786 p += log_sprintf(pMac, p, "Channel switch switch count = %d\n",
1787 pMac->lim.gLimChannelSwitch.switchCount);
1788 p += log_sprintf(pMac, p, "Channel switch switch timeout value = %d\n",
1789 pMac->lim.gLimChannelSwitch.switchTimeoutValue);
1790
1791 p += log_sprintf(pMac, p, "Radar interrupt configured = %s\n",
1792 pMac->lim.gLimSpecMgmt.fRadarIntrConfigured?"YES": "NO");
1793 p += log_sprintf(pMac, p, "Radar detected in current operating channel = %s\n",
1794 pMac->lim.gLimSpecMgmt.fRadarDetCurOperChan?"YES": "NO");
1795 p += log_sprintf(pMac, p, "Radar detected channels...\n");
1796 for (i = 0; i < pMac->sys.radarDetectCount; i++)
1797 {
1798 p += log_sprintf(pMac, p, "%d ", pMac->sys.detRadarChIds[i]);
1799 }
1800 p += log_sprintf(pMac, p, "\n");
1801
Jeff Johnsone7245742012-09-05 17:12:55 -07001802#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001803 return p;
1804}
1805
1806static char *
1807dump_lim_enable_measurement( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1808{
1809 (void) arg2; (void) arg3; (void) arg4;
1810
1811 if (arg1)
1812 {
1813 pMac->sys.gSysEnableLearnMode = eANI_BOOLEAN_TRUE;
1814 p += log_sprintf(pMac, p, "Measurement enabled\n");
1815 }
1816 else
1817 {
1818 pMac->sys.gSysEnableLearnMode = eANI_BOOLEAN_FALSE;
1819 p += log_sprintf(pMac, p, "Measurement disabled\n");
1820 }
1821
1822 return p;
1823}
1824
1825static char *
1826dump_lim_enable_quietIE( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1827{
1828 (void) arg2; (void) arg3; (void) arg4;
Jeff Johnsone7245742012-09-05 17:12:55 -07001829#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001830 if (arg1)
1831 {
1832 pMac->lim.gLimSpecMgmt.fQuietEnabled = eANI_BOOLEAN_TRUE;
1833 p += log_sprintf(pMac, p, "QuietIE enabled\n");
1834 }
1835 else
1836 {
1837 pMac->lim.gLimSpecMgmt.fQuietEnabled = eANI_BOOLEAN_FALSE;
1838 p += log_sprintf(pMac, p, "QuietIE disabled\n");
1839 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001840#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001841
1842 return p;
1843}
1844
1845static char *
1846dump_lim_disable_enable_scan( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1847{
1848 (void) arg2; (void) arg3; (void) arg4;
1849
1850 if (arg1)
1851 {
1852 pMac->lim.fScanDisabled = 1;
1853 p += log_sprintf(pMac, p, "Scan disabled\n");
1854 }
1855 else
1856 {
1857 pMac->lim.fScanDisabled = 0;
1858 p += log_sprintf(pMac, p, "scan enabled\n");
1859 }
1860
1861 return p;
1862}
1863
1864static char *finishScan(tpAniSirGlobal pMac, char *p)
1865{
1866 tSirMsgQ msg;
1867
1868 p += log_sprintf( pMac,p, "logDump finishScan \n");
1869
1870 msg.type = SIR_LIM_MIN_CHANNEL_TIMEOUT;
1871 msg.bodyval = 0;
1872 msg.bodyptr = NULL;
1873
1874 limPostMsgApi(pMac, &msg);
1875 return p;
1876}
1877
1878
1879static char *
1880dump_lim_info( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1881{
Jeff Johnsone7245742012-09-05 17:12:55 -07001882 (void) arg2; (void) arg3; (void) arg4;
1883 p = dumpLim( pMac, p, arg1);
Jeff Johnson295189b2012-06-20 16:38:30 -07001884 return p;
1885}
1886
1887static char *
1888dump_lim_finishscan_send( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1889{
1890 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1891 p = finishScan(pMac, p);
1892 return p;
1893}
1894
1895static char *
1896dump_lim_prb_rsp_send( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1897{
1898 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1899 p = testLimSendProbeRsp( pMac, p );
1900 return p;
1901}
1902
1903static char *
1904dump_sch_beacon_trigger( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1905{
1906 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1907 p = triggerBeaconGen(pMac, p);
1908 return p;
1909}
1910
1911
1912static char* dump_lim_trace_cfg(tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1913{
1914 MTRACE(macTraceCfg(pMac, arg1, arg2, arg3, arg4);)
1915 return p;
1916}
1917
1918static char* dump_lim_trace_dump(tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1919{
1920 MTRACE(macTraceDumpAll(pMac, (tANI_U8)arg1, (tANI_U8)arg2, arg3);)
1921 return p;
1922}
1923
1924static char* dump_lim_set_scan_in_powersave( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1925{
1926 p += log_sprintf( pMac,p, "logDump set scan in powersave to %d \n", arg1);
1927 dump_cfg_set(pMac, WNI_CFG_SCAN_IN_POWERSAVE, arg1, arg2, arg3, p);
1928 return p;
1929}
1930
1931#if defined WLAN_FEATURE_VOWIFI
1932static char *
1933dump_lim_send_rrm_action( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1934{
1935 tpPESession psessionEntry;
Madan Mohan Koyyalamudi8f207c12012-10-30 18:18:38 -07001936 tSirMacRadioMeasureReport *pRRMReport =
1937 vos_mem_malloc(4*sizeof(tSirMacRadioMeasureReport));
Jeff Johnson295189b2012-06-20 16:38:30 -07001938 tANI_U8 num = (tANI_U8)(arg4 > 4 ? 4 : arg4);
1939 tANI_U8 i;
1940
Madan Mohan Koyyalamudi8f207c12012-10-30 18:18:38 -07001941 if (!pRRMReport)
1942 {
1943 p += log_sprintf(pMac, p,
1944 "Unable to allocate memory to process command\n");
1945 goto done;
1946 }
1947
Jeff Johnson295189b2012-06-20 16:38:30 -07001948 if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg2) )== NULL)
1949 {
1950 p += log_sprintf( pMac,p,"Session does not exist for given session Id \n");
Madan Mohan Koyyalamudi8f207c12012-10-30 18:18:38 -07001951 goto done;
Jeff Johnson295189b2012-06-20 16:38:30 -07001952 }
1953 switch (arg3)
1954 {
1955 case 0:
1956 /* send two reports with incapable bit set */
1957 pRRMReport[0].type = 6;
1958 pRRMReport[1].type = 7;
1959 limSendRadioMeasureReportActionFrame( pMac, 1, 2, &pRRMReport[0], psessionEntry->bssId, psessionEntry );
1960 break;
1961 case 1:
1962 for ( i = 0 ; i < num ; i++ )
1963 {
1964 pRRMReport[i].type = 5;
1965 if ( i == 3 )
1966 pRRMReport[i].refused = 1;
1967 else
1968 pRRMReport[i].refused = 0;
1969
1970 pRRMReport[i].report.beaconReport.regClass = 32;
1971 pRRMReport[i].report.beaconReport.channel = i;
1972 pRRMReport[i].report.beaconReport.measDuration = 23;
1973 pRRMReport[i].report.beaconReport.phyType = i << 4; //some value.
1974 pRRMReport[i].report.beaconReport.bcnProbeRsp = 1;
1975 pRRMReport[i].report.beaconReport.rsni = 10;
1976 pRRMReport[i].report.beaconReport.rcpi = 40;
1977
1978 pRRMReport[i].report.beaconReport.bssid[0] = 0x00;
1979 pRRMReport[i].report.beaconReport.bssid[1] = 0xAA;
1980 pRRMReport[i].report.beaconReport.bssid[2] = 0xBB;
1981 pRRMReport[i].report.beaconReport.bssid[3] = 0xCC;
1982 pRRMReport[i].report.beaconReport.bssid[4] = 0x00;
1983 pRRMReport[i].report.beaconReport.bssid[5] = 0x01 << i;
1984
1985
1986 pRRMReport[i].report.beaconReport.antennaId = 10;
1987 pRRMReport[i].report.beaconReport.parentTSF = 0x1234;
1988
1989 pRRMReport[i].report.beaconReport.numIes = i * 10;
1990 {
1991 tANI_U8 j;
1992 for( j = 0; j < pRRMReport[i].report.beaconReport.numIes ; j++ )
1993 {
1994 pRRMReport[i].report.beaconReport.Ies[j] = j + i; //Junk values.
1995 }
1996 }
1997
1998 }
1999 limSendRadioMeasureReportActionFrame( pMac, 1, num, &pRRMReport[0], psessionEntry->bssId, psessionEntry );
2000 break;
2001 case 2:
2002 //send Neighbor request.
2003 {
2004 tSirMacNeighborReportReq neighbor;
2005 neighbor.dialogToken = 2;
2006 neighbor.ssid_present = (tANI_U8) arg4;
2007 neighbor.ssid.length = 5;
2008 palCopyMemory( pMac->hHdd, neighbor.ssid.ssId, "abcde", 5);
2009
2010 limSendNeighborReportRequestFrame( pMac, &neighbor, psessionEntry->bssId, psessionEntry );
2011
2012 }
2013
2014 break;
2015 case 3:
2016 //send Link measure report.
2017 {
2018 tSirMacLinkReport link;
2019 link.dialogToken = 4;
2020 link.txPower = 34;
2021 link.rxAntenna = 2;
2022 link.txAntenna = 1;
2023 link.rcpi = 9;
2024 link.rsni = 3;
2025 limSendLinkReportActionFrame( pMac, &link, psessionEntry->bssId, psessionEntry );
2026 }
2027 break;
2028 default:
2029 break;
2030 }
Madan Mohan Koyyalamudi8f207c12012-10-30 18:18:38 -07002031
2032done:
2033 vos_mem_free(pRRMReport);
Jeff Johnson295189b2012-06-20 16:38:30 -07002034 return p;
2035}
2036
2037static char *
2038dump_lim_unpack_rrm_action( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
2039{
2040 tpPESession psessionEntry;
2041 tANI_U32 status;
2042
2043 tANI_U8 size[] = {
2044 0x2C,
2045 0x2F,
2046 0x25,
2047 0x2C,
2048 0x1C,
2049 0x05
2050 };
2051
2052 tANI_U8 pBody[][100] = {
2053 {
2054 /*Beacon Request 0*/
2055 0x05, 0x00, 0x01, 0x00, 0x00,
2056 //Measurement request IE
2057 0x26, 0x25, 0x01, 0x00,
2058 //Beacon request type
2059 0x05,
2060 //Beacon request starts here
2061 0x0C, 0x01, 0x30, 0x00, 0x14, 0x00, 0x01,
2062 //BSSID
2063 0xFF, 0xFF, 0xFF, 0xFF, 0xff, 0xFF,
2064 //SSID
2065 0x00, 0x05, 0x57, 0x69, 0x46, 0x69, 0x31,
2066 //Reporting Condition
2067 0x01, 0x02, 0x00, 0x00,
2068 //Reporting Detail
2069 0x02, 0x01, 0x1,
2070 //Request IE
2071 0x0A, 0x05, 0x00, 0x30, 0x46, 0x36, 0xDD
2072 },
2073 {
2074 /*Beacon Request 1*/
2075 0x05, 0x00, 0x01, 0x00, 0x00,
2076 //Measurement request IE
2077 0x26, 0x28, 0x01, 0x00,
2078 //Beacon request type
2079 0x05,
2080 //Beacon request starts here
2081 0x0C, 0xFF, 0x30, 0x00, 0x14, 0x00, 0x01,
2082 //BSSID
2083 0xFF, 0xFF, 0xFF, 0xFF, 0xff, 0xFF,
2084 //SSID
2085/* 0x00, 0x08, 0x35, 0x36, 0x37, 0x38, 0x39, 0x40, 0x41, 0x42, */
2086 //Reporting Condition
2087 0x01, 0x02, 0x00, 0x00,
2088 //Reporting Detail
2089 0x02, 0x01, 0x1,
2090 //Request IE
2091 0x0A, 0x05, 0x00, 0x30, 0x46, 0x36, 0xDD,
2092 //AP channel report
2093 0x33, 0x03, 0x0C, 0x01, 0x06,
2094 0x33, 0x03, 0x0C, 0x24, 0x30,
2095 },
2096 {
2097 /*Beacon Request 2*/
2098 0x05, 0x00, 0x01, 0x00, 0x00,
2099 //Measurement request IE
2100 0x26, 0x1E, 0x01, 0x00,
2101 //Beacon request type
2102 0x05,
2103 //Beacon request starts here
2104 0x0C, 0x00, 0x30, 0x00, 0x14, 0x00, 0x02,
2105 //BSSID
2106 0xFF, 0xFF, 0xFF, 0xFF, 0xff, 0xFF,
2107 //SSID
2108 0x00, 0x05, 0x57, 0x69, 0x46, 0x69, 0x31,
2109 //0x00, 0x08, 0x41, 0x53, 0x54, 0x2D, 0x57, 0x41, 0x50, 0x49,
2110 //Reporting Condition
2111 0x01, 0x02, 0x00, 0x00,
2112 //Reporting Detail
2113 0x02, 0x01, 0x0
2114 //Request IE
2115 },
2116 {
2117 /*Beacon Request 3*/
2118 0x05, 0x00, 0x01, 0x00, 0x00,
2119 //Measurement request IE
2120 0x26, 0x25, 0x01, 0x00,
2121 //Beacon request type
2122 0x05,
2123 //Beacon request starts here
2124 0x0C, 0x01, 0x30, 0x00, 0x69, 0x00, 0x00,
2125 //BSSID
2126 0xFF, 0xFF, 0xFF, 0xFF, 0xff, 0xFF,
2127 //SSID
2128 0x00, 0x05, 0x57, 0x69, 0x46, 0x69, 0x31,
2129 //Reporting Condition
2130 0x01, 0x02, 0x00, 0x00,
2131 //Reporting Detail
2132 0x02, 0x01, 0x1,
2133 //Request IE
2134 0x0A, 0x05, 0x00, 0x30, 0x46, 0x36, 0xDD
2135 },
2136 {
2137 /*Neighbor report*/
2138 0x05, 0x05, 0x01,
2139 //Measurement request IE
2140 0x34, 0x17,
2141 //BSSID
2142 0xFF, 0xFF, 0xFF, 0xFF, 0xff, 0xFF,
2143 //BSSID INFOo
2144 0xED, 0x01, 0x00, 0x00,
2145 //Reg class, channel, Phy type
2146 0x20, 0x01, 0x02,
2147 //TSF Info
2148 0x01, 0x04, 0x02, 0x00, 0x60, 0x00,
2149 //Condensed country
2150 0x02, 0x02, 0x62, 0x63
2151 },
2152 {
2153 /* Link measurement request */
2154 0x05, 0x02, 0x00,
2155 //Txpower used
2156 0x00,
2157 //Max Tx Power
2158 0x00
2159 }
2160 };
2161
2162 if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg1) )== NULL)
2163 {
2164 p += log_sprintf( pMac,p,"Session does not exist for given session Id \n");
2165 return p;
2166 }
2167 switch (arg2)
2168 {
2169 case 0:
2170 case 1:
2171 case 2:
2172 case 3:
2173 {
Madan Mohan Koyyalamudi8f207c12012-10-30 18:18:38 -07002174 tDot11fRadioMeasurementRequest *frm =
2175 vos_mem_malloc(sizeof(tDot11fRadioMeasurementRequest));
2176 if (!frm)
2177 {
2178 p += log_sprintf(pMac, p,
2179 "Unable to allocate memory to process command\n");
2180 break;
2181 }
2182 if( (status = dot11fUnpackRadioMeasurementRequest( pMac, &pBody[arg2][0], size[arg2], frm )) != 0 )
Jeff Johnson295189b2012-06-20 16:38:30 -07002183 p += log_sprintf( pMac, p, "failed to unpack.....status = %x\n", status);
2184 else
Madan Mohan Koyyalamudi8f207c12012-10-30 18:18:38 -07002185 rrmProcessRadioMeasurementRequest( pMac, psessionEntry->bssId, frm, psessionEntry );
2186 vos_mem_free(frm);
Jeff Johnson295189b2012-06-20 16:38:30 -07002187 }
2188 break;
2189 case 4:
2190 {
Madan Mohan Koyyalamudi8f207c12012-10-30 18:18:38 -07002191 tDot11fNeighborReportResponse *frm =
2192 vos_mem_malloc(sizeof(tDot11fNeighborReportResponse));
2193 if (!frm)
2194 {
2195 p += log_sprintf(pMac, p,
2196 "Unable to allocate memory to process command\n");
2197 break;
2198 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002199 pBody[arg2][2] = (tANI_U8)arg3; //Dialog Token
Madan Mohan Koyyalamudi8f207c12012-10-30 18:18:38 -07002200 if( (status = dot11fUnpackNeighborReportResponse( pMac, &pBody[arg2][0], size[arg2], frm )) != 0 )
Jeff Johnson295189b2012-06-20 16:38:30 -07002201 p += log_sprintf( pMac, p, "failed to unpack.....status = %x\n", status);
2202 else
Madan Mohan Koyyalamudi8f207c12012-10-30 18:18:38 -07002203 rrmProcessNeighborReportResponse( pMac, frm, psessionEntry );
2204 vos_mem_free(frm);
Jeff Johnson295189b2012-06-20 16:38:30 -07002205 }
2206 break;
2207 case 5:
2208 {
2209// FIXME.
2210#ifdef FEATURE_WLAN_NON_INTEGRATED_SOC
2211 tDot11fLinkMeasurementRequest frm;
2212 tHalBufDesc Bd;
2213 pBody[arg2][3] = (tANI_U8)arg3; //TxPower used
2214 pBody[arg2][4] = (tANI_U8)arg4; //Max Tx power
2215
2216 Bd.phyStats0 = 0;
2217 Bd.phyStats1 = 0;
2218 if( (status = dot11fUnpackLinkMeasurementRequest( pMac, &pBody[arg2][0], size[arg2], &frm )) != 0 )
2219 p += log_sprintf( pMac, p, "failed to unpack.....status = %x\n", status);
2220 else
2221 rrmProcessLinkMeasurementRequest( pMac, (tANI_U8*)&Bd, &frm, psessionEntry );
2222#endif
2223 }
2224 break;
2225 case 6:
2226 {
2227 tPowerdBm localConstraint = (tPowerdBm) arg3;
2228 tPowerdBm maxTxPower = cfgGetRegulatoryMaxTransmitPower( pMac, psessionEntry->currentOperChannel );
2229 maxTxPower = VOS_MIN( maxTxPower, maxTxPower-localConstraint );
2230 if( maxTxPower != psessionEntry->maxTxPower )
2231 {
2232 rrmSendSetMaxTxPowerReq( pMac, maxTxPower, psessionEntry );
2233 psessionEntry->maxTxPower = maxTxPower;
2234 }
2235 }
2236 break;
2237 default:
2238 p += log_sprintf( pMac, p, "Invalid option" );
2239 break;
2240 }
2241 return p;
2242}
2243#endif
2244
2245#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
2246#ifdef RSSI_HACK
2247/* This dump command is needed to set the RSSI values in TL while testing handoff. Handoff code was tested
2248 * using this dump command. Whatever the value gives as the first parameter will be considered as the average
2249 * RSSI by TL and invokes corresponding callback registered by the clients */
2250extern int dumpCmdRSSI;
2251static char *
2252dump_lim_set_tl_data_pkt_rssi( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
2253{
2254 dumpCmdRSSI = arg1;
2255 limLog(pMac, LOGE, FL("Setting TL data packet RSSI to %d"), dumpCmdRSSI);
2256 return p;
2257}
2258#endif
2259#endif
2260
2261#if defined WLAN_FEATURE_VOWIFI_11R
2262/* This command is used to trigger FT Preauthentication with the AP with BSSID below */
2263static char *
2264dump_lim_ft_event( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
2265{
2266 static tANI_U8 macAddr[6] = {0x00, 0xde, 0xad, 0xaf, 0xaf, 0x04};
2267 tpPESession psessionEntry;
2268 tSirMsgQ msg;
2269 tpSirFTPreAuthReq pftPreAuthReq;
2270 tANI_U16 auth_req_len = 0;
2271 tCsrRoamConnectedProfile Profile;
2272
2273 csrRoamCopyConnectProfile(pMac, arg2, &Profile);
2274
2275 if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg2) )== NULL)
2276 {
2277 p += log_sprintf( pMac,
2278 p,"Session does not exist usage: 363 <0> sessionid channel \n");
2279 return p;
2280 }
2281
2282 switch (arg1)
2283 {
2284 case 0:
2285 // Send Pre-auth event
2286 {
2287 /*----------------*/
2288 p += log_sprintf( pMac,p, "Preparing Pre Auth Req message\n");
2289 auth_req_len = sizeof(tSirFTPreAuthReq);
2290
2291 pftPreAuthReq = vos_mem_malloc(auth_req_len);
2292 if (pftPreAuthReq == NULL)
2293 {
2294 p += log_sprintf( pMac,p,"Pre auth dump: palAllocateMemory() failed \n");
2295 return p;
2296 }
2297 pftPreAuthReq->pbssDescription = vos_mem_malloc(sizeof(Profile.pBssDesc->length)+
2298 Profile.pBssDesc->length);
2299
2300 pftPreAuthReq->messageType = eWNI_SME_FT_PRE_AUTH_REQ;
2301 pftPreAuthReq->length = auth_req_len + sizeof(Profile.pBssDesc->length) +
2302 Profile.pBssDesc->length;
2303 pftPreAuthReq->preAuthchannelNum = 6;
2304
2305 palCopyMemory(pMac->hHdd, (void *) &pftPreAuthReq->currbssId,
2306 (void *)psessionEntry->bssId, 6);
2307 palCopyMemory(pMac->hHdd, (void *) &pftPreAuthReq->preAuthbssId,
2308 (void *)macAddr, 6);
2309 pftPreAuthReq->ft_ies_length = (tANI_U16)pMac->ft.ftSmeContext.auth_ft_ies_length;
2310
2311 // Also setup the mac address in sme context.
2312 palCopyMemory(pMac->hHdd, pMac->ft.ftSmeContext.preAuthbssId, macAddr, 6);
2313
2314 vos_mem_copy(pftPreAuthReq->ft_ies, pMac->ft.ftSmeContext.auth_ft_ies,
2315 pMac->ft.ftSmeContext.auth_ft_ies_length);
2316
2317 vos_mem_copy(Profile.pBssDesc->bssId, macAddr, 6);
2318
2319 p += log_sprintf( pMac,p, "\n ----- LIM Debug Information ----- \n");
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002320 p += log_sprintf( pMac, p, "%s: length = %d\n", __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07002321 (int)pMac->ft.ftSmeContext.auth_ft_ies_length);
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002322 p += log_sprintf( pMac, p, "%s: length = %02x\n", __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07002323 (int)pMac->ft.ftSmeContext.auth_ft_ies[0]);
2324 p += log_sprintf( pMac, p, "%s: Auth Req %02x %02x %02x\n",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002325 __func__, pftPreAuthReq->ft_ies[0],
Jeff Johnson295189b2012-06-20 16:38:30 -07002326 pftPreAuthReq->ft_ies[1], pftPreAuthReq->ft_ies[2]);
2327
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002328 p += log_sprintf( pMac, p, "%s: Session %02x %02x %02x\n", __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07002329 psessionEntry->bssId[0],
2330 psessionEntry->bssId[1], psessionEntry->bssId[2]);
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002331 p += log_sprintf( pMac, p, "%s: Session %02x %02x %02x %p\n", __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07002332 pftPreAuthReq->currbssId[0],
2333 pftPreAuthReq->currbssId[1],
2334 pftPreAuthReq->currbssId[2], pftPreAuthReq);
2335
2336 Profile.pBssDesc->channelId = (tANI_U8)arg3;
2337 vos_mem_copy((void *)pftPreAuthReq->pbssDescription, (void *)Profile.pBssDesc,
2338 Profile.pBssDesc->length);
2339
2340 msg.type = eWNI_SME_FT_PRE_AUTH_REQ;
2341 msg.bodyptr = pftPreAuthReq;
2342 msg.bodyval = 0;
2343
2344 p += log_sprintf( pMac, p, "limPostMsgApi(eWNI_SME_FT_PRE_AUTH_REQ) \n");
2345 limPostMsgApi(pMac, &msg);
2346 }
2347 break;
2348
2349 default:
2350 break;
2351 }
2352 return p;
2353}
2354#endif
Jeff Johnsone7245742012-09-05 17:12:55 -07002355static char *
2356dump_lim_channel_switch_announcement( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
2357{
2358 tpPESession psessionEntry;
2359 tANI_U8 nMode = arg2;
2360 tANI_U8 nNewChannel = arg3;
2361 tANI_U8 nCount = arg4;
2362 tANI_U8 peer[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
Jeff Johnson295189b2012-06-20 16:38:30 -07002363
Jeff Johnsone7245742012-09-05 17:12:55 -07002364 if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg1) )== NULL)
2365 {
2366 p += log_sprintf( pMac,
2367 p,"Session does not exist usage: 363 <0> sessionid channel \n");
2368 printk("Session Not found!!!!\n");
2369 return p;
2370 }
2371
2372 limSendChannelSwitchMgmtFrame( pMac, peer, nMode, nNewChannel, nCount, psessionEntry );
2373
2374 psessionEntry->gLimChannelSwitch.switchCount = nCount;
2375 psessionEntry->gLimSpecMgmt.dot11hChanSwState = eLIM_11H_CHANSW_RUNNING;
2376 psessionEntry->gLimChannelSwitch.switchMode = nMode;
2377 psessionEntry->gLimChannelSwitch.primaryChannel = nNewChannel;
2378
2379 schSetFixedBeaconFields(pMac, psessionEntry);
2380 limSendBeaconInd(pMac, psessionEntry);
2381
2382 return p;
2383}
2384
Mohit Khanna4a70d262012-09-11 16:30:12 -07002385#ifdef WLAN_FEATURE_11AC
2386static char *
2387dump_lim_vht_opmode_notification(tpAniSirGlobal pMac, tANI_U32 arg1,tANI_U32 arg2,tANI_U32 arg3, tANI_U32 arg4, char *p)
2388{
2389 tANI_U8 peer[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
2390 tANI_U8 nMode = arg2;
2391 tpPESession psessionEntry;
2392
2393 if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg1) )== NULL)
2394 {
2395 p += log_sprintf( pMac,
2396 p,"Session does not exist usage: 366 <0> sessionid channel \n");
2397 return p;
2398 }
2399
2400 limSendVHTOpmodeNotificationFrame(pMac, peer, nMode,psessionEntry);
2401
2402 psessionEntry->gLimOperatingMode.present = 1;
2403 psessionEntry->gLimOperatingMode.chanWidth = nMode;
2404 psessionEntry->gLimOperatingMode.rxNSS = 0;
2405 psessionEntry->gLimOperatingMode.rxNSSType = 0;
2406
2407 schSetFixedBeaconFields(pMac, psessionEntry);
2408 limSendBeaconInd(pMac, psessionEntry);
2409
2410 return p;
2411}
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -07002412
2413static char *
2414dump_lim_vht_channel_switch_notification(tpAniSirGlobal pMac, tANI_U32 arg1,tANI_U32 arg2,tANI_U32 arg3, tANI_U32 arg4, char *p)
2415{
2416 tpPESession psessionEntry;
2417 tANI_U8 nChanWidth = arg2;
2418 tANI_U8 nNewChannel = arg3;
2419 tANI_U8 ncbMode = arg4;
2420 tANI_U8 peer[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
2421
2422 if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg1) )== NULL)
2423 {
2424 p += log_sprintf( pMac,
2425 p,"Session does not exist usage: 367 <0> sessionid channel \n");
2426 printk("Session Not found!!!!\n");
2427 return p;
2428 }
2429
2430 limSendVHTChannelSwitchMgmtFrame( pMac, peer, nChanWidth, nNewChannel, (ncbMode+1), psessionEntry );
2431
2432 psessionEntry->gLimChannelSwitch.switchCount = 0;
2433 psessionEntry->gLimSpecMgmt.dot11hChanSwState = eLIM_11H_CHANSW_RUNNING;
2434 psessionEntry->gLimChannelSwitch.switchMode = 1;
2435 psessionEntry->gLimChannelSwitch.primaryChannel = nNewChannel;
2436 psessionEntry->gLimWiderBWChannelSwitch.newChanWidth = nChanWidth;
2437 psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq0 = limGetCenterChannel(pMac,nNewChannel,(ncbMode+1),nChanWidth);
2438 psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq1 = 0;
2439
2440 schSetFixedBeaconFields(pMac, psessionEntry);
2441 limSendBeaconInd(pMac, psessionEntry);
2442
2443 return p;
2444}
2445
Mohit Khanna4a70d262012-09-11 16:30:12 -07002446#endif
Jeff Johnsone7245742012-09-05 17:12:55 -07002447static char *
2448dump_lim_cancel_channel_switch_announcement( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
2449{
2450 tpPESession psessionEntry;
2451
2452 if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg1) )== NULL)
2453 {
2454 p += log_sprintf( pMac,
2455 p,"Session does not exist usage: 363 <0> sessionid channel \n");
2456 printk("Session Not found!!!!\n");
2457 return p;
2458 }
2459 psessionEntry->gLimChannelSwitch.switchCount = 0;
2460 psessionEntry->gLimSpecMgmt.dot11hChanSwState = eLIM_11H_CHANSW_INIT;
2461 psessionEntry->gLimChannelSwitch.switchMode = 0;
2462 psessionEntry->gLimChannelSwitch.primaryChannel = 0;
2463
2464 schSetFixedBeaconFields(pMac, psessionEntry);
2465 limSendBeaconInd(pMac, psessionEntry);
2466
2467 return p;
2468}
Jeff Johnson295189b2012-06-20 16:38:30 -07002469static tDumpFuncEntry limMenuDumpTable[] = {
2470 {0, "PE (300-499)", NULL},
Jeff Johnsone7245742012-09-05 17:12:55 -07002471 {300, "LIM: Dump state(s)/statistics <session id>", dump_lim_info},
Jeff Johnson295189b2012-06-20 16:38:30 -07002472 {301, "PE.LIM: dump TSPEC Table", dump_lim_tspec_table},
2473 {302, "PE.LIM: dump specified TSPEC entry (id)", dump_lim_tspec_entry},
2474 {303, "PE.LIM: dump EDCA params", dump_lim_edca_params},
2475 {304, "PE.LIM: dump DPH table summary", dump_lim_dph_table_summary},
2476 {305, "PE.LIM: dump link monitor stats", dump_lim_link_monitor_stats},
2477 {306, "PE.LIM:dump Set the BAR Decline stat(arg1= 1/0 (enable/disable) arg2 =TID", dump_lim_AddBA_DeclineStat},
2478 {307, "PE: LIM: dump CSR Send ReAssocReq", dump_lim_sme_reassoc_req},
2479 {308, "PE:LIM: dump all 11H related data", dump_lim_dot11h_stats},
2480 {309, "PE:LIM: dump to enable Measurement on AP", dump_lim_enable_measurement},
2481 {310, "PE:LIM: dump to enable QuietIE on AP", dump_lim_enable_quietIE},
2482 {311, "PE:LIM: disable/enable scan 1(disable)", dump_lim_disable_enable_scan},
2483 {320, "PE.LIM: send sme scan request", dump_lim_scan_req_send},
2484
2485
2486 /*FIXME_GEN6*/
2487 /* This dump command is more of generic dump cmd and hence it should
2488 * be moved to logDump.c
2489 */
2490 {321, "PE:LIM: Set Log Level <VOS Module> <VOS Log Level>", dump_lim_update_log_level},
2491 {322, "PE.LIM: Enable/Disable PE Tracing", dump_lim_trace_cfg},
2492 {323, "PE.LIM: Trace Dump if enabled", dump_lim_trace_dump},
2493 {331, "PE.LIM: Send finish scan to LIM", dump_lim_finishscan_send},
2494 {332, "PE.LIM: force probe rsp send from LIM", dump_lim_prb_rsp_send},
2495 {333, "PE.SCH: Trigger to generate a beacon", dump_sch_beacon_trigger},
2496 {335, "PE.LIM: set ACM flag (0..3)", dump_lim_acm_set},
2497 {336, "PE.LIM: Send an ADDBA Req to peer MAC arg1=aid,arg2=tid, arg3=ssn", dump_lim_addba_req},
2498 {337, "PE.LIM: Send a DELBA Ind to peer MAC arg1=aid,arg2=recipient(0)/initiator(1),arg3=tid,arg4=reasonCode", dump_lim_delba_req},
2499 {338, "PE.LIM: Trigger a BA timeout for STA index", dump_lim_ba_timeout},
2500 {339, "PE.LIM: List active BA session(s) for AssocID", dump_lim_list_active_ba},
2501 {340, "PE.LIM: Set background scan flag (0-disable, 1-enable)",dump_lim_bgscan_toggle},
2502 {341, "PE.LIM: Set link monitoring mode", dump_lim_linkmonitor_toggle},
2503 {342, "PE.LIM: AddSta <6th byte of station Mac>", dump_lim_add_sta},
2504 {343, "PE.LIM: DelSta <aid>", dump_lim_del_sta},
2505 {344, "PE.LIM: Set probe respond flag", dump_lim_proberesp_toggle},
2506 {345, "PE.LIM: set protection config bitmap", set_lim_prot_cfg},
2507 {346, "PE:LIM: Set the Dot11 Mode", dump_lim_set_dot11_mode},
2508 {347, "PE:Enable or Disable Protection", dump_lim_set_protection_control},
2509 {348, "PE:LIM: Send SM Power Mode Action frame", dump_lim_send_SM_Power_Mode},
Jeff Johnsone7245742012-09-05 17:12:55 -07002510 {349, "PE: LIM: Change CB Mode <session id> <sec chnl offset>",dump_lim_update_cb_Mode},
Jeff Johnson295189b2012-06-20 16:38:30 -07002511 {350, "PE: LIM: abort scan", dump_lim_abort_scan},
2512 {351, "PE: LIM: Start stop BG scan", dump_lim_start_stop_bg_scan},
2513 {352, "PE: LIM: PE statistics <scanmask>", dump_lim_get_pe_statistics},
2514 {353, "PE: LIM: Set MAC log level <Mac Module ID> <Log Level>", dump_lim_set_log_level},
2515 {354, "PE: LIM: Set Scan in Power Save <0-disable, 1-enable>", dump_lim_set_scan_in_powersave},
2516 {355, "PE.LIM: send sme start BSS request", dump_lim_send_start_bss_req},
2517 {356, "PE.LIM: dump pesession info ", dump_lim_session_print},
2518 {357, "PE.LIM: send DisAssocRequest", dump_lim_send_disassoc_req},
2519 {358, "PE.LIM: send sme stop bss request <session ID>", dump_lim_stop_bss_req},
2520 {359, "PE.LIM: send sme join request", dump_lim_send_join_req},
2521#if defined WLAN_FEATURE_VOWIFI
2522 {360, "PE.LIM: send an RRM action frame", dump_lim_send_rrm_action},
2523 {361, "PE.LIM: unpack an RRM action frame", dump_lim_unpack_rrm_action},
2524#endif
2525#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
2526#ifdef RSSI_HACK
2527 {362, "TL Set current RSSI", dump_lim_set_tl_data_pkt_rssi},
2528#endif
2529#endif
2530#ifdef WLAN_FEATURE_VOWIFI_11R
2531 {363, "PE.LIM: trigger pre auth/reassoc event", dump_lim_ft_event},
2532#endif
Jeff Johnsone7245742012-09-05 17:12:55 -07002533 {364, "PE.LIM: Send a channel switch announcement", dump_lim_channel_switch_announcement},
2534 {365, "PE.LIM: Cancel channel switch announcement", dump_lim_cancel_channel_switch_announcement},
Mohit Khanna4a70d262012-09-11 16:30:12 -07002535#ifdef WLAN_FEATURE_11AC
2536 {366, "PE.LIM: Send a VHT OPMode Action Frame", dump_lim_vht_opmode_notification},
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -07002537 {367, "PE.LIM: Send a VHT Channel Switch Announcement", dump_lim_vht_channel_switch_notification},
Mohit Khanna4a70d262012-09-11 16:30:12 -07002538#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002539};
2540
2541
2542
2543void limDumpInit(tpAniSirGlobal pMac)
2544{
2545 logDumpRegisterTable( pMac, &limMenuDumpTable[0],
2546 sizeof(limMenuDumpTable)/sizeof(limMenuDumpTable[0]) );
2547}
2548
2549
2550#endif //#if defined(ANI_LOGDUMP)
2551