• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * siteMgrDebug.c
3  *
4  * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  *  * Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  *  * Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in
15  *    the documentation and/or other materials provided with the
16  *    distribution.
17  *  * Neither the name Texas Instruments nor the names of its
18  *    contributors may be used to endorse or promote products derived
19  *    from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 /** \file reportReplvl.c
35  *  \brief Report level implementation
36  *
37  *  \see reportReplvl.h
38  */
39 
40 /** \file   siteMgrDebug.c
41  *  \brief  The siteMgrDebug module.
42  *
43  *  \see    siteMgrDebug.h
44  */
45 
46 #include "tidef.h"
47 #include "osApi.h"
48 #include "paramOut.h"
49 #include "siteMgrDebug.h"
50 #include "siteMgrApi.h"
51 #include "siteHash.h"
52 #include "report.h"
53 #include "CmdDispatcher.h"
54 #include "DrvMainModules.h"
55 #include "sme.h"
56 #include "apConn.h"
57 #include "healthMonitor.h"
58 #include "conn.h"
59 #include "connApi.h"
60 
61 #ifdef XCC_MODULE_INCLUDED
62 #include "XCCMngr.h"
63 #endif
64 
65 
66 static void printPrimarySite(siteMgr_t *pSiteMgr);
67 
68 void printSiteTable(siteMgr_t *pSiteMgr, char *desiredSsid);
69 
70 static void printDesiredParams(siteMgr_t *pSiteMgr, TI_HANDLE hCmdDispatch);
71 
72 static void printPrimarySiteDesc(siteMgr_t *pSiteMgr, OS_802_11_BSSID *pPrimarySiteDesc);
73 
74 static void setRateSet(TI_UINT8 maxRate, TRates *pRates);
75 
76 void printSiteMgrHelpMenu(void);
77 
78 /*	Function implementation */
siteMgrDebugFunction(TI_HANDLE hSiteMgr,TStadHandlesList * pStadHandles,TI_UINT32 funcType,void * pParam)79 void siteMgrDebugFunction (TI_HANDLE         hSiteMgr,
80                            TStadHandlesList *pStadHandles,
81                            TI_UINT32         funcType,
82                            void             *pParam)
83 {
84 	siteMgr_t *pSiteMgr = (siteMgr_t *)hSiteMgr;
85 	paramInfo_t		param;
86 	TSsid			newDesiredSsid;
87 	TI_UINT8		value;
88 	TI_UINT8		i;
89 	OS_802_11_BSSID primarySiteDesc;
90 	TRates			ratesSet;
91 
92 
93 	newDesiredSsid.len = 5;
94 	os_memoryCopy(pSiteMgr->hOs, (void *)newDesiredSsid.str, "yaeli", 5);
95 
96 
97 	switch (funcType)
98 	{
99 	case SITE_MGR_DEBUG_HELP_MENU:
100 		printSiteMgrHelpMenu();
101 		break;
102 
103 	case PRIMARY_SITE_DBG:
104 		printPrimarySite(pSiteMgr);
105 		break;
106 
107 	case SITE_TABLE_DBG:
108 		printSiteTable(pSiteMgr, NULL);
109 		break;
110 
111 	case DESIRED_PARAMS_DBG:
112 		printDesiredParams(pSiteMgr, pStadHandles->hCmdDispatch);
113 		break;
114 
115 	case GET_PRIMARY_SITE_DESC_DBG:
116 		param.paramType = SITE_MGR_GET_SELECTED_BSSID_INFO;
117 		param.content.pSiteMgrPrimarySiteDesc = &primarySiteDesc;
118 		cmdDispatch_GetParam(pStadHandles->hCmdDispatch, &param);
119 		printPrimarySiteDesc(pSiteMgr, &primarySiteDesc);
120 		break;
121 
122 	case SET_RSN_DESIRED_CIPHER_SUITE_DBG:
123 		param.paramType = RSN_ENCRYPTION_STATUS_PARAM;
124 		value = *((TI_UINT32 *)pParam);
125 		param.content.rsnEncryptionStatus = (ECipherSuite)value;
126 		cmdDispatch_SetParam(pStadHandles->hCmdDispatch, &param);
127 		WLAN_OS_REPORT(("\nSetting RSN_DESIRED_CIPHER_SUITE_PARAM : %d\n", value));
128 		break;
129 
130 	case GET_RSN_DESIRED_CIPHER_SUITE_DBG:
131 		param.paramType = RSN_ENCRYPTION_STATUS_PARAM;
132 		cmdDispatch_GetParam(pStadHandles->hCmdDispatch, &param);
133 		WLAN_OS_REPORT(("\nGetting RSN_DESIRED_CIPHER_SUITE_PARAM: %d\n", param.content.rsnEncryptionStatus));
134 		break;
135 
136 	case SET_RSN_DESIRED_AUTH_TYPE_DBG:
137 		param.paramType = RSN_EXT_AUTHENTICATION_MODE;
138 		value = *((TI_UINT32 *)pParam);
139 		param.content.rsnDesiredAuthType = (EAuthSuite)value;
140 		cmdDispatch_SetParam(pStadHandles->hCmdDispatch, &param);
141 		if (value == RSN_AUTH_OPEN)
142 			WLAN_OS_REPORT(("\nSetting RSN_DESIRED_AUTH_TYPE_PARAM:	RSN_AUTH_OPEN\n"));
143 		else if (value == RSN_AUTH_SHARED_KEY)
144 			WLAN_OS_REPORT(("\nSetting RSN_DESIRED_AUTH_TYPE_PARAM:	RSN_AUTH_SHARED_KEY\n"));
145 		else if (value == RSN_AUTH_AUTO_SWITCH)
146 			WLAN_OS_REPORT(("\nSetting RSN_DESIRED_AUTH_TYPE_PARAM:	RSN_AUTH_AUTO_SWITCH\n"));
147 		else
148 			WLAN_OS_REPORT(("\nSetting RSN_DESIRED_AUTH_TYPE_PARAM:	Invalid: %d\n", value));
149 		break;
150 
151 	case GET_RSN_DESIRED_AUTH_TYPE_DBG:
152 		param.paramType = RSN_EXT_AUTHENTICATION_MODE;
153 		cmdDispatch_GetParam(pStadHandles->hCmdDispatch, &param);
154 		if (param.content.rsnDesiredAuthType == RSN_AUTH_OPEN)
155 			WLAN_OS_REPORT(("\nGetting RSN_DESIRED_AUTH_TYPE_PARAM:	RSN_AUTH_OPEN\n"));
156 		else if (param.content.rsnDesiredAuthType == RSN_AUTH_SHARED_KEY)
157 			WLAN_OS_REPORT(("\nGetting RSN_DESIRED_AUTH_TYPE_PARAM:	RSN_AUTH_SHARED_KEY\n"));
158 		else if (param.content.rsnDesiredAuthType == RSN_AUTH_AUTO_SWITCH)
159 			WLAN_OS_REPORT(("\nGetting RSN_DESIRED_AUTH_TYPE_PARAM:	RSN_AUTH_AUTO_SWITCH\n"));
160 		else
161 			WLAN_OS_REPORT(("\nGetting RSN_DESIRED_AUTH_TYPE_PARAM:	Invalid: %d\n", param.content.rsnDesiredAuthType));
162 
163 		break;
164 
165 	case GET_CONNECTION_STATUS_DBG:
166 		param.paramType = SME_CONNECTION_STATUS_PARAM;
167 		cmdDispatch_GetParam(pStadHandles->hCmdDispatch, &param);
168 		if (param.content.smeSmConnectionStatus == eDot11Idle)
169 			WLAN_OS_REPORT(("\nGetting SITE_MGR_CONNECTION_STATUS_PARAM:	STATUS_IDLE\n"));
170 		else if (param.content.smeSmConnectionStatus == eDot11Scaning)
171 			WLAN_OS_REPORT(("\nGetting SITE_MGR_CONNECTION_STATUS_PARAM:	STATUS_SCANNING\n"));
172 		else if (param.content.smeSmConnectionStatus == eDot11Connecting)
173 			WLAN_OS_REPORT(("\nGetting SITE_MGR_CONNECTION_STATUS_PARAM:	STATUS_CONNECTING\n"));
174 		else if (param.content.smeSmConnectionStatus == eDot11Associated)
175 			WLAN_OS_REPORT(("\nGetting SITE_MGR_CONNECTION_STATUS_PARAM:	STATUS_ASSOCIATED\n"));
176 		else if (param.content.smeSmConnectionStatus == eDot11Disassociated)
177 			WLAN_OS_REPORT(("\nGetting SITE_MGR_CONNECTION_STATUS_PARAM:	STATUS_DIS_ASSOCIATED\n"));
178         else if (param.content.smeSmConnectionStatus == eDot11RadioDisabled)
179             WLAN_OS_REPORT(("\nGetting SITE_MGR_CONNECTION_STATUS_PARAM:	STATUS_RADIO_DISABLED\n"));
180         else
181 			WLAN_OS_REPORT(("\nGetting SITE_MGR_CONNECTION_STATUS_PARAM:	STATUS_ERROR\n"));
182 		break;
183 
184 	case SET_SUPPORTED_RATE_SET_DBG:
185 		param.paramType = SITE_MGR_DESIRED_SUPPORTED_RATE_SET_PARAM;
186 		value = *((TI_UINT32 *)pParam);
187 		setRateSet(value, &ratesSet);
188 		os_memoryCopy(pSiteMgr->hOs, &(param.content.siteMgrDesiredSupportedRateSet), &(ratesSet), sizeof(TRates));
189 		WLAN_OS_REPORT(("\nSetting SET_SUPPORTED_RATE_SET_DBG\n"));
190 		cmdDispatch_SetParam(pStadHandles->hCmdDispatch, &param);
191 		break;
192 
193 	case GET_SUPPORTED_RATE_SET_DBG:
194 		param.paramType = SITE_MGR_DESIRED_SUPPORTED_RATE_SET_PARAM;
195 		cmdDispatch_GetParam(pStadHandles->hCmdDispatch, &param);
196 		WLAN_OS_REPORT(("\nGetting SITE_MGR_DESIRED_SUPPORTED_RATE_SET_PARAM\n"));
197 		if(param.content.siteMgrDesiredSupportedRateSet.len == 0)
198 			WLAN_OS_REPORT(("\nNo rates defined\n"));
199 		else
200 		{
201 			/* It looks like it never happens. Anyway decided to check */
202             if ( param.content.siteMgrDesiredSupportedRateSet.len > DOT11_MAX_SUPPORTED_RATES )
203             {
204                 WLAN_OS_REPORT(("siteMgrDebugFunction. param.content.siteMgrDesiredSupportedRateSet.len=%d exceeds the limit %d\n",
205                          param.content.siteMgrDesiredSupportedRateSet.len, DOT11_MAX_SUPPORTED_RATES));
206                 handleRunProblem(PROBLEM_BUF_SIZE_VIOLATION);
207                 param.content.siteMgrDesiredSupportedRateSet.len = DOT11_MAX_SUPPORTED_RATES;
208             }
209 			for (i = 0; i < param.content.siteMgrDesiredSupportedRateSet.len; i++)
210 				WLAN_OS_REPORT(("\nRate %d is 0x%X\n", i +1, param.content.siteMgrDesiredSupportedRateSet.ratesString[i]));
211 		}
212 		break;
213 
214 	case SET_MLME_LEGACY_AUTH_TYPE_DBG:
215 		param.paramType = MLME_LEGACY_TYPE_PARAM;
216 		value = *((TI_UINT32 *)pParam);
217 		param.content.mlmeLegacyAuthType = (legacyAuthType_e)value;
218 		cmdDispatch_SetParam(pStadHandles->hCmdDispatch, &param);
219 		if (value == AUTH_LEGACY_OPEN_SYSTEM)
220 			WLAN_OS_REPORT(("\nSetting MLME_LEGACY_TYPE_PARAM:	AUTH_LEGACY_OPEN_SYSTEM\n"));
221 		else if (value == AUTH_LEGACY_SHARED_KEY)
222 			WLAN_OS_REPORT(("\nSetting MLME_LEGACY_TYPE_PARAM:	AUTH_LEGACY_SHARED_KEY\n"));
223 		else if (value == AUTH_LEGACY_AUTO_SWITCH)
224 			WLAN_OS_REPORT(("\nSetting MLME_LEGACY_TYPE_PARAM:	AUTH_LEGACY_AUTO_SWITCH\n"));
225 		else
226 			WLAN_OS_REPORT(("\nSetting MLME_LEGACY_TYPE_PARAM:	Invalid: %d\n", value));
227 		break;
228 
229 	case GET_MLME_LEGACY_AUTH_TYPE_DBG:
230 		param.paramType = MLME_LEGACY_TYPE_PARAM;
231 		cmdDispatch_GetParam(pStadHandles->hCmdDispatch, &param);
232 		if (param.content.mlmeLegacyAuthType == AUTH_LEGACY_OPEN_SYSTEM)
233 			WLAN_OS_REPORT(("\nGetting MLME_LEGACY_TYPE_PARAM:	AUTH_LEGACY_OPEN_SYSTEM\n"));
234 		else if (param.content.rsnDesiredAuthType == AUTH_LEGACY_SHARED_KEY)
235 			WLAN_OS_REPORT(("\nGetting MLME_LEGACY_TYPE_PARAM:	AUTH_LEGACY_SHARED_KEY\n"));
236 		else if (param.content.rsnDesiredAuthType == AUTH_LEGACY_AUTO_SWITCH)
237 			WLAN_OS_REPORT(("\nGetting MLME_LEGACY_TYPE_PARAM:	AUTH_AUTO_SWITCH\n"));
238 		else
239 			WLAN_OS_REPORT(("\nGetting MLME_LEGACY_TYPE_PARAM:	Invalid: %d\n", param.content.rsnDesiredAuthType));
240 
241 		break;
242 
243 
244 	case RADIO_STAND_BY_CHANGE_STATE:
245 		WLAN_OS_REPORT(("\nChange GPIO-13 State...\n"));
246 		break;
247 
248 
249     case PRINT_FAILURE_EVENTS:
250         {
251 
252 	WLAN_OS_REPORT(("\n PRINT HEALTH MONITOR LOG\n"));
253 	healthMonitor_printFailureEvents (pStadHandles->hHealthMonitor);
254 	apConn_printStatistics(pStadHandles->hAPConnection);
255 #ifdef REPORT_LOG
256         conn_ibssPrintStatistics(pStadHandles->hConn);
257 #endif
258         if (((conn_t*)pStadHandles->hConn)->currentConnType==CONNECTION_INFRA)
259         {
260             switch (((conn_t*)pStadHandles->hConn)->state)
261             {
262             case   0:  WLAN_OS_REPORT((" CONN state is IDLE\n"));
263                 break;
264              case   1:  WLAN_OS_REPORT((" CONN state is SCR_WAIT\n"));
265                 break;
266              case   2:  WLAN_OS_REPORT((" CONN state is WAIT_JOIN_CMPLT\n"));
267                 break;
268              case   3:  WLAN_OS_REPORT((" CONN state is MLME_WAIT\n"));
269                 break;
270              case   4:  WLAN_OS_REPORT((" CONN state is RSN_WAIT\n"));
271                 break;
272              case   5:  WLAN_OS_REPORT((" CONN state is CONFIG_HW\n"));
273                 break;
274              case   6:  WLAN_OS_REPORT((" CONN state is CONNECTED\n"));
275                 break;
276             case   7:  WLAN_OS_REPORT((" CONN state is DISASSOCC\n"));
277                break;
278             default:
279                 break;
280             }
281         }
282         }
283         break;
284 
285 	case FORCE_HW_RESET_RECOVERY:
286 		WLAN_OS_REPORT(("\n Currently not supported!\n"));
287 		break;
288 
289 	case FORCE_SOFT_RECOVERY:
290 		WLAN_OS_REPORT(("\n FORCE Full Recovery (Soft)\n"));
291 		break;
292 
293 
294 	case PERFORM_HEALTH_TEST:
295 		WLAN_OS_REPORT(("\n PERFORM_HEALTH_TEST \n"));
296 		healthMonitor_PerformTest(pStadHandles->hHealthMonitor, TI_FALSE);
297 		break;
298 
299 	case PRINT_SITE_TABLE_PER_SSID:
300 		printSiteTable(pSiteMgr, (char*)pParam);
301 		break;
302 
303 	case SET_DESIRED_CHANNEL:
304 		param.paramType = SITE_MGR_DESIRED_CHANNEL_PARAM;
305 		param.content.siteMgrDesiredChannel = *(TI_UINT8*)pParam;
306 		siteMgr_setParam(pStadHandles->hSiteMgr, &param);
307 		break;
308 
309 	default:
310 		WLAN_OS_REPORT(("Invalid function type in Debug Site Manager Function Command: %d\n\n", funcType));
311 		break;
312 	}
313 }
314 
printPrimarySite(siteMgr_t * pSiteMgr)315 static void printPrimarySite(siteMgr_t *pSiteMgr)
316 {
317 	siteEntry_t *pSiteEntry;
318     TI_UINT8	len;
319 	char	ssid[MAX_SSID_LEN + 1];
320 
321 	pSiteEntry = pSiteMgr->pSitesMgmtParams->pPrimarySite;
322 
323 	if (pSiteEntry == NULL)
324 	{
325 		WLAN_OS_REPORT(("\n\n************************	PRIMARY SITE IS NULL	****************************\n\n\n"));
326 		return;
327 	}
328 
329 	WLAN_OS_REPORT(("\n\n************************	PRIMARY SITE	****************************\n\n\n"));
330 
331 	WLAN_OS_REPORT(("BSSID			%2X-%2X-%2X-%2X-%2X-%2X	",
332 														pSiteEntry->bssid[0],
333 														pSiteEntry->bssid[1],
334 														pSiteEntry->bssid[2],
335 														pSiteEntry->bssid[3],
336 														pSiteEntry->bssid[4],
337 														pSiteEntry->bssid[5]));
338     len = pSiteEntry->ssid.len;
339     /* It looks like it never happens. Anyway decided to check */
340     if ( pSiteEntry->ssid.len > MAX_SSID_LEN )
341     {
342         WLAN_OS_REPORT(("printPrimarySite. pSiteEntry->ssid.len=%d exceeds the limit %d\n",
343                    pSiteEntry->ssid.len, MAX_SSID_LEN));
344         handleRunProblem(PROBLEM_BUF_SIZE_VIOLATION);
345         len = MAX_SSID_LEN;
346     }
347 	os_memoryCopy(pSiteMgr->hOs, ssid, (void *)pSiteEntry->ssid.str, len);
348 	ssid[len] = '\0';
349 	WLAN_OS_REPORT(("SSID			%s\n\n", ssid));
350 
351 	if (pSiteEntry->bssType == BSS_INFRASTRUCTURE)
352 		WLAN_OS_REPORT(("BSS Type		INFRASTRUCTURE\n\n"));
353 	else if (pSiteEntry->bssType == BSS_INDEPENDENT)
354 		WLAN_OS_REPORT(("BSS Type		IBSS\n\n"));
355 	else if (pSiteEntry->bssType == BSS_ANY)
356 		WLAN_OS_REPORT(("BSS Type		ANY\n\n"));
357 	else
358 		WLAN_OS_REPORT(("BSS Type		INVALID\n\n"));
359 
360 
361 	WLAN_OS_REPORT(("Channel			%d\n", pSiteEntry->channel));
362 
363 	WLAN_OS_REPORT(("\n"));
364 
365 	switch (pSiteEntry->maxBasicRate)
366 	{
367 	case DRV_RATE_1M:
368 		WLAN_OS_REPORT(("Max Basic Rate		RATE_1M_BIT\n"));
369 		break;
370 
371 	case DRV_RATE_2M:
372 		WLAN_OS_REPORT(("Max Basic Rate		RATE_2M_BIT\n"));
373 		break;
374 
375 	case DRV_RATE_5_5M:
376 		WLAN_OS_REPORT(("Max Basic Rate		RATE_5_5M_BIT\n"));
377 		break;
378 
379 	case DRV_RATE_11M:
380 		WLAN_OS_REPORT(("Max Basic Rate		RATE_11M_BIT\n"));
381 		break;
382 
383 	case DRV_RATE_6M:
384 		WLAN_OS_REPORT(("Max Basic Rate		RATE_6M_BIT\n"));
385 		break;
386 
387 	case DRV_RATE_9M:
388 		WLAN_OS_REPORT(("Max Basic Rate		RATE_9M_BIT\n"));
389 		break;
390 
391 	case DRV_RATE_12M:
392 		WLAN_OS_REPORT(("Max Basic Rate		RATE_12M_BIT\n"));
393 		break;
394 
395 	case DRV_RATE_18M:
396 		WLAN_OS_REPORT(("Max Basic Rate		RATE_18M_BIT\n"));
397 		break;
398 
399 	case DRV_RATE_24M:
400 		WLAN_OS_REPORT(("Max Basic Rate		RATE_24M_BIT\n"));
401 		break;
402 
403 	case DRV_RATE_36M:
404 		WLAN_OS_REPORT(("Max Basic Rate		RATE_36M_BIT\n"));
405 		break;
406 
407 	case DRV_RATE_48M:
408 		WLAN_OS_REPORT(("Max Basic Rate		RATE_48M_BIT\n"));
409 		break;
410 
411 	case DRV_RATE_54M:
412 		WLAN_OS_REPORT(("Max Basic Rate		RATE_54M_BIT\n"));
413 		break;
414 
415 	default:
416 		WLAN_OS_REPORT(("Max Basic Rate		INVALID,  0x%X\n", pSiteEntry->maxBasicRate));
417 		break;
418 	}
419 
420 	switch (pSiteEntry->maxActiveRate)
421 	{
422 	case DRV_RATE_1M:
423 		WLAN_OS_REPORT(("Max Active Rate		RATE_1M_BIT\n"));
424 		break;
425 
426 	case DRV_RATE_2M:
427 		WLAN_OS_REPORT(("Max Active Rate		RATE_2M_BIT\n"));
428 		break;
429 
430 	case DRV_RATE_5_5M:
431 		WLAN_OS_REPORT(("Max Active Rate		RATE_5_5M_BIT\n"));
432 		break;
433 
434 	case DRV_RATE_11M:
435 		WLAN_OS_REPORT(("Max Active Rate		RATE_11M_BIT\n"));
436 		break;
437 
438 	case DRV_RATE_22M:
439 		WLAN_OS_REPORT(("Max Active Rate		RATE_22M_BIT\n"));
440 		break;
441 
442 	case DRV_RATE_6M:
443 		WLAN_OS_REPORT(("Max Active Rate		RATE_6M_BIT\n"));
444 		break;
445 
446 	case DRV_RATE_9M:
447 		WLAN_OS_REPORT(("Max Active Rate		RATE_9M_BIT\n"));
448 		break;
449 
450 	case DRV_RATE_12M:
451 		WLAN_OS_REPORT(("Max Active Rate		RATE_12M_BIT\n"));
452 		break;
453 
454 	case DRV_RATE_18M:
455 		WLAN_OS_REPORT(("Max Active Rate		RATE_18M_BIT\n"));
456 		break;
457 
458 	case DRV_RATE_24M:
459 		WLAN_OS_REPORT(("Max Active Rate		RATE_24M_BIT\n"));
460 		break;
461 
462 	case DRV_RATE_36M:
463 		WLAN_OS_REPORT(("Max Active Rate		RATE_36M_BIT\n"));
464 		break;
465 
466 	case DRV_RATE_48M:
467 		WLAN_OS_REPORT(("Max Active Rate		RATE_48M_BIT\n"));
468 		break;
469 
470 	case DRV_RATE_54M:
471 		WLAN_OS_REPORT(("Max Active Rate		RATE_54M_BIT\n"));
472 		break;
473 
474 	default:
475 		WLAN_OS_REPORT(("Max Active Rate		INVALID,  0x%X\n", pSiteEntry->maxActiveRate));
476 		break;
477 	}
478 
479 	WLAN_OS_REPORT(("\n"));
480 
481 	if (pSiteEntry->probeModulation == DRV_MODULATION_QPSK)
482 		WLAN_OS_REPORT(("Probe Modulation	QPSK\n"));
483 	else if (pSiteEntry->probeModulation == DRV_MODULATION_CCK)
484 		WLAN_OS_REPORT(("Probe Modulation	CCK\n"));
485 	else if (pSiteEntry->probeModulation == DRV_MODULATION_PBCC)
486 		WLAN_OS_REPORT(("Probe Modulation	PBCC\n"));
487 	else if (pSiteEntry->probeModulation == DRV_MODULATION_OFDM)
488 		WLAN_OS_REPORT(("Probe Modulation	OFDM\n"));
489 	else
490 		WLAN_OS_REPORT(("Probe Modulation	INVALID, %d\n", pSiteEntry->probeModulation));
491 
492 	if (pSiteEntry->beaconModulation == DRV_MODULATION_QPSK)
493 		WLAN_OS_REPORT(("Beacon Modulation	QPSK\n"));
494 	else if (pSiteEntry->beaconModulation == DRV_MODULATION_CCK)
495 		WLAN_OS_REPORT(("Beacon Modulation	CCK\n"));
496 	else if (pSiteEntry->beaconModulation == DRV_MODULATION_PBCC)
497 		WLAN_OS_REPORT(("Beacon Modulation	PBCC\n"));
498 	else if (pSiteEntry->beaconModulation == DRV_MODULATION_OFDM)
499 		WLAN_OS_REPORT(("Beacon Modulation	OFDM\n"));
500 	else
501 		WLAN_OS_REPORT(("Beacon Modulation	INVALID, %d\n", pSiteEntry->beaconModulation));
502 
503 	WLAN_OS_REPORT(("\n"));
504 
505 	if (pSiteEntry->privacy == TI_TRUE)
506 		WLAN_OS_REPORT(("Privacy							        On\n\n"));
507 	else
508 		WLAN_OS_REPORT(("Privacy							        Off\n\n"));
509 
510 	if (pSiteEntry->currentPreambleType == PREAMBLE_SHORT)
511 		WLAN_OS_REPORT(("Cap Preamble Type     Short\n"));
512 	else if (pSiteEntry->currentPreambleType == PREAMBLE_LONG)
513 		WLAN_OS_REPORT(("Cap Preamble Type     Long\n"));
514 	else
515 		WLAN_OS_REPORT(("Preamble	INVALID, %d\n", pSiteEntry->currentPreambleType));
516 
517 
518 	if(pSiteEntry->barkerPreambleType == PREAMBLE_UNSPECIFIED)
519 		WLAN_OS_REPORT(("Barker preamble Type		Unspecified\n"));
520 	else if(pSiteEntry->barkerPreambleType == PREAMBLE_SHORT)
521 		WLAN_OS_REPORT(("Barker_Preamble Type		Short\n"));
522 	else
523 		WLAN_OS_REPORT(("Barker_Preamble Type		Long\n"));
524 
525 	if(pSiteEntry->currentSlotTime == PHY_SLOT_TIME_SHORT)
526 		WLAN_OS_REPORT(("Slot time type					   Short\n"));
527 	else
528 		WLAN_OS_REPORT(("Slot time type					   Long\n"));
529 
530 
531 	WLAN_OS_REPORT(("\n"));
532 
533 	WLAN_OS_REPORT(("Beacon interval		%d\n", pSiteEntry->beaconInterval));
534 
535 	WLAN_OS_REPORT(("Local Time Stamp	%d\n", pSiteEntry->localTimeStamp));
536 
537 	WLAN_OS_REPORT(("rssi			%d\n", pSiteEntry->rssi));
538 
539 	WLAN_OS_REPORT(("\n"));
540 
541 	WLAN_OS_REPORT(("Fail status		%d\n", pSiteEntry->failStatus));
542 
543 	WLAN_OS_REPORT(("\n---------------------------------------------------------------\n\n", NULL));
544 
545 }
546 
printSiteTable(siteMgr_t * pSiteMgr,char * desiredSsid)547 void printSiteTable(siteMgr_t *pSiteMgr, char *desiredSsid)
548 {
549 	TI_UINT8	i, numOfSites = 0;
550 	siteEntry_t *pSiteEntry;
551 	char	ssid[MAX_SSID_LEN + 1];
552     siteTablesParams_t      *pCurrentSiteTable = pSiteMgr->pSitesMgmtParams->pCurrentSiteTable;
553     TI_UINT8                   tableIndex=2;
554 
555     WLAN_OS_REPORT(("\n\n************************	SITE TABLE	****************************\n\n\n"));
556 
557     /* It looks like it never happens. Anyway decided to check */
558     if ( pCurrentSiteTable->maxNumOfSites > MAX_SITES_BG_BAND )
559     {
560         WLAN_OS_REPORT(("printSiteTable. pCurrentSiteTable->maxNumOfSites=%d exceeds the limit %d\n",
561                    pCurrentSiteTable->maxNumOfSites, MAX_SITES_BG_BAND));
562         handleRunProblem(PROBLEM_BUF_SIZE_VIOLATION);
563         pCurrentSiteTable->maxNumOfSites = MAX_SITES_BG_BAND;
564     }
565 
566     do
567 	{
568         tableIndex--;
569 		for (i = 0; i < pCurrentSiteTable->maxNumOfSites; i++)
570 		{
571 			pSiteEntry = &(pCurrentSiteTable->siteTable[i]);
572 
573 			if (pSiteEntry->siteType == SITE_NULL)
574 				continue;
575             /* It looks like it never happens. Anyway decided to check */
576             if ( pCurrentSiteTable->siteTable[i].ssid.len > MAX_SSID_LEN )
577             {
578                 WLAN_OS_REPORT(("printSiteTable. pCurrentSiteTable->siteTable[%d].ssid.len=%d exceeds the limit %d\n",
579                          i, pCurrentSiteTable->siteTable[i].ssid.len, MAX_SSID_LEN));
580                 handleRunProblem(PROBLEM_BUF_SIZE_VIOLATION);
581                 pCurrentSiteTable->siteTable[i].ssid.len = MAX_SSID_LEN;
582             }
583 			os_memoryCopy(pSiteMgr->hOs ,ssid, (void *)pCurrentSiteTable->siteTable[i].ssid.str, pCurrentSiteTable->siteTable[i].ssid.len);
584 			ssid[pCurrentSiteTable->siteTable[i].ssid.len] = '\0';
585 
586 			if (desiredSsid != NULL)
587 			{
588 				int desiredSsidLength = 0;
589 				char * tmp = desiredSsid;
590 
591 				while (tmp != '\0')
592 				{
593 					desiredSsidLength++;
594 					tmp++;
595 				}
596 
597 				if (os_memoryCompare(pSiteMgr->hOs, (TI_UINT8 *)ssid, (TI_UINT8 *)desiredSsid, desiredSsidLength))
598 					continue;
599 			}
600 
601 			WLAN_OS_REPORT(("SSID	%s\n\n", ssid));
602 
603 
604 
605 			if (pSiteEntry->siteType == SITE_PRIMARY)
606 				WLAN_OS_REPORT( ("	 ENTRY PRIMARY %d \n", numOfSites));
607 			else
608 				WLAN_OS_REPORT( ("	ENTRY %d\n", i));
609 
610 			WLAN_OS_REPORT(("BSSID			%2X-%2X-%2X-%2X-%2X-%2X	\n",
611 																pCurrentSiteTable->siteTable[i].bssid[0],
612 																pCurrentSiteTable->siteTable[i].bssid[1],
613 																pCurrentSiteTable->siteTable[i].bssid[2],
614 																pCurrentSiteTable->siteTable[i].bssid[3],
615 																pCurrentSiteTable->siteTable[i].bssid[4],
616 																pCurrentSiteTable->siteTable[i].bssid[5]));
617 
618 
619 			if (pCurrentSiteTable->siteTable[i].bssType == BSS_INFRASTRUCTURE)
620 				WLAN_OS_REPORT(("BSS Type		INFRASTRUCTURE\n\n"));
621 			else if (pCurrentSiteTable->siteTable[i].bssType == BSS_INDEPENDENT)
622 				WLAN_OS_REPORT(("BSS Type		IBSS\n\n"));
623 			else if (pCurrentSiteTable->siteTable[i].bssType == BSS_ANY)
624 				WLAN_OS_REPORT(("BSS Type		ANY\n\n"));
625 			else
626 				WLAN_OS_REPORT(("BSS Type		INVALID\n\n"));
627 
628 
629 			WLAN_OS_REPORT(("Channel			%d\n", pCurrentSiteTable->siteTable[i].channel));
630 
631 			WLAN_OS_REPORT(("\n"));
632 
633 			switch (pCurrentSiteTable->siteTable[i].maxBasicRate)
634 			{
635 			case DRV_RATE_1M:
636 				WLAN_OS_REPORT(("Max Basic Rate		RATE_1M_BIT\n"));
637 				break;
638 
639 			case DRV_RATE_2M:
640 				WLAN_OS_REPORT(("Max Basic Rate		RATE_2M_BIT\n"));
641 				break;
642 
643 			case DRV_RATE_5_5M:
644 				WLAN_OS_REPORT(("Max Basic Rate		RATE_5_5M_BIT\n"));
645 				break;
646 
647 			case DRV_RATE_11M:
648 				WLAN_OS_REPORT(("Max Basic Rate		RATE_11M_BIT\n"));
649 				break;
650 
651 			case DRV_RATE_6M:
652 				WLAN_OS_REPORT(("Max Basic Rate		RATE_6M_BIT\n"));
653 				break;
654 
655 			case DRV_RATE_9M:
656 				WLAN_OS_REPORT(("Max Basic Rate		RATE_9M_BIT\n"));
657 				break;
658 
659 			case DRV_RATE_12M:
660 				WLAN_OS_REPORT(("Max Basic Rate		RATE_12M_BIT\n"));
661 				break;
662 
663 			case DRV_RATE_18M:
664 				WLAN_OS_REPORT(("Max Basic Rate		RATE_18M_BIT\n"));
665 				break;
666 
667 			case DRV_RATE_24M:
668 				WLAN_OS_REPORT(("Max Basic Rate		RATE_24M_BIT\n"));
669 				break;
670 
671 			case DRV_RATE_36M:
672 				WLAN_OS_REPORT(("Max Basic Rate		RATE_36M_BIT\n"));
673 				break;
674 
675 			case DRV_RATE_48M:
676 				WLAN_OS_REPORT(("Max Basic Rate		RATE_48M_BIT\n"));
677 				break;
678 
679 			case DRV_RATE_54M:
680 				WLAN_OS_REPORT(("Max Basic Rate		RATE_54M_BIT\n"));
681 				break;
682 
683 			default:
684 					WLAN_OS_REPORT(("Max Basic Rate		INVALID,  0x%X\n", pCurrentSiteTable->siteTable[i].maxBasicRate));
685 				break;
686 			}
687 
688 				switch (pCurrentSiteTable->siteTable[i].maxActiveRate)
689 			{
690 			case DRV_RATE_1M:
691 				WLAN_OS_REPORT(("Max Active Rate		RATE_1M_BIT\n"));
692 				break;
693 
694 			case DRV_RATE_2M:
695 				WLAN_OS_REPORT(("Max Active Rate		RATE_2M_BIT\n"));
696 				break;
697 
698 			case DRV_RATE_5_5M:
699 				WLAN_OS_REPORT(("Max Active Rate		RATE_5_5M_BIT\n"));
700 				break;
701 
702 			case DRV_RATE_11M:
703 				WLAN_OS_REPORT(("Max Active Rate		RATE_11M_BIT\n"));
704 				break;
705 
706 			case DRV_RATE_22M:
707 				WLAN_OS_REPORT(("Max Active Rate		RATE_22M_BIT\n"));
708 				break;
709 
710 			case DRV_RATE_6M:
711 				WLAN_OS_REPORT(("Max Active Rate		RATE_6M_BIT\n"));
712 				break;
713 
714 			case DRV_RATE_9M:
715 				WLAN_OS_REPORT(("Max Active Rate		RATE_9M_BIT\n"));
716 				break;
717 
718 			case DRV_RATE_12M:
719 				WLAN_OS_REPORT(("Max Active Rate		RATE_12M_BIT\n"));
720 				break;
721 
722 			case DRV_RATE_18M:
723 				WLAN_OS_REPORT(("Max Active Rate		RATE_18M_BIT\n"));
724 				break;
725 
726 			case DRV_RATE_24M:
727 				WLAN_OS_REPORT(("Max Active Rate		RATE_24M_BIT\n"));
728 				break;
729 
730 			case DRV_RATE_36M:
731 				WLAN_OS_REPORT(("Max Active Rate		RATE_36M_BIT\n"));
732 				break;
733 
734 			case DRV_RATE_48M:
735 				WLAN_OS_REPORT(("Max Active Rate		RATE_48M_BIT\n"));
736 				break;
737 
738 			case DRV_RATE_54M:
739 				WLAN_OS_REPORT(("Max Active Rate		RATE_54M_BIT\n"));
740 				break;
741 
742 			default:
743 					WLAN_OS_REPORT(("Max Active Rate		INVALID,  0x%X\n", pCurrentSiteTable->siteTable[i].maxActiveRate));
744 				break;
745 			}
746 
747 			WLAN_OS_REPORT(("\n"));
748 
749 				if (pCurrentSiteTable->siteTable[i].probeModulation == DRV_MODULATION_QPSK)
750 				WLAN_OS_REPORT(("Probe Modulation	QPSK\n"));
751 				else if (pCurrentSiteTable->siteTable[i].probeModulation == DRV_MODULATION_CCK)
752 				WLAN_OS_REPORT(("Probe Modulation	CCK\n"));
753 				else if (pCurrentSiteTable->siteTable[i].probeModulation == DRV_MODULATION_PBCC)
754 					WLAN_OS_REPORT(("Probe Modulation	PBCC\n"));
755 				else
756 					WLAN_OS_REPORT(("Probe Modulation	INVALID, %d\n", pCurrentSiteTable->siteTable[i].probeModulation));
757 
758 				if (pCurrentSiteTable->siteTable[i].beaconModulation == DRV_MODULATION_QPSK)
759 					WLAN_OS_REPORT(("Beacon Modulation	QPSK\n"));
760 				else if (pCurrentSiteTable->siteTable[i].beaconModulation == DRV_MODULATION_CCK)
761 					WLAN_OS_REPORT(("Beacon Modulation	CCK\n"));
762 				else if (pCurrentSiteTable->siteTable[i].beaconModulation == DRV_MODULATION_PBCC)
763 					WLAN_OS_REPORT(("Beacon Modulation	PBCC\n"));
764 				else
765 					WLAN_OS_REPORT(("Beacon Modulation	INVALID, %d\n", pCurrentSiteTable->siteTable[i].beaconModulation));
766 
767 				WLAN_OS_REPORT(("\n"));
768 
769 				if (pCurrentSiteTable->siteTable[i].privacy == TI_TRUE)
770 				WLAN_OS_REPORT(("Privacy			On\n"));
771 			else
772 				WLAN_OS_REPORT(("Privacy			Off\n"));
773 
774 				if (pCurrentSiteTable->siteTable[i].currentPreambleType == PREAMBLE_SHORT)
775 				WLAN_OS_REPORT(("Preamble Type		Short\n"));
776 				else if (pCurrentSiteTable->siteTable[i].currentPreambleType == PREAMBLE_LONG)
777 				WLAN_OS_REPORT(("Preamble Type		Long\n"));
778 			else
779 					WLAN_OS_REPORT(("Preamble	INVALID, %d\n", pCurrentSiteTable->siteTable[i].currentPreambleType));
780 
781 
782 			WLAN_OS_REPORT(("\n"));
783 
784 				WLAN_OS_REPORT(("Beacon interval		%d\n", pCurrentSiteTable->siteTable[i].beaconInterval));
785 
786 				WLAN_OS_REPORT(("Local Time Stamp	%d\n", pCurrentSiteTable->siteTable[i].localTimeStamp));
787 
788 				WLAN_OS_REPORT(("rssi			%d\n", pCurrentSiteTable->siteTable[i].rssi));
789 
790 				WLAN_OS_REPORT(("\n"));
791 
792 				WLAN_OS_REPORT(("Fail status		%d\n", pCurrentSiteTable->siteTable[i].failStatus));
793 
794 				WLAN_OS_REPORT(("ATIM Window %d\n", pCurrentSiteTable->siteTable[i].atimWindow));
795 
796 			WLAN_OS_REPORT(("\n---------------------------------------------------------------\n\n", NULL));
797 
798 			numOfSites++;
799 		}
800 
801 		WLAN_OS_REPORT(("\n		Number Of Sites:	%d\n", numOfSites));
802 		WLAN_OS_REPORT(("\n---------------------------------------------------------------\n", NULL));
803 
804 		   if ((pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode == DOT11_DUAL_MODE) && (tableIndex==1))
805 		   {   /* change site table */
806 			   if (pCurrentSiteTable == &pSiteMgr->pSitesMgmtParams->dot11BG_sitesTables)
807 				  {
808                    WLAN_OS_REPORT(("\n		dot11A_sitesTables	\n"));
809 
810                    pCurrentSiteTable = (siteTablesParams_t *)&pSiteMgr->pSitesMgmtParams->dot11A_sitesTables;
811 				  }
812 			   else
813 				  {
814                    WLAN_OS_REPORT(("\n		dot11BG_sitesTables	\n"));
815 
816                    pCurrentSiteTable = &pSiteMgr->pSitesMgmtParams->dot11BG_sitesTables;
817 				  }
818 		   }
819 
820     } while (tableIndex>0);
821 }
822 
printDesiredParams(siteMgr_t * pSiteMgr,TI_HANDLE hCmdDispatch)823 static void printDesiredParams(siteMgr_t *pSiteMgr, TI_HANDLE hCmdDispatch)
824 {
825 	paramInfo_t		param;
826 
827 	WLAN_OS_REPORT(("\n\n*****************************************", NULL));
828 	WLAN_OS_REPORT(("*****************************************\n\n", NULL));
829 
830 	WLAN_OS_REPORT(("Channel			%d\n", pSiteMgr->pDesiredParams->siteMgrDesiredChannel));
831 
832 	WLAN_OS_REPORT(("\n*****************************************\n\n", NULL));
833 
834 	switch (pSiteMgr->pDesiredParams->siteMgrDesiredRatePair.maxBasic)
835 	{
836 	case DRV_RATE_1M:
837 		WLAN_OS_REPORT(("Max Basic Rate		RATE_1M_BIT\n"));
838 		break;
839 
840 	case DRV_RATE_2M:
841 		WLAN_OS_REPORT(("Max Basic Rate		RATE_2M_BIT\n"));
842 		break;
843 
844 	case DRV_RATE_5_5M:
845 		WLAN_OS_REPORT(("Max Basic Rate		RATE_5_5M_BIT\n"));
846 		break;
847 
848 	case DRV_RATE_11M:
849 		WLAN_OS_REPORT(("Max Basic Rate		RATE_11M_BIT\n"));
850 		break;
851 
852 	case DRV_RATE_22M:
853 		WLAN_OS_REPORT(("Max Basic Rate		RATE_22M_BIT\n"));
854 		break;
855 
856 	case DRV_RATE_6M:
857 		WLAN_OS_REPORT(("Max Basic Rate		RATE_6M_BIT\n"));
858 		break;
859 
860 	case DRV_RATE_9M:
861 		WLAN_OS_REPORT(("Max Basic Rate		RATE_9M_BIT\n"));
862 		break;
863 
864 	case DRV_RATE_12M:
865 		WLAN_OS_REPORT(("Max Basic Rate		RATE_12M_BIT\n"));
866 		break;
867 
868 	case DRV_RATE_18M:
869 		WLAN_OS_REPORT(("Max Basic Rate		RATE_18M_BIT\n"));
870 		break;
871 
872 	case DRV_RATE_24M:
873 		WLAN_OS_REPORT(("Max Basic Rate		RATE_24M_BIT\n"));
874 		break;
875 
876 	case DRV_RATE_36M:
877 		WLAN_OS_REPORT(("Max Basic Rate		RATE_36M_BIT\n"));
878 		break;
879 
880 	case DRV_RATE_48M:
881 		WLAN_OS_REPORT(("Max Basic Rate		RATE_48M_BIT\n"));
882 		break;
883 
884 	case DRV_RATE_54M:
885 		WLAN_OS_REPORT(("Max Basic Rate		RATE_54M_BIT\n"));
886 		break;
887 
888 	default:
889 		WLAN_OS_REPORT(("Invalid basic rate value	0x%X\n", pSiteMgr->pDesiredParams->siteMgrDesiredRatePair.maxBasic));
890 		break;
891 	}
892 
893 	switch (pSiteMgr->pDesiredParams->siteMgrDesiredRatePair.maxActive)
894 	{
895 	case DRV_RATE_1M:
896 		WLAN_OS_REPORT(("Max Active Rate		RATE_1M_BIT\n"));
897 		break;
898 
899 	case DRV_RATE_2M:
900 		WLAN_OS_REPORT(("Max Active Rate		RATE_2M_BIT\n"));
901 		break;
902 
903 	case DRV_RATE_5_5M:
904 		WLAN_OS_REPORT(("Max Active Rate		RATE_5_5M_BIT\n"));
905 		break;
906 
907 	case DRV_RATE_11M:
908 		WLAN_OS_REPORT(("Max Active Rate		RATE_11M_BIT\n"));
909 		break;
910 
911 	case DRV_RATE_22M:
912 		WLAN_OS_REPORT(("Max Active Rate		RATE_22M_BIT\n"));
913 		break;
914 
915 	case DRV_RATE_6M:
916 		WLAN_OS_REPORT(("Max Active Rate		RATE_6M_BIT\n"));
917 		break;
918 
919 	case DRV_RATE_9M:
920 		WLAN_OS_REPORT(("Max Active Rate		RATE_9M_BIT\n"));
921 		break;
922 
923 	case DRV_RATE_12M:
924 		WLAN_OS_REPORT(("Max Active Rate		RATE_12M_BIT\n"));
925 		break;
926 
927 	case DRV_RATE_18M:
928 		WLAN_OS_REPORT(("Max Active Rate		RATE_18M_BIT\n"));
929 		break;
930 
931 	case DRV_RATE_24M:
932 		WLAN_OS_REPORT(("Max Active Rate		RATE_24M_BIT\n"));
933 		break;
934 
935 	case DRV_RATE_36M:
936 		WLAN_OS_REPORT(("Max Active Rate		RATE_36M_BIT\n"));
937 		break;
938 
939 	case DRV_RATE_48M:
940 		WLAN_OS_REPORT(("Max Active Rate		RATE_48M_BIT\n"));
941 		break;
942 
943 	case DRV_RATE_54M:
944 		WLAN_OS_REPORT(("Max Active Rate		RATE_54M_BIT\n"));
945 		break;
946 
947 	default:
948 		WLAN_OS_REPORT(("Invalid basic rate value	0x%X\n", pSiteMgr->pDesiredParams->siteMgrDesiredRatePair.maxActive));
949 		break;
950 	}
951 
952 	if (pSiteMgr->pDesiredParams->siteMgrDesiredModulationType == DRV_MODULATION_QPSK)
953 		WLAN_OS_REPORT(("Modulation Type		QPSK\n"));
954 	else if (pSiteMgr->pDesiredParams->siteMgrDesiredModulationType == DRV_MODULATION_CCK)
955 		WLAN_OS_REPORT(("Modulation Type		CCK\n"));
956 	else if (pSiteMgr->pDesiredParams->siteMgrDesiredModulationType == DRV_MODULATION_PBCC)
957 		WLAN_OS_REPORT(("Modulation Type		PBCC\n"));
958 	else if (pSiteMgr->pDesiredParams->siteMgrDesiredModulationType == DRV_MODULATION_OFDM)
959 		WLAN_OS_REPORT(("Modulation Type		OFDM\n"));
960 	else
961 		WLAN_OS_REPORT(("Invalid Modulation Type	%d\n", pSiteMgr->pDesiredParams->siteMgrDesiredModulationType));
962 
963 
964 	WLAN_OS_REPORT(("\n*****************************************\n\n", NULL));
965 
966 	param.paramType = RSN_EXT_AUTHENTICATION_MODE;
967 	cmdDispatch_GetParam(hCmdDispatch, &param);
968 	if (param.content.rsnDesiredAuthType == RSN_AUTH_OPEN)
969 		WLAN_OS_REPORT(("Authentication Type	Open System\n"));
970 	else if (param.content.rsnDesiredAuthType == RSN_AUTH_SHARED_KEY)
971 		WLAN_OS_REPORT(("Authentication Type	Shared Key\n"));
972 	else
973 		WLAN_OS_REPORT(("Authentication Type	Invalid: %d\n", param.content.rsnDesiredAuthType));
974 
975 	param.paramType = RSN_ENCRYPTION_STATUS_PARAM;
976 	cmdDispatch_GetParam(hCmdDispatch, &param);
977 	if (param.content.rsnEncryptionStatus == TWD_CIPHER_NONE)
978 		WLAN_OS_REPORT(("WEP 				Off\n"));
979 	else if (param.content.rsnEncryptionStatus == TWD_CIPHER_WEP)
980 		WLAN_OS_REPORT(("WEP 				On\n"));
981 	else
982 		WLAN_OS_REPORT(("WEP 		Invalid: %d\n", param.content.rsnEncryptionStatus));
983 
984 	WLAN_OS_REPORT(("\n"));
985 
986 
987 	WLAN_OS_REPORT(("\n*****************************************\n\n", NULL));
988 	if(pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode == DOT11_B_MODE)
989 		WLAN_OS_REPORT(("Desired dot11mode		11b\n"));
990 	else if(pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode == DOT11_G_MODE)
991 		WLAN_OS_REPORT(("Desired dot11mode		11g\n"));
992 	else if(pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode == DOT11_A_MODE)
993 		WLAN_OS_REPORT(("Desired dot11mode		11a\n"));
994 	else if(pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode == DOT11_DUAL_MODE)
995 		WLAN_OS_REPORT(("Desired dot11mode		dual 11a/g\n"));
996 	else
997 		WLAN_OS_REPORT(("Desired dot11mode		INVALID\n"));
998 
999 	WLAN_OS_REPORT(("\n*****************************************\n\n", NULL));
1000 	if(pSiteMgr->pDesiredParams->siteMgrDesiredSlotTime == PHY_SLOT_TIME_SHORT)
1001 		WLAN_OS_REPORT(("Desired slot time		short\n"));
1002 	else if(pSiteMgr->pDesiredParams->siteMgrDesiredSlotTime == PHY_SLOT_TIME_LONG)
1003 		WLAN_OS_REPORT(("Desired slot time		long\n"));
1004 	else
1005 		WLAN_OS_REPORT(("Desired slot time		INVALID\n"));
1006 
1007 
1008 	WLAN_OS_REPORT(("\n*****************************************\n\n", NULL));
1009 	if (pSiteMgr->pDesiredParams->siteMgrDesiredPreambleType == PREAMBLE_SHORT)
1010 		WLAN_OS_REPORT(("Desired Preamble		Short\n"));
1011 	else if (pSiteMgr->pDesiredParams->siteMgrDesiredPreambleType == PREAMBLE_LONG)
1012 		WLAN_OS_REPORT(("Desired Preamble	Long\n"));
1013 	else
1014 		WLAN_OS_REPORT(("Invalid Desired Preamble	%d\n", pSiteMgr->pDesiredParams->siteMgrDesiredPreambleType));
1015 
1016 	WLAN_OS_REPORT(("Beacon interval		%d\n", pSiteMgr->pDesiredParams->siteMgrDesiredBeaconInterval));
1017 
1018 	WLAN_OS_REPORT(("\n*****************************************", NULL));
1019 	WLAN_OS_REPORT(("*****************************************\n\n", NULL));
1020 
1021 }
1022 
1023 
1024 
printPrimarySiteDesc(siteMgr_t * pSiteMgr,OS_802_11_BSSID * pPrimarySiteDesc)1025 static void printPrimarySiteDesc(siteMgr_t *pSiteMgr, OS_802_11_BSSID *pPrimarySiteDesc)
1026 {
1027 	TI_UINT8 rateIndex, maxNumOfRates;
1028 	char ssid[MAX_SSID_LEN + 1];
1029 
1030 
1031 	WLAN_OS_REPORT(("\n^^^^^^^^^^^^^^^	PRIMARY SITE DESCRIPTION	^^^^^^^^^^^^^^^^^^^\n\n"));
1032 
1033 
1034 	/* MacAddress */
1035 	WLAN_OS_REPORT(("BSSID				0x%X-0x%X-0x%X-0x%X-0x%X-0x%X\n",	pPrimarySiteDesc->MacAddress[0],
1036 																	pPrimarySiteDesc->MacAddress[1],
1037 																	pPrimarySiteDesc->MacAddress[2],
1038 																	pPrimarySiteDesc->MacAddress[3],
1039 																	pPrimarySiteDesc->MacAddress[4],
1040 																	pPrimarySiteDesc->MacAddress[5]));
1041 
1042 	/* Capabilities */
1043 	WLAN_OS_REPORT(("Capabilities		0x%X\n",	pPrimarySiteDesc->Capabilities));
1044 
1045 	/* SSID */
1046 	os_memoryCopy(pSiteMgr->hOs, ssid, (void *)pPrimarySiteDesc->Ssid.Ssid, pPrimarySiteDesc->Ssid.SsidLength);
1047 	ssid[pPrimarySiteDesc->Ssid.SsidLength] = 0;
1048 	WLAN_OS_REPORT(("SSID				%s\n", ssid));
1049 
1050 	/* privacy */
1051 	if (pPrimarySiteDesc->Privacy == TI_TRUE)
1052 		WLAN_OS_REPORT(("Privacy				ON\n"));
1053 	else
1054 		WLAN_OS_REPORT(("Privacy				OFF\n"));
1055 
1056 	/* RSSI */
1057 	WLAN_OS_REPORT(("RSSI					%d\n", ((pPrimarySiteDesc->Rssi)>>16)));
1058 
1059 	if (pPrimarySiteDesc->InfrastructureMode == os802_11IBSS)
1060 		WLAN_OS_REPORT(("BSS Type				IBSS\n"));
1061 	else
1062 		WLAN_OS_REPORT(("BSS Type				INFRASTRUCTURE\n"));
1063 
1064 
1065 	maxNumOfRates = sizeof(pPrimarySiteDesc->SupportedRates) / sizeof(pPrimarySiteDesc->SupportedRates[0]);
1066 	/* SupportedRates */
1067 	for (rateIndex = 0; rateIndex < maxNumOfRates; rateIndex++)
1068 	{
1069 		if (pPrimarySiteDesc->SupportedRates[rateIndex] != 0)
1070 			WLAN_OS_REPORT(("Rate					0x%X\n", pPrimarySiteDesc->SupportedRates[rateIndex]));
1071 	}
1072 
1073 	WLAN_OS_REPORT(("\n---------------------------------------------------------------\n\n", NULL));
1074 
1075 }
1076 
setRateSet(TI_UINT8 maxRate,TRates * pRates)1077 static void setRateSet(TI_UINT8 maxRate, TRates *pRates)
1078 {
1079 	TI_UINT8 i = 0;
1080 
1081 	switch (maxRate)
1082 	{
1083 
1084 	case DRV_RATE_54M:
1085 		pRates->ratesString[i] = 108;
1086 		i++;
1087 
1088 	case DRV_RATE_48M:
1089 		pRates->ratesString[i] = 96;
1090 		i++;
1091 
1092 	case DRV_RATE_36M:
1093 		pRates->ratesString[i] = 72;
1094 		i++;
1095 
1096 	case DRV_RATE_24M:
1097 		pRates->ratesString[i] = 48;
1098 		i++;
1099 
1100 	case DRV_RATE_18M:
1101 		pRates->ratesString[i] = 36;
1102 		i++;
1103 
1104 	case DRV_RATE_12M:
1105 		pRates->ratesString[i] = 24;
1106 		i++;
1107 
1108 	case DRV_RATE_9M:
1109 		pRates->ratesString[i] = 18;
1110 		i++;
1111 
1112 	case DRV_RATE_6M:
1113 		pRates->ratesString[i] = 12;
1114 		i++;
1115 
1116 	case DRV_RATE_22M:
1117 		pRates->ratesString[i] = 44;
1118 		i++;
1119 
1120 	case DRV_RATE_11M:
1121 		pRates->ratesString[i] = 22;
1122 		pRates->ratesString[i] |= 0x80;
1123 		i++;
1124 
1125 	case DRV_RATE_5_5M:
1126 		pRates->ratesString[i] = 11;
1127 		pRates->ratesString[i] |= 0x80;
1128 		i++;
1129 
1130 	case DRV_RATE_2M:
1131 		pRates->ratesString[i] = 4;
1132 		pRates->ratesString[i] |= 0x80;
1133 		i++;
1134 
1135 	case DRV_RATE_1M:
1136 		pRates->ratesString[i] = 2;
1137 		pRates->ratesString[i] |= 0x80;
1138 		i++;
1139 		break;
1140 
1141 	default:
1142 		WLAN_OS_REPORT(("Set Rate Set, invalid max rate %d\n", maxRate));
1143 		pRates->len = 0;
1144 	}
1145 
1146 	pRates->len = i;
1147 
1148 }
1149 
printSiteMgrHelpMenu(void)1150 void printSiteMgrHelpMenu(void)
1151 {
1152 	WLAN_OS_REPORT(("\n\n   Site Manager Debug Menu   \n"));
1153 	WLAN_OS_REPORT(("------------------------\n"));
1154 
1155 	WLAN_OS_REPORT(("500 - Help.\n"));
1156 	WLAN_OS_REPORT(("501 - Primary Site Parameters.\n"));
1157 	WLAN_OS_REPORT(("502 - Sites List.\n"));
1158 	WLAN_OS_REPORT(("503 - Desired Parameters.\n"));
1159 	WLAN_OS_REPORT(("507 - Set Power save Mode.\n"));
1160 	WLAN_OS_REPORT(("508 - Get Power save Mode.\n"));
1161 	WLAN_OS_REPORT(("511 - Set Default Key Id.\n"));
1162 	WLAN_OS_REPORT(("512 - Get Default Key Id.\n"));
1163 	WLAN_OS_REPORT(("513 - Set Key.\n"));
1164 	WLAN_OS_REPORT(("514 - Get Key.\n"));
1165 	WLAN_OS_REPORT(("515 - Set Cypher Suite.\n"));
1166 	WLAN_OS_REPORT(("516 - Get Cypher Suite.\n"));
1167 	WLAN_OS_REPORT(("517 - Set Auth Mode.\n"));
1168 	WLAN_OS_REPORT(("518 - Get Auth Mode.\n"));
1169 	WLAN_OS_REPORT(("519 - Get Primary Site Description.\n"));
1170 	WLAN_OS_REPORT(("520 - Get Connection Status.\n"));
1171 	WLAN_OS_REPORT(("522 - Get Current Tx Rate.\n"));
1172 	WLAN_OS_REPORT(("525 - Set Supported Rate Set.\n"));
1173 	WLAN_OS_REPORT(("526 - Get Supported Rate Set.\n"));
1174 	WLAN_OS_REPORT(("527 - Set Auth type.\n"));
1175 	WLAN_OS_REPORT(("528 - Get Auth type.\n"));
1176 
1177 	WLAN_OS_REPORT(("        %03d - RADIO_STAND_BY_CHANGE_STATE \n", RADIO_STAND_BY_CHANGE_STATE));
1178 	WLAN_OS_REPORT(("        %03d - CONNECT_TO_BSSID \n", CONNECT_TO_BSSID));
1179 
1180 	WLAN_OS_REPORT(("        %03d - SET_START_CLI_SCAN_PARAM \n", SET_START_CLI_SCAN_PARAM));
1181 	WLAN_OS_REPORT(("        %03d - SET_STOP_CLI_SCAN_PARAM \n", SET_STOP_CLI_SCAN_PARAM));
1182 
1183 	WLAN_OS_REPORT(("        %03d - SET_BROADCAST_BACKGROUND_SCAN_PARAM \n", SET_BROADCAST_BACKGROUND_SCAN_PARAM));
1184 	WLAN_OS_REPORT(("        %03d - ENABLE_PERIODIC_BROADCAST_BBACKGROUND_SCAN_PARAM \n", ENABLE_PERIODIC_BROADCAST_BACKGROUND_SCAN_PARAM));
1185 	WLAN_OS_REPORT(("        %03d - DISABLE_PERIODIC_BROADCAST_BACKGROUND_SCAN_PARAM \n", DISABLE_PERIODIC_BROADCAST_BACKGROUND_SCAN_PARAM));
1186 
1187 	WLAN_OS_REPORT(("        %03d - SET_UNICAST_BACKGROUND_SCAN_PARAM \n", SET_UNICAST_BACKGROUND_SCAN_PARAM));
1188 	WLAN_OS_REPORT(("        %03d - ENABLE_PERIODIC_UNICAST_BACKGROUND_SCAN_PARAM \n", ENABLE_PERIODIC_UNICAST_BACKGROUND_SCAN_PARAM));
1189 	WLAN_OS_REPORT(("        %03d - DISABLE_PERIODIC_UNICAST_BACKGROUND_SCAN_PARAM \n", DISABLE_PERIODIC_UNICAST_BACKGROUND_SCAN_PARAM));
1190 
1191 	WLAN_OS_REPORT(("        %03d - SET_FOREGROUND_SCAN_PARAM \n", SET_FOREGROUND_SCAN_PARAM));
1192 	WLAN_OS_REPORT(("        %03d - ENABLE_PERIODIC_FOREGROUND_SCAN_PARAM \n", ENABLE_PERIODIC_FOREGROUND_SCAN_PARAM));
1193 	WLAN_OS_REPORT(("        %03d - DISABLE_PERIODIC_FOREGROUND_SCAN_PARAM \n", DISABLE_PERIODIC_FOREGROUND_SCAN_PARAM));
1194 
1195 	WLAN_OS_REPORT(("        %03d - SET_CHANNEL_NUMBER \n", SET_CHANNEL_NUMBER));
1196 	WLAN_OS_REPORT(("        %03d - SET_RSSI_GAP_THRSH \n", SET_RSSI_GAP_THRSH));
1197 	WLAN_OS_REPORT(("        %03d - SET_FAST_SCAN_TIMEOUT \n", SET_FAST_SCAN_TIMEOUT));
1198 	WLAN_OS_REPORT(("        %03d - SET_INTERNAL_ROAMING_ENABLE \n", SET_INTERNAL_ROAMING_ENABLE));
1199 
1200 	WLAN_OS_REPORT(("        %03d - PERFORM_HEALTH_TEST \n", PERFORM_HEALTH_TEST));
1201 	WLAN_OS_REPORT(("        %03d - PRINT_FAILURE_EVENTS \n", PRINT_FAILURE_EVENTS));
1202 	WLAN_OS_REPORT(("        %03d - FORCE_HW_RESET_RECOVERY \n", FORCE_HW_RESET_RECOVERY));
1203 	WLAN_OS_REPORT(("        %03d - FORCE_SOFT_RECOVERY \n", FORCE_SOFT_RECOVERY));
1204 
1205 	WLAN_OS_REPORT(("        %03d - RESET_ROAMING_EVENTS \n", RESET_ROAMING_EVENTS));
1206 	WLAN_OS_REPORT(("        %03d - SET_DESIRED_CONS_TX_ERRORS_THREH\n", SET_DESIRED_CONS_TX_ERRORS_THREH));
1207 
1208 	WLAN_OS_REPORT(("        %03d - GET_CURRENT_ROAMING_STATUS \n", GET_CURRENT_ROAMING_STATUS));
1209 
1210 
1211     WLAN_OS_REPORT(("        %03d - TOGGLE_LNA_ON \n", TEST_TOGGLE_LNA_ON));
1212     WLAN_OS_REPORT(("        %03d - TOGGLE_LNA_OFF \n", TEST_TOGGLE_LNA_OFF));
1213 
1214 	WLAN_OS_REPORT(("        %03d - PRINT_SITE_TABLE_PER_SSID\n", PRINT_SITE_TABLE_PER_SSID));
1215 
1216 	WLAN_OS_REPORT(("        %03d - SET_DESIRED_CHANNEL\n", SET_DESIRED_CHANNEL));
1217 
1218 	WLAN_OS_REPORT(("        %03d - START_PRE_AUTH\n", START_PRE_AUTH));
1219 
1220 	WLAN_OS_REPORT(("\n------------------------\n"));
1221 }
1222 
1223 
1224 
1225