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