From: Zdenek S. <st...@us...> - 2013-10-26 19:23:39
|
Update of /cvsroot/ipmitool/ipmitool/lib In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv571/lib Modified Files: ipmi_fwum.c Log Message: ID: 46 - ipmi_fwum needs some re-work Dismantle KfwumMain() - rollback Commit moves 'rollback' out of KfwumMain() and changes return value of KfwumManualRollback(). Index: ipmi_fwum.c =================================================================== RCS file: /cvsroot/ipmitool/ipmitool/lib/ipmi_fwum.c,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** ipmi_fwum.c 26 Oct 2013 19:23:16 -0000 1.43 --- ipmi_fwum.c 26 Oct 2013 19:23:37 -0000 1.44 *************** *** 143,147 **** unsigned char output, tKFWUM_BoardInfo *pBoardInfo); static tKFWUM_Status KfwumGetStatus(struct ipmi_intf *intf); ! static tKFWUM_Status KfwumManualRollback(struct ipmi_intf *intf); static tKFWUM_Status KfwumStartFirmwareImage(struct ipmi_intf *intf, unsigned long length, unsigned short padding); --- 143,147 ---- unsigned char output, tKFWUM_BoardInfo *pBoardInfo); static tKFWUM_Status KfwumGetStatus(struct ipmi_intf *intf); ! int KfwumManualRollback(struct ipmi_intf *intf); static tKFWUM_Status KfwumStartFirmwareImage(struct ipmi_intf *intf, unsigned long length, unsigned short padding); *************** *** 190,194 **** rc = KfwumMain(intf, KFWUM_TASK_STATUS); } else if (strncmp(argv[0], "rollback", 8) == 0) { ! rc = KfwumMain(intf, KFWUM_TASK_ROLLBACK); } else if (strncmp(argv[0], "download", 8) == 0) { if ((argc < 2) || (strlen(argv[1]) < 1)) { --- 190,194 ---- rc = KfwumMain(intf, KFWUM_TASK_STATUS); } else if (strncmp(argv[0], "rollback", 8) == 0) { ! rc = KfwumManualRollback(intf); } else if (strncmp(argv[0], "download", 8) == 0) { if ((argc < 2) || (strlen(argv[1]) < 1)) { *************** *** 287,293 **** KfwumGetStatus(intf); } - if ((status == KFWUM_STATUS_OK) && (task == KFWUM_TASK_ROLLBACK)) { - status = KfwumManualRollback(intf); - } if ((status == KFWUM_STATUS_OK) && ((task == KFWUM_TASK_UPGRADE) --- 287,290 ---- *************** *** 751,757 **** * *intf : IPMI interface * ! * returns KFWUM_STATUS_OK on success, otherwise KFWUM_STATUS_ERROR */ ! static tKFWUM_Status KfwumManualRollback(struct ipmi_intf *intf) { --- 748,755 ---- * *intf : IPMI interface * ! * returns 0 on success ! * returns (-1) on error */ ! int KfwumManualRollback(struct ipmi_intf *intf) { *************** *** 770,782 **** if (rsp == NULL) { lprintf(LOG_ERR, "Error in FWUM Manual Rollback Command."); ! return KFWUM_STATUS_ERROR; } else if (rsp->ccode != 0) { lprintf(LOG_ERR, "Error in FWUM Manual Rollback Command returned %x", rsp->ccode); ! return KFWUM_STATUS_ERROR; } printf("FWUM Starting Manual Rollback \n"); ! return KFWUM_STATUS_OK; } --- 768,780 ---- if (rsp == NULL) { lprintf(LOG_ERR, "Error in FWUM Manual Rollback Command."); ! return (-1); } else if (rsp->ccode != 0) { lprintf(LOG_ERR, "Error in FWUM Manual Rollback Command returned %x", rsp->ccode); ! return (-1); } printf("FWUM Starting Manual Rollback \n"); ! return 0; } |