summaryrefslogtreecommitdiff
path: root/EdkModulePkg/Bus
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2006-12-20 09:21:41 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2006-12-20 09:21:41 +0000
commite53a7e1bc959e049fdc335dc1e45ba5b2085126c (patch)
tree80456691e8782473a7b1348da070d88604d4c9cd /EdkModulePkg/Bus
parentfa67a8b221e1312a1d1ac73416595e00c7f0b889 (diff)
downloadedk2-platforms-e53a7e1bc959e049fdc335dc1e45ba5b2085126c.tar.xz
Set 0xff to both bridge & non-bridge device in case of unknown device.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2123 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg/Bus')
-rw-r--r--EdkModulePkg/Bus/Pci/PciBus/Dxe/PciDeviceSupport.c58
1 files changed, 30 insertions, 28 deletions
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciDeviceSupport.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciDeviceSupport.c
index b1cee26c0a..df69078e77 100644
--- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciDeviceSupport.c
+++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciDeviceSupport.c
@@ -283,28 +283,29 @@ RegisterPciDevice (
Routine Description:
- This function is used to register the PCI device to the EFI,
- create a handle for this PCI device,then attach apporpriate protocols
- onto the handle.
+ This function registers the PCI IO device. It creates a handle for this PCI IO device
+ (if the handle does not exist), attaches appropriate protocols onto the handle, does
+ necessary initialization, and sets up parent/child relationship with its bus controller.
Arguments:
- Controller - An efi handle.
- PciIoDevice - A pointer to the PCI_IO_DEVICE.
- Handle - A pointer to a efi handle.
+ Controller - An EFI handle for the PCI bus controller.
+ PciIoDevice - A PCI_IO_DEVICE pointer to the PCI IO device to be registered.
+ Handle - A pointer to hold the EFI handle for the PCI IO device.
Returns:
- None
+ EFI_SUCCESS - The PCI device is successfully registered.
+ Others - An error occurred when registering the PCI device.
--*/
-// TODO: EFI_SUCCESS - add return value to function comment
{
EFI_STATUS Status;
VOID *PlatformOpRomBuffer;
UINTN PlatformOpRomSize;
UINT8 PciExpressCapRegOffset;
EFI_PCI_IO_PROTOCOL *PciIo;
+ UINT8 Data8;
//
// Install the pciio protocol, device path protocol
@@ -326,21 +327,22 @@ Returns:
//
PciExpressCapRegOffset = 0;
Status = LocateCapabilityRegBlock (
- PciIoDevice,
- EFI_PCI_CAPABILITY_ID_PCIEXP,
- &PciExpressCapRegOffset,
- NULL
- );
+ PciIoDevice,
+ EFI_PCI_CAPABILITY_ID_PCIEXP,
+ &PciExpressCapRegOffset,
+ NULL
+ );
if (!EFI_ERROR (Status)) {
PciIoDevice->IsPciExp = TRUE;
}
//
- // Force Interrupt line to zero for cards that come up randomly
+ // Force Interrupt line to "Unknown" or "No Connection"
//
PciIo = &(PciIoDevice->PciIo);
- PciIo->Pci.Write (PciIo, EfiPciIoWidthUint8, 0x3C, 1, &gAllZero);
-
+ Data8 = PCI_INT_LINE_UNKNOWN;
+ PciIo->Pci.Write (PciIo, EfiPciIoWidthUint8, 0x3C, 1, &Data8);
+
//
// Process Platform OpRom
//
@@ -348,11 +350,11 @@ Returns:
PciIoDevice->AllOpRomProcessed = TRUE;
Status = gPciPlatformProtocol->GetPciRom (
- gPciPlatformProtocol,
- PciIoDevice->Handle,
- &PlatformOpRomBuffer,
- &PlatformOpRomSize
- );
+ gPciPlatformProtocol,
+ PciIoDevice->Handle,
+ &PlatformOpRomBuffer,
+ &PlatformOpRomSize
+ );
if (!EFI_ERROR (Status)) {
@@ -382,13 +384,13 @@ Returns:
);
if (EFI_ERROR (Status)) {
gBS->UninstallMultipleProtocolInterfaces (
- &PciIoDevice->Handle,
- &gEfiDevicePathProtocolGuid,
- PciIoDevice->DevicePath,
- &gEfiPciIoProtocolGuid,
- &PciIoDevice->PciIo,
- NULL
- );
+ &PciIoDevice->Handle,
+ &gEfiDevicePathProtocolGuid,
+ PciIoDevice->DevicePath,
+ &gEfiPciIoProtocolGuid,
+ &PciIoDevice->PciIo,
+ NULL
+ );
return Status;
}