PageRenderTime 62ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/wl1271_softAP/Test/siteMgrDebug.c

https://github.com/MiniCMX/android_hardware_ti_wlan
C | 1222 lines | 906 code | 263 blank | 53 comment | 217 complexity | 6ba68f51323f97240ac2cdc5772c863f MD5 | raw file
Possible License(s): GPL-2.0, BSD-3-Clause
  1. /*
  2. * siteMgrDebug.c
  3. *
  4. * Copyright(c) 1998 - 2010 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. /** \file reportReplvl.c
  34. * \brief Report level implementation
  35. *
  36. * \see reportReplvl.h
  37. */
  38. /** \file siteMgrDebug.c
  39. * \brief The siteMgrDebug module.
  40. *
  41. * \see siteMgrDebug.h
  42. */
  43. #include "tidef.h"
  44. #include "osApi.h"
  45. #include "paramOut.h"
  46. #include "siteMgrDebug.h"
  47. #include "siteMgrApi.h"
  48. #include "siteHash.h"
  49. #include "report.h"
  50. #include "CmdDispatcher.h"
  51. #include "DrvMainModules.h"
  52. #include "sme.h"
  53. #include "apConn.h"
  54. #include "healthMonitor.h"
  55. #include "conn.h"
  56. #include "connApi.h"
  57. #ifdef XCC_MODULE_INCLUDED
  58. #include "XCCMngr.h"
  59. #endif
  60. static void printPrimarySite(siteMgr_t *pSiteMgr);
  61. void printSiteTable(siteMgr_t *pSiteMgr, char *desiredSsid);
  62. static void printDesiredParams(siteMgr_t *pSiteMgr, TI_HANDLE hCmdDispatch);
  63. static void printPrimarySiteDesc(siteMgr_t *pSiteMgr, OS_802_11_BSSID *pPrimarySiteDesc);
  64. static void setRateSet(TI_UINT8 maxRate, TRates *pRates);
  65. void printSiteMgrHelpMenu(void);
  66. /* Function implementation */
  67. void siteMgrDebugFunction (TI_HANDLE hSiteMgr,
  68. TStadHandlesList *pStadHandles,
  69. TI_UINT32 funcType,
  70. void *pParam)
  71. {
  72. siteMgr_t *pSiteMgr = (siteMgr_t *)hSiteMgr;
  73. paramInfo_t param;
  74. TSsid newDesiredSsid;
  75. TI_UINT8 value;
  76. TI_UINT8 i;
  77. OS_802_11_BSSID primarySiteDesc;
  78. TRates ratesSet;
  79. newDesiredSsid.len = 5;
  80. os_memoryCopy(pSiteMgr->hOs, (void *)newDesiredSsid.str, "yaeli", 5);
  81. switch (funcType)
  82. {
  83. case SITE_MGR_DEBUG_HELP_MENU:
  84. printSiteMgrHelpMenu();
  85. break;
  86. case PRIMARY_SITE_DBG:
  87. printPrimarySite(pSiteMgr);
  88. break;
  89. case SITE_TABLE_DBG:
  90. printSiteTable(pSiteMgr, NULL);
  91. break;
  92. case DESIRED_PARAMS_DBG:
  93. printDesiredParams(pSiteMgr, pStadHandles->hCmdDispatch);
  94. break;
  95. case GET_PRIMARY_SITE_DESC_DBG:
  96. param.paramType = SITE_MGR_GET_SELECTED_BSSID_INFO;
  97. param.content.pSiteMgrPrimarySiteDesc = &primarySiteDesc;
  98. cmdDispatch_GetParam(pStadHandles->hCmdDispatch, &param);
  99. printPrimarySiteDesc(pSiteMgr, &primarySiteDesc);
  100. break;
  101. case SET_RSN_DESIRED_CIPHER_SUITE_DBG:
  102. param.paramType = RSN_ENCRYPTION_STATUS_PARAM;
  103. value = *((TI_UINT32 *)pParam);
  104. param.content.rsnEncryptionStatus = (ECipherSuite)value;
  105. cmdDispatch_SetParam(pStadHandles->hCmdDispatch, &param);
  106. WLAN_OS_REPORT(("\nSetting RSN_DESIRED_CIPHER_SUITE_PARAM : %d\n", value));
  107. break;
  108. case GET_RSN_DESIRED_CIPHER_SUITE_DBG:
  109. param.paramType = RSN_ENCRYPTION_STATUS_PARAM;
  110. cmdDispatch_GetParam(pStadHandles->hCmdDispatch, &param);
  111. WLAN_OS_REPORT(("\nGetting RSN_DESIRED_CIPHER_SUITE_PARAM: %d\n", param.content.rsnEncryptionStatus));
  112. break;
  113. case SET_RSN_DESIRED_AUTH_TYPE_DBG:
  114. param.paramType = RSN_EXT_AUTHENTICATION_MODE;
  115. value = *((TI_UINT32 *)pParam);
  116. param.content.rsnDesiredAuthType = (EAuthSuite)value;
  117. cmdDispatch_SetParam(pStadHandles->hCmdDispatch, &param);
  118. if (value == RSN_AUTH_OPEN)
  119. WLAN_OS_REPORT(("\nSetting RSN_DESIRED_AUTH_TYPE_PARAM: RSN_AUTH_OPEN\n"));
  120. else if (value == RSN_AUTH_SHARED_KEY)
  121. WLAN_OS_REPORT(("\nSetting RSN_DESIRED_AUTH_TYPE_PARAM: RSN_AUTH_SHARED_KEY\n"));
  122. else if (value == RSN_AUTH_AUTO_SWITCH)
  123. WLAN_OS_REPORT(("\nSetting RSN_DESIRED_AUTH_TYPE_PARAM: RSN_AUTH_AUTO_SWITCH\n"));
  124. else
  125. WLAN_OS_REPORT(("\nSetting RSN_DESIRED_AUTH_TYPE_PARAM: Invalid: %d\n", value));
  126. break;
  127. case GET_RSN_DESIRED_AUTH_TYPE_DBG:
  128. param.paramType = RSN_EXT_AUTHENTICATION_MODE;
  129. cmdDispatch_GetParam(pStadHandles->hCmdDispatch, &param);
  130. if (param.content.rsnDesiredAuthType == RSN_AUTH_OPEN)
  131. WLAN_OS_REPORT(("\nGetting RSN_DESIRED_AUTH_TYPE_PARAM: RSN_AUTH_OPEN\n"));
  132. else if (param.content.rsnDesiredAuthType == RSN_AUTH_SHARED_KEY)
  133. WLAN_OS_REPORT(("\nGetting RSN_DESIRED_AUTH_TYPE_PARAM: RSN_AUTH_SHARED_KEY\n"));
  134. else if (param.content.rsnDesiredAuthType == RSN_AUTH_AUTO_SWITCH)
  135. WLAN_OS_REPORT(("\nGetting RSN_DESIRED_AUTH_TYPE_PARAM: RSN_AUTH_AUTO_SWITCH\n"));
  136. else
  137. WLAN_OS_REPORT(("\nGetting RSN_DESIRED_AUTH_TYPE_PARAM: Invalid: %d\n", param.content.rsnDesiredAuthType));
  138. break;
  139. case GET_CONNECTION_STATUS_DBG:
  140. param.paramType = SME_CONNECTION_STATUS_PARAM;
  141. cmdDispatch_GetParam(pStadHandles->hCmdDispatch, &param);
  142. if (param.content.smeSmConnectionStatus == eDot11Idle)
  143. WLAN_OS_REPORT(("\nGetting SITE_MGR_CONNECTION_STATUS_PARAM: STATUS_IDLE\n"));
  144. else if (param.content.smeSmConnectionStatus == eDot11Scaning)
  145. WLAN_OS_REPORT(("\nGetting SITE_MGR_CONNECTION_STATUS_PARAM: STATUS_SCANNING\n"));
  146. else if (param.content.smeSmConnectionStatus == eDot11Connecting)
  147. WLAN_OS_REPORT(("\nGetting SITE_MGR_CONNECTION_STATUS_PARAM: STATUS_CONNECTING\n"));
  148. else if (param.content.smeSmConnectionStatus == eDot11Associated)
  149. WLAN_OS_REPORT(("\nGetting SITE_MGR_CONNECTION_STATUS_PARAM: STATUS_ASSOCIATED\n"));
  150. else if (param.content.smeSmConnectionStatus == eDot11Disassociated)
  151. WLAN_OS_REPORT(("\nGetting SITE_MGR_CONNECTION_STATUS_PARAM: STATUS_DIS_ASSOCIATED\n"));
  152. else if (param.content.smeSmConnectionStatus == eDot11RadioDisabled)
  153. WLAN_OS_REPORT(("\nGetting SITE_MGR_CONNECTION_STATUS_PARAM: STATUS_RADIO_DISABLED\n"));
  154. else
  155. WLAN_OS_REPORT(("\nGetting SITE_MGR_CONNECTION_STATUS_PARAM: STATUS_ERROR\n"));
  156. break;
  157. case SET_SUPPORTED_RATE_SET_DBG:
  158. param.paramType = SITE_MGR_DESIRED_SUPPORTED_RATE_SET_PARAM;
  159. value = *((TI_UINT32 *)pParam);
  160. setRateSet(value, &ratesSet);
  161. os_memoryCopy(pSiteMgr->hOs, &(param.content.siteMgrDesiredSupportedRateSet), &(ratesSet), sizeof(TRates));
  162. WLAN_OS_REPORT(("\nSetting SET_SUPPORTED_RATE_SET_DBG\n"));
  163. cmdDispatch_SetParam(pStadHandles->hCmdDispatch, &param);
  164. break;
  165. case GET_SUPPORTED_RATE_SET_DBG:
  166. param.paramType = SITE_MGR_DESIRED_SUPPORTED_RATE_SET_PARAM;
  167. cmdDispatch_GetParam(pStadHandles->hCmdDispatch, &param);
  168. WLAN_OS_REPORT(("\nGetting SITE_MGR_DESIRED_SUPPORTED_RATE_SET_PARAM\n"));
  169. if(param.content.siteMgrDesiredSupportedRateSet.len == 0)
  170. WLAN_OS_REPORT(("\nNo rates defined\n"));
  171. else
  172. {
  173. /* It looks like it never happens. Anyway decided to check */
  174. if ( param.content.siteMgrDesiredSupportedRateSet.len > DOT11_MAX_SUPPORTED_RATES )
  175. {
  176. WLAN_OS_REPORT(("siteMgrDebugFunction. param.content.siteMgrDesiredSupportedRateSet.len=%d exceeds the limit %d\n",
  177. param.content.siteMgrDesiredSupportedRateSet.len, DOT11_MAX_SUPPORTED_RATES));
  178. handleRunProblem(PROBLEM_BUF_SIZE_VIOLATION);
  179. param.content.siteMgrDesiredSupportedRateSet.len = DOT11_MAX_SUPPORTED_RATES;
  180. }
  181. for (i = 0; i < param.content.siteMgrDesiredSupportedRateSet.len; i++)
  182. WLAN_OS_REPORT(("\nRate %d is 0x%X\n", i +1, param.content.siteMgrDesiredSupportedRateSet.ratesString[i]));
  183. }
  184. break;
  185. case SET_MLME_LEGACY_AUTH_TYPE_DBG:
  186. param.paramType = MLME_LEGACY_TYPE_PARAM;
  187. value = *((TI_UINT32 *)pParam);
  188. param.content.mlmeLegacyAuthType = (legacyAuthType_e)value;
  189. cmdDispatch_SetParam(pStadHandles->hCmdDispatch, &param);
  190. if (value == AUTH_LEGACY_OPEN_SYSTEM)
  191. WLAN_OS_REPORT(("\nSetting MLME_LEGACY_TYPE_PARAM: AUTH_LEGACY_OPEN_SYSTEM\n"));
  192. else if (value == AUTH_LEGACY_SHARED_KEY)
  193. WLAN_OS_REPORT(("\nSetting MLME_LEGACY_TYPE_PARAM: AUTH_LEGACY_SHARED_KEY\n"));
  194. else if (value == AUTH_LEGACY_AUTO_SWITCH)
  195. WLAN_OS_REPORT(("\nSetting MLME_LEGACY_TYPE_PARAM: AUTH_LEGACY_AUTO_SWITCH\n"));
  196. else
  197. WLAN_OS_REPORT(("\nSetting MLME_LEGACY_TYPE_PARAM: Invalid: %d\n", value));
  198. break;
  199. case GET_MLME_LEGACY_AUTH_TYPE_DBG:
  200. param.paramType = MLME_LEGACY_TYPE_PARAM;
  201. cmdDispatch_GetParam(pStadHandles->hCmdDispatch, &param);
  202. if (param.content.mlmeLegacyAuthType == AUTH_LEGACY_OPEN_SYSTEM)
  203. WLAN_OS_REPORT(("\nGetting MLME_LEGACY_TYPE_PARAM: AUTH_LEGACY_OPEN_SYSTEM\n"));
  204. else if (param.content.rsnDesiredAuthType == AUTH_LEGACY_SHARED_KEY)
  205. WLAN_OS_REPORT(("\nGetting MLME_LEGACY_TYPE_PARAM: AUTH_LEGACY_SHARED_KEY\n"));
  206. else if (param.content.rsnDesiredAuthType == AUTH_LEGACY_AUTO_SWITCH)
  207. WLAN_OS_REPORT(("\nGetting MLME_LEGACY_TYPE_PARAM: AUTH_AUTO_SWITCH\n"));
  208. else
  209. WLAN_OS_REPORT(("\nGetting MLME_LEGACY_TYPE_PARAM: Invalid: %d\n", param.content.rsnDesiredAuthType));
  210. break;
  211. case RADIO_STAND_BY_CHANGE_STATE:
  212. WLAN_OS_REPORT(("\nChange GPIO-13 State...\n"));
  213. break;
  214. case PRINT_FAILURE_EVENTS:
  215. {
  216. WLAN_OS_REPORT(("\n PRINT HEALTH MONITOR LOG\n"));
  217. healthMonitor_printFailureEvents (pStadHandles->hHealthMonitor);
  218. apConn_printStatistics(pStadHandles->hAPConnection);
  219. conn_ibssPrintStatistics(pStadHandles->hConn);
  220. if (((conn_t*)pStadHandles->hConn)->currentConnType==CONNECTION_INFRA)
  221. {
  222. switch (((conn_t*)pStadHandles->hConn)->state)
  223. {
  224. case 0: WLAN_OS_REPORT((" CONN state is IDLE\n"));
  225. break;
  226. case 1: WLAN_OS_REPORT((" CONN state is SCR_WAIT\n"));
  227. break;
  228. case 2: WLAN_OS_REPORT((" CONN state is WAIT_JOIN_CMPLT\n"));
  229. break;
  230. case 3: WLAN_OS_REPORT((" CONN state is MLME_WAIT\n"));
  231. break;
  232. case 4: WLAN_OS_REPORT((" CONN state is RSN_WAIT\n"));
  233. break;
  234. case 5: WLAN_OS_REPORT((" CONN state is CONFIG_HW\n"));
  235. break;
  236. case 6: WLAN_OS_REPORT((" CONN state is CONNECTED\n"));
  237. break;
  238. case 7: WLAN_OS_REPORT((" CONN state is DISASSOCC\n"));
  239. break;
  240. default:
  241. break;
  242. }
  243. }
  244. }
  245. break;
  246. case FORCE_HW_RESET_RECOVERY:
  247. WLAN_OS_REPORT(("\n Currently not supported!\n"));
  248. break;
  249. case FORCE_SOFT_RECOVERY:
  250. WLAN_OS_REPORT(("\n FORCE Full Recovery (Soft)\n"));
  251. break;
  252. case PERFORM_HEALTH_TEST:
  253. WLAN_OS_REPORT(("\n PERFORM_HEALTH_TEST \n"));
  254. healthMonitor_PerformTest(pStadHandles->hHealthMonitor, TI_FALSE);
  255. break;
  256. case PRINT_SITE_TABLE_PER_SSID:
  257. printSiteTable(pSiteMgr, (char*)pParam);
  258. break;
  259. case SET_DESIRED_CHANNEL:
  260. param.paramType = SITE_MGR_DESIRED_CHANNEL_PARAM;
  261. param.content.siteMgrDesiredChannel = *(TI_UINT8*)pParam;
  262. siteMgr_setParam(pStadHandles->hSiteMgr, &param);
  263. break;
  264. default:
  265. WLAN_OS_REPORT(("Invalid function type in Debug Site Manager Function Command: %d\n\n", funcType));
  266. break;
  267. }
  268. }
  269. static void printPrimarySite(siteMgr_t *pSiteMgr)
  270. {
  271. siteEntry_t *pSiteEntry;
  272. TI_UINT8 len;
  273. char ssid[MAX_SSID_LEN + 1];
  274. pSiteEntry = pSiteMgr->pSitesMgmtParams->pPrimarySite;
  275. if (pSiteEntry == NULL)
  276. {
  277. WLAN_OS_REPORT(("\n\n************************ PRIMARY SITE IS NULL ****************************\n\n\n"));
  278. return;
  279. }
  280. WLAN_OS_REPORT(("\n\n************************ PRIMARY SITE ****************************\n\n\n"));
  281. WLAN_OS_REPORT(("BSSID %2X-%2X-%2X-%2X-%2X-%2X ",
  282. pSiteEntry->bssid[0],
  283. pSiteEntry->bssid[1],
  284. pSiteEntry->bssid[2],
  285. pSiteEntry->bssid[3],
  286. pSiteEntry->bssid[4],
  287. pSiteEntry->bssid[5]));
  288. len = pSiteEntry->ssid.len;
  289. /* It looks like it never happens. Anyway decided to check */
  290. if ( pSiteEntry->ssid.len > MAX_SSID_LEN )
  291. {
  292. WLAN_OS_REPORT(("printPrimarySite. pSiteEntry->ssid.len=%d exceeds the limit %d\n",
  293. pSiteEntry->ssid.len, MAX_SSID_LEN));
  294. handleRunProblem(PROBLEM_BUF_SIZE_VIOLATION);
  295. len = MAX_SSID_LEN;
  296. }
  297. os_memoryCopy(pSiteMgr->hOs, ssid, (void *)pSiteEntry->ssid.str, len);
  298. ssid[len] = '\0';
  299. WLAN_OS_REPORT(("SSID %s\n\n", ssid));
  300. if (pSiteEntry->bssType == BSS_INFRASTRUCTURE)
  301. WLAN_OS_REPORT(("BSS Type INFRASTRUCTURE\n\n"));
  302. else if (pSiteEntry->bssType == BSS_INDEPENDENT)
  303. WLAN_OS_REPORT(("BSS Type IBSS\n\n"));
  304. else if (pSiteEntry->bssType == BSS_ANY)
  305. WLAN_OS_REPORT(("BSS Type ANY\n\n"));
  306. else
  307. WLAN_OS_REPORT(("BSS Type INVALID\n\n"));
  308. WLAN_OS_REPORT(("Channel %d\n", pSiteEntry->channel));
  309. WLAN_OS_REPORT(("\n"));
  310. switch (pSiteEntry->maxBasicRate)
  311. {
  312. case DRV_RATE_1M:
  313. WLAN_OS_REPORT(("Max Basic Rate RATE_1M_BIT\n"));
  314. break;
  315. case DRV_RATE_2M:
  316. WLAN_OS_REPORT(("Max Basic Rate RATE_2M_BIT\n"));
  317. break;
  318. case DRV_RATE_5_5M:
  319. WLAN_OS_REPORT(("Max Basic Rate RATE_5_5M_BIT\n"));
  320. break;
  321. case DRV_RATE_11M:
  322. WLAN_OS_REPORT(("Max Basic Rate RATE_11M_BIT\n"));
  323. break;
  324. case DRV_RATE_6M:
  325. WLAN_OS_REPORT(("Max Basic Rate RATE_6M_BIT\n"));
  326. break;
  327. case DRV_RATE_9M:
  328. WLAN_OS_REPORT(("Max Basic Rate RATE_9M_BIT\n"));
  329. break;
  330. case DRV_RATE_12M:
  331. WLAN_OS_REPORT(("Max Basic Rate RATE_12M_BIT\n"));
  332. break;
  333. case DRV_RATE_18M:
  334. WLAN_OS_REPORT(("Max Basic Rate RATE_18M_BIT\n"));
  335. break;
  336. case DRV_RATE_24M:
  337. WLAN_OS_REPORT(("Max Basic Rate RATE_24M_BIT\n"));
  338. break;
  339. case DRV_RATE_36M:
  340. WLAN_OS_REPORT(("Max Basic Rate RATE_36M_BIT\n"));
  341. break;
  342. case DRV_RATE_48M:
  343. WLAN_OS_REPORT(("Max Basic Rate RATE_48M_BIT\n"));
  344. break;
  345. case DRV_RATE_54M:
  346. WLAN_OS_REPORT(("Max Basic Rate RATE_54M_BIT\n"));
  347. break;
  348. default:
  349. WLAN_OS_REPORT(("Max Basic Rate INVALID, 0x%X\n", pSiteEntry->maxBasicRate));
  350. break;
  351. }
  352. switch (pSiteEntry->maxActiveRate)
  353. {
  354. case DRV_RATE_1M:
  355. WLAN_OS_REPORT(("Max Active Rate RATE_1M_BIT\n"));
  356. break;
  357. case DRV_RATE_2M:
  358. WLAN_OS_REPORT(("Max Active Rate RATE_2M_BIT\n"));
  359. break;
  360. case DRV_RATE_5_5M:
  361. WLAN_OS_REPORT(("Max Active Rate RATE_5_5M_BIT\n"));
  362. break;
  363. case DRV_RATE_11M:
  364. WLAN_OS_REPORT(("Max Active Rate RATE_11M_BIT\n"));
  365. break;
  366. case DRV_RATE_22M:
  367. WLAN_OS_REPORT(("Max Active Rate RATE_22M_BIT\n"));
  368. break;
  369. case DRV_RATE_6M:
  370. WLAN_OS_REPORT(("Max Active Rate RATE_6M_BIT\n"));
  371. break;
  372. case DRV_RATE_9M:
  373. WLAN_OS_REPORT(("Max Active Rate RATE_9M_BIT\n"));
  374. break;
  375. case DRV_RATE_12M:
  376. WLAN_OS_REPORT(("Max Active Rate RATE_12M_BIT\n"));
  377. break;
  378. case DRV_RATE_18M:
  379. WLAN_OS_REPORT(("Max Active Rate RATE_18M_BIT\n"));
  380. break;
  381. case DRV_RATE_24M:
  382. WLAN_OS_REPORT(("Max Active Rate RATE_24M_BIT\n"));
  383. break;
  384. case DRV_RATE_36M:
  385. WLAN_OS_REPORT(("Max Active Rate RATE_36M_BIT\n"));
  386. break;
  387. case DRV_RATE_48M:
  388. WLAN_OS_REPORT(("Max Active Rate RATE_48M_BIT\n"));
  389. break;
  390. case DRV_RATE_54M:
  391. WLAN_OS_REPORT(("Max Active Rate RATE_54M_BIT\n"));
  392. break;
  393. default:
  394. WLAN_OS_REPORT(("Max Active Rate INVALID, 0x%X\n", pSiteEntry->maxActiveRate));
  395. break;
  396. }
  397. WLAN_OS_REPORT(("\n"));
  398. if (pSiteEntry->probeModulation == DRV_MODULATION_QPSK)
  399. WLAN_OS_REPORT(("Probe Modulation QPSK\n"));
  400. else if (pSiteEntry->probeModulation == DRV_MODULATION_CCK)
  401. WLAN_OS_REPORT(("Probe Modulation CCK\n"));
  402. else if (pSiteEntry->probeModulation == DRV_MODULATION_PBCC)
  403. WLAN_OS_REPORT(("Probe Modulation PBCC\n"));
  404. else if (pSiteEntry->probeModulation == DRV_MODULATION_OFDM)
  405. WLAN_OS_REPORT(("Probe Modulation OFDM\n"));
  406. else
  407. WLAN_OS_REPORT(("Probe Modulation INVALID, %d\n", pSiteEntry->probeModulation));
  408. if (pSiteEntry->beaconModulation == DRV_MODULATION_QPSK)
  409. WLAN_OS_REPORT(("Beacon Modulation QPSK\n"));
  410. else if (pSiteEntry->beaconModulation == DRV_MODULATION_CCK)
  411. WLAN_OS_REPORT(("Beacon Modulation CCK\n"));
  412. else if (pSiteEntry->beaconModulation == DRV_MODULATION_PBCC)
  413. WLAN_OS_REPORT(("Beacon Modulation PBCC\n"));
  414. else if (pSiteEntry->beaconModulation == DRV_MODULATION_OFDM)
  415. WLAN_OS_REPORT(("Beacon Modulation OFDM\n"));
  416. else
  417. WLAN_OS_REPORT(("Beacon Modulation INVALID, %d\n", pSiteEntry->beaconModulation));
  418. WLAN_OS_REPORT(("\n"));
  419. if (pSiteEntry->privacy == TI_TRUE)
  420. WLAN_OS_REPORT(("Privacy On\n\n"));
  421. else
  422. WLAN_OS_REPORT(("Privacy Off\n\n"));
  423. if (pSiteEntry->currentPreambleType == PREAMBLE_SHORT)
  424. WLAN_OS_REPORT(("Cap Preamble Type Short\n"));
  425. else if (pSiteEntry->currentPreambleType == PREAMBLE_LONG)
  426. WLAN_OS_REPORT(("Cap Preamble Type Long\n"));
  427. else
  428. WLAN_OS_REPORT(("Preamble INVALID, %d\n", pSiteEntry->currentPreambleType));
  429. if(pSiteEntry->barkerPreambleType == PREAMBLE_UNSPECIFIED)
  430. WLAN_OS_REPORT(("Barker preamble Type Unspecified\n"));
  431. else if(pSiteEntry->barkerPreambleType == PREAMBLE_SHORT)
  432. WLAN_OS_REPORT(("Barker_Preamble Type Short\n"));
  433. else
  434. WLAN_OS_REPORT(("Barker_Preamble Type Long\n"));
  435. if(pSiteEntry->currentSlotTime == PHY_SLOT_TIME_SHORT)
  436. WLAN_OS_REPORT(("Slot time type Short\n"));
  437. else
  438. WLAN_OS_REPORT(("Slot time type Long\n"));
  439. WLAN_OS_REPORT(("\n"));
  440. WLAN_OS_REPORT(("Beacon interval %d\n", pSiteEntry->beaconInterval));
  441. WLAN_OS_REPORT(("Local Time Stamp %d\n", pSiteEntry->localTimeStamp));
  442. WLAN_OS_REPORT(("rssi %d\n", pSiteEntry->rssi));
  443. WLAN_OS_REPORT(("\n"));
  444. WLAN_OS_REPORT(("Fail status %d\n", pSiteEntry->failStatus));
  445. WLAN_OS_REPORT(("\n---------------------------------------------------------------\n\n"));
  446. }
  447. void printSiteTable(siteMgr_t *pSiteMgr, char *desiredSsid)
  448. {
  449. TI_UINT8 i, numOfSites = 0;
  450. siteEntry_t *pSiteEntry;
  451. char ssid[MAX_SSID_LEN + 1];
  452. siteTablesParams_t *pCurrentSiteTable = pSiteMgr->pSitesMgmtParams->pCurrentSiteTable;
  453. TI_UINT8 tableIndex=2;
  454. WLAN_OS_REPORT(("\n\n************************ SITE TABLE ****************************\n\n\n"));
  455. /* It looks like it never happens. Anyway decided to check */
  456. if ( pCurrentSiteTable->maxNumOfSites > MAX_SITES_BG_BAND )
  457. {
  458. WLAN_OS_REPORT(("printSiteTable. pCurrentSiteTable->maxNumOfSites=%d exceeds the limit %d\n",
  459. pCurrentSiteTable->maxNumOfSites, MAX_SITES_BG_BAND));
  460. handleRunProblem(PROBLEM_BUF_SIZE_VIOLATION);
  461. pCurrentSiteTable->maxNumOfSites = MAX_SITES_BG_BAND;
  462. }
  463. do
  464. {
  465. tableIndex--;
  466. for (i = 0; i < pCurrentSiteTable->maxNumOfSites; i++)
  467. {
  468. pSiteEntry = &(pCurrentSiteTable->siteTable[i]);
  469. if (pSiteEntry->siteType == SITE_NULL)
  470. continue;
  471. /* It looks like it never happens. Anyway decided to check */
  472. if ( pCurrentSiteTable->siteTable[i].ssid.len > MAX_SSID_LEN )
  473. {
  474. WLAN_OS_REPORT(("printSiteTable. pCurrentSiteTable->siteTable[%d].ssid.len=%d exceeds the limit %d\n",
  475. i, pCurrentSiteTable->siteTable[i].ssid.len, MAX_SSID_LEN));
  476. handleRunProblem(PROBLEM_BUF_SIZE_VIOLATION);
  477. pCurrentSiteTable->siteTable[i].ssid.len = MAX_SSID_LEN;
  478. }
  479. os_memoryCopy(pSiteMgr->hOs ,ssid, (void *)pCurrentSiteTable->siteTable[i].ssid.str, pCurrentSiteTable->siteTable[i].ssid.len);
  480. ssid[pCurrentSiteTable->siteTable[i].ssid.len] = '\0';
  481. if (desiredSsid != NULL)
  482. {
  483. int desiredSsidLength = 0;
  484. char * tmp = desiredSsid;
  485. while (tmp != '\0')
  486. {
  487. desiredSsidLength++;
  488. tmp++;
  489. }
  490. if (os_memoryCompare(pSiteMgr->hOs, (TI_UINT8 *)ssid, (TI_UINT8 *)desiredSsid, desiredSsidLength))
  491. continue;
  492. }
  493. WLAN_OS_REPORT(("SSID %s\n\n", ssid));
  494. if (pSiteEntry->siteType == SITE_PRIMARY)
  495. WLAN_OS_REPORT( (" ENTRY PRIMARY %d \n", numOfSites));
  496. else
  497. WLAN_OS_REPORT( (" ENTRY %d\n", i));
  498. WLAN_OS_REPORT(("BSSID %2X-%2X-%2X-%2X-%2X-%2X \n",
  499. pCurrentSiteTable->siteTable[i].bssid[0],
  500. pCurrentSiteTable->siteTable[i].bssid[1],
  501. pCurrentSiteTable->siteTable[i].bssid[2],
  502. pCurrentSiteTable->siteTable[i].bssid[3],
  503. pCurrentSiteTable->siteTable[i].bssid[4],
  504. pCurrentSiteTable->siteTable[i].bssid[5]));
  505. if (pCurrentSiteTable->siteTable[i].bssType == BSS_INFRASTRUCTURE)
  506. WLAN_OS_REPORT(("BSS Type INFRASTRUCTURE\n\n"));
  507. else if (pCurrentSiteTable->siteTable[i].bssType == BSS_INDEPENDENT)
  508. WLAN_OS_REPORT(("BSS Type IBSS\n\n"));
  509. else if (pCurrentSiteTable->siteTable[i].bssType == BSS_ANY)
  510. WLAN_OS_REPORT(("BSS Type ANY\n\n"));
  511. else
  512. WLAN_OS_REPORT(("BSS Type INVALID\n\n"));
  513. WLAN_OS_REPORT(("Channel %d\n", pCurrentSiteTable->siteTable[i].channel));
  514. WLAN_OS_REPORT(("\n"));
  515. switch (pCurrentSiteTable->siteTable[i].maxBasicRate)
  516. {
  517. case DRV_RATE_1M:
  518. WLAN_OS_REPORT(("Max Basic Rate RATE_1M_BIT\n"));
  519. break;
  520. case DRV_RATE_2M:
  521. WLAN_OS_REPORT(("Max Basic Rate RATE_2M_BIT\n"));
  522. break;
  523. case DRV_RATE_5_5M:
  524. WLAN_OS_REPORT(("Max Basic Rate RATE_5_5M_BIT\n"));
  525. break;
  526. case DRV_RATE_11M:
  527. WLAN_OS_REPORT(("Max Basic Rate RATE_11M_BIT\n"));
  528. break;
  529. case DRV_RATE_6M:
  530. WLAN_OS_REPORT(("Max Basic Rate RATE_6M_BIT\n"));
  531. break;
  532. case DRV_RATE_9M:
  533. WLAN_OS_REPORT(("Max Basic Rate RATE_9M_BIT\n"));
  534. break;
  535. case DRV_RATE_12M:
  536. WLAN_OS_REPORT(("Max Basic Rate RATE_12M_BIT\n"));
  537. break;
  538. case DRV_RATE_18M:
  539. WLAN_OS_REPORT(("Max Basic Rate RATE_18M_BIT\n"));
  540. break;
  541. case DRV_RATE_24M:
  542. WLAN_OS_REPORT(("Max Basic Rate RATE_24M_BIT\n"));
  543. break;
  544. case DRV_RATE_36M:
  545. WLAN_OS_REPORT(("Max Basic Rate RATE_36M_BIT\n"));
  546. break;
  547. case DRV_RATE_48M:
  548. WLAN_OS_REPORT(("Max Basic Rate RATE_48M_BIT\n"));
  549. break;
  550. case DRV_RATE_54M:
  551. WLAN_OS_REPORT(("Max Basic Rate RATE_54M_BIT\n"));
  552. break;
  553. default:
  554. WLAN_OS_REPORT(("Max Basic Rate INVALID, 0x%X\n", pCurrentSiteTable->siteTable[i].maxBasicRate));
  555. break;
  556. }
  557. switch (pCurrentSiteTable->siteTable[i].maxActiveRate)
  558. {
  559. case DRV_RATE_1M:
  560. WLAN_OS_REPORT(("Max Active Rate RATE_1M_BIT\n"));
  561. break;
  562. case DRV_RATE_2M:
  563. WLAN_OS_REPORT(("Max Active Rate RATE_2M_BIT\n"));
  564. break;
  565. case DRV_RATE_5_5M:
  566. WLAN_OS_REPORT(("Max Active Rate RATE_5_5M_BIT\n"));
  567. break;
  568. case DRV_RATE_11M:
  569. WLAN_OS_REPORT(("Max Active Rate RATE_11M_BIT\n"));
  570. break;
  571. case DRV_RATE_22M:
  572. WLAN_OS_REPORT(("Max Active Rate RATE_22M_BIT\n"));
  573. break;
  574. case DRV_RATE_6M:
  575. WLAN_OS_REPORT(("Max Active Rate RATE_6M_BIT\n"));
  576. break;
  577. case DRV_RATE_9M:
  578. WLAN_OS_REPORT(("Max Active Rate RATE_9M_BIT\n"));
  579. break;
  580. case DRV_RATE_12M:
  581. WLAN_OS_REPORT(("Max Active Rate RATE_12M_BIT\n"));
  582. break;
  583. case DRV_RATE_18M:
  584. WLAN_OS_REPORT(("Max Active Rate RATE_18M_BIT\n"));
  585. break;
  586. case DRV_RATE_24M:
  587. WLAN_OS_REPORT(("Max Active Rate RATE_24M_BIT\n"));
  588. break;
  589. case DRV_RATE_36M:
  590. WLAN_OS_REPORT(("Max Active Rate RATE_36M_BIT\n"));
  591. break;
  592. case DRV_RATE_48M:
  593. WLAN_OS_REPORT(("Max Active Rate RATE_48M_BIT\n"));
  594. break;
  595. case DRV_RATE_54M:
  596. WLAN_OS_REPORT(("Max Active Rate RATE_54M_BIT\n"));
  597. break;
  598. default:
  599. WLAN_OS_REPORT(("Max Active Rate INVALID, 0x%X\n", pCurrentSiteTable->siteTable[i].maxActiveRate));
  600. break;
  601. }
  602. WLAN_OS_REPORT(("\n"));
  603. if (pCurrentSiteTable->siteTable[i].probeModulation == DRV_MODULATION_QPSK)
  604. WLAN_OS_REPORT(("Probe Modulation QPSK\n"));
  605. else if (pCurrentSiteTable->siteTable[i].probeModulation == DRV_MODULATION_CCK)
  606. WLAN_OS_REPORT(("Probe Modulation CCK\n"));
  607. else if (pCurrentSiteTable->siteTable[i].probeModulation == DRV_MODULATION_PBCC)
  608. WLAN_OS_REPORT(("Probe Modulation PBCC\n"));
  609. else
  610. WLAN_OS_REPORT(("Probe Modulation INVALID, %d\n", pCurrentSiteTable->siteTable[i].probeModulation));
  611. if (pCurrentSiteTable->siteTable[i].beaconModulation == DRV_MODULATION_QPSK)
  612. WLAN_OS_REPORT(("Beacon Modulation QPSK\n"));
  613. else if (pCurrentSiteTable->siteTable[i].beaconModulation == DRV_MODULATION_CCK)
  614. WLAN_OS_REPORT(("Beacon Modulation CCK\n"));
  615. else if (pCurrentSiteTable->siteTable[i].beaconModulation == DRV_MODULATION_PBCC)
  616. WLAN_OS_REPORT(("Beacon Modulation PBCC\n"));
  617. else
  618. WLAN_OS_REPORT(("Beacon Modulation INVALID, %d\n", pCurrentSiteTable->siteTable[i].beaconModulation));
  619. WLAN_OS_REPORT(("\n"));
  620. if (pCurrentSiteTable->siteTable[i].privacy == TI_TRUE)
  621. WLAN_OS_REPORT(("Privacy On\n"));
  622. else
  623. WLAN_OS_REPORT(("Privacy Off\n"));
  624. if (pCurrentSiteTable->siteTable[i].currentPreambleType == PREAMBLE_SHORT)
  625. WLAN_OS_REPORT(("Preamble Type Short\n"));
  626. else if (pCurrentSiteTable->siteTable[i].currentPreambleType == PREAMBLE_LONG)
  627. WLAN_OS_REPORT(("Preamble Type Long\n"));
  628. else
  629. WLAN_OS_REPORT(("Preamble INVALID, %d\n", pCurrentSiteTable->siteTable[i].currentPreambleType));
  630. WLAN_OS_REPORT(("\n"));
  631. WLAN_OS_REPORT(("Beacon interval %d\n", pCurrentSiteTable->siteTable[i].beaconInterval));
  632. WLAN_OS_REPORT(("Local Time Stamp %d\n", pCurrentSiteTable->siteTable[i].localTimeStamp));
  633. WLAN_OS_REPORT(("rssi %d\n", pCurrentSiteTable->siteTable[i].rssi));
  634. WLAN_OS_REPORT(("\n"));
  635. WLAN_OS_REPORT(("Fail status %d\n", pCurrentSiteTable->siteTable[i].failStatus));
  636. WLAN_OS_REPORT(("ATIM Window %d\n", pCurrentSiteTable->siteTable[i].atimWindow));
  637. WLAN_OS_REPORT(("\n---------------------------------------------------------------\n\n"));
  638. numOfSites++;
  639. }
  640. WLAN_OS_REPORT(("\n Number Of Sites: %d\n", numOfSites));
  641. WLAN_OS_REPORT(("\n---------------------------------------------------------------\n"));
  642. if ((pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode == DOT11_DUAL_MODE) && (tableIndex==1))
  643. { /* change site table */
  644. if (pCurrentSiteTable == &pSiteMgr->pSitesMgmtParams->dot11BG_sitesTables)
  645. {
  646. WLAN_OS_REPORT(("\n dot11A_sitesTables \n"));
  647. pCurrentSiteTable = (siteTablesParams_t *)&pSiteMgr->pSitesMgmtParams->dot11A_sitesTables;
  648. }
  649. else
  650. {
  651. WLAN_OS_REPORT(("\n dot11BG_sitesTables \n"));
  652. pCurrentSiteTable = &pSiteMgr->pSitesMgmtParams->dot11BG_sitesTables;
  653. }
  654. }
  655. } while (tableIndex>0);
  656. }
  657. static void printDesiredParams(siteMgr_t *pSiteMgr, TI_HANDLE hCmdDispatch)
  658. {
  659. paramInfo_t param;
  660. WLAN_OS_REPORT(("\n\n*****************************************"));
  661. WLAN_OS_REPORT(("*****************************************\n\n"));
  662. WLAN_OS_REPORT(("Channel %d\n", pSiteMgr->pDesiredParams->siteMgrDesiredChannel));
  663. WLAN_OS_REPORT(("\n*****************************************\n\n"));
  664. switch (pSiteMgr->pDesiredParams->siteMgrDesiredRatePair.maxBasic)
  665. {
  666. case DRV_RATE_1M:
  667. WLAN_OS_REPORT(("Max Basic Rate RATE_1M_BIT\n"));
  668. break;
  669. case DRV_RATE_2M:
  670. WLAN_OS_REPORT(("Max Basic Rate RATE_2M_BIT\n"));
  671. break;
  672. case DRV_RATE_5_5M:
  673. WLAN_OS_REPORT(("Max Basic Rate RATE_5_5M_BIT\n"));
  674. break;
  675. case DRV_RATE_11M:
  676. WLAN_OS_REPORT(("Max Basic Rate RATE_11M_BIT\n"));
  677. break;
  678. case DRV_RATE_22M:
  679. WLAN_OS_REPORT(("Max Basic Rate RATE_22M_BIT\n"));
  680. break;
  681. case DRV_RATE_6M:
  682. WLAN_OS_REPORT(("Max Basic Rate RATE_6M_BIT\n"));
  683. break;
  684. case DRV_RATE_9M:
  685. WLAN_OS_REPORT(("Max Basic Rate RATE_9M_BIT\n"));
  686. break;
  687. case DRV_RATE_12M:
  688. WLAN_OS_REPORT(("Max Basic Rate RATE_12M_BIT\n"));
  689. break;
  690. case DRV_RATE_18M:
  691. WLAN_OS_REPORT(("Max Basic Rate RATE_18M_BIT\n"));
  692. break;
  693. case DRV_RATE_24M:
  694. WLAN_OS_REPORT(("Max Basic Rate RATE_24M_BIT\n"));
  695. break;
  696. case DRV_RATE_36M:
  697. WLAN_OS_REPORT(("Max Basic Rate RATE_36M_BIT\n"));
  698. break;
  699. case DRV_RATE_48M:
  700. WLAN_OS_REPORT(("Max Basic Rate RATE_48M_BIT\n"));
  701. break;
  702. case DRV_RATE_54M:
  703. WLAN_OS_REPORT(("Max Basic Rate RATE_54M_BIT\n"));
  704. break;
  705. default:
  706. WLAN_OS_REPORT(("Invalid basic rate value 0x%X\n", pSiteMgr->pDesiredParams->siteMgrDesiredRatePair.maxBasic));
  707. break;
  708. }
  709. switch (pSiteMgr->pDesiredParams->siteMgrDesiredRatePair.maxActive)
  710. {
  711. case DRV_RATE_1M:
  712. WLAN_OS_REPORT(("Max Active Rate RATE_1M_BIT\n"));
  713. break;
  714. case DRV_RATE_2M:
  715. WLAN_OS_REPORT(("Max Active Rate RATE_2M_BIT\n"));
  716. break;
  717. case DRV_RATE_5_5M:
  718. WLAN_OS_REPORT(("Max Active Rate RATE_5_5M_BIT\n"));
  719. break;
  720. case DRV_RATE_11M:
  721. WLAN_OS_REPORT(("Max Active Rate RATE_11M_BIT\n"));
  722. break;
  723. case DRV_RATE_22M:
  724. WLAN_OS_REPORT(("Max Active Rate RATE_22M_BIT\n"));
  725. break;
  726. case DRV_RATE_6M:
  727. WLAN_OS_REPORT(("Max Active Rate RATE_6M_BIT\n"));
  728. break;
  729. case DRV_RATE_9M:
  730. WLAN_OS_REPORT(("Max Active Rate RATE_9M_BIT\n"));
  731. break;
  732. case DRV_RATE_12M:
  733. WLAN_OS_REPORT(("Max Active Rate RATE_12M_BIT\n"));
  734. break;
  735. case DRV_RATE_18M:
  736. WLAN_OS_REPORT(("Max Active Rate RATE_18M_BIT\n"));
  737. break;
  738. case DRV_RATE_24M:
  739. WLAN_OS_REPORT(("Max Active Rate RATE_24M_BIT\n"));
  740. break;
  741. case DRV_RATE_36M:
  742. WLAN_OS_REPORT(("Max Active Rate RATE_36M_BIT\n"));
  743. break;
  744. case DRV_RATE_48M:
  745. WLAN_OS_REPORT(("Max Active Rate RATE_48M_BIT\n"));
  746. break;
  747. case DRV_RATE_54M:
  748. WLAN_OS_REPORT(("Max Active Rate RATE_54M_BIT\n"));
  749. break;
  750. default:
  751. WLAN_OS_REPORT(("Invalid basic rate value 0x%X\n", pSiteMgr->pDesiredParams->siteMgrDesiredRatePair.maxActive));
  752. break;
  753. }
  754. if (pSiteMgr->pDesiredParams->siteMgrDesiredModulationType == DRV_MODULATION_QPSK)
  755. WLAN_OS_REPORT(("Modulation Type QPSK\n"));
  756. else if (pSiteMgr->pDesiredParams->siteMgrDesiredModulationType == DRV_MODULATION_CCK)
  757. WLAN_OS_REPORT(("Modulation Type CCK\n"));
  758. else if (pSiteMgr->pDesiredParams->siteMgrDesiredModulationType == DRV_MODULATION_PBCC)
  759. WLAN_OS_REPORT(("Modulation Type PBCC\n"));
  760. else if (pSiteMgr->pDesiredParams->siteMgrDesiredModulationType == DRV_MODULATION_OFDM)
  761. WLAN_OS_REPORT(("Modulation Type OFDM\n"));
  762. else
  763. WLAN_OS_REPORT(("Invalid Modulation Type %d\n", pSiteMgr->pDesiredParams->siteMgrDesiredModulationType));
  764. WLAN_OS_REPORT(("\n*****************************************\n\n"));
  765. param.paramType = RSN_EXT_AUTHENTICATION_MODE;
  766. cmdDispatch_GetParam(hCmdDispatch, &param);
  767. if (param.content.rsnDesiredAuthType == RSN_AUTH_OPEN)
  768. WLAN_OS_REPORT(("Authentication Type Open System\n"));
  769. else if (param.content.rsnDesiredAuthType == RSN_AUTH_SHARED_KEY)
  770. WLAN_OS_REPORT(("Authentication Type Shared Key\n"));
  771. else
  772. WLAN_OS_REPORT(("Authentication Type Invalid: %d\n", param.content.rsnDesiredAuthType));
  773. param.paramType = RSN_ENCRYPTION_STATUS_PARAM;
  774. cmdDispatch_GetParam(hCmdDispatch, &param);
  775. if (param.content.rsnEncryptionStatus == TWD_CIPHER_NONE)
  776. WLAN_OS_REPORT(("WEP Off\n"));
  777. else if (param.content.rsnEncryptionStatus == TWD_CIPHER_WEP)
  778. WLAN_OS_REPORT(("WEP On\n"));
  779. else
  780. WLAN_OS_REPORT(("WEP Invalid: %d\n", param.content.rsnEncryptionStatus));
  781. WLAN_OS_REPORT(("\n"));
  782. WLAN_OS_REPORT(("\n*****************************************\n\n"));
  783. if(pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode == DOT11_B_MODE)
  784. WLAN_OS_REPORT(("Desired dot11mode 11b\n"));
  785. else if(pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode == DOT11_G_MODE)
  786. WLAN_OS_REPORT(("Desired dot11mode 11g\n"));
  787. else if(pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode == DOT11_A_MODE)
  788. WLAN_OS_REPORT(("Desired dot11mode 11a\n"));
  789. else if(pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode == DOT11_DUAL_MODE)
  790. WLAN_OS_REPORT(("Desired dot11mode dual 11a/g\n"));
  791. else
  792. WLAN_OS_REPORT(("Desired dot11mode INVALID\n"));
  793. WLAN_OS_REPORT(("\n*****************************************\n\n"));
  794. if(pSiteMgr->pDesiredParams->siteMgrDesiredSlotTime == PHY_SLOT_TIME_SHORT)
  795. WLAN_OS_REPORT(("Desired slot time short\n"));
  796. else if(pSiteMgr->pDesiredParams->siteMgrDesiredSlotTime == PHY_SLOT_TIME_LONG)
  797. WLAN_OS_REPORT(("Desired slot time long\n"));
  798. else
  799. WLAN_OS_REPORT(("Desired slot time INVALID\n"));
  800. WLAN_OS_REPORT(("\n*****************************************\n\n"));
  801. if (pSiteMgr->pDesiredParams->siteMgrDesiredPreambleType == PREAMBLE_SHORT)
  802. WLAN_OS_REPORT(("Desired Preamble Short\n"));
  803. else if (pSiteMgr->pDesiredParams->siteMgrDesiredPreambleType == PREAMBLE_LONG)
  804. WLAN_OS_REPORT(("Desired Preamble Long\n"));
  805. else
  806. WLAN_OS_REPORT(("Invalid Desired Preamble %d\n", pSiteMgr->pDesiredParams->siteMgrDesiredPreambleType));
  807. WLAN_OS_REPORT(("Beacon interval %d\n", pSiteMgr->pDesiredParams->siteMgrDesiredBeaconInterval));
  808. WLAN_OS_REPORT(("\n*****************************************"));
  809. WLAN_OS_REPORT(("*****************************************\n\n"));
  810. }
  811. static void printPrimarySiteDesc(siteMgr_t *pSiteMgr, OS_802_11_BSSID *pPrimarySiteDesc)
  812. {
  813. TI_UINT8 rateIndex, maxNumOfRates;
  814. char ssid[MAX_SSID_LEN + 1];
  815. WLAN_OS_REPORT(("\n^^^^^^^^^^^^^^^ PRIMARY SITE DESCRIPTION ^^^^^^^^^^^^^^^^^^^\n\n"));
  816. /* MacAddress */
  817. WLAN_OS_REPORT(("BSSID 0x%X-0x%X-0x%X-0x%X-0x%X-0x%X\n", pPrimarySiteDesc->MacAddress[0],
  818. pPrimarySiteDesc->MacAddress[1],
  819. pPrimarySiteDesc->MacAddress[2],
  820. pPrimarySiteDesc->MacAddress[3],
  821. pPrimarySiteDesc->MacAddress[4],
  822. pPrimarySiteDesc->MacAddress[5]));
  823. /* Capabilities */
  824. WLAN_OS_REPORT(("Capabilities 0x%X\n", pPrimarySiteDesc->Capabilities));
  825. /* SSID */
  826. os_memoryCopy(pSiteMgr->hOs, ssid, (void *)pPrimarySiteDesc->Ssid.Ssid, pPrimarySiteDesc->Ssid.SsidLength);
  827. ssid[pPrimarySiteDesc->Ssid.SsidLength] = 0;
  828. WLAN_OS_REPORT(("SSID %s\n", ssid));
  829. /* privacy */
  830. if (pPrimarySiteDesc->Privacy == TI_TRUE)
  831. WLAN_OS_REPORT(("Privacy ON\n"));
  832. else
  833. WLAN_OS_REPORT(("Privacy OFF\n"));
  834. /* RSSI */
  835. WLAN_OS_REPORT(("RSSI %d\n", ((pPrimarySiteDesc->Rssi)>>16)));
  836. if (pPrimarySiteDesc->InfrastructureMode == os802_11IBSS)
  837. WLAN_OS_REPORT(("BSS Type IBSS\n"));
  838. else
  839. WLAN_OS_REPORT(("BSS Type INFRASTRUCTURE\n"));
  840. maxNumOfRates = sizeof(pPrimarySiteDesc->SupportedRates) / sizeof(pPrimarySiteDesc->SupportedRates[0]);
  841. /* SupportedRates */
  842. for (rateIndex = 0; rateIndex < maxNumOfRates; rateIndex++)
  843. {
  844. if (pPrimarySiteDesc->SupportedRates[rateIndex] != 0)
  845. WLAN_OS_REPORT(("Rate 0x%X\n", pPrimarySiteDesc->SupportedRates[rateIndex]));
  846. }
  847. WLAN_OS_REPORT(("\n---------------------------------------------------------------\n\n"));
  848. }
  849. static void setRateSet(TI_UINT8 maxRate, TRates *pRates)
  850. {
  851. TI_UINT8 i = 0;
  852. switch (maxRate)
  853. {
  854. case DRV_RATE_54M:
  855. pRates->ratesString[i] = 108;
  856. i++;
  857. case DRV_RATE_48M:
  858. pRates->ratesString[i] = 96;
  859. i++;
  860. case DRV_RATE_36M:
  861. pRates->ratesString[i] = 72;
  862. i++;
  863. case DRV_RATE_24M:
  864. pRates->ratesString[i] = 48;
  865. i++;
  866. case DRV_RATE_18M:
  867. pRates->ratesString[i] = 36;
  868. i++;
  869. case DRV_RATE_12M:
  870. pRates->ratesString[i] = 24;
  871. i++;
  872. case DRV_RATE_9M:
  873. pRates->ratesString[i] = 18;
  874. i++;
  875. case DRV_RATE_6M:
  876. pRates->ratesString[i] = 12;
  877. i++;
  878. case DRV_RATE_22M:
  879. pRates->ratesString[i] = 44;
  880. i++;
  881. case DRV_RATE_11M:
  882. pRates->ratesString[i] = 22;
  883. pRates->ratesString[i] |= 0x80;
  884. i++;
  885. case DRV_RATE_5_5M:
  886. pRates->ratesString[i] = 11;
  887. pRates->ratesString[i] |= 0x80;
  888. i++;
  889. case DRV_RATE_2M:
  890. pRates->ratesString[i] = 4;
  891. pRates->ratesString[i] |= 0x80;
  892. i++;
  893. case DRV_RATE_1M:
  894. pRates->ratesString[i] = 2;
  895. pRates->ratesString[i] |= 0x80;
  896. i++;
  897. break;
  898. default:
  899. WLAN_OS_REPORT(("Set Rate Set, invalid max rate %d\n", maxRate));
  900. pRates->len = 0;
  901. }
  902. pRates->len = i;
  903. }
  904. void printSiteMgrHelpMenu(void)
  905. {
  906. WLAN_OS_REPORT(("\n\n Site Manager Debug Menu \n"));
  907. WLAN_OS_REPORT(("------------------------\n"));
  908. WLAN_OS_REPORT(("500 - Help.\n"));
  909. WLAN_OS_REPORT(("501 - Primary Site Parameters.\n"));
  910. WLAN_OS_REPORT(("502 - Sites List.\n"));
  911. WLAN_OS_REPORT(("503 - Desired Parameters.\n"));
  912. WLAN_OS_REPORT(("507 - Set Power save Mode.\n"));
  913. WLAN_OS_REPORT(("508 - Get Power save Mode.\n"));
  914. WLAN_OS_REPORT(("511 - Set Default Key Id.\n"));
  915. WLAN_OS_REPORT(("512 - Get Default Key Id.\n"));
  916. WLAN_OS_REPORT(("513 - Set Key.\n"));
  917. WLAN_OS_REPORT(("514 - Get Key.\n"));
  918. WLAN_OS_REPORT(("515 - Set Cypher Suite.\n"));
  919. WLAN_OS_REPORT(("516 - Get Cypher Suite.\n"));
  920. WLAN_OS_REPORT(("517 - Set Auth Mode.\n"));
  921. WLAN_OS_REPORT(("518 - Get Auth Mode.\n"));
  922. WLAN_OS_REPORT(("519 - Get Primary Site Description.\n"));
  923. WLAN_OS_REPORT(("520 - Get Connection Status.\n"));
  924. WLAN_OS_REPORT(("522 - Get Current Tx Rate.\n"));
  925. WLAN_OS_REPORT(("525 - Set Supported Rate Set.\n"));
  926. WLAN_OS_REPORT(("526 - Get Supported Rate Set.\n"));
  927. WLAN_OS_REPORT(("527 - Set Auth type.\n"));
  928. WLAN_OS_REPORT(("528 - Get Auth type.\n"));
  929. WLAN_OS_REPORT((" %03d - RADIO_STAND_BY_CHANGE_STATE \n", RADIO_STAND_BY_CHANGE_STATE));
  930. WLAN_OS_REPORT((" %03d - CONNECT_TO_BSSID \n", CONNECT_TO_BSSID));
  931. WLAN_OS_REPORT((" %03d - SET_START_CLI_SCAN_PARAM \n", SET_START_CLI_SCAN_PARAM));
  932. WLAN_OS_REPORT((" %03d - SET_STOP_CLI_SCAN_PARAM \n", SET_STOP_CLI_SCAN_PARAM));
  933. WLAN_OS_REPORT((" %03d - SET_BROADCAST_BACKGROUND_SCAN_PARAM \n", SET_BROADCAST_BACKGROUND_SCAN_PARAM));
  934. WLAN_OS_REPORT((" %03d - ENABLE_PERIODIC_BROADCAST_BBACKGROUND_SCAN_PARAM \n", ENABLE_PERIODIC_BROADCAST_BACKGROUND_SCAN_PARAM));
  935. WLAN_OS_REPORT((" %03d - DISABLE_PERIODIC_BROADCAST_BACKGROUND_SCAN_PARAM \n", DISABLE_PERIODIC_BROADCAST_BACKGROUND_SCAN_PARAM));
  936. WLAN_OS_REPORT((" %03d - SET_UNICAST_BACKGROUND_SCAN_PARAM \n", SET_UNICAST_BACKGROUND_SCAN_PARAM));
  937. WLAN_OS_REPORT((" %03d - ENABLE_PERIODIC_UNICAST_BACKGROUND_SCAN_PARAM \n", ENABLE_PERIODIC_UNICAST_BACKGROUND_SCAN_PARAM));
  938. WLAN_OS_REPORT((" %03d - DISABLE_PERIODIC_UNICAST_BACKGROUND_SCAN_PARAM \n", DISABLE_PERIODIC_UNICAST_BACKGROUND_SCAN_PARAM));
  939. WLAN_OS_REPORT((" %03d - SET_FOREGROUND_SCAN_PARAM \n", SET_FOREGROUND_SCAN_PARAM));
  940. WLAN_OS_REPORT((" %03d - ENABLE_PERIODIC_FOREGROUND_SCAN_PARAM \n", ENABLE_PERIODIC_FOREGROUND_SCAN_PARAM));
  941. WLAN_OS_REPORT((" %03d - DISABLE_PERIODIC_FOREGROUND_SCAN_PARAM \n", DISABLE_PERIODIC_FOREGROUND_SCAN_PARAM));
  942. WLAN_OS_REPORT((" %03d - SET_CHANNEL_NUMBER \n", SET_CHANNEL_NUMBER));
  943. WLAN_OS_REPORT((" %03d - SET_RSSI_GAP_THRSH \n", SET_RSSI_GAP_THRSH));
  944. WLAN_OS_REPORT((" %03d - SET_FAST_SCAN_TIMEOUT \n", SET_FAST_SCAN_TIMEOUT));
  945. WLAN_OS_REPORT((" %03d - SET_INTERNAL_ROAMING_ENABLE \n", SET_INTERNAL_ROAMING_ENABLE));
  946. WLAN_OS_REPORT((" %03d - PERFORM_HEALTH_TEST \n", PERFORM_HEALTH_TEST));
  947. WLAN_OS_REPORT((" %03d - PRINT_FAILURE_EVENTS \n", PRINT_FAILURE_EVENTS));
  948. WLAN_OS_REPORT((" %03d - FORCE_HW_RESET_RECOVERY \n", FORCE_HW_RESET_RECOVERY));
  949. WLAN_OS_REPORT((" %03d - FORCE_SOFT_RECOVERY \n", FORCE_SOFT_RECOVERY));
  950. WLAN_OS_REPORT((" %03d - RESET_ROAMING_EVENTS \n", RESET_ROAMING_EVENTS));
  951. WLAN_OS_REPORT((" %03d - SET_DESIRED_CONS_TX_ERRORS_THREH\n", SET_DESIRED_CONS_TX_ERRORS_THREH));
  952. WLAN_OS_REPORT((" %03d - GET_CURRENT_ROAMING_STATUS \n", GET_CURRENT_ROAMING_STATUS));
  953. WLAN_OS_REPORT((" %03d - TOGGLE_LNA_ON \n", TEST_TOGGLE_LNA_ON));
  954. WLAN_OS_REPORT((" %03d - TOGGLE_LNA_OFF \n", TEST_TOGGLE_LNA_OFF));
  955. WLAN_OS_REPORT((" %03d - PRINT_SITE_TABLE_PER_SSID\n", PRINT_SITE_TABLE_PER_SSID));
  956. WLAN_OS_REPORT((" %03d - SET_DESIRED_CHANNEL\n", SET_DESIRED_CHANNEL));
  957. WLAN_OS_REPORT((" %03d - START_PRE_AUTH\n", START_PRE_AUTH));
  958. WLAN_OS_REPORT(("\n------------------------\n"));
  959. }