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