/*++\r
\r
-Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials are licensed and made available\r
under the terms and conditions of the BSD License which accompanies this\r
distribution. The full text of the license may be found at\r
EFI_STATUS Status;\r
EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
EFI_DISK_IO_PROTOCOL *DiskIo;\r
+ EFI_DISK_IO2_PROTOCOL *DiskIo2;\r
BOOLEAN LockedByMe;\r
\r
LockedByMe = FALSE;\r
if (EFI_ERROR (Status)) {\r
goto Exit;\r
}\r
+\r
+ Status = gBS->OpenProtocol (\r
+ ControllerHandle,\r
+ &gEfiDiskIo2ProtocolGuid,\r
+ (VOID **) &DiskIo2,\r
+ This->DriverBindingHandle,\r
+ ControllerHandle,\r
+ EFI_OPEN_PROTOCOL_BY_DRIVER\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ DiskIo2 = NULL;\r
+ }\r
+\r
//\r
// Allocate Volume structure. In FatAllocateVolume(), Resources\r
// are allocated with protocol installed and cached initialized\r
//\r
- Status = FatAllocateVolume (ControllerHandle, DiskIo, BlockIo);\r
+ Status = FatAllocateVolume (ControllerHandle, DiskIo, DiskIo2, BlockIo);\r
\r
//\r
// When the media changes on a device it will Reinstall the BlockIo interaface.\r
This->DriverBindingHandle,\r
ControllerHandle\r
);\r
+ gBS->CloseProtocol (\r
+ ControllerHandle,\r
+ &gEfiDiskIo2ProtocolGuid,\r
+ This->DriverBindingHandle,\r
+ ControllerHandle\r
+ );\r
}\r
}\r
\r
This->DriverBindingHandle,\r
ControllerHandle\r
);\r
+ Status = gBS->CloseProtocol (\r
+ ControllerHandle,\r
+ &gEfiDiskIo2ProtocolGuid,\r
+ This->DriverBindingHandle,\r
+ ControllerHandle\r
+ );\r
\r
return Status;\r
}\r