ID: 28 - 'lib/ipmi_delloem.c' - clean up the code

Re-format all usage functions.
This commit is contained in:
Zdenek Styblik 2013-07-07 11:28:00 +00:00
parent e95a4cf998
commit 1d9dd4e2de

View File

@ -297,19 +297,32 @@ ipmi_delloem_main(struct ipmi_intf * intf, int argc, char ** argv)
static void static void
usage(void) usage(void)
{ {
lprintf(LOG_NOTICE, ""); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, "usage: delloem <command> [option...]"); "");
lprintf(LOG_NOTICE, ""); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, "commands:"); "usage: delloem <command> [option...]");
lprintf(LOG_NOTICE, " lcd"); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, " mac"); "");
lprintf(LOG_NOTICE, " lan"); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, " setled"); "commands:");
lprintf(LOG_NOTICE, " powermonitor"); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, " vFlash"); " lcd");
lprintf(LOG_NOTICE, ""); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, "For help on individual commands type:"); " mac");
lprintf(LOG_NOTICE, "delloem <command> help"); lprintf(LOG_NOTICE,
" lan");
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");
} }
/* /*
* Function Name: ipmi_delloem_lcd_main * Function Name: ipmi_delloem_lcd_main
@ -1371,54 +1384,78 @@ ipmi_lcd_configure (struct ipmi_intf * intf, int command,
static void static void
ipmi_lcd_usage(void) ipmi_lcd_usage(void)
{ {
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, "Generic DELL HW:");
lprintf(LOG_NOTICE, " lcd set {none}|{default}|{custom <text>}");
lprintf(LOG_NOTICE, lprintf(LOG_NOTICE,
" Set LCD text displayed during non-fault conditions"); "");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, "iDRAC 11g or iDRAC 12g:");
lprintf(LOG_NOTICE, " lcd set {mode}|{lcdqualifier}|{errordisplay}");
lprintf(LOG_NOTICE, lprintf(LOG_NOTICE,
" Allows you to set the LCD mode and user-defined string."); "Generic DELL HW:");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, lprintf(LOG_NOTICE,
" lcd set mode {none}|{modelname}|{ipv4address}|{macaddress}|"); " lcd set {none}|{default}|{custom <text>}");
lprintf(LOG_NOTICE, lprintf(LOG_NOTICE,
" {systemname}|{servicetag}|{ipv6address}|{ambienttemp}"); " Set LCD text displayed during non-fault conditions");
lprintf(LOG_NOTICE, " {systemwatt }|{assettag}|{userdefined}<text>");
lprintf(LOG_NOTICE, " Allows you to set the LCD display mode to any of "
"the preceding parameters");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, lprintf(LOG_NOTICE,
" lcd set lcdqualifier {watt}|{btuphr}|{celsius}|{fahrenheit}"); "");
lprintf(LOG_NOTICE, " Allows you to set the unit for the system "
"ambient temperature mode.");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, " lcd set errordisplay {sel}|{simple}");
lprintf(LOG_NOTICE, " Allows you to set the error display.");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, " lcd info");
lprintf(LOG_NOTICE, lprintf(LOG_NOTICE,
" Show LCD text that is displayed during non-fault conditions"); "iDRAC 11g or iDRAC 12g:");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, " lcd set vkvm{active}|{inactive}");
lprintf(LOG_NOTICE, " Set vKVM active and inactive, message will "
"be displayed on lcd");
lprintf(LOG_NOTICE, " when vKVM is active and vKVM session is in progress");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, lprintf(LOG_NOTICE,
" lcd set frontpanelaccess {viewandmodify}|{viewonly}|{disabled}"); " lcd set {mode}|{lcdqualifier}|{errordisplay}");
lprintf(LOG_NOTICE, lprintf(LOG_NOTICE,
" Set LCD mode to view and modify, view only or disabled "); " Allows you to set the LCD mode and user-defined string.");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, " lcd status");
lprintf(LOG_NOTICE, lprintf(LOG_NOTICE,
" Show LCD Status for vKVM display<active|inactive>"); "");
lprintf(LOG_NOTICE, lprintf(LOG_NOTICE,
" and Front Panel access mode {viewandmodify}|{viewonly}|{disabled} "); " lcd set mode {none}|{modelname}|{ipv4address}|{macaddress}|");
lprintf(LOG_NOTICE, ""); lprintf(LOG_NOTICE,
" {systemname}|{servicetag}|{ipv6address}|{ambienttemp}");
lprintf(LOG_NOTICE,
" {systemwatt }|{assettag}|{userdefined}<text>");
lprintf(LOG_NOTICE,
" Allows you to set the LCD display mode to any of the preceding");
lprintf(LOG_NOTICE,
" parameters");
lprintf(LOG_NOTICE,
"");
lprintf(LOG_NOTICE,
" lcd set lcdqualifier {watt}|{btuphr}|{celsius}|{fahrenheit}");
lprintf(LOG_NOTICE,
" Allows you to set the unit for the system ambient temperature mode.");
lprintf(LOG_NOTICE,
"");
lprintf(LOG_NOTICE,
" lcd set errordisplay {sel}|{simple}");
lprintf(LOG_NOTICE,
" Allows you to set the error display.");
lprintf(LOG_NOTICE,
"");
lprintf(LOG_NOTICE,
" lcd info");
lprintf(LOG_NOTICE,
" Show LCD text that is displayed during non-fault conditions");
lprintf(LOG_NOTICE,
"");
lprintf(LOG_NOTICE,
"");
lprintf(LOG_NOTICE,
" lcd set vkvm{active}|{inactive}");
lprintf(LOG_NOTICE,
" Set vKVM active and inactive, message will be displayed on lcd");
lprintf(LOG_NOTICE,
" when vKVM is active and vKVM session is in progress");
lprintf(LOG_NOTICE,
"");
lprintf(LOG_NOTICE,
" lcd set frontpanelaccess {viewandmodify}|{viewonly}|{disabled}");
lprintf(LOG_NOTICE,
" Set LCD mode to view and modify, view only or disabled ");
lprintf(LOG_NOTICE,
"");
lprintf(LOG_NOTICE,
" lcd status");
lprintf(LOG_NOTICE,
" Show LCD Status for vKVM display<active|inactive>");
lprintf(LOG_NOTICE,
" and Front Panel access mode {viewandmodify}|{viewonly}|{disabled}");
lprintf(LOG_NOTICE,
"");
} }
/* /*
* Function Name: ipmi_delloem_mac_main * Function Name: ipmi_delloem_mac_main
@ -1859,14 +1896,20 @@ ipmi_macinfo(struct ipmi_intf* intf, uint8_t NicNum)
static void static void
ipmi_mac_usage(void) ipmi_mac_usage(void)
{ {
lprintf(LOG_NOTICE, ""); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, " mac list"); "");
lprintf(LOG_NOTICE, " Lists the MAC address of LOMs"); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, ""); " mac list");
lprintf(LOG_NOTICE, " mac get <NIC number>"); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, " Shows the MAC address of specified LOM. " " Lists the MAC address of LOMs");
"0-7 System LOM, 8- DRAC/iDRAC."); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, ""); "");
lprintf(LOG_NOTICE,
" mac get <NIC number>");
lprintf(LOG_NOTICE,
" Shows the MAC address of specified LOM. 0-7 System LOM, 8- DRAC/iDRAC.");
lprintf(LOG_NOTICE,
"");
} }
/* /*
* Function Name: ipmi_delloem_lan_main * Function Name: ipmi_delloem_lan_main
@ -2355,40 +2398,62 @@ ipmi_lan_get_active_nic(struct ipmi_intf * intf)
static void static void
ipmi_lan_usage(void) ipmi_lan_usage(void)
{ {
lprintf(LOG_NOTICE, ""); /* TODO:
lprintf(LOG_NOTICE, " lan set <Mode> "); * - rewrite
lprintf(LOG_NOTICE, " sets the NIC Selection Mode :"); * - review
lprintf(LOG_NOTICE, " on iDRAC12g :"); * - make it fit into 80 chars per line
lprintf(LOG_NOTICE, " dedicated, shared with lom1, shared with " * - this ``shared with Failover None).'' seems like a typo
"lom2,shared with lom3,shared "); */
lprintf(LOG_NOTICE, " with lom4,shared with failover lom1,"
"shared with failover lom2,shared ");
lprintf(LOG_NOTICE, " with failover lom3,shared with failover "
"lom4,shared with Failover all ");
lprintf(LOG_NOTICE, " loms, shared with Failover None).");
lprintf(LOG_NOTICE, " on other systems :");
lprintf(LOG_NOTICE, lprintf(LOG_NOTICE,
" dedicated, shared, shared with failover lom2,"); "");
lprintf(LOG_NOTICE, " shared with Failover all loms."); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, ""); " lan set <Mode>");
lprintf(LOG_NOTICE, " lan get "); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, " on iDRAC12g :"); " sets the NIC Selection Mode :");
lprintf(LOG_NOTICE, " returns the current NIC Selection Mode " lprintf(LOG_NOTICE,
"(dedicated, shared with lom1, shared "); " on iDRAC12g :");
lprintf(LOG_NOTICE, " with lom2, shared with lom3, shared with " lprintf(LOG_NOTICE,
"lom4,shared with failover lom1,"); " dedicated, shared with lom1, shared with lom2,shared with lom3,shared");
lprintf(LOG_NOTICE, " shared with failover lom2,shared with " lprintf(LOG_NOTICE,
"failover lom3,shared with failover "); " with lom4,shared with failover lom1,shared with failover lom2,shared");
lprintf(LOG_NOTICE, " lom4,shared with Failover all loms," lprintf(LOG_NOTICE,
"shared with Failover None)."); " with failover lom3,shared with failover lom4,shared with Failover all");
lprintf(LOG_NOTICE, " on other systems :"); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, " dedicated, shared, shared with failover,"); " loms, shared with Failover None).");
lprintf(LOG_NOTICE, " lom2, shared with Failover all loms."); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, ""); " on other systems :");
lprintf(LOG_NOTICE, " lan get active"); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, " returns the current active NIC (dedicated, LOM1, " " dedicated, shared, shared with failover lom2,");
"LOM2, LOM3, LOM4)."); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, ""); " shared with Failover all loms.");
lprintf(LOG_NOTICE,
"");
lprintf(LOG_NOTICE,
" lan get ");
lprintf(LOG_NOTICE,
" on iDRAC12g :");
lprintf(LOG_NOTICE,
" returns the current NIC Selection Mode (dedicated, shared with lom1, shared");
lprintf(LOG_NOTICE,
" with lom2, shared with lom3, shared with lom4,shared with failover lom1,");
lprintf(LOG_NOTICE,
" shared with failover lom2,shared with failover lom3,shared with failover");
lprintf(LOG_NOTICE,
" lom4,shared with Failover all loms,shared with Failover None).");
lprintf(LOG_NOTICE,
" on other systems :");
lprintf(LOG_NOTICE,
" dedicated, shared, shared with failover,");
lprintf(LOG_NOTICE,
" lom2, shared with Failover all loms.");
lprintf(LOG_NOTICE,
"");
lprintf(LOG_NOTICE,
" lan get active");
lprintf(LOG_NOTICE,
" returns the current active NIC (dedicated, LOM1, LOM2, LOM3, LOM4).");
lprintf(LOG_NOTICE,
"");
} }
/* /*
* Function Name: ipmi_delloem_powermonitor_main * Function Name: ipmi_delloem_powermonitor_main
@ -3659,36 +3724,62 @@ ipmi_set_power_cap(struct ipmi_intf * intf, int unit, int val)
static void static void
ipmi_powermonitor_usage(void) ipmi_powermonitor_usage(void)
{ {
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, " powermonitor");
lprintf(LOG_NOTICE, " Shows power tracking statistics ");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, " powermonitor clear cumulativepower");
lprintf(LOG_NOTICE, " Reset cumulative power reading");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, " powermonitor clear peakpower");
lprintf(LOG_NOTICE, " Reset peak power reading");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, " powermonitor powerconsumption");
lprintf(LOG_NOTICE, " Displays power consumption in <watt|btuphr>");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, " powermonitor powerconsumptionhistory <watt|btuphr>");
lprintf(LOG_NOTICE, " Displays power consumption history ");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, " powermonitor getpowerbudget");
lprintf(LOG_NOTICE, " Displays power cap in <watt|btuphr>");
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, lprintf(LOG_NOTICE,
" powermonitor setpowerbudget <val><watt|btuphr|percent>"); "");
lprintf(LOG_NOTICE, lprintf(LOG_NOTICE,
" Allows user to set the power cap in <watt|BTU/hr|percentage>"); " powermonitor");
lprintf(LOG_NOTICE, ""); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, " powermonitor enablepowercap "); " Shows power tracking statistics ");
lprintf(LOG_NOTICE, " To enable set power cap"); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, ""); "");
lprintf(LOG_NOTICE, " powermonitor disablepowercap "); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, " To disable set power cap"); " powermonitor clear cumulativepower");
lprintf(LOG_NOTICE, ""); lprintf(LOG_NOTICE,
" Reset cumulative power reading");
lprintf(LOG_NOTICE,
"");
lprintf(LOG_NOTICE,
" powermonitor clear peakpower");
lprintf(LOG_NOTICE,
" Reset peak power reading");
lprintf(LOG_NOTICE,
"");
lprintf(LOG_NOTICE,
" powermonitor powerconsumption");
lprintf(LOG_NOTICE,
" Displays power consumption in <watt|btuphr>");
lprintf(LOG_NOTICE,
"");
lprintf(LOG_NOTICE,
" powermonitor powerconsumptionhistory <watt|btuphr>");
lprintf(LOG_NOTICE,
" Displays power consumption history ");
lprintf(LOG_NOTICE,
"");
lprintf(LOG_NOTICE,
" powermonitor getpowerbudget");
lprintf(LOG_NOTICE,
" Displays power cap in <watt|btuphr>");
lprintf(LOG_NOTICE,
"");
lprintf(LOG_NOTICE,
" powermonitor setpowerbudget <val><watt|btuphr|percent>");
lprintf(LOG_NOTICE,
" Allows user to set the power cap in <watt|BTU/hr|percentage>");
lprintf(LOG_NOTICE,
"");
lprintf(LOG_NOTICE,
" powermonitor enablepowercap ");
lprintf(LOG_NOTICE,
" To enable set power cap");
lprintf(LOG_NOTICE,
"");
lprintf(LOG_NOTICE,
" powermonitor disablepowercap ");
lprintf(LOG_NOTICE,
" To disable set power cap");
lprintf(LOG_NOTICE,
"");
} }
/* /*
* Function Name: ipmi_delloem_vFlash_main * Function Name: ipmi_delloem_vFlash_main
@ -3866,10 +3957,14 @@ ipmi_delloem_vFlash_process(struct ipmi_intf * intf, int current_arg, char ** ar
static void static void
ipmi_vFlash_usage(void) ipmi_vFlash_usage(void)
{ {
lprintf(LOG_NOTICE, ""); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, " vFlash info Card"); "");
lprintf(LOG_NOTICE, " Shows Extended SD Card information"); 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 * Function Name: ipmi_setled_usage
@ -3883,15 +3978,20 @@ ipmi_vFlash_usage(void)
static void static void
ipmi_setled_usage(void) ipmi_setled_usage(void)
{ {
lprintf(LOG_NOTICE, "");
lprintf(LOG_NOTICE, " setled <b:d.f> <state..>");
lprintf(LOG_NOTICE, " Set backplane LED state");
lprintf(LOG_NOTICE, lprintf(LOG_NOTICE,
" b:d.f = PCI Bus:Device.Function of drive (lspci format)"); "");
lprintf(LOG_NOTICE, lprintf(LOG_NOTICE,
" state = present|online|hotspare|identify|rebuilding|"); " setled <b:d.f> <state..>");
lprintf(LOG_NOTICE, " fault|predict|critical|failed"); lprintf(LOG_NOTICE,
lprintf(LOG_NOTICE, ""); " Set backplane LED state");
lprintf(LOG_NOTICE,
" b:d.f = PCI Bus:Device.Function of drive (lspci format)");
lprintf(LOG_NOTICE,
" state = present|online|hotspare|identify|rebuilding|");
lprintf(LOG_NOTICE,
" fault|predict|critical|failed");
lprintf(LOG_NOTICE,
"");
} }
static int static int