mirror of https://github.com/acidanthera/audk.git
1. updated PCI/AGP Devices to check RemainingDevicePath in Supported() and Start() functions. The main changes are:
a. Add check validation of RemainingDevicePath in Supported() b. In Star() function, if RemaingDevicePath is the End of Device Path Node, don't create child device and return EFI_SUCCESS. 2. fixed one device path issue in ScsiBus driver. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9264 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
e7b2c17aad
commit
6fe852082f
|
@ -160,7 +160,7 @@ SCSIBusDriverBindingSupported (
|
|||
//
|
||||
if (Node->DevPath.Type != MESSAGING_DEVICE_PATH ||
|
||||
Node->DevPath.SubType != MSG_SCSI_DP ||
|
||||
DevicePathNodeLength(&Node->DevPath) != sizeof(ATAPI_DEVICE_PATH)) {
|
||||
DevicePathNodeLength(&Node->DevPath) != sizeof(SCSI_DEVICE_PATH)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
documentation on UGA for details on how to write a UGA driver that is able
|
||||
to function both in the EFI pre-boot environment and from the OS runtime.
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
Copyright (c) 2006 - 2009, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
|
@ -125,6 +125,7 @@ CirrusLogic5430ControllerDriverSupported (
|
|||
EFI_STATUS Status;
|
||||
EFI_PCI_IO_PROTOCOL *PciIo;
|
||||
PCI_TYPE00 Pci;
|
||||
EFI_DEV_PATH *Node;
|
||||
|
||||
//
|
||||
// Open the PCI I/O Protocol
|
||||
|
@ -168,16 +169,33 @@ CirrusLogic5430ControllerDriverSupported (
|
|||
//
|
||||
// See if this is a 5430 or a 5446 PCI controller
|
||||
//
|
||||
if (Pci.Hdr.DeviceId == CIRRUS_LOGIC_5430_DEVICE_ID) {
|
||||
Status = EFI_SUCCESS;
|
||||
}
|
||||
if (Pci.Hdr.DeviceId == CIRRUS_LOGIC_5430_DEVICE_ID ||
|
||||
Pci.Hdr.DeviceId == CIRRUS_LOGIC_5430_ALTERNATE_DEVICE_ID ||
|
||||
Pci.Hdr.DeviceId == CIRRUS_LOGIC_5446_DEVICE_ID) {
|
||||
|
||||
if (Pci.Hdr.DeviceId == CIRRUS_LOGIC_5430_ALTERNATE_DEVICE_ID) {
|
||||
Status = EFI_SUCCESS;
|
||||
}
|
||||
|
||||
if (Pci.Hdr.DeviceId == CIRRUS_LOGIC_5446_DEVICE_ID) {
|
||||
Status = EFI_SUCCESS;
|
||||
//
|
||||
// If this is an Intel 945 graphics controller,
|
||||
// go further check RemainingDevicePath validation
|
||||
//
|
||||
if (RemainingDevicePath != NULL) {
|
||||
Node = (EFI_DEV_PATH *) RemainingDevicePath;
|
||||
//
|
||||
// Check if RemainingDevicePath is the End of Device Path Node,
|
||||
// if yes, return EFI_SUCCESS
|
||||
//
|
||||
if (!IsDevicePathEnd (Node)) {
|
||||
//
|
||||
// If RemainingDevicePath isn't the End of Device Path Node,
|
||||
// check its validation
|
||||
//
|
||||
if (Node->DevPath.Type != ACPI_DEVICE_PATH ||
|
||||
Node->DevPath.SubType != ACPI_ADR_DP ||
|
||||
DevicePathNodeLength(&Node->DevPath) != sizeof(ACPI_ADR_DEVICE_PATH)) {
|
||||
Status = EFI_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -299,20 +317,32 @@ CirrusLogic5430ControllerDriverStart (
|
|||
ParentDevicePath,
|
||||
(EFI_DEVICE_PATH_PROTOCOL *) &AcpiDeviceNode
|
||||
);
|
||||
} else {
|
||||
} else if (!IsDevicePathEnd (RemainingDevicePath)) {
|
||||
//
|
||||
// If RemainingDevicePath isn't the End of Device Path Node,
|
||||
// only scan the specified device by RemainingDevicePath
|
||||
//
|
||||
Private->GopDevicePath = AppendDevicePathNode (ParentDevicePath, RemainingDevicePath);
|
||||
} else {
|
||||
//
|
||||
// If RemainingDevicePath is the End of Device Path Node,
|
||||
// don't create child device and return EFI_SUCCESS
|
||||
//
|
||||
Private->GopDevicePath = NULL;
|
||||
}
|
||||
|
||||
//
|
||||
// Creat child handle and device path protocol firstly
|
||||
//
|
||||
Private->Handle = NULL;
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&Private->Handle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
Private->GopDevicePath,
|
||||
NULL
|
||||
);
|
||||
if (Private->GopDevicePath != NULL) {
|
||||
//
|
||||
// Creat child handle and device path protocol firstly
|
||||
//
|
||||
Private->Handle = NULL;
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&Private->Handle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
Private->GopDevicePath,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -341,23 +371,31 @@ CirrusLogic5430ControllerDriverStart (
|
|||
);
|
||||
|
||||
} else if (FeaturePcdGet (PcdSupportGop)) {
|
||||
//
|
||||
// Start the GOP software stack.
|
||||
//
|
||||
Status = CirrusLogic5430GraphicsOutputConstructor (Private);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if (Private->GopDevicePath == NULL) {
|
||||
//
|
||||
// If RemainingDevicePath is the End of Device Path Node,
|
||||
// don't create child device and return EFI_SUCCESS
|
||||
//
|
||||
Status = EFI_SUCCESS;
|
||||
} else {
|
||||
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&Private->Handle,
|
||||
&gEfiGraphicsOutputProtocolGuid,
|
||||
&Private->GraphicsOutput,
|
||||
&gEfiEdidDiscoveredProtocolGuid,
|
||||
&Private->EdidDiscovered,
|
||||
&gEfiEdidActiveProtocolGuid,
|
||||
&Private->EdidActive,
|
||||
NULL
|
||||
);
|
||||
//
|
||||
// Start the GOP software stack.
|
||||
//
|
||||
Status = CirrusLogic5430GraphicsOutputConstructor (Private);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&Private->Handle,
|
||||
&gEfiGraphicsOutputProtocolGuid,
|
||||
&Private->GraphicsOutput,
|
||||
&gEfiEdidDiscoveredProtocolGuid,
|
||||
&Private->EdidDiscovered,
|
||||
&gEfiEdidActiveProtocolGuid,
|
||||
&Private->EdidActive,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
} else {
|
||||
//
|
||||
// This driver must support eithor GOP or UGA or both.
|
||||
|
|
Loading…
Reference in New Issue