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