48 #include <sys/ioctl.h>
59 #include "elx_pt_ioctl.h"
63 #define PORTSPEED_1GFC 0x00000001
64 #define PORTSPEED_2GFC 0x00000002
65 #define PORTSPEED_4GFC 0x00000008
66 #define PORTSPEED_8GFC 0x00000010
67 #define PORTSPEED_16GFC 0x00000020
68 #define PORTSPEED_32GFC 0x00000040
69 #define PORTSPEED_64GFC 0x00000400
70 #define PORTSPEED_128GFC 0x00000200
71 #define PORTSPEED_UNKNOWN 0x00008000
81 #define ETH_FC_AUTO "0"
82 #define ETH_FC_10G "1000"
86 #define FC_16G "16000"
87 #define FC_32G "32000"
107 #define OCS_MAX_SLI_PORTS_PER_DEVICE 4
109 #define OCS_FC_TRUNK_2_PORT_CONFIG 0x30
110 #define OCS_FC_TRUNK_2_PORT_HI_CONFIG 0xC0
111 #define OCS_FC_TRUNK_4_PORT_CONFIG 0xF0
113 #define OCS_FC_TRUNK_CONFIG_MASK 0xF0
114 #define OCS_FC_TRUNK_LINK_STATE_MASK 0x0F
118 typedef struct elx_sfp_transceiver_data_A0_s {
122 uint8_t transceiver[8];
132 char vendor_name[16];
134 uint8_t vendor_oui[3];
137 uint8_t wavelength[2];
144 uint8_t date_code[8];
149 uint8_t vendor_specific[32];
187 fprintf(stderr,
"Filename is required\n");
196 if (options.
file == NULL) {
197 fprintf(stderr,
"Filename missing\n");
201 printf(
"file: %s \n", options.
file);
259 char *objname = NULL;
263 fprintf(stderr,
"objname is required\n");
273 if (objname == NULL) {
274 printf (
"Missing object name argument\n");
280 fprintf(stderr,
"readobj is only supported on Lancer/Prism\n");
315 if (options.
device == NULL) {
316 fprintf(stderr,
"Unable to open device\n");
320 if (options.
file == NULL) {
321 fprintf(stderr,
"Filename missing\n");
378 if (options.
device == NULL) {
379 fprintf(stderr,
"Unable to open device\n");
383 if (options.
file == NULL) {
384 fprintf(stderr,
"Filename missing\n");
419 if (options.
device == NULL) {
420 fprintf(stderr,
"Unable to open device\n");
427 fprintf(stderr,
"Dump type option does not apply to Lancer/Prism\n");
437 fprintf(stderr,
"Choose no more than one of --fat, --efd, --ecd, or --ecdtest\n");
442 }
else if (options.
fat) {
460 fprintf(stderr,
"ECD dump not supported with user space driver.\n");
467 fprintf(stderr,
"No dump type selected\n");
501 if (options.
device == NULL) {
502 fprintf(stderr,
"Unable to open device\n");
507 fprintf(stderr,
"efdc is only supported on Skyhwawk\n");
543 if (options.
device == NULL) {
544 fprintf(stderr,
"Unable to open device\n");
549 fprintf(stderr,
"objenum is only supported on Lancer/Prism\n");
555 for (obj = objlist; obj; obj=obj->
next, cnt++) {
557 printf (
"[%2d] %-20s ......... %6d\n",
560 printf (
"[%2d] %-20s \n", cnt, obj->
name);
568 char *identify =
"UNKNOWN";
571 identify =
"Unknown";
577 identify =
"Module/connector soldered to motherboard ";
583 identify =
"300 pin XBI";
595 identify =
"Refer Spec";
602 char *identify =
"UNKNOWN";
606 identify =
"Unknown";
612 identify =
"Fibre Channel Style 1 copper connector";
615 identify =
"Fibre Channel Style 2 copper connector";
618 identify =
"BNC/TNC";
621 identify =
"Fibre Channel coaxial headers";
624 identify =
"FiberJack";
630 identify =
"Refer Spec";
642 identify =
"SFF-8079";
647 identify =
"SFF-8431";
651 identify =
"FC-PI-5";
654 identify =
"Unspecified";
665 identify =
"Unspecified";
677 identify =
"Manchester";
680 identify =
"SONET Scrambled";
683 identify =
"64B/66B";
686 identify =
"Unspecified";
697 if (resp_buff == NULL) {
706 printf(
"Get board temperature failed\n");
720 printf(
"Device %d temperature details - \n", device->
deviceIndex);
721 printf(
"\tCurrent temperature: \t %d degrees\n\n", resp_buff[0]);
722 printf(
"\tCritical temperature threshold:\t %d degrees\n", resp_buff[1]);
723 printf(
"\tWarning temperature threshold: \t %d degrees\n", resp_buff[2]);
758 printf(
"boardtemp is only supproted on Lancer\n");
763 printf(
"boardtemp is not supported with the user space driver\n");
805 if (options.
device == NULL) {
806 fprintf(stderr,
"Unable to open device\n");
811 if ((strcmp(value,
"no-sfp") == 0)) {
812 printf(
"Warning: No SFP module present on this device.\n");
814 if ((strlen(value) != 0) && (strcmp(value,
"(unknown)") != 0) && (strcmp(value,
"no-sfp") != 0)) {
815 d = transceiver_buffer;
817 while (isalnum(*s)) {
818 *d = (uint8_t) strtoul(s, NULL, 16);
824 dump8(
"Hex information from page 0xA0 ---\n", transceiver_buffer,
834 printf(
"\n\nSFP Transceiver data\n");
835 printf(
"==============================================================================\n");
837 printf(
"Ext Identifier: : 0x%x(%s)\n", a0_page_info.
ext_identifier,
838 (a0_page_info.
ext_identifier == 0x4) ?
"non-custom SFP, SFP+ and GBIC module":
"Unknown");
840 printf(
"Transceiver codes : 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n",
844 printf(
"FC Transceiver Speed : ");
845 for (i = 0; i < 8; i++) {
849 printf(
"100 MBytes/sec ");
852 printf(
"Unallocated ");
855 printf(
"200 MBytes/sec ");
858 printf(
"3200 MBytes/sec ");
861 printf(
"400 MBytes/sec ");
864 printf(
"1600 MBytes/sec ");
867 printf(
"800 MBytes/sec ");
870 printf(
"1200 MBytes/sec ");
880 printf(
"BR, Nominal : 0x%x\n", a0_page_info.
br_nominal);
882 printf(
"Length(9um,km) : 0x%x\n", a0_page_info.
length_9um_km);
883 printf(
"Length(9um) : 0x%x\n", a0_page_info.
length_9um);
884 printf(
"Length(50um) : 0x%x\n", a0_page_info.
length_50um);
886 printf(
"Length(Copper) : 0x%x\n", a0_page_info.
len_copper);
887 printf(
"Length(OM3) : 0x%x\n", a0_page_info.
length_om3);
888 printf(
"Vendor name : ");
892 printf(
"\nVendor PN : ");
893 for (i = 0; i<16; i++)
895 printf(
"\nVendor Revision : ");
896 for (i = 0; i<4; i++)
898 printf(
"\nOption values : 0x%x 0x%x\n", a0_page_info.
options[0], a0_page_info.
options[1]);
899 printf(
"BR margin, max : %d%s\n", a0_page_info.
br_max,
" %");
900 printf(
"BR margin, min : %d%s\n", a0_page_info.
br_min,
" %");
901 printf(
"Vendor SN : ");
902 for (i = 0; i<16; i++)
904 printf(
"\nDate code : ");
905 for (i = 0; i<8; i++)
907 printf(
"\nOptical diagnostics support : %s", (a0_page_info.
diag_monitor_type & 1 << 6) ?
"Yes":
"No");
908 printf(
"\n==============================================================================\n");
913 if ((strlen(value) != 0) && (strcmp(value,
"(unknown)") != 0)) {
914 d = transceiver_buffer;
916 while (isalnum(*s)) {
917 *d = (uint8_t) strtoul(s, NULL, 16);
923 dump8(
"Hex information from page 0xA2 ---\n", transceiver_buffer,
927 float temp_high,temp_low,vcc_high,vcc_low,tx_bias_high,tx_bias_low;
928 float tx_power_high,tx_power_low,rx_power_high,rx_power_low;
929 float temp_high_warn,temp_low_warn,vcc_high_warn,vcc_low_warn,tx_bias_high_warn,tx_bias_low_warn;
930 float tx_power_high_warn,tx_power_low_warn,rx_power_high_warn,rx_power_low_warn;
931 float temperature,vcc,tx_bias_current,tx_power,rx_power;
933 temp_high = ((transceiver_buffer[0] << 8) | transceiver_buffer[1])/(float)256;
934 temp_low = ((transceiver_buffer[2] << 8) | transceiver_buffer[3])/(float)256;
935 temp_high_warn = ((transceiver_buffer[4] << 8) | transceiver_buffer[5])/(float)256;
936 temp_low_warn = ((transceiver_buffer[6] << 8) | transceiver_buffer[7])/(float)256;
938 vcc_high = ((transceiver_buffer[8] << 8) | transceiver_buffer[9]) * (float)100 / 1000000;
939 vcc_low = ((transceiver_buffer[10] << 8) | transceiver_buffer[11]) * (float)100 / 1000000;
940 vcc_high_warn = ((transceiver_buffer[12] << 8) | transceiver_buffer[13]) * (float)100 / 1000000;
941 vcc_low_warn = ((transceiver_buffer[14] << 8) | transceiver_buffer[15]) * (float)100 / 1000000;
943 tx_bias_high = ((transceiver_buffer[16] << 8) | transceiver_buffer[17]) * (float)2 / 1000;
944 tx_bias_low = ((transceiver_buffer[18] << 8) | transceiver_buffer[19]) * (float)2 / 1000;
945 tx_bias_high_warn = ((transceiver_buffer[20] << 8) | transceiver_buffer[21]) * (float)2 / 1000;
946 tx_bias_low_warn = ((transceiver_buffer[22] << 8) | transceiver_buffer[23]) * (float)2 / 1000;
948 tx_power_high = ((transceiver_buffer[24] << 8) | transceiver_buffer[25]) * (float)0.1 / 1000;
949 tx_power_low = ((transceiver_buffer[26] << 8) | transceiver_buffer[27]) * (float)0.1 / 1000;
950 tx_power_high_warn = ((transceiver_buffer[28] << 8) | transceiver_buffer[29]) * (float)0.1 / 1000;
951 tx_power_low_warn = ((transceiver_buffer[30] << 8) | transceiver_buffer[31]) * (float)0.1 / 1000;
953 rx_power_high = ((transceiver_buffer[32] << 8) | transceiver_buffer[33]) * (float)0.1 / 1000;
954 rx_power_low = ((transceiver_buffer[34] << 8) | transceiver_buffer[35]) * (float)0.1 / 1000;
955 rx_power_high_warn = ((transceiver_buffer[36] << 8) | transceiver_buffer[37]) * (float)0.1 / 1000;
956 rx_power_low_warn = ((transceiver_buffer[38] << 8) | transceiver_buffer[39]) * (float)0.1 / 1000;
958 printf(
"== Threshold data ==\n");
959 printf(
"Temperature : -%f C(low) - %f C(high)\n", temp_low, temp_high);
960 printf(
"Voltage : %f V(low) - %f V(high)\n", vcc_low, vcc_high);
961 printf(
"TX Bias Current : %f mA(low) - %f mA(high)\n", tx_bias_low, tx_bias_high);
962 printf(
"TX Power : %f mW(low) - %f mW(high)\n", tx_power_low, tx_power_high);
963 printf(
"RX Power : %f mW(low) - %f mW(high)\n\n", rx_power_low, rx_power_high);
965 printf(
"== Threshold warnings data ==\n");
966 printf(
"Temperature : %f (low) - %f (high)\n", temp_low_warn, temp_high_warn);
967 printf(
"Voltage : %f V(low) - %f V(high)\n", vcc_low_warn, vcc_high_warn);
968 printf(
"TX Bias Current : %f mA(low) - %f mA(high)\n", tx_bias_low_warn, tx_bias_high_warn);
969 printf(
"TX Power : %f mW(low) - %f mW(high)\n", tx_power_low_warn, tx_power_high_warn);
970 printf(
"RX Power : %f mW(low) - %f mW(high)\n\n", rx_power_low_warn, rx_power_high_warn);
972 temperature = ((transceiver_buffer[96] << 8) | transceiver_buffer[97])/(float)256;
973 vcc = ((transceiver_buffer[98] << 8) | transceiver_buffer[99]) * (float)100 / 1000000;
974 tx_bias_current = ((transceiver_buffer[100] << 8) | transceiver_buffer[101]) * (float)2 / 1000;
975 tx_power = ((transceiver_buffer[102] << 8) | transceiver_buffer[103]) * (float)0.1 / 1000;
976 rx_power = ((transceiver_buffer[104] << 8) | transceiver_buffer[105]) * (float)0.1 / 1000;
977 printf(
"== Current SFP diagnostic data ==\n");
978 printf(
"Temperature: %f C \nSupply Voltage: %f V\n", temperature, vcc);
979 printf(
"TX Bias Current: %f mA\nTX Power: %f mW\nRX power: %f mW\n\n",
980 tx_bias_current, tx_power, rx_power);
1016 printf (
"gendump is only supported on Lancer/Prism\n");
1049 fprintf(stderr,
"FW diagnostic logging is only supported for FC devices.\n");
1089 printf (
"dump-to-host is only supported on Lancer/Prism\n");
1094 printf(
"dump-to-host is not supported with the user space driver\n");
1099 pci_func = strrchr(pci_dev,
'.') + 1;
1100 if (!options.
fdb_dump && strcmp(pci_func,
"0") != 0) {
1101 printf(
"dump-to-host is only valid for PCI function 0, ");
1102 printf(
"device index %d corresponds to PCI function %s of device %s\n",
1136 printf (
"iSCSI does not support this command\n");
1170 printf (
"iSCSI does not support this command\n");
1188 {
"HP-F",
"QW923A",
"", 0x0C },
1189 {
"HP-A",
"QW923A",
"", 0 },
1190 {
"HP-A",
"E7Y09A",
"", 0 },
1191 {
"FINISAR CORP.",
"FTLF8529P3BCV-EM",
"B", 0 },
1192 {
"EMULEX",
"AFBR-57F5MZ-ELX",
"", 0 },
1193 {
"FINISAR CORP.",
"FTLF8532P4BCV-EM",
"", 0 },
1194 {
"AVAGO",
"AFBR-57G5MZ-ELX",
"", 0 },
1195 {
"HPE-F",
"P9H30A",
"", 0 },
1196 {
"HPE-A",
"P9H30A",
"", 0 },
1197 {
"HP-F",
"E7Y10A",
"", 0 },
1198 {
"HP-A",
"E7Y10A",
"", 0 },
1199 {
"AVAGO",
"AFCT-57F3TMZ-ELX",
"B", 0 },
1201 #define DPORT_SFP_TABLE1_LEN (sizeof(supported_table1) / sizeof(elx_dport_sfp_table1_entry))
1213 #define DPORT_SFP_TABLE2_LEN (sizeof(supported_table2) / sizeof(elx_dport_sfp_table2_entry))
1216 if ((strcmp(value,
"no-sfp") == 0)) {
1217 printf(
"Warning: No SFP module present on this device.\n");
1220 if ((strlen(value) != 0) && (strcmp(value,
"(unknown)") != 0) && (strcmp(value,
"no-sfp") != 0)) {
1221 d = transceiver_buffer;
1223 while (isalnum(*s)) {
1224 *d = (uint8_t) strtoul(s, NULL, 16);
1235 strlen(supported_table1[i].vendor)) == 0) {
1239 strlen(supported_table1[i].vendor_pn)) == 0) {
1243 strlen(supported_table1[i].vendor_rev)) == 0) ||
1255 strlen(supported_table2[i].vendor_pn)) == 0) {
1256 if ((strncmp((
char *)a0_page_info->
vendor_specific,
"Emulex Certified", strlen(
"Emulex Certified")) == 0) ||
1257 (strncmp((
char *)a0_page_info->
vendor_specific,
"Emulex.Certified", strlen(
"Emulex.Certified")) == 0)) {
1294 printf (
"iSCSI does not support this command\n");
1299 printf (
"SFP is not supported for Dport tests\n");
1312 fprintf(stderr,
"Value (enable or disable) is required\n");
1318 if ((strcasecmp(value,
"enable") != 0) &&
1319 (strcasecmp(value,
"disable") != 0)) {
1320 fprintf(stderr,
"Unexpected value '%s' - should be 'enable' or 'disable'\n", value);
1329 printf(
"iSCSI does not support this command\n");
1345 printf (
"iSCSI does not support this command\n");
1360 printf (
" Command supports only to lancer/Prism\n");
1418 fprintf(stderr,
"ACK frequency is required\n");
1422 freq = strtoul(argv[2], NULL, 0);
1429 printf(
"Setting TCP parameters is only supported on Skyhawk\n");
1461 fprintf(stderr,
"Delayed ACK timer value is required\n");
1465 freq = strtoul(argv[2], NULL, 0);
1472 printf(
"Setting TCP parameters is only supported on Skyhawk\n");
1500 uint32_t window_size;
1504 fprintf(stderr,
"Window size value is required\n");
1508 window_size = strtoul(argv[2], NULL, 0);
1515 fprintf(stderr,
"Connection ID is required\n");
1520 printf(
"Setting TCP parameters is only supported on Skyhawk\n");
1552 memset(&args, 0,
sizeof(args));
1558 if (options.
saved) {
1587 if (args.
flags == 0) {
1656 fprintf(stderr,
"connection-info is only supported on iSCSI devices.\n");
1679 (strncmp(argv[2],
"show", 4) && strncmp(argv[2],
"clear", 5)))
1683 (strncmp(argv[2],
"add", 3) && strncmp(argv[2],
"del", 3)))
1692 int num_clust_tgts = 0;
1696 char tgtportal[256];
1704 len = snprintf(in_buf,
sizeof(in_buf),
"%d", inx);
1706 in_buf, len, NULL, 0);
1711 printf(
"iclusttgt list is empty\n");
1715 num_clust_tgts = rval;
1717 printf(
"iclusttgt Show targets %d\n", num_clust_tgts);
1720 printf(
"INDEX\tTARGET NAME AND ADDRESS\n");
1722 while (inx < num_clust_tgts) {
1723 memset(out_buf, 0,
sizeof(out_buf));
1724 len = snprintf(in_buf,
sizeof(in_buf),
"%d", inx);
1726 in_buf, len, out_buf,
sizeof(out_buf));
1730 slash = strchr(out_buf,
'/');
1734 printf(
"%5d\t", inx+1);
1736 num_chars = slash - (
char *)out_buf;
1737 memcpy(tgtportal, out_buf, num_chars);
1738 tgtportal[num_chars] =
'\0';
1739 printf(
"%s ", tgtportal);
1741 num_chars = strlen(out_buf) - (num_chars + 1);
1742 memcpy(tgtportal, slash + 1, num_chars);
1743 tgtportal[num_chars] =
'\0';
1744 printf(
"%s\n", tgtportal);
1758 char *portal_portnum;
1759 char *portal_grptag;
1766 fprintf(stderr,
"Parse arguments failed on %s\n",
1772 printf(
"iclusttgt is only supported in iSCSI\n");
1777 if (strcmp(argv[1],
"-d") == 0) {
1778 for (i = 1; i < argc-1; i++)
1779 memcpy((argv+i), (argv+i)+1,
sizeof(argv[i+1]));
1784 for (i = 1; i < argc-1; i++)
1785 memcpy((argv+i), (argv+i)+1,
sizeof(argv[i+1]));
1789 }
else if (argv[1][0] ==
'-') {
1791 for (i = 1; i < argc-1; i++)
1792 memcpy((argv+i), (argv+i)+1,
sizeof(argv[i+1]));
1798 fprintf(stderr,
"Invalid number of arguments. "
1799 "Run %s help %s\n", argv[0], argv[1]);
1804 memset(parms, 0,
sizeof(parms));
1806 portal_portnum = strchr(argv[4],
':');
1807 portal_grptag = strchr(argv[4],
',');
1809 if (!portal_portnum && portal_grptag) {
1810 fprintf(stderr,
"Invalid number of arguments. "
1811 "Run %s help %s\n", argv[0], argv[1]);
1815 strcpy(ip, argv[4]);
1816 if (portal_portnum && !portal_grptag)
1817 snprintf(ip,
sizeof(ip),
"%s,%d", argv[4],
1820 if (!portal_portnum)
1821 snprintf(ip,
sizeof(ip),
"%s:%d,%d", argv[4],
1824 parmlen = snprintf(parms,
sizeof(parms),
"%s/%s",
1828 if (0 == strncmp(argv[2],
"show", 4))
1831 snprintf(cmd,
sizeof(cmd),
"/ocs/iclusttgt_%s", argv[2]);
1833 parms, parmlen, NULL, 0);
1837 perror(
"ioctl-iclusttgt");
1839 printf(
"Command %s %s is %s on device %d\n",
1840 argv[1], argv[2], (rval ?
"failed" :
"success"),
1869 char cmd_params[256];
1880 fprintf(stderr,
"Insufficient parameters\n");
1885 if ((0 == strcmp(action,
"--add")) || (0 == strcmp(action,
"--del"))) {
1887 fprintf(stderr,
"Insufficient parameters\n");
1897 fprintf(stderr,
"parse arguments failed\n");
1902 printf(
"Route table add/del is only supported in iSCSI\n");
1907 if ((0 == strcmp(action,
"--add")) || (0 == strcmp(action,
"--del"))) {
1908 param_len = snprintf(cmd_params,
sizeof(cmd_params),
"%s/%s/%s",
1909 ip_addr, netmask, gateway);
1910 snprintf(cmd,
sizeof(cmd),
"/ocs/route_%s", action+2);
1912 &cmd_params, param_len, NULL, 0);
1914 printf(
"Route %s for IP-%s/%s gateway %s is successful\n",
1915 action, ip_addr, netmask, gateway);
1917 printf(
"Route %s for IP-%s/%s gateway %s is failed\n",
1918 action, ip_addr, netmask, gateway);
1920 }
else if (0 == strcmp(action,
"--show")) {
1921 route_table = malloc(
sizeof(*route_table));
1922 if (route_table == NULL) {
1923 fprintf(stderr,
"malloc failed\n");
1927 snprintf(cmd,
sizeof(cmd),
"/ocs/route_%s", action+2);
1929 NULL, 0, route_table,
sizeof(*route_table));
1931 printf(
"Route %s failed\n", action);
1936 printf(
"Route table entries %d\n", route_table->
entry_count);
1938 printf(
"%-16s %-16s %-16s\n",
"IP",
"Subnet",
"Gateway");
1939 for (inx = 0; inx < route_table->
entry_count; inx++) {
1940 printf(
"%-16s %-16s %-16s\n",
1949 fprintf(stderr,
"Invalid command %s for route\n", action);
1979 unsigned int vlan_id;
1981 char *show_buff = NULL;
1985 fprintf(stderr,
"Insufficient parameters\n");
1990 if ((0 == strcmp(action,
"--add")) || (0 == strcmp(action,
"--del"))) {
1992 fprintf(stderr,
"Insufficient parameters\n");
1996 vlan_id = atoi(argv[3]);
1997 if (!(vlan_id >= 2 && vlan_id <= 4096)) {
1998 fprintf(stderr,
"Invalid VLAN id %d\n", vlan_id);
2001 }
else if ((0 == strcmp(action,
"--show"))) {
2004 fprintf(stderr,
"malloc failed\n");
2008 fprintf(stderr,
"Invalid parameters\n");
2013 fprintf(stderr,
"parse failed\n");
2018 printf(
"VLAN config is only supported in iSCSI\n");
2022 snprintf(cmd,
sizeof(cmd),
"/ocs/vlan_%s", action+2);
2024 &vlan_id,
sizeof(vlan_id),
2028 fprintf(stderr,
"iSCSI vlan %s is failed on device %d\n",
2033 printf(
"iSCSI vlan %s is successful on device %d\n",
2037 if ((0 == strcmp(action,
"--show"))) {
2038 printf(
"%s ", show_buff);
2044 #define ELXU_IP_GET_ADDRESS_LIST_SIZE (4096 * 2)
2047 char *ipv4_addrs = NULL;
2048 char *ipv6_addrs = NULL;
2054 fprintf(stderr,
"IPv4 malloc failed\n");
2063 printf(
"Failed to read existing IPv4 addresses\n");
2069 fprintf(stderr,
"IPv6 malloc failed\n");
2077 printf(
"Failed to read existing IPv6 addresses\n");
2081 if ((strstr(ipv4_addrs, ipaddr) != NULL) ||
2082 (strstr(ipv6_addrs, ipaddr) != NULL)) {
2118 char cmd_parms[128];
2124 fprintf(stderr,
"IP address and netmask is required\n");
2129 netmask_p = argv[3];
2135 printf(
"Add IP address is only supported in iSCSI\n");
2141 printf(
"Check IP addresses failed\n");
2146 parm_len = snprintf(cmd_parms,
sizeof(cmd_parms),
"%s/%s/%d",
2147 ipaddr_p, netmask_p, options.
vlan_id);
2151 printf(
"IP address %s added to device %d\n",
2154 printf(
"Failed to add IP address %s from device %d\n",
2158 printf(
"IP address %s is already exists\n", ipaddr_p);
2187 int32_t ip_found = 0;
2188 char cmd_parms[128];
2192 fprintf(stderr,
"IP address is required\n");
2202 printf(
"Add IP address is only supported in iSCSI\n");
2208 printf(
"Check IP addresses failed\n");
2213 parm_len = snprintf(cmd_parms,
sizeof(cmd_parms),
"%s/%d",
2216 cmd_parms, parm_len, NULL, 0);
2218 printf(
"IP address %s removed from device %d\n",
2221 printf(
"Failed to remove IP address %s from device %d\n",
2225 printf(
"IP address %s is not found\n", ipaddr_p);
2257 fprintf(stderr,
"IP address version required\n");
2261 version = strtoul(argv[2], NULL, 10);
2262 if (version != 4 && version != 6) {
2263 fprintf(stderr,
"Invalid IP version (must be 4 or 6)\n");
2272 fprintf(stderr,
"Show IPs command is only supported on iSCSI\n");
2278 fprintf(stderr,
"malloc failed\n");
2287 printf(
"IP addresses on device %d:\n%s\n",
2320 fprintf(stderr,
"IP address is required\n");
2331 printf(
"Set gateway address is only supported in iSCSI\n");
2337 printf(
"Gateway address set to %s for device %d\n", ipaddr_p, options.
device->
deviceIndex);
2339 printf(
"Failed to set gateway on from device %d, rval is %d\n", options.
device->
deviceIndex, rval);
2374 printf(
"Gateway address is only supported in iSCSI\n");
2379 if (strlen(result) != 0) {
2380 printf(
"Gateway address is %s\n", result);
2383 printf(
"Failed to get gateway from from device %d\n", options.
device->
deviceIndex);
2416 char *name_and_secret;
2419 fprintf(stderr,
"Name and secret are required\n");
2423 name_and_secret = argv[2];
2424 separator = strchr(argv[2],
':');
2425 if (separator == NULL) {
2426 fprintf(stderr,
"Name and secret must be in the format name:secret\n");
2429 username_len = separator - (
char *)argv[2];
2430 secret_len = strlen(argv[2]) - username_len - 1;
2437 printf(
"Add CHAP is only supported in iSCSI\n");
2442 if (chap_user_buff == NULL) {
2443 fprintf(stderr,
"malloc failed\n");
2447 strncpy(chap_user_buff->
username, name_and_secret, username_len);
2448 chap_user_buff->
username[username_len] =
'\0';
2451 strncpy(chap_user_buff->
secret, separator, secret_len);
2452 chap_user_buff->
secret[secret_len] =
'\0';
2458 sizeof(*chap_user_buff), NULL, 0);
2460 printf(
"CHAP user %s:%s added\n", chap_user_buff->
username,
2463 printf(
"Failed to add CHAP user %s:%s\n", chap_user_buff->
username,
2467 free(chap_user_buff);
2498 fprintf(stderr,
"Name is required\n");
2508 printf(
"Remove CHAP is only supported in iSCSI\n");
2513 if (chap_user_buff == NULL) {
2514 fprintf(stderr,
"malloc failed\n");
2518 strcpy(chap_user_buff->
username, username);
2520 chap_user_buff->
secret[0] =
'\0';
2525 sizeof(*chap_user_buff), NULL, 0);
2527 printf(
"CHAP user %s removed\n", chap_user_buff->
username);
2529 printf(
"Failed to remove CHAP user %s\n", chap_user_buff->
username);
2532 free(chap_user_buff);
2573 printf(
"Show CHAP is only supported in iSCSI\n");
2587 printf(
"CHAP users list is empty\n");
2593 out_buf = malloc(out_buf_size);
2594 if (out_buf == NULL) {
2595 fprintf(stderr,
"malloc failed\n");
2600 NULL, 0, out_buf, out_buf_size);
2602 printf(
"CHAP show users list failed\n");
2608 printf(
"%-16s %-16s %-12s\n",
"User",
"Secret",
"Type");
2609 for (ii = 0; ii < cnt; ii++) {
2610 if (offset >= out_buf_size) {
2611 fprintf(stderr,
"CHAP user buffer overflowed\n");
2616 printf(
"%-16s %-16s %-12s\n", chap_user_buff->
username, chap_user_buff->
secret,
2651 fprintf(stderr,
"Value (true or false) is required\n");
2657 if ((strcasecmp(value,
"true") != 0) &&
2658 (strcasecmp(value,
"false") != 0)) {
2659 fprintf(stderr,
"Unexpected value '%s' - should be 'true' or 'false'\n", value);
2668 printf(
"CHAP is only supported in iSCSI\n");
2675 printf(
"Require-chap set to %s\n", value);
2677 printf(
"Failed to set require-chap, rval is %d\n", rval);
2711 printf(
"CHAP is only supported in iSCSI\n");
2717 if (strlen(result) != 0) {
2718 printf(
"Require-chap is %s\n", result);
2720 printf(
"Failed to get require-chap flag\n");
2754 fprintf(stderr,
"Jumbo frames are only supported on iSCSI\n");
2761 fprintf(stderr,
"Failed to enable jumbo frames, rval is %d\n", rval);
2763 printf(
"Jumbo frames enabled\n");
2797 fprintf(stderr,
"Jumbo frames are only supported on iSCSI\n");
2804 fprintf(stderr,
"Failed to disable jumbo frames, rval is %d\n", rval);
2806 printf(
"Jumbo frames disabled\n");
2840 fprintf(stderr,
"Header digests are only supported on iSCSI\n");
2847 fprintf(stderr,
"Failed to enable header digests, rval is %d\n", rval);
2849 printf(
"Header digests enabled\n");
2883 fprintf(stderr,
"Header digests are only supported on iSCSI\n");
2890 fprintf(stderr,
"Failed to disable header digests, rval is %d\n", rval);
2892 printf(
"Header digests disabled\n");
2926 fprintf(stderr,
"Data digests are only supported on iSCSI\n");
2933 fprintf(stderr,
"Failed to enable data digests, rval is %d\n", rval);
2935 printf(
"Data digests enabled\n");
2969 fprintf(stderr,
"Data digests are only supported on iSCSI\n");
2976 fprintf(stderr,
"Failed to disable data digests, rval is %d\n", rval);
2978 printf(
"Data digests disabled\n");
3005 uint32_t window_size;
3009 fprintf(stderr,
"Window size is required\n");
3013 window_size = strtoul(argv[2], NULL, 10);
3014 if ((window_size < 1) || (window_size > 65535)) {
3015 fprintf(stderr,
"Windows size %d invalid. Valid range is 1 to 65535\n", window_size);
3024 fprintf(stderr,
"Window size command is only supported on iSCSI\n");
3031 fprintf(stderr,
"Failed to set window size, rval is %d\n", rval);
3033 printf(
"Window size set\n");
3068 fprintf(stderr,
"Window size command is only supported on iSCSI\n");
3074 if (strlen(result) == 0) {
3075 fprintf(stderr,
"Failed to get window size\n");
3078 printf(
"Current window size is %s\n", result);
3106 uint32_t window_scale;
3110 fprintf(stderr,
"Window scale is required\n");
3114 window_scale = strtoul(argv[2], NULL, 10);
3115 if (window_scale > 14) {
3116 fprintf(stderr,
"Windows scale %d invalid. Valid range is 0 to 14\n", window_scale);
3125 fprintf(stderr,
"Window scale command is only supported on iSCSI\n");
3132 fprintf(stderr,
"Failed to set window scale, rval is %d\n", rval);
3134 printf(
"Window scale set\n");
3169 fprintf(stderr,
"Window scale command is only supported on iSCSI\n");
3175 if (strlen(result) == 0) {
3176 fprintf(stderr,
"Failed to get window scale\n");
3179 printf(
"Current window scale is %s\n", result);
3210 fprintf(stderr,
"Max connections is required\n");
3219 fprintf(stderr,
"Max connections command is only supported on iSCSI\n");
3226 fprintf(stderr,
"Failed to set max connections per session, rval is %d\n", rval);
3228 printf(
"Max connections per session set\n");
3263 fprintf(stderr,
"Max connections command is only supported on iSCSI\n");
3269 if (strlen(result) == 0) {
3270 fprintf(stderr,
"Failed to get max connections per session\n");
3273 printf(
"Current max connections per session is %s\n", result);
3305 fprintf(stderr,
"IP address is required\n");
3316 printf(
"Start-listen is only supported in iSCSI\n");
3323 printf(
"Now listening on IP address %s\n", ip_addr);
3325 printf(
"Failed to start listening on IP address %s\n", ip_addr);
3356 fprintf(stderr,
"IP address is required\n");
3367 printf(
"Stop-listen is only supported in iSCSI\n");
3374 printf(
"Stopped listening on IP address %s\n", ip_addr);
3376 printf(
"Failed to stop listening on IP address %s\n", ip_addr);
3411 fprintf(stderr,
"MAC address value is required\n");
3415 macaddr_p = argv[2];
3422 printf(
"Soft assigned MAC is only supported in iSCSI\n");
3428 sscanf(macaddr_p,
"%x:%x:%x:%x:%x:%x",
3429 &macaddr[0], &macaddr[1], &macaddr[2],
3430 &macaddr[3], &macaddr[4], &macaddr[5]);
3432 printf(
" soft assigned MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
3433 macaddr[0], macaddr[1], macaddr[2],
3434 macaddr[3], macaddr[4], macaddr[5]);
3464 fprintf(stderr,
"MAC address value is required\n");
3468 macaddr_p = argv[2];
3475 printf(
"MAC addresses apply only to iSCSI and NIC\n");
3481 sscanf(macaddr_p,
"%x:%x:%x:%x:%x:%x",
3482 &macaddr[0], &macaddr[1], &macaddr[2],
3483 &macaddr[3], &macaddr[4], &macaddr[5]);
3488 printf(
" New MAC address: %02x:%02x:%02x:%02x:%02x:%02x\n",
3489 macaddr[0], macaddr[1], macaddr[2],
3490 macaddr[3], macaddr[4], macaddr[5]);
3492 printf(
" Failed to change MAC address\n");
3527 fprintf(stderr,
"Show MAC command is only supported on iSCSI\n");
3535 if (strlen(mac) != 0) {
3536 printf(
" MAC on adapter: ");
3537 for (i=0; i<strlen(mac); i++) {
3538 printf(
"%c", mac[i]);
3539 if (((i % 2) == 1) && (i != strlen(mac)-1)) {
3546 printf(
" Unable to retrieve MAC address\n");
3579 fprintf(stderr,
"Show MAC command is only supported on iSCSI and NIC\n");
3585 printf(
" MAC on adapter: %s\n",
hex_dump(mac, 6));
3617 fprintf(stderr,
"Show WWN command is only supported on FC\n");
3655 fprintf(stderr,
"WWN value is required\n");
3664 printf(
"WWN applies only to FC\n");
3669 if (wwn_p == NULL) {
3673 wwpn_p = options.
wwpn;
3674 wwnn_p = options.
wwnn;
3676 if ((wwpn_p == NULL) && (wwnn_p == NULL)) {
3677 printf(
"Failed to set WWN. Please provide valid WWNN/WWPN as input.\n");
3682 if (wwpn_p != NULL) {
3683 strncpy(wwn_p, wwpn_p, strlen(wwpn_p));
3685 strncat(wwn_p,
"NA", 2);
3687 strncat(wwn_p,
"@", 1);
3689 if (wwnn_p != NULL) {
3690 strncat(wwn_p, wwnn_p, strlen(wwnn_p));
3692 strncat(wwn_p,
"NA", 2);
3702 if (wwnn_p != NULL) {
3703 printf(
"New WWNN: %s\n", wwnn_p);
3706 if (wwpn_p != NULL) {
3707 printf(
"New WWPN: %s\n", wwpn_p);
3709 printf(
"Successfully changed WWN. Please reset adapter for changes to take effect.\n");
3711 printf(
"Failed to change WWN\n");
3749 if (value && (strlen(value) > 0)) {
3750 printf(
" driver_version: %s\n", value);
3754 if (value && (strlen(value) > 0)) {
3755 printf(
" pm_state: %s\n", value);
3767 obj = status_list->
head;
3772 if (strncmp(prop->
name,
"/ocs/driver/", 12) == 0) {
3773 if (strstr(prop->
access,
"r") && (strlen(prop->
value) > 0)) {
3775 s = strrchr(prop->
name,
'/') + 1;
3776 printf(
" %s: %s\n", s, prop->
value);
3823 if (argv[2][0] ==
'-') {
3825 wwnn_arg=
"00:00:00:00:00:00:00:00";
3826 wwpn_arg=
"00:00:00:00:00:00:00:00";
3837 fprintf(stderr,
"Must specify either --target or --initiator\n");
3842 fprintf(stderr,
"Vports are only supported on FC and FCoE\n");
3847 printf(
"Invalid WWNN: %s\n", wwnn_arg);
3852 printf(
"Invalid WWPN: %s\n", wwpn_arg);
3886 fprintf(stderr,
"WWNN and WWPN are required\n");
3898 fprintf(stderr,
"Vports are only supported on FC and FCoE\n");
3903 printf(
"Invalid WWNN: %s\n", wwnn_arg);
3908 printf(
"Invalid WWPN: %s\n", wwpn_arg);
3936 char *linkcfg = NULL;
3951 if (linkcfg == NULL) {
3952 printf(
"Failed to get linkcfg value\n");
3955 printf(
"Link config: %s\n", linkcfg);
3980 char *linkspeed = NULL;
3993 if (linkspeed == NULL) {
3994 printf(
"Failed to get linkspeed value\n");
3997 printf(
"Link speed: %s\n", linkspeed);
4022 char *linktopology = NULL;
4035 if (linktopology == NULL) {
4036 printf(
"Failed to get linktopology value\n");
4039 printf(
"Link topology: %s\n", linktopology);
4063 uint8_t supported = 0;
4079 printf(
"Unsupported link config=%s\n", options.
linkcfg);
4094 printf(
"Failed to set link config, IOCTL failed status=%d\n", rval);
4098 printf(
"Successfully set link config. Please reboot for changes to take effect.\n");
4123 uint8_t supported = 0;
4139 printf(
"Unsupported link config=%s\n", options.
linkspeed);
4150 printf(
"link speed is not supported for this driver\n");
4155 printf(
"Failed to set link speed, IOCTL failed status=%d\n", rval);
4159 printf(
"Successfully set link speed.\n");
4184 uint8_t supported = 0;
4206 printf(
"Unsupported link topology=%s\n", options.
linktopology);
4217 printf(
"link topology is not supported for this driver\n");
4222 printf(
"Failed to set link topology, IOCTL failed status=%d\n", rval);
4226 printf(
"Successfully set link topology.\n");
4259 fprintf(stderr,
"Profiles are only supported on Skyhawk\n");
4265 if (strlen(response) == 0) {
4266 printf(
"Failed to get supported profile list\n");
4269 printf(
"Supported profiles:\n");
4270 printf(
"%s\n", response);
4300 char profile_description[80];
4303 goto exit_get_active_profile;
4307 fprintf(stderr,
"Profiles are only supported on Skyhawk\n");
4308 goto exit_get_active_profile;
4313 if (strlen(response)== 0) {
4314 printf(
"Failed to get active profile\n");
4317 profile = strtol(response, NULL, 0);
4320 strcpy(profile_description,
"(Description not available)");
4323 if (strlen(response) != 0) {
4331 line = strtok_r(response,
"\n", &tokptr1);
4334 id = strtok_r(line,
":", &tokptr2);
4335 description = strtok_r(NULL,
"\n", &tokptr2);
4336 if (strtol(
id, NULL, 0) == profile) {
4337 if (strlen(description) < 80) {
4338 strncpy(profile_description, description, strlen(description));
4343 line = strtok_r(NULL,
"\n", &tokptr1);
4346 printf(
"Active profile:\n");
4347 printf(
"0x%02x: %s\n", profile, profile_description);
4352 exit_get_active_profile:
4377 char *new_profile_id;
4385 fprintf(stderr,
"Profiles are only supported on Skyhawk\n");
4394 printf(
"Set active profile failed.\n");
4396 printf(
"Active profile set to %s\n",new_profile_id);
4397 printf(
"New profile will be in effect after reboot\n");
4425 char result[5*1024];
4433 printf(
"Supported profiles:\n");
4434 printf(
"%s\n", result);
4436 printf(
"Failed to get list of supported profiles\n");
4472 printf(
"Active profile:\n");
4473 printf(
"%s\n", result);
4475 printf(
"Failed to get active profile\n");
4503 char *new_profile_id;
4514 printf(
"Set active profile failed.\n");
4516 printf(
"Active profile set to %s\n",new_profile_id);
4517 printf(
"New profile will be in effect after reboot\n");
4552 fprintf(stderr,
"Port protocols are only supported on Skyhawk\n");
4558 if (strlen(response)== 0) {
4559 printf(
"Failed to get port protocol\n");
4562 printf(
"Port protocol:\n");
4563 printf(
"%s\n", response);
4591 char *new_protocol_name;
4599 fprintf(stderr,
"Port protocols are only supported on Skyhawk\n");
4608 printf(
"Set port protocol failed.\n");
4610 printf(
"Port protocol set\n");
4646 printf(
"Firmware reset successful, driver must now be reloaded\n");
4683 hba_list_info = malloc(
sizeof(*hba_list_info));
4684 if (hba_list_info == NULL) {
4691 NULL, 0, hba_list_info,
sizeof(*hba_list_info));
4695 printf(
"FDMI HBA list:\n");
4696 printf(
" Number of HBA entries: %d\n", hba_list_info->
entry_count);
4709 free(hba_list_info);
4737 char hba_id[128] = {0,};
4738 uint32_t hba_id_len;
4742 fprintf(stderr,
"HBA identifier is required\n");
4753 printf(
"Please provide valid HBA identifier as input\n");
4757 port_list_info = malloc(
sizeof(*port_list_info));
4758 if (port_list_info == NULL) {
4765 hba_id_len = snprintf(hba_id,
sizeof(hba_id),
"%s", options.
hba_identifier);
4767 hba_id, hba_id_len, port_list_info,
sizeof(*port_list_info));
4771 printf(
"FDMI Port list:\n");
4772 printf(
" Number of Port entries: %d\n", port_list_info->
entry_count);
4785 free(port_list_info);
4813 char hba_id[128] = {0,};
4814 uint32_t hba_id_len;
4818 fprintf(stderr,
"HBA identifier is required\n");
4829 printf(
"Please provide valid HBA identifier as input\n");
4833 hba_info = malloc(
sizeof(*hba_info));
4834 if (hba_info == NULL) {
4841 hba_id_len = snprintf(hba_id,
sizeof(hba_id),
"%s", options.
hba_identifier);
4843 hba_id, hba_id_len, hba_info,
sizeof(*hba_info));
4847 printf(
"FDMI HBA info:\n");
4854 printf(
" Node name: 0x%lx\n", hba_info->
node_name);
4857 printf(
" Manufacturer name: %s\n", hba_info->
manufacturer);
4860 printf(
" Serial Number: %s\n", hba_info->
serial_num);
4863 printf(
" Model name: %s\n", hba_info->
model_name);
4866 printf(
" Model Description: %s\n", hba_info->
model_desc);
4869 printf(
" Hardware Version: %s\n", hba_info->
hw_ver);
4872 printf(
" Driver Version: %s\n", hba_info->
driver_ver);
4875 printf(
" Optional ROM Version: %s\n", hba_info->
opt_rom_ver);
4878 printf(
" Firmware Version: %s\n", hba_info->
fw_ver);
4881 printf(
" OS Name and Version: %s\n", hba_info->
os_name_ver);
4890 printf(
" Vendor Info: 0x%x\n", hba_info->
vendor_info);
4893 printf(
" No of Ports: %d\n", hba_info->
num_ports);
4896 printf(
" Fabric Name: 0x%lx\n", hba_info->
fabric_name);
4899 printf(
" BIOS version: %s\n", hba_info->
bios_ver);
4902 printf(
" BOOT state: %d\n", hba_info->
boot_state);
4905 printf(
" Vendor ID: %s\n", hba_info->
vendor_id);
4919 char port_speed_str[256] = {0,};
4922 strcat(port_speed_str,
"1 ");
4925 strcat(port_speed_str,
"2 ");
4928 strcat(port_speed_str,
"4 ");
4931 strcat(port_speed_str,
"8 ");
4934 strcat(port_speed_str,
"16 ");
4937 strcat(port_speed_str,
"32 ");
4940 strcat(port_speed_str,
"64 ");
4943 strcat(port_speed_str,
"128 ");
4945 strcat(port_speed_str,
"Gb/s");
4946 strncpy(buf, port_speed_str, 256);
4974 char port_id[128] = {0,};
4975 uint32_t port_id_len;
4979 fprintf(stderr,
"Port identifier is required\n");
4990 printf(
"Please provide valid port identifier as input\n");
4994 port_info = malloc(
sizeof(*port_info));
4995 if (port_info == NULL) {
5002 port_id_len = snprintf(port_id,
sizeof(port_id),
"%s", options.
port_identifier);
5004 port_id, port_id_len, port_info,
sizeof(*port_info));
5006 printf(
"FDMI Port info:\n");
5012 printf(
" Supported FC-4 types: ");
5019 char port_speed_str[256] = {0,};
5022 printf(
" Supported speed: %s\n", port_speed_str);
5026 char port_speed_str[256] = {0,};
5029 printf(
" Port Current speed: %s\n", port_speed_str);
5033 printf(
" Maximum frame size: 0x%x\n", port_info->
max_frame_size);
5036 printf(
" OS Device Name: %s\n", port_info->
os_dev_name);
5039 printf(
" Host Name: %s\n", port_info->
host_name);
5042 printf(
" Node Name: 0x%lx\n", port_info->
node_name);
5045 printf(
" Port Name: 0x%lx\n", port_info->
port_name);
5051 printf(
" Port type: ");
5057 printf(
"NL_Port\n");
5060 printf(
"F/NL_Port\n");
5066 printf(
"FL_Port\n");
5069 printf(
"Undefined\n");
5073 printf(
" Supported Class of service: %d\n",
5081 printf(
" Port state: %d\n", port_info->
port_state);
5084 printf(
" Number of Discovered Ports: %d\n", port_info->
num_disc_ports);
5092 printf(
" Active FC-4 types: ");
5137 fprintf(stderr,
"Trunking is only supported on Prism adapters.\n");
5143 printf(
"Set trunk mode failed, rc %d.\n", rc);
5145 printf(
"Device configured to (%d) trunk mode. Host reboot is required for new trunk mode to take effect.\n", options.
trunk_mode);
5155 char *ptr = active_ports_str;
5158 memset(active_ports_str, 0x0, max_str_len);
5160 if (!(ports_active & (1 << i)))
5162 if (!strlen(active_ports_str)) {
5163 snprintf(tmp,
sizeof(tmp),
"%d", i);
5165 snprintf(tmp,
sizeof(tmp),
",%d", i);
5167 if (strlen(active_ports_str) + strlen(tmp) > max_str_len)
5173 if (!strlen(active_ports_str)) {
5174 strcpy(active_ports_str,
"None");
5200 uint32_t trunk_info;
5201 char *logical_link_speed;
5202 char active_ports_str[16];
5210 fprintf(stderr,
"Trunking is only supported on Prism adapters.\n");
5215 NULL, 0, &trunk_info,
sizeof(trunk_info));
5217 printf(
"Get trunk mode failed, rc %d.\n", rc);
5222 active_ports_str,
sizeof(active_ports_str));
5225 printf(
"SLI port is a single physical FC link\n");
5232 printf(
"FC Trunk Configuration:\n\tLinks=2\n\tMember ports={ 0,1 }\n\tActive ports={ %s }\n", active_ports_str);
5236 printf(
"FC Trunk Configuration:\n\tLinks=2\n\tMember ports={ 2,3 }\n\tActive ports={ %s }\n", active_ports_str);
5240 printf(
"FC Trunk Configuration:\n\tLinks=4\n\tMember ports={ 0,1,2,3 }\n\tActive ports={ %s }\n", active_ports_str);
5243 printf(
"Invalid FC link topology\n");
5247 if (strlen(logical_link_speed) == 0) {
5248 printf(
"Failed to get logical link speed from device %d\n",
5252 printf(
"\n Logical Link Speed: %ld Gbps\n", strtoul(logical_link_speed, NULL, 0)/1000);
5286 printf(
"Port migration operation is successed\n");
5316 int arg_in_len, arg_out_len;
5317 char *arg_in = NULL;
5318 void *arg_out = NULL;
5328 arg_in_len = strlen(
"clear") + 1;
5332 arg_out = (
void *)malloc(arg_out_len);
5336 memset(arg_out, 0, arg_out_len);
5337 rval =
elxu_device_exec(options.
device,
"/ocs/get_parity_stats", arg_in, arg_in_len, arg_out, arg_out_len);
5342 printf(
"ITCM Parity Stats:\n");
5343 printf(
"==================\n");
5345 printf(
"parity_bit_error_count[%d] = %d, total_parity_error_count[%d] = %d\n",
5346 i, counter[i].pbec, i, counter[i].tpec);
5381 printf(
"Firmware reset failed\n");
5385 printf(
"Firmware reset successful, driver must now be reloaded\n");
5417 fprintf(stderr,
"Unload command is only supported on user space drivers\n");
5422 fprintf(stderr,
"elxu_iocl_device CMD_UNLOAD failed: %d\n", rval);
5456 fprintf(stderr,
"Node aborts are applicable only on FC or FCoE\n");
5461 if (strlen(value) == 0) {
5462 printf(
"Failed to get sum of nodes abort count from device %d\n",
5467 printf(
"Sum of all nodes abort_cnt = %s\n", value);
5495 if (strcmp(argv[2],
"examples") == 0) {
5500 if (strcmp(argv[2],
cmd_table[i].name) == 0) {
5501 printf(
"Command: %s\n",
cmd_table[i].syntax);
5502 printf(
"Usage: %s\n",
cmd_table[i].help_text);
5510 printf(
"This command is supported only with the elx_pt driver.\n");
5514 printf(
"This command is not supported with the elx_pt driver.\n");
5522 printf(
"Type 'elxsdkutil help <command>' for help on a specific command.\n");
5523 printf(
"Type 'elxsdkutil help examples' for usage examples.\n\n");
5525 printf(
"Available commands:\n");
5531 }
else if ((
cmd_table[i].pt_handler != NULL) && (
cmd_table[i].ocs_handler == NULL)) {
5538 printf(
" (1) indicates a command supported by the OneCoreStorage drivers but not the elx_pt driver.\n");
5539 printf(
" (2) indicates a command supported by the elx_pt driver but not the OneCoreStorage drivers.\n");
5577 static struct option opts[] = {
5579 {
"device", required_argument, NULL,
'd'},
5580 {
"path", required_argument, NULL,
'p'},
5582 {
"file", required_argument, NULL,
'f'},
5586 {
"wwnn", required_argument, NULL,
WWNN},
5587 {
"wwpn", required_argument, NULL,
WWPN},
5588 {
"initiator", no_argument, NULL,
INITIATOR},
5589 {
"target", no_argument, NULL,
TARGET},
5590 {
"fat", no_argument, NULL,
FAT_DUMP},
5591 {
"efd", no_argument, NULL,
EFD_DUMP},
5592 {
"ecd", no_argument, NULL,
ECD_DUMP},
5593 {
"fdb_dump", no_argument, NULL,
FDB_DUMP},
5594 {
"ecdtest", no_argument, NULL,
TEST_DUMP},
5597 {
"linkcfg", required_argument, NULL,
LINKCFG},
5598 {
"linkspeed", required_argument, NULL,
LINKSPEED},
5599 {
"linktopology", required_argument, NULL,
LINKTOPOLOGY},
5600 {
"bufsize", required_argument, NULL,
BUFSIZE},
5601 {
"saved", no_argument, NULL,
SAVED},
5602 {
"clrsaved", no_argument, NULL,
CLRSAVED},
5603 {
"profile-id", required_argument, NULL,
PROFILE_ID},
5605 {
"wqes", no_argument, NULL,
WQES},
5606 {
"cqes", no_argument, NULL,
CQES},
5607 {
"rqes", no_argument, NULL,
RQES},
5608 {
"mqes", no_argument, NULL,
MQES},
5609 {
"eqes", no_argument, NULL,
EQES},
5610 {
"qentries", required_argument, NULL,
QENTRIES},
5616 {
"retry_count", required_argument, NULL,
RETRY_COUNT},
5617 {
"chap-type", required_argument, NULL,
CHAP_TYPE},
5618 {
"vlan-id", required_argument, NULL,
VLAN_ID},
5619 {
"hba_identifier", required_argument, NULL,
HBA_ID},
5620 {
"port_identifier", required_argument, NULL,
PORT_ID},
5621 {
"mode", required_argument, NULL,
TRUNK_MODE},
5627 memset(options, 0,
sizeof(*options));
5632 options->
bufsize = 16 * 1024 * 1024;
5634 while ((ch = getopt_long(argc, argv,
"f:d:", opts, NULL)) != -1) {
5638 options->
file = strdup(optarg);
5641 if (!isdigit(*optarg)) {
5642 fprintf(stderr,
"Invalid device '%s': not a number\n", optarg);
5645 devname.
devidx = atoi(optarg);
5648 options->
hostname = strdup(optarg);
5687 options->
wwnn = strdup(optarg);
5690 options->
wwpn = strdup(optarg);
5726 strncpy(options->
linkcfg, optarg, (
sizeof(options->
linkcfg) - 1));
5751 optlen = strlen(optarg);
5752 suffix = optarg[optlen-1];
5754 options->
bufsize = atoi(optarg);
5755 if (toupper(suffix) ==
'K') {
5758 if (toupper(suffix) ==
'M') {
5759 options->
bufsize *= (1024 * 1024);
5770 fprintf(stderr,
"Invalid argument: chap type %s\n", optarg);
5777 options->
vlan_id = atoi(optarg);
5794 if ((argc - optind) > expected_nonargs) {
5795 fprintf(stderr,
"Unexpected argument: %s\n", argv[optind + expected_nonargs]);
5802 if (options->
device == NULL) {
5803 fprintf(stderr,
"Unable to open device %d\n", devname.
devidx);
5823 printf (
"Where <device> is an integer 0..n indicating which HBA to use.\n");
5824 printf (
"If <device> is not specified it defaults to 0\n");
5826 printf (
"Examples:\n");
5827 printf (
"Compare file data with data stored in device 0 flash:\n");
5828 printf (
"elxsdkutil cmp myfile -d 0\n");
5830 printf (
"Display device 0 EFD capabilities:\n");
5831 printf (
"elxsdkutil efdc -d 0\n");
5833 printf (
"Generate dump on device 0 to be read by --efd command:\n");
5834 printf (
"elxsdkutil gendump -d 0\n");
5836 printf (
"Save device 0 EFD data in the file myfile:\n");
5837 printf (
"elxsdkutil efd -d 0 -f myfile\n");
5839 printf (
"Save device 0 FAT content in the file myfile:\n");
5840 printf (
"elxsdkutil fat -d 0 -f myfile\n");
5842 printf (
"Display UFI file and image information for the file myfile:\n");
5843 printf (
"elxsdkutil info myfile\n");
5845 printf (
"List HBA devices:\n");
5846 printf (
"elxsdkutil list\n");
5848 printf (
"List device filesystem objects on device 0:\n");
5849 printf (
"elxsdkutil objenum -d 0\n");
5851 printf (
"Copy an object instance \"/obj/inst\" into file the specified file:\n");
5852 printf (
"elxsdkutil read /obj/inst -d 0 -f myfile\n");
5854 printf (
"Write firmware image to device 0:\n");
5855 printf (
"elxsdkutil write myfile -d 0\n");
5857 printf (
"Print hexadecimal diagnostic information from the Transceiver:\n");
5858 printf (
"elxsdkutil sfp -d 0\n");
5860 printf (
"Retrieve Core Dump image to file:\n");
5861 printf (
"elxsdkutil ecd -d 0 -f myfile\n");
5863 printf (
"Create a vport on device 0:\n");
5864 printf (
"elxsdkutil create-vport 20:00:00:00:c9:01:02:03 10:00:00:00:c9:01:02:03 --target\n");
5866 printf (
"Remove a vport from device 0:\n");
5867 printf (
"elxsdkutil remove-vport 20:00:00:00:c9:01:02:03 10:00:00:00:c9:01:02:03\n");
5869 printf (
"List devices user space driver\n");
5870 printf (
"elxsdkutil list --host localhost\n\n");
uint32_t port_fabric_name_valid
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
char * supported_linkspeed[]
char * elxu_decode_sfp_id(uint32_t value)
int elxu_core_dump(elxu_device_t *device_p, char *fname_p, int test_dump)
Core Dump functionality.
int elxu_cmd_disable_data_digest(int argc, char **argv)
Command handler for the disable-data-digest command.
int elxu_check_sfp_dport_support(elxu_device_t *device)
int elxu_cmd_set_nv_mac_pt(int argc, char **argv)
Command handler for the set-nv-mac command.
int mbox_connection_update(elxu_device_t *device, uint32_t request_flags, uint16_t connectionId, uint32_t constrainWindowValue)
struct mgmt_object * head
#define OCS_CHAP_INCOMING
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 hba_data_upload(elxu_device_t *device_p, char const *fname_p, data_type_req_t req)
FAT data upload functionality.
#define ELXU_IP_GET_ADDRESS_LIST_SIZE
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 mbox_set_nv_wwn_pt(elxu_device_t *device, char *wwpn_p, char *wwnn_p)
Issue a set non-volatile WWNN/WWPN.
int is_fc(elxu_device_t *device_p)
Return true IFF the HBA is a FC HBA.
#define DPORT_SFP_TABLE2_LEN
int elxu_cmd_set_mac_ocs(int argc, char **argv)
Command handler for the set-mac command.
#define ELXU_CMD_VLAN_SHOW_BUFFER_SIZE
int elxu_cmd_sfp(int argc, char **argv)
Command handler for the sfp command.
int lancer_dump_to_host(elxu_device_t *device_p, const char *fname, int fdb_dump)
Trigger dump-to-host on Lancer.
int elxu_cmd_diag_loopback_tests(int argc, char **argv)
int mbox_tcp_parameters(elxu_device_t *device, uint32_t request_flags, uint32_t ackFrequency, uint32_t delayedAckTimerValue)
Issue the Set TCP Parameters mbox command.
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_device_exec(elxu_device_t *device, char *name, void *arg_in, int arg_in_len, void *arg_out, int arg_out_len)
Execute a management function on a device.
#define OCS_FC_TRUNK_LINK_STATE_MASK
int parse_wwn(char *wwn_in, uint64_t *wwn_out)
Parse a WWN from a string into a 64-bit value.
int elxu_cmd_firmware_reset(int argc, char **argv)
Command handler for the firmware-reset command.
void elxu_display_device_list(char *hostname)
Display the list of available devices.
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.
#define OCS_ISCSI_PORTAL_GRPTAG
uint32_t max_ct_payload_valid
uint32_t supported_cos_valid
#define OCS_IOCTL_DDUMP_FLAGS_CQES
int elxu_cmd_add_chap(int argc, char **argv)
Command handler for the add-chap command.
uint8_t active_fc4_types[32]
char * supported_linkcfgs[]
#define TRANSCEIVER_INFO_PAGE_SIZE
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
#define CLEAR_ALL_COUNTER
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.
uint32_t supported_class_of_service
uint32_t node_symb_name_valid
int elxu_cmd_delayed_ack_timer(int argc, char **argv)
Command handler for the delayed-ack-timer command.
int mbox_set_dynamic_dport(elxu_device_t *device, char *state_str)
#define OCS_CHAP_MODE_TARGET
uint32_t supported_speed_valid
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.
#define OCS_IOCTL_DDUMP_FLAGS_RQES
int elxu_cmd_get_linkspeed(int argc, char **argv)
Command handler for the linkspeed-get command.
uint32_t max_frame_size_valid
int mbox_read_rev(elxu_device_t *device)
Issue read rev mailbox command.
int mbox_soft_assign_mac(elxu_device_t *device, int *macaddr)
Soft assign MAC.
int mbox_query_dynamic_dport_status(elxu_device_t *device)
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_get_fw_diagnostic_log(elxu_device_t *device_p, char const *fname)
gather firmware diagnostic logs
#define OCS_ISCSI_TCP_PORT
void elxu_mgmt_info(elxu_device_t *device)
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_DUMP_TYPE4_WKI_TAG_SAT_TEM_RESP_LEN
#define OCS_CONFIG_LINKCFG_4X8G
#define CONNECTION_HANDLE
device name specifier This structure is used to describe the type and name of the device ioctl connec...
int is_lancer_g5(elxu_device_t *device_p)
Return true IFF the HBA is a Lancer G5.
void * zmalloc(uint32_t len)
Allocates and zeroes memory to be used.
uint32_t max_ct_payload_len
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.
int ext_fat_capabilities_upld(elxu_device_t *device_p)
Displays EXT FAT capabilities.
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.
#define OFT_DIRECTORY_OBJECT
int elxu_cmd_objenum(int argc, char **argv)
Command handler for the objenum command.
char * elxu_sfp_encoding_info(uint32_t value)
int elxu_cmd_unload(int argc, char **argv)
Command handler for user space driver unload.
#define OCS_IOCTL_CMD_UNLOAD
int is_uspace(elxu_device_t *device_p)
Return true IFF the device is managed by a user space driver.
int elxu_cmd_disable_jumbo(int argc, char **argv)
Command handler for the disable-jumbo command.
uint64_t hba_identifier[MAX_FDMI_HBA_COUNT]
int mbox_set_linkcfg_pt(elxu_device_t *device, char *config)
Set Link configuration.
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_ioctl_device(elxu_device_t *device, int req, void *arg)
Send an ioctl to a device.
void zfree(void *p)
Frees memory that has been allocated.
char * supported_linktopology[]
int elxu_cmd_port_migration(int argc, char **argv)
Command handler for the port-migration command.
int is_lancer(elxu_device_t *device_p)
Return true IFF the HBA is a Lancer.
char linkspeed[LINKSPEED_VALUE_NAME_MAX]
mgmt_object_t * mgmt_list_remove(mgmt_list_t *list, char *name)
Remove an object from a list.
#define OCS_MAX_SLI_PORTS_PER_DEVICE
int elxu_cmd_constrain_window(int argc, char **argv)
Command handler for the constrain-window command.
int remove_vport(elxu_device_t *device_p, uint64_t wwnn, uint64_t wwpn, int targetFlag, int initiatorFlag)
uint32_t os_name_ver_valid
int elxu_cmd_enable_jumbo(int argc, char **argv)
Command handler for the enable-jumbo command.
#define OCS_CHAP_TYPE_INCOMING
int mbox_get_dport_stats(elxu_device_t *device)
Issue Get dport stats mailbox command Create a GET_DPORT_STAT mailbox command.
int mbox_set_nv_mac_pt(elxu_device_t *device, int *macaddr)
uint32_t num_disc_ports_valid
int mbox_read_status(elxu_device_t *device, uint32_t clear_counter)
Issue read status mailbox command.
static cmd_table_entry_t cmd_table[]
uint32_t num_port_entries
struct mgmt_object * next
int elxu_cmd_get_linkcfg(int argc, char **argv)
Command handler for the linkcfg-get command.
uint8_t diag_monitor_type
uint64_t port_fabric_name
uint32_t num_port_attr_entries
uint32_t os_dev_name_valid
int mgmt_set_value(elxu_device_t *device, char *name, char *value)
#define OCS_FC_TRUNK_2_PORT_CONFIG
uint32_t vendor_info_valid
#define OCS_IOCTL_DDUMP_FLAGS_MQES
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 mbox_set_active_profile_pt(elxu_device_t *device, char *new_profile_id)
#define ISCSI_UPDATE_TCP_WINDOW
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.
uint32_t serial_num_valid
void elxu_driver_dump(elxu_device_t *device, int bufsize, ocs_ioctl_ddump_arg_t *args)
int elxu_cmd_mgmt_info(int argc, char **argv)
Command handler for the mgmt-info command.
#define OCS_CONFIG_LINKCFG_4X1G
uint32_t model_name_valid
int lancer_gen_dump(elxu_device_t *device_p, int fdb_dump)
Trigger dump generation on Lancer.
#define OCS_IOCTL_DDUMP_FLAGS_EQES
int elxu_cmd_ack_frequency(int argc, char **argv)
Command handler for the ack-frequency command.
char * elxu_decode_sfp_connector(uint32_t value)
uint64_t port_identifier[MAX_FDMI_PORT_COUNT]
int elxu_cmd_board_temp(int argc, char **argv)
Command handler for the board temperature.
uint32_t active_fc_types_valid
int elxu_cmd_get_fdmi_port_list(int argc, char **argv)
Command handler for the elxu_cmd_get_fdmi_port_list command.
char linkcfg[LINKCFG_VALUE_NAME_MAX]
int elxu_cmd_set_linkspeed(int argc, char **argv)
Command handler for the link-speed-set command.
uint32_t supported_fc_types_valid
ocs_route_table_entry_t entry[OCS_ISCSI_ROUTE_TABLE_ENTRIES_MAX]
#define CLEAR_OVERFLOW_FLAG
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.
void mgmt_delete_list(mgmt_list_t *list)
mgmt_delete_list Delete a linked list and free its contents
mgmt_list is a linked list of objects
#define OCS_CONFIG_LINKCFG_2X16G
int is_skyhawk(elxu_device_t *device_p)
Return true IFF the HBA is a Skyhawk.
void elxu_get_connection_info(elxu_device_t *device)
Print iSCSI connection info for the given device.
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.
int is_fcoe(elxu_device_t *device_p)
Return true IFF the HBA is a FCoE HBA.
char * elxu_decode_sfp_rate_id(uint32_t value)
int is_nic(elxu_device_t *device_p)
Return true IFF the HBA is a NIC HBA.
uint64_t port_identifier[MAX_FDMI_PORT_COUNT]
uint32_t boot_state_valid
int elxu_cmd_efdc(int argc, char **argv)
Command handler for the efdc command.
char * elxu_device_get_value(elxu_device_t *device, char *key)
Return a property value for a device.
int mbox_read_link_status(elxu_device_t *device, int clof, int clrc)
Issue read link status mailbox command.
int elxu_cmd_add_ip(int argc, char **argv)
Command handler for the add-ip command.
#define DPORT_SFP_TABLE1_LEN
char * mbox_get_linkcfg_pt(elxu_device_t *device)
Get Link configuration.
#define OCS_FC_TRUNK_CONFIG_MASK
#define OCS_CONFIG_LINKCFG_2X10G
uint8_t port_symb_name[256]
mgmt_list_t * mgmt_get_all(elxu_device_t *device)
uint8_t SFF_8472_compliance
int mbox_get_active_profile_pt(elxu_device_t *device, char *result, int result_len)
int elxu_cmd_read_status(int argc, char **argv)
Command handler for the read-status command.
int elxu_device_get_lancer_temp(elxu_device_t *device)
int elxu_cmd_get_max_connections(int argc, char **argv)
Command handler for get-max-connections.
#define OCS_FC_TRUNK_4_PORT_CONFIG
int create_vport(elxu_device_t *device_p, uint64_t wwnn, uint64_t wwpn, int targetFlag, int initiatorFlag)
elxu_device_t * elxu_open_device(elxu_device_name_t *devname)
Open a device file.
char linktopology[LINKTOPO_VALUE_NAME_MAX]
uint8_t supported_fc4_types[32]
int elxu_cmd_iclusttgt_show(elxu_device_t *device)
int is_iscsi(elxu_device_t *device_p)
Return true IFF the HBA is an iSCSI HBA.
sli4_object_t * sli4_object_enumerate(elxu_device_t *device)
Create a list of all SLI4 objects.
int elxu_cmd_get_fdmi_port_info(int argc, char **argv)
Command handler for the elxu_cmd_get_fdmi_port_info command.
static void show_examples()
Print examples of commands.
void usage()
Show program usage.
ocs_ddump_action_t action
int elxu_cmd_remove_chap(int argc, char **argv)
Command handler for remove-chap.
mgmt_object is a list of properties
int elxu_cmd_set_port_protocol(int argc, char **argv)
Command handler for the set-port-protocol command.
uint8_t node_symb_name[256]
int elxu_cmd_get_dynamic_dport_status(int argc, char **argv)
void mgmt_list_sort(mgmt_list_t *list)
uint32_t manufacturer_valid
#define ISCSI_UPDATE_ACK_FREQUENCY
int elxu_check_ip_address_exists(cmd_options_t *options, char *ipaddr, int *ip_found)
int file_handler(elxu_device_t *device_p, char const *file_name_p, int action)
File manipulating functionality.
int elxu_cmd_vlan(int argc, char **argv)
Command handler for the vlan command.
uint32_t port_symb_name_valid
uint32_t driver_ver_valid
#define OCS_CHAP_OUTGOING
int mbox_fw_reset_pt(elxu_device_t *device, int dd)
uint32_t model_desc_valid
#define ISCSI_UPDATE_DELAYED_ACK_TIMER
int mbox_diag_loopback_tests(elxu_device_t *device, int loopback_type, int retry_count)
Issue set link diag loopback mailbox command.
int elxu_cmd_get_dport_stats(int argc, char **argv)
Command handler for the get-dport-stats command.
int is_prism(elxu_device_t *device_p)
Return true IFF the HBA is a Prism.
void mbox_get_mac_pt(elxu_device_t *device, uint8_t *mac_addr)
int elxu_cmd_get_fdmi_hba_info(int argc, char **argv)
Command handler for the elxu_cmd_get_fdmi_hba_info command.
uint32_t fabric_name_valid
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.
mgmt_property is a name / value pair
void elxu_decode_port_speed(uint32_t port_speed, char *buf)
#define OCS_IOCTL_DDUMP_FLAGS_WQES
int elxu_cmd_iclusttgt(int argc, char **argv)
static void ocs_fc_report_trunk_links(uint8_t ports_active, char *active_ports_str, size_t max_str_len)
uint32_t opt_rom_ver_valid
int hba_data_object_upload(elxu_device_t *device_p, char const *objname_p, char const *fname_p)
uint32_t current_port_speed
int elxu_cmd_show_mac_ocs(int argc, char **argv)
Command handler for the show-mac command for the OCS drivers.
#define OCS_CLUST_TARGET_KEY_RETCNT
int elxu_cmd_connection_info(int argc, char **argv)
Command handler for the connection-info command.
void dump8(const char *label, void *buffer, uint32_t bufferLength)
Print a buffer in hexadecimal and ASCII.
struct sli4_object_s * next
int elxu_cmd_enable_header_digest(int argc, char **argv)
Command handler for enable-header-digest.
elxu_device_driver_e driver
int elxu_cmd_iclusttgt_check_args(int argc, char **argv)
char * hex_dump(uint8_t *value, int size)
Display a buffer in hexadecimal.
int elxu_cmd_get_parity_stats(int argc, char **argv)
Command handler for the get-parity-stats command.
int mbox_get_profile_list_pt(elxu_device_t *device, char *result, int result_len)
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.
uint32_t port_state_valid
#define OCS_CONFIG_LINKCFG_2X10G_2X8G
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.
#define OCS_CHAP_TYPE_OUTGOING
#define OCS_FC_TRUNK_2_PORT_HI_CONFIG
uint32_t current_speed_valid
uint8_t vendor_specific[32]
int elxu_cmd_set_trunk_mode(int argc, char **argv)
Command handler for elxu_cmd_set_trunk_mode command.
int mbox_get_connection_info(elxu_device_t *device, uint32_t connectionHandle)
Get connection info.
void sli4_object_free_list(sli4_object_t *head)
Free a list of sli4_object_t's.
struct mgmt_property * head
int parse_arguments(int argc, char **argv, cmd_options_t *options, int openflag, int expected_nonargs)
Parse command line arguments.