Lines Matching +full:x +full:- +full:rc
6 * - Redistributions of source code must retain the above copyright notice,
9 * - Redistributions in binary form must reproduce the above copyright notice,
12 * - Neither the name of Dell Inc nor the names of its contributors
69 #define INVALID (-1)
80 #define INVAILD_FAILOVER_MODE -2
81 #define INVAILD_FAILOVER_MODE_SETTINGS -3
82 #define INVAILD_SHARED_MODE -4
129 * 11G || 12G || 13G -> _ALL
130 * 12G || 13G -> _12_13
258 * Input: intf - ipmi interface
259 * argc - no of arguments
260 * argv - argument string array
263 * Return: return code 0 - success
264 * -1 - failure
269 int rc = 0; in ipmi_delloem_main() local
276 rc = ipmi_delloem_lcd_main(intf,argc,argv); in ipmi_delloem_main()
279 rc = ipmi_delloem_mac_main(intf,argc,argv); in ipmi_delloem_main()
282 rc = ipmi_delloem_lan_main(intf,argc,argv); in ipmi_delloem_main()
285 rc = ipmi_delloem_setled_main(intf,argc,argv); in ipmi_delloem_main()
288 rc = ipmi_delloem_powermonitor_main(intf,argc,argv); in ipmi_delloem_main()
291 rc = ipmi_delloem_vFlash_main(intf,argc,argv); in ipmi_delloem_main()
294 return -1; in ipmi_delloem_main()
296 return rc; in ipmi_delloem_main()
342 * Input: intf - ipmi interface
343 * argc - no of arguments
344 * argv - argument string array
347 * Return: return code 0 - success
348 * -1 - failure
354 int rc = 0; in ipmi_delloem_lcd_main() local
358 return -1; in ipmi_delloem_lcd_main()
369 return -1; in ipmi_delloem_lcd_main()
372 rc = ipmi_lcd_get_info_wh(intf); in ipmi_delloem_lcd_main()
374 rc = ipmi_lcd_get_info(intf); in ipmi_delloem_lcd_main()
377 rc = ipmi_lcd_get_status(intf); in ipmi_delloem_lcd_main()
384 return -1; in ipmi_delloem_lcd_main()
390 return -1; in ipmi_delloem_lcd_main()
396 return (-1); in ipmi_delloem_lcd_main()
401 return -1; in ipmi_delloem_lcd_main()
409 return -1; in ipmi_delloem_lcd_main()
413 return -1; in ipmi_delloem_lcd_main()
416 rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_CONFIG_NONE, 0xFF, in ipmi_delloem_lcd_main()
419 rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_CONFIG_DEFAULT, 0xFF, in ipmi_delloem_lcd_main()
425 return -1; in ipmi_delloem_lcd_main()
427 rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_CONFIG_USER_DEFINED, in ipmi_delloem_lcd_main()
430 rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_iDRAC_IPV4ADRESS, in ipmi_delloem_lcd_main()
433 rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_IDRAC_MAC_ADDRESS, in ipmi_delloem_lcd_main()
436 rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_OS_SYSTEM_NAME, 0xFF, in ipmi_delloem_lcd_main()
439 rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_SERVICE_TAG, 0xFF, in ipmi_delloem_lcd_main()
442 rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_iDRAC_IPV6ADRESS, in ipmi_delloem_lcd_main()
445 rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_AMBEINT_TEMP, 0xFF, in ipmi_delloem_lcd_main()
448 rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_SYSTEM_WATTS, 0xFF, in ipmi_delloem_lcd_main()
451 rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_ASSET_TAG, 0xFF, in ipmi_delloem_lcd_main()
465 return -1; in ipmi_delloem_lcd_main()
469 return -1; in ipmi_delloem_lcd_main()
472 rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x00, 0XFF, 0, NULL); in ipmi_delloem_lcd_main()
474 rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x01, 0XFF, 0, NULL); in ipmi_delloem_lcd_main()
476 rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x02, 0xFF, 0, NULL); in ipmi_delloem_lcd_main()
478 rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x03, 0xFF, 0, NULL); in ipmi_delloem_lcd_main()
491 return -1; in ipmi_delloem_lcd_main()
495 return -1; in ipmi_delloem_lcd_main()
498 rc = ipmi_lcd_configure_wh(intf, 0xFF, 0xFF, in ipmi_delloem_lcd_main()
501 rc = ipmi_lcd_configure_wh(intf, 0xFF, 0xFF, in ipmi_delloem_lcd_main()
512 rc = ipmi_lcd_configure(intf, IPMI_DELL_LCD_CONFIG_NONE, 0, NULL); in ipmi_delloem_lcd_main()
515 rc = ipmi_lcd_configure(intf, IPMI_DELL_LCD_CONFIG_DEFAULT, 0, NULL); in ipmi_delloem_lcd_main()
521 return -1; in ipmi_delloem_lcd_main()
523 rc = ipmi_lcd_configure(intf, IPMI_DELL_LCD_CONFIG_USER_DEFINED, in ipmi_delloem_lcd_main()
529 return -1; in ipmi_delloem_lcd_main()
532 rc = ipmi_lcd_set_kvm(intf, 1); in ipmi_delloem_lcd_main()
534 rc = ipmi_lcd_set_kvm(intf, 0); in ipmi_delloem_lcd_main()
546 return -1; in ipmi_delloem_lcd_main()
549 rc = ipmi_lcd_set_lock(intf, 0); in ipmi_delloem_lcd_main()
551 rc = ipmi_lcd_set_lock(intf, 1); in ipmi_delloem_lcd_main()
553 rc = ipmi_lcd_set_lock(intf, 2); in ipmi_delloem_lcd_main()
568 return -1; in ipmi_delloem_lcd_main()
574 return -1; in ipmi_delloem_lcd_main()
576 return rc; in ipmi_delloem_lcd_main()
578 /* ipmi_lcd_get_platform_model_name - This function retrieves the platform model
595 int rc = 0; in ipmi_lcd_get_platform_model_name() local
600 rc = ipmi_mc_getsysinfo(intf, field_type, ii, 0, sizeof(lcdstringblock), in ipmi_lcd_get_platform_model_name()
602 if (rc < 0) { in ipmi_lcd_get_platform_model_name()
605 } else if (rc > 0) { in ipmi_lcd_get_platform_model_name()
607 val2str(rc, completion_code_vals)); in ipmi_lcd_get_platform_model_name()
610 /* first block is different - 14 bytes*/ in ipmi_lcd_get_platform_model_name()
619 bytes_to_copy = MIN(lcdstring_len - bytes_copied, in ipmi_lcd_get_platform_model_name()
625 * (ii-1); in ipmi_lcd_get_platform_model_name()
634 return rc; in ipmi_lcd_get_platform_model_name()
640 * Input: intf - ipmi interface
643 * Return: iDRAC6 type 1 - whoville
644 * 0 - others
649 int rc; in ipmi_idracvalidator_command() local
651 rc = ipmi_mc_getsysinfo(intf, IPMI_DELL_IDRAC_VALIDATOR, 2, 0, sizeof(data), in ipmi_idracvalidator_command()
653 if (rc < 0) { in ipmi_idracvalidator_command()
655 return -1; in ipmi_idracvalidator_command()
656 } else if (rc > 0) { in ipmi_idracvalidator_command()
658 val2str(rsp->ccode, completion_code_vals)); */ in ipmi_idracvalidator_command()
659 return -1; in ipmi_idracvalidator_command()
696 * Input: intf - ipmi interface
697 * Global: lcd_mode - lcd mode setting
708 int rc; in ipmi_lcd_get_configure_command_wh() local
709 rc = ipmi_mc_getsysinfo(intf, IPMI_DELL_LCD_CONFIG_SELECTOR, 0, 0, in ipmi_lcd_get_configure_command_wh()
711 if (rc < 0) { in ipmi_lcd_get_configure_command_wh()
713 return -1; in ipmi_lcd_get_configure_command_wh()
714 } else if ((rc == 0xc1) || (rc == 0xcb)){ in ipmi_lcd_get_configure_command_wh()
717 } else if (rc > 0) { in ipmi_lcd_get_configure_command_wh()
719 val2str(rc, completion_code_vals)); in ipmi_lcd_get_configure_command_wh()
720 return -1; in ipmi_lcd_get_configure_command_wh()
729 * Input: intf - ipmi interface
730 * Output: command - user defined / default / none / ipv4 / mac address /
739 int rc; in ipmi_lcd_get_configure_command() local
740 rc = ipmi_mc_getsysinfo(intf, IPMI_DELL_LCD_CONFIG_SELECTOR, 0, 0, in ipmi_lcd_get_configure_command()
742 if (rc < 0) { in ipmi_lcd_get_configure_command()
744 return -1; in ipmi_lcd_get_configure_command()
745 } else if ((rc == 0xc1)||(rc == 0xcb)) { in ipmi_lcd_get_configure_command()
748 return -1; in ipmi_lcd_get_configure_command()
749 } else if (rc > 0) { in ipmi_lcd_get_configure_command()
751 val2str(rc, completion_code_vals)); in ipmi_lcd_get_configure_command()
752 return -1; in ipmi_lcd_get_configure_command()
754 /* rsp->data[0] is the rev */ in ipmi_lcd_get_configure_command()
762 * Input: intf - ipmi interface
763 * command - user defined / default / none / ipv4 / mac address /
773 int rc; in ipmi_lcd_set_configure_command() local
775 data[1] = command; /* command - custom, default, none */ in ipmi_lcd_set_configure_command()
776 rc = ipmi_mc_setsysinfo(intf, 2, data); in ipmi_lcd_set_configure_command()
777 if (rc < 0) { in ipmi_lcd_set_configure_command()
779 return -1; in ipmi_lcd_set_configure_command()
780 } else if ((rc == 0xc1) || (rc == 0xcb)) { in ipmi_lcd_set_configure_command()
783 } else if (rc > 0) { in ipmi_lcd_set_configure_command()
785 val2str(rc, completion_code_vals)); in ipmi_lcd_set_configure_command()
786 return -1; in ipmi_lcd_set_configure_command()
794 * Input: intf - ipmi interface
795 * mode - user defined / default / none
796 * lcdquallifier - lcd quallifier id
797 * errordisp - error number
807 int rc; in ipmi_lcd_set_configure_command_wh() local
811 data[1] = mode & 0xFF; /* command - custom, default, none*/ in ipmi_lcd_set_configure_command_wh()
816 data[1] = (lcd_mode.lcdmode) & 0xFF; /* command - custom, default, none*/ in ipmi_lcd_set_configure_command_wh()
823 data[5] = (lcd_mode.lcdquallifier) | 0x01; /* command - custom, default, none*/ in ipmi_lcd_set_configure_command_wh()
825 data[5] = (lcd_mode.lcdquallifier) & 0xFE; /* command - custom, default, none*/ in ipmi_lcd_set_configure_command_wh()
827 data[5] = (lcd_mode.lcdquallifier) | 0x02; /* command - custom, default, none*/ in ipmi_lcd_set_configure_command_wh()
839 rc = ipmi_mc_setsysinfo(intf, 13, data); in ipmi_lcd_set_configure_command_wh()
840 if (rc < 0) { in ipmi_lcd_set_configure_command_wh()
842 return -1; in ipmi_lcd_set_configure_command_wh()
843 } else if ((rc == 0xc1) || (rc == 0xcb)) { in ipmi_lcd_set_configure_command_wh()
846 } else if (rc > 0) { in ipmi_lcd_set_configure_command_wh()
848 val2str(rc, completion_code_vals)); in ipmi_lcd_set_configure_command_wh()
849 return -1; in ipmi_lcd_set_configure_command_wh()
857 * Input: intf - ipmi interface
858 * lcdstring - new string to be updated
859 * max_length - length of the string
870 int ii, rc; in ipmi_lcd_get_single_line_text() local
873 rc = ipmi_mc_getsysinfo(intf, IPMI_DELL_LCD_STRING_SELECTOR, ii, 0, in ipmi_lcd_get_single_line_text()
875 if (rc < 0) { in ipmi_lcd_get_single_line_text()
877 return -1; in ipmi_lcd_get_single_line_text()
878 } else if (rc > 0) { in ipmi_lcd_get_single_line_text()
880 val2str(rc, completion_code_vals)); in ipmi_lcd_get_single_line_text()
881 return -1; in ipmi_lcd_get_single_line_text()
883 /* first block is different - 14 bytes*/ in ipmi_lcd_get_single_line_text()
894 bytes_to_copy = MIN(lcdstring_len - bytes_copied, in ipmi_lcd_get_single_line_text()
900 * (ii-1); in ipmi_lcd_get_single_line_text()
915 * Input: intf - ipmi interface
924 int rc; in ipmi_lcd_get_info_wh() local
927 return -1; in ipmi_lcd_get_info_wh()
934 return (-1); in ipmi_lcd_get_info_wh()
942 rc = ipmi_mc_getsysinfo(intf, IPMI_DELL_LCD_GET_CAPS_SELECTOR, 0, 0, in ipmi_lcd_get_info_wh()
944 if (rc < 0) { in ipmi_lcd_get_info_wh()
946 return -1; in ipmi_lcd_get_info_wh()
947 } else if ((rc == 0xc1) || (rc == 0xcb)) { in ipmi_lcd_get_info_wh()
950 } else if (rc > 0) { in ipmi_lcd_get_info_wh()
952 val2str(rc, completion_code_vals)); in ipmi_lcd_get_info_wh()
953 return -1; in ipmi_lcd_get_info_wh()
957 rc = ipmi_lcd_get_single_line_text(intf, lcdstring, in ipmi_lcd_get_info_wh()
1001 * Input: intf - ipmi interface
1011 int rc; in ipmi_lcd_get_info() local
1016 return -1; in ipmi_lcd_get_info()
1023 return (-1); in ipmi_lcd_get_info()
1031 rc = ipmi_mc_getsysinfo(intf, IPMI_DELL_LCD_GET_CAPS_SELECTOR, 0, 0, in ipmi_lcd_get_info()
1033 if (rc < 0) { in ipmi_lcd_get_info()
1035 return -1; in ipmi_lcd_get_info()
1036 } else if ((rc == 0xc1) || (rc == 0xcb)) { in ipmi_lcd_get_info()
1039 } else if (rc > 0) { in ipmi_lcd_get_info()
1041 val2str(rc, completion_code_vals)); in ipmi_lcd_get_info()
1042 return -1; in ipmi_lcd_get_info()
1046 rc = ipmi_lcd_get_single_line_text(intf, lcdstring, in ipmi_lcd_get_info()
1059 * Input: intf - ipmi interface
1060 * Output: lcdstatus - KVM Status & Lock Status
1066 int rc; in ipmi_lcd_get_status_val() local
1067 rc = ipmi_mc_getsysinfo(intf, IPMI_DELL_LCD_STATUS_SELECTOR, 0, 0, in ipmi_lcd_get_status_val()
1069 if (rc < 0) { in ipmi_lcd_get_status_val()
1071 return -1; in ipmi_lcd_get_status_val()
1072 } else if ((rc == 0xc1) || (rc == 0xcb)) { in ipmi_lcd_get_status_val()
1075 return -1; in ipmi_lcd_get_status_val()
1076 } else if (rc > 0) { in ipmi_lcd_get_status_val()
1078 val2str(rc, completion_code_vals)); in ipmi_lcd_get_status_val()
1079 return -1; in ipmi_lcd_get_status_val()
1100 * Input: intf - ipmi interface
1107 int rc; in CheckLCDSupport() local
1109 rc = ipmi_mc_getsysinfo(intf, IPMI_DELL_LCD_STATUS_SELECTOR, 0, 0, 0, NULL); in CheckLCDSupport()
1110 if (rc == 0) { in CheckLCDSupport()
1118 * Input: lcdstatus - KVM Status & Lock Status
1155 * Input: intf - ipmi interface
1157 * Return: -1 on error
1163 int rc=0; in ipmi_lcd_get_status() local
1165 rc =ipmi_lcd_get_status_val( intf, &lcdstatus); in ipmi_lcd_get_status()
1166 if (rc < 0) { in ipmi_lcd_get_status()
1167 return -1; in ipmi_lcd_get_status()
1170 return rc; in ipmi_lcd_get_status()
1176 * Input: intf - ipmi interface
1177 * status - Inactive / Active
1179 * Return: -1 on error
1187 int rc=0; in ipmi_lcd_set_kvm() local
1191 rc = ipmi_lcd_get_status_val(intf,&lcdstatus); in ipmi_lcd_set_kvm()
1192 if (rc < 0) { in ipmi_lcd_set_kvm()
1193 return -1; in ipmi_lcd_set_kvm()
1201 data[1] = status; /* active- incative*/ in ipmi_lcd_set_kvm()
1202 data[2] = lcdstatus.lock_status; /* full-veiw-locked */ in ipmi_lcd_set_kvm()
1203 rsp = intf->sendrecv(intf, &req); in ipmi_lcd_set_kvm()
1206 rc= -1; in ipmi_lcd_set_kvm()
1207 } else if ((rsp->ccode == 0xc1) || (rsp->ccode == 0xcb)) { in ipmi_lcd_set_kvm()
1210 return -1; in ipmi_lcd_set_kvm()
1211 } else if (rsp->ccode > 0) { in ipmi_lcd_set_kvm()
1213 val2str(rsp->ccode, completion_code_vals)); in ipmi_lcd_set_kvm()
1214 rc= -1; in ipmi_lcd_set_kvm()
1216 return rc; in ipmi_lcd_set_kvm()
1222 * Input: intf - ipmi interface
1223 * lock - View and modify / View only / Diabled
1225 * Return: -1 on error
1233 int rc =0; in ipmi_lcd_set_lock() local
1237 rc = ipmi_lcd_get_status_val(intf,&lcdstatus); in ipmi_lcd_set_lock()
1238 if (rc < 0) { in ipmi_lcd_set_lock()
1239 return -1; in ipmi_lcd_set_lock()
1247 data[1] = lcdstatus.vKVM_status; /* active- incative */ in ipmi_lcd_set_lock()
1248 data[2] = lock; /* full- veiw-locked */ in ipmi_lcd_set_lock()
1249 rsp = intf->sendrecv(intf, &req); in ipmi_lcd_set_lock()
1252 rc = -1; in ipmi_lcd_set_lock()
1253 } else if ((rsp->ccode == 0xc1) || (rsp->ccode == 0xcb)) { in ipmi_lcd_set_lock()
1256 rc = -1; in ipmi_lcd_set_lock()
1257 } else if (rsp->ccode > 0) { in ipmi_lcd_set_lock()
1259 val2str(rsp->ccode, completion_code_vals)); in ipmi_lcd_set_lock()
1260 rc= -1; in ipmi_lcd_set_lock()
1262 return rc; in ipmi_lcd_set_lock()
1268 * Input: intf - ipmi interface
1269 * text - lcd string
1271 * Return: -1 on error
1281 int rc = 0; in ipmi_lcd_set_single_line_text() local
1284 return (-1); in ipmi_lcd_set_single_line_text()
1290 int size_of_copy = MIN((bytes_to_store - bytes_stored), in ipmi_lcd_set_single_line_text()
1303 int size_of_copy = MIN((bytes_to_store - bytes_stored), in ipmi_lcd_set_single_line_text()
1313 rc = ipmi_mc_setsysinfo(intf, 18, data); in ipmi_lcd_set_single_line_text()
1314 if (rc < 0) { in ipmi_lcd_set_single_line_text()
1316 rc = -1; in ipmi_lcd_set_single_line_text()
1317 } else if (rc > 0) { in ipmi_lcd_set_single_line_text()
1319 val2str(rc, completion_code_vals)); in ipmi_lcd_set_single_line_text()
1320 rc = -1; in ipmi_lcd_set_single_line_text()
1324 return rc; in ipmi_lcd_set_single_line_text()
1330 * Input: intf - ipmi interface
1331 * text - lcd string
1332 * line_number- line number
1334 * Return: -1 on error
1340 int rc = 0; in ipmi_lcd_set_text() local
1342 rc = ipmi_mc_getsysinfo(intf, IPMI_DELL_LCD_GET_CAPS_SELECTOR, 0, 0, in ipmi_lcd_set_text()
1344 if (rc < 0) { in ipmi_lcd_set_text()
1346 return -1; in ipmi_lcd_set_text()
1347 } else if (rc > 0) { in ipmi_lcd_set_text()
1349 val2str(rc, completion_code_vals)); in ipmi_lcd_set_text()
1350 return -1; in ipmi_lcd_set_text()
1353 rc = ipmi_lcd_set_single_line_text(intf, text); in ipmi_lcd_set_text()
1356 rc = -1; in ipmi_lcd_set_text()
1358 return rc; in ipmi_lcd_set_text()
1364 * Input: intf - ipmi interface
1365 * lcdquallifier- lcd quallifier
1366 * errordisp - error number
1367 * line_number-line number
1368 * text - lcd string
1370 * Return: -1 on error
1377 int rc = 0; in ipmi_lcd_configure_wh() local
1380 rc = ipmi_lcd_set_text(intf, text, line_number); in ipmi_lcd_configure_wh()
1382 if (rc == 0) { in ipmi_lcd_configure_wh()
1383 rc = ipmi_lcd_set_configure_command_wh(intf, mode ,lcdquallifier,errordisp); in ipmi_lcd_configure_wh()
1385 return rc; in ipmi_lcd_configure_wh()
1391 * Input: intf - ipmi interface
1392 * command- lcd command
1393 * line_number-line number
1394 * text - lcd string
1396 * Return: -1 on error
1403 int rc = 0; in ipmi_lcd_configure() local
1405 rc = ipmi_lcd_set_text(intf, text, line_number); in ipmi_lcd_configure()
1407 if (rc == 0) { in ipmi_lcd_configure()
1408 rc = ipmi_lcd_set_configure_command(intf, command); in ipmi_lcd_configure()
1410 return rc; in ipmi_lcd_configure()
1431 " Set LCD text displayed during non-fault conditions"); in ipmi_lcd_usage()
1439 " Allows you to set the LCD mode and user-defined string."); in ipmi_lcd_usage()
1469 " Show LCD text that is displayed during non-fault conditions"); in ipmi_lcd_usage()
1501 * Input: intf - ipmi interface
1502 * argc - no of arguments
1503 * argv - argument string array
1506 * Return: return code 0 - success
1507 * -1 - failure
1512 int rc = 0; in ipmi_delloem_mac_main() local
1513 int currIdInt = -1; in ipmi_delloem_mac_main()
1521 rc = ipmi_macinfo(intf, 0xff); in ipmi_delloem_mac_main()
1523 rc = ipmi_macinfo(intf, 0xff); in ipmi_delloem_mac_main()
1528 return -1; in ipmi_delloem_mac_main()
1532 "Invalid NIC number. The NIC number should be between 0-8"); in ipmi_delloem_mac_main()
1533 return -1; in ipmi_delloem_mac_main()
1537 "Invalid NIC number. The NIC number should be between 0-8"); in ipmi_delloem_mac_main()
1538 return -1; in ipmi_delloem_mac_main()
1540 rc = ipmi_macinfo(intf, currIdInt); in ipmi_delloem_mac_main()
1544 return rc; in ipmi_delloem_mac_main()
1594 rsp = intf->sendrecv(intf, &req); in ipmi_macinfo_drac_idrac_virtual_mac()
1596 return -1; in ipmi_macinfo_drac_idrac_virtual_mac()
1598 if (rsp->ccode > 0) { in ipmi_macinfo_drac_idrac_virtual_mac()
1599 return -1; in ipmi_macinfo_drac_idrac_virtual_mac()
1606 memcpy(VirtualMacAddress, ((rsp->data) + 1), MACADDRESSLENGH); in ipmi_macinfo_drac_idrac_virtual_mac()
1614 memcpy(VirtualMacAddress, ((rsp->data) + 1 + MACADDRESSLENGH), in ipmi_macinfo_drac_idrac_virtual_mac()
1623 memcpy(VirtualMacAddress, ((rsp->data) + VIRTUAL_MAC_OFFSET), in ipmi_macinfo_drac_idrac_virtual_mac()
1632 return -1; in ipmi_macinfo_drac_idrac_virtual_mac()
1653 printf("%02x:", VirtualMacAddress[j]); in ipmi_macinfo_drac_idrac_virtual_mac()
1655 printf("%02x", VirtualMacAddress[j]); in ipmi_macinfo_drac_idrac_virtual_mac()
1693 rsp = intf->sendrecv(intf, &req); in ipmi_macinfo_drac_idrac_mac()
1696 return -1; in ipmi_macinfo_drac_idrac_mac()
1698 if (rsp->ccode > 0) { in ipmi_macinfo_drac_idrac_mac()
1700 val2str(rsp->ccode, completion_code_vals)); in ipmi_macinfo_drac_idrac_mac()
1701 return -1; in ipmi_macinfo_drac_idrac_mac()
1703 memcpy(iDRAC6MacAddressByte, ((rsp->data) + PARAM_REV_OFFSET), in ipmi_macinfo_drac_idrac_mac()
1725 printf("%02x:", iDRAC6MacAddressByte[j]); in ipmi_macinfo_drac_idrac_mac()
1727 printf("%02x", iDRAC6MacAddressByte[j]); in ipmi_macinfo_drac_idrac_mac()
1735 * Input: intf - ipmi interface
1736 * NicNum - NIC number
1763 rsp = intf->sendrecv(intf, &req); in ipmi_macinfo_10g()
1766 return -1; in ipmi_macinfo_10g()
1768 if (rsp->ccode > 0) { in ipmi_macinfo_10g()
1770 val2str(rsp->ccode, completion_code_vals)); in ipmi_macinfo_10g()
1771 return -1; in ipmi_macinfo_10g()
1773 …Total_No_NICs = (uint8_t)rsp->data[0 + PARAM_REV_OFFSET]; /* Byte 1: Total Number of Embedded NICs… in ipmi_macinfo_10g()
1780 ((rsp->data) + PARAM_REV_OFFSET+TOTAL_N0_NICS_INDEX), in ipmi_macinfo_10g()
1788 printf("%02x:", in ipmi_macinfo_10g()
1791 printf("%02x", in ipmi_macinfo_10g()
1804 * Input: intf - ipmi interface
1842 rsp = intf->sendrecv(intf, &req); in ipmi_macinfo_11g()
1845 return -1; in ipmi_macinfo_11g()
1847 if (rsp->ccode > 0) { in ipmi_macinfo_11g()
1849 val2str(rsp->ccode, completion_code_vals)); in ipmi_macinfo_11g()
1850 return -1; in ipmi_macinfo_11g()
1853 maxlen = (uint8_t)rsp->data[0 + PARAM_REV_OFFSET]; in ipmi_macinfo_11g()
1873 rsp = intf->sendrecv(intf, &req); in ipmi_macinfo_11g()
1876 return -1; in ipmi_macinfo_11g()
1878 if (rsp->ccode > 0) { in ipmi_macinfo_11g()
1880 val2str(rsp->ccode, completion_code_vals)); in ipmi_macinfo_11g()
1881 return -1; in ipmi_macinfo_11g()
1884 ((rsp->data)+PARAM_REV_OFFSET), len); in ipmi_macinfo_11g()
1891 printf("%02x:", in ipmi_macinfo_11g()
1894 printf("%02x", in ipmi_macinfo_11g()
1915 * Input: intf - ipmi interface
1934 return (-1); in ipmi_macinfo()
1960 " Shows the MAC address of specified LOM. 0-7 System LOM, 8- DRAC/iDRAC."); in ipmi_mac_usage()
1968 * Input: intf - ipmi interface
1969 * argc - no of arguments
1970 * argv - argument string array
1973 * Return: return code 0 - success
1974 * -1 - failure
1979 int rc = 0; in ipmi_delloem_lan_main() local
1990 return -1; in ipmi_delloem_lan_main()
1995 return -1; in ipmi_delloem_lan_main()
2002 return -1; in ipmi_delloem_lan_main()
2005 return (-1); in ipmi_delloem_lan_main()
2008 return (-1); in ipmi_delloem_lan_main()
2011 return (-1); in ipmi_delloem_lan_main()
2013 rc = ipmi_lan_set_nic_selection_12g(intf,nic_set); in ipmi_delloem_lan_main()
2018 return -1; in ipmi_delloem_lan_main()
2022 return (-1); in ipmi_delloem_lan_main()
2024 rc = ipmi_lan_set_nic_selection(intf,nic_selection); in ipmi_delloem_lan_main()
2030 rc = ipmi_lan_get_nic_selection(intf); in ipmi_delloem_lan_main()
2031 return rc; in ipmi_delloem_lan_main()
2033 rc = ipmi_lan_get_active_nic(intf); in ipmi_delloem_lan_main()
2034 return rc; in ipmi_delloem_lan_main()
2040 return -1; in ipmi_delloem_lan_main()
2042 return rc; in ipmi_delloem_lan_main()
2071 rsp = intf->sendrecv(intf, &req); in get_nic_selection_mode_12g()
2074 return -1; in get_nic_selection_mode_12g()
2075 } else if (rsp->ccode > 0) { in get_nic_selection_mode_12g()
2077 val2str(rsp->ccode, completion_code_vals)); in get_nic_selection_mode_12g()
2078 return -1; in get_nic_selection_mode_12g()
2080 nic_set[0] = rsp->data[0]; in get_nic_selection_mode_12g()
2081 nic_set[1] = rsp->data[1]; in get_nic_selection_mode_12g()
2286 rsp = intf->sendrecv(intf, &req); in ipmi_lan_set_nic_selection_12g()
2289 return -1; in ipmi_lan_set_nic_selection_12g()
2292 && (rsp->ccode == LICENSE_NOT_SUPPORTED))) { in ipmi_lan_set_nic_selection_12g()
2296 return -1; in ipmi_lan_set_nic_selection_12g()
2297 } else if (rsp->ccode > 0) { in ipmi_lan_set_nic_selection_12g()
2299 val2str(rsp->ccode, completion_code_vals)); in ipmi_lan_set_nic_selection_12g()
2300 return -1; in ipmi_lan_set_nic_selection_12g()
2321 rsp = intf->sendrecv(intf, &req); in ipmi_lan_set_nic_selection()
2324 return -1; in ipmi_lan_set_nic_selection()
2325 } else if (rsp->ccode > 0) { in ipmi_lan_set_nic_selection()
2327 val2str(rsp->ccode, completion_code_vals)); in ipmi_lan_set_nic_selection()
2328 return -1; in ipmi_lan_set_nic_selection()
2341 uint8_t nic_selection=-1; in ipmi_lan_get_nic_selection()
2354 rsp = intf->sendrecv(intf, &req); in ipmi_lan_get_nic_selection()
2357 return -1; in ipmi_lan_get_nic_selection()
2358 } else if (rsp->ccode > 0) { in ipmi_lan_get_nic_selection()
2360 val2str(rsp->ccode, completion_code_vals)); in ipmi_lan_get_nic_selection()
2361 return -1; in ipmi_lan_get_nic_selection()
2363 nic_selection = rsp->data[0]; in ipmi_lan_get_nic_selection()
2365 nic_selection_failover = rsp->data[1]; in ipmi_lan_get_nic_selection()
2369 printf("%s\n",NIC_Selection_Mode_String_12g[nic_selection-1]); in ipmi_lan_get_nic_selection()
2372 NIC_Selection_Mode_String_12g[nic_selection-1]); in ipmi_lan_get_nic_selection()
2383 return -1; in ipmi_lan_get_nic_selection()
2410 rsp = intf->sendrecv(intf, &req); in ipmi_lan_get_active_nic()
2413 return -1; in ipmi_lan_get_active_nic()
2414 } else if (rsp->ccode > 0) { in ipmi_lan_get_active_nic()
2416 val2str(rsp->ccode, completion_code_vals)); in ipmi_lan_get_active_nic()
2417 return -1; in ipmi_lan_get_active_nic()
2419 current_lom = rsp->data[0]; in ipmi_lan_get_active_nic()
2429 rsp = intf->sendrecv(intf, &req); in ipmi_lan_get_active_nic()
2432 return -1; in ipmi_lan_get_active_nic()
2433 } else if (rsp->ccode > 0) { in ipmi_lan_get_active_nic()
2435 val2str(rsp->ccode, completion_code_vals)); in ipmi_lan_get_active_nic()
2436 return -1; in ipmi_lan_get_active_nic()
2438 active_nic = rsp->data[1]; in ipmi_lan_get_active_nic()
2451 * - rewrite in ipmi_lan_usage()
2452 * - review in ipmi_lan_usage()
2453 * - make it fit into 80 chars per line in ipmi_lan_usage()
2454 * - this ``shared with Failover None).'' seems like a typo in ipmi_lan_usage()
2511 * Input: intf - ipmi interface
2512 * argc - no of arguments
2513 * argv - argument string array
2516 * Return: return code 0 - success
2517 * -1 - failure
2522 int rc = 0; in ipmi_delloem_powermonitor_main() local
2530 rc = ipmi_powermgmt(intf); in ipmi_delloem_powermonitor_main()
2532 rc = ipmi_powermgmt(intf); in ipmi_delloem_powermonitor_main()
2537 return -1; in ipmi_delloem_powermonitor_main()
2539 rc = ipmi_powermgmt_clear(intf, 1); in ipmi_delloem_powermonitor_main()
2541 rc = ipmi_powermgmt_clear(intf, 0); in ipmi_delloem_powermonitor_main()
2544 return -1; in ipmi_delloem_powermonitor_main()
2549 rc = ipmi_print_get_power_consmpt_data(intf,watt); in ipmi_delloem_powermonitor_main()
2551 rc = ipmi_print_get_power_consmpt_data(intf, watt); in ipmi_delloem_powermonitor_main()
2553 rc = ipmi_print_get_power_consmpt_data(intf, btuphr); in ipmi_delloem_powermonitor_main()
2556 return -1; in ipmi_delloem_powermonitor_main()
2561 rc = ipmi_print_power_consmpt_history(intf,watt); in ipmi_delloem_powermonitor_main()
2563 rc = ipmi_print_power_consmpt_history(intf, watt); in ipmi_delloem_powermonitor_main()
2565 rc = ipmi_print_power_consmpt_history(intf, btuphr); in ipmi_delloem_powermonitor_main()
2568 return -1; in ipmi_delloem_powermonitor_main()
2573 rc=ipmi_print_power_cap(intf,watt); in ipmi_delloem_powermonitor_main()
2575 rc = ipmi_print_power_cap(intf, watt); in ipmi_delloem_powermonitor_main()
2577 rc = ipmi_print_power_cap(intf, btuphr); in ipmi_delloem_powermonitor_main()
2580 return -1; in ipmi_delloem_powermonitor_main()
2587 return -1; in ipmi_delloem_powermonitor_main()
2592 return -1; in ipmi_delloem_powermonitor_main()
2597 return (-1); in ipmi_delloem_powermonitor_main()
2603 rc = ipmi_set_power_cap(intf,watt,val); in ipmi_delloem_powermonitor_main()
2605 rc = ipmi_set_power_cap(intf, btuphr,val); in ipmi_delloem_powermonitor_main()
2607 rc = ipmi_set_power_cap(intf,percent,val); in ipmi_delloem_powermonitor_main()
2610 return -1; in ipmi_delloem_powermonitor_main()
2618 return -1; in ipmi_delloem_powermonitor_main()
2620 return rc; in ipmi_delloem_powermonitor_main()
2626 * Input: rawTime - ipmi time format
2627 * Output: strTime - gmtime format
2644 * Input: sensorOwner - sensor owner id
2645 * sensorNumber - sensor id
2646 * intf - ipmi interface
2647 * Output: sensorReadingData - ipmi response structure
2657 int rc = 0; in ipmi_get_sensor_reading() local
2665 return -1; in ipmi_get_sensor_reading()
2668 rsp = intf->sendrecv(intf, &req); in ipmi_get_sensor_reading()
2671 } else if (rsp->ccode > 0) { in ipmi_get_sensor_reading()
2674 memcpy(pSensorReadingData, rsp->data, sizeof(SensorReadingType)); in ipmi_get_sensor_reading()
2676 if (rsp->ccode != 0) { in ipmi_get_sensor_reading()
2677 rc = 1; in ipmi_get_sensor_reading()
2680 if ((!(rsp->data[1]& 0xC0)) || ((rsp->data[1] & 0x20))) { in ipmi_get_sensor_reading()
2681 rc =1; in ipmi_get_sensor_reading()
2683 return rc; in ipmi_get_sensor_reading()
2689 * Input: intf - ipmi interface
2690 * Global: PowercapSetable_flag - power cap status
2708 rsp = intf->sendrecv(intf, &req); in ipmi_get_power_capstatus_command()
2711 return -1; in ipmi_get_power_capstatus_command()
2712 } else if (( iDRAC_FLAG_12_13 ) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) { in ipmi_get_power_capstatus_command()
2715 return -1; /* Return Error as unlicensed */ in ipmi_get_power_capstatus_command()
2716 } else if (rsp->ccode > 0) { in ipmi_get_power_capstatus_command()
2718 val2str(rsp->ccode, completion_code_vals)); in ipmi_get_power_capstatus_command()
2719 return -1; in ipmi_get_power_capstatus_command()
2721 if (rsp->data[0] & 0x02) { in ipmi_get_power_capstatus_command()
2724 if (rsp->data[0] & 0x01) { in ipmi_get_power_capstatus_command()
2733 * Input: intf - ipmi interface
2734 * val - power cap status
2746 return -1; in ipmi_set_power_capstatus_command()
2750 return -1; in ipmi_set_power_capstatus_command()
2759 rsp = intf->sendrecv(intf, &req); in ipmi_set_power_capstatus_command()
2762 return -1; in ipmi_set_power_capstatus_command()
2763 } else if ((iDRAC_FLAG_12_13) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) { in ipmi_set_power_capstatus_command()
2766 return -1; /* return unlicensed Error code */ in ipmi_set_power_capstatus_command()
2767 } else if (rsp->ccode > 0) { in ipmi_set_power_capstatus_command()
2769 val2str(rsp->ccode, completion_code_vals)); in ipmi_set_power_capstatus_command()
2770 return -1; in ipmi_set_power_capstatus_command()
2778 * Input: intf - ipmi interface
2822 rsp = intf->sendrecv(intf, &req); in ipmi_powermgmt()
2825 return -1; in ipmi_powermgmt()
2827 if (rsp->ccode != 0) { in ipmi_powermgmt()
2829 "Error getting power management information, return code %x", in ipmi_powermgmt()
2830 rsp->ccode); in ipmi_powermgmt()
2831 return -1; in ipmi_powermgmt()
2833 bmctimeconvval=(uint32_t*)rsp->data; in ipmi_powermgmt()
2851 rsp = intf->sendrecv(intf, &req); in ipmi_powermgmt()
2854 return -1; in ipmi_powermgmt()
2857 if ((iDRAC_FLAG_12_13) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) { in ipmi_powermgmt()
2860 return -1; in ipmi_powermgmt()
2861 } else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb)) { in ipmi_powermgmt()
2864 return -1; in ipmi_powermgmt()
2865 }else if (rsp->ccode != 0) { in ipmi_powermgmt()
2867 "Error getting power management information, return code %x", in ipmi_powermgmt()
2868 rsp->ccode); in ipmi_powermgmt()
2869 return -1; in ipmi_powermgmt()
2872 pwrMonitorInfo = (IPMI_POWER_MONITOR*)rsp->data; in ipmi_powermgmt()
2874 cumStartTimeConv = BSWAP_32(pwrMonitorInfo->cumStartTime); in ipmi_powermgmt()
2875 cumReadingConv = BSWAP_32(pwrMonitorInfo->cumReading); in ipmi_powermgmt()
2876 maxPeakStartTimeConv = BSWAP_32(pwrMonitorInfo->maxPeakStartTime); in ipmi_powermgmt()
2877 ampPeakTimeConv = BSWAP_32(pwrMonitorInfo->ampPeakTime); in ipmi_powermgmt()
2878 ampReadingConv = BSWAP_16(pwrMonitorInfo->ampReading); in ipmi_powermgmt()
2879 wattPeakTimeConv = BSWAP_32(pwrMonitorInfo->wattPeakTime); in ipmi_powermgmt()
2880 wattReadingConv = BSWAP_16(pwrMonitorInfo->wattReading); in ipmi_powermgmt()
2882 cumStartTimeConv = pwrMonitorInfo->cumStartTime; in ipmi_powermgmt()
2883 cumReadingConv = pwrMonitorInfo->cumReading; in ipmi_powermgmt()
2884 maxPeakStartTimeConv = pwrMonitorInfo->maxPeakStartTime; in ipmi_powermgmt()
2885 ampPeakTimeConv = pwrMonitorInfo->ampPeakTime; in ipmi_powermgmt()
2886 ampReadingConv = pwrMonitorInfo->ampReading; in ipmi_powermgmt()
2887 wattPeakTimeConv = pwrMonitorInfo->wattPeakTime; in ipmi_powermgmt()
2888 wattReadingConv = pwrMonitorInfo->wattReading; in ipmi_powermgmt()
2929 * Input: intf - ipmi interface
2930 * clearValue - peakpower / cumulativepower
2956 rsp = intf->sendrecv(intf, &req); in ipmi_powermgmt_clear()
2959 return -1; in ipmi_powermgmt_clear()
2961 && (rsp->ccode == LICENSE_NOT_SUPPORTED)) { in ipmi_powermgmt_clear()
2964 return -1; in ipmi_powermgmt_clear()
2965 } else if (rsp->ccode == 0xc1) { in ipmi_powermgmt_clear()
2968 return -1; in ipmi_powermgmt_clear()
2969 } else if (rsp->ccode != 0) { in ipmi_powermgmt_clear()
2971 val2str(rsp->ccode, completion_code_vals)); in ipmi_powermgmt_clear()
2972 return -1; in ipmi_powermgmt_clear()
2980 * Input: powerinwatt - power in watt
2997 * Input: powerinbtuphr - power in btuphr
3015 * Input: intf - ipmi interface
3016 * unit - watt / btuphr
3034 rsp = intf->sendrecv(intf, &req); in ipmi_get_power_headroom_command()
3037 return -1; in ipmi_get_power_headroom_command()
3039 && (rsp->ccode == LICENSE_NOT_SUPPORTED)) { in ipmi_get_power_headroom_command()
3042 return -1; in ipmi_get_power_headroom_command()
3043 } else if ((rsp->ccode == 0xc1) || (rsp->ccode == 0xcb)) { in ipmi_get_power_headroom_command()
3046 return -1; in ipmi_get_power_headroom_command()
3047 } else if (rsp->ccode > 0) { in ipmi_get_power_headroom_command()
3049 val2str(rsp->ccode, completion_code_vals)); in ipmi_get_power_headroom_command()
3050 return -1; in ipmi_get_power_headroom_command()
3054 printf("power headroom Data : %x %x %x %x ", rsp->data[0], in ipmi_get_power_headroom_command()
3055 rsp->data[1], rsp->data[2], rsp->data[3]); in ipmi_get_power_headroom_command()
3057 powerheadroom= *(( POWER_HEADROOM *)rsp->data); in ipmi_get_power_headroom_command()
3083 * Input: intf - ipmi interface
3105 return -1; in ipmi_get_power_consumption_data()
3107 sensor_number = sdr->record.common->keys.sensor_num; in ipmi_get_power_consumption_data()
3110 sdr->record.common->keys.sensor_num, in ipmi_get_power_consumption_data()
3111 sdr->record.common->keys.owner_id, in ipmi_get_power_consumption_data()
3112 sdr->record.common->keys.lun, in ipmi_get_power_consumption_data()
3113 sdr->record.common->keys.channel); in ipmi_get_power_consumption_data()
3114 if (rsp == NULL || rsp->ccode != 0) { in ipmi_get_power_consumption_data()
3117 return -1; in ipmi_get_power_consumption_data()
3119 readingbtuphr = sdr_convert_sensor_reading(sdr->record.full, in ipmi_get_power_consumption_data()
3121 warning_threshbtuphr = sdr_convert_sensor_reading(sdr->record.full, in ipmi_get_power_consumption_data()
3122 rsp->data[4]); in ipmi_get_power_consumption_data()
3123 failure_threshbtuphr = sdr_convert_sensor_reading(sdr->record.full, in ipmi_get_power_consumption_data()
3124 rsp->data[5]); in ipmi_get_power_consumption_data()
3146 * Input: intf - ipmi interface
3147 * Output: instpowerconsumptiondata - instant Power consumption information
3168 rsp = intf->sendrecv(intf, &req); in ipmi_get_instan_power_consmpt_data()
3171 return -1; in ipmi_get_instan_power_consmpt_data()
3173 && (rsp->ccode == LICENSE_NOT_SUPPORTED)) { in ipmi_get_instan_power_consmpt_data()
3176 return -1; in ipmi_get_instan_power_consmpt_data()
3177 } else if ((rsp->ccode == 0xc1) || (rsp->ccode == 0xcb)) { in ipmi_get_instan_power_consmpt_data()
3180 return -1; in ipmi_get_instan_power_consmpt_data()
3181 } else if (rsp->ccode != 0) { in ipmi_get_instan_power_consmpt_data()
3183 val2str(rsp->ccode, completion_code_vals)); in ipmi_get_instan_power_consmpt_data()
3184 return -1; in ipmi_get_instan_power_consmpt_data()
3186 *instpowerconsumptiondata = *((IPMI_INST_POWER_CONSUMPTION_DATA *)(rsp->data)); in ipmi_get_instan_power_consmpt_data()
3188 …instpowerconsumptiondata->instanpowerconsumption = BSWAP_16(instpowerconsumptiondata->instanpowerc… in ipmi_get_instan_power_consmpt_data()
3189 instpowerconsumptiondata->instanApms = BSWAP_16(instpowerconsumptiondata->instanApms); in ipmi_get_instan_power_consmpt_data()
3190 instpowerconsumptiondata->resv1 = BSWAP_16(instpowerconsumptiondata->resv1); in ipmi_get_instan_power_consmpt_data()
3198 * Input: instpowerconsumptiondata - instant Power consumption information
3218 * Input: intf - ipmi interface
3219 * unit - watt / btuphr
3227 int rc = 0; in ipmi_print_get_power_consmpt_data() local
3230 rc = ipmi_get_power_consumption_data(intf, unit); in ipmi_print_get_power_consmpt_data()
3231 if (rc == (-1)) { in ipmi_print_get_power_consmpt_data()
3232 return rc; in ipmi_print_get_power_consmpt_data()
3234 rc = ipmi_get_instan_power_consmpt_data(intf, &instpowerconsumptiondata); in ipmi_print_get_power_consmpt_data()
3235 if (rc == (-1)) { in ipmi_print_get_power_consmpt_data()
3236 return rc; in ipmi_print_get_power_consmpt_data()
3239 rc = ipmi_get_power_headroom_command(intf, unit); in ipmi_print_get_power_consmpt_data()
3240 if (rc == (-1)) { in ipmi_print_get_power_consmpt_data()
3241 return rc; in ipmi_print_get_power_consmpt_data()
3243 return rc; in ipmi_print_get_power_consmpt_data()
3249 * Input: intf - ipmi interface
3250 * Output: pavgpower- average power consumption information
3258 int rc; in ipmi_get_avgpower_consmpt_history() local
3260 rc = ipmi_mc_getsysinfo(intf, 0xeb, 0, 0, sizeof(*pavgpower), pavgpower); in ipmi_get_avgpower_consmpt_history()
3261 if (rc < 0) { in ipmi_get_avgpower_consmpt_history()
3264 return -1; in ipmi_get_avgpower_consmpt_history()
3265 } else if ((iDRAC_FLAG_12_13) && (rc == LICENSE_NOT_SUPPORTED)) { in ipmi_get_avgpower_consmpt_history()
3268 return -1; in ipmi_get_avgpower_consmpt_history()
3269 } else if ((rc == 0xc1) || (rc == 0xcb)) { in ipmi_get_avgpower_consmpt_history()
3272 return -1; in ipmi_get_avgpower_consmpt_history()
3273 } else if (rc != 0) { in ipmi_get_avgpower_consmpt_history()
3276 val2str(rc, completion_code_vals)); in ipmi_get_avgpower_consmpt_history()
3277 return -1; in ipmi_get_avgpower_consmpt_history()
3282 " :%x %x %x %x %x %x %x %x\n\n", in ipmi_get_avgpower_consmpt_history()
3287 pavgpower->lastminutepower = BSWAP_16(pavgpower->lastminutepower); in ipmi_get_avgpower_consmpt_history()
3288 pavgpower->lasthourpower = BSWAP_16(pavgpower->lasthourpower); in ipmi_get_avgpower_consmpt_history()
3289 pavgpower->lastdaypower = BSWAP_16(pavgpower->lastdaypower); in ipmi_get_avgpower_consmpt_history()
3290 pavgpower->lastweakpower = BSWAP_16(pavgpower->lastweakpower); in ipmi_get_avgpower_consmpt_history()
3298 * Input: intf - ipmi interface
3299 * Output: pavgpower- peak power consumption information
3308 int rc; in ipmi_get_peakpower_consmpt_history() local
3309 rc = ipmi_mc_getsysinfo(intf, 0xec, 0, 0, sizeof(*pstPeakpower), in ipmi_get_peakpower_consmpt_history()
3311 if (rc < 0) { in ipmi_get_peakpower_consmpt_history()
3313 return -1; in ipmi_get_peakpower_consmpt_history()
3314 } else if ((iDRAC_FLAG_12_13) && (rc == LICENSE_NOT_SUPPORTED)) { in ipmi_get_peakpower_consmpt_history()
3317 return -1; in ipmi_get_peakpower_consmpt_history()
3318 } else if ((rc == 0xc1) || (rc == 0xcb)) { in ipmi_get_peakpower_consmpt_history()
3321 return -1; in ipmi_get_peakpower_consmpt_history()
3322 } else if (rc != 0) { in ipmi_get_peakpower_consmpt_history()
3324 val2str(rc, completion_code_vals)); in ipmi_get_peakpower_consmpt_history()
3325 return -1; in ipmi_get_peakpower_consmpt_history()
3330 "%x %x %x %x %x %x %x %x %x %x\n " in ipmi_get_peakpower_consmpt_history()
3331 "%x %x %x %x %x %x %x %x %x %x %x %x %x %x\n\n", in ipmi_get_peakpower_consmpt_history()
3340 pstPeakpower->lastminutepower = BSWAP_16(pstPeakpower->lastminutepower); in ipmi_get_peakpower_consmpt_history()
3341 pstPeakpower->lasthourpower = BSWAP_16(pstPeakpower->lasthourpower); in ipmi_get_peakpower_consmpt_history()
3342 pstPeakpower->lastdaypower = BSWAP_16(pstPeakpower->lastdaypower); in ipmi_get_peakpower_consmpt_history()
3343 pstPeakpower->lastweakpower = BSWAP_16(pstPeakpower->lastweakpower); in ipmi_get_peakpower_consmpt_history()
3344 pstPeakpower->lastminutepowertime = BSWAP_32(pstPeakpower->lastminutepowertime); in ipmi_get_peakpower_consmpt_history()
3345 pstPeakpower->lasthourpowertime = BSWAP_32(pstPeakpower->lasthourpowertime); in ipmi_get_peakpower_consmpt_history()
3346 pstPeakpower->lastdaypowertime = BSWAP_32(pstPeakpower->lastdaypowertime); in ipmi_get_peakpower_consmpt_history()
3347 pstPeakpower->lastweekpowertime = BSWAP_32(pstPeakpower->lastweekpowertime); in ipmi_get_peakpower_consmpt_history()
3355 * Input: intf - ipmi interface
3356 * Output: pavgpower- peak power consumption information
3365 int rc; in ipmi_get_minpower_consmpt_history() local
3366 rc = ipmi_mc_getsysinfo(intf, 0xed, 0, 0, sizeof(*pstMinpower), in ipmi_get_minpower_consmpt_history()
3368 if (rc < 0) { in ipmi_get_minpower_consmpt_history()
3370 return -1; in ipmi_get_minpower_consmpt_history()
3371 } else if ((iDRAC_FLAG_12_13) && (rc == LICENSE_NOT_SUPPORTED)) { in ipmi_get_minpower_consmpt_history()
3374 return -1; in ipmi_get_minpower_consmpt_history()
3375 } else if ((rc == 0xc1) || (rc == 0xcb)) { in ipmi_get_minpower_consmpt_history()
3378 return -1; in ipmi_get_minpower_consmpt_history()
3379 } else if (rc != 0) { in ipmi_get_minpower_consmpt_history()
3381 val2str(rc, completion_code_vals)); in ipmi_get_minpower_consmpt_history()
3382 return -1; in ipmi_get_minpower_consmpt_history()
3387 "%x %x %x %x %x %x %x %x %x %x\n " in ipmi_get_minpower_consmpt_history()
3388 "%x %x %x %x %x %x %x %x %x %x %x %x %x\n\n", in ipmi_get_minpower_consmpt_history()
3397 pstMinpower->lastminutepower = BSWAP_16(pstMinpower->lastminutepower); in ipmi_get_minpower_consmpt_history()
3398 pstMinpower->lasthourpower = BSWAP_16(pstMinpower->lasthourpower); in ipmi_get_minpower_consmpt_history()
3399 pstMinpower->lastdaypower = BSWAP_16(pstMinpower->lastdaypower); in ipmi_get_minpower_consmpt_history()
3400 pstMinpower->lastweakpower = BSWAP_16(pstMinpower->lastweakpower); in ipmi_get_minpower_consmpt_history()
3401 pstMinpower->lastminutepowertime = BSWAP_32(pstMinpower->lastminutepowertime); in ipmi_get_minpower_consmpt_history()
3402 pstMinpower->lasthourpowertime = BSWAP_32(pstMinpower->lasthourpowertime); in ipmi_get_minpower_consmpt_history()
3403 pstMinpower->lastdaypowertime = BSWAP_32(pstMinpower->lastdaypowertime); in ipmi_get_minpower_consmpt_history()
3404 pstMinpower->lastweekpowertime = BSWAP_32(pstMinpower->lastweekpowertime); in ipmi_get_minpower_consmpt_history()
3412 * Input: intf - ipmi interface
3413 * unit - watt / btuphr
3427 int rc = 0; in ipmi_print_power_consmpt_history() local
3433 rc = ipmi_get_avgpower_consmpt_history(intf, &avgpower); in ipmi_print_power_consmpt_history()
3434 if (rc == (-1)) { in ipmi_print_power_consmpt_history()
3435 return rc; in ipmi_print_power_consmpt_history()
3438 rc = ipmi_get_peakpower_consmpt_history(intf, &stPeakpower); in ipmi_print_power_consmpt_history()
3439 if (rc == (-1)) { in ipmi_print_power_consmpt_history()
3440 return rc; in ipmi_print_power_consmpt_history()
3443 rc = ipmi_get_minpower_consmpt_history(intf, &stMinpower); in ipmi_print_power_consmpt_history()
3444 if (rc == (-1)) { in ipmi_print_power_consmpt_history()
3445 return rc; in ipmi_print_power_consmpt_history()
3447 if (rc != 0) { in ipmi_print_power_consmpt_history()
3448 return rc; in ipmi_print_power_consmpt_history()
3546 return rc; in ipmi_print_power_consmpt_history()
3552 * Input: intf - ipmi interface
3553 * Output: ipmipowercap - power cap information
3561 int rc; in ipmi_get_power_cap() local
3562 rc = ipmi_mc_getsysinfo(intf, IPMI_DELL_POWER_CAP, 0, 0, in ipmi_get_power_cap()
3564 if (rc < 0) { in ipmi_get_power_cap()
3566 return -1; in ipmi_get_power_cap()
3567 } else if ((iDRAC_FLAG_12_13) && (rc == LICENSE_NOT_SUPPORTED)) { in ipmi_get_power_cap()
3570 return -1; in ipmi_get_power_cap()
3571 } else if ((rc == 0xc1) || (rc == 0xcb)) { in ipmi_get_power_cap()
3574 return -1; in ipmi_get_power_cap()
3575 } else if (rc != 0) { in ipmi_get_power_cap()
3577 val2str(rc, completion_code_vals)); in ipmi_get_power_cap()
3578 return -1; in ipmi_get_power_cap()
3582 printf("power cap Data :%x %x %x %x %x %x %x %x %x %x ", in ipmi_get_power_cap()
3588 ipmipowercap->PowerCap = BSWAP_16(ipmipowercap->PowerCap); in ipmi_get_power_cap()
3589 ipmipowercap->MaximumPowerConsmp = BSWAP_16(ipmipowercap->MaximumPowerConsmp); in ipmi_get_power_cap()
3590 ipmipowercap->MinimumPowerConsmp = BSWAP_16(ipmipowercap->MinimumPowerConsmp); in ipmi_get_power_cap()
3591 ipmipowercap->totalnumpowersupp = BSWAP_16(ipmipowercap->totalnumpowersupp); in ipmi_get_power_cap()
3592 ipmipowercap->AvailablePower = BSWAP_16(ipmipowercap->AvailablePower); in ipmi_get_power_cap()
3593 ipmipowercap->SystemThrottling = BSWAP_16(ipmipowercap->SystemThrottling); in ipmi_get_power_cap()
3594 ipmipowercap->Resv = BSWAP_16(ipmipowercap->Resv); in ipmi_get_power_cap()
3602 * Input: intf - ipmi interface
3603 * unit - watt / btuphr
3611 int rc; in ipmi_print_power_cap() local
3614 rc = ipmi_get_power_cap(intf, &ipmipowercap); in ipmi_print_power_cap()
3615 if (rc == 0) { in ipmi_print_power_cap()
3629 return rc; in ipmi_print_power_cap()
3635 * Input: intf - ipmi interface
3636 * unit - watt / btuphr
3637 * val - new power cap value
3644 int rc; in ipmi_set_power_cap() local
3653 return -1; /* Adding the failed condition check */ in ipmi_set_power_cap()
3657 return -1; in ipmi_set_power_cap()
3660 return -1; in ipmi_set_power_cap()
3662 rc = ipmi_mc_getsysinfo(intf, IPMI_DELL_POWER_CAP, 0, 0, in ipmi_set_power_cap()
3664 if (rc < 0) { in ipmi_set_power_cap()
3666 return -1; in ipmi_set_power_cap()
3667 } else if ((iDRAC_FLAG_12_13) && (rc == LICENSE_NOT_SUPPORTED)) { in ipmi_set_power_cap()
3670 return -1; in ipmi_set_power_cap()
3671 } else if (rc == 0xc1) { in ipmi_set_power_cap()
3674 return -1; in ipmi_set_power_cap()
3675 } else if (rc != 0) { in ipmi_set_power_cap()
3677 val2str(rc, completion_code_vals)); in ipmi_set_power_cap()
3678 return -1; in ipmi_set_power_cap()
3682 printf("power cap Data :%x %x %x %x %x %x %x %x %x %x %x ", in ipmi_set_power_cap()
3715 "should be between 0 - 100"); in ipmi_set_power_cap()
3716 return -1; in ipmi_set_power_cap()
3719 - ipmipowercap.MinimumPowerConsmp)) / 100) in ipmi_set_power_cap()
3729 "Cap value is out of boundary conditon it should be between %d - %d", in ipmi_set_power_cap()
3731 return -1; in ipmi_set_power_cap()
3740 lprintf(LOG_ERR, " -%d", maxpowerbtuphr1); in ipmi_set_power_cap()
3741 return -1; in ipmi_set_power_cap()
3743 rc = ipmi_mc_setsysinfo(intf, 13, data); in ipmi_set_power_cap()
3744 if (rc < 0) { in ipmi_set_power_cap()
3746 return -1; in ipmi_set_power_cap()
3747 } else if ((iDRAC_FLAG_12_13) && (rc == LICENSE_NOT_SUPPORTED)) { in ipmi_set_power_cap()
3750 return -1; in ipmi_set_power_cap()
3751 } else if (rc > 0) { in ipmi_set_power_cap()
3753 val2str(rc, completion_code_vals)); in ipmi_set_power_cap()
3754 return -1; in ipmi_set_power_cap()
3757 printf("CC for setpowercap :%d ", rc); in ipmi_set_power_cap()
3834 * Input: intf - ipmi interface
3835 * argc - no of arguments
3836 * argv - argument string array
3839 * Return: return code 0 - success
3840 * -1 - failure
3845 int rc = 0; in ipmi_delloem_vFlash_main() local
3847 rc = ipmi_delloem_vFlash_process(intf, current_arg, argv); in ipmi_delloem_vFlash_main()
3848 return rc; in ipmi_delloem_vFlash_main()
3856 * Output: -
3869 snprintf(un_str, 32, "Unknown (0x%02X)", vflashcompcode); in get_vFlash_compcode_str()
3878 * Return: 0 - success -1 - failure
3897 rsp = intf->sendrecv(intf, &req); in ipmi_get_sd_card_info()
3900 return -1; in ipmi_get_sd_card_info()
3901 } else if (rsp->ccode > 0) { in ipmi_get_sd_card_info()
3903 val2str(rsp->ccode, completion_code_vals)); in ipmi_get_sd_card_info()
3904 return -1; in ipmi_get_sd_card_info()
3907 sdcardinfoblock = (IPMI_DELL_SDCARD_INFO *) (void *) rsp->data; in ipmi_get_sd_card_info()
3910 && (sdcardinfoblock->vflashcompcode == VFL_NOT_LICENSED)) { in ipmi_get_sd_card_info()
3913 return -1; in ipmi_get_sd_card_info()
3914 } else if (sdcardinfoblock->vflashcompcode != 0x00) { in ipmi_get_sd_card_info()
3916 get_vFlash_compcode_str(sdcardinfoblock->vflashcompcode, in ipmi_get_sd_card_info()
3918 return -1; in ipmi_get_sd_card_info()
3921 if (!(sdcardinfoblock->sdcardstatus & 0x04)) { in ipmi_get_sd_card_info()
3926 return (-1); in ipmi_get_sd_card_info()
3930 printf("SD Card size : %8dMB\n", sdcardinfoblock->sdcardsize); in ipmi_get_sd_card_info()
3931 printf("Available size : %8dMB\n", sdcardinfoblock->sdcardavailsize); in ipmi_get_sd_card_info()
3933 (sdcardinfoblock->sdcardstatus & 0x80) ? "Yes" : "No"); in ipmi_get_sd_card_info()
3935 (sdcardinfoblock->sdcardstatus & 0x40) ? "Yes" : "No"); in ipmi_get_sd_card_info()
3937 (sdcardinfoblock->sdcardstatus & 0x20) ? "Yes" : "No"); in ipmi_get_sd_card_info()
3939 (sdcardinfoblock->sdcardstatus & 0x10) ? "Yes" : "No"); in ipmi_get_sd_card_info()
3941 (sdcardinfoblock->sdcardstatus & 0x08) ? "Yes" : "No"); in ipmi_get_sd_card_info()
3942 cardstatus = sdcardinfoblock->sdcardstatus & 0x03; in ipmi_get_sd_card_info()
3947 printf("Bootable partition : %10d\n", sdcardinfoblock->bootpartion); in ipmi_get_sd_card_info()
3954 * Input : intf - ipmi interface, arg index, argv array
3956 * Return: 0 - Success -1 - failure
3961 int rc; in ipmi_delloem_vFlash_process() local
3962 if (strncmp(intf->name,"wmi\0",4) && strncmp(intf->name, "open\0",5)) { in ipmi_delloem_vFlash_process()
3966 return -1; in ipmi_delloem_vFlash_process()
3978 return -1; in ipmi_delloem_vFlash_process()
3983 return -1; in ipmi_delloem_vFlash_process()
3985 rc = ipmi_get_sd_card_info(intf); in ipmi_delloem_vFlash_process()
3986 return rc; in ipmi_delloem_vFlash_process()
3990 return -1; in ipmi_delloem_vFlash_process()
3995 return -1; in ipmi_delloem_vFlash_process()
4078 rsp = intf->sendrecv(intf, &req); in CheckSetLEDSupport()
4079 if (rsp == NULL || rsp->ccode != 0) { in CheckSetLEDSupport()
4088 * Input: intf - ipmi interface
4089 * bdf - PCI Address of drive
4090 * *bay - Returns bay ID
4091 * *slot - Returns slot ID
4120 rsp = intf->sendrecv(intf, &req); in ipmi_getdrivemap()
4123 return -1; in ipmi_getdrivemap()
4124 } else if (rsp->ccode != 0) { in ipmi_getdrivemap()
4126 val2str(rsp->ccode, completion_code_vals)); in ipmi_getdrivemap()
4127 return -1; in ipmi_getdrivemap()
4129 *bay = rsp->data[7]; in ipmi_getdrivemap()
4130 *slot = rsp->data[8]; in ipmi_getdrivemap()
4133 return -1; in ipmi_getdrivemap()
4141 * Input: intf - ipmi interface
4142 * bdf - PCI Address of drive
4143 * state - SES Flags state of drive
4175 rsp = intf->sendrecv(intf, &req); in ipmi_setled_state()
4178 return -1; in ipmi_setled_state()
4179 } else if (rsp->ccode != 0) { in ipmi_setled_state()
4181 val2str(rsp->ccode, completion_code_vals)); in ipmi_setled_state()
4182 return -1; in ipmi_setled_state()
4223 * Input: intf - ipmi interface
4224 * argc - no of arguments
4225 * argv - argument string array
4228 * Return: return code 0 - success
4229 * -1 - failure
4241 return -1; in ipmi_delloem_setled_main()
4251 return -1; in ipmi_delloem_setled_main()
4252 } else if (sscanf(argv[current_arg], "%*x:%x:%x.%x", &b,&d,&f) == 3) { in ipmi_delloem_setled_main()
4256 } else if (sscanf(argv[current_arg], "%x:%x.%x", &b,&d,&f) == 3) { in ipmi_delloem_setled_main()
4261 return -1; in ipmi_delloem_setled_main()
4267 return -1; in ipmi_delloem_setled_main()