mirror of https://github.com/acidanthera/audk.git
1. updated "the Bus Driver that creates all of its child handles on the first call to Start()" not to create any child handle if RemainingDeviepath is the End of Device Path Node, per UEFI 2.3.
The others changes include: a. Check RemainingDevicePath at beginning of Supported(), make sure it has been verified before Start() is called. b. Check IO protocol firstly rather than EfiDevicePathProtocolGuid, reduce the times entering into Start() function because EfiDevicePathProtocolGuid existed on most of handle. 2. roll back serial drivers not to create child device, if the device speicifed by remainingdevicepath cannot find in the created devices list. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9267 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
919df8e6d2
commit
9be2900668
|
@ -385,19 +385,10 @@ SerialControllerDriverStart (
|
|||
break;
|
||||
}
|
||||
}
|
||||
FreePool (OpenInfoBuffer);
|
||||
|
||||
if (Index < EntryCount) {
|
||||
//
|
||||
// If gEfiSerialIoProtocolGuid is opened by one child device, return
|
||||
//
|
||||
FreePool (OpenInfoBuffer);
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
// If gEfiSerialIoProtocolGuid is not opened by any child device,
|
||||
// go further to create child device handle based on RemainingDevicePath
|
||||
//
|
||||
}
|
||||
|
||||
if (RemainingDevicePath != NULL) {
|
||||
if (IsDevicePathEnd (RemainingDevicePath)) {
|
||||
|
|
|
@ -132,7 +132,19 @@ PciBusDriverBindingSupported (
|
|||
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;
|
||||
EFI_DEV_PATH_PTR Node;
|
||||
|
||||
//
|
||||
// Check RemainingDevicePath validation
|
||||
//
|
||||
if (RemainingDevicePath != NULL) {
|
||||
//
|
||||
// Check if RemainingDevicePath is the End of Device Path Node,
|
||||
// if yes, go on checking other conditions
|
||||
//
|
||||
if (!IsDevicePathEnd (RemainingDevicePath)) {
|
||||
//
|
||||
// If RemainingDevicePath isn't the End of Device Path Node,
|
||||
// check its validation
|
||||
//
|
||||
Node.DevPath = RemainingDevicePath;
|
||||
if (Node.DevPath->Type != HARDWARE_DEVICE_PATH ||
|
||||
Node.DevPath->SubType != HW_PCI_DP ||
|
||||
|
@ -140,32 +152,8 @@ PciBusDriverBindingSupported (
|
|||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
//
|
||||
// Open the IO Abstraction(s) needed to perform the supported test
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
Controller,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
(VOID **) &ParentDevicePath,
|
||||
This->DriverBindingHandle,
|
||||
Controller,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
);
|
||||
if (Status == EFI_ALREADY_STARTED) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
gBS->CloseProtocol (
|
||||
Controller,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Controller
|
||||
);
|
||||
|
||||
//
|
||||
// Check if Pci Root Bridge IO protocol is installed by platform
|
||||
//
|
||||
|
@ -185,6 +173,9 @@ PciBusDriverBindingSupported (
|
|||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Close the I/O Abstraction(s) used to perform the supported test
|
||||
//
|
||||
gBS->CloseProtocol (
|
||||
Controller,
|
||||
&gEfiPciRootBridgeIoProtocolGuid,
|
||||
|
@ -192,6 +183,35 @@ PciBusDriverBindingSupported (
|
|||
Controller
|
||||
);
|
||||
|
||||
//
|
||||
// Open the EFI Device Path protocol needed to perform the supported test
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
Controller,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
(VOID **) &ParentDevicePath,
|
||||
This->DriverBindingHandle,
|
||||
Controller,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
);
|
||||
if (Status == EFI_ALREADY_STARTED) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Close protocol, don't use device path protocol in the Support() function
|
||||
//
|
||||
gBS->CloseProtocol (
|
||||
Controller,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Controller
|
||||
);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -219,6 +239,19 @@ PciBusDriverBindingStart (
|
|||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
// Check RemainingDevicePath validation
|
||||
//
|
||||
if (RemainingDevicePath != NULL) {
|
||||
//
|
||||
// Check if RemainingDevicePath is the End of Device Path Node,
|
||||
// if yes, return EFI_SUCCESS
|
||||
//
|
||||
if (IsDevicePathEnd (RemainingDevicePath)) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiIncompatiblePciDeviceSupportProtocolGuid,
|
||||
NULL,
|
||||
|
|
|
@ -69,43 +69,28 @@ PartitionDriverBindingSupported (
|
|||
EFI_DISK_IO_PROTOCOL *DiskIo;
|
||||
EFI_DEV_PATH *Node;
|
||||
|
||||
//
|
||||
// Check RemainingDevicePath validation
|
||||
//
|
||||
if (RemainingDevicePath != NULL) {
|
||||
//
|
||||
// Check if RemainingDevicePath is the End of Device Path Node,
|
||||
// if yes, go on checking other conditions
|
||||
//
|
||||
if (!IsDevicePathEnd (RemainingDevicePath)) {
|
||||
//
|
||||
// If RemainingDevicePath isn't the End of Device Path Node,
|
||||
// check its validation
|
||||
//
|
||||
Node = (EFI_DEV_PATH *) RemainingDevicePath;
|
||||
if (Node->DevPath.Type != MEDIA_DEVICE_PATH ||
|
||||
Node->DevPath.SubType != MEDIA_HARDDRIVE_DP ||
|
||||
DevicePathNodeLength (&Node->DevPath) != sizeof (HARDDRIVE_DEVICE_PATH)
|
||||
) {
|
||||
DevicePathNodeLength (&Node->DevPath) != sizeof (HARDDRIVE_DEVICE_PATH)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
//
|
||||
// Open the IO Abstraction(s) needed to perform the supported test
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
(VOID **) &ParentDevicePath,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
);
|
||||
if (Status == EFI_ALREADY_STARTED) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
// Close the I/O Abstraction(s) used to perform the supported test
|
||||
//
|
||||
gBS->CloseProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle
|
||||
);
|
||||
|
||||
//
|
||||
// Open the IO Abstraction(s) needed to perform the supported test
|
||||
//
|
||||
|
@ -134,6 +119,35 @@ PartitionDriverBindingSupported (
|
|||
ControllerHandle
|
||||
);
|
||||
|
||||
//
|
||||
// Open the EFI Device Path protocol needed to perform the supported test
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
(VOID **) &ParentDevicePath,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
);
|
||||
if (Status == EFI_ALREADY_STARTED) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Close protocol, don't use device path protocol in the Support() function
|
||||
//
|
||||
gBS->CloseProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle
|
||||
);
|
||||
|
||||
//
|
||||
// Open the IO Abstraction(s) needed to perform the supported test
|
||||
//
|
||||
|
@ -181,6 +195,19 @@ PartitionDriverBindingStart (
|
|||
PARTITION_DETECT_ROUTINE *Routine;
|
||||
BOOLEAN MediaPresent;
|
||||
|
||||
//
|
||||
// Check RemainingDevicePath validation
|
||||
//
|
||||
if (RemainingDevicePath != NULL) {
|
||||
//
|
||||
// Check if RemainingDevicePath is the End of Device Path Node,
|
||||
// if yes, return EFI_SUCCESS
|
||||
//
|
||||
if (IsDevicePathEnd (RemainingDevicePath)) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiBlockIoProtocolGuid,
|
||||
|
|
|
@ -372,19 +372,10 @@ Returns:
|
|||
break;
|
||||
}
|
||||
}
|
||||
FreePool (OpenInfoBuffer);
|
||||
|
||||
if (Index < EntryCount) {
|
||||
//
|
||||
// If gEfiWinNtIoProtocolGuid is opened by one child device, return
|
||||
//
|
||||
FreePool (OpenInfoBuffer);
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
// If gEfiWinNtIoProtocolGuid is not opened by any child device,
|
||||
// go further to create child device handle based on RemainingDevicePath
|
||||
//
|
||||
}
|
||||
|
||||
if (RemainingDevicePath == NULL) {
|
||||
//
|
||||
|
|
|
@ -466,17 +466,8 @@ Returns:
|
|||
}
|
||||
|
||||
FreePool (OpenInfoBuffer);
|
||||
if (Index < EntryCount) {
|
||||
//
|
||||
// If gEfiUnixIoProtocolGuid is opened by one child device, return
|
||||
//
|
||||
return Status;
|
||||
}
|
||||
//
|
||||
// If gEfiUnixIoProtocolGuid is not opened by any child device,
|
||||
// go further to create child device handle based on RemainingDevicePath
|
||||
//
|
||||
}
|
||||
|
||||
if (RemainingDevicePath == NULL) {
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue