//\r
// FmpDeviceLib CheckImage function to do any specific checks\r
//\r
- Status = FmpDeviceCheckImage ((((UINT8 *)Image) + AllHeaderSize), RawSize, ImageUpdatable);\r
+ Status = FmpDeviceCheckImageWithStatus ((((UINT8 *) Image) + AllHeaderSize), RawSize, ImageUpdatable, LastAttemptStatus);\r
if (EFI_ERROR (Status)) {\r
DEBUG ((DEBUG_ERROR, "FmpDxe(%s): CheckTheImage() - FmpDeviceLib CheckImage failed. Status = %r\n", mImageIdName, Status));\r
+\r
+ //\r
+ // LastAttemptStatus returned from the device library should fall within the designated error range\r
+ // [LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE, LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MAX_ERROR_CODE_VALUE]\r
+ //\r
+ if ((*LastAttemptStatus < LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE) ||\r
+ (*LastAttemptStatus > LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MAX_ERROR_CODE_VALUE)) {\r
+ DEBUG (\r
+ (DEBUG_ERROR,\r
+ "FmpDxe(%s): CheckTheImage() - LastAttemptStatus %d from FmpDeviceCheckImageWithStatus() is invalid.\n",\r
+ mImageIdName,\r
+ *LastAttemptStatus)\r
+ );\r
+ *LastAttemptStatus = LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL;\r
+ }\r
}\r
\r
cleanup:\r
//\r
//Copy the requested image to the firmware using the FmpDeviceLib\r
//\r
- Status = FmpDeviceSetImage (\r
- (((UINT8 *)Image) + AllHeaderSize),\r
+ Status = FmpDeviceSetImageWithStatus (\r
+ (((UINT8 *) Image) + AllHeaderSize),\r
ImageSize - AllHeaderSize,\r
VendorCode,\r
FmpDxeProgress,\r
IncomingFwVersion,\r
- AbortReason\r
+ AbortReason,\r
+ &LastAttemptStatus\r
);\r
if (EFI_ERROR (Status)) {\r
DEBUG ((DEBUG_ERROR, "FmpDxe(%s): SetTheImage() SetImage from FmpDeviceLib failed. Status = %r.\n", mImageIdName, Status));\r
+\r
+ //\r
+ // LastAttemptStatus returned from the device library should fall within the designated error range\r
+ // [LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE, LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MAX_ERROR_CODE_VALUE]\r
+ //\r
+ if ((LastAttemptStatus < LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE) ||\r
+ (LastAttemptStatus > LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MAX_ERROR_CODE_VALUE)) {\r
+ DEBUG (\r
+ (DEBUG_ERROR,\r
+ "FmpDxe(%s): SetTheImage() - LastAttemptStatus %d from FmpDeviceSetImageWithStatus() is invalid.\n",\r
+ mImageIdName,\r
+ LastAttemptStatus)\r
+ );\r
+ LastAttemptStatus = LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL;\r
+ }\r
+\r
goto cleanup;\r
}\r
\r