blob: 3392a09f99c0e0885fd878e161d3e78ecbc402b6 [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
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530376 pScanReq = vos_mem_malloc(sizeof(tSirSmeScanReq));
377 if (NULL == pScanReq)
Jeff Johnson295189b2012-06-20 16:38:30 -0700378 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530379 p += log_sprintf( pMac,p,"sendSmeScanReq: AllocateMemory() failed \n");
Jeff Johnson295189b2012-06-20 16:38:30 -0700380 return p;
381 }
382
383 pScanReq->messageType = eWNI_SME_SCAN_REQ;
384 pScanReq->minChannelTime = 30;
385 pScanReq->maxChannelTime = 130;
386 pScanReq->bssType = eSIR_INFRASTRUCTURE_MODE;
387 limGetMyMacAddr(pMac, pScanReq->bssId);
388 pScanReq->numSsid = 1;
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530389 vos_mem_copy((void *) &pScanReq->ssId[0].ssId, (void *)"Ivan", 4);
Jeff Johnson295189b2012-06-20 16:38:30 -0700390 pScanReq->ssId[0].length = 4;
391 pScanReq->scanType = eSIR_ACTIVE_SCAN;
392 pScanReq->returnAfterFirstMatch = 0;
393 pScanReq->returnUniqueResults = 0;
394 pScanReq->returnFreshResults = SIR_BG_SCAN_PURGE_RESUTLS|SIR_BG_SCAN_RETURN_FRESH_RESULTS;
395 pScanReq->channelList.numChannels = 1;
396 pScanReq->channelList.channelNumber[0] = 6;
397 pScanReq->uIEFieldLen = 0;
398 pScanReq->uIEFieldOffset = sizeof(tSirSmeScanReq);
399 pScanReq->sessionId = 0;
400
401 msg.type = eWNI_SME_SCAN_REQ;
402 msg.bodyptr = pScanReq;
403 msg.bodyval = 0;
404 p += log_sprintf( pMac,p, "sendSmeScanReq: limPostMsgApi(eWNI_SME_SCAN_REQ) \n");
405 limPostMsgApi(pMac, &msg);
406
407 return p;
408}
409
410static char *sendSmeDisAssocReq(tpAniSirGlobal pMac, char *p,tANI_U32 arg1 ,tANI_U32 arg2)
411{
412
413 tpDphHashNode pStaDs;
414 tSirMsgQ msg;
415 tSirSmeDisassocReq *pDisAssocReq;
416 tpPESession psessionEntry;
417
418 //arg1 - assocId
419 //arg2 - sessionId
420 if( arg1 < 1 )
421 {
422 p += log_sprintf( pMac,p,"Invalid session OR Assoc ID \n");
423 return p;
424 }
425
426 if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg2) )== NULL)
427 {
428 p += log_sprintf( pMac,p,"Session does not exist for given session Id \n");
429 return p;
430 }
431
432 pStaDs = dphGetHashEntry(pMac, (tANI_U16)arg1, &psessionEntry->dph.dphHashTable);
433
434 if(NULL == pStaDs)
435 {
436 p += log_sprintf( pMac,p, "Could not find station with assocId = %d\n", arg1);
437 return p;
438 }
439
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530440 pDisAssocReq = vos_mem_malloc(sizeof(tSirSmeDisassocReq));
441 if (NULL == pDisAssocReq)
Jeff Johnson295189b2012-06-20 16:38:30 -0700442 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530443 p += log_sprintf( pMac,p,"sendSmeDisAssocReq: AllocateMemory() failed \n");
Jeff Johnson295189b2012-06-20 16:38:30 -0700444 return p;
445 }
446
447 if( ( (psessionEntry->limSystemRole == eLIM_STA_ROLE) ||
448 (psessionEntry ->limSystemRole == eLIM_BT_AMP_STA_ROLE) ) &&
449 (psessionEntry->statypeForBss == STA_ENTRY_PEER))
450 {
451 sirCopyMacAddr(pDisAssocReq->bssId,psessionEntry->bssId);
452 sirCopyMacAddr(pDisAssocReq->peerMacAddr,psessionEntry->bssId);
453 }
454 if((psessionEntry->limSystemRole == eLIM_BT_AMP_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700455 || (psessionEntry->limSystemRole == eLIM_AP_ROLE)
Jeff Johnson295189b2012-06-20 16:38:30 -0700456 )
457 {
458 sirCopyMacAddr(pDisAssocReq->peerMacAddr,pStaDs->staAddr);
459 sirCopyMacAddr(pDisAssocReq->bssId,psessionEntry->bssId);
460 }
461
462 pDisAssocReq->messageType = eWNI_SME_DISASSOC_REQ;
463
464 pDisAssocReq->length = sizeof(tSirSmeDisassocReq);
465
466 pDisAssocReq->reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
467
468 pDisAssocReq->sessionId = 0;
469
470 pDisAssocReq->transactionId = 0;
471
472 msg.type = eWNI_SME_DISASSOC_REQ;
473 msg.bodyptr = pDisAssocReq;
474 msg.bodyval = 0;
475
476 p += log_sprintf( pMac,p, "sendSmeDisAssocReq: limPostMsgApi(eWNI_SME_DISASSOC_REQ) \n");
477 limPostMsgApi(pMac, &msg);
478
479 return p;
480}
481
482
483static char *sendSmeStartBssReq(tpAniSirGlobal pMac, char *p,tANI_U32 arg1)
484{
485 tSirMsgQ msg;
486 tSirSmeStartBssReq *pStartBssReq;
487 unsigned char *pBuf;
Jeff Johnsone7245742012-09-05 17:12:55 -0700488 ePhyChanBondState cbMode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700489 tSirNwType nwType;
490
491 p += log_sprintf( pMac,p, "sendSmeStartBssReq: Preparing eWNI_SME_START_BSS_REQ message\n");
492
493 if(arg1 > 2)
494 {
495 p += log_sprintf( pMac,p,"Invalid Argument1 \n");
496 return p;
497 }
498
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530499 pStartBssReq = vos_mem_malloc(sizeof(tSirSmeStartBssReq));
500 if (NULL == pStartBssReq)
Jeff Johnson295189b2012-06-20 16:38:30 -0700501 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530502 p += log_sprintf( pMac,p,"sendSmeStartBssReq: AllocateMemory() failed \n");
Jeff Johnson295189b2012-06-20 16:38:30 -0700503 return p;
504 }
505
506 pStartBssReq->messageType = eWNI_SME_START_BSS_REQ;
507 pStartBssReq->length = 29; // 0x1d
508
509 if(arg1 == 0) //BTAMP STATION
510 {
511 pStartBssReq->bssType = eSIR_BTAMP_STA_MODE;
512
513 pStartBssReq->ssId.length = 5;
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530514 vos_mem_copy((void *) &pStartBssReq->ssId.ssId, (void *)"BTSTA", 5);
Jeff Johnson295189b2012-06-20 16:38:30 -0700515 }
516 else if(arg1 == 1) //BTAMP AP
517 {
518 pStartBssReq->bssType = eSIR_BTAMP_AP_MODE;
519 pStartBssReq->ssId.length = 4;
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530520 vos_mem_copy((void *) &pStartBssReq->ssId.ssId, (void *)"BTAP", 4);
Jeff Johnson295189b2012-06-20 16:38:30 -0700521 }
522 else //IBSS
523 {
524 pStartBssReq->bssType = eSIR_IBSS_MODE;
525 pStartBssReq->ssId.length = 4;
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530526 vos_mem_copy((void *) &pStartBssReq->ssId.ssId, (void *)"Ibss", 4);
Jeff Johnson295189b2012-06-20 16:38:30 -0700527 }
528
529 // Filling in channel ID 6
530 pBuf = &(pStartBssReq->ssId.ssId[pStartBssReq->ssId.length]);
531 *pBuf = 6;
532 pBuf++;
533
534 // Filling in CB mode
Jeff Johnsone7245742012-09-05 17:12:55 -0700535 cbMode = PHY_SINGLE_CHANNEL_CENTERED;
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530536 vos_mem_copy(pBuf, (tANI_U8 *)&cbMode, sizeof(ePhyChanBondState));
Jeff Johnsone7245742012-09-05 17:12:55 -0700537 pBuf += sizeof(ePhyChanBondState);
Jeff Johnson295189b2012-06-20 16:38:30 -0700538
539 // Filling in RSN IE Length to zero
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530540 vos_mem_set(pBuf, sizeof(tANI_U16), 0); //tSirRSNie->length
Jeff Johnson295189b2012-06-20 16:38:30 -0700541 pBuf += sizeof(tANI_U16);
542
543 // Filling in NW Type
544 nwType = eSIR_11G_NW_TYPE;
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530545 vos_mem_copy(pBuf, (tANI_U8 *)&nwType, sizeof(tSirNwType));
Jeff Johnson295189b2012-06-20 16:38:30 -0700546 pBuf += sizeof(tSirNwType);
547
548 /* ---- To be filled by LIM later ----
549 pStartBssReq->operationalRateSet
550 pStartBssReq->extendedRateSet
551 pStartBssReq->dot11mode
552 pStartBssReq->bssId
553 pStartBssReq->selfMacAddr
554 pStartBssReq->beaconInterval
555 pStartBssReq->sessionId = 0;
556 pStartBssReq->transactionId = 0;
557 * ------------------------------------ */
558
559 msg.type = eWNI_SME_START_BSS_REQ;
560 msg.bodyptr = pStartBssReq;
561 msg.bodyval = 0;
562 p += log_sprintf( pMac,p, "sendSmeStartBssReq: limPostMsgApi(eWNI_SME_START_BSS_REQ) \n");
563 limPostMsgApi(pMac, &msg);
564
565 return p;
566}
567
568static char *sendSmeStopBssReq(tpAniSirGlobal pMac, char *p, tANI_U32 sessionId)
569{
570 tSirMsgQ msg;
571 tSirSmeStopBssReq stopBssReq, *pStopBssReq;
572 tANI_U16 msgLen = 0;
573 tpPESession psessionEntry;
574
575 psessionEntry = peFindSessionBySessionId(pMac, (tANI_U8)sessionId);
576 if ( psessionEntry == NULL )
577 {
578 limLog(pMac, LOGP, FL("Session entry does not exist for given sessionID \n"));
579 return p;
580 }
581
582 p += log_sprintf( pMac,p, "sendSmeStopBssReq: Preparing eWNI_SME_STOP_BSS_REQ message\n");
583 pStopBssReq = (tSirSmeStopBssReq *) &stopBssReq;
584
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530585 pStopBssReq = vos_mem_malloc(sizeof(tSirSmeStopBssReq));
586 if (NULL == pStopBssReq)
Jeff Johnson295189b2012-06-20 16:38:30 -0700587 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530588 p += log_sprintf( pMac,p,"sendSmeStopBssReq: AllocateMemory() failed \n");
Jeff Johnson295189b2012-06-20 16:38:30 -0700589 return p;
590 }
591
592 pStopBssReq->messageType = eWNI_SME_STOP_BSS_REQ;
593 msgLen += sizeof(tANI_U32); // msgType + length
594
595 pStopBssReq->reasonCode = eSIR_SME_SUCCESS;
596 msgLen += sizeof(tSirResultCodes);
597
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530598 vos_mem_copy((void *) &pStopBssReq->bssId, (void *)psessionEntry->bssId, 6);
Jeff Johnson295189b2012-06-20 16:38:30 -0700599 msgLen += sizeof(tSirMacAddr);
600
601 pStopBssReq->sessionId = (tANI_U8)sessionId;
602 msgLen += sizeof(tANI_U8);
603
604 pStopBssReq->transactionId = 0;
605 msgLen += sizeof(tANI_U16);
606
607 pStopBssReq->length = msgLen;
608
609 msg.type = eWNI_SME_STOP_BSS_REQ;
610 msg.bodyptr = pStopBssReq;
611 msg.bodyval = 0;
612 p += log_sprintf( pMac,p, "sendSmeStopBssReq: limPostMsgApi(eWNI_SME_STOP_BSS_REQ) \n");
613 limPostMsgApi(pMac, &msg);
614
615 return p;
616}
617
618static char *sendSmeJoinReq(tpAniSirGlobal pMac, char *p)
619{
620 tSirMsgQ msg;
621 tSirSmeJoinReq *pJoinReq;
622 unsigned char *pBuf;
623 tANI_U16 msgLen = 307;
624
625 tANI_U8 msgDump[307] = {
626 0x06, 0x12, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
627 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00,
628 0xDE, 0xAD, 0xBA, 0xEF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
629 0x00, 0x00, 0x00, 0x64, 0x00, 0x21, 0x04, 0x02, 0x00, 0x00,
630 0x00, 0x01, 0x1E, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x18,
631 0x00, 0x00, 0x00, 0xA8, 0x85, 0x4F, 0x7A, 0x00, 0x06, 0x41,
632 0x6E, 0x69, 0x4E, 0x65, 0x74, 0x01, 0x04, 0x82, 0x84, 0x8B,
633 0x96, 0x03, 0x01, 0x06, 0x07, 0x06, 0x55, 0x53, 0x49, 0x01,
634 0x0E, 0x1E, 0x2A, 0x01, 0x00, 0x32, 0x08, 0x0C, 0x12, 0x18,
635 0x24, 0x30, 0x48, 0x60, 0x6C, 0x2D, 0x1A, 0xEE, 0x11, 0x03,
636 0xFF, 0xFF, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
637 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
638 0x00, 0x00, 0x00, 0x3D, 0x16, 0x06, 0x07, 0x11, 0x00, 0x00,
639 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
640 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDD, 0x18, 0x00,
641 0x50, 0xF2, 0x02, 0x01, 0x01, 0x01, 0x00, 0x03, 0xA4, 0x00,
642 0x00, 0x27, 0xA4, 0x00, 0x00, 0x42, 0x43, 0x5E, 0x00, 0x62,
643 0x32, 0x2F, 0x00, 0xDD, 0x14, 0x00, 0x0A, 0xF5, 0x00, 0x03,
644 0x01, 0x03, 0x05, 0x0A, 0x02, 0x80, 0xC0, 0x12, 0x06, 0xFF,
645 0xFF, 0xFF, 0xFF, 0xB6, 0x0D, 0xDD, 0x6E, 0x00, 0x50, 0xF2,
646 0x04, 0x10, 0x4A, 0x00, 0x01, 0x10, 0x10, 0x44, 0x00, 0x01,
647 0x01, 0x10, 0x3B, 0x00, 0x01, 0x03, 0x10, 0x47, 0x00, 0x10,
648 0xDB, 0xC6, 0x77, 0x28, 0xB9, 0xF3, 0xD8, 0x58, 0x86, 0xFF,
649 0xFC, 0x6B, 0xB6, 0xB9, 0x27, 0x79, 0x10, 0x21, 0x00, 0x08,
650 0x51, 0x75, 0x61, 0x6C, 0x63, 0x6F, 0x6D, 0x6D, 0x10, 0x23,
651 0x00, 0x07, 0x57, 0x46, 0x52, 0x34, 0x30, 0x33, 0x31, 0x10,
652 0x24, 0x00, 0x06, 0x4D, 0x4E, 0x31, 0x32, 0x33, 0x34, 0x10,
653 0x42, 0x00, 0x06, 0x53, 0x4E, 0x31, 0x32, 0x33, 0x34, 0x10,
654 0x54, 0x00, 0x08, 0x00, 0x06, 0x00, 0x50, 0xF2, 0x04, 0x00,
655 0x01, 0x10, 0x11, 0x00, 0x06, 0x31, 0x31, 0x6E, 0x2D, 0x41,
656 0x50, 0x10, 0x08, 0x00, 0x02, 0x01, 0x8E
657 };
658
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530659 pJoinReq = vos_mem_malloc(msgLen);
660 if (NULL == pJoinReq)
Jeff Johnson295189b2012-06-20 16:38:30 -0700661 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530662 p += log_sprintf( pMac,p,"sendSmeJoinReq: AllocateMemory() failed \n");
Jeff Johnson295189b2012-06-20 16:38:30 -0700663 return p;
664 }
665
666 pBuf = (unsigned char *)pJoinReq;
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +0530667 vos_mem_copy(pBuf, (tANI_U8 *)msgDump, msgLen);
Jeff Johnson295189b2012-06-20 16:38:30 -0700668
669 msg.type = eWNI_SME_JOIN_REQ;
670 msg.bodyptr = pJoinReq;
671 msg.bodyval = 0;
672 limPostMsgApi(pMac, &msg);
673
674 return p;
675}
676
677
678static char *printSessionInfo(tpAniSirGlobal pMac, char *p)
679{
680 tpPESession psessionEntry = &pMac->lim.gpSession[0];
681 tANI_U8 i;
682
683 p += log_sprintf( pMac, p, "Dump PE Session \n");
684
685 for(i=0; i < pMac->lim.maxBssId; i++)
686 {
687 if( pMac->lim.gpSession[i].valid )
688 {
689 psessionEntry = &pMac->lim.gpSession[i];
690 p += log_sprintf( pMac,p, "*****************************************\n");
691 p += log_sprintf( pMac,p, " PE Session [%d] \n", i);
692 p += log_sprintf( pMac,p, "available: %d \n", psessionEntry->available);
693 p += log_sprintf( pMac,p, "peSessionId: %d, smeSessionId: %d, transactionId: %d \n",
694 psessionEntry->peSessionId, psessionEntry->smeSessionId, psessionEntry->smeSessionId);
695 p += log_sprintf( pMac,p, "bssId: %02X:%02X:%02X:%02X:%02X:%02X \n",
696 psessionEntry->bssId[0], psessionEntry->bssId[1], psessionEntry->bssId[2],
697 psessionEntry->bssId[3], psessionEntry->bssId[4], psessionEntry->bssId[5]);
698 p += log_sprintf( pMac,p, "selfMacAddr: %02X:%02X:%02X:%02X:%02X:%02X \n",
699 psessionEntry->selfMacAddr[0], psessionEntry->selfMacAddr[1], psessionEntry->selfMacAddr[2],
700 psessionEntry->selfMacAddr[3], psessionEntry->selfMacAddr[4], psessionEntry->selfMacAddr[5]);
701 p += log_sprintf( pMac,p, "bssIdx: %d \n", psessionEntry->bssIdx);
702 p += log_sprintf( pMac,p, "valid: %d \n", psessionEntry->valid);
703 p += log_sprintf( pMac,p, "limMlmState: (%d) %s ", psessionEntry->limMlmState, limMlmStateStr(psessionEntry->limMlmState) );
704 p += log_sprintf( pMac,p, "limPrevMlmState: (%d) %s ", psessionEntry->limPrevMlmState, limMlmStateStr(psessionEntry->limMlmState) );
705 p += log_sprintf( pMac,p, "limSmeState: (%d) %s ", psessionEntry->limSmeState, limSmeStateStr(psessionEntry->limSmeState) );
706 p += log_sprintf( pMac,p, "limPrevSmeState: (%d) %s ", psessionEntry->limPrevSmeState, limSmeStateStr(psessionEntry->limPrevSmeState) );
707 p += log_sprintf( pMac,p, "limSystemRole: (%d) %s \n", psessionEntry->limSystemRole, getRole(psessionEntry->limSystemRole) );
708 p += log_sprintf( pMac,p, "bssType: (%d) %s \n", psessionEntry->bssType, limBssTypeStr(psessionEntry->bssType));
709 p += log_sprintf( pMac,p, "operMode: %d \n", psessionEntry->operMode);
710 p += log_sprintf( pMac,p, "dot11mode: %d \n", psessionEntry->dot11mode);
Jeff Johnsone7245742012-09-05 17:12:55 -0700711 p += log_sprintf( pMac,p, "htCapability: %d \n", psessionEntry->htCapability);
Jeff Johnson295189b2012-06-20 16:38:30 -0700712 p += log_sprintf( pMac,p, "limRFBand: %d \n", psessionEntry->limRFBand);
713 p += log_sprintf( pMac,p, "limIbssActive: %d \n", psessionEntry->limIbssActive);
714 p += log_sprintf( pMac,p, "limCurrentAuthType: %d \n", psessionEntry->limCurrentAuthType);
715 p += log_sprintf( pMac,p, "limCurrentBssCaps: %d \n", psessionEntry->limCurrentBssCaps);
716 p += log_sprintf( pMac,p, "limCurrentBssQosCaps: %d \n", psessionEntry->limCurrentBssQosCaps);
717 p += log_sprintf( pMac,p, "limCurrentBssPropCap: %d \n", psessionEntry->limCurrentBssPropCap);
718 p += log_sprintf( pMac,p, "limSentCapsChangeNtf: %d \n", psessionEntry->limSentCapsChangeNtf);
719 p += log_sprintf( pMac,p, "LimAID: %d \n", psessionEntry->limAID);
720 p += log_sprintf( pMac,p, "ReassocbssId: %02X:%02X:%02X:%02X:%02X:%02X \n",
721 psessionEntry->limReAssocbssId[0], psessionEntry->limReAssocbssId[1], psessionEntry->limReAssocbssId[2],
722 psessionEntry->limReAssocbssId[3], psessionEntry->limReAssocbssId[4], psessionEntry->limReAssocbssId[5]);
723 p += log_sprintf( pMac,p, "limReassocChannelId: %d \n", psessionEntry->limReassocChannelId);
724 p += log_sprintf( pMac,p, "limReassocBssCaps: %d \n", psessionEntry->limReassocBssCaps);
725 p += log_sprintf( pMac,p, "limReassocBssQosCaps: %d \n", psessionEntry->limReassocBssQosCaps);
726 p += log_sprintf( pMac,p, "limReassocBssPropCap: %d \n", psessionEntry->limReassocBssPropCap);
Jeff Johnson295189b2012-06-20 16:38:30 -0700727 p += log_sprintf( pMac,p, "********************************************\n");
728 }
729 }
730 return p;
731}
732
733void
734limSetEdcaBcastACMFlag(tpAniSirGlobal pMac, tANI_U32 ac, tANI_U32 acmFlag)
735{
736 tpPESession psessionEntry = &pMac->lim.gpSession[0]; //TBD-RAJESH HOW TO GET sessionEntry?????
737 psessionEntry->gLimEdcaParamsBC[ac].aci.acm = (tANI_U8)acmFlag;
738 psessionEntry->gLimEdcaParamSetCount++;
739 schSetFixedBeaconFields(pMac,psessionEntry);
740}
741
742static char *
743limDumpEdcaParams(tpAniSirGlobal pMac, char *p)
744{
745 tANI_U8 i = 0;
746 tpPESession psessionEntry = &pMac->lim.gpSession[0]; //TBD-RAJESH HOW TO GET sessionEntry?????
747 p += log_sprintf( pMac,p, "EDCA parameter set count = %d\n", psessionEntry->gLimEdcaParamSetCount);
748 p += log_sprintf( pMac,p, "Broadcast parameters\n");
749 p += log_sprintf( pMac,p, "AC\tACI\tACM\tAIFSN\tCWMax\tCWMin\tTxopLimit\t\n");
750 for(i = 0; i < MAX_NUM_AC; i++)
751 {
752 //right now I am just interested in ACM bit. this can be extended for all other EDCA paramters.
753 p += log_sprintf( pMac,p, "%d\t%d\t%d\t%d\t%d\t%d\t%d\n", i,
754 psessionEntry->gLimEdcaParamsBC[i].aci.aci, psessionEntry->gLimEdcaParamsBC[i].aci.acm,
755 psessionEntry->gLimEdcaParamsBC[i].aci.aifsn, psessionEntry->gLimEdcaParamsBC[i].cw.max,
756 psessionEntry->gLimEdcaParamsBC[i].cw.min, psessionEntry->gLimEdcaParamsBC[i].txoplimit);
757 }
758
759 p += log_sprintf( pMac,p, "\nLocal parameters\n");
760 p += log_sprintf( pMac,p, "AC\tACI\tACM\tAIFSN\tCWMax\tCWMin\tTxopLimit\t\n");
761 for(i = 0; i < MAX_NUM_AC; i++)
762 {
763 //right now I am just interested in ACM bit. this can be extended for all other EDCA paramters.
764 p += log_sprintf( pMac,p, "%d\t%d\t%d\t%d\t%d\t%d\t%d\n", i,
765 psessionEntry->gLimEdcaParams[i].aci.aci, psessionEntry->gLimEdcaParams[i].aci.acm,
766 psessionEntry->gLimEdcaParams[i].aci.aifsn, psessionEntry->gLimEdcaParams[i].cw.max,
767 psessionEntry->gLimEdcaParams[i].cw.min, psessionEntry->gLimEdcaParams[i].txoplimit);
768 }
769
770 return p;
771}
772
773
774static char* limDumpTspecEntry(tpAniSirGlobal pMac, char *p, tANI_U32 tspecEntryNo)
775{
776 tpLimTspecInfo pTspecList;
777 if(tspecEntryNo >= LIM_NUM_TSPEC_MAX)
778 {
779 p += log_sprintf( pMac,p, "Tspec Entry no. %d is out of allowed range(0 .. %d)\n",
780 tspecEntryNo, (LIM_NUM_TSPEC_MAX - 1));
781 return p;
782 }
783 pTspecList = &pMac->lim.tspecInfo[tspecEntryNo];
784 if (pTspecList->inuse)
785 p += log_sprintf( pMac,p, "Entry %d is VALID\n", tspecEntryNo);
786 else
787 {
788 p += log_sprintf( pMac,p, "Entry %d is UNUSED\n", tspecEntryNo);
789 return p;
790 }
791 p += log_sprintf( pMac,p, "\tSta %0x:%0x:%0x:%0x:%0x:%0x, AID %d, Index %d\n",
792 pTspecList->staAddr[0], pTspecList->staAddr[1],
793 pTspecList->staAddr[2], pTspecList->staAddr[3],
794 pTspecList->staAddr[4], pTspecList->staAddr[5],
795 pTspecList->assocId, pTspecList->idx);
796 p += log_sprintf( pMac,p, "\tType %d, Length %d, ackPolicy %d, userPrio %d, accessPolicy = %d, Dir %d, tsid %d\n",
797 pTspecList->tspec.type, pTspecList->tspec.length,
798 pTspecList->tspec.tsinfo.traffic.ackPolicy, pTspecList->tspec.tsinfo.traffic.userPrio,
799 pTspecList->tspec.tsinfo.traffic.accessPolicy, pTspecList->tspec.tsinfo.traffic.direction,
800 pTspecList->tspec.tsinfo.traffic.tsid);
801 p += log_sprintf( pMac,p, "\tPsb %d, Agg %d, TrafficType %d, schedule %d; msduSz: nom %d, max %d\n",
802 pTspecList->tspec.tsinfo.traffic.psb, pTspecList->tspec.tsinfo.traffic.aggregation,
803 pTspecList->tspec.tsinfo.traffic.trafficType, pTspecList->tspec.tsinfo.schedule.schedule,
804 pTspecList->tspec.nomMsduSz, pTspecList->tspec.maxMsduSz);
805 p += log_sprintf( pMac,p, "\tSvcInt: Min %d, Max %d; dataRate: Min %d, mean %d, peak %d\n",
806 pTspecList->tspec.minSvcInterval, pTspecList->tspec.maxSvcInterval,
807 pTspecList->tspec.minDataRate, pTspecList->tspec.meanDataRate,
808 pTspecList->tspec.peakDataRate);
809 p += log_sprintf( pMac,p, "\tmaxBurstSz %d, delayBound %d, minPhyRate %d, surplusBw %d, mediumTime %d\n",
810 pTspecList->tspec.maxBurstSz, pTspecList->tspec.delayBound,
811 pTspecList->tspec.minPhyRate, pTspecList->tspec.surplusBw,
812 pTspecList->tspec.mediumTime);
813
814 return p;
815}
816
817static char* dumpTspecTableSummary(tpAniSirGlobal pMac, tpLimTspecInfo pTspecList, char *p, int ctspec)
818{
819 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",
820 ctspec, pTspecList->idx, pTspecList->assocId,
821 pTspecList->tspec.tsinfo.traffic.ackPolicy, pTspecList->tspec.tsinfo.traffic.userPrio,
822 pTspecList->tspec.tsinfo.traffic.psb, pTspecList->tspec.tsinfo.traffic.aggregation,
823 pTspecList->tspec.tsinfo.traffic.accessPolicy, pTspecList->tspec.tsinfo.traffic.direction,
824 pTspecList->tspec.tsinfo.traffic.tsid, pTspecList->tspec.tsinfo.traffic.trafficType);
825
826 return p;
827}
828
829
830static char* limDumpDphTableSummary(tpAniSirGlobal pMac,char *p)
831{
832 tANI_U8 i, j;
833 p += log_sprintf( pMac,p, "DPH Table dump\n");
834
835 for(j=0; j < pMac->lim.maxBssId; j++)
836 {
837 /* Find first free room in session table */
838 if(pMac->lim.gpSession[j].valid)
839 {
840 p += log_sprintf( pMac,p, "aid staId bssid encPol qosMode wme 11e wsm staaddr\n");
841 for(i = 0; i < pMac->lim.gpSession[j].dph.dphHashTable.size; i++)
842 {
843 if (pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].added)
844 {
845 p += log_sprintf( pMac,p, "%d %d %d %d %d %d %d %d %x:%x:%x:%x:%x:%x\n",
846 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].assocId,
847 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].staIndex,
848 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].bssId,
849 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].encPolicy,
850 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].qosMode,
851 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].wmeEnabled,
852 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].lleEnabled,
853 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].wsmEnabled,
854 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].staAuthenticated,
855 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].staAddr[0],
856 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].staAddr[1],
857 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].staAddr[2],
858 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].staAddr[3],
859 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].staAddr[4],
860 pMac->lim.gpSession[j].dph.dphHashTable.pDphNodeArray[i].staAddr[5]);
861 }
862 }
863 }
864 }
865 return p;
866}
867
868// add the specified tspec to the tspec list
869static char* limDumpTsecTable( tpAniSirGlobal pMac, char* p)
870{
871 int ctspec;
872 tpLimTspecInfo pTspecList = &pMac->lim.tspecInfo[0];
873
874 p += log_sprintf( pMac,p, "=======LIM TSPEC TABLE DUMP\n");
875 p += log_sprintf( pMac,p, "Num\tIdx\tAID\tAckPol\tUP\tPSB\tAgg\tAccessPol\tDir\tTSID\ttraffic\n");
876
877 for (ctspec = 0; ctspec < LIM_NUM_TSPEC_MAX; ctspec++, pTspecList++)
878 {
879 if (pTspecList->inuse)
880 p = dumpTspecTableSummary(pMac, pTspecList, p, ctspec);
881 }
882 return p;
883}
884
885static char *
886dump_lim_tspec_table( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
887{
888 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
889 p = limDumpTsecTable(pMac, p);
890 return p;
891}
892
893static char *
894dump_lim_tspec_entry( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
895{
896 (void) arg2; (void) arg3; (void) arg4;
897 p = limDumpTspecEntry(pMac, p, arg1);
898 return p;
899}
900
901static char *
902dump_lim_dph_table_summary( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
903{
904 (void) arg2; (void) arg3; (void) arg4;
905 p = limDumpDphTableSummary(pMac, p);
906 return p;
907}
908
909
910static char *
911dump_lim_link_monitor_stats( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
912{
913 tANI_U32 ind, val;
914
915 (void) arg2; (void) arg3; (void) arg4;
916 p += log_sprintf( pMac,p, "\n ----- LIM Heart Beat Stats ----- \n");
917 p += log_sprintf( pMac,p, "No. of HeartBeat Failures in LinkEst State = %d\n",
918 pMac->lim.gLimHBfailureCntInLinkEstState);
919 p += log_sprintf( pMac,p, "No. of Probe Failures after HB failed = %d\n",
920 pMac->lim.gLimProbeFailureAfterHBfailedCnt);
921 p += log_sprintf( pMac,p, "No. of HeartBeat Failures in Other States = %d\n",
922 pMac->lim.gLimHBfailureCntInOtherStates);
923
924 if (wlan_cfgGetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, &val) == eSIR_SUCCESS)
925 p += log_sprintf( pMac,p, "Cfg HeartBeat Threshold = %d\n", val);
926
927 p += log_sprintf( pMac,p, "# Beacons Rcvd in HB interval # of times\n");
928
929 for (ind = 1; ind < MAX_NO_BEACONS_PER_HEART_BEAT_INTERVAL; ind++)
930 {
931 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,
932 pMac->lim.gLimHeartBeatBeaconStats[ind]);
933 }
934 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",
935 MAX_NO_BEACONS_PER_HEART_BEAT_INTERVAL-1,
936 pMac->lim.gLimHeartBeatBeaconStats[0]);
937
938 if (arg1 != 0)
939 {
940 for (ind = 0; ind < MAX_NO_BEACONS_PER_HEART_BEAT_INTERVAL; ind++)
941 pMac->lim.gLimHeartBeatBeaconStats[ind] = 0;
942
943 pMac->lim.gLimHBfailureCntInLinkEstState = 0;
944 pMac->lim.gLimProbeFailureAfterHBfailedCnt = 0;
945 pMac->lim.gLimHBfailureCntInOtherStates = 0;
946
947 p += log_sprintf( pMac,p, "\nReset HeartBeat Statistics\n");
948 }
949 return p;
950}
951
952static char *
953dump_lim_edca_params( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
954{
955 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
956 p = limDumpEdcaParams(pMac, p);
957 return p;
958}
959
960static char *
961dump_lim_acm_set( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
962{
963 (void) arg3; (void) arg4;
964 limSetEdcaBcastACMFlag(pMac, arg1 /*ac(0..3)*/, arg2 /*(acmFlag = 1 to set ACM*/);
965 return p;
966}
967
968static char *
969dump_lim_bgscan_toggle( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
970{
971 (void) arg2; (void) arg3; (void) arg4;
972 pMac->lim.gLimForceBackgroundScanDisable = (arg1 == 0) ? 1 : 0;
973 p += log_sprintf( pMac,p, "Bgnd scan is now %s\n",
974 (pMac->lim.gLimForceBackgroundScanDisable) ? "Disabled" : "On");
975 return p;
976}
977
978static char *
979dump_lim_linkmonitor_toggle( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
980{
981 (void) arg2; (void) arg3; (void) arg4;
982 pMac->sys.gSysEnableLinkMonitorMode = (arg1 == 0) ? 0 : 1;
983 p += log_sprintf( pMac,p, "LinkMonitor mode enable = %s\n",
984 (pMac->sys.gSysEnableLinkMonitorMode) ? "On" : "Off");
985 return p;
986}
987
988static char *
989dump_lim_proberesp_toggle( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
990{
991 (void) arg2; (void) arg3; (void) arg4;
992 pMac->lim.gLimProbeRespDisableFlag = (arg1 == 0) ? 0 : 1;
993 p += log_sprintf( pMac,p, "ProbeResponse mode disable = %s\n",
994 (pMac->lim.gLimProbeRespDisableFlag) ? "On" : "Off");
995 return p;
996}
997
998static char *
999dump_lim_add_sta( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1000{
1001#ifdef FIXME_GEN6
1002 tpDphHashNode pStaDs;
1003 tpPESession psessionEntry = &pMac->lim.gpSession[0]; //TBD-RAJESH HOW TO GET sessionEntry?????
1004 tSirMacAddr staMac = {0};
Gopichand Nakkala777e6032012-12-31 16:39:21 -08001005 tANI_U16 peerIdx;
Jeff Johnson295189b2012-06-20 16:38:30 -07001006 if(arg2 > 5)
1007 goto addStaFail;
Gopichand Nakkala777e6032012-12-31 16:39:21 -08001008 peerIdx = limAssignPeerIdx(pMac, psessionEntry);
1009 pStaDs = dphGetHashEntry(pMac, peerIdx);
Jeff Johnson295189b2012-06-20 16:38:30 -07001010 if(NULL == pStaDs)
1011 {
1012 staMac[5] = (tANI_U8) arg1;
Gopichand Nakkala777e6032012-12-31 16:39:21 -08001013 pStaDs = dphAddHashEntry(pMac, staMac, peerIdx, &psessionEntry->dph.dphHashTable);
Jeff Johnson295189b2012-06-20 16:38:30 -07001014 if(NULL == pStaDs)
1015 goto addStaFail;
1016
1017 pStaDs->staType = STA_ENTRY_PEER;
1018 switch(arg2)
1019 {
1020 //11b station
1021 case 0:
1022 {
1023 pStaDs->mlmStaContext.htCapability = 0;
1024 pStaDs->erpEnabled = 0;
1025 p += log_sprintf( pMac,p, "11b");
1026 }
1027 break;
1028 //11g station
1029 case 1:
1030 {
1031 pStaDs->mlmStaContext.htCapability = 0;
1032 pStaDs->erpEnabled = 1;
1033 p += log_sprintf( pMac,p, "11g");
1034 }
1035 break;
1036 //ht20 station non-GF
1037 case 2:
1038 {
1039 pStaDs->mlmStaContext.htCapability = 1;
1040 pStaDs->erpEnabled = 1;
1041 pStaDs->htSupportedChannelWidthSet = 0;
1042 pStaDs->htGreenfield = 0;
1043 p += log_sprintf( pMac,p, "HT20 non-GF");
1044 }
1045 break;
1046 //ht20 station GF
1047 case 3:
1048 {
1049 pStaDs->mlmStaContext.htCapability = 1;
1050 pStaDs->erpEnabled = 1;
1051 pStaDs->htSupportedChannelWidthSet = 0;
1052 pStaDs->htGreenfield = 1;
1053 p += log_sprintf( pMac,p, "HT20 GF");
1054 }
1055 break;
1056 //ht40 station non-GF
1057 case 4:
1058 {
1059 pStaDs->mlmStaContext.htCapability = 1;
1060 pStaDs->erpEnabled = 1;
1061 pStaDs->htSupportedChannelWidthSet = 1;
1062 pStaDs->htGreenfield = 0;
1063 p += log_sprintf( pMac,p, "HT40 non-GF");
1064 }
1065 break;
1066 //ht40 station GF
1067 case 5:
1068 {
1069 pStaDs->mlmStaContext.htCapability = 1;
1070 pStaDs->erpEnabled = 1;
1071 pStaDs->htSupportedChannelWidthSet = 1;
1072 pStaDs->htGreenfield = 1;
1073 p += log_sprintf( pMac,p, "HT40 GF");
1074 }
1075 break;
1076 default:
1077 {
1078 p += log_sprintf( pMac,p, "arg2 not in range [0..3]. Station not added.\n");
1079 goto addStaFail;
1080 }
1081 break;
1082 }
1083
1084 pStaDs->added = 1;
1085 p += log_sprintf( pMac,p, " station with mac address 00:00:00:00:00:%x added.\n", (tANI_U8)arg1);
1086 limAddSta(pMac, pStaDs,psessionEntry);
1087 }
1088 else
1089 {
1090addStaFail:
1091 p += log_sprintf( pMac,p, "Could not add station\n");
1092 p += log_sprintf( pMac,p, "arg1: 6th byte of the station MAC address\n");
1093 p += log_sprintf( pMac,p, "arg2[0..5] : station type as described below\n");
1094 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");
1095 }
1096#endif
1097 return p;
1098}
1099
1100static char *
1101dump_lim_del_sta( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1102{
1103
1104 tpDphHashNode pStaDs;
1105 tLimMlmDisassocInd mlmDisassocInd;
1106 tpPESession psessionEntry;
1107 tANI_U8 reasonCode = eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON;
1108
1109 if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg2) )== NULL)
1110 {
1111 p += log_sprintf( pMac,p,"Session does not exist for given session Id \n");
1112 return p;
1113 }
1114
1115 pStaDs = dphGetHashEntry(pMac, (tANI_U16)arg1, &psessionEntry->dph.dphHashTable);
1116
1117 if(NULL == pStaDs)
1118 {
1119 p += log_sprintf( pMac,p, "Could not find station with assocId = %d\n", arg1);
1120 return p;
1121 }
1122
1123 if (pStaDs->mlmStaContext.mlmState != eLIM_MLM_LINK_ESTABLISHED_STATE)
1124 {
1125 p += log_sprintf( pMac,p, "received Disassoc frame from peer that is in state %X \n", pStaDs->mlmStaContext.mlmState);
1126 return p;
1127 }
1128
1129 pStaDs->mlmStaContext.cleanupTrigger = eLIM_PEER_ENTITY_DISASSOC;
1130 pStaDs->mlmStaContext.disassocReason = (tSirMacReasonCodes) reasonCode;
1131
1132 // Issue Disassoc Indication to SME.
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301133 vos_mem_copy((tANI_U8 *) &mlmDisassocInd.peerMacAddr,
Jeff Johnson295189b2012-06-20 16:38:30 -07001134 (tANI_U8 *) pStaDs->staAddr, sizeof(tSirMacAddr));
1135 mlmDisassocInd.reasonCode = reasonCode;
Jeff Johnson295189b2012-06-20 16:38:30 -07001136 mlmDisassocInd.disassocTrigger = eLIM_PEER_ENTITY_DISASSOC;
1137
1138 mlmDisassocInd.sessionId = psessionEntry->peSessionId;
1139
1140 limPostSmeMessage(pMac, LIM_MLM_DISASSOC_IND, (tANI_U32 *) &mlmDisassocInd);
1141 // Receive path cleanup
1142 limCleanupRxPath(pMac, pStaDs,psessionEntry);
1143 return p;
1144}
1145
1146
1147
1148
1149static char *
1150set_lim_prot_cfg( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1151{
1152
1153/**********************************
1154* Protection Enable
1155*
1156*LOWER byte for associated stations
1157*UPPER byte for overlapping stations.
1158*11g ==> protection from 11g
1159*11b ==> protection from 11b
1160*each byte will have the following info
1161*bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0
1162*reserved reserved RIFS Lsig n-GF ht20 11g 11b
1163**********************************
1164WNI_CFG_PROTECTION_ENABLED I 4 9
1165V RW NP RESTART
1166LIM
11670 0xff 0xff
1168V RW NP RESTART
1169LIM
11700 0xffff 0xffff
1171
1172#ENUM FROM_llB 0
1173#ENUM FROM_llG 1
1174#ENUM HT_20 2
1175#ENUM NON_GF 3
1176#ENUM LSIG_TXOP 4
1177#ENUM RIFS 5
1178#ENUM OLBC_FROM_llB 8
1179#ENUM OLBC_FROM_llG 9
1180#ENUM OLBC_HT20 10
1181#ENUM OLBC_NON_GF 11
1182#ENUM OLBC_LSIG_TXOP 12
1183#ENUM OLBC_RIFS 13
1184******************************************/
1185 if(1 == arg1)
1186 dump_cfg_set(pMac, WNI_CFG_PROTECTION_ENABLED, 0xff, arg3, arg4, p);
1187 else if(2 == arg1)
1188 dump_cfg_set(pMac, WNI_CFG_PROTECTION_ENABLED, arg2 & 0xff, arg3, arg4, p);
1189 else
1190 {
1191 p += log_sprintf( pMac,p, "To set protection config:\n");
1192 p += log_sprintf( pMac,p, "arg1: operation type(1 -> set to Default 0xff, 2-> set to a arg2, else print help)\n");
1193 }
1194 return p;
1195}
1196
1197
1198static char *
1199dump_lim_set_protection_control( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1200{
1201 dump_cfg_set(pMac, WNI_CFG_FORCE_POLICY_PROTECTION, arg1, arg2, arg3, p);
Jeff Johnson295189b2012-06-20 16:38:30 -07001202 limSetCfgProtection(pMac, NULL);
Jeff Johnson295189b2012-06-20 16:38:30 -07001203 return p;
1204}
1205
1206
1207static char *
1208dump_lim_send_SM_Power_Mode( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1209{
1210 tSirMsgQ msg;
1211 tpSirMbMsg pMBMsg;
1212 tSirMacHTMIMOPowerSaveState state;
1213
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001214 p += log_sprintf( pMac,p, "%s: Verifying the Arguments\n", __func__);
Jeff Johnson295189b2012-06-20 16:38:30 -07001215 if ((arg1 > 3) || (arg1 == 2))
1216 {
1217 p += log_sprintf( pMac,p, "Invalid Argument , enter one of the valid states\n");
1218 return p;
1219 }
1220
1221 state = (tSirMacHTMIMOPowerSaveState) arg1;
1222
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301223 pMBMsg = vos_mem_malloc(WNI_CFG_MB_HDR_LEN + sizeof(tSirMacHTMIMOPowerSaveState));
Jeff Johnson295189b2012-06-20 16:38:30 -07001224 if(NULL == pMBMsg)
1225 {
1226 p += log_sprintf( pMac,p, "pMBMsg is NULL\n");
1227 return p;
1228 }
1229 pMBMsg->type = eWNI_PMC_SMPS_STATE_IND;
1230 pMBMsg->msgLen = (tANI_U16)(WNI_CFG_MB_HDR_LEN + sizeof(tSirMacHTMIMOPowerSaveState));
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301231 vos_mem_copy(pMBMsg->data, &state, sizeof(tSirMacHTMIMOPowerSaveState));
Jeff Johnson295189b2012-06-20 16:38:30 -07001232
1233 msg.type = eWNI_PMC_SMPS_STATE_IND;
1234 msg.bodyptr = pMBMsg;
1235 msg.bodyval = 0;
1236
1237 if (limPostMsgApi(pMac, &msg) != TX_SUCCESS)
1238 {
1239 p += log_sprintf( pMac,p, "Updating the SMPower Request has failed \n");
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301240 vos_mem_free(pMBMsg);
Jeff Johnson295189b2012-06-20 16:38:30 -07001241 }
1242 else
1243 {
1244 p += log_sprintf( pMac,p, "Updating the SMPower Request is Done \n");
1245 }
1246
1247 return p;
1248}
1249
1250
1251
1252
1253static char *
1254dump_lim_addba_req( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1255{
1256tSirRetStatus status;
1257tpDphHashNode pSta;
1258 tpPESession psessionEntry = &pMac->lim.gpSession[0]; //TBD-RAJESH HOW TO GET sessionEntry?????
1259
1260
1261 (void) arg4;
1262
1263 // Get DPH Sta entry for this ASSOC ID
1264 pSta = dphGetHashEntry( pMac, (tANI_U16) arg1, &psessionEntry->dph.dphHashTable);
1265 if( NULL == pSta )
1266 {
1267 p += log_sprintf( pMac, p,
1268 "\n%s: Could not find entry in DPH table for assocId = %d\n",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001269 __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07001270 arg1 );
1271 }
1272 else
1273 {
1274 status = limPostMlmAddBAReq( pMac, pSta, (tANI_U8) arg2, (tANI_U16) arg3,psessionEntry);
1275 p += log_sprintf( pMac, p,
1276 "\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 -07001277 __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07001278 pSta->staIndex,
1279 arg2,
1280 limResultCodeStr( status ));
1281 }
1282
1283 return p;
1284}
1285
1286static char *
1287dump_lim_delba_req( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1288{
1289tSirRetStatus status;
1290tpDphHashNode pSta;
1291 tpPESession psessionEntry = &pMac->lim.gpSession[0]; //TBD-RAJESH HOW TO GET sessionEntry?????
1292
1293 // Get DPH Sta entry for this ASSOC ID
1294 pSta = dphGetHashEntry( pMac, (tANI_U16) arg1, &psessionEntry->dph.dphHashTable );
1295 if( NULL == pSta )
1296 {
1297 p += log_sprintf( pMac, p,
1298 "\n%s: Could not find entry in DPH table for assocId = %d\n",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001299 __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07001300 arg1 );
1301 }
1302 else
1303 {
1304 status = limPostMlmDelBAReq( pMac, pSta, (tANI_U8) arg2, (tANI_U8) arg3, (tANI_U16) arg4 ,psessionEntry);
1305 p += log_sprintf( pMac, p,
1306 "\n%s: Attempted to send a DELBA Ind to STA Index %d, "
1307 "as the BA \"%s\" for TID %d, with Reason code %d. "
1308 "Send Status = %s\n",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001309 __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07001310 pSta->staIndex,
1311 (arg2 == 1)? "Initiator": "Recipient",
1312 arg3, // TID
1313 arg4, // Reason Code
1314 limResultCodeStr( status ));
1315 }
1316
1317 return p;
1318}
1319
1320static char *
1321dump_lim_ba_timeout( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1322{
1323
1324/* FIXME: NO HAL IN UMAC for PRIMA */
Jeff Johnson295189b2012-06-20 16:38:30 -07001325
1326 p += log_sprintf( pMac, p,
1327 "\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 -07001328 __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07001329 arg1, // STA index
1330 arg2, // TID
1331 arg3 ); // BA Direction
1332
1333 return p;
1334}
1335
1336static char *
1337dump_lim_list_active_ba( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1338{
1339tANI_U32 i;
1340tpDphHashNode pSta;
1341
1342//TBD-RAJESH HOW TO GET sessionEntry?????
1343
1344tpPESession psessionEntry = &pMac->lim.gpSession[0]; //TBD-RAJESH
1345
1346 (void) arg2; (void) arg3; (void) arg4;
1347
1348 // Get DPH Sta entry for this ASSOC ID
1349 pSta = dphGetHashEntry( pMac, (tANI_U16) arg1, &psessionEntry->dph.dphHashTable);
1350 if( NULL == pSta )
1351 {
1352 p += log_sprintf( pMac, p,
1353 "\n%s: Could not find entry in DPH table for assocId = %d\n",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001354 __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07001355 arg1 );
1356 }
1357 else
1358 {
1359 p += log_sprintf( pMac, p,
1360 "\nList of Active BA sessions for STA Index %d with Assoc ID %d\n",
1361 pSta->staIndex,
1362 arg1 );
1363
1364 p += log_sprintf( pMac, p, "TID\tRxBA\tTxBA\tRxBufferSize\tTxBufferSize\tRxBATimeout\tTxBATimeout\n");
1365 for( i = 0; i < STACFG_MAX_TC; i ++ )
1366 p += log_sprintf( pMac, p,
1367 "%d\t%d\t%d\t%d\t%d\t%d\t%d\n",
1368 i, // TID
1369 pSta->tcCfg[i].fUseBARx,
1370 pSta->tcCfg[i].fUseBATx,
1371 pSta->tcCfg[i].rxBufSize,
1372 pSta->tcCfg[i].txBufSize,
1373 pSta->tcCfg[i].tuRxBAWaitTimeout,
1374 pSta->tcCfg[i].tuTxBAWaitTimeout );
1375 }
1376
1377 return p;
1378}
1379
1380
1381static char *
1382dump_lim_AddBA_DeclineStat( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1383{
1384
1385 int Tid, Enable=(arg1 & 0x1);
1386 tANI_U8 val;
1387
1388 if (arg1 > 1) {
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001389 log_sprintf( pMac,p, "%s:Invalid Value is entered for Enable/Disable \n", __func__ );
Jeff Johnson295189b2012-06-20 16:38:30 -07001390 arg1 &= 1;
1391 }
1392
1393 val = pMac->lim.gAddBA_Declined;
1394
1395 if (arg2 > 7) {
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001396 log_sprintf( pMac,p, "%s:Invalid Value is entered for Tid \n", __func__ );
Jeff Johnson295189b2012-06-20 16:38:30 -07001397 Tid = arg2 & 0x7;
1398 } else
1399 Tid = arg2;
1400
1401
1402 if ( Enable)
1403 val |= Enable << Tid;
1404 else
1405 val &= ~(0x1 << Tid);
1406
1407 if (cfgSetInt(pMac, (tANI_U16)WNI_CFG_ADDBA_REQ_DECLINE, (tANI_U32) val) != eSIR_SUCCESS)
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001408 log_sprintf( pMac,p, "%s:Config Set for ADDBA REQ Decline has failed \n", __func__ );
Jeff Johnson295189b2012-06-20 16:38:30 -07001409
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07001410 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 -07001411
1412 return p;
1413}
1414static char *
1415dump_lim_set_dot11_mode( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1416{
1417
1418 tpPESession psessionEntry =&pMac->lim.gpSession[0]; //TBD-RAJESH HOW TO GET sessionEntry?????
1419 dump_cfg_set(pMac, WNI_CFG_DOT11_MODE, arg1, arg2, arg3, p);
1420 if ( (limGetSystemRole(psessionEntry) == eLIM_AP_ROLE) ||
1421 (limGetSystemRole(psessionEntry) == eLIM_STA_IN_IBSS_ROLE))
1422 schSetFixedBeaconFields(pMac,psessionEntry);
1423 p += log_sprintf( pMac,p, "The Dot11 Mode is set to %s", limDot11ModeStr(pMac, (tANI_U8)psessionEntry->dot11mode));
1424 return p;
1425}
1426
1427
1428static char* dump_lim_update_cb_Mode(tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1429{
1430 tANI_U32 localPwrConstraint;
Jeff Johnsone7245742012-09-05 17:12:55 -07001431 tpPESession psessionEntry = peFindSessionBySessionId(pMac, arg1);
1432
1433 if (psessionEntry == NULL)
1434 {
1435 p += log_sprintf( pMac, p, "Invalid sessionId: %d \n ", arg1);
1436 return p;
1437 }
1438
1439 if ( !psessionEntry->htCapability )
Jeff Johnson295189b2012-06-20 16:38:30 -07001440 {
1441 p += log_sprintf( pMac,p, "Error: Dot11 mode is non-HT, can not change the CB mode.\n");
1442 return p;
1443 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001444
1445 psessionEntry->htSupportedChannelWidthSet = arg2?1:0;
1446 psessionEntry->htRecommendedTxWidthSet = psessionEntry->htSupportedChannelWidthSet;
1447 psessionEntry->htSecondaryChannelOffset = arg2;
Jeff Johnson295189b2012-06-20 16:38:30 -07001448
1449 if(eSIR_SUCCESS != cfgSetInt(pMac, WNI_CFG_CHANNEL_BONDING_MODE,
Jeff Johnsone7245742012-09-05 17:12:55 -07001450 arg2 ? WNI_CFG_CHANNEL_BONDING_MODE_ENABLE : WNI_CFG_CHANNEL_BONDING_MODE_DISABLE))
Jeff Johnson295189b2012-06-20 16:38:30 -07001451 p += log_sprintf(pMac,p, "cfgSetInt failed for WNI_CFG_CHANNEL_BONDING_MODE\n");
Jeff Johnsone7245742012-09-05 17:12:55 -07001452
Jeff Johnson295189b2012-06-20 16:38:30 -07001453 wlan_cfgGetInt(pMac, WNI_CFG_LOCAL_POWER_CONSTRAINT, &localPwrConstraint);
Jeff Johnsone7245742012-09-05 17:12:55 -07001454
1455 limSendSwitchChnlParams(pMac, psessionEntry->currentOperChannel, psessionEntry->htSecondaryChannelOffset,
Jeff Johnson295189b2012-06-20 16:38:30 -07001456 (tPowerdBm) localPwrConstraint, psessionEntry->peSessionId);
1457 if ( (limGetSystemRole(psessionEntry) == eLIM_AP_ROLE) ||
1458 (limGetSystemRole(psessionEntry) == eLIM_STA_IN_IBSS_ROLE))
1459 schSetFixedBeaconFields(pMac,psessionEntry);
1460 return p;
Jeff Johnsone7245742012-09-05 17:12:55 -07001461
Jeff Johnson295189b2012-06-20 16:38:30 -07001462}
1463
1464static char* dump_lim_abort_scan(tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1465{
1466 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1467 //csrScanAbortMacScan(pMac);
1468 return p;
1469
1470}
1471
1472static char* dump_lim_start_stop_bg_scan(tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1473{
1474 (void) arg2; (void) arg3; (void) arg4;
1475
1476 if (TX_TIMER_VALID(pMac->lim.limTimers.gLimBackgroundScanTimer))
1477 {
1478 limDeactivateAndChangeTimer(pMac, eLIM_BACKGROUND_SCAN_TIMER);
1479 }
1480
1481 if(arg1 == 1)
1482 {
1483 if (tx_timer_activate(
1484 &pMac->lim.limTimers.gLimBackgroundScanTimer) != TX_SUCCESS)
1485 {
1486 pMac->lim.gLimBackgroundScanTerminate = TRUE;
1487 }
1488 else
1489 {
1490 pMac->lim.gLimBackgroundScanTerminate = FALSE;
1491 pMac->lim.gLimBackgroundScanDisable = false;
1492 pMac->lim.gLimForceBackgroundScanDisable = false;
1493 }
1494 }
1495 else
1496 {
1497 pMac->lim.gLimBackgroundScanTerminate = TRUE;
1498 pMac->lim.gLimBackgroundScanChannelId = 0;
1499 pMac->lim.gLimBackgroundScanDisable = true;
1500 pMac->lim.gLimForceBackgroundScanDisable = true;
1501 }
1502 return p;
1503
1504}
1505
1506static char*
1507dump_lim_get_pe_statistics(tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1508{
Jeff Johnson295189b2012-06-20 16:38:30 -07001509 tpAniGetPEStatsReq pReq;
1510 tANI_U32 statsMask;
1511
1512 (void) arg2; (void) arg3; (void) arg4;
1513
1514
1515 switch(arg1)
1516 {
1517 case 1:
1518 statsMask = PE_SUMMARY_STATS_INFO;
1519 break;
1520 case 2:
1521 statsMask = PE_GLOBAL_CLASS_A_STATS_INFO;
1522 break;
1523 case 3:
1524 statsMask = PE_GLOBAL_CLASS_B_STATS_INFO;
1525 break;
1526 case 4:
1527 statsMask = PE_GLOBAL_CLASS_C_STATS_INFO;
1528 break;
1529 case 5:
1530 statsMask = PE_PER_STA_STATS_INFO;
1531 break;
1532 default:
1533 return p;
1534 }
1535
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301536 pReq = vos_mem_malloc(sizeof(tAniGetPEStatsReq));
1537 if (NULL == pReq)
Jeff Johnson295189b2012-06-20 16:38:30 -07001538 {
1539 p += log_sprintf( pMac,p, "Error: Unable to allocate memory.\n");
1540 return p;
1541 }
1542
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301543 vos_mem_set(pReq, sizeof(*pReq), 0);
Jeff Johnson295189b2012-06-20 16:38:30 -07001544
1545 pReq->msgType = eWNI_SME_GET_STATISTICS_REQ;
1546 pReq->statsMask = statsMask;
1547 pReq->staId = (tANI_U16)arg2;
1548
1549 pMac->lim.gLimRspReqd = eANI_BOOLEAN_TRUE;
1550 limPostSmeMessage(pMac, eWNI_SME_GET_STATISTICS_REQ, (tANI_U32 *) pReq);
1551
1552 return p;
1553
1554}
1555
1556extern char* setLOGLevel( tpAniSirGlobal pMac, char *p, tANI_U32 module, tANI_U32 level );
1557static char *
1558dump_lim_set_log_level( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1559{
1560 p = setLOGLevel(pMac, p, arg1, arg2);
1561 return p;
1562}
1563
1564static char *
1565dump_lim_update_log_level( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1566{
1567 vos_trace_setLevel( arg1, arg2 );
1568 return p;
1569}
1570
1571static char *
1572dump_lim_scan_req_send( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1573{
1574 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1575 p = sendSmeScanReq(pMac, p);
1576 return p;
1577}
1578
1579static char *
1580dump_lim_send_start_bss_req( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1581{
1582 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1583 p = sendSmeStartBssReq(pMac, p,arg1);
1584 return p;
1585}
1586
1587static char *
1588dump_lim_send_join_req( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1589{
1590 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1591 p = sendSmeJoinReq(pMac, p);
1592 return p;
1593}
1594
1595static char *
1596dump_lim_send_disassoc_req( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1597{
1598 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1599
1600 p = sendSmeDisAssocReq(pMac, p, arg1 ,arg2);
1601 return p;
1602}
1603
1604static char *
1605dump_lim_stop_bss_req( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1606{
1607 (void) arg2; (void) arg3; (void) arg4;
1608 p = sendSmeStopBssReq(pMac, p, arg1);
1609 return p;
1610}
1611
1612
1613static char *
1614dump_lim_session_print( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1615{
1616 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1617 p = printSessionInfo(pMac, p);
1618 return p;
1619}
1620
1621static char *
1622dump_lim_sme_reassoc_req( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1623{
1624 tANI_U32 sessionId = arg1;
1625 tCsrRoamModifyProfileFields modifyProfileFields;
1626 tANI_U32 roamId;
1627
1628 (void) arg2; (void) arg3; (void) arg4;
1629
1630 if( CSR_IS_SESSION_VALID( pMac, sessionId ) )
1631 {
1632 if(HAL_STATUS_SUCCESS(sme_AcquireGlobalLock( &pMac->sme )))
1633 {
1634 csrGetModifyProfileFields(pMac, sessionId, &modifyProfileFields);
1635 csrReassoc( pMac, sessionId, &modifyProfileFields, &roamId, 0);
1636 sme_ReleaseGlobalLock( &pMac->sme );
1637 }
1638 }
1639 else
1640 {
1641 p += log_sprintf( pMac,p, "Invalid session = %d\n", sessionId);
1642 }
1643
1644 return p;
1645}
1646
1647static char *
1648dump_lim_dot11h_stats( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1649{
Jeff Johnson295189b2012-06-20 16:38:30 -07001650 return p;
1651}
1652
1653static char *
1654dump_lim_enable_measurement( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1655{
1656 (void) arg2; (void) arg3; (void) arg4;
1657
1658 if (arg1)
1659 {
1660 pMac->sys.gSysEnableLearnMode = eANI_BOOLEAN_TRUE;
1661 p += log_sprintf(pMac, p, "Measurement enabled\n");
1662 }
1663 else
1664 {
1665 pMac->sys.gSysEnableLearnMode = eANI_BOOLEAN_FALSE;
1666 p += log_sprintf(pMac, p, "Measurement disabled\n");
1667 }
1668
1669 return p;
1670}
1671
1672static char *
1673dump_lim_enable_quietIE( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1674{
1675 (void) arg2; (void) arg3; (void) arg4;
Jeff Johnsone7245742012-09-05 17:12:55 -07001676#if 0
Jeff Johnson295189b2012-06-20 16:38:30 -07001677 if (arg1)
1678 {
1679 pMac->lim.gLimSpecMgmt.fQuietEnabled = eANI_BOOLEAN_TRUE;
1680 p += log_sprintf(pMac, p, "QuietIE enabled\n");
1681 }
1682 else
1683 {
1684 pMac->lim.gLimSpecMgmt.fQuietEnabled = eANI_BOOLEAN_FALSE;
1685 p += log_sprintf(pMac, p, "QuietIE disabled\n");
1686 }
Jeff Johnsone7245742012-09-05 17:12:55 -07001687#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001688
1689 return p;
1690}
1691
1692static char *
1693dump_lim_disable_enable_scan( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1694{
1695 (void) arg2; (void) arg3; (void) arg4;
1696
1697 if (arg1)
1698 {
1699 pMac->lim.fScanDisabled = 1;
1700 p += log_sprintf(pMac, p, "Scan disabled\n");
1701 }
1702 else
1703 {
1704 pMac->lim.fScanDisabled = 0;
1705 p += log_sprintf(pMac, p, "scan enabled\n");
1706 }
1707
1708 return p;
1709}
1710
1711static char *finishScan(tpAniSirGlobal pMac, char *p)
1712{
1713 tSirMsgQ msg;
1714
1715 p += log_sprintf( pMac,p, "logDump finishScan \n");
1716
1717 msg.type = SIR_LIM_MIN_CHANNEL_TIMEOUT;
1718 msg.bodyval = 0;
1719 msg.bodyptr = NULL;
1720
1721 limPostMsgApi(pMac, &msg);
1722 return p;
1723}
1724
1725
1726static char *
1727dump_lim_info( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1728{
Jeff Johnsone7245742012-09-05 17:12:55 -07001729 (void) arg2; (void) arg3; (void) arg4;
1730 p = dumpLim( pMac, p, arg1);
Jeff Johnson295189b2012-06-20 16:38:30 -07001731 return p;
1732}
1733
1734static char *
1735dump_lim_finishscan_send( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1736{
1737 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1738 p = finishScan(pMac, p);
1739 return p;
1740}
1741
1742static char *
1743dump_lim_prb_rsp_send( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1744{
1745 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1746 p = testLimSendProbeRsp( pMac, p );
1747 return p;
1748}
1749
1750static char *
1751dump_sch_beacon_trigger( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1752{
1753 (void) arg1; (void) arg2; (void) arg3; (void) arg4;
1754 p = triggerBeaconGen(pMac, p);
1755 return p;
1756}
1757
1758
1759static char* dump_lim_trace_cfg(tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1760{
1761 MTRACE(macTraceCfg(pMac, arg1, arg2, arg3, arg4);)
1762 return p;
1763}
1764
1765static char* dump_lim_trace_dump(tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1766{
1767 MTRACE(macTraceDumpAll(pMac, (tANI_U8)arg1, (tANI_U8)arg2, arg3);)
1768 return p;
1769}
1770
1771static char* dump_lim_set_scan_in_powersave( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1772{
1773 p += log_sprintf( pMac,p, "logDump set scan in powersave to %d \n", arg1);
1774 dump_cfg_set(pMac, WNI_CFG_SCAN_IN_POWERSAVE, arg1, arg2, arg3, p);
1775 return p;
1776}
1777
1778#if defined WLAN_FEATURE_VOWIFI
1779static char *
1780dump_lim_send_rrm_action( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1781{
1782 tpPESession psessionEntry;
Madan Mohan Koyyalamudi8f207c12012-10-30 18:18:38 -07001783 tSirMacRadioMeasureReport *pRRMReport =
1784 vos_mem_malloc(4*sizeof(tSirMacRadioMeasureReport));
Jeff Johnson295189b2012-06-20 16:38:30 -07001785 tANI_U8 num = (tANI_U8)(arg4 > 4 ? 4 : arg4);
1786 tANI_U8 i;
1787
Madan Mohan Koyyalamudi8f207c12012-10-30 18:18:38 -07001788 if (!pRRMReport)
1789 {
1790 p += log_sprintf(pMac, p,
1791 "Unable to allocate memory to process command\n");
1792 goto done;
1793 }
1794
Jeff Johnson295189b2012-06-20 16:38:30 -07001795 if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg2) )== NULL)
1796 {
1797 p += log_sprintf( pMac,p,"Session does not exist for given session Id \n");
Madan Mohan Koyyalamudi8f207c12012-10-30 18:18:38 -07001798 goto done;
Jeff Johnson295189b2012-06-20 16:38:30 -07001799 }
1800 switch (arg3)
1801 {
1802 case 0:
1803 /* send two reports with incapable bit set */
1804 pRRMReport[0].type = 6;
1805 pRRMReport[1].type = 7;
1806 limSendRadioMeasureReportActionFrame( pMac, 1, 2, &pRRMReport[0], psessionEntry->bssId, psessionEntry );
1807 break;
1808 case 1:
1809 for ( i = 0 ; i < num ; i++ )
1810 {
1811 pRRMReport[i].type = 5;
1812 if ( i == 3 )
1813 pRRMReport[i].refused = 1;
1814 else
1815 pRRMReport[i].refused = 0;
1816
1817 pRRMReport[i].report.beaconReport.regClass = 32;
1818 pRRMReport[i].report.beaconReport.channel = i;
1819 pRRMReport[i].report.beaconReport.measDuration = 23;
1820 pRRMReport[i].report.beaconReport.phyType = i << 4; //some value.
1821 pRRMReport[i].report.beaconReport.bcnProbeRsp = 1;
1822 pRRMReport[i].report.beaconReport.rsni = 10;
1823 pRRMReport[i].report.beaconReport.rcpi = 40;
1824
1825 pRRMReport[i].report.beaconReport.bssid[0] = 0x00;
1826 pRRMReport[i].report.beaconReport.bssid[1] = 0xAA;
1827 pRRMReport[i].report.beaconReport.bssid[2] = 0xBB;
1828 pRRMReport[i].report.beaconReport.bssid[3] = 0xCC;
1829 pRRMReport[i].report.beaconReport.bssid[4] = 0x00;
1830 pRRMReport[i].report.beaconReport.bssid[5] = 0x01 << i;
1831
1832
1833 pRRMReport[i].report.beaconReport.antennaId = 10;
1834 pRRMReport[i].report.beaconReport.parentTSF = 0x1234;
1835
1836 pRRMReport[i].report.beaconReport.numIes = i * 10;
1837 {
1838 tANI_U8 j;
1839 for( j = 0; j < pRRMReport[i].report.beaconReport.numIes ; j++ )
1840 {
1841 pRRMReport[i].report.beaconReport.Ies[j] = j + i; //Junk values.
1842 }
1843 }
1844
1845 }
1846 limSendRadioMeasureReportActionFrame( pMac, 1, num, &pRRMReport[0], psessionEntry->bssId, psessionEntry );
1847 break;
1848 case 2:
1849 //send Neighbor request.
1850 {
1851 tSirMacNeighborReportReq neighbor;
1852 neighbor.dialogToken = 2;
1853 neighbor.ssid_present = (tANI_U8) arg4;
1854 neighbor.ssid.length = 5;
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05301855 vos_mem_copy(neighbor.ssid.ssId, "abcde", 5);
Jeff Johnson295189b2012-06-20 16:38:30 -07001856
1857 limSendNeighborReportRequestFrame( pMac, &neighbor, psessionEntry->bssId, psessionEntry );
1858
1859 }
1860
1861 break;
1862 case 3:
1863 //send Link measure report.
1864 {
1865 tSirMacLinkReport link;
1866 link.dialogToken = 4;
1867 link.txPower = 34;
1868 link.rxAntenna = 2;
1869 link.txAntenna = 1;
1870 link.rcpi = 9;
1871 link.rsni = 3;
1872 limSendLinkReportActionFrame( pMac, &link, psessionEntry->bssId, psessionEntry );
1873 }
1874 break;
1875 default:
1876 break;
1877 }
Madan Mohan Koyyalamudi8f207c12012-10-30 18:18:38 -07001878
1879done:
1880 vos_mem_free(pRRMReport);
Jeff Johnson295189b2012-06-20 16:38:30 -07001881 return p;
1882}
1883
1884static char *
1885dump_lim_unpack_rrm_action( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
1886{
1887 tpPESession psessionEntry;
1888 tANI_U32 status;
1889
1890 tANI_U8 size[] = {
1891 0x2C,
1892 0x2F,
1893 0x25,
1894 0x2C,
1895 0x1C,
1896 0x05
1897 };
1898
1899 tANI_U8 pBody[][100] = {
1900 {
1901 /*Beacon Request 0*/
1902 0x05, 0x00, 0x01, 0x00, 0x00,
1903 //Measurement request IE
1904 0x26, 0x25, 0x01, 0x00,
1905 //Beacon request type
1906 0x05,
1907 //Beacon request starts here
1908 0x0C, 0x01, 0x30, 0x00, 0x14, 0x00, 0x01,
1909 //BSSID
1910 0xFF, 0xFF, 0xFF, 0xFF, 0xff, 0xFF,
1911 //SSID
1912 0x00, 0x05, 0x57, 0x69, 0x46, 0x69, 0x31,
1913 //Reporting Condition
1914 0x01, 0x02, 0x00, 0x00,
1915 //Reporting Detail
1916 0x02, 0x01, 0x1,
1917 //Request IE
1918 0x0A, 0x05, 0x00, 0x30, 0x46, 0x36, 0xDD
1919 },
1920 {
1921 /*Beacon Request 1*/
1922 0x05, 0x00, 0x01, 0x00, 0x00,
1923 //Measurement request IE
1924 0x26, 0x28, 0x01, 0x00,
1925 //Beacon request type
1926 0x05,
1927 //Beacon request starts here
1928 0x0C, 0xFF, 0x30, 0x00, 0x14, 0x00, 0x01,
1929 //BSSID
1930 0xFF, 0xFF, 0xFF, 0xFF, 0xff, 0xFF,
1931 //SSID
1932/* 0x00, 0x08, 0x35, 0x36, 0x37, 0x38, 0x39, 0x40, 0x41, 0x42, */
1933 //Reporting Condition
1934 0x01, 0x02, 0x00, 0x00,
1935 //Reporting Detail
1936 0x02, 0x01, 0x1,
1937 //Request IE
1938 0x0A, 0x05, 0x00, 0x30, 0x46, 0x36, 0xDD,
1939 //AP channel report
1940 0x33, 0x03, 0x0C, 0x01, 0x06,
1941 0x33, 0x03, 0x0C, 0x24, 0x30,
1942 },
1943 {
1944 /*Beacon Request 2*/
1945 0x05, 0x00, 0x01, 0x00, 0x00,
1946 //Measurement request IE
1947 0x26, 0x1E, 0x01, 0x00,
1948 //Beacon request type
1949 0x05,
1950 //Beacon request starts here
1951 0x0C, 0x00, 0x30, 0x00, 0x14, 0x00, 0x02,
1952 //BSSID
1953 0xFF, 0xFF, 0xFF, 0xFF, 0xff, 0xFF,
1954 //SSID
1955 0x00, 0x05, 0x57, 0x69, 0x46, 0x69, 0x31,
1956 //0x00, 0x08, 0x41, 0x53, 0x54, 0x2D, 0x57, 0x41, 0x50, 0x49,
1957 //Reporting Condition
1958 0x01, 0x02, 0x00, 0x00,
1959 //Reporting Detail
1960 0x02, 0x01, 0x0
1961 //Request IE
1962 },
1963 {
1964 /*Beacon Request 3*/
1965 0x05, 0x00, 0x01, 0x00, 0x00,
1966 //Measurement request IE
1967 0x26, 0x25, 0x01, 0x00,
1968 //Beacon request type
1969 0x05,
1970 //Beacon request starts here
1971 0x0C, 0x01, 0x30, 0x00, 0x69, 0x00, 0x00,
1972 //BSSID
1973 0xFF, 0xFF, 0xFF, 0xFF, 0xff, 0xFF,
1974 //SSID
1975 0x00, 0x05, 0x57, 0x69, 0x46, 0x69, 0x31,
1976 //Reporting Condition
1977 0x01, 0x02, 0x00, 0x00,
1978 //Reporting Detail
1979 0x02, 0x01, 0x1,
1980 //Request IE
1981 0x0A, 0x05, 0x00, 0x30, 0x46, 0x36, 0xDD
1982 },
1983 {
1984 /*Neighbor report*/
1985 0x05, 0x05, 0x01,
1986 //Measurement request IE
1987 0x34, 0x17,
1988 //BSSID
1989 0xFF, 0xFF, 0xFF, 0xFF, 0xff, 0xFF,
1990 //BSSID INFOo
1991 0xED, 0x01, 0x00, 0x00,
1992 //Reg class, channel, Phy type
1993 0x20, 0x01, 0x02,
1994 //TSF Info
1995 0x01, 0x04, 0x02, 0x00, 0x60, 0x00,
1996 //Condensed country
1997 0x02, 0x02, 0x62, 0x63
1998 },
1999 {
2000 /* Link measurement request */
2001 0x05, 0x02, 0x00,
2002 //Txpower used
2003 0x00,
2004 //Max Tx Power
2005 0x00
2006 }
2007 };
2008
2009 if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg1) )== NULL)
2010 {
2011 p += log_sprintf( pMac,p,"Session does not exist for given session Id \n");
2012 return p;
2013 }
2014 switch (arg2)
2015 {
2016 case 0:
2017 case 1:
2018 case 2:
2019 case 3:
2020 {
Madan Mohan Koyyalamudi8f207c12012-10-30 18:18:38 -07002021 tDot11fRadioMeasurementRequest *frm =
2022 vos_mem_malloc(sizeof(tDot11fRadioMeasurementRequest));
2023 if (!frm)
2024 {
2025 p += log_sprintf(pMac, p,
2026 "Unable to allocate memory to process command\n");
2027 break;
2028 }
2029 if( (status = dot11fUnpackRadioMeasurementRequest( pMac, &pBody[arg2][0], size[arg2], frm )) != 0 )
Jeff Johnson295189b2012-06-20 16:38:30 -07002030 p += log_sprintf( pMac, p, "failed to unpack.....status = %x\n", status);
2031 else
Madan Mohan Koyyalamudi8f207c12012-10-30 18:18:38 -07002032 rrmProcessRadioMeasurementRequest( pMac, psessionEntry->bssId, frm, psessionEntry );
2033 vos_mem_free(frm);
Jeff Johnson295189b2012-06-20 16:38:30 -07002034 }
2035 break;
2036 case 4:
2037 {
Madan Mohan Koyyalamudi8f207c12012-10-30 18:18:38 -07002038 tDot11fNeighborReportResponse *frm =
2039 vos_mem_malloc(sizeof(tDot11fNeighborReportResponse));
2040 if (!frm)
2041 {
2042 p += log_sprintf(pMac, p,
2043 "Unable to allocate memory to process command\n");
2044 break;
2045 }
Jeff Johnson295189b2012-06-20 16:38:30 -07002046 pBody[arg2][2] = (tANI_U8)arg3; //Dialog Token
Madan Mohan Koyyalamudi8f207c12012-10-30 18:18:38 -07002047 if( (status = dot11fUnpackNeighborReportResponse( pMac, &pBody[arg2][0], size[arg2], frm )) != 0 )
Jeff Johnson295189b2012-06-20 16:38:30 -07002048 p += log_sprintf( pMac, p, "failed to unpack.....status = %x\n", status);
2049 else
Madan Mohan Koyyalamudi8f207c12012-10-30 18:18:38 -07002050 rrmProcessNeighborReportResponse( pMac, frm, psessionEntry );
2051 vos_mem_free(frm);
Jeff Johnson295189b2012-06-20 16:38:30 -07002052 }
2053 break;
2054 case 5:
2055 {
2056// FIXME.
Jeff Johnson295189b2012-06-20 16:38:30 -07002057 }
2058 break;
2059 case 6:
2060 {
2061 tPowerdBm localConstraint = (tPowerdBm) arg3;
2062 tPowerdBm maxTxPower = cfgGetRegulatoryMaxTransmitPower( pMac, psessionEntry->currentOperChannel );
2063 maxTxPower = VOS_MIN( maxTxPower, maxTxPower-localConstraint );
2064 if( maxTxPower != psessionEntry->maxTxPower )
2065 {
2066 rrmSendSetMaxTxPowerReq( pMac, maxTxPower, psessionEntry );
2067 psessionEntry->maxTxPower = maxTxPower;
2068 }
2069 }
2070 break;
2071 default:
2072 p += log_sprintf( pMac, p, "Invalid option" );
2073 break;
2074 }
2075 return p;
2076}
2077#endif
2078
2079#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
2080#ifdef RSSI_HACK
2081/* This dump command is needed to set the RSSI values in TL while testing handoff. Handoff code was tested
2082 * using this dump command. Whatever the value gives as the first parameter will be considered as the average
2083 * RSSI by TL and invokes corresponding callback registered by the clients */
2084extern int dumpCmdRSSI;
2085static char *
2086dump_lim_set_tl_data_pkt_rssi( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
2087{
2088 dumpCmdRSSI = arg1;
2089 limLog(pMac, LOGE, FL("Setting TL data packet RSSI to %d"), dumpCmdRSSI);
2090 return p;
2091}
2092#endif
2093#endif
2094
2095#if defined WLAN_FEATURE_VOWIFI_11R
2096/* This command is used to trigger FT Preauthentication with the AP with BSSID below */
2097static char *
2098dump_lim_ft_event( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
2099{
2100 static tANI_U8 macAddr[6] = {0x00, 0xde, 0xad, 0xaf, 0xaf, 0x04};
2101 tpPESession psessionEntry;
2102 tSirMsgQ msg;
2103 tpSirFTPreAuthReq pftPreAuthReq;
2104 tANI_U16 auth_req_len = 0;
2105 tCsrRoamConnectedProfile Profile;
2106
2107 csrRoamCopyConnectProfile(pMac, arg2, &Profile);
2108
2109 if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg2) )== NULL)
2110 {
2111 p += log_sprintf( pMac,
2112 p,"Session does not exist usage: 363 <0> sessionid channel \n");
2113 return p;
2114 }
2115
2116 switch (arg1)
2117 {
2118 case 0:
2119 // Send Pre-auth event
2120 {
2121 /*----------------*/
2122 p += log_sprintf( pMac,p, "Preparing Pre Auth Req message\n");
2123 auth_req_len = sizeof(tSirFTPreAuthReq);
2124
2125 pftPreAuthReq = vos_mem_malloc(auth_req_len);
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302126 if (NULL == pftPreAuthReq)
Jeff Johnson295189b2012-06-20 16:38:30 -07002127 {
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302128 p += log_sprintf( pMac,p,"Pre auth dump: AllocateMemory() failed \n");
Jeff Johnson295189b2012-06-20 16:38:30 -07002129 return p;
2130 }
2131 pftPreAuthReq->pbssDescription = vos_mem_malloc(sizeof(Profile.pBssDesc->length)+
2132 Profile.pBssDesc->length);
2133
2134 pftPreAuthReq->messageType = eWNI_SME_FT_PRE_AUTH_REQ;
2135 pftPreAuthReq->length = auth_req_len + sizeof(Profile.pBssDesc->length) +
2136 Profile.pBssDesc->length;
2137 pftPreAuthReq->preAuthchannelNum = 6;
2138
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302139 vos_mem_copy((void *) &pftPreAuthReq->currbssId,
Jeff Johnson295189b2012-06-20 16:38:30 -07002140 (void *)psessionEntry->bssId, 6);
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302141 vos_mem_copy((void *) &pftPreAuthReq->preAuthbssId,
Jeff Johnson295189b2012-06-20 16:38:30 -07002142 (void *)macAddr, 6);
2143 pftPreAuthReq->ft_ies_length = (tANI_U16)pMac->ft.ftSmeContext.auth_ft_ies_length;
2144
2145 // Also setup the mac address in sme context.
Bansidhar Gopalachari2f7395d2013-07-12 11:24:23 +05302146 vos_mem_copy(pMac->ft.ftSmeContext.preAuthbssId, macAddr, 6);
Jeff Johnson295189b2012-06-20 16:38:30 -07002147
2148 vos_mem_copy(pftPreAuthReq->ft_ies, pMac->ft.ftSmeContext.auth_ft_ies,
2149 pMac->ft.ftSmeContext.auth_ft_ies_length);
2150
2151 vos_mem_copy(Profile.pBssDesc->bssId, macAddr, 6);
2152
2153 p += log_sprintf( pMac,p, "\n ----- LIM Debug Information ----- \n");
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002154 p += log_sprintf( pMac, p, "%s: length = %d\n", __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07002155 (int)pMac->ft.ftSmeContext.auth_ft_ies_length);
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002156 p += log_sprintf( pMac, p, "%s: length = %02x\n", __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07002157 (int)pMac->ft.ftSmeContext.auth_ft_ies[0]);
2158 p += log_sprintf( pMac, p, "%s: Auth Req %02x %02x %02x\n",
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002159 __func__, pftPreAuthReq->ft_ies[0],
Jeff Johnson295189b2012-06-20 16:38:30 -07002160 pftPreAuthReq->ft_ies[1], pftPreAuthReq->ft_ies[2]);
2161
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002162 p += log_sprintf( pMac, p, "%s: Session %02x %02x %02x\n", __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07002163 psessionEntry->bssId[0],
2164 psessionEntry->bssId[1], psessionEntry->bssId[2]);
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -07002165 p += log_sprintf( pMac, p, "%s: Session %02x %02x %02x %p\n", __func__,
Jeff Johnson295189b2012-06-20 16:38:30 -07002166 pftPreAuthReq->currbssId[0],
2167 pftPreAuthReq->currbssId[1],
2168 pftPreAuthReq->currbssId[2], pftPreAuthReq);
2169
2170 Profile.pBssDesc->channelId = (tANI_U8)arg3;
2171 vos_mem_copy((void *)pftPreAuthReq->pbssDescription, (void *)Profile.pBssDesc,
2172 Profile.pBssDesc->length);
2173
2174 msg.type = eWNI_SME_FT_PRE_AUTH_REQ;
2175 msg.bodyptr = pftPreAuthReq;
2176 msg.bodyval = 0;
2177
2178 p += log_sprintf( pMac, p, "limPostMsgApi(eWNI_SME_FT_PRE_AUTH_REQ) \n");
2179 limPostMsgApi(pMac, &msg);
2180 }
2181 break;
2182
2183 default:
2184 break;
2185 }
2186 return p;
2187}
2188#endif
Jeff Johnsone7245742012-09-05 17:12:55 -07002189static char *
2190dump_lim_channel_switch_announcement( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
2191{
2192 tpPESession psessionEntry;
2193 tANI_U8 nMode = arg2;
2194 tANI_U8 nNewChannel = arg3;
2195 tANI_U8 nCount = arg4;
2196 tANI_U8 peer[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
Jeff Johnson295189b2012-06-20 16:38:30 -07002197
Jeff Johnsone7245742012-09-05 17:12:55 -07002198 if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg1) )== NULL)
2199 {
2200 p += log_sprintf( pMac,
2201 p,"Session does not exist usage: 363 <0> sessionid channel \n");
Mahesh Kumar Kalikot Veetil2aad8d82013-02-07 12:31:28 -08002202 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_WARN,"Session Not found!!!!");
Jeff Johnsone7245742012-09-05 17:12:55 -07002203 return p;
2204 }
2205
2206 limSendChannelSwitchMgmtFrame( pMac, peer, nMode, nNewChannel, nCount, psessionEntry );
2207
2208 psessionEntry->gLimChannelSwitch.switchCount = nCount;
2209 psessionEntry->gLimSpecMgmt.dot11hChanSwState = eLIM_11H_CHANSW_RUNNING;
2210 psessionEntry->gLimChannelSwitch.switchMode = nMode;
2211 psessionEntry->gLimChannelSwitch.primaryChannel = nNewChannel;
2212
2213 schSetFixedBeaconFields(pMac, psessionEntry);
2214 limSendBeaconInd(pMac, psessionEntry);
2215
2216 return p;
2217}
2218
Mohit Khanna4a70d262012-09-11 16:30:12 -07002219#ifdef WLAN_FEATURE_11AC
2220static char *
2221dump_lim_vht_opmode_notification(tpAniSirGlobal pMac, tANI_U32 arg1,tANI_U32 arg2,tANI_U32 arg3, tANI_U32 arg4, char *p)
2222{
2223 tANI_U8 peer[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
2224 tANI_U8 nMode = arg2;
2225 tpPESession psessionEntry;
2226
2227 if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg1) )== NULL)
2228 {
2229 p += log_sprintf( pMac,
2230 p,"Session does not exist usage: 366 <0> sessionid channel \n");
2231 return p;
2232 }
2233
2234 limSendVHTOpmodeNotificationFrame(pMac, peer, nMode,psessionEntry);
2235
2236 psessionEntry->gLimOperatingMode.present = 1;
2237 psessionEntry->gLimOperatingMode.chanWidth = nMode;
2238 psessionEntry->gLimOperatingMode.rxNSS = 0;
2239 psessionEntry->gLimOperatingMode.rxNSSType = 0;
2240
2241 schSetFixedBeaconFields(pMac, psessionEntry);
2242 limSendBeaconInd(pMac, psessionEntry);
2243
2244 return p;
2245}
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -07002246
2247static char *
2248dump_lim_vht_channel_switch_notification(tpAniSirGlobal pMac, tANI_U32 arg1,tANI_U32 arg2,tANI_U32 arg3, tANI_U32 arg4, char *p)
2249{
2250 tpPESession psessionEntry;
2251 tANI_U8 nChanWidth = arg2;
2252 tANI_U8 nNewChannel = arg3;
2253 tANI_U8 ncbMode = arg4;
2254 tANI_U8 peer[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
2255
2256 if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg1) )== NULL)
2257 {
2258 p += log_sprintf( pMac,
2259 p,"Session does not exist usage: 367 <0> sessionid channel \n");
Mahesh Kumar Kalikot Veetil2aad8d82013-02-07 12:31:28 -08002260 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_WARN,"Session Not found!!!!");
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -07002261 return p;
2262 }
2263
2264 limSendVHTChannelSwitchMgmtFrame( pMac, peer, nChanWidth, nNewChannel, (ncbMode+1), psessionEntry );
2265
2266 psessionEntry->gLimChannelSwitch.switchCount = 0;
2267 psessionEntry->gLimSpecMgmt.dot11hChanSwState = eLIM_11H_CHANSW_RUNNING;
2268 psessionEntry->gLimChannelSwitch.switchMode = 1;
2269 psessionEntry->gLimChannelSwitch.primaryChannel = nNewChannel;
2270 psessionEntry->gLimWiderBWChannelSwitch.newChanWidth = nChanWidth;
2271 psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq0 = limGetCenterChannel(pMac,nNewChannel,(ncbMode+1),nChanWidth);
2272 psessionEntry->gLimWiderBWChannelSwitch.newCenterChanFreq1 = 0;
2273
2274 schSetFixedBeaconFields(pMac, psessionEntry);
2275 limSendBeaconInd(pMac, psessionEntry);
2276
2277 return p;
2278}
2279
Mohit Khanna4a70d262012-09-11 16:30:12 -07002280#endif
Jeff Johnsone7245742012-09-05 17:12:55 -07002281static char *
2282dump_lim_cancel_channel_switch_announcement( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
2283{
2284 tpPESession psessionEntry;
2285
2286 if((psessionEntry = peFindSessionBySessionId(pMac,(tANI_U8)arg1) )== NULL)
2287 {
2288 p += log_sprintf( pMac,
2289 p,"Session does not exist usage: 363 <0> sessionid channel \n");
Mahesh Kumar Kalikot Veetil2aad8d82013-02-07 12:31:28 -08002290 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_WARN,"Session Not found!!!!");
Jeff Johnsone7245742012-09-05 17:12:55 -07002291 return p;
2292 }
2293 psessionEntry->gLimChannelSwitch.switchCount = 0;
2294 psessionEntry->gLimSpecMgmt.dot11hChanSwState = eLIM_11H_CHANSW_INIT;
2295 psessionEntry->gLimChannelSwitch.switchMode = 0;
2296 psessionEntry->gLimChannelSwitch.primaryChannel = 0;
2297
2298 schSetFixedBeaconFields(pMac, psessionEntry);
2299 limSendBeaconInd(pMac, psessionEntry);
2300
2301 return p;
2302}
Madan Mohan Koyyalamudi01cba042013-01-10 21:56:05 -08002303
2304
2305static char *
2306dump_lim_mcc_policy_maker(tpAniSirGlobal pMac, tANI_U32 arg1,tANI_U32 arg2,tANI_U32 arg3, tANI_U32 arg4, char *p)
2307{
2308 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_FATAL, "dump_lim_mcc_policy_maker arg = %d",arg1);
2309
2310 if(arg1 == 0) //Disable feature completely
2311 {
2312 WDA_TrafficStatsTimerActivate(FALSE);
2313 if (ccmCfgSetInt(pMac, WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED, FALSE,
2314 NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE)
2315 {
2316 limLog( pMac, LOGE, FL("Could not get WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED"));
2317 }
2318 }
2319 else if(arg1 == 1) //Enable feature
2320 {
2321 if (ccmCfgSetInt(pMac, WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED, TRUE,
2322 NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE)
2323 {
2324 limLog( pMac, LOGE, FL("Could not set WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED"));
2325 }
2326 }
2327 else if(arg1 == 2) //Enable feature and activate periodic timer
2328 {
2329 if (ccmCfgSetInt(pMac, WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED, TRUE,
2330 NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE)
2331 {
2332 limLog( pMac, LOGE, FL("Could not set WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED"));
2333 }
2334 WDA_TrafficStatsTimerActivate(TRUE);
2335 }
2336 else if(arg1 == 3) //Enable only stats collection - Used for unit testing
2337 {
2338 VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_FATAL, "Enabling Traffic Stats in DTS");
2339 WDI_DS_ActivateTrafficStats();
2340 }
2341 else if(arg1 == 4) //Send current stats snapshot to Riva -- Used for unit testing
2342 {
2343 v_VOID_t * pVosContext = vos_get_global_context(VOS_MODULE_ID_WDA, NULL);
2344 tWDA_CbContext *pWDA = vos_get_context(VOS_MODULE_ID_WDA, pVosContext);
2345 ccmCfgSetInt(pMac, WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED, TRUE, NULL, eANI_BOOLEAN_FALSE);
Kiran Kumar Lokerea4db3dc2013-03-25 18:05:24 -07002346 if(pWDA != NULL)
2347 {
2348 WDA_TimerTrafficStatsInd(pWDA);
2349 }
Madan Mohan Koyyalamudi01cba042013-01-10 21:56:05 -08002350 WDA_TrafficStatsTimerActivate(FALSE);
2351 ccmCfgSetInt(pMac, WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED, FALSE,NULL, eANI_BOOLEAN_FALSE);
2352 }
2353 else if (arg1 == 5) //Change the periodicity of TX stats timer
2354 {
2355 v_VOID_t * pVosContext = vos_get_global_context(VOS_MODULE_ID_WDA, NULL);
2356 tWDA_CbContext *pWDA = vos_get_context(VOS_MODULE_ID_WDA, pVosContext);
Kiran Kumar Lokerea4db3dc2013-03-25 18:05:24 -07002357 if (pWDA != NULL && tx_timer_change(&pWDA->wdaTimers.trafficStatsTimer, arg2/10, arg2/10) != TX_SUCCESS)
Madan Mohan Koyyalamudi01cba042013-01-10 21:56:05 -08002358 {
2359 limLog(pMac, LOGP, FL("Disable timer before changing timeout value"));
2360 }
2361 }
2362 return p;
2363}
2364
Ravi Kumar Vaishnavb7652402013-01-18 19:05:15 -08002365#ifdef WLANTL_DEBUG
2366/* API to print number of pkts received based on rate index */
2367/* arg1 = station Id */
2368/* arg2 = BOOLEAN value to either or not flush the counters */
2369static char *
2370dump_lim_get_pkts_rcvd_per_rate_idx( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
2371{
2372 /* if anything other than 1, then we need not flush the counters */
2373 if( arg2 != 1)
2374 arg2 = FALSE;
2375
2376 WLANTLPrintPktsRcvdPerRateIdx(pMac->roam.gVosContext, (tANI_U8)arg1, (v_BOOL_t)arg2);
2377 return p;
2378}
2379
2380/* API to print number of pkts received based on rssi */
2381/* arg1 = station Id */
2382/* arg2 = BOOLEAN value to either or not flush the counters */
2383static char *
2384dump_lim_get_pkts_rcvd_per_rssi_values( tpAniSirGlobal pMac, tANI_U32 arg1, tANI_U32 arg2, tANI_U32 arg3, tANI_U32 arg4, char *p)
2385{
2386 /* if anything other than 1, then we need not flush the counters */
2387 if( arg2 != 1)
2388 arg2 = FALSE;
2389
2390 WLANTLPrintPktsRcvdPerRssi(pMac->roam.gVosContext, (tANI_U8)arg1, (v_BOOL_t)arg2);
2391 return p;
2392}
2393#endif
2394
Jeff Johnson295189b2012-06-20 16:38:30 -07002395static tDumpFuncEntry limMenuDumpTable[] = {
2396 {0, "PE (300-499)", NULL},
Jeff Johnsone7245742012-09-05 17:12:55 -07002397 {300, "LIM: Dump state(s)/statistics <session id>", dump_lim_info},
Jeff Johnson295189b2012-06-20 16:38:30 -07002398 {301, "PE.LIM: dump TSPEC Table", dump_lim_tspec_table},
2399 {302, "PE.LIM: dump specified TSPEC entry (id)", dump_lim_tspec_entry},
2400 {303, "PE.LIM: dump EDCA params", dump_lim_edca_params},
2401 {304, "PE.LIM: dump DPH table summary", dump_lim_dph_table_summary},
2402 {305, "PE.LIM: dump link monitor stats", dump_lim_link_monitor_stats},
2403 {306, "PE.LIM:dump Set the BAR Decline stat(arg1= 1/0 (enable/disable) arg2 =TID", dump_lim_AddBA_DeclineStat},
2404 {307, "PE: LIM: dump CSR Send ReAssocReq", dump_lim_sme_reassoc_req},
2405 {308, "PE:LIM: dump all 11H related data", dump_lim_dot11h_stats},
2406 {309, "PE:LIM: dump to enable Measurement on AP", dump_lim_enable_measurement},
2407 {310, "PE:LIM: dump to enable QuietIE on AP", dump_lim_enable_quietIE},
2408 {311, "PE:LIM: disable/enable scan 1(disable)", dump_lim_disable_enable_scan},
2409 {320, "PE.LIM: send sme scan request", dump_lim_scan_req_send},
2410
2411
2412 /*FIXME_GEN6*/
2413 /* This dump command is more of generic dump cmd and hence it should
2414 * be moved to logDump.c
2415 */
2416 {321, "PE:LIM: Set Log Level <VOS Module> <VOS Log Level>", dump_lim_update_log_level},
2417 {322, "PE.LIM: Enable/Disable PE Tracing", dump_lim_trace_cfg},
2418 {323, "PE.LIM: Trace Dump if enabled", dump_lim_trace_dump},
2419 {331, "PE.LIM: Send finish scan to LIM", dump_lim_finishscan_send},
2420 {332, "PE.LIM: force probe rsp send from LIM", dump_lim_prb_rsp_send},
2421 {333, "PE.SCH: Trigger to generate a beacon", dump_sch_beacon_trigger},
2422 {335, "PE.LIM: set ACM flag (0..3)", dump_lim_acm_set},
2423 {336, "PE.LIM: Send an ADDBA Req to peer MAC arg1=aid,arg2=tid, arg3=ssn", dump_lim_addba_req},
2424 {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},
2425 {338, "PE.LIM: Trigger a BA timeout for STA index", dump_lim_ba_timeout},
2426 {339, "PE.LIM: List active BA session(s) for AssocID", dump_lim_list_active_ba},
2427 {340, "PE.LIM: Set background scan flag (0-disable, 1-enable)",dump_lim_bgscan_toggle},
2428 {341, "PE.LIM: Set link monitoring mode", dump_lim_linkmonitor_toggle},
2429 {342, "PE.LIM: AddSta <6th byte of station Mac>", dump_lim_add_sta},
2430 {343, "PE.LIM: DelSta <aid>", dump_lim_del_sta},
2431 {344, "PE.LIM: Set probe respond flag", dump_lim_proberesp_toggle},
2432 {345, "PE.LIM: set protection config bitmap", set_lim_prot_cfg},
2433 {346, "PE:LIM: Set the Dot11 Mode", dump_lim_set_dot11_mode},
2434 {347, "PE:Enable or Disable Protection", dump_lim_set_protection_control},
2435 {348, "PE:LIM: Send SM Power Mode Action frame", dump_lim_send_SM_Power_Mode},
Jeff Johnsone7245742012-09-05 17:12:55 -07002436 {349, "PE: LIM: Change CB Mode <session id> <sec chnl offset>",dump_lim_update_cb_Mode},
Jeff Johnson295189b2012-06-20 16:38:30 -07002437 {350, "PE: LIM: abort scan", dump_lim_abort_scan},
2438 {351, "PE: LIM: Start stop BG scan", dump_lim_start_stop_bg_scan},
2439 {352, "PE: LIM: PE statistics <scanmask>", dump_lim_get_pe_statistics},
2440 {353, "PE: LIM: Set MAC log level <Mac Module ID> <Log Level>", dump_lim_set_log_level},
2441 {354, "PE: LIM: Set Scan in Power Save <0-disable, 1-enable>", dump_lim_set_scan_in_powersave},
2442 {355, "PE.LIM: send sme start BSS request", dump_lim_send_start_bss_req},
2443 {356, "PE.LIM: dump pesession info ", dump_lim_session_print},
2444 {357, "PE.LIM: send DisAssocRequest", dump_lim_send_disassoc_req},
2445 {358, "PE.LIM: send sme stop bss request <session ID>", dump_lim_stop_bss_req},
2446 {359, "PE.LIM: send sme join request", dump_lim_send_join_req},
2447#if defined WLAN_FEATURE_VOWIFI
2448 {360, "PE.LIM: send an RRM action frame", dump_lim_send_rrm_action},
2449 {361, "PE.LIM: unpack an RRM action frame", dump_lim_unpack_rrm_action},
2450#endif
2451#ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
2452#ifdef RSSI_HACK
2453 {362, "TL Set current RSSI", dump_lim_set_tl_data_pkt_rssi},
2454#endif
2455#endif
2456#ifdef WLAN_FEATURE_VOWIFI_11R
2457 {363, "PE.LIM: trigger pre auth/reassoc event", dump_lim_ft_event},
2458#endif
Jeff Johnsone7245742012-09-05 17:12:55 -07002459 {364, "PE.LIM: Send a channel switch announcement", dump_lim_channel_switch_announcement},
2460 {365, "PE.LIM: Cancel channel switch announcement", dump_lim_cancel_channel_switch_announcement},
Mohit Khanna4a70d262012-09-11 16:30:12 -07002461#ifdef WLAN_FEATURE_11AC
2462 {366, "PE.LIM: Send a VHT OPMode Action Frame", dump_lim_vht_opmode_notification},
Madan Mohan Koyyalamudic6226de2012-09-18 16:33:31 -07002463 {367, "PE.LIM: Send a VHT Channel Switch Announcement", dump_lim_vht_channel_switch_notification},
Madan Mohan Koyyalamudi01cba042013-01-10 21:56:05 -08002464 {368, "PE.LIM: MCC Policy Maker", dump_lim_mcc_policy_maker},
Mohit Khanna4a70d262012-09-11 16:30:12 -07002465#endif
Ravi Kumar Vaishnavb7652402013-01-18 19:05:15 -08002466#ifdef WLANTL_DEBUG
2467 {369, "PE.LIM: pkts/rateIdx: iwpriv wlan0 dump 368 <staId> <boolean to flush counter>", dump_lim_get_pkts_rcvd_per_rate_idx},
2468 {370, "PE.LIM: pkts/rssi: : iwpriv wlan0 dump 369 <staId> <boolean to flush counter>", dump_lim_get_pkts_rcvd_per_rssi_values},
2469#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07002470};
2471
2472
2473
2474void limDumpInit(tpAniSirGlobal pMac)
2475{
2476 logDumpRegisterTable( pMac, &limMenuDumpTable[0],
2477 sizeof(limMenuDumpTable)/sizeof(limMenuDumpTable[0]) );
2478}
2479
2480
2481#endif //#if defined(ANI_LOGDUMP)
2482