diff options
Diffstat (limited to 'lib/ipmi_hpmfwupg.c')
-rw-r--r-- | lib/ipmi_hpmfwupg.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/lib/ipmi_hpmfwupg.c b/lib/ipmi_hpmfwupg.c index 8ada69b..9cbd4ff 100644 --- a/lib/ipmi_hpmfwupg.c +++ b/lib/ipmi_hpmfwupg.c @@ -30,6 +30,10 @@ * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ +#define _BSD_SOURCE || \ + (_XOPEN_SOURCE >= 500 || \ + _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) && \ + !(_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700) #include <ipmitool/ipmi_intf.h> #include <ipmitool/ipmi_mc.h> @@ -38,14 +42,20 @@ #include <ipmitool/ipmi_strings.h> #include <ipmitool/log.h> #include "../src/plugins/lan/md5.h" +#include <ctype.h> #include <stdio.h> #include <time.h> #include <sys/param.h> +#include <unistd.h> #if HAVE_CONFIG_H # include <config.h> #endif +/* From src/plugins/ipmi_intf.c: */ +uint16_t +ipmi_intf_get_max_request_data_size(struct ipmi_intf * intf); + extern int verbose; int HpmfwupgUpgrade(struct ipmi_intf *intf, char *imageFilename, @@ -106,6 +116,10 @@ int HpmFwupgActionUploadFirmware(struct HpmfwupgComponentBitMask components, struct ipmi_intf *intf, int option, int *pFlagColdReset); +int +HpmfwupgPreUpgradeCheck(struct ipmi_intf *intf, + struct HpmfwupgUpgradeCtx *pFwupgCtx, + int componentMask, int option); /* HpmGetuserInput - get input from user * @@ -294,7 +308,6 @@ HpmfwupgTargetCheck(struct ipmi_intf *intf, int option) struct HpmfwupgGetTargetUpgCapabilitiesCtx targetCapCmd; int rc = HPMFWUPG_SUCCESS; int componentId = 0; - int flagColdReset = FALSE; struct ipm_devid_rsp devIdrsp; struct HpmfwupgGetComponentPropertiesCtx getCompProp; int mode = 0; @@ -431,13 +444,6 @@ HpmfwupgTargetCheck(struct ipmi_intf *intf, int option) gVersionInfo[componentId].deferredAux[2] = 0xff; gVersionInfo[componentId].deferredAux[3] = 0xff; } - if (gVersionInfo[componentId].coldResetRequired) { - /* - * If any of the component indicates that the Payload Cold reset is required - * then set the flag - */ - flagColdReset = TRUE; - } if (option & VIEW_MODE) { HpmDisplayVersion(mode, &gVersionInfo[componentId], @@ -996,14 +1002,11 @@ HpmfwupgUpgradeStage(struct ipmi_intf *intf, struct HpmfwupgActionRecord* pActionRecord; int rc = HPMFWUPG_SUCCESS; unsigned char *pImagePtr; - unsigned int actionsSize; int flagColdReset = FALSE; /* Put pointer after image header */ pImagePtr = (unsigned char*) (pFwupgCtx->pImageData + sizeof(struct HpmfwupgImageHeader) + pImageHeader->oemDataLength + sizeof(unsigned char)/*checksum*/); - /* Deternime actions size */ - actionsSize = pFwupgCtx->imageSize - sizeof(struct HpmfwupgImageHeader); if (!(option & VIEW_MODE)) { HpmDisplayUpgradeHeader(); } @@ -2021,13 +2024,13 @@ HpmfwupgQueryRollbackStatus(struct ipmi_intf *intf, memcpy(&pCtx->resp, rsp->data, sizeof(struct HpmfwupgQueryRollbackStatusResp)); if (pCtx->resp.rollbackComp.ComponentBits.byte != 0) { - /* Rollback occured */ + /* Rollback occurred */ lprintf(LOG_NOTICE, - "Rollback occured on component mask: 0x%02x", + "Rollback occurred on component mask: 0x%02x", pCtx->resp.rollbackComp.ComponentBits.byte); } else { lprintf(LOG_NOTICE, - "No Firmware rollback occured"); + "No Firmware rollback occurred"); } } else if (rsp->ccode == 0x81) { lprintf(LOG_ERR, |