diff options
author | Tian Feng <feng.tian@intel.com> | 2015-06-16 01:03:50 +0000 |
---|---|---|
committer | erictian <erictian@Edk2> | 2015-06-16 01:03:50 +0000 |
commit | beeeb22cd5ca38444da3f11cdf83b38244ddee5c (patch) | |
tree | 142b25562d228b74fde401c71900868625d5d926 /MdeModulePkg | |
parent | 1463ce18ca7c4f971c08cc6341dbb0adb25c831a (diff) | |
download | edk2-platforms-beeeb22cd5ca38444da3f11cdf83b38244ddee5c.tar.xz |
MdeModulePkg/NvmExpressDxe: Open NVME_PASS_THRU with BY_CHILD attr
Open NVM_EXPRESS_PASS_THRU rather than PCI_IO to create parent-child
relationship.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tian Feng <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17636 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c index 99f89f1d45..d107d96387 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c @@ -213,8 +213,8 @@ EnumerateNvmeDevNamespace ( }
gBS->OpenProtocol (
Private->ControllerHandle,
- &gEfiPciIoProtocolGuid,
- (VOID **) &Private->PciIo,
+ &gEfiNvmExpressPassThruProtocolGuid,
+ (VOID **) &Private->Passthru,
Private->DriverBindingHandle,
Device->DeviceHandle,
EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
@@ -336,9 +336,9 @@ UnregisterNvmeNamespace ( )
{
EFI_STATUS Status;
- EFI_PCI_IO_PROTOCOL *PciIo;
EFI_BLOCK_IO_PROTOCOL *BlockIo;
NVME_DEVICE_PRIVATE_DATA *Device;
+ NVME_CONTROLLER_PRIVATE_DATA *Private;
BlockIo = NULL;
@@ -354,14 +354,15 @@ UnregisterNvmeNamespace ( return Status;
}
- Device = NVME_DEVICE_PRIVATE_DATA_FROM_BLOCK_IO (BlockIo);
+ Device = NVME_DEVICE_PRIVATE_DATA_FROM_BLOCK_IO (BlockIo);
+ Private = Device->Controller;
//
// Close the child handle
//
gBS->CloseProtocol (
Controller,
- &gEfiPciIoProtocolGuid,
+ &gEfiNvmExpressPassThruProtocolGuid,
This->DriverBindingHandle,
Handle
);
@@ -384,8 +385,8 @@ UnregisterNvmeNamespace ( if (EFI_ERROR (Status)) {
gBS->OpenProtocol (
Controller,
- &gEfiPciIoProtocolGuid,
- (VOID **) &PciIo,
+ &gEfiNvmExpressPassThruProtocolGuid,
+ (VOID **) &Private->Passthru,
This->DriverBindingHandle,
Handle,
EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
@@ -844,22 +845,24 @@ NvmExpressDriverBindingStop ( BOOLEAN AllChildrenStopped;
UINTN Index;
NVME_CONTROLLER_PRIVATE_DATA *Private;
+ EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *PassThru;
if (NumberOfChildren == 0) {
Status = gBS->OpenProtocol (
Controller,
- &gEfiCallerIdGuid,
- (VOID **) &Private,
+ &gEfiNvmExpressPassThruProtocolGuid,
+ (VOID **) &PassThru,
This->DriverBindingHandle,
Controller,
EFI_OPEN_PROTOCOL_GET_PROTOCOL
);
if (!EFI_ERROR (Status)) {
+ Private = NVME_CONTROLLER_PRIVATE_DATA_FROM_PASS_THRU (PassThru);
gBS->UninstallMultipleProtocolInterfaces (
Controller,
- &gEfiCallerIdGuid,
- Private,
+ &gEfiNvmExpressPassThruProtocolGuid,
+ PassThru,
NULL
);
@@ -940,7 +943,7 @@ NvmExpressUnload ( DeviceHandleBuffer = NULL;
Status = gBS->LocateHandleBuffer (
ByProtocol,
- &gEfiCallerIdGuid,
+ &gEfiNvmExpressPassThruProtocolGuid,
NULL,
&DeviceHandleCount,
&DeviceHandleBuffer
|