1 /*
2 * ticon.c
3 *
4 * Copyright 2001-2009 Texas Instruments, Inc. - http://www.ti.com/
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19 /****************************************************************************
20 *
21 * MODULE: ticon.c
22 *
23 * PURPOSE:
24 *
25 * DESCRIPTION:
26 * ============
27 *
28 *
29 ****************************************************************************/
30
31 /* includes */
32 /************/
33 #include "cu_osapi.h"
34 #include "oserr.h"
35
36 #include "TWDriver.h"
37 #include "STADExternalIf.h"
38
39 #include "console.h"
40 #include "cu_cmd.h"
41 #include "wpa_core.h"
42 #ifdef XCC_MODULE_INCLUDED
43 #include "cu_XCC.h"
44 #endif
45
46 /* defines */
47 /***********/
48 #ifdef DEBUG
49 #define CHK_NULL(p) ((p)) ? (VOID) 0 : os_error_printf(CU_MSG_ERROR, (PS8)"\nfailed: '%s', file %s, line %d\n", #p, __FILE__, __LINE__);
50 #define CHK(p) ((!p)) ? (VOID) 0 : os_error_printf(CU_MSG_ERROR, (PS8)"\nfailed: '%s', file %s, line %d\n", #p, __FILE__, __LINE__);
51 #else
52 #define CHK(p) (p)
53 #define CHK_NULL(p) (p)
54 #endif
55
56 #define TIWLAN_DRV_NAME "tiwlan0"
57 #ifdef ANDROID
58 #define SUPPL_IF_FILE "/data/misc/wifi/sockets/" TIWLAN_DRV_NAME
59 #else
60 #define SUPPL_IF_FILE "/var/run/" TIWLAN_DRV_NAME
61 #endif
62 extern int consoleRunScript( char *script_file, THandle hConsole);
63
64 /* local types */
65 /***************/
66 /* Module control block */
67 typedef struct TiCon_t
68 {
69 THandle hConsole;
70 S8 drv_name[IF_NAME_SIZE];
71 } TiCon_t;
72
73 /* local variables */
74 /*******************/
75 static TiCon_t g_TiCon;
76
77 /* local fucntions */
78 /*******************/
TiCon_Init_Console_Menu(TiCon_t * pTiCon)79 static S32 TiCon_Init_Console_Menu(TiCon_t* pTiCon)
80 {
81 THandle h, h1;
82 THandle h2;
83
84
85
86 /* -------------------------------------------- Driver -------------------------------------------- */
87
88 CHK_NULL(h = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) NULL, (PS8)"Driver", (PS8)"Driver start/stop" ) );
89 Console_AddToken(pTiCon->hConsole,h, (PS8)"Start", (PS8)"Start driver", (FuncToken_t) CuCmd_StartDriver, NULL );
90 Console_AddToken(pTiCon->hConsole,h, (PS8)"sTop", (PS8)"Stop driver", (FuncToken_t) CuCmd_StopDriver, NULL );
91 Console_AddToken(pTiCon->hConsole,h, (PS8)"stAtus", (PS8)"Print status", (FuncToken_t) CuCmd_Show_Status, NULL );
92
93 /* -------------------------------------------- Connection -------------------------------------------- */
94
95 CHK_NULL(h = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) NULL, (PS8)"Connection", (PS8)"Connection management" ) );
96 Console_AddToken(pTiCon->hConsole,h, (PS8)"Bssid_list", (PS8)"Bssid_list", (FuncToken_t) CuCmd_BssidList, NULL );
97 {
98 ConParm_t aaa[] = { {(PS8)"ssid", CON_PARM_STRING | CON_PARM_OPTIONAL, 0, 32, 0 },
99 {(PS8)"bssid", CON_PARM_STRING | CON_PARM_OPTIONAL, 0, 32, 0 },
100 CON_LAST_PARM };
101
102 Console_AddToken(pTiCon->hConsole,h, (PS8)"Connect", (PS8)"Connect", (FuncToken_t) CuCmd_Connect, aaa );
103 }
104 Console_AddToken(pTiCon->hConsole,h, (PS8)"Disassociate", (PS8)"disconnect", (FuncToken_t) CuCmd_Disassociate, NULL );
105 Console_AddToken(pTiCon->hConsole,h, (PS8)"Status", (PS8)"Print connection status", (FuncToken_t) CuCmd_Show_Status, NULL );
106 #ifdef TI_DBG
107 Console_AddToken(pTiCon->hConsole,h, (PS8)"Full_bssid_list", (PS8)"Full_bssid_list", (FuncToken_t) CuCmd_FullBssidList, NULL );
108 #endif
109
110 #ifdef CONFIG_EAP_WSC
111 CHK_NULL(h1 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) h, (PS8)"wPs", (PS8)"WiFi Protected Setup" ) );
112 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Pin", (PS8)"Acquire profile using PIN", (FuncToken_t) CuCmd_StartEnrolleePIN, NULL );
113 Console_AddToken(pTiCon->hConsole,h1, (PS8)"pBc", (PS8)"Acquire profile using Push Button", (FuncToken_t) CuCmd_StartEnrolleePBC, NULL );
114 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Stop", (PS8)"Stop WiFi Protected Setup", (FuncToken_t) CuCmd_StopEnrollee, NULL );
115 {
116 ConParm_t aaa[] =
117 {
118 {(PS8)"PIN", CON_PARM_STRING, 0, 8, 0 },
119 CON_LAST_PARM
120 };
121 Console_AddToken(pTiCon->hConsole,h1, (PS8)"set pIn", (PS8)"Set PIN code", (FuncToken_t) CuCmd_SetPin, aaa );
122 }
123 #endif /* CONFIG_EAP_WSC */
124
125 /* -------------------------------------------- Management -------------------------------------------- */
126
127 CHK_NULL(h = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) NULL, (PS8)"Management", (PS8)"Station management" ) );
128 {
129 ConParm_t aaa[] = { {(PS8)"connectMode", CON_PARM_OPTIONAL, 0, 0, 0 }, CON_LAST_PARM };
130 Console_AddToken(pTiCon->hConsole,h, (PS8)"connect moDe", (PS8)"Set Connect Mode", (FuncToken_t) CuCmd_ModifyConnectMode, aaa );
131 }
132 {
133 ConParm_t aaa[] = { {(PS8)"channel", CON_PARM_OPTIONAL, 0, 0, 0 }, CON_LAST_PARM };
134 Console_AddToken(pTiCon->hConsole,h, (PS8)"Channel", (PS8)"Set the channel", (FuncToken_t) CuCmd_ModifyChannel, aaa );
135 }
136 {
137 ConParm_t aaa[] = { {(PS8)"tx rate", CON_PARM_STRING | CON_PARM_OPTIONAL, 0, 32, 0 }, CON_LAST_PARM };
138 Console_AddToken(pTiCon->hConsole,h, (PS8)"Rate", (PS8)"Get TX data rate in Mbps (1,2,5.5,11...)", (FuncToken_t) CuCmd_GetTxRate, aaa );
139 }
140 {
141 ConParm_t aaa[] = { {(PS8)"BSS_type", CON_PARM_OPTIONAL, 0, 0, 0 }, CON_LAST_PARM };
142 Console_AddToken(pTiCon->hConsole,h, (PS8)"Mode", (PS8)"BSS_type", (FuncToken_t) CuCmd_ModifyBssType, aaa );
143 }
144 {
145 ConParm_t aaa[] = { {(PS8)"frag", CON_PARM_OPTIONAL, 0, 0, 0 }, CON_LAST_PARM };
146 Console_AddToken(pTiCon->hConsole,h, (PS8)"Frag", (PS8)"Set the fragmentation threshold <256..2346>", (FuncToken_t) CuCmd_ModifyFragTh, aaa );
147 }
148 {
149 ConParm_t aaa[] = { {(PS8)"rts", CON_PARM_OPTIONAL, 0, 0, 0 }, CON_LAST_PARM };
150 Console_AddToken(pTiCon->hConsole,h, (PS8)"rts", (PS8)"Set RTS threshold <0..2347>", (FuncToken_t) CuCmd_ModifyRtsTh, aaa);
151 }
152 {
153 ConParm_t aaa[] = { {(PS8)"preamble", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 1, 0 }, CON_LAST_PARM };
154 Console_AddToken(pTiCon->hConsole,h, (PS8)"prEamble", (PS8)"Set preamble type 1=short 0=long", (FuncToken_t) CuCmd_ModifyPreamble, aaa );
155 }
156 {
157 ConParm_t aaa[] = { {(PS8)"slot", CON_PARM_OPTIONAL, 0, 0, 0 }, CON_LAST_PARM };
158 Console_AddToken(pTiCon->hConsole,h, (PS8)"sLot", (PS8)"Set short slot", (FuncToken_t) CuCmd_ModifyShortSlot, aaa );
159 }
160 {
161 ConParm_t aaa[] = { {(PS8)"radio on//off", CON_PARM_OPTIONAL, 0, 1, 0 }, CON_LAST_PARM };
162 Console_AddToken(pTiCon->hConsole,h, (PS8)"rAdio on/off", (PS8)"Turn radio on/off. 0=OFF, 1=ON", (FuncToken_t) CuCmd_RadioOnOff, aaa );
163 }
164 Console_AddToken(pTiCon->hConsole,h, (PS8)"Info", (PS8)"Get Selected BSSID Info", (FuncToken_t) CuCmd_GetSelectedBssidInfo, NULL );
165 Console_AddToken(pTiCon->hConsole,h, (PS8)"siGnal", (PS8)"Get Current RSSI level", (FuncToken_t) CuCmd_GetRsiiLevel, NULL );
166 Console_AddToken(pTiCon->hConsole,h, (PS8)"snr ratiO", (PS8)"Get Current SNR radio", (FuncToken_t) CuCmd_GetSnrRatio, NULL );
167
168
169 {
170 ConParm_t aaa[] = { {(PS8)"Tx power level", CON_PARM_OPTIONAL, 0, 0, 0 }, CON_LAST_PARM };
171 Console_AddToken(pTiCon->hConsole,h, (PS8)"tX_power_table", (PS8)"show Tx power table", (FuncToken_t) CuCmd_ShowTxPowerTable, aaa );
172 Console_AddToken(pTiCon->hConsole,h, (PS8)"tx_power_dBm_div10", (PS8)"Tx power level", (FuncToken_t) CuCmd_TxPowerDbm, aaa );
173 Console_AddToken(pTiCon->hConsole,h, (PS8)"tx_poWer_level", (PS8)"Tx power level", (FuncToken_t) CuCmd_ShowTxPowerLevel, aaa );
174 }
175 CHK_NULL(h1 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) h, (PS8)"802_11d_h", (PS8)"802_11D_H" ) );
176 {
177 ConParm_t aaa[] = { {(PS8)"802_11_D", CON_PARM_OPTIONAL, 0, 0, 0 }, CON_LAST_PARM };
178 ConParm_t bbb[] = {
179 {(PS8)"min DFS channel", CON_PARM_RANGE, 36, 180, 40 },
180 {(PS8)"max DFS channel", CON_PARM_RANGE, 36, 180, 140 },
181 CON_LAST_PARM};
182
183 Console_AddToken(pTiCon->hConsole,h1, (PS8)"D_enableDisable", (PS8)"enableDisable_d", (FuncToken_t) CuCmd_ModifyState_802_11d, aaa );
184 Console_AddToken(pTiCon->hConsole,h1, (PS8)"H_enableDisable", (PS8)"enableDisable_h", (FuncToken_t) CuCmd_ModifyState_802_11h, aaa );
185 Console_AddToken(pTiCon->hConsole,h1, (PS8)"d_Country_2_4Ie", (PS8)"d_Country_2_4Ie", (FuncToken_t) CuCmd_D_Country_2_4Ie, aaa );
186 Console_AddToken(pTiCon->hConsole,h1, (PS8)"d_cOuntry_5Ie", (PS8)"d_Country_5Ie", (FuncToken_t) CuCmd_D_Country_5Ie, aaa );
187
188 Console_AddToken(pTiCon->hConsole,h1, (PS8)"dfS_range", (PS8)"DFS_range", (FuncToken_t) CuCmd_ModifyDfsRange, bbb );
189
190 }
191 CHK_NULL(h1 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) h, (PS8)"beacoN", (PS8)"Set Beacon Filter Desired State" ) );
192 {
193 ConParm_t beaconFilterDesiredState[] = { {(PS8)"Set Beacon Desired State", CON_PARM_OPTIONAL, 0, 0, 0 },
194 CON_LAST_PARM };
195 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Set Beacon Filter Desired State", (PS8)"Set Beacon Filter Current State", (FuncToken_t) CuCmd_SetBeaconFilterDesiredState, beaconFilterDesiredState );
196 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Get Beacon Filter Current State", (PS8)"Get Beacon Filter Current State", (FuncToken_t) CuCmd_GetBeaconFilterDesiredState, NULL );
197 }
198
199 CHK_NULL(h1 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) h, (PS8)"adVanced", (PS8)"Advanced params" ) );
200 {
201 ConParm_t aaa[] = { { (PS8)"rates", CON_PARM_OPTIONAL | CON_PARM_LINE, 0, 120, 0 }, CON_LAST_PARM };
202 Console_AddToken(pTiCon->hConsole, h1, (PS8)"Supported rates", (PS8)"rates", (FuncToken_t) CuCmd_ModifySupportedRates, aaa );
203 }
204 Console_AddToken(pTiCon->hConsole, h1, (PS8)"Health-check", (PS8)"Send health-check to device", (FuncToken_t) CuCmd_SendHealthCheck, NULL );
205 CHK_NULL(h2 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) h1, (PS8)"rx data Filter", (PS8)"Rx Data Filter" ) );
206 Console_AddToken(pTiCon->hConsole, h2, (PS8)"Enable", (PS8)"Enable Rx Data Filtering", (FuncToken_t) CuCmd_EnableRxDataFilters, NULL );
207 Console_AddToken(pTiCon->hConsole, h2, (PS8)"Disable", (PS8)"Enable Rx Data Filtering", (FuncToken_t) CuCmd_DisableRxDataFilters, NULL );
208 {
209 ConParm_t aaa[] =
210 {
211 {(PS8)"Offset", CON_PARM_RANGE, 0, 255, 0 },
212 {(PS8)"Mask", CON_PARM_STRING, 0, 64, 0 },
213 {(PS8)"Pattern", CON_PARM_STRING, 0, 128, 0 },
214 CON_LAST_PARM
215 };
216 Console_AddToken(pTiCon->hConsole, h2, (PS8)"Add", (PS8)"Add Rx Data Filter", (FuncToken_t) CuCmd_AddRxDataFilter, aaa );
217 }
218 {
219 ConParm_t aaa[] =
220 {
221 {(PS8)"Offset", CON_PARM_RANGE, 0, 255, 0 },
222 {(PS8)"Mask", CON_PARM_STRING, 0, 64, 0 },
223 {(PS8)"Pattern", CON_PARM_STRING, 0, 128, 0 },
224 CON_LAST_PARM
225 };
226 Console_AddToken(pTiCon->hConsole, h2, (PS8)"Remove", (PS8)"Remove Rx Data Filter", (FuncToken_t) CuCmd_RemoveRxDataFilter, aaa );
227 }
228 Console_AddToken(pTiCon->hConsole, h2, (PS8)"Statistics", (PS8)"Print Rx Data Filtering Statistics", (FuncToken_t) CuCmd_GetRxDataFiltersStatistics, NULL );
229 CHK_NULL(h2 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) h1, (PS8)"Keep alive", (PS8)"Keep Alive templates" ) );
230 Console_AddToken(pTiCon->hConsole, h2, (PS8)"Enable", (PS8)"Set global keep-alive flag to enable", (FuncToken_t)CuCmd_EnableKeepAlive, NULL );
231 Console_AddToken(pTiCon->hConsole, h2, (PS8)"Disable", (PS8)"Set global keep-alive flag to disable", (FuncToken_t)CuCmd_DisableKeepAlive, NULL );
232 {
233 ConParm_t aaa[] =
234 {
235 {(PS8)"Index", CON_PARM_RANGE, 0, 1, 0 },
236 {(PS8)"Interval (msec)", CON_PARM_RANGE, 0, 1000000, 60000 },
237 {(PS8)"Trigger type (0-idle 1-always)", CON_PARM_RANGE, 0, 1, 0 },
238 {(PS8)"Pattern (hex data)", CON_PARM_STRING, 0, KEEP_ALIVE_TEMPLATE_MAX_LENGTH * 2, 0 },
239 CON_LAST_PARM
240 };
241 Console_AddToken(pTiCon->hConsole, h2, (PS8)"Add", (PS8)"Add a new keep-alive template", (FuncToken_t)CuCmd_AddKeepAliveMessage, aaa );
242 }
243 {
244 ConParm_t aaa[] =
245 {
246 {(PS8)"Index", CON_PARM_RANGE, 0, 1, 0 },
247 CON_LAST_PARM
248 };
249 Console_AddToken(pTiCon->hConsole, h2, (PS8)"Remove", (PS8)"Remove a keep-alive template", (FuncToken_t)CuCmd_RemoveKeepAliveMessage, aaa );
250 }
251 Console_AddToken(pTiCon->hConsole, h2, (PS8)"Show", (PS8)"Show all configured keep-alive templates", (FuncToken_t)CuCmd_ShowKeepAlive, NULL );
252
253 /* -------------------------------------------- Show -------------------------------------------- */
254 CHK_NULL(h = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) NULL, (PS8)"Show", (PS8)"Show params" ) );
255 Console_AddToken(pTiCon->hConsole, h, (PS8)"Statistics", (PS8)"Show statistics", (FuncToken_t) CuCmd_ShowStatistics, NULL );
256 {
257 ConParm_t aaa[] = { {(PS8)"Clear stats on read", CON_PARM_OPTIONAL | CON_PARM_RANGE, 0, 1, 0 }, CON_LAST_PARM };
258 Console_AddToken(pTiCon->hConsole,h, (PS8)"Txstatistics", (PS8)"Show tx statistics", (FuncToken_t) CuCmd_ShowTxStatistics, aaa );
259 }
260 Console_AddToken(pTiCon->hConsole,h, (PS8)"Advanced", (PS8)"Show advanced params", (FuncToken_t) CuCmd_ShowAdvancedParams, NULL );
261
262 Console_AddToken(pTiCon->hConsole,h, (PS8)"Power consumption", (PS8)"Show power consumption statistics", (FuncToken_t) Cucmd_ShowPowerConsumptionStats, NULL );
263
264 /* -------------------------------------------- Privacy -------------------------------------------- */
265
266 CHK_NULL(h = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) NULL, (PS8)"Privacy", (PS8)"Privacy configuration" ) );
267 {
268 ConParm_t aaa[] = { {(PS8)"mode", CON_PARM_OPTIONAL, 0, 0, 0 },CON_LAST_PARM };
269 Console_AddToken(pTiCon->hConsole,h, (PS8)"Authentication", (PS8)"Set authentication mode",
270 (FuncToken_t)CuCmd_SetPrivacyAuth, aaa );
271 }
272 #ifdef WPA_ENTERPRISE
273 {
274 ConParm_t aaa[] = { {(PS8)"type", CON_PARM_OPTIONAL, 0, 0, 0 }, CON_LAST_PARM };
275 Console_AddToken(pTiCon->hConsole,h, (PS8)"Eap", (PS8)"Set EAP type", (FuncToken_t)CuCmd_SetPrivacyEap, aaa );
276 }
277 #endif
278 {
279 ConParm_t aaa[] = { {(PS8)"type", CON_PARM_OPTIONAL, 0, 0, 0 }, CON_LAST_PARM };
280 Console_AddToken(pTiCon->hConsole,h, (PS8)"encRyption", (PS8)"Set encryption type", (FuncToken_t)CuCmd_SetPrivacyEncryption, aaa);
281 }
282 #ifdef WPA_ENTERPRISE
283 {
284 ConParm_t aaa[] = { {(PS8)"type", 0, 0, 0, 0 }, CON_LAST_PARM };
285 Console_AddToken(pTiCon->hConsole,h, (PS8)"Keytype", (PS8)"Set key type", (FuncToken_t) CuCmd_SetPrivacyKeyType, aaa );
286 }
287
288 {
289 ConParm_t aaa[] = { {(PS8)"mode", CON_PARM_OPTIONAL, 0, 0, 0 }, CON_LAST_PARM };
290 Console_AddToken(pTiCon->hConsole,h, (PS8)"Mixedmode", (PS8)"Set mixed mode", (FuncToken_t) CuCmd_SetPrivacyMixedMode, aaa );
291 }
292
293 {
294 ConParm_t aaa[] = { {(PS8)"mode", CON_PARM_OPTIONAL, 0, 0, 0 }, CON_LAST_PARM };
295 Console_AddToken(pTiCon->hConsole,h, (PS8)"aNywpamode", (PS8)"Set Any WPA mode", (FuncToken_t) CuCmd_SetPrivacyAnyWpaMode, aaa );
296 }
297
298 {
299 ConParm_t aaa[] = {
300 {(PS8)"User:", CON_PARM_STRING, 0, WPACORE_MAX_CERT_USER_NAME_LENGTH, 0 },
301 {(PS8)"Password:", CON_PARM_STRING | CON_PARM_OPTIONAL, 0, WPACORE_MAX_CERT_PASSWORD_LENGTH , 0 },
302 CON_LAST_PARM };
303 Console_AddToken(pTiCon->hConsole,h, (PS8)"Credentials", (PS8)"Set Credentials ", (FuncToken_t)CuCmd_SetPrivacyCredentials, aaa);
304 }
305 #endif
306 {
307 ConParm_t aaa[] =
308 {
309 {(PS8)"Passphrase", CON_PARM_STRING, WPACORE_MIN_PSK_STRING_LENGTH, WPACORE_MAX_PSK_STRING_LENGTH, 0},
310 {(PS8)"key type (hex | text) [text]", CON_PARM_OPTIONAL | CON_PARM_STRING, 0, 5, 0},
311 CON_LAST_PARM
312 };
313 Console_AddToken(pTiCon->hConsole,h, (PS8)"pskPassphrase", (PS8)"Set PSK Passphrase", (FuncToken_t)CuCmd_SetPrivacyPskPassPhrase, aaa );
314 }
315
316 #ifdef WPA_ENTERPRISE
317 {
318 ConParm_t aaa[] = { {(PS8)"Certificate Name:", CON_PARM_STRING, 0, WPACORE_MAX_CERT_FILE_NAME_LENGTH, 0 },
319 {(PS8)"Validate (yes - 1 /no - 0):", CON_PARM_OPTIONAL, 0, 0, 0 }, CON_LAST_PARM };
320 Console_AddToken(pTiCon->hConsole,h, (PS8)"cerTificate", (PS8)"Set Certificate",(FuncToken_t)CuCmd_SetPrivacyCertificate, aaa);
321
322 }
323 #endif
324 #ifdef WPA_SUPPLICANT
325 CHK_NULL(h1 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) h, (PS8)"Supplicant", (PS8)"Supplicant" ) );
326 {
327 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Kill", (PS8)"Kill", (FuncToken_t) CuCmd_StopSuppl, NULL );
328
329 ConParm_t aaa[] =
330 {
331 {(PS8)"Level", CON_PARM_RANGE, 0, 4, 0 },
332 {(PS8)"Show keys", CON_PARM_RANGE, 0, 1, 0 },
333 {(PS8)"Show timestamps (yes - 1 /no - 0)", CON_PARM_RANGE, 0, 1, 0 },
334 CON_LAST_PARM};
335 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Debug", (PS8)"Set debug", (FuncToken_t)CuCmd_ChangeSupplDebugLevels, aaa );
336 }
337 #endif
338
339 CHK_NULL(h1 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) h, (PS8)"Wep", (PS8)"Wep" ) );
340 {
341 ConParm_t aaa[] =
342 {
343 {(PS8)"Key Value", CON_PARM_STRING, 0, 64, 0},
344 {(PS8)"Tx Key Index", 0, 0, 0, 0 },
345 {(PS8)"Default Key (yes - 1 /no - 0)", 0, 0, 0, 0 },
346 {(PS8)"key type (hex | text) [hex]", CON_PARM_OPTIONAL | CON_PARM_STRING, 0, 5, 0},
347 CON_LAST_PARM
348 };
349 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Add", (PS8)"Add WEP", (FuncToken_t)CuCmd_AddPrivacyKey, aaa );
350 }
351 {
352 ConParm_t aaa[] = { {(PS8)"Key Index", 0, 0, 0, 0 }, CON_LAST_PARM };
353 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Remove", (PS8)"Remove WEP", (FuncToken_t)CuCmd_RemovePrivacyKey, aaa);
354 }
355 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Get Default Key ID", (PS8)"Get Default Key ID", (FuncToken_t)CuCmd_GetPrivacyDefaultKey, NULL);
356
357
358 #ifdef XCC_MODULE_INCLUDED
359 CuXCC_AddXCCMenu(pTiCon, h);
360 #endif/*XCC_MODULE_INCLUDED*/
361
362 /* -------------------------------------------- Scan -------------------------------------------- */
363
364 CHK_NULL(h = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) NULL, (PS8)"scAn", (PS8)"Scan Service Configuration" ) );
365 Console_AddToken(pTiCon->hConsole, h, (PS8)"Start", (PS8)"Start One-Shot Application Scan", (FuncToken_t) CuCmd_StartScan, NULL );
366 Console_AddToken(pTiCon->hConsole, h, (PS8)"sTop", (PS8)"Stop One-Shot Application Scan", (FuncToken_t) CuCmd_StopScan, NULL );
367 #ifndef NO_WPA_SUPPL
368 {
369 ConParm_t aaa[] = { {(PS8)"ssid", CON_PARM_STRING | CON_PARM_OPTIONAL, 0, 32, 0 },
370 CON_LAST_PARM };
371
372 Console_AddToken(pTiCon->hConsole,h, (PS8)"Wextstart", (PS8)"WEXT Start One-Shot Application Scan", (FuncToken_t) CuCmd_WextStartScan, aaa );
373 }
374 #endif
375
376 CHK_NULL(h1 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) h, (PS8)"configApp", (PS8)"Configure One-Shot Application Scan Params" ) );
377 {
378 ConParm_t aaa[] = {
379 {(PS8)"SSID", CON_PARM_STRING, 0, 33, 0 },
380 #ifdef TI_DBG /* limitn application scan to normal only in release version */
381 {(PS8)"Scan Type", CON_PARM_RANGE, SCAN_TYPE_NORMAL_PASSIVE, SCAN_TYPE_TRIGGERED_ACTIVE, 0 },
382 #else
383 {(PS8)"Scan Type", CON_PARM_RANGE, SCAN_TYPE_NORMAL_PASSIVE, SCAN_TYPE_NORMAL_ACTIVE, 0 },
384 #endif
385 {(PS8)"Band", CON_PARM_RANGE, 0, 1, 0 },
386 {(PS8)"Probe Request Number", CON_PARM_RANGE, 0, 255, 0 },
387 {(PS8)"Probe Request Rate", CON_PARM_RANGE, 0, DRV_RATE_MASK_54_OFDM, 0 },
388
389 #ifdef TI_DBG
390 {(PS8)"Tid", CON_PARM_RANGE, 0, 255, 0 },
391 #endif
392 {(PS8)"Number of Channels", CON_PARM_RANGE, 0, 16, 0 },
393 CON_LAST_PARM };
394 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Global", (PS8)"Config Global Params", (FuncToken_t) CuCmd_ScanAppGlobalConfig, aaa );
395 }
396 {
397 ConParm_t aaa[] = {
398 {(PS8)"Index", CON_PARM_RANGE, 0, 30, 0 },
399 {(PS8)"BSSID (xx:xx:xx:xx:xx:xx)", CON_PARM_STRING, 0, 18, 0 },
400 {(PS8)"Max Dwell Time", CON_PARM_RANGE, 0, 100000000, 0 },
401 {(PS8)"Min Dwell Time", CON_PARM_RANGE, 0, 100000000, 0 },
402 {(PS8)"ET Condition", CON_PARM_RANGE, SCAN_ET_COND_DISABLE, SCAN_ET_COND_ANY_FRAME, 0 },
403 {(PS8)"ET Frame Number", CON_PARM_RANGE, 0, 255, 0 },
404 {(PS8)"TX power level", CON_PARM_RANGE, 0, MAX_TX_POWER, 0 },
405 {(PS8)"Channel Number", CON_PARM_RANGE, 0, 255, 0 },
406 CON_LAST_PARM };
407 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Channel", (PS8)"Config Channel Params", (FuncToken_t) CuCmd_ScanAppChannelConfig, aaa );
408 }
409 Console_AddToken(pTiCon->hConsole,h1, (PS8)"cLear", (PS8)"Clear All Params", (FuncToken_t) CuCmd_ScanAppClear, NULL );
410 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Display", (PS8)"Display Params", (FuncToken_t) CuCmd_ScanAppDisplay, NULL );
411
412 CHK_NULL(h1 = (THandle) Console_AddDirExt (pTiCon->hConsole, (THandle)h, (PS8)"configpEriodic", (PS8)"Configure Periodic Application Scan" ) );
413 {
414 ConParm_t aaa[] = {
415 {(PS8)"RSSI Threshold", CON_PARM_RANGE | CON_PARM_SIGN, -100, 0, -97 },
416 {(PS8)"SNR threshold", CON_PARM_RANGE | CON_PARM_SIGN, -10, 100, 0 },
417 {(PS8)"Report threshold", CON_PARM_RANGE, 1, 8, 1 },
418 {(PS8)"Terminate on report", CON_PARM_RANGE, 0, 1, 1 },
419 {(PS8)"BSS Type (0-independent, 1-infrastructure, 2-any)", CON_PARM_RANGE, 0, 2, 2 },
420 {(PS8)"Probe request number", CON_PARM_RANGE, 0, 5, 3 },
421 {(PS8)"Number of scan cycles", CON_PARM_RANGE, 0, 100, 0 },
422 {(PS8)"Number of SSIDs", CON_PARM_RANGE, 0, 8, 0 },
423 {(PS8)"SSID List Filter Enabled", CON_PARM_RANGE, 0, 1, 1 },
424 {(PS8)"Number of channels", CON_PARM_RANGE, 0, 32, 14 },
425 CON_LAST_PARM };
426 Console_AddToken (pTiCon->hConsole, h1, (PS8)"Global", (PS8)"Configure global periodic scan parameters", CuCmd_ConfigPeriodicScanGlobal, aaa);
427 }
428 {
429 ConParm_t aaa[] = {
430 {(PS8)"Index", CON_PARM_RANGE, 0, PERIODIC_SCAN_MAX_INTERVAL_NUM - 1, 0 },
431 {(PS8)"Interval (in millisec)", CON_PARM_RANGE, 0, 3600000, 1000 },
432 CON_LAST_PARM };
433 Console_AddToken (pTiCon->hConsole, h1, (PS8)"Interval", (PS8)"Configure interval table", CuCmd_ConfigPeriodicScanInterval, aaa);
434 }
435 {
436 ConParm_t aaa[] = {
437 {(PS8)"Index", CON_PARM_RANGE, 0, 7, 0 },
438 {(PS8)"Visability (0-public, 1-hidden)", CON_PARM_RANGE, 0, 1, 0 },
439 {(PS8)"SSID", CON_PARM_STRING, 0, 33, 0},
440 CON_LAST_PARM };
441 Console_AddToken (pTiCon->hConsole, h1, (PS8)"SSID", (PS8)"Configure SSID list", CuCmd_ConfigurePeriodicScanSsid, aaa);
442 }
443 {
444 ConParm_t aaa[] = {
445 {(PS8)"Index", CON_PARM_RANGE, 0, 32, 0 },
446 {(PS8)"Band (0-2.4GHz, 1-5GHz)", CON_PARM_RANGE, 0, 1, 0 },
447 {(PS8)"Channel", CON_PARM_RANGE, 0, 180, 0 },
448 {(PS8)"Scan Type (0-passive, 1-active)", CON_PARM_RANGE, 0, 1, 0 },
449 {(PS8)"Min dwell time (in millisec)", CON_PARM_RANGE, 1, 1000, 15 },
450 {(PS8)"Max dwell time (in millisec)", CON_PARM_RANGE, 1, 1000, 100 },
451 {(PS8)"TX power level (dBm*10)", CON_PARM_RANGE, 0, MAX_TX_POWER, 0 },
452 CON_LAST_PARM };
453 Console_AddToken (pTiCon->hConsole, h1, (PS8)"Channel", (PS8)"Configure channel list", CuCmd_ConfigurePeriodicScanChannel, aaa);
454 }
455 Console_AddToken (pTiCon->hConsole, h1, (PS8)"cLear", (PS8)"Clear configuration", CuCmd_ClearPeriodicScanConfiguration, NULL);
456 Console_AddToken (pTiCon->hConsole, h1, (PS8)"Display", (PS8)"Display current configuration", CuCmd_DisplayPeriodicScanConfiguration, NULL);
457 Console_AddToken (pTiCon->hConsole, h1, (PS8)"sTart", (PS8)"Start Periodic Scan", CuCmd_StartPeriodicScan, NULL);
458 Console_AddToken (pTiCon->hConsole, h1, (PS8)"stoP", (PS8)"Stop periodic scan", CuCmd_StopPeriodicScan, NULL);
459
460 CHK_NULL(h1 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) h, (PS8)"configPolicy", (PS8)"Configure Scan Manager Scan Policy" ) );
461 {
462 ConParm_t aaa[] = {
463 {(PS8)"Normal scan interval (msec)", CON_PARM_RANGE, 0, 3600000, 5000 },
464 {(PS8)"Deteriorating scan interval", CON_PARM_RANGE, 0, 3600000, 3000 },
465 {(PS8)"Max Track Failures", CON_PARM_RANGE, 0, 20, 3 },
466 {(PS8)"BSS list size", CON_PARM_RANGE, 0, 16, 8 },
467 {(PS8)"BSS Number to start discovery", CON_PARM_RANGE, 0, 16, 4 },
468 {(PS8)"Number of bands", CON_PARM_RANGE, 0, 2, 1 },
469 CON_LAST_PARM };
470 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Gloabal", (PS8)"Set Global policy Params", (FuncToken_t) CuCmd_ConfigScanPolicy, aaa );
471 }
472
473 CHK_NULL(h2 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) h1, (PS8)"Band", (PS8)"Configure band scan policy" ) );
474 {
475 ConParm_t aaa[] = {
476 {(PS8)"Index", CON_PARM_RANGE, 0, 1, 0 },
477 {(PS8)"Band", CON_PARM_RANGE, 0, 1, 0 },
478 {(PS8)"RSSI threshold", CON_PARM_RANGE| CON_PARM_SIGN, -100, 0, 0 },
479 {(PS8)"Channel number for discovery cycle", CON_PARM_RANGE, 0, 30, 5 },
480 {(PS8)"Number of Channels", CON_PARM_RANGE, 0, 30, 0 },
481 CON_LAST_PARM };
482 Console_AddToken(pTiCon->hConsole,h2, (PS8)"Misc", (PS8)"Set misc band params", (FuncToken_t) CuCmd_ConfigScanBand, aaa );
483 }
484 {
485 ConParm_t aaa[] = {
486 {(PS8)"Band Index", CON_PARM_RANGE, 0, 1, 0 },
487 {(PS8)"Channel Index", CON_PARM_RANGE, 0, 29, 0 },
488 {(PS8)"Channel", CON_PARM_RANGE, 0, 160, 0 },
489 CON_LAST_PARM };
490 Console_AddToken(pTiCon->hConsole,h2, (PS8)"Channel", (PS8)"Set Channel params", (FuncToken_t) CuCmd_ConfigScanBandChannel, aaa );
491 }
492 {
493 ConParm_t aaa[] = {
494 {(PS8)"Band Index", CON_PARM_RANGE, 0, 1, 0 },
495 {(PS8)"Scan Type", CON_PARM_RANGE, 0, 5, 0 },
496 {(PS8)"ET event", CON_PARM_RANGE, SCAN_ET_COND_DISABLE, SCAN_ET_COND_ANY_FRAME, SCAN_ET_COND_DISABLE },
497 {(PS8)"ET num of frames", CON_PARM_RANGE, 0, 255,0 },
498 {(PS8)"Triggering AC", CON_PARM_RANGE, 0, 255, 0 },
499 {(PS8)"Scan Duration (SPS)", CON_PARM_RANGE, 0, 100000000, 2000 },
500 {(PS8)"Max dwell time", CON_PARM_RANGE, 0, 100000000, 60000 },
501 {(PS8)"Min dwell time", CON_PARM_RANGE, 0, 100000000, 30000 },
502 {(PS8)"Probe req. number", CON_PARM_RANGE, 0, 255, 2 },
503
504 {(PS8)"Probe req. rate", CON_PARM_RANGE, 0, DRV_RATE_MASK_54_OFDM, 0 },
505
506 {(PS8)"TX power level", CON_PARM_RANGE, 0, MAX_TX_POWER, 0 },
507 CON_LAST_PARM };
508 Console_AddToken(pTiCon->hConsole,h2, (PS8)"Track", (PS8)"Set tracking method params", (FuncToken_t) CuCmd_ConfigScanBandTrack, aaa );
509 }
510 {
511 ConParm_t aaa[] = {
512 {(PS8)"Band Index", CON_PARM_RANGE, 0, 1, 0 },
513 {(PS8)"Scan Type", CON_PARM_RANGE, 0, 5, 0 },
514 {(PS8)"ET event", CON_PARM_RANGE, SCAN_ET_COND_DISABLE, SCAN_ET_COND_ANY_FRAME, SCAN_ET_COND_DISABLE },
515 {(PS8)"ET num of frames", CON_PARM_RANGE, 0, 255,0 },
516 {(PS8)"Triggering AC", CON_PARM_RANGE, 0, 255, 0 },
517 {(PS8)"Scan Duration (SPS)", CON_PARM_RANGE, 0, 100000000, 2000 },
518 {(PS8)"Max dwell time", CON_PARM_RANGE, 0, 100000000, 60000 },
519 {(PS8)"Min dwell time", CON_PARM_RANGE, 0, 100000000, 30000 },
520 {(PS8)"Probe req. number", CON_PARM_RANGE, 0, 255, 2 },
521
522 {(PS8)"Probe req. rate", CON_PARM_RANGE, 0, DRV_RATE_MASK_54_OFDM, 0 },
523
524 {(PS8)"TX power level", CON_PARM_RANGE, 0, MAX_TX_POWER, 0 },
525 CON_LAST_PARM };
526 Console_AddToken(pTiCon->hConsole,h2, (PS8)"Discovery", (PS8)"Set Discovery method params", (FuncToken_t) CuCmd_ConfigScanBandDiscover, aaa );
527 }
528 {
529 ConParm_t aaa[] = {
530 {(PS8)"Band Index", CON_PARM_RANGE, 0, 1, 0 },
531 {(PS8)"Scan Type", CON_PARM_RANGE, 0, 5, 0 },
532 {(PS8)"ET event", CON_PARM_RANGE, SCAN_ET_COND_DISABLE, SCAN_ET_COND_ANY_FRAME, SCAN_ET_COND_DISABLE },
533 {(PS8)"ET num of frames", CON_PARM_RANGE, 0, 255,0 },
534 {(PS8)"Triggering AC", CON_PARM_RANGE, 0, 255, 0 },
535 {(PS8)"Scan Duration (SPS)", CON_PARM_RANGE, 0, 100000000, 2000 },
536 {(PS8)"Max dwell time", CON_PARM_RANGE, 0, 100000000, 60000 },
537 {(PS8)"Min dwell time", CON_PARM_RANGE, 0, 100000000, 30000 },
538 {(PS8)"Probe req. number", CON_PARM_RANGE, 0, 255, 2 },
539
540 {(PS8)"Probe req. rate", CON_PARM_RANGE, 0, DRV_RATE_MASK_54_OFDM, 0 },
541
542 {(PS8)"TX power level", CON_PARM_RANGE, 0, MAX_TX_POWER, 0 },
543 CON_LAST_PARM };
544 Console_AddToken(pTiCon->hConsole,h2, (PS8)"Immediate", (PS8)"Set Immediate method params", (FuncToken_t) CuCmd_ConfigScanBandImmed, aaa );
545 }
546
547
548 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Display", (PS8)"Display Policy Params", (FuncToken_t) CuCmd_DisplayScanPolicy, NULL );
549 Console_AddToken(pTiCon->hConsole,h1, (PS8)"cLear", (PS8)"Clear Polciy Params", (FuncToken_t) CuCmd_ClearScanPolicy, NULL );
550 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Store", (PS8)"Send policy to scan manager", (FuncToken_t) CuCmd_SetScanPolicy, NULL );
551 Console_AddToken(pTiCon->hConsole,h1, (PS8)"bsslisT", (PS8)"Display BSS list", (FuncToken_t) CuCmd_GetScanBssList, NULL );
552
553 /* -------------------------------------------- roaminG -------------------------------------------- */
554
555 /************ ROAMING manager commands - start ********************/
556 CHK_NULL(h = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) NULL, (PS8)"roaminG", (PS8)"Roaming Manager configuration" ) );
557 Console_AddToken(pTiCon->hConsole,h, (PS8)"Enable", (PS8)"Enable Internal Roaming", (FuncToken_t) CuCmd_RoamingEnable, NULL );
558 Console_AddToken(pTiCon->hConsole,h, (PS8)"Disable", (PS8)"Disable Internal Roaming", (FuncToken_t) CuCmd_RoamingDisable, NULL );
559 {
560 ConParm_t aaa[] = {
561 {(PS8)"Low pass filter time", CON_PARM_RANGE, 0, 1440, 30 }, CON_LAST_PARM };
562 Console_AddToken(pTiCon->hConsole,h, (PS8)"Low pass filter", (PS8)"Time in sec ", (FuncToken_t) CuCmd_RoamingLowPassFilter, aaa );
563 }
564 {
565 ConParm_t aaa[] = {
566 {(PS8)"Quality threshold", CON_PARM_RANGE | CON_PARM_SIGN, -150, 0, -70 }, CON_LAST_PARM };
567 Console_AddToken(pTiCon->hConsole,h, (PS8)"Quality threshold", (PS8)"Quality indicator", (FuncToken_t) CuCmd_RoamingQualityIndicator, aaa );
568 }
569
570 Console_AddToken(pTiCon->hConsole,h, (PS8)"Get ", (PS8)"Get Roaming config params ", (FuncToken_t) CuCmd_RoamingGetConfParams, NULL );
571
572 CHK_NULL(h1 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) h, (PS8)"Thresholds", (PS8)"Set Roaming MNGR triggers thresholds" ) );
573 {
574 ConParm_t aaa[] = {
575 {(PS8)"Tx retry", CON_PARM_RANGE, 0, 255, 20 }, CON_LAST_PARM };
576 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Tx retry ", (PS8)"Consecutive number of TX retries", (FuncToken_t) CuCmd_RoamingDataRetryThreshold, aaa );
577 }
578 {
579 ConParm_t aaa[] = {
580 {(PS8)"Bss loss", CON_PARM_RANGE, 1, 255, 4 }, CON_LAST_PARM };
581 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Bss loss ", (PS8)"Number of TBTTs", (FuncToken_t) CuCmd_RoamingNumExpectedTbttForBSSLoss, aaa );
582 }
583 {
584 ConParm_t aaa[] = {
585 {(PS8)"tx Rate threshold", CON_PARM_RANGE, 0, 54, 2 }, CON_LAST_PARM };
586 Console_AddToken(pTiCon->hConsole,h1, (PS8)"tx Rate threshold ", (PS8)"TX rate (fallback) threshold", (FuncToken_t) CuCmd_RoamingTxRateThreshold, aaa );
587 }
588 {
589 ConParm_t aaa[] = {
590 {(PS8)"Low rssi threshold", CON_PARM_RANGE | CON_PARM_SIGN, -150, 0, -80 }, CON_LAST_PARM };
591
592 Console_AddToken(pTiCon->hConsole,h1, (PS8)"low rssi thresHold ", (PS8)"Low RSSI threshold", (FuncToken_t) CuCmd_RoamingLowRssiThreshold, aaa );
593 }
594 {
595 ConParm_t aaa[] = {
596 {(PS8)"low Snr threshold", CON_PARM_RANGE, 0, 255, 10 }, CON_LAST_PARM };
597 Console_AddToken(pTiCon->hConsole,h1, (PS8)"low Snr threshold ", (PS8)"Low SNR threshold", (FuncToken_t) CuCmd_RoamingLowSnrThreshold, aaa );
598 }
599 {
600 ConParm_t aaa[] = {
601 {(PS8)"low Quality for scan", CON_PARM_RANGE | CON_PARM_SIGN, -150, -40, -85 }, CON_LAST_PARM };
602 Console_AddToken(pTiCon->hConsole,h1, (PS8)"low Quality for scan ", (PS8)"Increase the background scan", (FuncToken_t) CuCmd_RoamingLowQualityForBackgroungScanCondition, aaa );
603 }
604 {
605 ConParm_t aaa[] = {
606 {(PS8)"Normal quality for scan", CON_PARM_RANGE | CON_PARM_SIGN, -150, -40, -70 }, CON_LAST_PARM };
607 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Normal quality for scan ", (PS8)"Reduce the background scan", (FuncToken_t) CuCmd_RoamingNormalQualityForBackgroungScanCondition, aaa );
608 }
609 {
610 ConParm_t aaa[] = {
611 {(PS8)"Index ", CON_PARM_RANGE, 0, 1, 0 },
612 {(PS8)"Threshold [dB / dBm] ", CON_PARM_RANGE | CON_PARM_SIGN, -100, 100, 0 },
613 {(PS8)"Pacing [Millisecond] ", CON_PARM_RANGE, 0, 60000, 1000 },
614 {(PS8)"Metric [0 - bcon_rssi, 1 - pkt_rssi, 2 - bcon_snr, 3 - pkt_snr] ", CON_PARM_RANGE, 0, 3, 0 },
615 {(PS8)"Type [0 - Level, 1 - Edge] ", CON_PARM_RANGE, 0, 1, 0 },
616 {(PS8)"Direction [0 - Down, 1 - Up, 2 - Both] ", CON_PARM_RANGE, 0, 2, 0 },
617 {(PS8)"Hystersis [dB] ", CON_PARM_RANGE, 0, 255, 0 },
618 {(PS8)"Enable [0 - Disable, 1 - Enable] ", CON_PARM_RANGE, 0, 1, 0 },
619 CON_LAST_PARM };
620 Console_AddToken(pTiCon->hConsole,h1, (PS8)"User defined trigger\n", (PS8)"User defined FW trigger", (FuncToken_t) CuCmd_CurrBssUserDefinedTrigger, aaa );
621 }
622
623 /************ ROAMING manager commands - end ********************/
624
625 /* -------------------------------------------- QOS -------------------------------------------- */
626
627
628 CHK_NULL(h = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) NULL, (PS8)"qOs", (PS8)"Quality of service" ) );
629
630 Console_AddToken(pTiCon->hConsole,h, (PS8)"aP params", (PS8)"Get AP QoS parameters", (FuncToken_t) CuCmd_GetApQosParams, NULL );
631 Console_AddToken(pTiCon->hConsole,h, (PS8)"ap Capabilities", (PS8)"Get AP QoS capabilities parameters", (FuncToken_t) CuCmd_GetApQosCapabilities, NULL );
632 {
633 ConParm_t ACid[] = { {(PS8)"AC", CON_PARM_RANGE, 0, 3, 3 }, CON_LAST_PARM };
634 Console_AddToken(pTiCon->hConsole,h, (PS8)"ac Status", (PS8)"Get Current AC Status", (FuncToken_t) CuCmd_GetAcStatus, ACid );
635 }
636 Console_AddToken(pTiCon->hConsole,h, (PS8)"dEsired ps mode", (PS8)"Get desired PS mode", (FuncToken_t) CuCmd_GetDesiredPsMode, NULL );
637 {
638 ConParm_t aaa[] = {
639 {(PS8)"TID", CON_PARM_RANGE, 0, 7, 0 },
640 {(PS8)"Stream Period (mSec)", CON_PARM_RANGE , 10, 100, 20 },
641 {(PS8)"Tx Timeout (mSec)", CON_PARM_RANGE , 0, 200, 30 },
642 {(PS8)"Enable", CON_PARM_RANGE , 0, 1, 1 },
643 CON_LAST_PARM };
644 Console_AddToken(pTiCon->hConsole,h, (PS8)"set ps rX streaming", (PS8)"Set PS Rx Streaming", (FuncToken_t) CuCmd_SetPsRxDelivery, aaa );
645 }
646 Console_AddToken(pTiCon->hConsole,h, (PS8)"get ps rx streAming", (PS8)"Get PS Rx Streaming parameters", (FuncToken_t) CuCmd_GetPsRxStreamingParams, NULL );
647 {
648 ConParm_t aaa[] = {
649 {(PS8)"acID", CON_PARM_RANGE, 0, 3, 0 },
650 {(PS8)"MaxLifeTime", CON_PARM_RANGE , 0, 1024, 0 },
651 {(PS8)"PS Delivery Protocol (0 - Legacy, 1 - U-APSD)", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 1, 1 },
652 CON_LAST_PARM };
653 Console_AddToken(pTiCon->hConsole,h, (PS8)"Qosparams", (PS8)"Set QOS Parameters", (FuncToken_t) CuCmd_SetQosParams, aaa );
654 }
655 {
656 ConParm_t aaa[] = {
657 {(PS8)"PsPoll", CON_PARM_RANGE, 0, 65000, 0 },
658 {(PS8)"UPSD", CON_PARM_RANGE , 0, 65000, 0 },
659 CON_LAST_PARM };
660 Console_AddToken(pTiCon->hConsole,h, (PS8)"Rx TimeOut", (PS8)"Rx TimeOut", (FuncToken_t) CuCmd_SetRxTimeOut, aaa );
661 }
662 { ConParm_t aaa[] = {
663 {(PS8)"Type", CON_PARM_RANGE, DSCP_CLSFR, CLSFR_TYPE_MAX, 0 },
664 {(PS8)"D-Tag", CON_PARM_RANGE, CLASSIFIER_DTAG_MIN, CLASSIFIER_DTAG_MAX, CLASSIFIER_DTAG_DEF },
665 {(PS8)"Param1", CON_PARM_RANGE, 0, 65535, 0 },
666 {(PS8)"Ip1", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 255, 0 },
667 {(PS8)"Ip2", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 255, 0 },
668 {(PS8)"Ip3", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 255, 0 },
669 {(PS8)"Ip4", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 255, 0 },
670 CON_LAST_PARM };
671 Console_AddToken(pTiCon->hConsole,h, (PS8)"Insert class", (PS8)"Insert new classification entry", (FuncToken_t) CuCmd_InsertClsfrEntry, aaa );
672 }
673 { ConParm_t aaa[] = {
674 {(PS8)"Type", CON_PARM_RANGE, DSCP_CLSFR, CLSFR_TYPE_MAX, 0 },
675 {(PS8)"D-Tag", CON_PARM_RANGE, CLASSIFIER_DTAG_MIN, CLASSIFIER_DTAG_MAX, CLASSIFIER_DTAG_DEF },
676 {(PS8)"Param1", CON_PARM_RANGE, 0, 65535, 0 },
677 {(PS8)"Ip1", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 255, 0 },
678 {(PS8)"Ip2", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 255, 0 },
679 {(PS8)"Ip3", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 255, 0 },
680 {(PS8)"Ip4", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 255, 0 },
681 CON_LAST_PARM };
682 Console_AddToken(pTiCon->hConsole,h, (PS8)"remoVe class", (PS8)"Remove classification entry", (FuncToken_t) CuCmd_RemoveClsfrEntry, aaa );
683 }
684
685 CHK_NULL(h1 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) h, (PS8)"Tspec", (PS8)"TSPEC Sub-menu" ) );
686 { ConParm_t TspecParams[] = {
687 {(PS8)"UserPriority", CON_PARM_RANGE, 0, 7, 1 },
688 {(PS8)"NominalMSDUsize", CON_PARM_RANGE, 1, 2312, 1 },
689 {(PS8)"MeanDataRate (Bps units)", CON_PARM_RANGE, 0, 54000000, 0 },
690 {(PS8)"MinimumPHYRate (Mbps units)", CON_PARM_RANGE , 0, 54, 0 },
691 {(PS8)"SurplusBandwidthAllowance", CON_PARM_RANGE , 0, 7, 0 },
692 {(PS8)"UPSD Mode (0 - Legacy, 1 - U-APSD)", CON_PARM_RANGE , 0, 1, 0 },
693 {(PS8)"MinimumServiceInterval (usec)", CON_PARM_RANGE , 0, 1000000000, 0 },
694 {(PS8)"MaximumServiceInterval (usec)", CON_PARM_RANGE , 0, 1000000000, 0 },
695 CON_LAST_PARM };
696 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Add", (PS8)"Add TSPEC", (FuncToken_t) CuCmd_AddTspec, TspecParams );
697 }
698 {
699 ConParm_t UPid[] = { {(PS8)"User priority", CON_PARM_RANGE, 0, 7, 1 }, CON_LAST_PARM };
700 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Get", (PS8)"Get TSPEC Params", (FuncToken_t) CuCmd_GetTspec, UPid );
701 }
702 {
703 ConParm_t UPid[] = { {(PS8)"UserPriority", CON_PARM_RANGE, 0, 7, 1 },
704 {(PS8)"ReasonCode", CON_PARM_RANGE, 32, 45, 32 }, CON_LAST_PARM };
705 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Delete", (PS8)"Delete TSPEC", (FuncToken_t) CuCmd_DeleteTspec, UPid );
706 }
707
708 {
709 ConParm_t MediumUsageParams[] = {
710 {(PS8)"AC", CON_PARM_RANGE, 0, 3, 3 },
711 {(PS8)"HighThreshold", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 100, 1 },
712 {(PS8)"LowThreshold", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 100, 1 },
713 CON_LAST_PARM };
714 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Medium usage", (PS8)"Medium usage threshold", (FuncToken_t) CuCmd_ModifyMediumUsageTh, MediumUsageParams );
715 }
716
717
718 /* -------------------------------------------- Power Management -------------------------------------------- */
719
720 CHK_NULL(h = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) NULL, (PS8)"poWer", (PS8)"Power Management" ) );
721 {
722 /* Set Power Mode Command */
723 ConParm_t powerModeCmd[] = {
724 {(PS8)"PowerMode", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 3, 1 }, /* Min/Max/Def */
725 CON_LAST_PARM };
726 Console_AddToken(pTiCon->hConsole,h, (PS8)"set_Power_mode", (PS8)"Set user power mode", (FuncToken_t) CuCmd_SetPowerMode, powerModeCmd );
727
728 }
729 {
730 /* Set Power Save Power level Command */
731 ConParm_t powerSavePowerLevelCmd[] = {
732 {(PS8)"PowerSavePowerLevel", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 2, 2 }, /* Min/Max/Def */
733 CON_LAST_PARM };
734 Console_AddToken(pTiCon->hConsole,h, (PS8)"set_powersave_powerLevel", (PS8)"Set the Power level during PowerSave", (FuncToken_t) CuCmd_SetPowerSavePowerLevel, powerSavePowerLevelCmd );
735
736 }
737 {
738 /* Set default Power level Command */
739 ConParm_t defaultPowerLevelCmd[] = {
740 {(PS8)"DefaultPowerLevel", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 2, 2 }, /* Min/Max/Def */
741 CON_LAST_PARM };
742 Console_AddToken(pTiCon->hConsole,h, (PS8)"set_deFault_powerlevel", (PS8)"Set the default power level", (FuncToken_t) CuCmd_SetDefaultPowerLevel, defaultPowerLevelCmd );
743
744 }
745 {
746 /* Set doze mode in auto power mode */
747 ConParm_t powerSaveDozeMode[] = {
748 {(PS8)"DozeModeInAuto", CON_PARM_RANGE | CON_PARM_OPTIONAL, AUTO_POWER_MODE_DOZE_MODE_MIN_VALUE, AUTO_POWER_MODE_DOZE_MODE_MAX_VALUE, AUTO_POWER_MODE_DOZE_MODE_DEF_VALUE },
749 CON_LAST_PARM };
750 Console_AddToken(pTiCon->hConsole,h, (PS8)"set_doZe_mode_in_auto", (PS8)"Set doze mode in auto power mode", (FuncToken_t) CuCmd_SetDozeModeInAutoPowerLevel, powerSaveDozeMode );
751
752 }
753
754 {
755 ConParm_t TrafficIntensityParams[] = {
756 {(PS8)"HighThreshold (packets/sec)", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 1000, 100 },
757 {(PS8)"LowThreshold (packets/sec)", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 1000, 25 },
758 {(PS8)"CheckInterval (ms)", CON_PARM_RANGE | CON_PARM_OPTIONAL, 100, 10000, 1000 },
759 CON_LAST_PARM };
760 Console_AddToken(pTiCon->hConsole,h, (PS8)"traffic_Thresholds", (PS8)"Set/Get traffic intensity thresholds", (FuncToken_t) CuCmd_SetTrafficIntensityTh, TrafficIntensityParams );
761 }
762 Console_AddToken(pTiCon->hConsole,h, (PS8)"eNable", (PS8)"enable traffic intensity events", (FuncToken_t) CuCmd_EnableTrafficEvents, NULL );
763 Console_AddToken(pTiCon->hConsole,h, (PS8)"Disable", (PS8)"disable traffic intensity events", (FuncToken_t) CuCmd_DisableTrafficEvents, NULL );
764
765 /* -------------------------------------------- Events -------------------------------------------- */
766
767 CHK_NULL(h = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) NULL, (PS8)"eVents", (PS8)"Events" ) );
768 {
769 ConParm_t aaa[] = { {(PS8)"type", CON_PARM_OPTIONAL, 0, 0, 0 }, CON_LAST_PARM };
770 Console_AddToken(pTiCon->hConsole,h, (PS8)"Register", (PS8)"IPC events", (FuncToken_t)CuCmd_RegisterEvents, aaa);
771 }
772 {
773 ConParm_t aaa[] = { {(PS8)"type", CON_PARM_OPTIONAL, 0, 0, 0 }, CON_LAST_PARM };
774 Console_AddToken(pTiCon->hConsole,h, (PS8)"Unregister", (PS8)"IPC events", (FuncToken_t)CuCmd_UnregisterEvents, aaa);
775 }
776
777 /* -------------------------------------------- SG -------------------------------------------- */
778 CHK_NULL(h = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) NULL, (PS8)"Bt CoExsistance", (PS8)"BT - Wlan CoExsistance" ) );
779 {
780 ConParm_t aaa[] = { {(PS8)"enable", CON_PARM_RANGE | CON_PARM_OPTIONAL,
781 SOFT_GEMINI_ENABLED_MIN, SOFT_GEMINI_ENABLED_MAX, 0 }, CON_LAST_PARM };
782 Console_AddToken(pTiCon->hConsole,h, (PS8)"Enable", (PS8)"Enable BT Coexistense", (FuncToken_t) CuCmd_EnableBtCoe, aaa );
783 }
784 {
785 ConParm_t aaa[] = {
786 {(PS8)"coexParamIdx", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
787 SOFT_GEMINI_PARAMS_INDEX_MIN, SOFT_GEMINI_PARAMS_INDEX_MAX, SOFT_GEMINI_PARAMS_INDEX_DEF },
788 {(PS8)"coexParamValue", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
789 SOFT_GEMINI_PARAMS_VALUE_MIN, SOFT_GEMINI_PARAMS_VALUE_MAX, SOFT_GEMINI_PARAMS_VALUE_DEF},
790 CON_LAST_PARM };
791
792 Console_AddToken(pTiCon->hConsole, h, (PS8)"Config", (PS8)"Parameters configuration", (FuncToken_t) CuCmd_ConfigBtCoe, aaa );
793 }
794 {
795 ConParm_t aaa[] = { {(PS8)"status", CON_PARM_RANGE | CON_PARM_OPTIONAL, 0, 3, 0 }, CON_LAST_PARM };
796 Console_AddToken(pTiCon->hConsole, h, (PS8)"Status", (PS8)"Get status", (FuncToken_t) CuCmd_GetBtCoeStatus, aaa );
797 }
798 {
799 ConParm_t aaa[] = {
800 {(PS8)"coexIp", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
801 COEX_ACTIVITY_PARAMS_COEX_IP_MIN, COEX_ACTIVITY_PARAMS_COEX_IP_MAX, COEX_ACTIVITY_PARAMS_COEX_IP_DEF },
802 {(PS8)"activityId", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
803 COEX_ACTIVITY_PARAMS_ACTIVITY_ID_MIN, COEX_ACTIVITY_PARAMS_ACTIVITY_ID_MAX, COEX_ACTIVITY_PARAMS_ACTIVITY_ID_DEF},
804 {(PS8)"defaultPriority", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
805 COEX_ACTIVITY_PARAMS_DEFAULT_PRIO_MIN, COEX_ACTIVITY_PARAMS_DEFAULT_PRIO_MAX, COEX_ACTIVITY_PARAMS_DEFAULT_PRIO_DEF},
806 {(PS8)"raisedPriority", CON_PARM_RANGE | CON_PARM_OPTIONAL,
807 COEX_ACTIVITY_PARAMS_RAISED_PRIO_MIN, COEX_ACTIVITY_PARAMS_RAISED_PRIO_MAX, COEX_ACTIVITY_PARAMS_RAISED_PRIO_DEF},
808 {(PS8)"minService", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
809 COEX_ACTIVITY_PARAMS_MIN_SERVICE_MIN, COEX_ACTIVITY_PARAMS_MIN_SERVICE_MAX, COEX_ACTIVITY_PARAMS_MIN_SERVICE_DEF },
810 {(PS8)"maxService", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
811 COEX_ACTIVITY_PARAMS_MAX_SERVICE_MIN, COEX_ACTIVITY_PARAMS_MAX_SERVICE_MAX, COEX_ACTIVITY_PARAMS_MAX_SERVICE_DEF},
812 CON_LAST_PARM };
813
814 Console_AddToken(pTiCon->hConsole, h, (PS8)"coexActivity", (PS8)"Coex Activity Parameters configuration", (FuncToken_t) CuCmd_ConfigCoexActivity, aaa );
815 }
816 {
817 ConParm_t aaa[] = {
818 {(PS8)"enable", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
819 FM_COEX_ENABLE_MIN, FM_COEX_ENABLE_MAX, FM_COEX_ENABLE_DEF },
820 {(PS8)"swallowPeriod", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
821 FM_COEX_SWALLOW_PERIOD_MIN, FM_COEX_SWALLOW_PERIOD_MAX, FM_COEX_SWALLOW_PERIOD_DEF },
822 {(PS8)"nDividerFrefSet1", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
823 FM_COEX_N_DIVIDER_FREF_SET1_MIN, FM_COEX_N_DIVIDER_FREF_SET1_MAX, FM_COEX_N_DIVIDER_FREF_SET1_DEF },
824 {(PS8)"nDividerFrefSet2", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
825 FM_COEX_N_DIVIDER_FREF_SET2_MIN, FM_COEX_N_DIVIDER_FREF_SET2_MAX, FM_COEX_N_DIVIDER_FREF_SET2_DEF },
826 {(PS8)"mDividerFrefSet1", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
827 FM_COEX_M_DIVIDER_FREF_SET1_MIN, FM_COEX_M_DIVIDER_FREF_SET1_MAX, FM_COEX_M_DIVIDER_FREF_SET1_DEF },
828 {(PS8)"mDividerFrefSet2", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
829 FM_COEX_M_DIVIDER_FREF_SET2_MIN, FM_COEX_M_DIVIDER_FREF_SET2_MAX, FM_COEX_M_DIVIDER_FREF_SET2_DEF },
830 {(PS8)"pllStabilizationTime", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
831 FM_COEX_PLL_STABILIZATION_TIME_MIN, FM_COEX_PLL_STABILIZATION_TIME_MAX, FM_COEX_PLL_STABILIZATION_TIME_DEF },
832 {(PS8)"ldoStabilizationTime", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
833 FM_COEX_LDO_STABILIZATION_TIME_MIN, FM_COEX_LDO_STABILIZATION_TIME_MAX, FM_COEX_LDO_STABILIZATION_TIME_DEF },
834 {(PS8)"disturbedBandMargin", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
835 FM_COEX_DISTURBED_BAND_MARGIN_MIN, FM_COEX_DISTURBED_BAND_MARGIN_MAX, FM_COEX_DISTURBED_BAND_MARGIN_DEF },
836 {(PS8)"swallowClkDif", CON_PARM_RANGE | CON_PARM_OPTIONAL ,
837 FM_COEX_SWALLOW_CLK_DIF_MIN, FM_COEX_SWALLOW_CLK_DIF_MAX, FM_COEX_SWALLOW_CLK_DIF_DEF },
838 CON_LAST_PARM };
839
840 Console_AddToken(pTiCon->hConsole, h, (PS8)"Fm_coexistence", (PS8)"FM Coexistence parameters configuration", (FuncToken_t) CuCmd_ConfigFmCoex, aaa );
841 }
842
843 #ifdef XCC_MODULE_INCLUDED
844 CuXCC_AddMeasurementMenu(pTiCon->hConsole);
845 #endif /* XCC_MODULE_INCLUDED*/
846
847 #ifdef TI_DBG
848
849 /* -------------------------------------------- Report -------------------------------------------- */
850
851 CHK_NULL(h1 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) NULL, (PS8)"Report", (PS8)"Debug features" ) );
852 {
853 ConParm_t aaa[] =
854 {
855 {(PS8)"module table", CON_PARM_STRING | CON_PARM_OPTIONAL , REPORT_FILES_NUM, REPORT_FILES_NUM, 0 },
856 CON_LAST_PARM };
857 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Set", (PS8)"set report module table", (FuncToken_t) CuCmd_SetReport, aaa );
858 }
859 {
860 ConParm_t aaa[] =
861 {
862 {(PS8)"module", CON_PARM_OPTIONAL, 0, 0, 0 },
863 CON_LAST_PARM
864 };
865 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Add", (PS8)"set report for specified module", (FuncToken_t) CuCmd_AddReport, aaa );
866 }
867 {
868 ConParm_t aaa[] =
869 {
870 {(PS8)"module", CON_PARM_OPTIONAL, 0, 0, 0 },
871 CON_LAST_PARM
872 };
873 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Clear", (PS8)"clear report for specified module", (FuncToken_t) CuCmd_ClearReport, aaa );
874 }
875 {
876 ConParm_t aaa[] = { {(PS8)"level", CON_PARM_OPTIONAL , 0, 0, 0 }, CON_LAST_PARM };
877 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Level", (PS8)"set report severity level", (FuncToken_t) CuCmd_ReportSeverityLevel, aaa );
878 }
879 /* -------------------------------------------- Debug -------------------------------------------- */
880
881 CHK_NULL(h = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) NULL, (PS8)"dEbug", (PS8)"Debug features" ) );
882 {
883 ConParm_t aaa[] = {{(PS8)"func_num", CON_PARM_OPTIONAL, 0, 0, 0 },
884 {(PS8)"param1 (decimal)", CON_PARM_OPTIONAL , 0, 0, 0 },
885 {(PS8)"param2 (decimal)", CON_PARM_OPTIONAL , 0, 0, 0 },
886 {(PS8)"R/W Mem buf (up to 32 characters)", CON_PARM_STRING | CON_PARM_OPTIONAL, 0, FW_DEBUG_MAX_BUF * 2, 0 },
887 CON_LAST_PARM };
888 Console_AddToken(pTiCon->hConsole,h, (PS8)"Print", (PS8)"print driver debug info", (FuncToken_t) CuCmd_PrintDriverDebug, aaa );
889
890 CHK_NULL(h1 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle)h , (PS8)"Fw Debug", (PS8)"Debug features" ) );
891 {
892 {
893 ConParm_t aaa[] = { { (PS8)"debug", CON_PARM_OPTIONAL | CON_PARM_LINE, 0, 2050, 0 }, CON_LAST_PARM };
894 Console_AddToken(pTiCon->hConsole, h1, (PS8)"debug", (PS8)" debug", (FuncToken_t) CuCmd_FwDebug, aaa );
895 }
896 {
897 ConParm_t aaa[] = { {(PS8)"Index", CON_PARM_OPTIONAL|CON_PARM_RANGE | CON_PARM_SIGN,0,255,0},
898 {(PS8)"Value_1", CON_PARM_OPTIONAL|CON_PARM_RANGE | CON_PARM_SIGN,-4096,4069,0},
899 {(PS8)"Value_2", CON_PARM_OPTIONAL|CON_PARM_RANGE | CON_PARM_SIGN,-4096,4069,0},
900 {(PS8)"Value_3", CON_PARM_OPTIONAL|CON_PARM_RANGE | CON_PARM_SIGN,-4096,4069,0},
901 {(PS8)"Value_4", CON_PARM_OPTIONAL|CON_PARM_RANGE | CON_PARM_SIGN,-4096,4069,0},
902 {(PS8)"Value_5", CON_PARM_OPTIONAL|CON_PARM_RANGE | CON_PARM_SIGN,-4096,4069,0},
903 {(PS8)"Value_6", CON_PARM_OPTIONAL|CON_PARM_RANGE | CON_PARM_SIGN,-4096,4069,0},
904 {(PS8)"Value_7", CON_PARM_OPTIONAL|CON_PARM_RANGE | CON_PARM_SIGN,-4096,4069,0},
905 {(PS8)"Value_8", CON_PARM_OPTIONAL|CON_PARM_RANGE | CON_PARM_SIGN,-4096,4069,0},
906 {(PS8)"Value_9", CON_PARM_OPTIONAL|CON_PARM_RANGE | CON_PARM_SIGN,-4096,4069,0},
907 {(PS8)"Value_10", CON_PARM_OPTIONAL|CON_PARM_RANGE | CON_PARM_SIGN,-4096,4069,0},
908 {(PS8)"Value_11", CON_PARM_OPTIONAL|CON_PARM_RANGE | CON_PARM_SIGN,-4096,4069,0},
909 {(PS8)"Value_12", CON_PARM_OPTIONAL|CON_PARM_RANGE | CON_PARM_SIGN,-4096,4069,0},
910 {(PS8)"Value_13", CON_PARM_OPTIONAL|CON_PARM_RANGE | CON_PARM_SIGN,-4096,4069,0},
911 CON_LAST_PARM };
912 Console_AddToken(pTiCon->hConsole, h1, (PS8)"Set rate managment", (PS8)"rate managment", (FuncToken_t) CuCmd_SetRateMngDebug, aaa );
913
914 }
915 {
916 ConParm_t aaa[] = { {(PS8)"Index", CON_PARM_OPTIONAL,0,4096,0},
917 {(PS8)"Value", CON_PARM_OPTIONAL,0,4096,0}, CON_LAST_PARM };
918 Console_AddToken(pTiCon->hConsole, h1, (PS8)"Get rate managment", (PS8)"rate managment", (FuncToken_t) CuCmd_GetRateMngDebug, aaa );
919
920 }
921
922 }
923 }
924
925 #endif /*TI_DBG*/
926
927 /* -------------------------------------------- BIT -------------------------------------------- */
928
929 CHK_NULL(h = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) NULL, (PS8)"biT", (PS8)"Built In Test" ) );
930
931 CHK_NULL(h1 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) h, (PS8)"Bip", (PS8)"Built In Production Line Test" ) );
932 {
933 {
934 ConParm_t aaa[] = {{(PS8)"iReferencePointDetectorValue", CON_PARM_OPTIONAL|CON_PARM_RANGE, 0, 1000, 0 },
935 {(PS8)"iReferencePointPower", CON_PARM_OPTIONAL|CON_PARM_RANGE, 0, 200, 0 },
936 {(PS8)"isubBand", CON_PARM_OPTIONAL|CON_PARM_RANGE, 0, 10, 0 },
937 CON_LAST_PARM };
938 Console_AddToken(pTiCon->hConsole,h1, (PS8)"update Buffer calref point", (PS8)"BufferCalReferencePoint", (FuncToken_t) CuCmd_BIP_BufferCalReferencePoint, aaa );
939 }
940
941 {
942 ConParm_t aaa[] = {{(PS8)"Sub Band B/G: 1 - 14", CON_PARM_RANGE, 0, 1, 0 },
943 {(PS8)"Sub Band A: 1 - 4", CON_PARM_RANGE, 0, 1, 0 },
944 {(PS8)"Sub Band A: 8 - 16", CON_PARM_RANGE, 0, 1, 0 },
945 {(PS8)"Sub Band A: 34 - 48", CON_PARM_RANGE, 0, 1, 0 },
946 {(PS8)"Sub Band A: 52 - 64", CON_PARM_RANGE, 0, 1, 0 },
947 {(PS8)"Sub Band A: 100 -116", CON_PARM_RANGE, 0, 1, 0 },
948 {(PS8)"Sub Band A: 120 -140", CON_PARM_RANGE, 0, 1, 0 },
949 {(PS8)"Sub Band A: 149 -165", CON_PARM_RANGE, 0, 1, 0 },
950 CON_LAST_PARM };
951 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Tx bip", (PS8)"P2G Calibration", (FuncToken_t) CuCmd_BIP_StartBIP, aaa );
952 }
953
954
955 CHK_NULL(h2 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) h1, (PS8)"Rx bip", (PS8)"Rx Built In Production Line Test" ) );
956 {
957 {
958 ConParm_t aaa[] = {{(PS8)"initiates RX BIP operations",CON_PARM_OPTIONAL },
959 CON_LAST_PARM };
960 Console_AddToken(pTiCon->hConsole,h2, (PS8)"rx Enter", (PS8)"enter Rx Calibration state", (FuncToken_t) CuCmd_BIP_EnterRxBIP, aaa );
961 }
962
963 {
964 ConParm_t aaa[] = {{(PS8)"Reference point value", CON_PARM_SIGN },
965 CON_LAST_PARM };
966 Console_AddToken(pTiCon->hConsole,h2, (PS8)"rx Start", (PS8)" Rx Calibration", (FuncToken_t) CuCmd_BIP_StartRxBIP, aaa );
967 }
968
969 {
970 ConParm_t aaa[] = {{(PS8)"finished the RX BIP procedure" ,CON_PARM_OPTIONAL},
971 CON_LAST_PARM };
972 Console_AddToken(pTiCon->hConsole,h2, (PS8)"rx eXit", (PS8)"Exit Rx Calibration", (FuncToken_t) CuCmd_BIP_ExitRxBIP, aaa );
973 }
974
975 }
976
977
978 }
979
980 CHK_NULL(h1 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) h, (PS8)"Radio debug", (PS8)"Radio Debug Test" ) );
981 {
982 /* Get HDK version*/
983 Console_AddToken(pTiCon->hConsole,h1, (PS8)"Get hdk version", (PS8)"HDK version", (FuncToken_t) CuCmd_RadioDebug_GetHDKVersion, NULL );
984 /* Rx Channel Tune */
985 {
986 ConParm_t aaa[] = {{(PS8)"Band", CON_PARM_OPTIONAL|CON_PARM_RANGE, 0, 2, 0 },
987 {(PS8)"Channel", CON_PARM_OPTIONAL|CON_PARM_RANGE , 1, 161, 0 },
988 CON_LAST_PARM };
989 Console_AddToken(pTiCon->hConsole,h1, (PS8)"cHannel tune", (PS8)"Set the RX channel", (FuncToken_t) CuCmd_RadioDebug_ChannelTune, aaa );
990 }
991 /* TX Debug */
992 CHK_NULL(h2 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) h1, (PS8)"Tx debug", (PS8)"TX Debug Test" ) );
993 {
994 /* TELEC */
995 {
996 ConParm_t aaa[] = {{(PS8)"Power", CON_PARM_OPTIONAL, 0, 25000, 0 },
997 {(PS8)"Tone Type", CON_PARM_OPTIONAL, 1, 2, 2 },
998 /* {(PS8)"Band", CON_PARM_OPTIONAL, 0, 2, 0 },
999 {(PS8)"Channel", CON_PARM_OPTIONAL , 1, 161, 0 },
1000 {(PS8)"Power", CON_PARM_OPTIONAL, 0, 0, 0 },
1001 {(PS8)"Tone Type", CON_PARM_OPTIONAL, 0, 0, 0 },
1002 {(PS8)"Tone Number - Single Tones", CON_PARM_OPTIONAL, 0, 0, 0 },
1003 {(PS8)"Tone Number - Two Tones", CON_PARM_OPTIONAL, 0, 0, 0 },
1004 {(PS8)"Use Digital DC", CON_PARM_OPTIONAL, 0, 0, 0 },
1005 {(PS8)"Invert", CON_PARM_OPTIONAL, 0, 0, 0 },
1006 {(PS8)"Eleven N Span", CON_PARM_OPTIONAL, 0, 0, 0 },
1007 {(PS8)"Digital DC", CON_PARM_OPTIONAL, 0, 0, 0 },
1008 {(PS8)"Analog DC Fine", CON_PARM_OPTIONAL, 0, 0, 0 },
1009 {(PS8)"Analog DC Coarse", CON_PARM_OPTIONAL, 0, 0, 0 },*/
1010 CON_LAST_PARM };
1011 Console_AddToken(pTiCon->hConsole,h2, (PS8)"Cw", (PS8)"Start CW test", (FuncToken_t) CuCmd_RadioDebug_StartTxCw, aaa );
1012
1013 }
1014 /* FCC */
1015 {
1016 ConParm_t aaa[] = {{(PS8)"Delay", CON_PARM_OPTIONAL, 0, 0, 0 },
1017 {(PS8)"Rate", CON_PARM_OPTIONAL, 0, 0, 0 },
1018 {(PS8)"Size", CON_PARM_OPTIONAL, 0, 0, 0 },
1019 {(PS8)"Amount", CON_PARM_OPTIONAL, 0, 0, 0 },
1020 {(PS8)"Power", CON_PARM_OPTIONAL, 0, 0, 0 },
1021 {(PS8)"Seed", CON_PARM_OPTIONAL, 0, 0, 0 },
1022 {(PS8)"Packet Mode", CON_PARM_OPTIONAL, 0, 0, 0 },
1023 {(PS8)"DC On Off", CON_PARM_OPTIONAL, 0, 0, 0 },
1024 {(PS8)"GI", CON_PARM_OPTIONAL, 0, 0, 0 },
1025 {(PS8)"Preamble", CON_PARM_OPTIONAL, 0, 0, 0 },
1026 {(PS8)"Type", CON_PARM_OPTIONAL, 0, 0, 0 },
1027 {(PS8)"Scrambler", CON_PARM_OPTIONAL, 0, 0, 0 },
1028 {(PS8)"Enable CLPC", CON_PARM_OPTIONAL, 0, 0, 0 },
1029 {(PS8)"Sequance Number Mode", CON_PARM_OPTIONAL, 0, 0, 0 },
1030 {(PS8)"Destination MAC Address", CON_PARM_STRING | CON_PARM_OPTIONAL, 0, 32, 0 },
1031 /* future use. for now the oregenal source address are use.
1032 {(PS8)"Source MAC Address", CON_PARM_STRING | CON_PARM_OPTIONAL, 0, 32, 0 },
1033 */
1034 {(PS8)"Destination MAC Address", CON_PARM_STRING | CON_PARM_OPTIONAL, 0, 32, 0 },
1035 CON_LAST_PARM };
1036 Console_AddToken(pTiCon->hConsole,h2, (PS8)"coNtinues", (PS8)"Start TX continues test", (FuncToken_t) CuCmd_RadioDebug_StartContinuousTx, aaa );
1037 }
1038 /* Stop FCC/TELEC */
1039 {
1040 Console_AddToken(pTiCon->hConsole,h2, (PS8)"Stop", (PS8)"Stop TX tests", (FuncToken_t) CuCmd_RadioDebug_StopTx, NULL );
1041 }
1042 #if 0 /* not support for now */
1043 /* TEMPLATE */
1044 {
1045 ConParm_t aaa[] = {{(PS8)"Length", CON_PARM_OPTIONAL|CON_PARM_RANGE, 0, 0, 0 },
1046 {(PS8)"Offset", CON_PARM_OPTIONAL|CON_PARM_RANGE , 0, 0, 0 },
1047 {(PS8)"Data", CON_PARM_OPTIONAL|CON_PARM_RANGE, 0, 0, 0 },
1048 CON_LAST_PARM };
1049 Console_AddToken(pTiCon->hConsole,h2, (PS8)"temPlate", (PS8)"Set Template", (FuncToken_t) CuCmd_RadioDebug_Template, aaa );
1050 }
1051 #endif
1052 }
1053 /*yael - to Complete statistics */
1054 CHK_NULL(h2 = (THandle) Console_AddDirExt(pTiCon->hConsole, (THandle) h1, (PS8)"rx Statistics", (PS8)"Rx Statistics" ) );
1055 {
1056 /* RX Statixtics Start */
1057 Console_AddToken(pTiCon->hConsole,h2, (PS8)"rx stat Start", (PS8)"Start Rx Statistics", (FuncToken_t)CuCmd_RadioDebug_StartRxStatistics , NULL );
1058 /* RX Statixtics Stop */
1059 Console_AddToken(pTiCon->hConsole,h2, (PS8)"rx stat stoP", (PS8)"Stop Rx Statistics", (FuncToken_t)CuCmd_RadioDebug_StopRxStatistics , NULL );
1060 /* RX Statixtics Reset */
1061 Console_AddToken(pTiCon->hConsole,h2, (PS8)"rx stat Reset", (PS8)"Reset Rx Statistics", (FuncToken_t)CuCmd_RadioDebug_ResetRxStatistics , NULL );
1062 /* RX Statixtics Get */
1063 Console_AddToken(pTiCon->hConsole,h2, (PS8)"rx stat Get", (PS8)"Get Rx Statistics", (FuncToken_t)CuCmd_RadioDebug_GetRxStatistics , NULL );
1064 }
1065 } /* h1 */
1066
1067 /* -------------------------------------------- Root -------------------------------------------- */
1068
1069 Console_AddToken(pTiCon->hConsole,NULL, (PS8)"aboUt", (PS8)"About", (FuncToken_t) CuCmd_ShowAbout, NULL );
1070 Console_AddToken(pTiCon->hConsole,NULL, (PS8)"Quit", (PS8)"quit", (FuncToken_t) CuCmd_Quit, NULL );
1071
1072 return 0;
1073 }
1074
1075
TiCon_Print_Usage(VOID)1076 static S32 TiCon_Print_Usage(VOID)
1077 {
1078 os_error_printf(CU_MSG_ERROR, (PS8)"Usage: ./wlan_cu [driver_name] [options]\n");
1079 os_error_printf(CU_MSG_ERROR, (PS8)" -b - bypass supplicant\n");
1080 os_error_printf(CU_MSG_ERROR, (PS8)" -i<ifname> - supplicant interface file\n");
1081 os_error_printf(CU_MSG_ERROR, (PS8)"example:\n");
1082 os_error_printf(CU_MSG_ERROR, (PS8)" ./wlan_cu tiwlan0 -i/voice/tiwlan0\n");
1083 return 0;
1084 }
1085
TiCon_SignalCtrlC(S32 signo)1086 static VOID TiCon_SignalCtrlC(S32 signo)
1087 {
1088 os_error_printf(CU_MSG_ERROR, (PS8)"TiCon_Signal - got signal Ctrl+c ... exiting\n");
1089 Console_Stop(g_TiCon.hConsole);
1090 }
1091
1092
1093 /* functions */
1094 /*************/
user_main(S32 argc,PS8 * argv)1095 S32 user_main(S32 argc, PS8* argv)
1096 {
1097 S32 i;
1098 char *script_file = NULL;
1099 S32 BypassSupplicant = FALSE;
1100 S8 SupplIfFile[50];
1101 S32 fill_name = TRUE;
1102 int stop_UI = 0;
1103
1104 SupplIfFile[0] = '\0';
1105 if( argc > 1 )
1106 {
1107 i=1;
1108 if( argv[i][0] != '-' )
1109 {
1110 os_strcpy( g_TiCon.drv_name, argv[i++] );
1111 fill_name = FALSE;
1112 }
1113
1114 for( ;i < argc; i++ )
1115 {
1116 if( !os_strcmp(argv[i], (PS8)"-h" ) || !os_strcmp(argv[i], (PS8)"--help") )
1117 {
1118 TiCon_Print_Usage();
1119 return 0;
1120 }
1121 else if(!os_strcmp(argv[i], (PS8)"-b"))
1122 {
1123 BypassSupplicant = TRUE;
1124 }
1125 else if(!os_strncmp(argv[i], (PS8)"-i", 2))
1126 {
1127 os_strcpy( SupplIfFile, &(argv[i])[2] );
1128 }
1129 else if(!os_strncmp(argv[i], "-s", 2 ) )
1130 {
1131 script_file = argv[++i];
1132 }
1133 }
1134 }
1135
1136 os_OsSpecificCmdParams(argc, argv);
1137
1138 /* fill the driver name */
1139 if(fill_name == TRUE)
1140 {
1141 os_strcpy(g_TiCon.drv_name, (PS8)TIWLAN_DRV_NAME);
1142 }
1143
1144 /* fill supplicant interface file */
1145 if(SupplIfFile[0] == '\0')
1146 {
1147 os_strcpy(SupplIfFile, (PS8)SUPPL_IF_FILE);
1148 }
1149
1150 g_TiCon.hConsole = Console_Create(g_TiCon.drv_name, BypassSupplicant, SupplIfFile);
1151 if(g_TiCon.hConsole == NULL)
1152 return 0;
1153
1154 Console_GetDeviceStatus(g_TiCon.hConsole);
1155
1156 os_Catch_CtrlC_Signal(TiCon_SignalCtrlC);
1157
1158 os_InitOsSpecificModules();
1159
1160 /* ----------------------------------------------------------- */
1161 TiCon_Init_Console_Menu(&g_TiCon);
1162
1163 if( script_file )
1164 {
1165 stop_UI = consoleRunScript (script_file, g_TiCon.hConsole);
1166 }
1167
1168 if( !stop_UI )
1169 {
1170 os_error_printf(CU_MSG_INFO2, (PS8)("user_main, start\n") );
1171 Console_Start(g_TiCon.hConsole);
1172 }
1173
1174 Console_Destroy(g_TiCon.hConsole);
1175
1176 os_DeInitOsSpecificModules();
1177
1178 return 0;
1179 }
1180
1181 /* Stubs for all OS */
g_tester_send_event(U8 event_index)1182 void g_tester_send_event(U8 event_index)
1183 {
1184 }
1185
ProcessLoggerMessage(PU8 data,U32 len)1186 void ProcessLoggerMessage(PU8 data, U32 len)
1187 {
1188 }
1189