Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
elxu_commands.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2018, Emulex
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its contributors
16  * may be used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  *
31  */
32 
33  /**
34  * @file
35  * Defines the elxsdkutil command data types and includes the table of commands.
36  */
37 
38 
39 #ifndef __ELXU_COMMANDS_H__
40 #define __ELXU_COMMANDS_H__
41 
42 #include "elxu_device.h"
43 #include <ocs_ioctl.h>
44 
45 typedef int(*handler_t)(int, char**);
46 
47 typedef struct cmd_table_entry_s {
48  char *name;
53  char *syntax;
54  char *help_text;
56 
57 #define ASCII_VALUE_OFFSET 1000
58 
59 #define CLEAR_COUNTER (ASCII_VALUE_OFFSET + 99)
60 #define CLEAR_OVERFLOW_FLAG (ASCII_VALUE_OFFSET + 100)
61 #define CLEAR_ALL_COUNTER (ASCII_VALUE_OFFSET + 101)
62 #define TEST_DUMP (ASCII_VALUE_OFFSET + 102)
63 #define FAT_DUMP (ASCII_VALUE_OFFSET + 103)
64 #define EFD_DUMP (ASCII_VALUE_OFFSET + 104)
65 #define ECD_DUMP (ASCII_VALUE_OFFSET + 105)
66 #define WWNN (ASCII_VALUE_OFFSET + 106)
67 #define WWPN (ASCII_VALUE_OFFSET + 107)
68 #define INITIATOR (ASCII_VALUE_OFFSET + 108)
69 #define TARGET (ASCII_VALUE_OFFSET + 109)
70 #define CONNECTION_HANDLE (ASCII_VALUE_OFFSET + 111)
71 #define CONNECTION_ID (ASCII_VALUE_OFFSET + 114)
72 #define CMD_HOSTNAME (ASCII_VALUE_OFFSET + 115)
73 #define LINKCFG (ASCII_VALUE_OFFSET + 116)
74 #define BUFSIZE (ASCII_VALUE_OFFSET + 117)
75 #define SAVED (ASCII_VALUE_OFFSET + 118)
76 #define CLRSAVED (ASCII_VALUE_OFFSET + 119)
77 #define PROFILE_ID (ASCII_VALUE_OFFSET + 120)
78 #define WQES (ASCII_VALUE_OFFSET + 121)
79 #define CQES (ASCII_VALUE_OFFSET + 122)
80 #define RQES (ASCII_VALUE_OFFSET + 123)
81 #define MQES (ASCII_VALUE_OFFSET + 124)
82 #define EQES (ASCII_VALUE_OFFSET + 125)
83 #define QENTRIES (ASCII_VALUE_OFFSET + 126)
84 #define PROTOCOL_NAME (ASCII_VALUE_OFFSET + 127)
85 #define FIRMWARE_RESET (ASCII_VALUE_OFFSET + 128)
86 #define FDB_DUMP (ASCII_VALUE_OFFSET + 129)
87 #define SFP_DIAG_DATA (ASCII_VALUE_OFFSET + 130)
88 #define LOOPBACK_TYPE (ASCII_VALUE_OFFSET + 131)
89 #define RETRY_COUNT (ASCII_VALUE_OFFSET + 132)
90 #define LINKSPEED (ASCII_VALUE_OFFSET + 133)
91 #define LINKTOPOLOGY (ASCII_VALUE_OFFSET + 134)
92 #define CHAP_TYPE (ASCII_VALUE_OFFSET + 135)
93 #define SFP_TRANSCEIVER (ASCII_VALUE_OFFSET + 136)
94 #define VLAN_ID (ASCII_VALUE_OFFSET + 137)
95 #define HBA_ID (ASCII_VALUE_OFFSET + 138)
96 #define PORT_ID (ASCII_VALUE_OFFSET + 149)
97 #define TRUNK_MODE (ASCII_VALUE_OFFSET + 150)
98 #define PORT_MIGRATION (ASCII_VALUE_OFFSET + 151)
99 
100 #define OCS_CLUST_TARGET_KEY_RETCNT (9999)
101 #define OCS_ISCSI_PORTAL_GRPTAG (1)
102 #define OCS_ISCSI_TCP_PORT (3260)
103 
104 extern int elxu_cmd_file_info(int argc, char **argv);
105 extern int elxu_cmd_driver_info(int argc, char **argv);
106 extern int elxu_cmd_list(int argc, char **argv);
107 extern int elxu_cmd_read(int argc, char **argv);
108 extern int elxu_cmd_write(int argc, char **argv);
109 extern int elxu_cmd_version(int argc, char **argv);
110 extern int elxu_cmd_cmp(int argc, char **argv);
111 extern int elxu_cmd_dump(int argc, char **argv);
112 extern int elxu_cmd_efdc(int argc, char **argv);
113 extern int elxu_cmd_gendump(int argc, char **argv);
114 extern int elxu_cmd_dump_to_host(int arg, char **argv);
115 extern int elxu_cmd_board_temp(int argc, char **argv);
116 extern int elxu_cmd_objenum(int argc, char **argv);
117 extern int elxu_cmd_sfp(int argc, char **argv);
118 extern int elxu_cmd_read_status(int argc, char **argv);
119 extern int elxu_cmd_read_link_status(int argc, char **argv);
120 extern int elxu_cmd_get_dport_stats(int argc, char **argv);
121 extern int elxu_cmd_get_dynamic_dport_status(int argc, char **argv);
122 extern int elxu_cmd_set_dport_dynamic_mode(int argc, char **argv);
123 extern int elxu_cmd_diag_loopback_tests(int argc, char **argv);
124 extern int elxu_cmd_read_rev(int argc, char **argv);
125 extern int elxu_cmd_ack_frequency(int argc, char **argv);
126 extern int elxu_cmd_delayed_ack_timer(int argc, char **argv);
127 extern int elxu_cmd_constrain_window(int argc, char **argv);
128 extern int elxu_cmd_driver_dump(int argc, char **argv);
129 extern int elxu_cmd_mgmt_info(int argc, char **argv);
130 extern int elxu_cmd_connection_info(int argc, char **argv);
131 extern int elxu_cmd_vlan(int argc, char **argv);
132 extern int elxu_cmd_route(int argc, char **argv);
133 extern int elxu_cmd_add_ip(int argc, char **argv);
134 extern int elxu_cmd_remove_ip(int argc, char **argv);
135 extern int elxu_cmd_show_ips(int argc, char **argv);
136 extern int elxu_cmd_iclusttgt(int argc, char **argv);
137 extern int elxu_cmd_set_mac_ocs(int argc, char **argv);
138 extern int elxu_cmd_set_nv_mac_pt(int argc, char **argv);
139 extern int elxu_cmd_show_mac_ocs(int argc, char **argv);
140 extern int elxu_cmd_show_mac_pt(int argc, char **argv);
141 extern int elxu_cmd_show_wwn(int argc, char **argv);
142 extern int elxu_cmd_set_wwn(int argc, char **argv);
143 extern int elxu_cmd_create_vport(int argc, char **argv);
144 extern int elxu_cmd_remove_vport(int argc, char **argv);
145 extern int elxu_cmd_help(int argc, char **argv);
146 extern int elxu_cmd_set_linkcfg(int argc, char **argv);
147 extern int elxu_cmd_get_linkcfg(int argc, char **argv);
148 extern int elxu_cmd_set_linkspeed(int argc, char **argv);
149 extern int elxu_cmd_get_linkspeed(int argc, char **argv);
150 extern int elxu_cmd_set_linktopology(int argc, char **argv);
151 extern int elxu_cmd_get_linktopology(int argc, char **argv);
152 extern int elxu_cmd_get_profile_list(int argc, char **argv);
153 extern int elxu_cmd_get_active_profile(int argc, char **argv);
154 extern int elxu_cmd_set_active_profile(int argc, char **argv);
155 extern int elxu_cmd_get_profile_list_pt(int argc, char **argv);
156 extern int elxu_cmd_get_active_profile_pt(int argc, char **argv);
157 extern int elxu_cmd_set_active_profile_pt(int argc, char **argv);
158 extern int elxu_cmd_get_port_protocol(int argc, char **argv);
159 extern int elxu_cmd_set_port_protocol(int argc, char **argv);
160 extern int elxu_cmd_firmware_reset(int argc, char **argv);
161 extern int elxu_cmd_firmware_reset_pt(int argc, char **argv);
162 extern int elxu_cmd_port_migration(int argc, char **argv);
163 extern int elxu_cmd_get_parity_stats(int argc, char **argv);
164 extern int elxu_cmd_unload(int argc, char **argv);
165 extern int elxu_cmd_add_chap(int argc, char **argv);
166 extern int elxu_cmd_remove_chap(int argc, char **argv);
167 extern int elxu_cmd_show_chap_list(int argc, char **argv);
168 extern int elxu_cmd_enable_jumbo(int argc, char **argv);
169 extern int elxu_cmd_disable_jumbo(int argc, char **argv);
170 extern int elxu_cmd_enable_header_digest(int argc, char **argv);
171 extern int elxu_cmd_disable_header_digest(int argc, char **argv);
172 extern int elxu_cmd_enable_data_digest(int argc, char **argv);
173 extern int elxu_cmd_disable_data_digest(int argc, char **argv);
174 extern int elxu_cmd_set_tcp_window_size(int argc, char **argv);
175 extern int elxu_cmd_get_tcp_window_size(int argc, char **argv);
176 extern int elxu_cmd_set_tcp_window_scale(int argc, char **argv);
177 extern int elxu_cmd_get_tcp_window_scale(int argc, char **argv);
178 extern int elxu_cmd_set_max_connections(int argc, char **argv);
179 extern int elxu_cmd_get_max_connections(int argc, char **argv);
180 extern int elxu_cmd_start_listen(int argc, char **argv);
181 extern int elxu_cmd_stop_listen(int argc, char **argv);
182 extern int elxu_cmd_set_require_chap(int argc, char **argv);
183 extern int elxu_cmd_get_require_chap(int argc, char **argv);
184 extern int elxu_cmd_set_gateway(int argc, char **argv);
185 extern int elxu_cmd_get_gateway(int argc, char **argv);
186 extern int elxu_cmd_node_abort_cnt(int argc, char **argv);
187 extern int elxu_cmd_fw_diagnostic_log(int argc, char **argv);
188 extern int elxu_cmd_get_fdmi_hba_list(int argc, char **argv);
189 extern int elxu_cmd_get_fdmi_hba_info(int argc, char **argv);
190 extern int elxu_cmd_get_fdmi_port_list(int argc, char **argv);
191 extern int elxu_cmd_get_fdmi_port_info(int argc, char **argv);
192 extern int elxu_cmd_set_trunk_mode(int argc, char **argv);
193 extern int elxu_cmd_get_trunk_config(int argc, char **argv);
194 
195 #define ELXU_CMD_VLAN_SHOW_BUFFER_SIZE (4096)
196 
197 extern void usage();
198 
201  "file-info -f <filename>",
202  "Provide information about the given firmware file"
203  },
205  "list [--host <hostname>]",
206  "List discovered devices"
207  },
208  {"driver-info", elxu_cmd_driver_info, NULL, NULL, NULL,
209  "driver-info [-d <devicenum>] [--host <hostname>]",
210  "Provide information about the driver associated with a device"
211  },
212  {"read", elxu_cmd_read, NULL, NULL, NULL,
213  "read <objname> [-d <devicenum>] [--host <hostname>] [-f <filename>]",
214  "Read an object file from a device"
215  },
216  {"write", elxu_cmd_write, elxu_cmd_write, NULL, NULL,
217  "write -f <filename> [-d <devicenum>] [--host <hostname>]",
218  "Write a firmware file to a device"
219  },
221  "version",
222  "Report the version of this program"
223  },
224  {"cmp", elxu_cmd_cmp, NULL, NULL, NULL,
225  "cmp -f <filename> [-d <devicenum>] [--host <hostname>]",
226  "Compare the firmware in a file with the firmware on a device"
227  },
228  {"dump", elxu_cmd_dump, elxu_cmd_dump, NULL, NULL,
229  "dump [--fat | --efd | --ecd | --ecdtest] [-d <devicenum>] [--host <hostname>] [-f <filename>]",
230  "Retrieve a dump from a device. For Skyhawk an optional dump type\n"
231  "(--fat, --efd, --ecd, --ecdtest) can be specified. The default is ecd."
232  },
233  {"efdc", elxu_cmd_efdc, NULL, NULL, NULL,
234  "efdc [-d <devicenum>] [--host <hostname>]",
235  "Report EFD capabilities for a device"
236  },
237  {"gendump", elxu_cmd_gendump, elxu_cmd_gendump, NULL, NULL,
238  "gendump [--fdb] [-d <devicenum>] [--host <hostname>]",
239  "Cause a device to generate a dump. --fdb option for Function specific non disruptive dump"
240  },
241  {"dump-to-host", elxu_cmd_dump_to_host, elxu_cmd_dump_to_host, NULL, NULL,
242  "dump-to-host [--fdb] [-d <devicenum>] [-f <filename>]",
243  "Cause a device to generate a dump and transfer it directly to host\n"
244  "memory (Lancer only). If no filename is given the dump will be\n"
245  "written to the file dump.bin. --fdb option for Function specific non disruptive dump"
246  },
247  {"objenum", elxu_cmd_objenum, NULL, NULL, NULL,
248  "objenum [-d <devicenum>] [--host <hostname>]",
249  "Enumerate filesystem objects on a device"
250  },
251  {"sfp", elxu_cmd_sfp, NULL, NULL, NULL,
252  "sfp [-d <devicenum>] [--host <hostname>]",
253  "Report SFP data for a device, --sfp_diag_data to get SFP Diagnostics data from transceiver\n"
254  "--sfp_xceiver_data Decode SFP transceiver for a device"
255  },
256  {"boardtemp", elxu_cmd_board_temp, NULL, NULL, NULL,
257  "boardtemp [-d <devicenum>]", "Read board temperature"
258  },
259  {"read-status", elxu_cmd_read_status, NULL, NULL, NULL,
260  "read-status [-d <devicenum>] [--host <hostname>] [--cc]",
261  "Report device status and optionally clear counters."
262  },
263  {"read-link-status", elxu_cmd_read_link_status, NULL, NULL, NULL,
264  "read-link-status [-d <devicenum>] [--host <hostname>] [--clof] [--clrc]",
265  "Report device link status. Optional flags can be used to clear\n"
266  "overflow counters or clear all counters."
267  },
268  {"dport-dynamic-mode-status", elxu_cmd_get_dynamic_dport_status, NULL, NULL, NULL,
269  "dport-dynamic-mode-status [-d <devicenum>]",
270  "Query dynamic dport mode status"
271  },
272  {"set-dport-dynamic-mode", elxu_cmd_set_dport_dynamic_mode, NULL, NULL, NULL,
273  "set-dport-dynamic-mode (enable | disable) [-d <devicenum>]",
274  "Enable/Disable dport dynamic mode"
275  },
276  {"get-dport-stats", elxu_cmd_get_dport_stats, NULL, NULL, NULL,
277  "get-dport-stats [-d <devicenum>] [--host <hostname>]",
278  "Enable on-demand dport mode and get dport stats"
279  },
280  {"diag-loopback-tests", elxu_cmd_diag_loopback_tests, NULL, NULL, NULL,
281  "diag-loopback-tests [-d <devicenum>] [--host <hostname>] [--loopback_type <loopback type> --retry_count <No of times to re-run loopback test>]",
282  "Run diagnostic loopback tests with specificed loopback type\n1 - Internal loopback\n2 - External loopback\n3 - PCI loopback"
283  },
284  {"read-rev", elxu_cmd_read_rev, NULL, NULL, NULL,
285  "read-rev [-d <devicenum>] [--host <hostname>]",
286  "Report device HW and FW revisions"
287  },
288  {"driver-dump", elxu_cmd_driver_dump, NULL, NULL, NULL,
289  "driver-dump [-d <devicenum>] [--wqes] [--cqes] [--mqes] [--rqes] [--eqes] [--qentries <entries to dump>] [--host <hostname>] [--bufsize <buffer size>] [--saved] [--clrsaved]",
290  "Retrieve driver debug information for device."
291  },
292  {"mgmt-info", elxu_cmd_mgmt_info, NULL, NULL, NULL,
293  "mgmt-info [-d <devicenum>] [--host <hostname>]",
294  "Retrieve driver management information for device"
295  },
296  {"connection-info", elxu_cmd_connection_info, NULL, NULL, NULL,
297  "connection-info [-d <devicenum>] [--host <hostname>] [--connection-handle <handle>]",
298  "If a connection handle is provided, reports information on that\n"
299  "connection. If no connection handle is provided, displays a list\n"
300  "of open connections."
301  },
302  {"iclusttgt", elxu_cmd_iclusttgt, NULL, NULL, NULL,
303  "iclusttgt [-d <devicenum>] <add/del/clear/show>",
304  "\niSCSI cluster target table will have other targets\n"
305  "within the same network entity. "
306  "Target will send this list of items to\n"
307  "initiator during send targets discovery phase.\n"
308  "Supported sub-commands:\n"
309  "\tadd <target-name> <target-address>\n"
310  "\tdel <target-name> <target-address>\n"
311  "\tshow\n"
312  "\tclear"
313  },
314  {"route", elxu_cmd_route, NULL, NULL, NULL,
315  "route <--add|--del|--show> [ip-address] [net mask] [gateway]"
316  " [-d <devicenum>] [--host <hostname>]",
317  "Add or delete routing table entry.\n"
318  "route <--add|--del> requires following sub-options\n"
319  "<ip-address> IP address to add to the route table\n"
320  "<net mask> Subnet mask to add to the route table\n"
321  "<gateway> Gateway to add to the route table\n"
322  },
323  {"vlan", elxu_cmd_vlan, NULL, NULL, NULL,
324  "vlan <--add|--del|--show> [-d <devicenum>] [--host <hostname>]",
325  "Add or delete VLAN-id to an iSCSI adapter.\n"
326  "Required sub-options format:\n"
327  "--add <vlan-id>\n"
328  "--del <vlan-id>\n"
329  "--show\n"
330  },
331  {"add-ip", elxu_cmd_add_ip, NULL, NULL, NULL,
332  "add-ip <ip address> <net mask> [--vlan-id <vlan_id>] "
333  "[-d <devicenum>] [--host <hostname>]",
334  "Add an additional IP address to an iSCSI adapter.\n"
335  "[--vlan-id <vlan_id>] Add IP address for a given vlan_id interface.\n"
336  "The IP address and net mask\n"
337  "should be in either IPv4 or IPv6 format ###.###.###.### or\n"
338  "####:####:####:####:####:####:####:####"
339  },
340  {"show-ips", elxu_cmd_show_ips, NULL, NULL, NULL,
341  "show-ips <ip version 4/6> [-d <devicenum>] [--host <hostname>]",
342  "Show the IP addresses (4 or 6) assigned to an iSCSI adapter.\n"
343  },
344  {"remove-ip", elxu_cmd_remove_ip, NULL, NULL, NULL,
345  "remove-ip <ip address> [--vlan-id <vlan_id>] [-d <devicenum>] [--host <hostname>]",
346  "Remove an IP address from an iSCSI adapter.\n"
347  "[--vlan-id <vlan_id>] Remove IP address for a given vlan_id interface.\n"
348  "The IP address should be in either IPv4 or IPv6 format ###.###.###.### or\n"
349  "####:####:####:####:####:####:####:####"
350  },
351  {"set-gateway", elxu_cmd_set_gateway, NULL, NULL, NULL,
352  "set-gateway <ip address> [-d <devicenum>] [--host <hostname>]",
353  "Set the gateway address for an iSCSI adapter. The IP address\n"
354  "should be in either IPv4 or IPv6 format ###.###.###.### or\n"
355  "####:####:####:####:####:####:####:####"
356  },
357  {"get-gateway", elxu_cmd_get_gateway, NULL, NULL, NULL,
358  "get-gateway [-d <devicenum>] [--host <hostname>]",
359  "Get the gateway address for an iSCSI adapter. The IP address\n"
360  "should be in either IPv4 or IPv6 format ###.##"
361  },
362  {"add-chap", elxu_cmd_add_chap, NULL, NULL, NULL,
363  "add-chap <name>:<secret> [-d <devicenum>] [--host <hostname>] "
364  "[--chap-type <incoming|outgoing>]",
365  "Add a chap name and secret to an iSCSI adapter.\n"
366  "--chap-type indicates whether CHAP is incoming or outgoing, default is incoming.\n"
367  },
368  {"remove-chap", elxu_cmd_remove_chap, NULL, NULL, NULL,
369  "remove-chap <name> [-d <devicenum>] [--host <hostname>] "
370  "[--chap-type <incoming|outgoing>]",
371  "Remove a chap name from an iSCSI adapter.\n"
372  "--chap-type indicates whether CHAP is incoming or outgoing, default is incoming.\n"
373  },
374  {"show-chap", elxu_cmd_show_chap_list, NULL, NULL, NULL,
375  "show-chap [-d <devicenum>] [--host <hostname>]",
376  "Show CHAP users list from an iSCSI adapter."
377  },
378  {"set-require-chap", elxu_cmd_set_require_chap, NULL, NULL, NULL,
379  "set-require-chap ( true | false )[-d <devicenum>] [--host <hostname>]",
380  "Cause the iSCIS driver to require or not require CHAP authentication."
381  },
382  {"get-require-chap", elxu_cmd_get_require_chap, NULL, NULL, NULL,
383  "get-require-chap [-d <devicenum>] [--host <hostname>]",
384  "Get the current state of the require-CHAP flag in the driver."
385  },
386  {"enable-jumbo", elxu_cmd_enable_jumbo, NULL, NULL, NULL,
387  "enable-jumbo [-d <devicenum>] [--host <hostname>]",
388  "Enable jumbo frames on an iSCSI adapter."
389  },
390  {"disable-jumbo", elxu_cmd_disable_jumbo, NULL, NULL, NULL,
391  "disable-jumbo [-d <devicenum>] [--host <hostname>]",
392  "Disable jumbo frames on an iSCSI adapter."
393  },
394  {"enable-header-digest", elxu_cmd_enable_header_digest, NULL, NULL, NULL,
395  "enable-header-digest [-d <devicenum>] [--host <hostname>]",
396  "Enable header digest on an iSCSI adapter."
397  },
398  {"disable-header-digest", elxu_cmd_disable_header_digest, NULL, NULL, NULL,
399  "disable-header-digest [-d <devicenum>] [--host <hostname>]",
400  "Disable header digest on an iSCSI adapter."
401  },
402  {"enable-data-digest", elxu_cmd_enable_data_digest, NULL, NULL, NULL,
403  "enable-data-digest [-d <devicenum>] [--host <hostname>]",
404  "Enable data digest on an iSCSI adapter."
405  },
406  {"disable-data-digest", elxu_cmd_disable_data_digest, NULL, NULL, NULL,
407  "disable-data-digest [-d <devicenum>] [--host <hostname>]",
408  "Disable data digest on an iSCSI adapter."
409  },
410  {"set-tcp-window-size", elxu_cmd_set_tcp_window_size, NULL, NULL, NULL,
411  "set-tcp-window-size <size> [-d <devicenum>] [--host <hostname>]",
412  "Set the TCP window size on an iSCSI adapter."
413  },
414  {"get-tcp-window-size", elxu_cmd_get_tcp_window_size, NULL, NULL, NULL,
415  "get-tcp-window-size [-d <devicenum>] [--host <hostname>]",
416  "Get the TCP window size from an iSCSI adapter."
417  },
418  {"set-tcp-window-scale", elxu_cmd_set_tcp_window_scale, NULL, NULL, NULL,
419  "set-tcp-window-scale <scale> [-d <devicenum>] [--host <hostname>]",
420  "Set the TCP window scale on an iSCSI adapter."
421  },
422  {"get-tcp-window-scale", elxu_cmd_get_tcp_window_scale, NULL, NULL, NULL,
423  "get-tcp-window-scale [-d <devicenum>] [--host <hostname>]",
424  "Get the TCP window scale from an iSCSI adapter."
425  },
426  {"set-max-connections", elxu_cmd_set_max_connections, NULL, NULL, NULL,
427  "set-max-connections <max_connections> [-d <devicenum>] [--host <hostname>]",
428  "Set the maximum connections per session on an iSCSI adapter."
429  },
430  {"get-max-connections", elxu_cmd_get_max_connections, NULL, NULL, NULL,
431  "get-max-connections [-d <devicenum> [--host <hostname>]",
432  "Get the maximum connections per session from an iSCSI adapter."
433  },
434  {"start-listen", elxu_cmd_start_listen, NULL, NULL, NULL,
435  "start-listen <ip-address> [-d <devicenum>] [--host <hostname>]",
436  "Start listening for connections on an existing IP address on an iSCSI adapter."
437  },
438  {"stop-listen", elxu_cmd_stop_listen, NULL, NULL, NULL,
439  "stop-listen <ip-address> [-d <devicenum>] [--host <hostname>]",
440  "Stop listening for connections on an existing IP address on an iSCSI adapter."
441  },
442 #if 0
443  /*
444  * The set-mac command is removed temporarily due to a firmware bug
445  * which is preventing the command from working properly.
446  */
447  {"set-mac", elxu_cmd_set_mac_ocs, NULL, NULL, NULL,
448  "set-mac <mac_address> [-d <devicenum>] [--host <hostname>]",
449  "Soft assign MAC address. The MAC address should be in the\n"
450  "format ##:##:##:##:##:##"
451  },
452 #endif
453  {"set-nv-mac", NULL, elxu_cmd_set_nv_mac_pt, NULL, NULL,
454  "set-nv-mac <mac_address> [-d <devicenum>] [--host <hostname>]",
455  "Set permanent MAC address. The MAC address should be in the\n"
456  "format ##:##:##:##:##:##"
457  },
458  {"show-mac", elxu_cmd_show_mac_ocs, elxu_cmd_show_mac_pt, NULL, NULL,
459  "show-mac [-d <devicenum>] [--host <hostname>]",
460  "Show the MAC address for a device."
461  },
462  {"show-wwn", elxu_cmd_show_wwn, elxu_cmd_show_wwn, NULL, NULL,
463  "show-wwn [-d <devicenum>] [--host <hostname>]",
464  "Show the worldwide names for a device."
465  },
466  {"set-wwn", elxu_cmd_set_wwn, elxu_cmd_set_wwn, NULL, NULL,
467  "set-wwn (--wwpn <WWN> | --wwnn <WWN>) [-d <devicenum>] [--host <hostname>]",
468  "Set the worldwide node name or worldwide port name or both for a device.\n"
469  "The WWN should be in the format ##:##:##:##:##:##:##:##"
470  },
471  {"create-vport", elxu_cmd_create_vport, NULL, NULL, NULL,
472  "create-vport [<wwnn> <wwpn>] (--target | --initiator) [-d <devicenum>] [--host <hostname>]",
473  "Create an NPIV vport. Worldwide names, if provided, should be\n"
474  "in the format: ##:##:##:##:##:##:##:##. Example: 10:00:00:00:c9:01:02:03\n"
475  "If worldwide names are omitted they will be assigned by the firmware\n"
476  "Either --target, --initiator, or both must be specified"
477  },
478  {"remove-vport", elxu_cmd_remove_vport, NULL, NULL, NULL,
479  "remove-vport <wwnn> <wwpn> [-d <devicenum>] [--host <hostname>]",
480  "Remove an NPIV vport.\n"
481  "Worldwide names should be "
482  "in the format: ##:##:##:##:##:##:##:##.\nExample: 10:00:00:00:c9:01:02:03"
483  },
484  {"linkcfg-set", elxu_cmd_set_linkcfg, elxu_cmd_set_linkcfg, NULL, NULL,
485  "linkcfg-set [-d <devicenum>] [--host <hostname>] --linkcfg <link config>",
486  "Set link configuration. Where <link config> is: "
494  },
495  {"linkcfg-get", elxu_cmd_get_linkcfg, elxu_cmd_get_linkcfg, NULL, NULL,
496  "linkcfg-get [-d <devicenum>] [--host <hostname>]",
497  "Display link configuration."
498  },
499  {"linkspeed-set", elxu_cmd_set_linkspeed, NULL, NULL, NULL,
500  "linkspeed-set [-d <devicenum>] [--host <hostname>] --linkspeed <link speed>",
501  "Set link speed where <link speed > is:"
502  "0 - Auto | 1000 - 10G | 2000 - 2G | 4000 - 4G | 8000 - 8G | 16000 - 16G | 32000 - 32G"
503  },
504  {"linkspeed-get", elxu_cmd_get_linkspeed, NULL, NULL, NULL,
505  "linkspeed-get [-d <devicenum>] [--host <hostname>]",
506  "Display link speed."
507  },
508  {
509  "linktopology-set", elxu_cmd_set_linktopology, NULL, NULL, NULL,
510  "linktopology-set [-d <devicenum>] [--host <hostname>] --linktopology <link topology",
511  "Set link topology where <link topology > is:"
512  "0 - Auto | 1 - NPORT | 2 - LOOP."
513  },
514  {"linktopology-get", elxu_cmd_get_linktopology, NULL, NULL, NULL,
515  "linktopology-get [-d <devicenum>] [--host <hostname>]",
516  "Display link topology."
517  },
518  {"get-profile-list", elxu_cmd_get_profile_list, elxu_cmd_get_profile_list_pt, NULL, NULL,
519  "get-profile-list [-d <devicenum>] [--host <hostname>]",
520  "Get list of available profiles."
521  },
522  {"get-active-profile", elxu_cmd_get_active_profile, elxu_cmd_get_active_profile_pt, NULL, NULL,
523  "get-active-profile [-d <devicenum>] [--host <hostname>]",
524  "Get currently active profile."
525  },
526  {"set-active-profile", elxu_cmd_set_active_profile, elxu_cmd_set_active_profile_pt, NULL, NULL,
527  "set-active-profile --profile-id <profile_id> [-d <devicenum>] [--host <hostname>]",
528  "Change the active profile."
529  },
530  {"get-port-protocol", elxu_cmd_get_port_protocol, NULL, NULL, NULL,
531  "get-port-protocol [-d <devicenum>] [--host <hostname>]",
532  "Get the current protocol for the port"
533  },
534  {"set-port-protocol", elxu_cmd_set_port_protocol, NULL, NULL, NULL,
535  "set-port-protocol [-d <devicenum>] [--host <hostname>] --protocol (iscsi | fcoe)",
536  "Sets the protocol for a Skyhawk port"
537  },
538  {"firmware-reset", elxu_cmd_firmware_reset, elxu_cmd_firmware_reset_pt, NULL, NULL,
539  "firmware-reset [-d <devicenum>] [--host <hostname>]",
540  "Generate a firmware reset on the HBA"
541  },
542  {"port-migration", elxu_cmd_port_migration, NULL, NULL, NULL,
543  "port-migration [-d <devicenum>] [--host <hostname>]",
544  "Port migration on specific physical port of HBA"
545  },
546  {"get-parity-stats", elxu_cmd_get_parity_stats, NULL, NULL, NULL,
547  "get-parity-stats [-d <devicenum>] [--host <hostname>] [--cc]",
548  "Retrieve ITCM parity stats and clear the counters optionally"
549  },
550  {"unload", elxu_cmd_unload, NULL, NULL, NULL,
551  "unload [--host <hostname>]",
552  "gracefully unload a user space driver"
553  },
554  {"node-abort-cnt", elxu_cmd_node_abort_cnt, NULL, NULL, NULL,
555  "node-abort-cnt [-d <devicenum>] [--host <hostname>]",
556  "Retrieve sum of the aborts for all ocs/domain/port/nodes."
557  },
558  {"fw-diag-log", elxu_cmd_fw_diagnostic_log, NULL, NULL, NULL,
559  "fw-diag-log [-d <devicenum>] [--host <hostname>] [-f <filename>]",
560  "Extract host buffer based firmware diagnostic logs to a file"
561  },
562  {"get-fdmi-hba-list", elxu_cmd_get_fdmi_hba_list, NULL, NULL, NULL,
563  "get-fdmi-hba-list [-d <devicenum>] [--host <hostname>]",
564  "Retrieve list of FDMI HBA identifiers from switch."
565  },
566  {"get-fdmi-hba-info", elxu_cmd_get_fdmi_hba_info, NULL, NULL, NULL,
567  "get-fdmi-hba-info [-d <devicenum>] [--host <hostname>] --hba_identifier"
568  "<HBA identifier Name>",
569  "Retrieve HBA info which matches with HBA identifier from switch."
570  },
571  {"get-fdmi-port-list", elxu_cmd_get_fdmi_port_list, NULL, NULL, NULL,
572  "get-fdmi-port-list [-d <devicenum>] [--host <hostname>] --hba_identifier"
573  "<HBA identifier Name>",
574  "Retrieve list of FDMI port identifiers exists in HBA identifier from switch"
575  },
576  {"get-fdmi-port-info", elxu_cmd_get_fdmi_port_info, NULL, NULL, NULL,
577  "get-fdmi-port-info [-d <devicenum>] [--port_identifier <port identifier name>]",
578  "Retrieve FDMI Port attribute info which matches with port name"
579  },
580  {"set-trunk-mode", elxu_cmd_set_trunk_mode, NULL, NULL, NULL,
581  "set-trunk-mode [-d <devicenum>] [--mode <trunk mode>]",
582  "Set trunk mode\n\t0: Disabled\n\t1: 2 links per trunk\n\t2: 4 links per trunk"
583  },
584  {"show-trunk-config", elxu_cmd_get_trunk_config, NULL, NULL, NULL,
585  "show-trunk-config [-d <devicenum>]",
586  "show trunk config"
587  },
589  "help [<command>]",
590  "Show usage information for a command"
591  }
592 };
593 
594 #endif
int elxu_cmd_node_abort_cnt(int argc, char **argv)
Command handler for the node-abort-cnt command.
int elxu_cmd_help(int argc, char **argv)
Command handler for the help command.
#define OCS_CONFIG_LINKCFG_4X10G
linkcfg strings
Definition: ocs_ioctl.h:472
int elxu_cmd_disable_data_digest(int argc, char **argv)
Command handler for the disable-data-digest command.
int elxu_cmd_set_nv_mac_pt(int argc, char **argv)
Command handler for the set-nv-mac command.
int elxu_cmd_read_rev(int argc, char **argv)
Command handler for the read-rev command.
int elxu_cmd_show_mac_pt(int argc, char **argv)
Command handler for the show-mac command for the elx_pt driver.
int elxu_cmd_driver_info(int argc, char **argv)
Command handler for the driver-info command.
int elxu_cmd_set_gateway(int argc, char **argv)
Command handler for the set-gateway command.
int elxu_cmd_set_active_profile(int argc, char **argv)
Command handler for the set-active-profile command.
int elxu_cmd_set_mac_ocs(int argc, char **argv)
Command handler for the set-mac command.
int elxu_cmd_sfp(int argc, char **argv)
Command handler for the sfp command.
int elxu_cmd_diag_loopback_tests(int argc, char **argv)
int elxu_cmd_set_tcp_window_size(int argc, char **argv)
Command handler for the set-tcp-window-size command.
int elxu_cmd_get_profile_list(int argc, char **argv)
Command handler for the get-profile-list command.
int elxu_cmd_firmware_reset(int argc, char **argv)
Command handler for the firmware-reset command.
int elxu_cmd_remove_ip(int argc, char **argv)
Command handler for the remove-ip command.
int elxu_cmd_remove_vport(int argc, char **argv)
Command handler for the remove-vport command.
int elxu_cmd_add_chap(int argc, char **argv)
Command handler for the add-chap command.
int elxu_cmd_set_active_profile_pt(int argc, char **argv)
Command handler for the set-active-profile command for the elx_pt driver.
int elxu_cmd_get_fdmi_hba_list(int argc, char **argv)
Command handler for the elxu_cmd_get_fdmi_hba_list command.
#define OCS_CONFIG_LINKCFG_1X40G
Definition: ocs_ioctl.h:473
int elxu_cmd_start_listen(int argc, char **argv)
Command handler for start-listen.
int elxu_cmd_enable_data_digest(int argc, char **argv)
Command handler for enable-data-digest.
int elxu_cmd_delayed_ack_timer(int argc, char **argv)
Command handler for the delayed-ack-timer command.
char * syntax
Definition: elxu_commands.h:53
int elxu_cmd_gendump(int argc, char **argv)
Command handler for the gendump command.
int elxu_cmd_read(int argc, char **argv)
Command handler for the read command.
int elxu_cmd_set_linkcfg(int argc, char **argv)
Command handler for the linkcfg-set command.
int elxu_cmd_get_linkspeed(int argc, char **argv)
Command handler for the linkspeed-get command.
int elxu_cmd_show_ips(int argc, char **argv)
Command handler for the show-ips command.
int elxu_cmd_list(int argc, char **argv)
Command handler for the list command.
int elxu_cmd_dump_to_host(int argc, char **argv)
Command handler for the dump command.
int elxu_cmd_dump(int argc, char **argv)
Command handler for the dump command.
int elxu_cmd_file_info(int argc, char **argv)
Command handler for the file-info command.
int elxu_cmd_get_tcp_window_size(int argc, char **argv)
Command handler for get-tcp-window-size.
#define OCS_CONFIG_LINKCFG_4X8G
Definition: ocs_ioctl.h:475
Definition: elxu_commands.h:47
int elxu_cmd_set_tcp_window_scale(int argc, char **argv)
Command handler for set-tcp-window-scale.
int elxu_cmd_set_dport_dynamic_mode(int argc, char **argv)
int elxu_cmd_get_linktopology(int argc, char **argv)
Command handler for the linktopology-get command.
int elxu_cmd_get_gateway(int argc, char **argv)
Command handler for the get-gateway command.
handler_t nodriver_handler
Definition: elxu_commands.h:52
int elxu_cmd_get_trunk_config(int argc, char **argv)
Command handler for elxu_cmd_get_trunk_config command.
int elxu_cmd_set_require_chap(int argc, char **argv)
Command handler for set-require-chap.
int elxu_cmd_objenum(int argc, char **argv)
Command handler for the objenum command.
int elxu_cmd_unload(int argc, char **argv)
Command handler for user space driver unload.
int elxu_cmd_disable_jumbo(int argc, char **argv)
Command handler for the disable-jumbo command.
int elxu_cmd_get_active_profile_pt(int argc, char **argv)
Command handler for the get-active-profile command for the elx_pt driver.
int elxu_cmd_driver_dump(int argc, char **argv)
Command handler for the driver-dump command.
int elxu_cmd_set_linktopology(int argc, char **argv)
Command handler for the linktopology-set command.
int elxu_cmd_port_migration(int argc, char **argv)
Command handler for the port-migration command.
int elxu_cmd_constrain_window(int argc, char **argv)
Command handler for the constrain-window command.
int elxu_cmd_enable_jumbo(int argc, char **argv)
Command handler for the enable-jumbo command.
static cmd_table_entry_t cmd_table[]
int elxu_cmd_get_linkcfg(int argc, char **argv)
Command handler for the linkcfg-get command.
int elxu_cmd_show_chap_list(int argc, char **argv)
Command handler for show-chap.
int elxu_cmd_create_vport(int argc, char **argv)
Command handler for the create-vport command.
int elxu_cmd_stop_listen(int argc, char **argv)
Command handler for stop-listen.
int elxu_cmd_fw_diagnostic_log(int argc, char **argv)
Command handler for the fw-diag-log command.
int elxu_cmd_mgmt_info(int argc, char **argv)
Command handler for the mgmt-info command.
#define OCS_CONFIG_LINKCFG_4X1G
Definition: ocs_ioctl.h:476
int elxu_cmd_ack_frequency(int argc, char **argv)
Command handler for the ack-frequency command.
char * name
Definition: elxu_commands.h:48
int elxu_cmd_board_temp(int argc, char **argv)
Command handler for the board temperature.
int elxu_cmd_get_fdmi_port_list(int argc, char **argv)
Command handler for the elxu_cmd_get_fdmi_port_list command.
int elxu_cmd_set_linkspeed(int argc, char **argv)
Command handler for the link-speed-set command.
int elxu_cmd_read_link_status(int argc, char **argv)
Command handler for the read-link-status command.
int elxu_cmd_cmp(int argc, char **argv)
Command handler for the cmp command.
#define OCS_CONFIG_LINKCFG_2X16G
Definition: ocs_ioctl.h:474
int elxu_cmd_set_wwn(int argc, char **argv)
Command handler for the set-wwn command.
int elxu_cmd_set_max_connections(int argc, char **argv)
Command handler for set-max-connections.
int elxu_cmd_get_profile_list_pt(int argc, char **argv)
Command handler for the get-profile-list command for the elx_pt driver.
handler_t pt_handler
Definition: elxu_commands.h:50
int elxu_cmd_efdc(int argc, char **argv)
Command handler for the efdc command.
int elxu_cmd_add_ip(int argc, char **argv)
Command handler for the add-ip command.
#define OCS_CONFIG_LINKCFG_2X10G
Definition: ocs_ioctl.h:477
int elxu_cmd_read_status(int argc, char **argv)
Command handler for the read-status command.
handler_t nodev_handler
Definition: elxu_commands.h:51
int elxu_cmd_get_max_connections(int argc, char **argv)
Command handler for get-max-connections.
int elxu_cmd_get_fdmi_port_info(int argc, char **argv)
Command handler for the elxu_cmd_get_fdmi_port_info command.
void usage()
Show program usage.
int elxu_cmd_remove_chap(int argc, char **argv)
Command handler for remove-chap.
int elxu_cmd_set_port_protocol(int argc, char **argv)
Command handler for the set-port-protocol command.
int elxu_cmd_get_dynamic_dport_status(int argc, char **argv)
int elxu_cmd_vlan(int argc, char **argv)
Command handler for the vlan command.
int elxu_cmd_get_dport_stats(int argc, char **argv)
Command handler for the get-dport-stats command.
int elxu_cmd_get_fdmi_hba_info(int argc, char **argv)
Command handler for the elxu_cmd_get_fdmi_hba_info command.
int elxu_cmd_disable_header_digest(int argc, char **argv)
Command handler for the disable-header-digest comand.
int elxu_cmd_get_active_profile(int argc, char **argv)
Command handler for the get-active-profile command.
int elxu_cmd_iclusttgt(int argc, char **argv)
int(* handler_t)(int, char **)
Definition: elxu_commands.h:45
int elxu_cmd_show_mac_ocs(int argc, char **argv)
Command handler for the show-mac command for the OCS drivers.
int elxu_cmd_connection_info(int argc, char **argv)
Command handler for the connection-info command.
int elxu_cmd_enable_header_digest(int argc, char **argv)
Command handler for enable-header-digest.
handler_t ocs_handler
Definition: elxu_commands.h:49
int elxu_cmd_get_parity_stats(int argc, char **argv)
Command handler for the get-parity-stats command.
int elxu_cmd_show_wwn(int argc, char **argv)
Command handler for the show-wwn command.
int elxu_cmd_version(int argc, char **argv)
Command handler for the version command.
int elxu_cmd_write(int argc, char **argv)
Command handler for the write command.
#define OCS_CONFIG_LINKCFG_2X10G_2X8G
Definition: ocs_ioctl.h:478
int elxu_cmd_get_require_chap(int argc, char **argv)
Command handler for get-require-chap.
int elxu_cmd_firmware_reset_pt(int argc, char **argv)
Send a firmware reset via the elx_pt driver.
int elxu_cmd_route(int argc, char **argv)
Command handler for the route command.
int elxu_cmd_get_tcp_window_scale(int argc, char **argv)
Command handler for get-tcp-window-scale.
int elxu_cmd_get_port_protocol(int argc, char **argv)
Command handler for the get-port-protocol command.
char * help_text
Definition: elxu_commands.h:54
int elxu_cmd_set_trunk_mode(int argc, char **argv)
Command handler for elxu_cmd_set_trunk_mode command.