src/add-ons/kernel/bus_managers/acpi/acpica/components/hardware/hwpci.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiHwDerivePciId
 *
 * PARAMETERS:  PciId               - Initial values for the PCI ID. May be
 *                                    modified by this function.
 *              RootPciDevice       - A handle to a PCI device object. This
 *                                    object must be a PCI Root Bridge having a
 *                                    _HID value of either PNP0A03 or PNP0A08
 *              PciRegion           - A handle to a PCI configuration space
 *                                    Operation Region being initialized
 *
 * RETURN:      Status
 *
 * DESCRIPTION: This function derives a full PCI ID for a PCI device,
 *              consisting of a Segment number, Bus number, Device number,
 *              and function code.
 *
 *              The PCI hardware dynamically configures PCI bus numbers
 *              depending on the bus topology discovered during system
 *              initialization. This function is invoked during configuration
 *              of a PCI_Config Operation Region in order to (possibly) update
 *              the Bus/Device/Function numbers in the PciId with the actual
 *              values as determined by the hardware and operating system
 *              configuration.
 *
 *              The PciId parameter is initially populated during the Operation
 *              Region initialization. This function is then called, and is
 *              will make any necessary modifications to the Bus, Device, or
 *              Function number PCI ID subfields as appropriate for the
 *              current hardware and OS configuration.
 *
 * NOTE:        Created 08/2010. Replaces the previous OSL AcpiOsDerivePciId
 *              interface since this feature is OS-independent. This module
 *              specifically avoids any use of recursion by building a local
 *              temporary device list.
 *
 ******************************************************************************/
AcpiHwDerivePciId
PARAMETERS:  PciId               - Initial values for the PCI ID. May be
modified by this function.
RootPciDevice       - A handle to a PCI device object. This
object must be a PCI Root Bridge having a
_HID value of either PNP0A03 or PNP0A08
PciRegion           - A handle to a PCI configuration space
Operation Region being initialized

Status

This function derives a full PCI ID for a PCI device,
consisting of a Segment number, Bus number, Device number,
and function code.

The PCI hardware dynamically configures PCI bus numbers
depending on the bus topology discovered during system
initialization. This function is invoked during configuration
of a PCI_Config Operation Region in order to (possibly) update
the Bus/Device/Function numbers in the PciId with the actual
values as determined by the hardware and operating system
configuration.

The PciId parameter is initially populated during the Operation
Region initialization. This function is then called, and is
will make any necessary modifications to the Bus, Device, or
Function number PCI ID subfields as appropriate for the
current hardware and OS configuration.


AcpiHwDerivePciId PARAMETERS : PciId - Initial values for the PCI ID . May be modified by this function . RootPciDevice - A handle to a PCI device object . This object must be a PCI Root Bridge having a _HID value of either PNP0A03 or PNP0A08 PciRegion - A handle to a PCI configuration space Operation Region being initialized Status This function derives a full PCI ID for a PCI device consisting of a Segment number Bus number Device number and function code . The PCI hardware dynamically configures PCI bus numbers depending on the bus topology discovered during system initialization . This function is invoked during configuration of a PCI_Config Operation Region in order to ( possibly ) update the Bus / Device / Function numbers in the PciId with the actual values as determined by the hardware and operating system configuration . The PciId parameter is initially populated during the Operation Region initialization . This function is then called and is will make any necessary modifications to the Bus Device or Function number PCI ID subfields as appropriate for the current hardware and OS configuration .
ACPI_STATUS
AcpiHwDerivePciId (
    ACPI_PCI_ID             *PciId,
    ACPI_HANDLE             RootPciDevice,
    ACPI_HANDLE             PciRegion)
{
    ACPI_STATUS             Status;
    ACPI_PCI_DEVICE         *ListHead;
    ACPI_FUNCTION_TRACE (HwDerivePciId);
    if (!PciId)
    {
        return_ACPI_STATUS (AE_BAD_PARAMETER);
    }
    Status = AcpiHwBuildPciList (RootPciDevice, PciRegion, &ListHead);
    if (ACPI_SUCCESS (Status))
    {
        Status = AcpiHwProcessPciList (PciId, ListHead);
        AcpiHwDeletePciList (ListHead);
    }
    return_ACPI_STATUS (Status);
}
ACPI_STATUS AcpiHwDerivePciId ( ACPI_PCI_ID * PciId , ACPI_HANDLE RootPciDevice , ACPI_HANDLE PciRegion ) { ACPI_STATUS Status ; ACPI_PCI_DEVICE * ListHead ; ACPI_FUNCTION_TRACE ( HwDerivePciId ) ; if ( ! PciId ) { return_ACPI_STATUS ( AE_BAD_PARAMETER ) ; } Status = AcpiHwBuildPciList ( RootPciDevice , PciRegion , & ListHead ) ; if ( ACPI_SUCCESS ( Status ) ) { Status = AcpiHwProcessPciList ( PciId , ListHead ) ; AcpiHwDeletePciList ( ListHead ) ; } return_ACPI_STATUS ( Status ) ; }
FUNCTION:    AcpiHwDerivePciId
 PARAMETERS:  PciId               - Initial values for the PCI ID.
FUNCTION : AcpiHwDerivePciId PARAMETERS : PciId - Initial values for the PCI ID .
/* Build a list of PCI devices, from PciRegion up to RootPciDevice */ /* Walk the list, updating the PCI device/function/bus numbers */ /* Delete the list */