summaryrefslogtreecommitdiff
path: root/lib/ipmi_hpmfwupg.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ipmi_hpmfwupg.c')
-rw-r--r--lib/ipmi_hpmfwupg.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/lib/ipmi_hpmfwupg.c b/lib/ipmi_hpmfwupg.c
index 69950b7..fbb5a62 100644
--- a/lib/ipmi_hpmfwupg.c
+++ b/lib/ipmi_hpmfwupg.c
@@ -344,6 +344,8 @@ HpmfwupgTargetCheck(struct ipmi_intf *intf, int option)
generalPropResp.GeneralCompProperties.bitfield.rollbackBackup;
gVersionInfo[componentId].coldResetRequired = getCompProp.resp.Response.
generalPropResp.GeneralCompProperties.bitfield.payloadColdReset;
+ gVersionInfo[componentId].deferredActivationSupported = getCompProp.resp.Response.
+ generalPropResp.GeneralCompProperties.bitfield.deferredActivation;
getCompProp.req.selector = HPMFWUPG_COMP_DESCRIPTION_STRING;
rc = HpmfwupgGetComponentProperties(intf, &getCompProp);
if (rc != HPMFWUPG_SUCCESS) {
@@ -395,6 +397,16 @@ HpmfwupgTargetCheck(struct ipmi_intf *intf, int option)
gVersionInfo[componentId].rollbackAux[2] = getCompProp.resp.Response.rollbackFwVersionResp.rollbackFwVersion[4];
gVersionInfo[componentId].rollbackAux[3] = getCompProp.resp.Response.rollbackFwVersionResp.rollbackFwVersion[5];
}
+ mode |= ROLLBACK_VER;
+ } else {
+ gVersionInfo[componentId].rollbackMajor = 0xff;
+ gVersionInfo[componentId].rollbackMinor = 0xff;
+ gVersionInfo[componentId].rollbackAux[0] = 0xff;
+ gVersionInfo[componentId].rollbackAux[1] = 0xff;
+ gVersionInfo[componentId].rollbackAux[2] = 0xff;
+ gVersionInfo[componentId].rollbackAux[3] = 0xff;
+ }
+ if (gVersionInfo[componentId].deferredActivationSupported) {
getCompProp.req.selector = HPMFWUPG_COMP_DEFERRED_FIRMWARE_VERSION;
rc = HpmfwupgGetComponentProperties(intf, &getCompProp);
if (rc != HPMFWUPG_SUCCESS) {
@@ -411,14 +423,7 @@ HpmfwupgTargetCheck(struct ipmi_intf *intf, int option)
gVersionInfo[componentId].deferredAux[2] = getCompProp.resp.Response.deferredFwVersionResp.deferredFwVersion[4];
gVersionInfo[componentId].deferredAux[3] = getCompProp.resp.Response.deferredFwVersionResp.deferredFwVersion[5];
}
- mode |= ROLLBACK_VER;
} else {
- gVersionInfo[componentId].rollbackMajor = 0xff;
- gVersionInfo[componentId].rollbackMinor = 0xff;
- gVersionInfo[componentId].rollbackAux[0] = 0xff;
- gVersionInfo[componentId].rollbackAux[1] = 0xff;
- gVersionInfo[componentId].rollbackAux[2] = 0xff;
- gVersionInfo[componentId].rollbackAux[3] = 0xff;
gVersionInfo[componentId].deferredMajor = 0xff;
gVersionInfo[componentId].deferredMinor = 0xff;
gVersionInfo[componentId].deferredAux[0] = 0xff;
@@ -1235,10 +1240,12 @@ HpmFwupgActionUploadFirmware(struct HpmfwupgComponentBitMask components,
} else {
/* success, buf length is valid */
bufLengthIsSet = 1;
- if (blockLength > firmwareLength) {
+ if (imageOffset + blockLength > firmwareLength ||
+ imageOffset + blockLength < blockLength) {
/*
* blockLength is the remaining length of the firmware to upload so
- * if its greater than the firmware length then its kind of error
+ * if imageOffset and blockLength sum is greater than the firmware
+ * length then its kind of error
*/
lprintf(LOG_NOTICE,
"\n Error in Upload FIRMWARE command [rc=%d]\n",
@@ -1247,6 +1254,7 @@ HpmFwupgActionUploadFirmware(struct HpmfwupgComponentBitMask components,
"\n TotalSent:0x%x Img offset:0x%x Blk length:0x%x Fwlen:0x%x\n",
totalSent,imageOffset,blockLength,firmwareLength);
rc = HPMFWUPG_ERROR;
+ continue;
}
totalSent += count;
if (imageOffset != 0x00) {
@@ -2296,7 +2304,8 @@ HpmfwupgWaitLongDurationCmd(struct ipmi_intf *intf,
* receive d5 (on the first get status) from
* the ipmi driver.
*/
- (upgStatusCmd.resp.lastCmdCompCode != 0x00 )
+ (upgStatusCmd.resp.lastCmdCompCode == 0x80 ||
+ upgStatusCmd.resp.lastCmdCompCode == 0xD5)
&& ((timeoutSec2 - timeoutSec1) < upgradeTimeout )
&& (rc == HPMFWUPG_SUCCESS)) {
/* Must wait at least 1000 ms between status requests */