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 ||
|
if (Node->DevPath.Type != MESSAGING_DEVICE_PATH ||
|
||||||
Node->DevPath.SubType != MSG_SCSI_DP ||
|
Node->DevPath.SubType != MSG_SCSI_DP ||
|
||||||
DevicePathNodeLength(&Node->DevPath) != sizeof(ATAPI_DEVICE_PATH)) {
|
DevicePathNodeLength(&Node->DevPath) != sizeof(SCSI_DEVICE_PATH)) {
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
documentation on UGA for details on how to write a UGA driver that is able
|
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.
|
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
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -125,6 +125,7 @@ CirrusLogic5430ControllerDriverSupported (
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
EFI_PCI_IO_PROTOCOL *PciIo;
|
EFI_PCI_IO_PROTOCOL *PciIo;
|
||||||
PCI_TYPE00 Pci;
|
PCI_TYPE00 Pci;
|
||||||
|
EFI_DEV_PATH *Node;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Open the PCI I/O Protocol
|
// Open the PCI I/O Protocol
|
||||||
|
@ -168,16 +169,33 @@ CirrusLogic5430ControllerDriverSupported (
|
||||||
//
|
//
|
||||||
// See if this is a 5430 or a 5446 PCI controller
|
// See if this is a 5430 or a 5446 PCI controller
|
||||||
//
|
//
|
||||||
if (Pci.Hdr.DeviceId == CIRRUS_LOGIC_5430_DEVICE_ID) {
|
if (Pci.Hdr.DeviceId == CIRRUS_LOGIC_5430_DEVICE_ID ||
|
||||||
Status = EFI_SUCCESS;
|
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;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Pci.Hdr.DeviceId == CIRRUS_LOGIC_5446_DEVICE_ID) {
|
|
||||||
Status = EFI_SUCCESS;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -299,10 +317,21 @@ CirrusLogic5430ControllerDriverStart (
|
||||||
ParentDevicePath,
|
ParentDevicePath,
|
||||||
(EFI_DEVICE_PATH_PROTOCOL *) &AcpiDeviceNode
|
(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);
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Private->GopDevicePath != NULL) {
|
||||||
//
|
//
|
||||||
// Creat child handle and device path protocol firstly
|
// Creat child handle and device path protocol firstly
|
||||||
//
|
//
|
||||||
|
@ -314,6 +343,7 @@ CirrusLogic5430ControllerDriverStart (
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Construct video mode buffer
|
// Construct video mode buffer
|
||||||
|
@ -341,6 +371,14 @@ CirrusLogic5430ControllerDriverStart (
|
||||||
);
|
);
|
||||||
|
|
||||||
} else if (FeaturePcdGet (PcdSupportGop)) {
|
} else if (FeaturePcdGet (PcdSupportGop)) {
|
||||||
|
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 {
|
||||||
|
|
||||||
//
|
//
|
||||||
// Start the GOP software stack.
|
// Start the GOP software stack.
|
||||||
//
|
//
|
||||||
|
@ -357,7 +395,7 @@ CirrusLogic5430ControllerDriverStart (
|
||||||
&Private->EdidActive,
|
&Private->EdidActive,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
// This driver must support eithor GOP or UGA or both.
|
// This driver must support eithor GOP or UGA or both.
|
||||||
|
|
Loading…
Reference in New Issue