mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
Add new Dell OEM commands and update man page
This commit is contained in:
parent
d06ddcd28b
commit
19295a5483
@ -225,7 +225,7 @@ Commands:
|
||||
shell Launch interactive IPMI shell
|
||||
exec Run list of commands from file
|
||||
set Set runtime variable for shell and exec
|
||||
delloem Manage Dell OEM Extensions
|
||||
delloem Manage Dell OEM Extensions.
|
||||
echo Used to echo lines to stdout in scripts
|
||||
ekanalyzer run FRU-Ekeying analyzer using FRU files
|
||||
ime Upgrade/Query Intel ME firmware
|
||||
@ -866,13 +866,27 @@ Perform manual rollback of the ME firmware
|
||||
.br
|
||||
|
||||
The delloem commands provide information on Dell-specific features.
|
||||
.TP
|
||||
\fIsetled {b:d.f} {state..}\fP
|
||||
.RS
|
||||
.br
|
||||
|
||||
Sets the drive backplane LEDs for a device.
|
||||
.br
|
||||
{b:d.f} = PCI Address of device (eg. 06:00.0)
|
||||
.br
|
||||
{state} = one or more of the following:
|
||||
.RS
|
||||
\fIonline | present | hotspare | identify | rebuilding | fault | predict | critical | failed\fP
|
||||
.br
|
||||
.RE
|
||||
.RE
|
||||
|
||||
.TP
|
||||
\fIlcd\fP
|
||||
.RS
|
||||
.br
|
||||
\fBset {mode}\fR|
|
||||
.br
|
||||
\fB{lcdqualifier}\fR|\fB{errordisplay}\fR
|
||||
\fIset {mode}\fP|\fI{lcdqualifier}\fP|\fI{errordisplay}\fP
|
||||
.RS
|
||||
.br
|
||||
|
||||
@ -882,48 +896,39 @@ Allows you to set the LCD mode and user-defined string.
|
||||
\fIlcd set mode\fP
|
||||
.RS
|
||||
.br
|
||||
\fB{none}\fR|\fB{modelname}\fR|
|
||||
\fI{none}\fP|\fI{modelname}\fP|\fI{ipv4address}\fP|\fI{macaddress}\fP|
|
||||
.br
|
||||
\fB{ipv4address}\fR|\fB{macaddress}\fR|
|
||||
\fI{systemname}\fP|\fI{servicetag}\fP|\fI{ipv6address}\fP|
|
||||
.br
|
||||
\fB{systemname}\fR|\fB{servicetag}\fR|
|
||||
\fI{ambienttemp}\fP|\fI{systemwatt}\fP|\fI{assettag}\fP|
|
||||
.br
|
||||
\fB{ipv6address}\fR|\fB{ambienttemp}\fR|
|
||||
.br
|
||||
\fB{systemwatt}\fR|\fB{assettag}\fR|
|
||||
.br
|
||||
\fB{userdefined}<text>\fR
|
||||
.RS
|
||||
\fI{userdefined}<text>\fP
|
||||
.br
|
||||
|
||||
Allows you to set the LCD display mode to any of the preceding parameters.
|
||||
.RE
|
||||
|
||||
.RE
|
||||
.TP
|
||||
\fIlcd set lcdqualifier\fP
|
||||
.RS
|
||||
.br
|
||||
\fB{watt}\fR|\fB{btuphr}\fR|
|
||||
\fI{watt}\fP|\fI{btuphr}\fP|
|
||||
.br
|
||||
\fB{celsius}\fR|\fB{fahrenheit}\fR
|
||||
.RS
|
||||
\fI{celsius}\fP|\fI{fahrenheit}\fP
|
||||
.br
|
||||
|
||||
Allows you to set the unit for the system ambient temperature mode.
|
||||
.RE
|
||||
|
||||
.RE
|
||||
.TP
|
||||
\fIlcd set errordisplay\fP
|
||||
.RS
|
||||
.br
|
||||
\fB{sel}\fR|\fB{simple}\fR
|
||||
.RS
|
||||
\fI{sel}\fP|\fI{simple}\fP
|
||||
.br
|
||||
|
||||
Allows you to set the error display.
|
||||
.RE
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
\fIlcd info\fP
|
||||
.RS
|
||||
@ -934,13 +939,11 @@ Displays the LCD screen information.
|
||||
.TP
|
||||
\fIlcd set vkvm\fP
|
||||
.RS
|
||||
\fB{active}\fR|\fB{inactive}\fR
|
||||
.RS
|
||||
\fI{active}\fP|\fI{inactive}\fP
|
||||
.br
|
||||
|
||||
Allows you to set the vKVM status to active or inactive. When it is active and session is in progress, a message appears on LCD.
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
\fIlcd status\fP
|
||||
.RS
|
||||
@ -948,6 +951,7 @@ Allows you to set the vKVM status to active or inactive. When it is active and s
|
||||
|
||||
Displays the LCD status for vKVM display active or inactive and Front Panel access mode (viewandmodify, view-only or disabled).
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
\fImac\fP
|
||||
.RS
|
||||
@ -956,47 +960,52 @@ Displays the LCD status for vKVM display active or inactive and Front Panel acce
|
||||
Displays the information about the system NICs.
|
||||
.TP
|
||||
\fImac list\fP
|
||||
.RS
|
||||
.br
|
||||
|
||||
Displays the NIC MAC address and status of all NICs. It also displays the DRAC/iDRAC MAC address.
|
||||
.RE
|
||||
|
||||
.TP
|
||||
\fImac get\fP
|
||||
.RS
|
||||
\fB<NIC number>\fR
|
||||
.RS
|
||||
\fI<NIC number>\fP
|
||||
.br
|
||||
|
||||
Displays the selected NICs MAC address and status.
|
||||
.RE
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
\fIlan\fP
|
||||
.RS
|
||||
.br
|
||||
Displays the information of Lan.
|
||||
|
||||
.TP
|
||||
\fIlan set\fP
|
||||
.RS
|
||||
\fB<Mode>\fR
|
||||
\fI<Mode>\fP
|
||||
.br
|
||||
|
||||
Sets the NIC selection mode (dedicated, shared, shared with failover LOM2, shared with failover all LOMs).
|
||||
Sets the NIC selection mode (dedicated, shared with lom1, shared with lom2,shared with lom3,shared with lom4,shared with failover lom1,shared with failover lom2,shared with failover lom3,shared with failover lom4,shared with Failover all loms, shared with Failover None).
|
||||
.RE
|
||||
.TP
|
||||
\fIlan get\fP
|
||||
.br
|
||||
|
||||
Returns the current NIC selection mode (dedicated, shared, shared with failover LOM2, shared with failover all LOMs).
|
||||
Returns the current NIC selection mode (dedicated, shared with lom1, shared with lom2, shared with lom3, shared with lom4,shared with failover lom1, shared with failover lom2,shared with failover lom3,shared with failover lom4,shared with Failover all loms,shared with Failover None).
|
||||
|
||||
.TP
|
||||
\fIlan get active\fP
|
||||
.br
|
||||
|
||||
Returns the current active NIC (dedicated, LOM1, LOM2, LOM3 or LOM4).
|
||||
.RE
|
||||
.TP
|
||||
\fIpowermonitor\fP
|
||||
.RS
|
||||
.br
|
||||
|
||||
Displays power tracking statistics.
|
||||
.RE
|
||||
|
||||
.TP
|
||||
\fIpowermonitor clear cumulativepower\fP
|
||||
.RS
|
||||
@ -1014,48 +1023,35 @@ Reset peak power reading.
|
||||
.TP
|
||||
\fIpowermonitor powerconsumption\fP
|
||||
.RS
|
||||
\fB<watt>\fR|\fB<btuphr>\fR
|
||||
.RS
|
||||
\fI<watt>\fP|\fI<btuphr>\fP
|
||||
.br
|
||||
|
||||
Displays the power consumption in watt or btuphr.
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
\fIpowermonitor powerconsumptionhistory\fP
|
||||
.RS
|
||||
\fB<watt>\fR|\fB<btuphr>\fR
|
||||
.RS
|
||||
\fI<watt>\fP|\fI<btuphr>\fP
|
||||
.br
|
||||
|
||||
Displays the power consumption history in watt or btuphr.
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
\fIpowermonitor getpowerbudget\fP
|
||||
.RS
|
||||
\fB<watt>\fR|\fB<btuphr>\fR
|
||||
.RS
|
||||
\fI<watt>\fP|\fI<btuphr>\fP
|
||||
.br
|
||||
|
||||
Displays the power cap in watt or btuphr.
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
\fIpowermonitor setpowerbudget\fP
|
||||
.RS
|
||||
\fB<val>\fR\fB<watt|btuphr|percent>\fR
|
||||
.RS
|
||||
\fI<val>\fP\fI<watt\fP|\fIbtuphr\fP|\fIpercent>\fP
|
||||
.br
|
||||
|
||||
Allows you to set the power cap in watt, BTU/hr or percentage.
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
\fIpowermonitor enablepowercap\fP
|
||||
.RS
|
||||
.br
|
||||
|
||||
Enables set power cap.
|
||||
.RE
|
||||
.TP
|
||||
@ -1066,7 +1062,35 @@ Enables set power cap.
|
||||
Disables set power cap.
|
||||
.RE
|
||||
.RE
|
||||
.RE
|
||||
|
||||
.RS
|
||||
.br
|
||||
.TP
|
||||
\fIwindbg\fP
|
||||
.RS
|
||||
.br
|
||||
\fIwindbg start\fP
|
||||
.RS
|
||||
.br
|
||||
Starts the windbg session (Cold Reset & SOL Activation)
|
||||
.RE
|
||||
\fIwindbg end\fP
|
||||
.RS
|
||||
.br
|
||||
Ends the windbg session (SOL Deactivation)
|
||||
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
\fIvFlash info Card\fP
|
||||
.RS
|
||||
.br
|
||||
|
||||
Shows Extended SD Card information
|
||||
.RE
|
||||
.RE
|
||||
.TP
|
||||
.TP
|
||||
\fIevent\fP
|
||||
.RS
|
||||
|
@ -76,6 +76,9 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#define IDRAC_11G 1
|
||||
#define IDRAC_12G 2
|
||||
// Return Error code for license
|
||||
#define LICENSE_NOT_SUPPORTED 0x6F
|
||||
#define VFL_NOT_LICENSED 0x33
|
||||
#define btuphr 0x01
|
||||
#define watt 0x00
|
||||
#define IPMI_DELL_POWER_CAP 0xEA
|
||||
@ -95,6 +98,8 @@ typedef struct _tag_ipmi_dell_lcd_caps
|
||||
#define IPMI_DELL_LCD_STRING1_SIZE 14
|
||||
#define IPMI_DELL_LCD_STRINGN_SIZE 16
|
||||
|
||||
/* vFlash subcommands */
|
||||
#define IPMI_GET_EXT_SD_CARD_INFO 0xA4
|
||||
|
||||
|
||||
typedef struct _tag_ipmi_dell_lcd_string
|
||||
@ -339,6 +344,20 @@ typedef struct _power_headroom
|
||||
uint16_t peakheadroom;
|
||||
} __attribute__ ((packed)) POWER_HEADROOM;
|
||||
|
||||
struct vFlashstr {
|
||||
uint8_t val;
|
||||
const char * str;
|
||||
};
|
||||
typedef struct ipmi_vFlash_extended_info
|
||||
{
|
||||
uint8_t vflashcompcode;
|
||||
uint8_t sdcardstatus;
|
||||
uint32_t sdcardsize;
|
||||
uint32_t sdcardavailsize;
|
||||
uint8_t bootpartion;
|
||||
uint8_t Resv;
|
||||
} __attribute__ ((packed)) IPMI_DELL_SDCARD_INFO;
|
||||
|
||||
|
||||
typedef struct _SensorReadingType
|
||||
{
|
||||
|
@ -117,6 +117,14 @@ static uint8_t SetLEDSupported=0;
|
||||
volatile uint8_t IMC_Type = IMC_IDRAC_10G;
|
||||
|
||||
|
||||
const struct vFlashstr vFlash_completion_code_vals[] = {
|
||||
{0x00, "SUCCESS"},
|
||||
{0x01, "NO_SD_CARD"},
|
||||
{0x63, "UNKNOWN_ERROR"},
|
||||
{0x00, NULL}
|
||||
};
|
||||
|
||||
|
||||
POWER_HEADROOM powerheadroom;
|
||||
|
||||
uint8_t PowercapSetable_flag=0;
|
||||
@ -203,6 +211,16 @@ static int getpowersupplyfruinfo(struct ipmi_intf *intf, uint8_t id,
|
||||
struct fru_header header, struct fru_info fru);
|
||||
static void ipmi_powermonitor_usage(void);
|
||||
|
||||
/* vFlash Function prototypes */
|
||||
static int ipmi_delloem_vFlash_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
const char * get_vFlash_compcode_str(uint8_t vflashcompcode, const struct vFlashstr *vs);
|
||||
static int ipmi_get_sd_card_info(struct ipmi_intf* intf);
|
||||
static int ipmi_delloem_vFlash_process(struct ipmi_intf* intf, int current_arg, char ** argv);
|
||||
static void ipmi_vFlash_usage(void);
|
||||
|
||||
|
||||
/* LED Function prototypes */
|
||||
|
||||
static int ipmi_getsesmask(int, char **);
|
||||
static int CheckSetLEDSupport(struct ipmi_intf * intf);
|
||||
static int IsSetLEDSupported(void);
|
||||
@ -263,7 +281,12 @@ ipmi_delloem_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
else if (strncmp(argv[current_arg], "powermonitor\0", 13) == 0)
|
||||
{
|
||||
ipmi_delloem_powermonitor_main (intf,argc,argv);
|
||||
}
|
||||
}
|
||||
/* vFlash Support */
|
||||
else if (strncmp(argv[current_arg], "vFlash\0", 7) == 0)
|
||||
{
|
||||
ipmi_delloem_vFlash_main (intf,argc,argv);
|
||||
}
|
||||
else
|
||||
{
|
||||
usage();
|
||||
@ -297,6 +320,7 @@ static void usage(void)
|
||||
if (IsSetLEDSupported())
|
||||
lprintf(LOG_NOTICE, " setled");
|
||||
lprintf(LOG_NOTICE, " powermonitor");
|
||||
lprintf(LOG_NOTICE, " vFlash");
|
||||
lprintf(LOG_NOTICE, "");
|
||||
lprintf(LOG_NOTICE, "For help on individual commands type:");
|
||||
lprintf(LOG_NOTICE, "delloem <command> help");
|
||||
@ -2676,6 +2700,11 @@ static int ipmi_lan_set_nic_selection_12g (struct ipmi_intf* intf, uint8_t* nic_
|
||||
lprintf(LOG_ERR, " Error in setting nic selection");
|
||||
return -1;
|
||||
}
|
||||
// Check license only for setting the dedicated nic.
|
||||
else if( (nic_selection[0] == 1) && ((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED))) {
|
||||
printf("FM001 : A required license is missing or expired\n");
|
||||
return -1;
|
||||
}
|
||||
else if (rsp->ccode > 0)
|
||||
{
|
||||
lprintf(LOG_ERR, " Error in setting nic selection (%s) \n",
|
||||
@ -3158,7 +3187,10 @@ ipmi_get_power_capstatus_command (struct ipmi_intf * intf)
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, " Error getting powercap status");
|
||||
return -1;
|
||||
return -1;
|
||||
} else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
|
||||
printf("FM001 : A required license is missing or expired\n");
|
||||
return -1; // Return Error as unlicensed
|
||||
} else if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, " Error getting powercap statusr: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
@ -3210,6 +3242,9 @@ ipmi_set_power_capstatus_command (struct ipmi_intf * intf,uint8_t val)
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, " Error setting powercap status");
|
||||
return -1;
|
||||
} else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
|
||||
printf("FM001 : A required license is missing or expired\n");
|
||||
return -1; //return unlicensed Error code
|
||||
} else if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, " Error setting powercap statusr: %s",
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
@ -3301,7 +3336,11 @@ static int ipmi_powermgmt(struct ipmi_intf* intf)
|
||||
lprintf(LOG_ERR, " Error getting power management information.\n");
|
||||
return -1;
|
||||
}
|
||||
if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb)) {
|
||||
|
||||
if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
|
||||
printf("FM001 : A required license is missing or expired\n");
|
||||
return -1;
|
||||
} else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb)) {
|
||||
lprintf(LOG_ERR, " Error getting power management information: Command not supported on this system.");
|
||||
return -1;
|
||||
}else if (rsp->ccode != 0) {
|
||||
@ -3411,6 +3450,9 @@ ipmi_powermgmt_clear(struct ipmi_intf* intf,uint8_t clearValue)
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, " Error clearing power values.\n");
|
||||
return -1;
|
||||
} else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
|
||||
printf("FM001 : A required license is missing or expired\n");
|
||||
return -1;
|
||||
} else if (rsp->ccode == 0xc1) {
|
||||
lprintf(LOG_ERR, " Error clearing power values, command not supported on this system.\n");
|
||||
return -1;
|
||||
@ -3490,6 +3532,9 @@ static int ipmi_get_power_headroom_command (struct ipmi_intf * intf,uint8_t unit
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, " Error getting power headroom status");
|
||||
return -1;
|
||||
} else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
|
||||
printf("FM001 : A required license is missing or expired\n");
|
||||
return -1;
|
||||
} else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb)){
|
||||
lprintf(LOG_ERR, " Error getting power headroom status: Command not supported on this system ");
|
||||
return -1;
|
||||
@ -3647,6 +3692,9 @@ static int ipmi_get_instan_power_consmpt_data(struct ipmi_intf* intf,
|
||||
lprintf(LOG_ERR, " Error getting instantaneous power consumption data .\n");
|
||||
|
||||
return -1;
|
||||
} else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
|
||||
printf("FM001 : A required license is missing or expired\n");
|
||||
return -1;
|
||||
} else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb)) {
|
||||
lprintf(LOG_ERR, " Error getting instantaneous power consumption data: Command not supported on this system.");
|
||||
return -1;
|
||||
@ -3770,7 +3818,10 @@ static int ipmi_get_avgpower_consmpt_history(struct ipmi_intf* intf,IPMI_AVGPOWE
|
||||
lprintf(LOG_ERR, " Error getting average power consumption history data .\n");
|
||||
return -1;
|
||||
}
|
||||
else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb))
|
||||
else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
|
||||
printf("FM001 : A required license is missing or expired\n");
|
||||
return -1;
|
||||
} else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb))
|
||||
{
|
||||
lprintf(LOG_ERR, " Error getting average power consumption history data: Command not supported on this system.");
|
||||
return -1;
|
||||
@ -3830,7 +3881,10 @@ static int ipmi_get_peakpower_consmpt_history(struct ipmi_intf* intf,IPMI_POWER_
|
||||
lprintf(LOG_ERR, " Error getting peak power consumption history data .\n");
|
||||
return -1;
|
||||
}
|
||||
else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb))
|
||||
else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
|
||||
printf("FM001 : A required license is missing or expired\n");
|
||||
return -1;
|
||||
} else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb))
|
||||
{
|
||||
lprintf(LOG_ERR, " Error getting peak power consumption history data: Command not supported on this system.");
|
||||
return -1;
|
||||
@ -3893,7 +3947,10 @@ static int ipmi_get_minpower_consmpt_history(struct ipmi_intf* intf,IPMI_POWER_C
|
||||
lprintf(LOG_ERR, " Error getting peak power consumption history data .\n");
|
||||
return -1;
|
||||
}
|
||||
else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb))
|
||||
else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
|
||||
printf("FM001 : A required license is missing or expired\n");
|
||||
return -1;
|
||||
} else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb))
|
||||
{
|
||||
lprintf(LOG_ERR, " Error getting peak power consumption history data: Command not supported on this system.");
|
||||
return -1;
|
||||
@ -4120,6 +4177,9 @@ static int ipmi_get_power_cap(struct ipmi_intf* intf,IPMI_POWER_CAP* ipmipowerca
|
||||
}
|
||||
return -1;
|
||||
|
||||
} else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
|
||||
printf("FM001 : A required license is missing or expired\n");
|
||||
return -1;
|
||||
} else if ((rsp->ccode == 0xc1)||(rsp->ccode == 0xcb)) {
|
||||
|
||||
lprintf(LOG_ERR, " Error getting power cap: Command not supported on this system.");
|
||||
@ -4255,8 +4315,12 @@ static int ipmi_set_power_cap(struct ipmi_intf* intf,int unit,int val )
|
||||
rsp->data[8], rsp->data[9], rsp->data[10],rsp->data[11]);
|
||||
}
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
|
||||
printf("FM001 : A required license is missing or expired\n");
|
||||
return -1;
|
||||
}
|
||||
else if (rsp->ccode == 0xc1)
|
||||
{
|
||||
|
||||
@ -4366,6 +4430,10 @@ static int ipmi_set_power_cap(struct ipmi_intf* intf,int unit,int val )
|
||||
lprintf(LOG_ERR, " Error setting power cap");
|
||||
return -1;
|
||||
}
|
||||
else if((iDRAC_FLAG == IDRAC_12G) && (rsp->ccode == LICENSE_NOT_SUPPORTED)) {
|
||||
printf("FM001 : A required license is missing or expired\n");
|
||||
return -1;
|
||||
}
|
||||
else if (rsp->ccode > 0)
|
||||
{
|
||||
lprintf(LOG_ERR, " Error setting power cap: %s",
|
||||
@ -4515,6 +4583,221 @@ ipmi_powermonitor_usage(void)
|
||||
lprintf(LOG_NOTICE, "");
|
||||
|
||||
}
|
||||
/*****************************************************************
|
||||
* Function Name: ipmi_delloem_vFlash_main
|
||||
*
|
||||
* Description: This function processes the delloem vFlash command
|
||||
* Input: intf - ipmi interface
|
||||
argc - no of arguments
|
||||
argv - argument string array
|
||||
* Output:
|
||||
*
|
||||
* Return: return code 0 - success
|
||||
* -1 - failure
|
||||
*
|
||||
******************************************************************/
|
||||
|
||||
static int ipmi_delloem_vFlash_main (struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
current_arg++;
|
||||
rc = ipmi_delloem_vFlash_process(intf, current_arg, argv);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*****************************************************************
|
||||
* Function Name: get_vFlash_compcode_str
|
||||
*
|
||||
* Description: This function maps the vFlash completion code
|
||||
* to a string
|
||||
* Input : vFlash completion code and static array of codes vs strings
|
||||
* Output: -
|
||||
* Return: returns the mapped string
|
||||
*
|
||||
******************************************************************/
|
||||
const char *
|
||||
get_vFlash_compcode_str(uint8_t vflashcompcode, const struct vFlashstr *vs)
|
||||
{
|
||||
static char un_str[32];
|
||||
int i;
|
||||
|
||||
for (i = 0; vs[i].str != NULL; i++) {
|
||||
if (vs[i].val == vflashcompcode)
|
||||
return vs[i].str;
|
||||
}
|
||||
|
||||
memset(un_str, 0, 32);
|
||||
snprintf(un_str, 32, "Unknown (0x%02X)", vflashcompcode);
|
||||
|
||||
return un_str;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* Function Name: ipmi_get_sd_card_info
|
||||
*
|
||||
* Description: This function prints the vFlash Extended SD card info
|
||||
* Input : ipmi interface
|
||||
* Output: prints the sd card extended info
|
||||
* Return: 0 - success -1 - failure
|
||||
*
|
||||
******************************************************************/
|
||||
static int
|
||||
ipmi_get_sd_card_info(struct ipmi_intf* intf) {
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
|
||||
uint8_t msg_data[2];
|
||||
uint8_t input_length=0;
|
||||
uint8_t cardstatus=0x00;
|
||||
|
||||
IPMI_DELL_SDCARD_INFO * sdcardinfoblock;
|
||||
|
||||
input_length = 2;
|
||||
msg_data[0] = msg_data[1] = 0x00;
|
||||
|
||||
req.msg.netfn = DELL_OEM_NETFN;
|
||||
req.msg.lun = 0;
|
||||
req.msg.cmd = IPMI_GET_EXT_SD_CARD_INFO;
|
||||
req.msg.data = msg_data;
|
||||
req.msg.data_len = input_length;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL)
|
||||
{
|
||||
lprintf(LOG_ERR, " Error in getting SD Card Extended Information");
|
||||
return -1;
|
||||
}
|
||||
else if (rsp->ccode > 0)
|
||||
{
|
||||
lprintf(LOG_ERR, " Error in getting SD Card Extended Information (%s) \n",
|
||||
val2str(rsp->ccode, completion_code_vals) );
|
||||
return -1;
|
||||
}
|
||||
|
||||
sdcardinfoblock = (IPMI_DELL_SDCARD_INFO *) (void *) rsp->data;
|
||||
|
||||
if( (iDRAC_FLAG == IDRAC_12G) && (sdcardinfoblock->vflashcompcode == VFL_NOT_LICENSED))
|
||||
{
|
||||
printf("FM001 : A required license is missing or expired\n");
|
||||
return -1;
|
||||
}
|
||||
else if (sdcardinfoblock->vflashcompcode != 0x00)
|
||||
{
|
||||
lprintf(LOG_ERR, " Error in getting SD Card Extended Information (%s) \n", get_vFlash_compcode_str(sdcardinfoblock->vflashcompcode,
|
||||
vFlash_completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!(sdcardinfoblock->sdcardstatus & 0x04))
|
||||
{
|
||||
lprintf(LOG_ERR, " vFlash SD card is unavailable, please insert the card\n of size 256MB or greater\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
printf("vFlash SD Card Properties\n");
|
||||
printf("SD Card size : %8dMB\n",sdcardinfoblock->sdcardsize);
|
||||
printf("Available size : %8dMB\n",sdcardinfoblock->sdcardavailsize);
|
||||
printf("Initialized : %10s\n", (sdcardinfoblock->sdcardstatus & 0x80) ?
|
||||
"Yes" : "No");
|
||||
printf("Licensed : %10s\n", (sdcardinfoblock->sdcardstatus & 0x40) ?
|
||||
"Yes" : "No");
|
||||
printf("Attached : %10s\n", (sdcardinfoblock->sdcardstatus & 0x20) ?
|
||||
"Yes" : "No");
|
||||
printf("Enabled : %10s\n", (sdcardinfoblock->sdcardstatus & 0x10) ?
|
||||
"Yes" : "No");
|
||||
printf("Write Protected : %10s\n", (sdcardinfoblock->sdcardstatus & 0x08) ?
|
||||
"Yes" : "No");
|
||||
cardstatus = sdcardinfoblock->sdcardstatus & 0x03;
|
||||
printf("Health : %10s\n", ((0x00 == cardstatus
|
||||
) ? "OK" : ((cardstatus == 0x03) ?
|
||||
"Undefined" : ((cardstatus == 0x02) ?
|
||||
"Critical" : "Warning"))));
|
||||
printf("Bootable partition : %10d\n",sdcardinfoblock->bootpartion);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* Function Name: ipmi_delloem_vFlash_process
|
||||
*
|
||||
* Description: This function processes the args for vFlash subcmd
|
||||
* Input : intf - ipmi interface, arg index, argv array
|
||||
* Output: prints help or error with help
|
||||
* Return: 0 - Success -1 - failure
|
||||
*
|
||||
******************************************************************/
|
||||
static int
|
||||
ipmi_delloem_vFlash_process(struct ipmi_intf* intf, int current_arg, char ** argv) {
|
||||
int rc;
|
||||
|
||||
if (strncmp(intf->name,"wmi\0",4) &&
|
||||
strncmp(intf->name, "open\0",5))
|
||||
{
|
||||
lprintf(LOG_ERR, " vFlash support is enabled only for wmi and open interface.\n Its not enabled for lan and lanplus interface.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (argv[current_arg] == NULL)
|
||||
{
|
||||
ipmi_vFlash_usage();
|
||||
return -1;
|
||||
}
|
||||
else if (!strncmp(argv[current_arg], "info\0", 5))
|
||||
{
|
||||
current_arg++;
|
||||
if (argv[current_arg] == NULL)
|
||||
{
|
||||
ipmi_vFlash_usage();
|
||||
return -1;
|
||||
}
|
||||
else if (strncmp(argv[current_arg], "Card\0", 5) == 0)
|
||||
{
|
||||
current_arg++;
|
||||
if (argv[current_arg] != NULL)
|
||||
{
|
||||
ipmi_vFlash_usage();
|
||||
return -1;
|
||||
}
|
||||
rc = ipmi_get_sd_card_info(intf);
|
||||
return rc;
|
||||
}
|
||||
else /* TBD: many sub commands are present */
|
||||
{
|
||||
ipmi_vFlash_usage();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/* TBD other vFlash subcommands */
|
||||
else if (!strncmp(argv[current_arg], "help\0", 5))
|
||||
{
|
||||
ipmi_vFlash_usage();
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ipmi_vFlash_usage();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* Function Name: ipmi_vFlash_usage
|
||||
*
|
||||
* Description: This function displays the usage for using vFlash
|
||||
* Input : void
|
||||
* Output: prints help
|
||||
* Return: void
|
||||
*
|
||||
******************************************************************/
|
||||
static void
|
||||
ipmi_vFlash_usage(void)
|
||||
{
|
||||
lprintf(LOG_NOTICE, "");
|
||||
lprintf(LOG_NOTICE, " vFlash info Card");
|
||||
lprintf(LOG_NOTICE, " Shows Extended SD Card information");
|
||||
lprintf(LOG_NOTICE, "");
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* Function Name: ipmi_setled_usage
|
||||
|
Loading…
x
Reference in New Issue
Block a user