CHAR16 *mVersionName = NULL;\r
\r
EFI_EVENT mFmpDeviceLockEvent;\r
+//\r
+// Indicates if an attempt has been made to lock a \r
+// FLASH storage device by calling FmpDeviceLock().\r
+// A FLASH storage device may not support being locked,\r
+// so this variable is set to TRUE even if FmpDeviceLock()\r
+// returns an error.\r
+//\r
BOOLEAN mFmpDeviceLocked = FALSE;\r
\r
/**\r
//\r
// Check the FmpDeviceLib\r
//\r
+ DeviceLibLowestSupportedVersion = DEFAULT_LOWESTSUPPORTEDVERSION;\r
Status = FmpDeviceGetLowestSupportedVersion (&DeviceLibLowestSupportedVersion);\r
if (EFI_ERROR (Status)) {\r
DeviceLibLowestSupportedVersion = DEFAULT_LOWESTSUPPORTEDVERSION;\r
@retval EFI_INVALID_PARAMETER The Image was NULL.\r
@retval EFI_NOT_FOUND The current image is not copied to the buffer.\r
@retval EFI_UNSUPPORTED The operation is not supported.\r
- @retval EFI_SECURITY_VIOLATIO The operation could not be performed due to an authentication failure.\r
+ @retval EFI_SECURITY_VIOLATION The operation could not be performed due to an authentication failure.\r
\r
**/\r
EFI_STATUS\r
\r
Status = EFI_SUCCESS;\r
\r
+ //\r
+ // Check to make sure index is 1 (only 1 image for this device)\r
+ //\r
+ if (ImageIndex != 1) {\r
+ DEBUG ((DEBUG_ERROR, "FmpDxe: GetImage() - Image Index Invalid.\n"));\r
+ Status = EFI_INVALID_PARAMETER;\r
+ goto cleanup;\r
+ }\r
+\r
if ((ImageSize == NULL)) {\r
DEBUG ((DEBUG_ERROR, "FmpDxe: GetImage() - ImageSize Pointer Parameter is NULL.\n"));\r
Status = EFI_INVALID_PARAMETER;\r
goto cleanup;\r
}\r
\r
- //\r
- // Check to make sure index is 1 (only 1 image for this device)\r
- //\r
- if (ImageIndex != 1) {\r
- DEBUG ((DEBUG_ERROR, "FmpDxe: GetImage() - Image Index Invalid.\n"));\r
- Status = EFI_INVALID_PARAMETER;\r
- goto cleanup;\r
- }\r
-\r
-\r
Status = FmpDeviceGetImage (Image, ImageSize);\r
cleanup:\r
\r
@retval EFI_ABORTED The operation is aborted.\r
@retval EFI_INVALID_PARAMETER The Image was NULL.\r
@retval EFI_UNSUPPORTED The operation is not supported.\r
- @retval EFI_SECURITY_VIOLATIO The operation could not be performed due to an authentication failure.\r
+ @retval EFI_SECURITY_VIOLATION The operation could not be performed due to an authentication failure.\r
\r
**/\r
EFI_STATUS\r
@retval EFI_ABORTED The operation is aborted.\r
@retval EFI_INVALID_PARAMETER The Image was NULL.\r
@retval EFI_UNSUPPORTED The operation is not supported.\r
- @retval EFI_SECURITY_VIOLATIO The operation could not be performed due to an authentication failure.\r
+ @retval EFI_SECURITY_VIOLATION The operation could not be performed due to an authentication failure.\r
\r
**/\r
EFI_STATUS\r
UINT32 AllHeaderSize;\r
UINT32 IncommingFwVersion;\r
UINT32 LastAttemptStatus;\r
+ EFI_STATUS GetAttributesStatus;\r
+ UINT64 AttributesSupported;\r
+ UINT64 AttributesSetting;\r
\r
Status = EFI_SUCCESS;\r
Updateable = 0;\r
//\r
if (mFmpDeviceLocked) {\r
DEBUG ((DEBUG_ERROR, "FmpDxe: SetTheImage() - Device is already locked. Can't update.\n"));\r
- Status = EFI_ACCESS_DENIED;\r
+ Status = EFI_UNSUPPORTED;\r
goto cleanup;\r
}\r
\r
\r
//\r
// Set flag so the descriptor is repopulated\r
- // This only applied to devices that do not require system reboot\r
+ // This is only applied to devices that do not require reset\r
//\r
- if (!PcdGetBool (PcdFmpDeviceSystemResetRequired)) {\r
- mDescriptorPopulated = FALSE;\r
+ GetAttributesStatus = FmpDeviceGetAttributes (&AttributesSupported, &AttributesSetting);\r
+ if (!EFI_ERROR (GetAttributesStatus)) {\r
+ if (((AttributesSupported & IMAGE_ATTRIBUTE_RESET_REQUIRED) == 0) ||\r
+ ((AttributesSetting & IMAGE_ATTRIBUTE_RESET_REQUIRED) == 0)) {\r
+ mDescriptorPopulated = FALSE;\r
+ }\r
}\r
\r
cleanup:\r
@retval EFI_INVALID_PARAMETER The PackageVersionName length is longer than the value\r
returned in PackageVersionNameMaxLen.\r
@retval EFI_UNSUPPORTED The operation is not supported.\r
- @retval EFI_SECURITY_VIOLATIO The operation could not be performed due to an authentication failure.\r
+ @retval EFI_SECURITY_VIOLATION The operation could not be performed due to an authentication failure.\r
\r
**/\r
EFI_STATUS\r