From 3f508629a5bb4f807f0e7fb616bc928936d84769 Mon Sep 17 00:00:00 2001 From: Zdenek Styblik Date: Sun, 25 May 2014 08:48:50 +0200 Subject: [PATCH] ID: 305 - HPM.1 deferred activation support fixup Currently, the HPM.1 agent in the IPMItool does not differ between Rollback support and Deferred Activation Support. The patch fixes up this bug. Commit for Dmitry Bazhenov --- include/ipmitool/ipmi_hpmfwupg.h | 1 + lib/ipmi_hpmfwupg.c | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/include/ipmitool/ipmi_hpmfwupg.h b/include/ipmitool/ipmi_hpmfwupg.h index 305091e..71ec565 100644 --- a/include/ipmitool/ipmi_hpmfwupg.h +++ b/include/ipmitool/ipmi_hpmfwupg.h @@ -796,6 +796,7 @@ typedef struct _VERSIONINFO { unsigned char imageAux[4]; unsigned char coldResetRequired; unsigned char rollbackSupported; + unsigned char deferredActivationSupported; char descString[HPMFWUPG_DESC_STRING_LENGTH + 1]; }VERSIONINFO, *PVERSIONINFO; diff --git a/lib/ipmi_hpmfwupg.c b/lib/ipmi_hpmfwupg.c index 69950b7..7df0d81 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;