summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c
diff options
context:
space:
mode:
authorerictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-13 05:27:23 +0000
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-13 05:27:23 +0000
commit39840c50c1a7cc727fb60cce044b0e956f94deb3 (patch)
tree4d9868e5b649887217e2dbca514e44b80cdd363f /MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c
parent0194d26cb8427513c2cb78398e3d529bb0a44bf4 (diff)
downloadedk2-platforms-39840c50c1a7cc727fb60cce044b0e956f94deb3.tar.xz
Produce DiskInfo for usb mass storage device
Signed-off-by:erictian Reviewed-by:niruiyu git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11817 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c')
-rw-r--r--MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c
index 107eb8b4e4..563c55960f 100644
--- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c
+++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
-#include "UsbMassImpl.h"
+#include "UsbMass.h"
#define USB_MASS_TRANSPORT_COUNT 3
//
@@ -554,6 +554,8 @@ UsbMassInitMultiLun (
goto ON_ERROR;
}
+ InitializeDiskInfo (UsbMass);
+
//
// Create a new handle for each LUN, and install Block I/O Protocol and Device Path Protocol.
//
@@ -563,6 +565,8 @@ UsbMassInitMultiLun (
UsbMass->DevicePath,
&gEfiBlockIoProtocolGuid,
&UsbMass->BlockIo,
+ &gEfiDiskInfoProtocolGuid,
+ &UsbMass->DiskInfo,
NULL
);
@@ -591,6 +595,8 @@ UsbMassInitMultiLun (
UsbMass->DevicePath,
&gEfiBlockIoProtocolGuid,
&UsbMass->BlockIo,
+ &gEfiDiskInfoProtocolGuid,
+ &UsbMass->DiskInfo,
NULL
);
goto ON_ERROR;
@@ -702,11 +708,15 @@ UsbMassInitNonLun (
goto ON_ERROR;
}
- Status = gBS->InstallProtocolInterface (
+ InitializeDiskInfo (UsbMass);
+
+ Status = gBS->InstallMultipleProtocolInterfaces (
&Controller,
&gEfiBlockIoProtocolGuid,
- EFI_NATIVE_INTERFACE,
- &UsbMass->BlockIo
+ &UsbMass->BlockIo,
+ &gEfiDiskInfoProtocolGuid,
+ &UsbMass->DiskInfo,
+ NULL
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
@@ -1007,10 +1017,13 @@ USBMassDriverBindingStop (
// Uninstall Block I/O protocol from the device handle,
// then call the transport protocol to stop itself.
//
- Status = gBS->UninstallProtocolInterface (
+ Status = gBS->UninstallMultipleProtocolInterfaces (
Controller,
&gEfiBlockIoProtocolGuid,
- &UsbMass->BlockIo
+ &UsbMass->BlockIo,
+ &gEfiDiskInfoProtocolGuid,
+ &UsbMass->DiskInfo,
+ NULL
);
if (EFI_ERROR (Status)) {
return Status;
@@ -1068,6 +1081,8 @@ USBMassDriverBindingStop (
UsbMass->DevicePath,
&gEfiBlockIoProtocolGuid,
&UsbMass->BlockIo,
+ &gEfiDiskInfoProtocolGuid,
+ &UsbMass->DiskInfo,
NULL
);