/*++\r
\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
Module Name:\r
\r
PciDeviceSupport.c\r
- \r
+\r
Abstract:\r
\r
This file provides routine to support Pci device node manipulation\r
\r
Routine Description:\r
\r
- \r
+\r
Arguments:\r
\r
RootBridge - A pointer to the PCI_IO_DEVICE.\r
Routine Description:\r
\r
Destroy a pci device node.\r
- Also all direct or indirect allocated resource for this node will be freed. \r
+ Also all direct or indirect allocated resource for this node will be freed.\r
\r
Arguments:\r
\r
Routine Description:\r
\r
Destroy all device nodes under the root bridge\r
- specified by Controller. \r
+ specified by Controller.\r
The root bridge itself is also included.\r
\r
Arguments:\r
\r
Routine Description:\r
\r
- This function registers the PCI IO device. It creates a handle for this PCI IO device \r
+ This function registers the PCI IO device. It creates a handle for this PCI IO device\r
(if the handle does not exist), attaches appropriate protocols onto the handle, does\r
necessary initialization, and sets up parent/child relationship with its bus controller.\r
\r
if (!EFI_ERROR (Status)) {\r
PciIoDevice->IsPciExp = TRUE;\r
}\r
- \r
+\r
//\r
// Force Interrupt line to "Unknown" or "No Connection"\r
+ // based on the PCI spec, the Interrupt line for x86 should be set as 0xFF for unknown.\r
//\r
PciIo = &(PciIoDevice->PciIo);\r
+#ifndef MDE_CPU_IPF\r
Data8 = PCI_INT_LINE_UNKNOWN;\r
+#else\r
+ Data8 = 0;\r
+#endif\r
PciIo->Pci.Write (PciIo, EfiPciIoWidthUint8, 0x3C, 1, &Data8);\r
\r
//\r
Routine Description:\r
\r
This function is used to remove the whole PCI devices from the bridge.\r
- \r
+\r
Arguments:\r
\r
RootBridgeHandle - An efi handle.\r
if (Temp->Registered) {\r
DeRegisterPciDevice (RootBridgeHandle, Temp->Handle);\r
}\r
- \r
+\r
//\r
// Remove this node from the linked list\r
//\r
Routine Description:\r
\r
This function is used to de-register the PCI device from the EFI,\r
- That includes un-installing PciIo protocol from the specified PCI \r
+ That includes un-installing PciIo protocol from the specified PCI\r
device handle.\r
\r
Arguments:\r
);\r
return Status;\r
}\r
- \r
+\r
//\r
// The Device Driver should disable this device after disconnect\r
// so the Pci Bus driver will not touch this device any more.\r
\r
Node.DevPath = RemainingDevicePath;\r
\r
- if (Node.Pci->Device != Temp->DeviceNumber || \r
+ if (Node.Pci->Device != Temp->DeviceNumber ||\r
Node.Pci->Function != Temp->FunctionNumber) {\r
CurrentLink = CurrentLink->ForwardLink;\r
continue;\r
if (!Temp->Allocated) {\r
return EFI_NOT_READY;\r
}\r
- \r
+\r
//\r
// Check if the current node has been registered before\r
// If it is not, register it\r
ChildHandleBuffer[*NumberOfChildren] = Temp->Handle;\r
(*NumberOfChildren)++;\r
}\r
- \r
+\r
//\r
// Get the next device path\r
//\r
if (EfiIsDevicePathEnd (CurrentDevicePath)) {\r
return EFI_SUCCESS;\r
}\r
- \r
+\r
//\r
// If it is a PPB\r
//\r
Routine Description:\r
\r
Start to manage the PCI device according to RemainingDevicePath\r
- If RemainingDevicePath == NULL, the PCI bus driver will start \r
+ If RemainingDevicePath == NULL, the PCI bus driver will start\r
to manage all the PCI devices it found previously\r
\r
Arguments:\r
/*++\r
\r
Routine Description:\r
- \r
+\r
Arguments:\r
\r
Bridge - A pointer to the PCI_IO_DEVICE.\r
Arguments:\r
\r
VgaDevice - A pointer to the PCI_IO_DEVICE.\r
- \r
+\r
Returns:\r
\r
None\r
\r
Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink);\r
\r
- if (IS_PCI_VGA(&Temp->Pci) && \r
+ if (IS_PCI_VGA(&Temp->Pci) &&\r
(Temp->Attributes &\r
(EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY |\r
EFI_PCI_IO_ATTRIBUTE_VGA_IO |\r
PciRootBridgeIo - A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
HpcDevicePath - A pointer to the EFI_DEVICE_PATH_PROTOCL.\r
PciAddress - A pointer to the pci address.\r
- \r
+\r
Returns:\r
\r
None\r