mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
ID: 46 - ipmi_fwum needs some re-work
KfwumFinishFirmareImage() - code formatting
This commit is contained in:
parent
5a1e81a948
commit
d8f27165d1
@ -1053,43 +1053,38 @@ struct KfwumFinishFirmwareDownloadReq{
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static tKFWUM_Status KfwumFinishFirmwareImage(struct ipmi_intf * intf,
|
static tKFWUM_Status KfwumFinishFirmwareImage(struct ipmi_intf * intf,
|
||||||
tKFWUM_InFirmwareInfo firmInfo)
|
tKFWUM_InFirmwareInfo firmInfo)
|
||||||
{
|
{
|
||||||
tKFWUM_Status status = KFWUM_STATUS_OK;
|
struct ipmi_rs *rsp;
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rq req;
|
||||||
struct ipmi_rq req;
|
struct KfwumFinishFirmwareDownloadReq thisReq;
|
||||||
struct KfwumFinishFirmwareDownloadReq thisReq;
|
|
||||||
|
|
||||||
thisReq.versionMaj = firmInfo.versMajor;
|
thisReq.versionMaj = firmInfo.versMajor;
|
||||||
thisReq.versionMinSub = ((firmInfo.versMinor <<4) | firmInfo.versSubMinor);
|
thisReq.versionMinSub = ((firmInfo.versMinor <<4)
|
||||||
thisReq.versionSdr = firmInfo.sdrRev;
|
| firmInfo.versSubMinor);
|
||||||
thisReq.reserved = 0;
|
thisReq.versionSdr = firmInfo.sdrRev;
|
||||||
/* Byte 4 reserved, write 0 */
|
thisReq.reserved = 0;
|
||||||
|
/* Byte 4 reserved, write 0 */
|
||||||
memset(&req, 0, sizeof(req));
|
memset(&req, 0, sizeof(req));
|
||||||
req.msg.netfn = IPMI_NETFN_FIRMWARE;
|
req.msg.netfn = IPMI_NETFN_FIRMWARE;
|
||||||
req.msg.cmd = KFWUM_CMD_ID_FINISH_FIRMWARE_IMAGE;
|
req.msg.cmd = KFWUM_CMD_ID_FINISH_FIRMWARE_IMAGE;
|
||||||
req.msg.data = (unsigned char *) &thisReq;
|
req.msg.data = (unsigned char *)&thisReq;
|
||||||
req.msg.data_len = 4;
|
req.msg.data_len = 4;
|
||||||
|
/* Infinite loop if BMC doesn't reply or replies 0xc0 every time. */
|
||||||
do
|
do {
|
||||||
{
|
rsp = intf->sendrecv(intf, &req);
|
||||||
rsp = intf->sendrecv(intf, &req);
|
} while (rsp == NULL || rsp->ccode == 0xc0);
|
||||||
}while (rsp == NULL || rsp->ccode == 0xc0);
|
if (!rsp) {
|
||||||
|
lprintf(LOG_ERR,
|
||||||
if (!rsp)
|
"Error in FWUM Firmware Finish Firmware Image Download Command.");
|
||||||
{
|
return KFWUM_STATUS_ERROR;
|
||||||
printf("Error in FWUM Firmware Finish Firmware Image Download Command\n");
|
} else if (rsp->ccode != 0) {
|
||||||
status = KFWUM_STATUS_ERROR;
|
lprintf(LOG_ERR,
|
||||||
}
|
"FWUM Firmware Finish Firmware Image Download returned %x",
|
||||||
else if (rsp->ccode)
|
rsp->ccode);
|
||||||
{
|
return KFWUM_STATUS_ERROR;
|
||||||
printf("FWUM Firmware Finish Firmware Image Download returned %x\n",
|
}
|
||||||
rsp->ccode);
|
return KFWUM_STATUS_OK;
|
||||||
status = KFWUM_STATUS_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user