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
KfwumManualRollback() - code formatting, simplify
This commit is contained in:
parent
700658e91e
commit
0dddcfe450
@ -821,44 +821,35 @@ struct KfwumManualRollbackReq{
|
|||||||
|
|
||||||
/* KfwumManualRollback - Ask IPMC to rollback to previous version
|
/* KfwumManualRollback - Ask IPMC to rollback to previous version
|
||||||
*
|
*
|
||||||
* * intf : IPMI interface
|
* *intf : IPMI interface
|
||||||
|
*
|
||||||
|
* returns KFWUM_STATUS_OK on success, otherwise KFWUM_STATUS_ERROR
|
||||||
*/
|
*/
|
||||||
static tKFWUM_Status KfwumManualRollback(struct ipmi_intf * intf)
|
static tKFWUM_Status KfwumManualRollback(struct ipmi_intf * intf)
|
||||||
{
|
{
|
||||||
tKFWUM_Status status = KFWUM_STATUS_OK;
|
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
struct KfwumManualRollbackReq thisReq;
|
struct KfwumManualRollbackReq thisReq;
|
||||||
|
|
||||||
|
|
||||||
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_MANUAL_ROLLBACK;
|
req.msg.cmd = KFWUM_CMD_ID_MANUAL_ROLLBACK;
|
||||||
|
|
||||||
thisReq.type = 0; /* Wait BMC shutdown */
|
thisReq.type = 0; /* Wait BMC shutdown */
|
||||||
|
req.msg.data = (unsigned char *)&thisReq;
|
||||||
req.msg.data = (unsigned char *) &thisReq;
|
|
||||||
req.msg.data_len = 1;
|
req.msg.data_len = 1;
|
||||||
|
|
||||||
rsp = intf->sendrecv(intf, &req);
|
rsp = intf->sendrecv(intf, &req);
|
||||||
|
if (rsp == NULL) {
|
||||||
if (!rsp)
|
lprintf(LOG_ERR, "Error in FWUM Manual Rollback Command.");
|
||||||
{
|
return KFWUM_STATUS_ERROR;
|
||||||
printf("Error in FWUM Manual Rollback Command\n");
|
} else if (rsp->ccode != 0) {
|
||||||
status = KFWUM_STATUS_ERROR;
|
lprintf(LOG_ERR,
|
||||||
}
|
"Error in FWUM Manual Rollback Command returned %x",
|
||||||
else if (rsp->ccode)
|
|
||||||
{
|
|
||||||
printf("Error in FWUM Manual Rollback Command returned %x\n",
|
|
||||||
rsp->ccode);
|
rsp->ccode);
|
||||||
status = KFWUM_STATUS_ERROR;
|
return KFWUM_STATUS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(status == KFWUM_STATUS_OK)
|
|
||||||
{
|
|
||||||
printf("FWUM Starting Manual Rollback \n");
|
printf("FWUM Starting Manual Rollback \n");
|
||||||
}
|
return KFWUM_STATUS_OK;
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_PRAGMA_PACK
|
#ifdef HAVE_PRAGMA_PACK
|
||||||
|
Loading…
x
Reference in New Issue
Block a user