Skip to content

Commit

Permalink
Pass vendor code to fw update function
Browse files Browse the repository at this point in the history
Signed-off-by: Darin K Hoff <[email protected]>
Signed-off-by: Juston Li <[email protected]>
  • Loading branch information
dkhoff authored and Juston Li committed Aug 27, 2018
1 parent 69f5648 commit 247ea32
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion DcpmPkg/driver/Protocol/Device/NvmFirmwareManagement.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ EFI_GUID mNvmDimmFirmwareImageTypeGuid = EFI_DCPMM_FIRMWARE_IMAGE_TYPE_GUID;
#define NVDIMM_VERSION_NAME_BYTE_OFFSET NVDIMM_IMAGE_ID_NAME_BYTE_OFFSET + HII_MAX_STRING_BUFFER_LENGTH
#define NVDIMM_IMAGE_DESCRIPTOR_SIZE NVDIMM_VERSION_NAME_BYTE_OFFSET + HII_MAX_STRING_BUFFER_LENGTH

typedef struct _SET_IMAGE_ATTRIBUTES{
BOOLEAN Force;
} SET_IMAGE_ATTRIBUTES;

/**
In addition to the function information from the library header.
Expand Down Expand Up @@ -162,6 +166,8 @@ SetImage (
CHAR16 pImageContentError[] = L"Error: Invalid image file.";
NVM_STATUS Status = NVM_ERR_OPERATION_NOT_STARTED;
CONST CHAR16 *pSingleStatusCodeMessage = NULL;
SET_IMAGE_ATTRIBUTES *SetImageAttributes = (SET_IMAGE_ATTRIBUTES *)VendorCode;
BOOLEAN Force = FALSE;

NVDIMM_ENTRY();

Expand Down Expand Up @@ -194,7 +200,11 @@ SetImage (
Progress(0);
}

ReturnCode = UpdateDimmFw(GET_DIMM_FROM_INSTANCE(This)->pDimm->DimmID, Image, ImageSize, FALSE, &Status);
if (NULL != SetImageAttributes) {
Force = SetImageAttributes->Force;
}

ReturnCode = UpdateDimmFw(GET_DIMM_FROM_INSTANCE(This)->pDimm->DimmID, Image, ImageSize, Force, &Status);
if (EFI_ERROR(ReturnCode)) {
ReturnCode = EFI_ABORTED;
pSingleStatusCodeMessage = GetSingleNvmStatusCodeMessage(gNvmDimmData->HiiHandle, Status);
Expand Down

0 comments on commit 247ea32

Please sign in to comment.