mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
cleanup all unused-parameter warnings
Cleanup all unused-parameter warnings. Each warning was examined to verify it wasn't simply a case of a build macro difference. Partially resolves ipmitool/ipmitool#13 Signed-off-by: Patrick Venture <venture@google.com>
This commit is contained in:
parent
d6d9c85139
commit
8ea6094118
@ -93,7 +93,7 @@ typedef enum picmg_busres_resource_id {
|
|||||||
} t_picmg_busres_resource_id;
|
} t_picmg_busres_resource_id;
|
||||||
|
|
||||||
/* the LED color capabilities */
|
/* the LED color capabilities */
|
||||||
static const char* __UNUSED__(led_color_str[]) = {
|
static const char *__UNUSED__(led_color_str[]) = {
|
||||||
"reserved",
|
"reserved",
|
||||||
"BLUE",
|
"BLUE",
|
||||||
"RED",
|
"RED",
|
||||||
|
@ -92,17 +92,16 @@ struct activate_payload_rsp {
|
|||||||
* function will return -1 if value is not valid, or
|
* function will return -1 if value is not valid, or
|
||||||
* will return 0 if valid.
|
* will return 0 if valid.
|
||||||
*/
|
*/
|
||||||
int ipmi_sol_set_param_isvalid_uint8_t( const char *strval,
|
int ipmi_sol_set_param_isvalid_uint8_t(const char *strval,
|
||||||
const char *name,
|
const char *name,
|
||||||
int base,
|
uint8_t minval,
|
||||||
uint8_t minval,
|
uint8_t maxval,
|
||||||
uint8_t maxval,
|
uint8_t *out_value);
|
||||||
uint8_t *out_value);
|
|
||||||
|
|
||||||
int ipmi_sol_main(struct ipmi_intf *, int, char **);
|
int ipmi_sol_main(struct ipmi_intf *, int, char **);
|
||||||
int ipmi_get_sol_info(struct ipmi_intf * intf,
|
int ipmi_get_sol_info(struct ipmi_intf *intf,
|
||||||
uint8_t channel,
|
uint8_t channel,
|
||||||
struct sol_config_parameters * params);
|
struct sol_config_parameters *params);
|
||||||
|
|
||||||
|
|
||||||
#endif /* IPMI_SOL_H */
|
#endif /* IPMI_SOL_H */
|
||||||
|
@ -171,12 +171,10 @@ static int ipmi_lcd_get_status(struct ipmi_intf *intf);
|
|||||||
static int ipmi_lcd_set_kvm(struct ipmi_intf *intf, char status);
|
static int ipmi_lcd_set_kvm(struct ipmi_intf *intf, char status);
|
||||||
static int ipmi_lcd_set_lock(struct ipmi_intf *intf, char lock);
|
static int ipmi_lcd_set_lock(struct ipmi_intf *intf, char lock);
|
||||||
static int ipmi_lcd_set_single_line_text(struct ipmi_intf *intf, char *text);
|
static int ipmi_lcd_set_single_line_text(struct ipmi_intf *intf, char *text);
|
||||||
static int ipmi_lcd_set_text(struct ipmi_intf *intf, char *text,
|
static int ipmi_lcd_set_text(struct ipmi_intf *intf, char *text);
|
||||||
int line_number);
|
|
||||||
static int ipmi_lcd_configure_wh(struct ipmi_intf *intf, uint32_t mode,
|
static int ipmi_lcd_configure_wh(struct ipmi_intf *intf, uint32_t mode,
|
||||||
uint16_t lcdquallifier, uint8_t errordisp, int8_t line_number, char *text);
|
uint16_t lcdquallifier, uint8_t errordisp, char *text);
|
||||||
static int ipmi_lcd_configure(struct ipmi_intf *intf, int command,
|
static int ipmi_lcd_configure(struct ipmi_intf *intf, int command, char *text);
|
||||||
int8_t line_number, char *text);
|
|
||||||
static void ipmi_lcd_usage(void);
|
static void ipmi_lcd_usage(void);
|
||||||
/* MAC Function prototypes */
|
/* MAC Function prototypes */
|
||||||
static int ipmi_delloem_mac_main(struct ipmi_intf *intf, int argc, char **argv);
|
static int ipmi_delloem_mac_main(struct ipmi_intf *intf, int argc, char **argv);
|
||||||
@ -417,10 +415,10 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
if (strncmp(argv[current_arg], "none\0", 5) == 0) {
|
if (strncmp(argv[current_arg], "none\0", 5) == 0) {
|
||||||
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_CONFIG_NONE, 0xFF,
|
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_CONFIG_NONE, 0xFF,
|
||||||
0XFF, 0, NULL);
|
0XFF, NULL);
|
||||||
} else if (strncmp(argv[current_arg], "modelname\0", 10) == 0) {
|
} else if (strncmp(argv[current_arg], "modelname\0", 10) == 0) {
|
||||||
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_CONFIG_DEFAULT, 0xFF,
|
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_CONFIG_DEFAULT, 0xFF,
|
||||||
0XFF, 0, NULL);
|
0XFF, NULL);
|
||||||
} else if (strncmp(argv[current_arg], "userdefined\0", 12) == 0) {
|
} else if (strncmp(argv[current_arg], "userdefined\0", 12) == 0) {
|
||||||
current_arg++;
|
current_arg++;
|
||||||
if (argc <= current_arg) {
|
if (argc <= current_arg) {
|
||||||
@ -428,31 +426,31 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_CONFIG_USER_DEFINED,
|
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_CONFIG_USER_DEFINED,
|
||||||
0xFF, 0XFF, line_number, argv[current_arg]);
|
0xFF, 0XFF, argv[current_arg]);
|
||||||
} else if (strncmp(argv[current_arg], "ipv4address\0", 12) == 0) {
|
} else if (strncmp(argv[current_arg], "ipv4address\0", 12) == 0) {
|
||||||
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_iDRAC_IPV4ADRESS,
|
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_iDRAC_IPV4ADRESS,
|
||||||
0xFF, 0XFF, 0, NULL);
|
0xFF, 0XFF, NULL);
|
||||||
} else if (strncmp(argv[current_arg], "macaddress\0", 11) == 0) {
|
} else if (strncmp(argv[current_arg], "macaddress\0", 11) == 0) {
|
||||||
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_IDRAC_MAC_ADDRESS,
|
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_IDRAC_MAC_ADDRESS,
|
||||||
0xFF, 0XFF, 0, NULL);
|
0xFF, 0XFF, NULL);
|
||||||
} else if (strncmp(argv[current_arg], "systemname\0", 11) == 0) {
|
} else if (strncmp(argv[current_arg], "systemname\0", 11) == 0) {
|
||||||
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_OS_SYSTEM_NAME, 0xFF,
|
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_OS_SYSTEM_NAME, 0xFF,
|
||||||
0XFF, 0, NULL);
|
0XFF, NULL);
|
||||||
} else if (strncmp(argv[current_arg], "servicetag\0", 11) == 0) {
|
} else if (strncmp(argv[current_arg], "servicetag\0", 11) == 0) {
|
||||||
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_SERVICE_TAG, 0xFF,
|
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_SERVICE_TAG, 0xFF,
|
||||||
0XFF, 0, NULL);
|
0XFF, NULL);
|
||||||
} else if (strncmp(argv[current_arg], "ipv6address\0", 12) == 0) {
|
} else if (strncmp(argv[current_arg], "ipv6address\0", 12) == 0) {
|
||||||
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_iDRAC_IPV6ADRESS,
|
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_iDRAC_IPV6ADRESS,
|
||||||
0xFF, 0XFF, 0, NULL);
|
0xFF, 0XFF, NULL);
|
||||||
} else if (strncmp(argv[current_arg], "ambienttemp\0", 12) == 0) {
|
} else if (strncmp(argv[current_arg], "ambienttemp\0", 12) == 0) {
|
||||||
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_AMBEINT_TEMP, 0xFF,
|
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_AMBEINT_TEMP, 0xFF,
|
||||||
0XFF, 0, NULL);
|
0XFF, NULL);
|
||||||
} else if (strncmp(argv[current_arg], "systemwatt\0", 11) == 0) {
|
} else if (strncmp(argv[current_arg], "systemwatt\0", 11) == 0) {
|
||||||
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_SYSTEM_WATTS, 0xFF,
|
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_SYSTEM_WATTS, 0xFF,
|
||||||
0XFF, 0, NULL);
|
0XFF, NULL);
|
||||||
} else if (strncmp(argv[current_arg], "assettag\0", 9) == 0) {
|
} else if (strncmp(argv[current_arg], "assettag\0", 9) == 0) {
|
||||||
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_ASSET_TAG, 0xFF,
|
rc = ipmi_lcd_configure_wh(intf, IPMI_DELL_LCD_ASSET_TAG, 0xFF,
|
||||||
0XFF, 0, NULL);
|
0XFF, NULL);
|
||||||
} else if (strncmp(argv[current_arg], "help\0", 5) == 0) {
|
} else if (strncmp(argv[current_arg], "help\0", 5) == 0) {
|
||||||
ipmi_lcd_usage();
|
ipmi_lcd_usage();
|
||||||
} else {
|
} else {
|
||||||
@ -472,13 +470,13 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (strncmp(argv[current_arg], "watt\0", 5) == 0) {
|
if (strncmp(argv[current_arg], "watt\0", 5) == 0) {
|
||||||
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x00, 0XFF, 0, NULL);
|
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x00, 0XFF, NULL);
|
||||||
} else if (strncmp(argv[current_arg], "btuphr\0",7) == 0) {
|
} else if (strncmp(argv[current_arg], "btuphr\0",7) == 0) {
|
||||||
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x01, 0XFF, 0, NULL);
|
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x01, 0XFF, NULL);
|
||||||
} else if (strncmp(argv[current_arg], "celsius\0", 8) == 0) {
|
} else if (strncmp(argv[current_arg], "celsius\0", 8) == 0) {
|
||||||
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x02, 0xFF, 0, NULL);
|
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x02, 0xFF, NULL);
|
||||||
} else if (strncmp(argv[current_arg], "fahrenheit", 11) == 0) {
|
} else if (strncmp(argv[current_arg], "fahrenheit", 11) == 0) {
|
||||||
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x03, 0xFF, 0, NULL);
|
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0x03, 0xFF, NULL);
|
||||||
} else if (strncmp(argv[current_arg], "help\0", 5) == 0) {
|
} else if (strncmp(argv[current_arg], "help\0", 5) == 0) {
|
||||||
ipmi_lcd_usage();
|
ipmi_lcd_usage();
|
||||||
} else {
|
} else {
|
||||||
@ -499,10 +497,10 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
if (strncmp(argv[current_arg], "sel\0", 4) == 0) {
|
if (strncmp(argv[current_arg], "sel\0", 4) == 0) {
|
||||||
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0xFF,
|
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0xFF,
|
||||||
IPMI_DELL_LCD_ERROR_DISP_SEL, 0, NULL);
|
IPMI_DELL_LCD_ERROR_DISP_SEL, NULL);
|
||||||
} else if (strncmp(argv[current_arg], "simple\0", 7) == 0) {
|
} else if (strncmp(argv[current_arg], "simple\0", 7) == 0) {
|
||||||
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0xFF,
|
rc = ipmi_lcd_configure_wh(intf, 0xFF, 0xFF,
|
||||||
IPMI_DELL_LCD_ERROR_DISP_VERBOSE, 0, NULL);
|
IPMI_DELL_LCD_ERROR_DISP_VERBOSE, NULL);
|
||||||
} else if (strncmp(argv[current_arg], "help\0", 5) == 0) {
|
} else if (strncmp(argv[current_arg], "help\0", 5) == 0) {
|
||||||
ipmi_lcd_usage();
|
ipmi_lcd_usage();
|
||||||
} else {
|
} else {
|
||||||
@ -512,10 +510,10 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
} else if ((strncmp(argv[current_arg], "none\0", 5) == 0)
|
} else if ((strncmp(argv[current_arg], "none\0", 5) == 0)
|
||||||
&& (iDRAC_FLAG==0)) {
|
&& (iDRAC_FLAG==0)) {
|
||||||
rc = ipmi_lcd_configure(intf, IPMI_DELL_LCD_CONFIG_NONE, 0, NULL);
|
rc = ipmi_lcd_configure(intf, IPMI_DELL_LCD_CONFIG_NONE, NULL);
|
||||||
} else if ((strncmp(argv[current_arg], "default\0", 8) == 0)
|
} else if ((strncmp(argv[current_arg], "default\0", 8) == 0)
|
||||||
&& (iDRAC_FLAG==0)) {
|
&& (iDRAC_FLAG==0)) {
|
||||||
rc = ipmi_lcd_configure(intf, IPMI_DELL_LCD_CONFIG_DEFAULT, 0, NULL);
|
rc = ipmi_lcd_configure(intf, IPMI_DELL_LCD_CONFIG_DEFAULT, NULL);
|
||||||
} else if ((strncmp(argv[current_arg], "custom\0", 7) == 0)
|
} else if ((strncmp(argv[current_arg], "custom\0", 7) == 0)
|
||||||
&& (iDRAC_FLAG==0)) {
|
&& (iDRAC_FLAG==0)) {
|
||||||
current_arg++;
|
current_arg++;
|
||||||
@ -524,7 +522,7 @@ ipmi_delloem_lcd_main(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
rc = ipmi_lcd_configure(intf, IPMI_DELL_LCD_CONFIG_USER_DEFINED,
|
rc = ipmi_lcd_configure(intf, IPMI_DELL_LCD_CONFIG_USER_DEFINED,
|
||||||
line_number, argv[current_arg]);
|
argv[current_arg]);
|
||||||
} else if (strncmp(argv[current_arg], "vkvm\0", 5) == 0) {
|
} else if (strncmp(argv[current_arg], "vkvm\0", 5) == 0) {
|
||||||
current_arg++;
|
current_arg++;
|
||||||
if (argc <= current_arg) {
|
if (argc <= current_arg) {
|
||||||
@ -1332,13 +1330,12 @@ ipmi_lcd_set_single_line_text(struct ipmi_intf * intf, char * text)
|
|||||||
* Description: This function sets lcd line text
|
* Description: This function sets lcd line text
|
||||||
* Input: intf - ipmi interface
|
* Input: intf - ipmi interface
|
||||||
* text - lcd string
|
* text - lcd string
|
||||||
* line_number- line number
|
|
||||||
* Output:
|
* Output:
|
||||||
* Return: -1 on error
|
* Return: -1 on error
|
||||||
* 0 if successful
|
* 0 if successful
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
ipmi_lcd_set_text(struct ipmi_intf * intf, char * text, int line_number)
|
ipmi_lcd_set_text(struct ipmi_intf * intf, char * text)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
IPMI_DELL_LCD_CAPS lcd_caps;
|
IPMI_DELL_LCD_CAPS lcd_caps;
|
||||||
@ -1367,7 +1364,6 @@ ipmi_lcd_set_text(struct ipmi_intf * intf, char * text, int line_number)
|
|||||||
* Input: intf - ipmi interface
|
* Input: intf - ipmi interface
|
||||||
* lcdquallifier- lcd quallifier
|
* lcdquallifier- lcd quallifier
|
||||||
* errordisp - error number
|
* errordisp - error number
|
||||||
* line_number-line number
|
|
||||||
* text - lcd string
|
* text - lcd string
|
||||||
* Output:
|
* Output:
|
||||||
* Return: -1 on error
|
* Return: -1 on error
|
||||||
@ -1375,12 +1371,12 @@ ipmi_lcd_set_text(struct ipmi_intf * intf, char * text, int line_number)
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
ipmi_lcd_configure_wh(struct ipmi_intf * intf, uint32_t mode,
|
ipmi_lcd_configure_wh(struct ipmi_intf * intf, uint32_t mode,
|
||||||
uint16_t lcdquallifier, uint8_t errordisp, int8_t line_number, char * text)
|
uint16_t lcdquallifier, uint8_t errordisp, char * text)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
if (IPMI_DELL_LCD_CONFIG_USER_DEFINED == mode) {
|
if (IPMI_DELL_LCD_CONFIG_USER_DEFINED == mode) {
|
||||||
/* Any error was reported earlier. */
|
/* Any error was reported earlier. */
|
||||||
rc = ipmi_lcd_set_text(intf, text, line_number);
|
rc = ipmi_lcd_set_text(intf, text);
|
||||||
}
|
}
|
||||||
if (rc == 0) {
|
if (rc == 0) {
|
||||||
rc = ipmi_lcd_set_configure_command_wh(intf, mode ,lcdquallifier,errordisp);
|
rc = ipmi_lcd_set_configure_command_wh(intf, mode ,lcdquallifier,errordisp);
|
||||||
@ -1393,19 +1389,17 @@ ipmi_lcd_configure_wh(struct ipmi_intf * intf, uint32_t mode,
|
|||||||
* Description: This function updates the current lcd configuration
|
* Description: This function updates the current lcd configuration
|
||||||
* Input: intf - ipmi interface
|
* Input: intf - ipmi interface
|
||||||
* command- lcd command
|
* command- lcd command
|
||||||
* line_number-line number
|
|
||||||
* text - lcd string
|
* text - lcd string
|
||||||
* Output:
|
* Output:
|
||||||
* Return: -1 on error
|
* Return: -1 on error
|
||||||
* 0 if successful
|
* 0 if successful
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
ipmi_lcd_configure(struct ipmi_intf * intf, int command,
|
ipmi_lcd_configure(struct ipmi_intf * intf, int command, char * text)
|
||||||
int8_t line_number, char * text)
|
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
if (IPMI_DELL_LCD_CONFIG_USER_DEFINED == command) {
|
if (IPMI_DELL_LCD_CONFIG_USER_DEFINED == command) {
|
||||||
rc = ipmi_lcd_set_text(intf, text, line_number);
|
rc = ipmi_lcd_set_text(intf, text);
|
||||||
}
|
}
|
||||||
if (rc == 0) {
|
if (rc == 0) {
|
||||||
rc = ipmi_lcd_set_configure_command(intf, command);
|
rc = ipmi_lcd_set_configure_command(intf, command);
|
||||||
@ -1948,7 +1942,7 @@ ipmi_mac_usage(void)
|
|||||||
*
|
*
|
||||||
* Description: This function processes the delloem lan command
|
* Description: This function processes the delloem lan command
|
||||||
* Input: intf - ipmi interface
|
* Input: intf - ipmi interface
|
||||||
* argc - no of arguments
|
* argc - no of arguments (unused, left in for calling consistency)
|
||||||
* argv - argument string array
|
* argv - argument string array
|
||||||
* Output:
|
* Output:
|
||||||
*
|
*
|
||||||
@ -1956,7 +1950,7 @@ ipmi_mac_usage(void)
|
|||||||
* -1 - failure
|
* -1 - failure
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
ipmi_delloem_lan_main(struct ipmi_intf * intf, int argc, char ** argv)
|
ipmi_delloem_lan_main(struct ipmi_intf * intf, int __UNUSED__(argc), char ** argv)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
int nic_selection = 0;
|
int nic_selection = 0;
|
||||||
@ -3741,7 +3735,7 @@ ipmi_powermonitor_usage(void)
|
|||||||
*
|
*
|
||||||
* Description: This function processes the delloem vFlash command
|
* Description: This function processes the delloem vFlash command
|
||||||
* Input: intf - ipmi interface
|
* Input: intf - ipmi interface
|
||||||
* argc - no of arguments
|
* argc - no of arguments (unused)
|
||||||
* argv - argument string array
|
* argv - argument string array
|
||||||
* Output:
|
* Output:
|
||||||
*
|
*
|
||||||
@ -3749,7 +3743,7 @@ ipmi_powermonitor_usage(void)
|
|||||||
* -1 - failure
|
* -1 - failure
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
ipmi_delloem_vFlash_main(struct ipmi_intf * intf, int argc, char ** argv)
|
ipmi_delloem_vFlash_main(struct ipmi_intf * intf, int __UNUSED__(argc), char ** argv)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
current_arg++;
|
current_arg++;
|
||||||
|
@ -218,8 +218,7 @@ static void ipmi_ek_add_record2list( struct ipmi_ek_multi_header ** record,
|
|||||||
struct ipmi_ek_multi_header ** list_last );
|
struct ipmi_ek_multi_header ** list_last );
|
||||||
|
|
||||||
static void ipmi_ek_display_record( struct ipmi_ek_multi_header * record,
|
static void ipmi_ek_display_record( struct ipmi_ek_multi_header * record,
|
||||||
struct ipmi_ek_multi_header * list_head,
|
struct ipmi_ek_multi_header * list_head);
|
||||||
struct ipmi_ek_multi_header * list_last );
|
|
||||||
|
|
||||||
static void ipmi_ek_remove_record_from_list(
|
static void ipmi_ek_remove_record_from_list(
|
||||||
struct ipmi_ek_multi_header * record,
|
struct ipmi_ek_multi_header * record,
|
||||||
@ -236,7 +235,7 @@ static int ipmi_ekanalyzer_fru_file2structure( char * filename,
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
static int ipmi_ek_matching_process( int * file_type, int index1, int index2,
|
static int ipmi_ek_matching_process( int * file_type, int index1, int index2,
|
||||||
struct ipmi_ek_multi_header ** list_head,
|
struct ipmi_ek_multi_header ** list_head,
|
||||||
struct ipmi_ek_multi_header ** list_last, char * opt,
|
char * opt,
|
||||||
struct ipmi_ek_multi_header * pphysical );
|
struct ipmi_ek_multi_header * pphysical );
|
||||||
|
|
||||||
static int ipmi_ek_get_resource_descriptor( int port_count, int index,
|
static int ipmi_ek_get_resource_descriptor( int port_count, int index,
|
||||||
@ -456,7 +455,7 @@ ipmi_ek_get_file_type(char *argument)
|
|||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
int
|
int
|
||||||
ipmi_ekanalyzer_main(struct ipmi_intf *intf, int argc, char **argv)
|
ipmi_ekanalyzer_main(struct ipmi_intf *__UNUSED__(intf), int argc, char **argv)
|
||||||
{
|
{
|
||||||
int rc = ERROR_STATUS;
|
int rc = ERROR_STATUS;
|
||||||
int file_type[MAX_FILE_NUMBER];
|
int file_type[MAX_FILE_NUMBER];
|
||||||
@ -513,7 +512,7 @@ ipmi_ekanalyzer_main(struct ipmi_intf *intf, int argc, char **argv)
|
|||||||
/* Convert from binary data into multi record structure */
|
/* Convert from binary data into multi record structure */
|
||||||
rc = ipmi_ekanalyzer_fru_file2structure (filename[type_offset],
|
rc = ipmi_ekanalyzer_fru_file2structure (filename[type_offset],
|
||||||
&list_head, &list_record, &list_last );
|
&list_head, &list_record, &list_last );
|
||||||
ipmi_ek_display_record(list_record, list_head, list_last);
|
ipmi_ek_display_record(list_record, list_head);
|
||||||
/* Remove record of list */
|
/* Remove record of list */
|
||||||
while (list_head) {
|
while (list_head) {
|
||||||
ipmi_ek_remove_record_from_list(list_head,
|
ipmi_ek_remove_record_from_list(list_head,
|
||||||
@ -1188,7 +1187,7 @@ ipmi_ekanalyzer_ekeying_match( int argc, char * opt,
|
|||||||
}
|
}
|
||||||
return_value = ipmi_ek_matching_process( file_type,
|
return_value = ipmi_ek_matching_process( file_type,
|
||||||
match_pair, num_file, list_head,
|
match_pair, num_file, list_head,
|
||||||
list_last, opt, pcarrier_p2p);
|
opt, pcarrier_p2p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1224,8 +1223,6 @@ ipmi_ekanalyzer_ekeying_match( int argc, char * opt,
|
|||||||
* index2: position of the second record in the list of the record
|
* index2: position of the second record in the list of the record
|
||||||
* ipmi_ek_multi_header ** list_head: pointer to the header of a
|
* ipmi_ek_multi_header ** list_head: pointer to the header of a
|
||||||
* linked list that contain FRU multi record
|
* linked list that contain FRU multi record
|
||||||
* ipmi_ek_multi_header ** list_last: pointer to the tale of a
|
|
||||||
* linked list that contain FRU multi record
|
|
||||||
* opt: string that contain display option such as "match", "unmatch", or
|
* opt: string that contain display option such as "match", "unmatch", or
|
||||||
* "all".
|
* "all".
|
||||||
* pphysical: a pointer that contain a carrier p2p connectivity record
|
* pphysical: a pointer that contain a carrier p2p connectivity record
|
||||||
@ -1241,7 +1238,7 @@ ipmi_ekanalyzer_ekeying_match( int argc, char * opt,
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
static int ipmi_ek_matching_process( int * file_type, int index1, int index2,
|
static int ipmi_ek_matching_process( int * file_type, int index1, int index2,
|
||||||
struct ipmi_ek_multi_header ** list_head,
|
struct ipmi_ek_multi_header ** list_head,
|
||||||
struct ipmi_ek_multi_header ** list_last, char * opt,
|
char * opt,
|
||||||
struct ipmi_ek_multi_header * pphysical )
|
struct ipmi_ek_multi_header * pphysical )
|
||||||
{
|
{
|
||||||
int result = ERROR_STATUS;
|
int result = ERROR_STATUS;
|
||||||
@ -2951,7 +2948,6 @@ ipmi_ek_display_product_info_area(FILE *input_file, long offset)
|
|||||||
*
|
*
|
||||||
* Input: record: a pointer to current record
|
* Input: record: a pointer to current record
|
||||||
* list_head: a pointer to header of the list
|
* list_head: a pointer to header of the list
|
||||||
* list_last: a pointer to tale of the list
|
|
||||||
*
|
*
|
||||||
* Output: None
|
* Output: None
|
||||||
*
|
*
|
||||||
@ -2962,8 +2958,7 @@ ipmi_ek_display_product_info_area(FILE *input_file, long offset)
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
static void
|
static void
|
||||||
ipmi_ek_display_record(struct ipmi_ek_multi_header *record,
|
ipmi_ek_display_record(struct ipmi_ek_multi_header *record,
|
||||||
struct ipmi_ek_multi_header *list_head,
|
struct ipmi_ek_multi_header *list_head)
|
||||||
struct ipmi_ek_multi_header *list_last)
|
|
||||||
{
|
{
|
||||||
if (!list_head) {
|
if (!list_head) {
|
||||||
printf("***empty list***\n");
|
printf("***empty list***\n");
|
||||||
|
@ -1573,10 +1573,11 @@ typedef struct OemKontronInformationRecordV1{
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void ipmi_fru_oemkontron_get( int argc, char ** argv,uint8_t * fru_data,
|
static void ipmi_fru_oemkontron_get(int argc,
|
||||||
int off,int len,
|
char ** argv,
|
||||||
struct fru_multirec_header *h,
|
uint8_t * fru_data,
|
||||||
struct fru_multirec_oem_header *oh)
|
int off,
|
||||||
|
struct fru_multirec_oem_header *oh)
|
||||||
{
|
{
|
||||||
static int badParams=FALSE;
|
static int badParams=FALSE;
|
||||||
int start = off;
|
int start = off;
|
||||||
@ -3703,15 +3704,15 @@ ipmi_fru_get_multirec(struct ipmi_intf * intf, uint8_t id ,
|
|||||||
if( suppliedIana == iana ) {
|
if( suppliedIana == iana ) {
|
||||||
lprintf(LOG_DEBUG, "Matching record found" );
|
lprintf(LOG_DEBUG, "Matching record found" );
|
||||||
|
|
||||||
if( iana == IPMI_OEM_KONTRON ) {
|
if( iana == IPMI_OEM_KONTRON ) {
|
||||||
ipmi_fru_oemkontron_get( argc,argv,fru_data,
|
ipmi_fru_oemkontron_get(argc, argv, fru_data,
|
||||||
i + sizeof(struct fru_multirec_header),
|
i + sizeof(struct fru_multirec_header),
|
||||||
h->len, h, oh );
|
oh);
|
||||||
}
|
}
|
||||||
/* FIXME: Add OEM record support here */
|
/* FIXME: Add OEM record support here */
|
||||||
else{
|
else{
|
||||||
printf(" OEM IANA (%s) Record not supported in this mode\n",
|
printf(" OEM IANA (%s) Record not supported in this mode\n",
|
||||||
val2str( iana, ipmi_oem_info));
|
val2str( iana, ipmi_oem_info));
|
||||||
error = 1;
|
error = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,6 @@ typedef struct gendev_eeprom_info
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
ipmi_gendev_get_eeprom_size(
|
ipmi_gendev_get_eeprom_size(
|
||||||
struct ipmi_intf *intf,
|
|
||||||
struct sdr_record_generic_locator *dev,
|
struct sdr_record_generic_locator *dev,
|
||||||
t_gendev_eeprom_info *info
|
t_gendev_eeprom_info *info
|
||||||
)
|
)
|
||||||
@ -191,7 +190,7 @@ ipmi_gendev_read_file(
|
|||||||
int eeprom_size;
|
int eeprom_size;
|
||||||
t_gendev_eeprom_info eeprom_info;
|
t_gendev_eeprom_info eeprom_info;
|
||||||
|
|
||||||
eeprom_size = ipmi_gendev_get_eeprom_size(intf, dev, &eeprom_info);
|
eeprom_size = ipmi_gendev_get_eeprom_size(dev, &eeprom_info);
|
||||||
|
|
||||||
if(eeprom_size > 0)
|
if(eeprom_size > 0)
|
||||||
{
|
{
|
||||||
@ -362,7 +361,7 @@ ipmi_gendev_write_file(
|
|||||||
int eeprom_size;
|
int eeprom_size;
|
||||||
t_gendev_eeprom_info eeprom_info;
|
t_gendev_eeprom_info eeprom_info;
|
||||||
|
|
||||||
eeprom_size = ipmi_gendev_get_eeprom_size(intf, dev, &eeprom_info);
|
eeprom_size = ipmi_gendev_get_eeprom_size(dev, &eeprom_info);
|
||||||
|
|
||||||
if(eeprom_size > 0)
|
if(eeprom_size > 0)
|
||||||
{
|
{
|
||||||
|
@ -113,7 +113,7 @@ int HpmFwupgActionUploadFirmware(struct HpmfwupgComponentBitMask components,
|
|||||||
int option,
|
int option,
|
||||||
int *pFlagColdReset);
|
int *pFlagColdReset);
|
||||||
int
|
int
|
||||||
HpmfwupgPreUpgradeCheck(struct ipmi_intf *intf,
|
HpmfwupgPreUpgradeCheck(
|
||||||
struct HpmfwupgUpgradeCtx *pFwupgCtx,
|
struct HpmfwupgUpgradeCtx *pFwupgCtx,
|
||||||
int componentMask, int option);
|
int componentMask, int option);
|
||||||
|
|
||||||
@ -503,10 +503,9 @@ HpmfwupgUpgrade(struct ipmi_intf *intf, char *imageFilename, int activate,
|
|||||||
lprintf(LOG_NOTICE, "\nPerforming upgrade stage:");
|
lprintf(LOG_NOTICE, "\nPerforming upgrade stage:");
|
||||||
}
|
}
|
||||||
if (option & VIEW_MODE) {
|
if (option & VIEW_MODE) {
|
||||||
rc = HpmfwupgPreUpgradeCheck(intf,
|
rc = HpmfwupgPreUpgradeCheck(&fwupgCtx,componentMask, VIEW_MODE);
|
||||||
&fwupgCtx,componentMask, VIEW_MODE);
|
|
||||||
} else {
|
} else {
|
||||||
rc = HpmfwupgPreUpgradeCheck(intf, &fwupgCtx,
|
rc = HpmfwupgPreUpgradeCheck(&fwupgCtx,
|
||||||
componentMask, option);
|
componentMask, option);
|
||||||
if (rc == HPMFWUPG_SUCCESS) {
|
if (rc == HPMFWUPG_SUCCESS) {
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
@ -830,7 +829,7 @@ HpmfwupgValidateActionRecordChecksum(struct HpmfwupgActionRecord *pActionRecord)
|
|||||||
* is same as target version.
|
* is same as target version.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
HpmfwupgPreUpgradeCheck(struct ipmi_intf *intf,
|
HpmfwupgPreUpgradeCheck(
|
||||||
struct HpmfwupgUpgradeCtx *pFwupgCtx,
|
struct HpmfwupgUpgradeCtx *pFwupgCtx,
|
||||||
int componentMask, int option)
|
int componentMask, int option)
|
||||||
{
|
{
|
||||||
|
@ -60,8 +60,7 @@ static void ipmi_kontron_help(void);
|
|||||||
static int ipmi_kontron_set_serial_number(struct ipmi_intf *intf);
|
static int ipmi_kontron_set_serial_number(struct ipmi_intf *intf);
|
||||||
static int ipmi_kontron_set_mfg_date (struct ipmi_intf *intf);
|
static int ipmi_kontron_set_mfg_date (struct ipmi_intf *intf);
|
||||||
static void ipmi_kontron_nextboot_help(void);
|
static void ipmi_kontron_nextboot_help(void);
|
||||||
static int ipmi_kontron_nextboot_set(struct ipmi_intf *intf, int argc,
|
static int ipmi_kontron_nextboot_set(struct ipmi_intf *intf, char **argv);
|
||||||
char **argv);
|
|
||||||
static int ipmi_kontronoem_send_set_large_buffer(struct ipmi_intf *intf,
|
static int ipmi_kontronoem_send_set_large_buffer(struct ipmi_intf *intf,
|
||||||
unsigned char channel, unsigned char size);
|
unsigned char channel, unsigned char size);
|
||||||
|
|
||||||
@ -107,7 +106,7 @@ ipmi_kontronoem_main(struct ipmi_intf *intf, int argc, char **argv)
|
|||||||
ipmi_kontron_nextboot_help();
|
ipmi_kontron_nextboot_help();
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
rc = ipmi_kontron_nextboot_set(intf, (argc - 1), (argv + 1));
|
rc = ipmi_kontron_nextboot_set(intf, (argv + 1));
|
||||||
if (rc == 0) {
|
if (rc == 0) {
|
||||||
printf("Nextboot set successfully\n");
|
printf("Nextboot set successfully\n");
|
||||||
} else {
|
} else {
|
||||||
@ -656,7 +655,7 @@ ipmi_kontron_nextboot_help(void)
|
|||||||
* returns 1 if successful
|
* returns 1 if successful
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
ipmi_kontron_nextboot_set(struct ipmi_intf *intf, int argc, char **argv)
|
ipmi_kontron_nextboot_set(struct ipmi_intf *intf, char **argv)
|
||||||
{
|
{
|
||||||
struct ipmi_rs *rsp;
|
struct ipmi_rs *rsp;
|
||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
|
@ -37,9 +37,9 @@
|
|||||||
#include <ipmitool/helper.h>
|
#include <ipmitool/helper.h>
|
||||||
#include <ipmitool/ipmi_sel.h>
|
#include <ipmitool/ipmi_sel.h>
|
||||||
|
|
||||||
static int ipmi_oem_supermicro(struct ipmi_intf * intf);
|
static int ipmi_oem_supermicro(struct ipmi_intf *intf);
|
||||||
static int ipmi_oem_ibm(struct ipmi_intf * intf);
|
static int ipmi_oem_ibm(struct ipmi_intf *intf);
|
||||||
static int ipmi_oem_quanta(struct ipmi_intf * intf);
|
static int ipmi_oem_quanta(struct ipmi_intf *intf);
|
||||||
|
|
||||||
static struct ipmi_oem_handle ipmi_oem_list[] = {
|
static struct ipmi_oem_handle ipmi_oem_list[] = {
|
||||||
{
|
{
|
||||||
@ -82,16 +82,16 @@ static struct ipmi_oem_handle ipmi_oem_list[] = {
|
|||||||
|
|
||||||
/* Supermicro IPMIv2 BMCs use OEM authtype */
|
/* Supermicro IPMIv2 BMCs use OEM authtype */
|
||||||
static int
|
static int
|
||||||
ipmi_oem_supermicro(struct ipmi_intf * intf)
|
ipmi_oem_supermicro(struct ipmi_intf *intf)
|
||||||
{
|
{
|
||||||
ipmi_intf_session_set_authtype(intf, IPMI_SESSION_AUTHTYPE_OEM);
|
ipmi_intf_session_set_authtype(intf, IPMI_SESSION_AUTHTYPE_OEM);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ipmi_oem_ibm(struct ipmi_intf * intf)
|
ipmi_oem_ibm(struct ipmi_intf *__UNUSED__(intf))
|
||||||
{
|
{
|
||||||
char * filename = getenv("IPMI_OEM_IBM_DATAFILE");
|
char *filename = getenv("IPMI_OEM_IBM_DATAFILE");
|
||||||
if (!filename) {
|
if (!filename) {
|
||||||
lprintf(LOG_ERR, "Unable to read IPMI_OEM_IBM_DATAFILE from environment");
|
lprintf(LOG_ERR, "Unable to read IPMI_OEM_IBM_DATAFILE from environment");
|
||||||
return -1;
|
return -1;
|
||||||
@ -101,7 +101,7 @@ ipmi_oem_ibm(struct ipmi_intf * intf)
|
|||||||
|
|
||||||
/* Quanta IPMIv2 BMCs use OEM authtype */
|
/* Quanta IPMIv2 BMCs use OEM authtype */
|
||||||
static int
|
static int
|
||||||
ipmi_oem_quanta(struct ipmi_intf * intf)
|
ipmi_oem_quanta(struct ipmi_intf *intf)
|
||||||
{
|
{
|
||||||
ipmi_intf_session_set_authtype(intf, IPMI_SESSION_AUTHTYPE_OEM);
|
ipmi_intf_session_set_authtype(intf, IPMI_SESSION_AUTHTYPE_OEM);
|
||||||
return 0;
|
return 0;
|
||||||
@ -112,7 +112,7 @@ ipmi_oem_quanta(struct ipmi_intf * intf)
|
|||||||
void
|
void
|
||||||
ipmi_oem_print(void)
|
ipmi_oem_print(void)
|
||||||
{
|
{
|
||||||
struct ipmi_oem_handle * oem;
|
struct ipmi_oem_handle *oem;
|
||||||
lprintf(LOG_NOTICE, "\nOEM Support:");
|
lprintf(LOG_NOTICE, "\nOEM Support:");
|
||||||
for (oem=ipmi_oem_list; oem->name && oem->desc; oem++) {
|
for (oem=ipmi_oem_list; oem->name && oem->desc; oem++) {
|
||||||
lprintf(LOG_NOTICE, "\t%-12s %s", oem->name, oem->desc);
|
lprintf(LOG_NOTICE, "\t%-12s %s", oem->name, oem->desc);
|
||||||
|
@ -603,7 +603,8 @@ _ipmi_set_pef_policy_entry(struct ipmi_intf *intf, uint8_t policy_id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ipmi_pef_print_oem_lan_dest(struct ipmi_intf *intf, uint8_t ch, uint8_t dest)
|
ipmi_pef_print_oem_lan_dest(struct ipmi_intf *intf,
|
||||||
|
uint8_t dest)
|
||||||
{
|
{
|
||||||
char address[128];
|
char address[128];
|
||||||
int len;
|
int len;
|
||||||
@ -866,7 +867,7 @@ ipmi_pef_print_serial_dest(struct ipmi_intf *intf, uint8_t ch, uint8_t dest)
|
|||||||
if (!dest || tbl_size == 0) /* Page alerting not supported */
|
if (!dest || tbl_size == 0) /* Page alerting not supported */
|
||||||
return;
|
return;
|
||||||
if (dest > tbl_size) {
|
if (dest > tbl_size) {
|
||||||
ipmi_pef_print_oem_lan_dest(intf, ch, dest - tbl_size);
|
ipmi_pef_print_oem_lan_dest(intf, dest - tbl_size);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -904,7 +905,7 @@ ipmi_pef_print_serial_dest(struct ipmi_intf *intf, uint8_t ch, uint8_t dest)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ipmi_pef_print_dest(struct ipmi_intf * intf, uint8_t ch, uint8_t dest)
|
ipmi_pef_print_dest(uint8_t dest)
|
||||||
{ /*
|
{ /*
|
||||||
// print generic alert destination info
|
// print generic alert destination info
|
||||||
*/
|
*/
|
||||||
@ -1330,7 +1331,7 @@ ipmi_pef2_list_policies(struct ipmi_intf *intf)
|
|||||||
dest);
|
dest);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ipmi_pef_print_dest(intf, channel_info.channel, dest);
|
ipmi_pef_print_dest(dest);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
@ -656,7 +656,7 @@ ipmi_picmg_properties(struct ipmi_intf * intf, int show )
|
|||||||
#define PICMG_FRU_ACTIVATE (unsigned char) 0x01
|
#define PICMG_FRU_ACTIVATE (unsigned char) 0x01
|
||||||
|
|
||||||
int
|
int
|
||||||
ipmi_picmg_fru_activation(struct ipmi_intf * intf, int argc, char ** argv, unsigned char state)
|
ipmi_picmg_fru_activation(struct ipmi_intf * intf, char ** argv, unsigned char state)
|
||||||
{
|
{
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
@ -690,7 +690,7 @@ ipmi_picmg_fru_activation(struct ipmi_intf * intf, int argc, char ** argv, unsig
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ipmi_picmg_fru_activation_policy_get(struct ipmi_intf * intf, int argc, char ** argv)
|
ipmi_picmg_fru_activation_policy_get(struct ipmi_intf * intf, char ** argv)
|
||||||
{
|
{
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
@ -729,7 +729,7 @@ ipmi_picmg_fru_activation_policy_get(struct ipmi_intf * intf, int argc, char **
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ipmi_picmg_fru_activation_policy_set(struct ipmi_intf * intf, int argc, char ** argv)
|
ipmi_picmg_fru_activation_policy_set(struct ipmi_intf * intf, char ** argv)
|
||||||
{
|
{
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
@ -1153,7 +1153,7 @@ ipmi_picmg_amc_portstate_set(struct ipmi_intf * intf, uint8_t channel,
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ipmi_picmg_get_led_properties(struct ipmi_intf * intf, int argc, char ** argv)
|
ipmi_picmg_get_led_properties(struct ipmi_intf * intf, char ** argv)
|
||||||
{
|
{
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
@ -1192,7 +1192,7 @@ ipmi_picmg_get_led_properties(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ipmi_picmg_get_led_capabilities(struct ipmi_intf * intf, int argc, char ** argv)
|
ipmi_picmg_get_led_capabilities(struct ipmi_intf * intf, char ** argv)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
@ -1242,7 +1242,7 @@ ipmi_picmg_get_led_capabilities(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ipmi_picmg_get_led_state(struct ipmi_intf * intf, int argc, char ** argv)
|
ipmi_picmg_get_led_state(struct ipmi_intf * intf, char ** argv)
|
||||||
{
|
{
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
@ -1329,7 +1329,7 @@ ipmi_picmg_get_led_state(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ipmi_picmg_set_led_state(struct ipmi_intf * intf, int argc, char ** argv)
|
ipmi_picmg_set_led_state(struct ipmi_intf * intf, char ** argv)
|
||||||
{
|
{
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
@ -1405,7 +1405,7 @@ ipmi_picmg_set_led_state(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ipmi_picmg_get_power_level(struct ipmi_intf * intf, int argc, char ** argv)
|
ipmi_picmg_get_power_level(struct ipmi_intf * intf, char ** argv)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
@ -1456,7 +1456,7 @@ ipmi_picmg_get_power_level(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ipmi_picmg_set_power_level(struct ipmi_intf * intf, int argc, char ** argv)
|
ipmi_picmg_set_power_level(struct ipmi_intf * intf, char ** argv)
|
||||||
{
|
{
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
@ -1560,7 +1560,7 @@ ipmi_picmg_bused_resource(struct ipmi_intf * intf, t_picmg_bused_resource_mode m
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ipmi_picmg_fru_control(struct ipmi_intf * intf, int argc, char ** argv)
|
ipmi_picmg_fru_control(struct ipmi_intf * intf, char ** argv)
|
||||||
{
|
{
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
@ -1807,7 +1807,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
/* fru control command */
|
/* fru control command */
|
||||||
else if (!strncmp(argv[0], "frucontrol", 10)) {
|
else if (!strncmp(argv[0], "frucontrol", 10)) {
|
||||||
if (argc > 2) {
|
if (argc > 2) {
|
||||||
rc = ipmi_picmg_fru_control(intf, argc-1, &(argv[1]));
|
rc = ipmi_picmg_fru_control(intf, &(argv[1]));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lprintf(LOG_NOTICE, "usage: frucontrol <FRU-ID> <OPTION>");
|
lprintf(LOG_NOTICE, "usage: frucontrol <FRU-ID> <OPTION>");
|
||||||
@ -1827,7 +1827,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
/* fru activation command */
|
/* fru activation command */
|
||||||
else if (!strncmp(argv[0], "activate", 8)) {
|
else if (!strncmp(argv[0], "activate", 8)) {
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
rc = ipmi_picmg_fru_activation(intf, argc-1, &(argv[1]), PICMG_FRU_ACTIVATE);
|
rc = ipmi_picmg_fru_activation(intf, &(argv[1]), PICMG_FRU_ACTIVATE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lprintf(LOG_ERR, "Specify the FRU to activate.");
|
lprintf(LOG_ERR, "Specify the FRU to activate.");
|
||||||
@ -1838,7 +1838,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
/* fru deactivation command */
|
/* fru deactivation command */
|
||||||
else if (!strncmp(argv[0], "deactivate", 10)) {
|
else if (!strncmp(argv[0], "deactivate", 10)) {
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
rc = ipmi_picmg_fru_activation(intf, argc-1, &(argv[1]), PICMG_FRU_DEACTIVATE);
|
rc = ipmi_picmg_fru_activation(intf, &(argv[1]), PICMG_FRU_DEACTIVATE);
|
||||||
}else {
|
}else {
|
||||||
lprintf(LOG_ERR, "Specify the FRU to deactivate.");
|
lprintf(LOG_ERR, "Specify the FRU to deactivate.");
|
||||||
return -1;
|
return -1;
|
||||||
@ -1850,13 +1850,13 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
if (!strncmp(argv[1], "get", 3)) {
|
if (!strncmp(argv[1], "get", 3)) {
|
||||||
if (argc > 2) {
|
if (argc > 2) {
|
||||||
rc = ipmi_picmg_fru_activation_policy_get(intf, argc-1, &(argv[2]));
|
rc = ipmi_picmg_fru_activation_policy_get(intf, &(argv[2]));
|
||||||
} else {
|
} else {
|
||||||
lprintf(LOG_NOTICE, "usage: get <fruid>");
|
lprintf(LOG_NOTICE, "usage: get <fruid>");
|
||||||
}
|
}
|
||||||
} else if (!strncmp(argv[1], "set", 3)) {
|
} else if (!strncmp(argv[1], "set", 3)) {
|
||||||
if (argc > 4) {
|
if (argc > 4) {
|
||||||
rc = ipmi_picmg_fru_activation_policy_set(intf, argc-1, &(argv[2]));
|
rc = ipmi_picmg_fru_activation_policy_set(intf, &(argv[2]));
|
||||||
} else {
|
} else {
|
||||||
lprintf(LOG_NOTICE, "usage: set <fruid> <lockmask> <lock>");
|
lprintf(LOG_NOTICE, "usage: set <fruid> <lockmask> <lock>");
|
||||||
lprintf(LOG_NOTICE,
|
lprintf(LOG_NOTICE,
|
||||||
@ -2095,7 +2095,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
if (!strncmp(argv[1], "prop", 4)) {
|
if (!strncmp(argv[1], "prop", 4)) {
|
||||||
if (argc > 2) {
|
if (argc > 2) {
|
||||||
rc = ipmi_picmg_get_led_properties(intf, argc-1, &(argv[2]));
|
rc = ipmi_picmg_get_led_properties(intf, &(argv[2]));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lprintf(LOG_NOTICE, "led prop <FRU-ID>");
|
lprintf(LOG_NOTICE, "led prop <FRU-ID>");
|
||||||
@ -2103,7 +2103,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
else if (!strncmp(argv[1], "cap", 3)) {
|
else if (!strncmp(argv[1], "cap", 3)) {
|
||||||
if (argc > 3) {
|
if (argc > 3) {
|
||||||
rc = ipmi_picmg_get_led_capabilities(intf, argc-1, &(argv[2]));
|
rc = ipmi_picmg_get_led_capabilities(intf, &(argv[2]));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lprintf(LOG_NOTICE, "led cap <FRU-ID> <LED-ID>");
|
lprintf(LOG_NOTICE, "led cap <FRU-ID> <LED-ID>");
|
||||||
@ -2111,7 +2111,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
else if (!strncmp(argv[1], "get", 3)) {
|
else if (!strncmp(argv[1], "get", 3)) {
|
||||||
if (argc > 3) {
|
if (argc > 3) {
|
||||||
rc = ipmi_picmg_get_led_state(intf, argc-1, &(argv[2]));
|
rc = ipmi_picmg_get_led_state(intf, &(argv[2]));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lprintf(LOG_NOTICE, "led get <FRU-ID> <LED-ID>");
|
lprintf(LOG_NOTICE, "led get <FRU-ID> <LED-ID>");
|
||||||
@ -2119,7 +2119,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
else if (!strncmp(argv[1], "set", 3)) {
|
else if (!strncmp(argv[1], "set", 3)) {
|
||||||
if (argc > 6) {
|
if (argc > 6) {
|
||||||
rc = ipmi_picmg_set_led_state(intf, argc-1, &(argv[2]));
|
rc = ipmi_picmg_set_led_state(intf, &(argv[2]));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lprintf(LOG_NOTICE,
|
lprintf(LOG_NOTICE,
|
||||||
@ -2163,7 +2163,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
if (!strncmp(argv[1], "get", 3)) {
|
if (!strncmp(argv[1], "get", 3)) {
|
||||||
if (argc > 3) {
|
if (argc > 3) {
|
||||||
rc = ipmi_picmg_get_power_level(intf, argc-1, &(argv[2]));
|
rc = ipmi_picmg_get_power_level(intf, &(argv[2]));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lprintf(LOG_NOTICE, "power get <FRU-ID> <type>");
|
lprintf(LOG_NOTICE, "power get <FRU-ID> <type>");
|
||||||
@ -2178,7 +2178,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
else if (!strncmp(argv[1], "set", 3)) {
|
else if (!strncmp(argv[1], "set", 3)) {
|
||||||
if (argc > 4) {
|
if (argc > 4) {
|
||||||
rc = ipmi_picmg_set_power_level(intf, argc-1, &(argv[2]));
|
rc = ipmi_picmg_set_power_level(intf, &(argv[2]));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lprintf(LOG_NOTICE, "power set <FRU-ID> <level> <present-desired>");
|
lprintf(LOG_NOTICE, "power set <FRU-ID> <level> <present-desired>");
|
||||||
|
@ -194,7 +194,7 @@ int ipmi_sel_oem_init(const char * filename)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ipmi_sel_oem_message(struct sel_event_record * evt, int verbose)
|
static void ipmi_sel_oem_message(struct sel_event_record * evt)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Note: although we have a verbose argument, currently the output
|
* Note: although we have a verbose argument, currently the output
|
||||||
@ -425,14 +425,15 @@ static struct ipmi_event_sensor_types __UNUSED__(oem_kontron_event_reading_types
|
|||||||
{ 0x71 , 0x00 , 0xff, "Code Assert" },
|
{ 0x71 , 0x00 , 0xff, "Code Assert" },
|
||||||
{ 0, 0, 0xFF, NULL }
|
{ 0, 0, 0xFF, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* NOTE: unused paramter kept in for consistency. */
|
||||||
char *
|
char *
|
||||||
get_kontron_evt_desc(struct ipmi_intf *intf, struct sel_event_record * rec)
|
get_kontron_evt_desc(struct ipmi_intf *__UNUSED__(intf), struct sel_event_record *rec)
|
||||||
{
|
{
|
||||||
char * description = NULL;
|
char *description = NULL;
|
||||||
/*
|
/*
|
||||||
* Kontron OEM events are described in the product's user manual, but are limited in favor of
|
* Kontron OEM events are described in the product's user manual, but are limited in favor of
|
||||||
* sensor specific
|
* sensor specific
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Only standard records are defined so far */
|
/* Only standard records are defined so far */
|
||||||
@ -1861,7 +1862,7 @@ ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt)
|
|||||||
for(data_count=0;data_count < SEL_OEM_NOTS_DATA_LEN;data_count++)
|
for(data_count=0;data_count < SEL_OEM_NOTS_DATA_LEN;data_count++)
|
||||||
printf("%02x", evt->sel_type.oem_nots_type.oem_defined[data_count]);
|
printf("%02x", evt->sel_type.oem_nots_type.oem_defined[data_count]);
|
||||||
}
|
}
|
||||||
ipmi_sel_oem_message(evt, 0);
|
ipmi_sel_oem_message(evt);
|
||||||
printf ("\n");
|
printf ("\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2055,7 +2056,7 @@ ipmi_sel_print_std_entry_verbose(struct ipmi_intf * intf, struct sel_event_recor
|
|||||||
for(data_count=0;data_count < SEL_OEM_NOTS_DATA_LEN;data_count++)
|
for(data_count=0;data_count < SEL_OEM_NOTS_DATA_LEN;data_count++)
|
||||||
printf("%02x", evt->sel_type.oem_nots_type.oem_defined[data_count]);
|
printf("%02x", evt->sel_type.oem_nots_type.oem_defined[data_count]);
|
||||||
printf(" [%s]\n\n",hex2ascii (evt->sel_type.oem_nots_type.oem_defined, SEL_OEM_NOTS_DATA_LEN));
|
printf(" [%s]\n\n",hex2ascii (evt->sel_type.oem_nots_type.oem_defined, SEL_OEM_NOTS_DATA_LEN));
|
||||||
ipmi_sel_oem_message(evt, 1);
|
ipmi_sel_oem_message(evt);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -648,13 +648,14 @@ ipmi_print_sol_info(struct ipmi_intf * intf, uint8_t channel)
|
|||||||
*
|
*
|
||||||
* function will return -1 if value is not valid, or
|
* function will return -1 if value is not valid, or
|
||||||
* will return 0 if valid.
|
* will return 0 if valid.
|
||||||
|
*
|
||||||
|
* base parameter currently unused, left in for extension.
|
||||||
*/
|
*/
|
||||||
int ipmi_sol_set_param_isvalid_uint8_t( const char *strval,
|
int ipmi_sol_set_param_isvalid_uint8_t(const char *strval,
|
||||||
const char *name,
|
const char *name,
|
||||||
int base,
|
uint8_t minval,
|
||||||
uint8_t minval,
|
uint8_t maxval,
|
||||||
uint8_t maxval,
|
uint8_t *out_value)
|
||||||
uint8_t *out_value)
|
|
||||||
{
|
{
|
||||||
if (str2uchar(strval, out_value) != 0 || (*out_value < minval)
|
if (str2uchar(strval, out_value) != 0 || (*out_value < minval)
|
||||||
|| (*out_value > maxval)) {
|
|| (*out_value > maxval)) {
|
||||||
@ -866,7 +867,7 @@ ipmi_sol_set_param(struct ipmi_intf * intf,
|
|||||||
data[1] = SOL_PARAMETER_CHARACTER_INTERVAL;
|
data[1] = SOL_PARAMETER_CHARACTER_INTERVAL;
|
||||||
|
|
||||||
/* validate user-supplied input */
|
/* validate user-supplied input */
|
||||||
if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 1, 255, &data[2]))
|
if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 1, 255, &data[2]))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* We need other values to complete the request */
|
/* We need other values to complete the request */
|
||||||
@ -892,7 +893,7 @@ ipmi_sol_set_param(struct ipmi_intf * intf,
|
|||||||
data[1] = SOL_PARAMETER_CHARACTER_INTERVAL;
|
data[1] = SOL_PARAMETER_CHARACTER_INTERVAL;
|
||||||
|
|
||||||
/* validate user-supplied input */
|
/* validate user-supplied input */
|
||||||
if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 0, 255, &data[3]))
|
if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 255, &data[3]))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* We need other values to complete the request */
|
/* We need other values to complete the request */
|
||||||
@ -918,7 +919,7 @@ ipmi_sol_set_param(struct ipmi_intf * intf,
|
|||||||
data[1] = SOL_PARAMETER_SOL_RETRY;
|
data[1] = SOL_PARAMETER_SOL_RETRY;
|
||||||
|
|
||||||
/* validate user input, 7 is max value */
|
/* validate user input, 7 is max value */
|
||||||
if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 0, 7, &data[2]))
|
if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 7, &data[2]))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* We need other values to complete the request */
|
/* We need other values to complete the request */
|
||||||
@ -944,7 +945,7 @@ ipmi_sol_set_param(struct ipmi_intf * intf,
|
|||||||
data[1] = SOL_PARAMETER_SOL_RETRY;
|
data[1] = SOL_PARAMETER_SOL_RETRY;
|
||||||
|
|
||||||
/* validate user-supplied input */
|
/* validate user-supplied input */
|
||||||
if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 0, 255, &data[3]))
|
if (ipmi_sol_set_param_isvalid_uint8_t(value, param, 0, 255, &data[3]))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* We need other values to complete the request */
|
/* We need other values to complete the request */
|
||||||
|
@ -682,7 +682,7 @@ selwatch_wait(struct ipmi_event_intf * eintf)
|
|||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ipmievd_cleanup(int signal)
|
ipmievd_cleanup(int __UNUSED__(signal))
|
||||||
{
|
{
|
||||||
struct stat st1;
|
struct stat st1;
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ static int rl_event_keepalive(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
|
int ipmi_shell_main(struct ipmi_intf *intf, int argc, char **argv)
|
||||||
{
|
{
|
||||||
char *ptr, *pbuf, **ap, *__argv[EXEC_ARG_SIZE];
|
char *ptr, *pbuf, **ap, *__argv[EXEC_ARG_SIZE];
|
||||||
int __argc, rc=0;
|
int __argc, rc=0;
|
||||||
@ -215,7 +215,9 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
#else /* HAVE_READLINE */
|
#else /* HAVE_READLINE */
|
||||||
|
|
||||||
int
|
int
|
||||||
ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
|
ipmi_shell_main(struct ipmi_intf *__UNUSED__(intf),
|
||||||
|
int __UNUSED__(argc),
|
||||||
|
char **__UNUSED__(argv))
|
||||||
{
|
{
|
||||||
lprintf(LOG_ERR, "Compiled without readline, shell is disabled");
|
lprintf(LOG_ERR, "Compiled without readline, shell is disabled");
|
||||||
return -1;
|
return -1;
|
||||||
@ -223,7 +225,8 @@ ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
|
|
||||||
#endif /* HAVE_READLINE */
|
#endif /* HAVE_READLINE */
|
||||||
|
|
||||||
int ipmi_echo_main(struct ipmi_intf * intf, int argc, char ** argv)
|
int ipmi_echo_main(struct ipmi_intf *__UNUSED__(intf), int argc,
|
||||||
|
char **argv)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ static int ipmi_imb_open(struct ipmi_intf * intf)
|
|||||||
printf("Error: no IMB driver found at %s!\n", IPMI_IMB_DEV);
|
printf("Error: no IMB driver found at %s!\n", IPMI_IMB_DEV);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
intf->opened = 1;
|
intf->opened = 1;
|
||||||
intf->manufacturer_id = ipmi_get_oem(intf);
|
intf->manufacturer_id = ipmi_get_oem(intf);
|
||||||
|
|
||||||
@ -75,10 +75,10 @@ static void ipmi_imb_close(struct ipmi_intf * intf)
|
|||||||
intf->manufacturer_id = IPMI_OEM_UNKNOWN;
|
intf->manufacturer_id = IPMI_OEM_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct ipmi_rs * ipmi_imb_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
|
static struct ipmi_rs * ipmi_imb_send_cmd(struct ipmi_intf *__UNUSED__(intf), struct ipmi_rq *req)
|
||||||
{
|
{
|
||||||
IMBPREQUESTDATA imbreq;
|
IMBPREQUESTDATA imbreq;
|
||||||
static struct ipmi_rs rsp;
|
static struct ipmi_rs rsp;
|
||||||
int status, i;
|
int status, i;
|
||||||
unsigned char ccode;
|
unsigned char ccode;
|
||||||
|
|
||||||
|
@ -60,6 +60,7 @@
|
|||||||
|
|
||||||
#include "imbapi.h"
|
#include "imbapi.h"
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <ipmitool/helper.h>
|
||||||
#include <ipmitool/log.h>
|
#include <ipmitool/log.h>
|
||||||
|
|
||||||
#ifdef SCO_UW
|
#ifdef SCO_UW
|
||||||
@ -285,7 +286,7 @@ ipmi_close_ia(void)
|
|||||||
* it also sets Ntstatus.status.
|
* it also sets Ntstatus.status.
|
||||||
*/
|
*/
|
||||||
static BOOL
|
static BOOL
|
||||||
DeviceIoControl(HANDLE dummey_hDevice, DWORD dwIoControlCode, LPVOID
|
DeviceIoControl(HANDLE __UNUSED__(dummey_hDevice), DWORD dwIoControlCode, LPVOID
|
||||||
lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer,
|
lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer,
|
||||||
DWORD cbOutBuffer, LPDWORD lpcbBytesReturned,
|
DWORD cbOutBuffer, LPDWORD lpcbBytesReturned,
|
||||||
LPOVERLAPPED lpoOverlapped)
|
LPOVERLAPPED lpoOverlapped)
|
||||||
|
@ -119,14 +119,23 @@ uint8_t * ipmi_auth_md5(struct ipmi_session * s, uint8_t * data, int data_len)
|
|||||||
#endif /*HAVE_CRYPTO_MD5*/
|
#endif /*HAVE_CRYPTO_MD5*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
#ifdef HAVE_CRYPTO_MD2
|
||||||
|
#define __MD2_ONLY__(x) x
|
||||||
|
#else
|
||||||
|
#define __MD2_ONLY__(x) __UNUSED__(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
* multi-session authcode generation for MD2
|
* multi-session authcode generation for MD2
|
||||||
* H(password + session_id + msg + session_seq + password)
|
* H(password + session_id + msg + session_seq + password)
|
||||||
*
|
*
|
||||||
* Use OpenSSL implementation of MD2 algorithm if found.
|
* Use OpenSSL implementation of MD2 algorithm if found.
|
||||||
* This function is analogous to ipmi_auth_md5
|
* This function is analogous to ipmi_auth_md5
|
||||||
*/
|
*/
|
||||||
uint8_t * ipmi_auth_md2(struct ipmi_session * s, uint8_t * data, int data_len)
|
uint8_t * ipmi_auth_md2(
|
||||||
|
struct ipmi_session *__MD2_ONLY__(s),
|
||||||
|
uint8_t *__MD2_ONLY__(data),
|
||||||
|
int __MD2_ONLY__(data_len))
|
||||||
{
|
{
|
||||||
#ifdef HAVE_CRYPTO_MD2
|
#ifdef HAVE_CRYPTO_MD2
|
||||||
MD2_CTX ctx;
|
MD2_CTX ctx;
|
||||||
|
@ -338,9 +338,9 @@ ipmi_lan_recv_packet(struct ipmi_intf * intf)
|
|||||||
* asf.data[f:a]= 0x000000000000
|
* asf.data[f:a]= 0x000000000000
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
ipmi_handle_pong(struct ipmi_intf * intf, struct ipmi_rs * rsp)
|
ipmi_handle_pong(struct ipmi_rs *rsp)
|
||||||
{
|
{
|
||||||
struct rmcp_pong * pong;
|
struct rmcp_pong *pong;
|
||||||
|
|
||||||
if (!rsp)
|
if (!rsp)
|
||||||
return -1;
|
return -1;
|
||||||
@ -468,7 +468,7 @@ ipmi_lan_poll_recv(struct ipmi_intf * intf)
|
|||||||
switch (rmcp_rsp.class) {
|
switch (rmcp_rsp.class) {
|
||||||
case RMCP_CLASS_ASF:
|
case RMCP_CLASS_ASF:
|
||||||
/* ping response packet */
|
/* ping response packet */
|
||||||
rv = ipmi_handle_pong(intf, rsp);
|
rv = ipmi_handle_pong(rsp);
|
||||||
return (rv <= 0) ? NULL : rsp;
|
return (rv <= 0) ? NULL : rsp;
|
||||||
case RMCP_CLASS_IPMI:
|
case RMCP_CLASS_IPMI:
|
||||||
/* handled by rest of function */
|
/* handled by rest of function */
|
||||||
@ -1310,8 +1310,7 @@ ipmi_lan_send_sol(struct ipmi_intf * intf,
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
check_sol_packet_for_new_data(struct ipmi_intf * intf,
|
check_sol_packet_for_new_data(struct ipmi_rs *rsp)
|
||||||
struct ipmi_rs *rsp)
|
|
||||||
{
|
{
|
||||||
static uint8_t last_received_sequence_number = 0;
|
static uint8_t last_received_sequence_number = 0;
|
||||||
static uint8_t last_received_byte_count = 0;
|
static uint8_t last_received_byte_count = 0;
|
||||||
@ -1411,7 +1410,7 @@ ipmi_lan_recv_sol(struct ipmi_intf * intf)
|
|||||||
* Remembers the data sent, and alters the data to just
|
* Remembers the data sent, and alters the data to just
|
||||||
* include the new stuff.
|
* include the new stuff.
|
||||||
*/
|
*/
|
||||||
check_sol_packet_for_new_data(intf, rsp);
|
check_sol_packet_for_new_data(rsp);
|
||||||
|
|
||||||
return rsp;
|
return rsp;
|
||||||
}
|
}
|
||||||
|
@ -102,15 +102,14 @@ static void getIpmiPayloadWireRep(
|
|||||||
uint8_t rq_seq,
|
uint8_t rq_seq,
|
||||||
uint8_t curr_seq);
|
uint8_t curr_seq);
|
||||||
static void getSolPayloadWireRep(
|
static void getSolPayloadWireRep(
|
||||||
struct ipmi_intf * intf,
|
|
||||||
uint8_t * msg,
|
uint8_t * msg,
|
||||||
struct ipmi_v2_payload * payload);
|
struct ipmi_v2_payload * payload);
|
||||||
static void read_open_session_response(struct ipmi_rs * rsp, int offset);
|
static void read_open_session_response(struct ipmi_rs * rsp, int offset);
|
||||||
static void read_rakp2_message(struct ipmi_rs * rsp, int offset, uint8_t alg);
|
static void read_rakp2_message(struct ipmi_rs * rsp, int offset, uint8_t alg);
|
||||||
static void read_rakp4_message(struct ipmi_rs * rsp, int offset, uint8_t alg);
|
static void read_rakp4_message(struct ipmi_rs * rsp, int offset, uint8_t alg);
|
||||||
static void read_session_data(struct ipmi_rs * rsp, int * offset, struct ipmi_session *s);
|
static void read_session_data(struct ipmi_rs * rsp, int * offset);
|
||||||
static void read_session_data_v15(struct ipmi_rs * rsp, int * offset, struct ipmi_session *s);
|
static void read_session_data_v15(struct ipmi_rs * rsp, int * offset);
|
||||||
static void read_session_data_v2x(struct ipmi_rs * rsp, int * offset, struct ipmi_session *s);
|
static void read_session_data_v2x(struct ipmi_rs * rsp, int * offset);
|
||||||
static void read_ipmi_response(struct ipmi_rs * rsp, int * offset);
|
static void read_ipmi_response(struct ipmi_rs * rsp, int * offset);
|
||||||
static void read_sol_packet(struct ipmi_rs * rsp, int * offset);
|
static void read_sol_packet(struct ipmi_rs * rsp, int * offset);
|
||||||
static struct ipmi_rs * ipmi_lanplus_recv_sol(struct ipmi_intf * intf);
|
static struct ipmi_rs * ipmi_lanplus_recv_sol(struct ipmi_intf * intf);
|
||||||
@ -118,7 +117,6 @@ static struct ipmi_rs * ipmi_lanplus_send_sol(
|
|||||||
struct ipmi_intf * intf,
|
struct ipmi_intf * intf,
|
||||||
struct ipmi_v2_payload * payload);
|
struct ipmi_v2_payload * payload);
|
||||||
static int check_sol_packet_for_new_data(
|
static int check_sol_packet_for_new_data(
|
||||||
struct ipmi_intf * intf,
|
|
||||||
struct ipmi_rs *rsp);
|
struct ipmi_rs *rsp);
|
||||||
static void ack_sol_packet(
|
static void ack_sol_packet(
|
||||||
struct ipmi_intf * intf,
|
struct ipmi_intf * intf,
|
||||||
@ -496,7 +494,7 @@ ipmi_lan_recv_packet(struct ipmi_intf * intf)
|
|||||||
* asf.data[f:a]= 0x000000000000
|
* asf.data[f:a]= 0x000000000000
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
ipmi_handle_pong(struct ipmi_intf * intf, struct ipmi_rs * rsp)
|
ipmi_handle_pong(struct ipmi_rs *rsp)
|
||||||
{
|
{
|
||||||
struct rmcp_pong {
|
struct rmcp_pong {
|
||||||
struct rmcp_hdr rmcp;
|
struct rmcp_hdr rmcp;
|
||||||
@ -506,7 +504,7 @@ ipmi_handle_pong(struct ipmi_intf * intf, struct ipmi_rs * rsp)
|
|||||||
uint8_t sup_entities;
|
uint8_t sup_entities;
|
||||||
uint8_t sup_interact;
|
uint8_t sup_interact;
|
||||||
uint8_t reserved[6];
|
uint8_t reserved[6];
|
||||||
} * pong;
|
} *pong;
|
||||||
|
|
||||||
if (!rsp)
|
if (!rsp)
|
||||||
return -1;
|
return -1;
|
||||||
@ -626,7 +624,7 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
|
|||||||
|
|
||||||
if (rmcp_rsp->class == RMCP_CLASS_ASF) {
|
if (rmcp_rsp->class == RMCP_CLASS_ASF) {
|
||||||
/* might be ping response packet */
|
/* might be ping response packet */
|
||||||
rv = ipmi_handle_pong(intf, rsp);
|
rv = ipmi_handle_pong(rsp);
|
||||||
return (rv <= 0) ? NULL : rsp;
|
return (rv <= 0) ? NULL : rsp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -656,7 +654,7 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
|
|||||||
* -------------------------------------------------------------------
|
* -------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
read_session_data(rsp, &offset, intf->session);
|
read_session_data(rsp, &offset);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Skip packets that are not intended for this session
|
* Skip packets that are not intended for this session
|
||||||
@ -1132,21 +1130,19 @@ read_rakp4_message(
|
|||||||
* param offset [in/out] should point to the beginning of the session when
|
* param offset [in/out] should point to the beginning of the session when
|
||||||
* this function is called. The offset will be adjusted to
|
* this function is called. The offset will be adjusted to
|
||||||
* point to the end of the session when this function exits.
|
* point to the end of the session when this function exits.
|
||||||
* param session holds our session state
|
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
read_session_data(
|
read_session_data(
|
||||||
struct ipmi_rs * rsp,
|
struct ipmi_rs * rsp,
|
||||||
int * offset,
|
int * offset)
|
||||||
struct ipmi_session * s)
|
|
||||||
{
|
{
|
||||||
/* We expect to read different stuff depending on the authtype */
|
/* We expect to read different stuff depending on the authtype */
|
||||||
rsp->session.authtype = rsp->data[*offset];
|
rsp->session.authtype = rsp->data[*offset];
|
||||||
|
|
||||||
if (rsp->session.authtype == IPMI_SESSION_AUTHTYPE_RMCP_PLUS)
|
if (rsp->session.authtype == IPMI_SESSION_AUTHTYPE_RMCP_PLUS)
|
||||||
read_session_data_v2x(rsp, offset, s);
|
read_session_data_v2x(rsp, offset);
|
||||||
else
|
else
|
||||||
read_session_data_v15(rsp, offset, s);
|
read_session_data_v15(rsp, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1172,8 +1168,7 @@ read_session_data(
|
|||||||
void
|
void
|
||||||
read_session_data_v2x(
|
read_session_data_v2x(
|
||||||
struct ipmi_rs * rsp,
|
struct ipmi_rs * rsp,
|
||||||
int * offset,
|
int * offset)
|
||||||
struct ipmi_session * s)
|
|
||||||
{
|
{
|
||||||
rsp->session.authtype = rsp->data[(*offset)++];
|
rsp->session.authtype = rsp->data[(*offset)++];
|
||||||
|
|
||||||
@ -1201,7 +1196,7 @@ read_session_data_v2x(
|
|||||||
/*
|
/*
|
||||||
* read_session_data_v15
|
* read_session_data_v15
|
||||||
*
|
*
|
||||||
* Initialize the ipmi_rsp from the session header of the packet.
|
* Initialize the ipmi_rsp from the session header of the packet.
|
||||||
*
|
*
|
||||||
* The offset should point the first byte of the the IPMI session when this
|
* The offset should point the first byte of the the IPMI session when this
|
||||||
* function is called. When this function exits, the offset will point to
|
* function is called. When this function exits, the offset will point to
|
||||||
@ -1216,8 +1211,7 @@ read_session_data_v2x(
|
|||||||
*/
|
*/
|
||||||
void read_session_data_v15(
|
void read_session_data_v15(
|
||||||
struct ipmi_rs * rsp,
|
struct ipmi_rs * rsp,
|
||||||
int * offset,
|
int * offset)
|
||||||
struct ipmi_session * s)
|
|
||||||
{
|
{
|
||||||
/* All v15 messages are IPMI messages */
|
/* All v15 messages are IPMI messages */
|
||||||
rsp->session.payloadtype = IPMI_PAYLOAD_TYPE_IPMI;
|
rsp->session.payloadtype = IPMI_PAYLOAD_TYPE_IPMI;
|
||||||
@ -1481,7 +1475,6 @@ void getIpmiPayloadWireRep(
|
|||||||
* param payload [in] holds the v2 payload with our SOL data
|
* param payload [in] holds the v2 payload with our SOL data
|
||||||
*/
|
*/
|
||||||
void getSolPayloadWireRep(
|
void getSolPayloadWireRep(
|
||||||
struct ipmi_intf * intf, /* in out */
|
|
||||||
uint8_t * msg, /* output */
|
uint8_t * msg, /* output */
|
||||||
struct ipmi_v2_payload * payload) /* input */
|
struct ipmi_v2_payload * payload) /* input */
|
||||||
{
|
{
|
||||||
@ -1687,7 +1680,7 @@ ipmi_lanplus_build_v2x_msg(
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case IPMI_PAYLOAD_TYPE_SOL:
|
case IPMI_PAYLOAD_TYPE_SOL:
|
||||||
getSolPayloadWireRep(intf,
|
getSolPayloadWireRep(
|
||||||
msg + IPMI_LANPLUS_OFFSET_PAYLOAD,
|
msg + IPMI_LANPLUS_OFFSET_PAYLOAD,
|
||||||
payload);
|
payload);
|
||||||
|
|
||||||
@ -2528,7 +2521,6 @@ ipmi_lanplus_send_sol(
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
check_sol_packet_for_new_data(
|
check_sol_packet_for_new_data(
|
||||||
struct ipmi_intf * intf,
|
|
||||||
struct ipmi_rs *rsp)
|
struct ipmi_rs *rsp)
|
||||||
{
|
{
|
||||||
static uint8_t last_received_sequence_number = 0;
|
static uint8_t last_received_sequence_number = 0;
|
||||||
@ -2644,7 +2636,7 @@ ipmi_lanplus_recv_sol(struct ipmi_intf * intf)
|
|||||||
* Remembers the data sent, and alters the data to just
|
* Remembers the data sent, and alters the data to just
|
||||||
* include the new stuff.
|
* include the new stuff.
|
||||||
*/
|
*/
|
||||||
check_sol_packet_for_new_data(intf, rsp);
|
check_sol_packet_for_new_data(rsp);
|
||||||
}
|
}
|
||||||
return rsp;
|
return rsp;
|
||||||
}
|
}
|
||||||
@ -3700,7 +3692,7 @@ ipmi_lanplus_keepalive(struct ipmi_intf * intf)
|
|||||||
/* rsp was SOL data instead of our answer */
|
/* rsp was SOL data instead of our answer */
|
||||||
/* since it didn't go through the sol recv, do sol recv stuff here */
|
/* since it didn't go through the sol recv, do sol recv stuff here */
|
||||||
ack_sol_packet(intf, rsp);
|
ack_sol_packet(intf, rsp);
|
||||||
check_sol_packet_for_new_data(intf, rsp);
|
check_sol_packet_for_new_data(rsp);
|
||||||
if (rsp->data_len)
|
if (rsp->data_len)
|
||||||
intf->session->sol_data.sol_input_handler(rsp);
|
intf->session->sol_data.sol_input_handler(rsp);
|
||||||
rsp = ipmi_lan_poll_recv(intf);
|
rsp = ipmi_lan_poll_recv(intf);
|
||||||
|
@ -816,12 +816,14 @@ serial_bm_wait_response(struct ipmi_intf * intf,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Get message from receive message queue
|
* Get message from receive message queue
|
||||||
|
*
|
||||||
|
* Note: kept max_len in case later use.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
serial_bm_get_message(struct ipmi_intf * intf,
|
serial_bm_get_message(struct ipmi_intf * intf,
|
||||||
struct serial_bm_request_ctx * req_ctx,
|
struct serial_bm_request_ctx * req_ctx,
|
||||||
struct serial_bm_recv_ctx * read_ctx,
|
struct serial_bm_recv_ctx * read_ctx,
|
||||||
uint8_t * msg, size_t max_len)
|
uint8_t * msg, size_t __UNUSED__(max_len))
|
||||||
{
|
{
|
||||||
uint8_t data[SERIAL_BM_MAX_MSG_SIZE];
|
uint8_t data[SERIAL_BM_MAX_MSG_SIZE];
|
||||||
struct serial_bm_request_ctx tmp_ctx;
|
struct serial_bm_request_ctx tmp_ctx;
|
||||||
|
@ -714,11 +714,13 @@ serial_term_wait_response(struct ipmi_intf * intf,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Get message from receive message queue
|
* Get message from receive message queue
|
||||||
|
*
|
||||||
|
* Note: Kept max_len in case it's useful later.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
serial_term_get_message(struct ipmi_intf * intf,
|
serial_term_get_message(struct ipmi_intf * intf,
|
||||||
struct serial_term_request_ctx * req_ctx,
|
struct serial_term_request_ctx * req_ctx,
|
||||||
uint8_t * msg, size_t max_len)
|
uint8_t * msg, size_t __UNUSED__(max_len))
|
||||||
{
|
{
|
||||||
uint8_t data[IPMI_SERIAL_MAX_RESPONSE];
|
uint8_t data[IPMI_SERIAL_MAX_RESPONSE];
|
||||||
struct serial_term_request_ctx tmp_ctx;
|
struct serial_term_request_ctx tmp_ctx;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user