{\r
EFI_STATUS Status;\r
EFI_STORAGE_SECURITY_COMMAND_PROTOCOL* SecurityCommand;\r
- EFI_BLOCK_IO_PROTOCOL* BlkIo;\r
\r
if (mOpalEndOfDxe) {\r
return EFI_UNSUPPORTED;\r
Controller\r
);\r
\r
- //\r
- // Test EFI_BLOCK_IO_PROTOCOL on controller Handle, required by EFI_STORAGE_SECURITY_COMMAND_PROTOCOL\r
- // function APIs\r
- //\r
- Status = gBS->OpenProtocol(\r
- Controller,\r
- &gEfiBlockIoProtocolGuid,\r
- (VOID **)&BlkIo,\r
- This->DriverBindingHandle,\r
- Controller,\r
- EFI_OPEN_PROTOCOL_BY_DRIVER\r
- );\r
-\r
- if (EFI_ERROR(Status)) {\r
- DEBUG((DEBUG_INFO, "No EFI_BLOCK_IO_PROTOCOL on controller\n"));\r
- return Status;\r
- }\r
-\r
- //\r
- // Close protocol and reopen in Start call\r
- //\r
- gBS->CloseProtocol(\r
- Controller,\r
- &gEfiBlockIoProtocolGuid,\r
- This->DriverBindingHandle,\r
- Controller\r
- );\r
\r
return EFI_SUCCESS;\r
}\r
);\r
if (EFI_ERROR(Status)) {\r
//\r
- // Close storage security that was opened\r
+ // Block_IO not supported on handle\r
//\r
- gBS->CloseProtocol(\r
- Controller,\r
- &gEfiStorageSecurityCommandProtocolGuid,\r
- This->DriverBindingHandle,\r
- Controller\r
- );\r
+ if(Status == EFI_UNSUPPORTED) {\r
+ BlkIo = NULL;\r
+ } else {\r
+ //\r
+ // Close storage security that was opened\r
+ //\r
+ gBS->CloseProtocol(\r
+ Controller,\r
+ &gEfiStorageSecurityCommandProtocolGuid,\r
+ This->DriverBindingHandle,\r
+ Controller\r
+ );\r
\r
- FreePool(Dev);\r
- return Status;\r
+ FreePool(Dev);\r
+ return Status;\r
+ }\r
}\r
\r
//\r
// Save mediaId\r
//\r
- Dev->MediaId = BlkIo->Media->MediaId;\r
+ if(BlkIo == NULL) {\r
+ // If no Block IO present, use defined MediaId value.\r
+ Dev->MediaId = 0x0;\r
+ } else {\r
+ Dev->MediaId = BlkIo->Media->MediaId;\r
\r
- gBS->CloseProtocol(\r
- Controller,\r
- &gEfiBlockIoProtocolGuid,\r
- This->DriverBindingHandle,\r
- Controller\r
+ gBS->CloseProtocol(\r
+ Controller,\r
+ &gEfiBlockIoProtocolGuid,\r
+ This->DriverBindingHandle,\r
+ Controller\r
);\r
+ }\r
\r
//\r
// Acquire Ascii printable name of child, if not found, then ignore device\r