diff --git a/ipmitool/lib/ipmi_picmg.c b/ipmitool/lib/ipmi_picmg.c index 0a229fe..150d24c 100644 --- a/ipmitool/lib/ipmi_picmg.c +++ b/ipmitool/lib/ipmi_picmg.c @@ -225,7 +225,7 @@ ipmi_picmg_properties(struct ipmi_intf * intf, int show ) rsp = intf->sendrecv(intf, &req); if (!rsp || rsp->ccode) { - printf("Error getting address information\n"); + lprintf(LOG_ERR, "Error getting address information."); return -1; } @@ -281,11 +281,11 @@ ipmi_picmg_fru_activation(struct ipmi_intf * intf, int argc, char ** argv, unsig rsp = intf->sendrecv(intf, &req); if (!rsp || rsp->ccode) { - printf("Error activation/deactivation of FRU\n"); + lprintf(LOG_ERR, "Error activation/deactivation of FRU."); return -1; } if (rsp->data[0] != 0x00) { - printf("Error\n"); + lprintf(LOG_ERR, "Error activation/deactivation of FRU."); } return 0; @@ -313,11 +313,12 @@ ipmi_picmg_fru_activation_policy_get(struct ipmi_intf * intf, int argc, char ** rsp = intf->sendrecv(intf, &req); if (!rsp) { - printf("no response\n"); + lprintf(LOG_ERR, "No valid response received."); return -1; } if (rsp->ccode) { - printf("returned CC code 0x%02x\n", rsp->ccode); + lprintf(LOG_ERR, "FRU activation policy get failed with CC code 0x%02x", + rsp->ccode); return -1; } @@ -351,12 +352,13 @@ ipmi_picmg_fru_activation_policy_set(struct ipmi_intf * intf, int argc, char ** rsp = intf->sendrecv(intf, &req); if (!rsp) { - printf("no response\n"); + lprintf(LOG_ERR, "No valid response received."); return -1; } if (rsp->ccode) { - printf("returned CC code 0x%02x\n", rsp->ccode); + lprintf(LOG_ERR, "FRU activation policy set failed with CC code 0x%02x", + rsp->ccode); return -1; } @@ -390,13 +392,14 @@ ipmi_picmg_portstate_get(struct ipmi_intf * intf, int interface,int channel, rsp = intf->sendrecv(intf, &req); if (!rsp) { - printf("no response\n"); + lprintf(LOG_ERR, "No valid response received."); return -1; } if (rsp->ccode) { if( mode == PICMG_EKEY_MODE_QUERY ){ - printf("returned CC code 0x%02x\n", rsp->ccode); + lprintf(LOG_ERR, "FRU portstate get failed with CC code 0x%02x", + rsp->ccode); } return -1; } @@ -497,7 +500,7 @@ ipmi_picmg_portstate_get(struct ipmi_intf * intf, int interface,int channel, } else { - lprintf(LOG_NOTICE,"Unexpected answer, can't print result"); + lprintf(LOG_ERR, "Unexpected answer, can't print result."); } return 0; @@ -530,12 +533,13 @@ ipmi_picmg_portstate_set(struct ipmi_intf * intf, int interface, int channel, rsp = intf->sendrecv(intf, &req); if (!rsp) { - printf("no response\n"); + lprintf(LOG_ERR, "No valid response received."); return -1; } if (rsp->ccode) { - printf("returned CC code 0x%02x\n", rsp->ccode); + lprintf(LOG_ERR, "Picmg portstate set failed with CC code 0x%02x", + rsp->ccode); return -1; } @@ -580,13 +584,14 @@ ipmi_picmg_amc_portstate_get(struct ipmi_intf * intf,int device,int channel, rsp = intf->sendrecv(intf, &req); if (!rsp) { - printf("no response\n"); + lprintf(LOG_ERR, "No valid response received."); return -1; } if (rsp->ccode) { if( mode == PICMG_EKEY_MODE_QUERY ){ - printf("returned CC code 0x%02x\n", rsp->ccode); + lprintf(LOG_ERR, "Amc portstate get failed with CC code 0x%02x", + rsp->ccode); } return -1; } @@ -720,12 +725,13 @@ ipmi_picmg_amc_portstate_set(struct ipmi_intf * intf, int channel, int port, rsp = intf->sendrecv(intf, &req); if (!rsp) { - printf("no response\n"); + lprintf(LOG_ERR, "No valid response received."); return -1; } if (rsp->ccode) { - printf("returned CC code 0x%02x\n", rsp->ccode); + lprintf(LOG_ERR, "Amc portstate set failed with CC code 0x%02x", + rsp->ccode); return -1; } @@ -754,12 +760,13 @@ ipmi_picmg_get_led_properties(struct ipmi_intf * intf, int argc, char ** argv) rsp = intf->sendrecv(intf, &req); if (!rsp) { - printf("no response\n"); + lprintf(LOG_ERR, "No valid response received."); return -1; } if (rsp->ccode) { - printf("returned CC code 0x%02x\n", rsp->ccode); + lprintf(LOG_ERR, "LED get properties failed with CC code 0x%02x", + rsp->ccode); return -1; } @@ -793,12 +800,13 @@ ipmi_picmg_get_led_capabilities(struct ipmi_intf * intf, int argc, char ** argv) rsp = intf->sendrecv(intf, &req); if (!rsp) { - printf("no response\n"); + lprintf(LOG_ERR, "No valid response received."); return -1; } if (rsp->ccode) { - printf("returned CC code 0x%02x\n", rsp->ccode); + lprintf(LOG_ERR, "LED get capabilities failed with CC code 0x%02x", + rsp->ccode); return -1; } @@ -840,12 +848,12 @@ ipmi_picmg_get_led_state(struct ipmi_intf * intf, int argc, char ** argv) rsp = intf->sendrecv(intf, &req); if (!rsp) { - printf("no response\n"); + lprintf(LOG_ERR, "No valid response received."); return -1; } if (rsp->ccode) { - printf("returned CC code 0x%02x\n", rsp->ccode); + lprintf(LOG_ERR, "LED get state failed with CC code 0x%02x", rsp->ccode); return -1; } @@ -924,12 +932,12 @@ ipmi_picmg_set_led_state(struct ipmi_intf * intf, int argc, char ** argv) rsp = intf->sendrecv(intf, &req); if (!rsp) { - printf("no response\n"); + lprintf(LOG_ERR, "No valid response received."); return -1; } if (rsp->ccode) { - printf("returned CC code 0x%02x\n", rsp->ccode); + lprintf(LOG_ERR, "LED set state failed with CC code 0x%02x", rsp->ccode); return -1; } @@ -961,12 +969,12 @@ ipmi_picmg_get_power_level(struct ipmi_intf * intf, int argc, char ** argv) rsp = intf->sendrecv(intf, &req); if (!rsp) { - printf("no response\n"); + lprintf(LOG_ERR, "No valid response received."); return -1; } if (rsp->ccode) { - printf("returned CC code 0x%02x\n", rsp->ccode); + lprintf(LOG_ERR, "Power level get failed with CC code 0x%02x", rsp->ccode); return -1; } @@ -1005,12 +1013,12 @@ ipmi_picmg_set_power_level(struct ipmi_intf * intf, int argc, char ** argv) rsp = intf->sendrecv(intf, &req); if (!rsp) { - printf("no response\n"); + lprintf(LOG_ERR, "No valid response received."); return -1; } if (rsp->ccode) { - printf("returned CC code 0x%02x\n", rsp->ccode); + lprintf(LOG_ERR, "Power level set failed with CC code 0x%02x", rsp->ccode); return -1; } @@ -1096,12 +1104,12 @@ ipmi_picmg_fru_control(struct ipmi_intf * intf, int argc, char ** argv) rsp = intf->sendrecv(intf, &req); if (!rsp) { - printf("frucontrol: no response\n"); + lprintf(LOG_ERR, "No valid response received."); return -1; } if (rsp->ccode) { - printf("frucontrol: returned CC code 0x%02x\n", rsp->ccode); + lprintf(LOG_ERR, "frucontrol failed with CC code 0x%02x", rsp->ccode); return -1; } else { printf("frucontrol: ok\n"); @@ -1143,12 +1151,12 @@ ipmi_picmg_clk_get(struct ipmi_intf * intf, int clk_id,int clk_res,int mode) rsp = intf->sendrecv(intf, &req); if (!rsp) { - printf("no response\n"); + lprintf(LOG_ERR, "No valid response received."); return -1; } if (rsp->ccode && (mode == PICMG_EKEY_MODE_QUERY) ) { - printf("returned CC code 0x%02x\n", rsp->ccode); + lprintf(LOG_ERR, "Clk get failed with CC code 0x%02x", rsp->ccode); return -1; } @@ -1251,7 +1259,7 @@ ipmi_picmg_clk_set(struct ipmi_intf * intf, int argc, char ** argv) } else { - printf("missing resource id for atca board\n"); + lprintf(LOG_ERR, "Missing resource id for atca board."); return -1; } } @@ -1269,12 +1277,12 @@ printf("## res: %d\n", msg_data[10]); rsp = intf->sendrecv(intf, &req); if (!rsp) { - printf("no response\n"); + lprintf(LOG_ERR, "No valid response received."); return -1; } if (rsp->ccode) { - printf("returned CC code 0x%02x\n", rsp->ccode); + lprintf(LOG_ERR, "Clk set failed with CC code 0x%02x", rsp->ccode); return -1; } @@ -1310,7 +1318,7 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv) ipmi_picmg_bused_resource(intf, PICMG_BUSED_RESOURCE_SUMMARY ); } } else { - printf("usage: busres summary\n"); + lprintf(LOG_NOTICE, "usage: busres summary"); } } /* fru control command */ @@ -1319,14 +1327,14 @@ ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv) rc = ipmi_picmg_fru_control(intf, argc-1, &(argv[1])); } else { - printf("usage: frucontrol