- Fix new GCC compilation issues in regards to Packing

This commit is contained in:
Jean-Michel Audet 2008-09-29 18:33:32 +00:00
parent 5b8255f671
commit 35daac42a5
4 changed files with 403 additions and 59 deletions

View File

@ -488,6 +488,30 @@ AC_ARG_ENABLE([file-security],
AC_DEFINE(ENABLE_FILE_SECURITY, [1], [Define to 1 for extra file security.]) AC_DEFINE(ENABLE_FILE_SECURITY, [1], [Define to 1 for extra file security.])
fi], []) fi], [])
AC_TRY_RUN([
#include <stdio.h>
struct packstruct {
unsigned char t0 :5;
unsigned char t1 :5;
unsigned char t2 :5;
unsigned char t3 :5;
unsigned char t4 :4;
} __attribute__ ((packed));
int
main(int argc, char ** argv)
{
if(sizeof(struct packstruct) != 3)
return(1);
else
return(0);
}
],[],[AC_DEFINE(HAVE_PRAGMA_PACK,[1],[Define to 1 if you need to use #pragma pack instead of __attribute__ ((packed))])]
)
dnl Generate files for build dnl Generate files for build
AC_CONFIG_FILES([Makefile AC_CONFIG_FILES([Makefile
doc/Makefile doc/Makefile

View File

@ -44,6 +44,13 @@
#define IPMI_BUF_SIZE 1024 #define IPMI_BUF_SIZE 1024
#if HAVE_PRAGMA_PACK
#define ATTRIBUTE_PACKING
#else
#define ATTRIBUTE_PACKING __attribute__ ((packed))
#endif
/* From table 13.16 of the IPMI v2 specification */ /* From table 13.16 of the IPMI v2 specification */
#define IPMI_PAYLOAD_TYPE_IPMI 0x00 #define IPMI_PAYLOAD_TYPE_IPMI 0x00
#define IPMI_PAYLOAD_TYPE_SOL 0x01 #define IPMI_PAYLOAD_TYPE_SOL 0x01

View File

@ -616,6 +616,9 @@ static unsigned short KfwumCalculateChecksumPadding(unsigned char * pBuffer,
/****************************************************************************** /******************************************************************************
******************************* COMMANDS ************************************** ******************************* COMMANDS **************************************
******************************************************************************/ ******************************************************************************/
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct KfwumGetInfoResp { struct KfwumGetInfoResp {
unsigned char protocolRevision; unsigned char protocolRevision;
unsigned char controllerDeviceId; unsigned char controllerDeviceId;
@ -628,7 +631,11 @@ struct KfwumGetInfoResp {
unsigned char firmRev1; unsigned char firmRev1;
unsigned char firmRev2; unsigned char firmRev2;
unsigned char numBank; unsigned char numBank;
} __attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
/* KfwumGetInfo - Get Firmware Update Manager (FWUM) information /* KfwumGetInfo - Get Firmware Update Manager (FWUM) information
@ -827,6 +834,10 @@ static tKFWUM_Status KfwumGetDeviceInfo(struct ipmi_intf * intf,
return status; return status;
} }
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct KfwumGetStatusResp { struct KfwumGetStatusResp {
unsigned char bankState; unsigned char bankState;
unsigned char firmLengthLSB; unsigned char firmLengthLSB;
@ -835,7 +846,11 @@ struct KfwumGetStatusResp {
unsigned char firmRev1; unsigned char firmRev1;
unsigned char firmRev2; unsigned char firmRev2;
unsigned char firmRev3; unsigned char firmRev3;
} __attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
const struct valstr bankStateValS[] = { const struct valstr bankStateValS[] = {
{ 0x00, "Not programmed" }, { 0x00, "Not programmed" },
@ -917,9 +932,16 @@ static tKFWUM_Status KfwumGetStatus(struct ipmi_intf * intf)
printf("\n"); printf("\n");
return status; return status;
} }
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct KfwumManualRollbackReq{ struct KfwumManualRollbackReq{
unsigned char type; unsigned char type;
} __attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
/* KfwumManualRollback - Ask IPMC to rollback to previous version /* KfwumManualRollback - Ask IPMC to rollback to previous version
@ -964,6 +986,9 @@ static tKFWUM_Status KfwumManualRollback(struct ipmi_intf * intf)
return status; return status;
} }
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct KfwumStartFirmwareDownloadReq{ struct KfwumStartFirmwareDownloadReq{
unsigned char lengthLSB; unsigned char lengthLSB;
unsigned char lengthMid; unsigned char lengthMid;
@ -971,10 +996,20 @@ struct KfwumStartFirmwareDownloadReq{
unsigned char paddingLSB; unsigned char paddingLSB;
unsigned char paddingMSB; unsigned char paddingMSB;
unsigned char useSequence; unsigned char useSequence;
} __attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct KfwumStartFirmwareDownloadResp { struct KfwumStartFirmwareDownloadResp {
unsigned char bank; unsigned char bank;
} __attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
static tKFWUM_Status KfwumStartFirmwareImage(struct ipmi_intf * intf, static tKFWUM_Status KfwumStartFirmwareImage(struct ipmi_intf * intf,
unsigned long length,unsigned short padding) unsigned long length,unsigned short padding)
@ -1030,6 +1065,9 @@ static tKFWUM_Status KfwumStartFirmwareImage(struct ipmi_intf * intf,
return status; return status;
} }
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct KfwumSaveFirmwareAddressReq struct KfwumSaveFirmwareAddressReq
{ {
unsigned char addressLSB; unsigned char addressLSB;
@ -1037,13 +1075,22 @@ struct KfwumSaveFirmwareAddressReq
unsigned char addressMSB; unsigned char addressMSB;
unsigned char numBytes; unsigned char numBytes;
unsigned char txBuf[KFWUM_SMALL_BUFFER-KFWUM_OLD_CMD_OVERHEAD]; unsigned char txBuf[KFWUM_SMALL_BUFFER-KFWUM_OLD_CMD_OVERHEAD];
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct KfwumSaveFirmwareSequenceReq struct KfwumSaveFirmwareSequenceReq
{ {
unsigned char sequenceNumber; unsigned char sequenceNumber;
unsigned char txBuf[KFWUM_BIG_BUFFER]; unsigned char txBuf[KFWUM_BIG_BUFFER];
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#define FWUM_SAVE_FIRMWARE_NO_RESPONSE_LIMIT ((unsigned char)6) #define FWUM_SAVE_FIRMWARE_NO_RESPONSE_LIMIT ((unsigned char)6)
@ -1187,12 +1234,19 @@ static tKFWUM_Status KfwumSaveFirmwareImage(struct ipmi_intf * intf,
return status; return status;
} }
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct KfwumFinishFirmwareDownloadReq{ struct KfwumFinishFirmwareDownloadReq{
unsigned char versionMaj; unsigned char versionMaj;
unsigned char versionMinSub; unsigned char versionMinSub;
unsigned char versionSdr; unsigned char versionSdr;
unsigned char reserved; unsigned char reserved;
} __attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
static tKFWUM_Status KfwumFinishFirmwareImage(struct ipmi_intf * intf, static tKFWUM_Status KfwumFinishFirmwareImage(struct ipmi_intf * intf,
tKFWUM_InFirmwareInfo firmInfo) tKFWUM_InFirmwareInfo firmInfo)
{ {

View File

@ -202,6 +202,9 @@ typedef enum eHpmfwupgComponentId
HPMFWUPG_COMPONENT_ID_MAX HPMFWUPG_COMPONENT_ID_MAX
} tHpmfwupgComponentId; } tHpmfwupgComponentId;
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgComponentBitMask struct HpmfwupgComponentBitMask
{ {
union union
@ -230,7 +233,10 @@ struct HpmfwupgComponentBitMask
#endif #endif
}bitField; }bitField;
}ComponentBits; }ComponentBits;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
static const int HPMFWUPG_SUCCESS = 0; static const int HPMFWUPG_SUCCESS = 0;
@ -244,12 +250,20 @@ static const int HPMFWUPG_UPLOAD_RETRY = 2;
* TARGET UPGRADE CAPABILITIES DEFINITIONS * TARGET UPGRADE CAPABILITIES DEFINITIONS
*/ */
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgGetTargetUpgCapabilitiesReq struct HpmfwupgGetTargetUpgCapabilitiesReq
{ {
unsigned char picmgId; unsigned char picmgId;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgGetTargetUpgCapabilitiesResp struct HpmfwupgGetTargetUpgCapabilitiesResp
{ {
unsigned char picmgId; unsigned char picmgId;
@ -285,13 +299,22 @@ struct HpmfwupgGetTargetUpgCapabilitiesResp
unsigned char rollbackTimeout; unsigned char rollbackTimeout;
unsigned char inaccessTimeout; unsigned char inaccessTimeout;
struct HpmfwupgComponentBitMask componentsPresent; struct HpmfwupgComponentBitMask componentsPresent;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgGetTargetUpgCapabilitiesCtx struct HpmfwupgGetTargetUpgCapabilitiesCtx
{ {
struct HpmfwupgGetTargetUpgCapabilitiesReq req; struct HpmfwupgGetTargetUpgCapabilitiesReq req;
struct HpmfwupgGetTargetUpgCapabilitiesResp resp; struct HpmfwupgGetTargetUpgCapabilitiesResp resp;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
/* /*
* COMPONENT PROPERTIES DEFINITIONS * COMPONENT PROPERTIES DEFINITIONS
@ -308,13 +331,22 @@ typedef enum eHpmfwupgCompPropertiesSelect
HPMFWUPG_COMP_OEM_PROPERTIES = 192 HPMFWUPG_COMP_OEM_PROPERTIES = 192
} tHpmfwupgCompPropertiesSelect; } tHpmfwupgCompPropertiesSelect;
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgGetComponentPropertiesReq struct HpmfwupgGetComponentPropertiesReq
{ {
unsigned char picmgId; unsigned char picmgId;
unsigned char componentId; unsigned char componentId;
unsigned char selector; unsigned char selector;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgGetGeneralPropResp struct HpmfwupgGetGeneralPropResp
{ {
unsigned char picmgId; unsigned char picmgId;
@ -340,42 +372,78 @@ struct HpmfwupgGetGeneralPropResp
#endif #endif
}bitfield; }bitfield;
}GeneralCompProperties; }GeneralCompProperties;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgGetCurrentVersionResp struct HpmfwupgGetCurrentVersionResp
{ {
unsigned char picmgId; unsigned char picmgId;
unsigned char currentVersion[HPMFWUPG_VERSION_SIZE]; unsigned char currentVersion[HPMFWUPG_VERSION_SIZE];
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgGetDescStringResp struct HpmfwupgGetDescStringResp
{ {
unsigned char picmgId; unsigned char picmgId;
char descString[HPMFWUPG_DESC_STRING_LENGTH]; char descString[HPMFWUPG_DESC_STRING_LENGTH];
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgGetRollbackFwVersionResp struct HpmfwupgGetRollbackFwVersionResp
{ {
unsigned char picmgId; unsigned char picmgId;
unsigned char rollbackFwVersion[HPMFWUPG_VERSION_SIZE]; unsigned char rollbackFwVersion[HPMFWUPG_VERSION_SIZE];
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgGetDeferredFwVersionResp struct HpmfwupgGetDeferredFwVersionResp
{ {
unsigned char picmgId; unsigned char picmgId;
unsigned char deferredFwVersion[HPMFWUPG_VERSION_SIZE]; unsigned char deferredFwVersion[HPMFWUPG_VERSION_SIZE];
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
/* /*
* GetComponentProperties - OEM properties (192) * GetComponentProperties - OEM properties (192)
*/ */
#define HPMFWUPG_OEM_LENGTH 4 #define HPMFWUPG_OEM_LENGTH 4
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgGetOemProperties struct HpmfwupgGetOemProperties
{ {
unsigned char picmgId; unsigned char picmgId;
unsigned char oemRspData[HPMFWUPG_OEM_LENGTH]; unsigned char oemRspData[HPMFWUPG_OEM_LENGTH];
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgGetComponentPropertiesResp struct HpmfwupgGetComponentPropertiesResp
{ {
union union
@ -387,33 +455,60 @@ struct HpmfwupgGetComponentPropertiesResp
struct HpmfwupgGetDeferredFwVersionResp deferredFwVersionResp; struct HpmfwupgGetDeferredFwVersionResp deferredFwVersionResp;
struct HpmfwupgGetOemProperties oemProperties; struct HpmfwupgGetOemProperties oemProperties;
}Response; }Response;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgGetComponentPropertiesCtx struct HpmfwupgGetComponentPropertiesCtx
{ {
struct HpmfwupgGetComponentPropertiesReq req; struct HpmfwupgGetComponentPropertiesReq req;
struct HpmfwupgGetComponentPropertiesResp resp; struct HpmfwupgGetComponentPropertiesResp resp;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
/* /*
* ABORT UPGRADE DEFINITIONS * ABORT UPGRADE DEFINITIONS
*/ */
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgAbortUpgradeReq struct HpmfwupgAbortUpgradeReq
{ {
unsigned char picmgId; unsigned char picmgId;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgAbortUpgradeResp struct HpmfwupgAbortUpgradeResp
{ {
unsigned char picmgId; unsigned char picmgId;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgAbortUpgradeCtx struct HpmfwupgAbortUpgradeCtx
{ {
struct HpmfwupgAbortUpgradeReq req; struct HpmfwupgAbortUpgradeReq req;
struct HpmfwupgAbortUpgradeResp resp; struct HpmfwupgAbortUpgradeResp resp;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
/* /*
* UPGRADE ACTIONS DEFINITIONS * UPGRADE ACTIONS DEFINITIONS
@ -427,23 +522,41 @@ typedef enum eHpmfwupgUpgradeAction
HPMFWUPG_UPGRADE_ACTION_INVALID = 0xff HPMFWUPG_UPGRADE_ACTION_INVALID = 0xff
} tHpmfwupgUpgradeAction; } tHpmfwupgUpgradeAction;
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgInitiateUpgradeActionReq struct HpmfwupgInitiateUpgradeActionReq
{ {
unsigned char picmgId; unsigned char picmgId;
struct HpmfwupgComponentBitMask componentsMask; struct HpmfwupgComponentBitMask componentsMask;
unsigned char upgradeAction; unsigned char upgradeAction;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgInitiateUpgradeActionResp struct HpmfwupgInitiateUpgradeActionResp
{ {
unsigned char picmgId; unsigned char picmgId;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgInitiateUpgradeActionCtx struct HpmfwupgInitiateUpgradeActionCtx
{ {
struct HpmfwupgInitiateUpgradeActionReq req; struct HpmfwupgInitiateUpgradeActionReq req;
struct HpmfwupgInitiateUpgradeActionResp resp; struct HpmfwupgInitiateUpgradeActionResp resp;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
/* /*
* UPLOAD FIRMWARE BLOCK DEFINITIONS * UPLOAD FIRMWARE BLOCK DEFINITIONS
@ -455,23 +568,42 @@ struct HpmfwupgInitiateUpgradeActionCtx
#define HPMFWUPG_SEND_DATA_COUNT_IPMB 26 #define HPMFWUPG_SEND_DATA_COUNT_IPMB 26
#define HPMFWUPG_SEND_DATA_COUNT_IPMBL 26 #define HPMFWUPG_SEND_DATA_COUNT_IPMBL 26
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgUploadFirmwareBlockReq struct HpmfwupgUploadFirmwareBlockReq
{ {
unsigned char picmgId; unsigned char picmgId;
unsigned char blockNumber; unsigned char blockNumber;
unsigned char data[HPMFWUPG_SEND_DATA_COUNT_MAX]; unsigned char data[HPMFWUPG_SEND_DATA_COUNT_MAX];
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgUploadFirmwareBlockResp struct HpmfwupgUploadFirmwareBlockResp
{ {
unsigned char picmgId; unsigned char picmgId;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgUploadFirmwareBlockCtx struct HpmfwupgUploadFirmwareBlockCtx
{ {
struct HpmfwupgUploadFirmwareBlockReq req; struct HpmfwupgUploadFirmwareBlockReq req;
struct HpmfwupgUploadFirmwareBlockResp resp; struct HpmfwupgUploadFirmwareBlockResp resp;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
/* /*
@ -480,131 +612,234 @@ struct HpmfwupgUploadFirmwareBlockCtx
#define HPMFWUPG_IMAGE_SIZE_BYTE_COUNT 4 #define HPMFWUPG_IMAGE_SIZE_BYTE_COUNT 4
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgFinishFirmwareUploadReq struct HpmfwupgFinishFirmwareUploadReq
{ {
unsigned char picmgId; unsigned char picmgId;
unsigned char componentId; unsigned char componentId;
unsigned char imageLength[HPMFWUPG_IMAGE_SIZE_BYTE_COUNT]; unsigned char imageLength[HPMFWUPG_IMAGE_SIZE_BYTE_COUNT];
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgFinishFirmwareUploadResp struct HpmfwupgFinishFirmwareUploadResp
{ {
unsigned char picmgId; unsigned char picmgId;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgFinishFirmwareUploadCtx struct HpmfwupgFinishFirmwareUploadCtx
{ {
struct HpmfwupgFinishFirmwareUploadReq req; struct HpmfwupgFinishFirmwareUploadReq req;
struct HpmfwupgFinishFirmwareUploadResp resp; struct HpmfwupgFinishFirmwareUploadResp resp;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
/* /*
* ACTIVATE FW DEFINITIONS * ACTIVATE FW DEFINITIONS
*/ */
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgActivateFirmwareReq struct HpmfwupgActivateFirmwareReq
{ {
unsigned char picmgId; unsigned char picmgId;
unsigned char rollback_override; unsigned char rollback_override;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgActivateFirmwareResp struct HpmfwupgActivateFirmwareResp
{ {
unsigned char picmgId; unsigned char picmgId;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgActivateFirmwareCtx struct HpmfwupgActivateFirmwareCtx
{ {
struct HpmfwupgActivateFirmwareReq req; struct HpmfwupgActivateFirmwareReq req;
struct HpmfwupgActivateFirmwareResp resp; struct HpmfwupgActivateFirmwareResp resp;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
/* /*
* GET UPGRADE STATUS DEFINITIONS * GET UPGRADE STATUS DEFINITIONS
*/ */
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgGetUpgradeStatusReq struct HpmfwupgGetUpgradeStatusReq
{ {
unsigned char picmgId; unsigned char picmgId;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgGetUpgradeStatusResp struct HpmfwupgGetUpgradeStatusResp
{ {
unsigned char picmgId; unsigned char picmgId;
unsigned char cmdInProcess; unsigned char cmdInProcess;
unsigned char lastCmdCompCode; unsigned char lastCmdCompCode;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgGetUpgradeStatusCtx struct HpmfwupgGetUpgradeStatusCtx
{ {
struct HpmfwupgGetUpgradeStatusReq req; struct HpmfwupgGetUpgradeStatusReq req;
struct HpmfwupgGetUpgradeStatusResp resp; struct HpmfwupgGetUpgradeStatusResp resp;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
/* /*
* MANUAL FW ROLLBACK DEFINITIONS * MANUAL FW ROLLBACK DEFINITIONS
*/ */
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgManualFirmwareRollbackReq struct HpmfwupgManualFirmwareRollbackReq
{ {
unsigned char picmgId; unsigned char picmgId;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgManualFirmwareRollbackResp struct HpmfwupgManualFirmwareRollbackResp
{ {
unsigned char picmgId; unsigned char picmgId;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
struct HpmfwupgManualFirmwareRollbackCtx struct HpmfwupgManualFirmwareRollbackCtx
{ {
struct HpmfwupgManualFirmwareRollbackReq req; struct HpmfwupgManualFirmwareRollbackReq req;
struct HpmfwupgManualFirmwareRollbackResp resp; struct HpmfwupgManualFirmwareRollbackResp resp;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
/* /*
* QUERY ROLLBACK STATUS DEFINITIONS * QUERY ROLLBACK STATUS DEFINITIONS
*/ */
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgQueryRollbackStatusReq struct HpmfwupgQueryRollbackStatusReq
{ {
unsigned char picmgId; unsigned char picmgId;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgQueryRollbackStatusResp struct HpmfwupgQueryRollbackStatusResp
{ {
unsigned char picmgId; unsigned char picmgId;
struct HpmfwupgComponentBitMask rollbackComp; struct HpmfwupgComponentBitMask rollbackComp;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgQueryRollbackStatusCtx struct HpmfwupgQueryRollbackStatusCtx
{ {
struct HpmfwupgQueryRollbackStatusReq req; struct HpmfwupgQueryRollbackStatusReq req;
struct HpmfwupgQueryRollbackStatusResp resp; struct HpmfwupgQueryRollbackStatusResp resp;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
/* /*
* QUERY SELF TEST RESULT DEFINITIONS * QUERY SELF TEST RESULT DEFINITIONS
*/ */
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgQuerySelftestResultReq struct HpmfwupgQuerySelftestResultReq
{ {
unsigned char picmgId; unsigned char picmgId;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgQuerySelftestResultResp struct HpmfwupgQuerySelftestResultResp
{ {
unsigned char picmgId; unsigned char picmgId;
unsigned char result1; unsigned char result1;
unsigned char result2; unsigned char result2;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgQuerySelftestResultCtx struct HpmfwupgQuerySelftestResultCtx
{ {
struct HpmfwupgQuerySelftestResultReq req; struct HpmfwupgQuerySelftestResultReq req;
struct HpmfwupgQuerySelftestResultResp resp; struct HpmfwupgQuerySelftestResultResp resp;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
/* /*
* HPM.1 IMAGE DEFINITIONS * HPM.1 IMAGE DEFINITIONS
*/ */
@ -619,6 +854,9 @@ struct HpmfwupgQuerySelftestResultCtx
#define HPMFWUPG_IMAGE_HEADER_VERSION 0 #define HPMFWUPG_IMAGE_HEADER_VERSION 0
#define HPMFWUPG_IMAGE_SIGNATURE "PICMGFWU" #define HPMFWUPG_IMAGE_SIGNATURE "PICMGFWU"
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgImageHeader struct HpmfwupgImageHeader
{ {
char signature[HPMFWUPG_HEADER_SIGNATURE_LENGTH]; char signature[HPMFWUPG_HEADER_SIGNATURE_LENGTH];
@ -654,27 +892,45 @@ struct HpmfwupgImageHeader
unsigned char compRevision[HPMFWUPG_COMP_REVISION_LENGTH]; unsigned char compRevision[HPMFWUPG_COMP_REVISION_LENGTH];
unsigned char firmRevision[HPMFWUPG_FIRM_REVISION_LENGTH]; unsigned char firmRevision[HPMFWUPG_FIRM_REVISION_LENGTH];
unsigned short oemDataLength; unsigned short oemDataLength;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#define HPMFWUPG_DESCRIPTION_LENGTH 21 #define HPMFWUPG_DESCRIPTION_LENGTH 21
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgActionRecord struct HpmfwupgActionRecord
{ {
unsigned char actionType; unsigned char actionType;
struct HpmfwupgComponentBitMask components; struct HpmfwupgComponentBitMask components;
unsigned char checksum; unsigned char checksum;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#define HPMFWUPG_FIRMWARE_SIZE_LENGTH 4 #define HPMFWUPG_FIRMWARE_SIZE_LENGTH 4
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgFirmwareImage struct HpmfwupgFirmwareImage
{ {
unsigned char version[HPMFWUPG_FIRM_REVISION_LENGTH]; unsigned char version[HPMFWUPG_FIRM_REVISION_LENGTH];
char desc[HPMFWUPG_DESCRIPTION_LENGTH]; char desc[HPMFWUPG_DESCRIPTION_LENGTH];
unsigned char length[HPMFWUPG_FIRMWARE_SIZE_LENGTH]; unsigned char length[HPMFWUPG_FIRMWARE_SIZE_LENGTH];
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
#ifdef PRAGMA_PACK
#pramga pack(1)
#endif
struct HpmfwupgUpgradeCtx struct HpmfwupgUpgradeCtx
{ {
unsigned int imageSize; unsigned int imageSize;
@ -683,7 +939,10 @@ struct HpmfwupgUpgradeCtx
struct HpmfwupgGetTargetUpgCapabilitiesResp targetCap; struct HpmfwupgGetTargetUpgCapabilitiesResp targetCap;
struct HpmfwupgGetGeneralPropResp genCompProp[HPMFWUPG_COMPONENT_ID_MAX]; struct HpmfwupgGetGeneralPropResp genCompProp[HPMFWUPG_COMPONENT_ID_MAX];
struct ipm_devid_rsp devId; struct ipm_devid_rsp devId;
}__attribute__ ((packed)); } ATTRIBUTE_PACKING;
#ifdef PRAGMA_PACK
#pramga pack(0)
#endif
typedef enum eHpmfwupgActionType typedef enum eHpmfwupgActionType
{ {