FreeBSD/sys/contrib/dev/acpica/components/hardware/hwpci.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiHwProcessPciList
 *
 * PARAMETERS:  PciId               - Initial values for the PCI ID. May be
 *                                    modified by this function.
 *              ListHead            - Device list created by
 *                                    AcpiHwBuildPciList
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Walk downward through the PCI device list, getting the device
 *              info for each, via the PCI configuration space and updating
 *              the PCI ID as necessary. Deletes the list during traversal.
 *
 ******************************************************************************/
AcpiHwProcessPciList
PARAMETERS:  PciId               - Initial values for the PCI ID. May be
modified by this function.
ListHead            - Device list created by
AcpiHwBuildPciList

Status

Walk downward through the PCI device list, getting the device
info for each, via the PCI configuration space and updating
the PCI ID as necessary. Deletes the list during traversal.
AcpiHwProcessPciList PARAMETERS : PciId - Initial values for the PCI ID . May be modified by this function . ListHead - Device list created by AcpiHwBuildPciList Status Walk downward through the PCI device list getting the device info for each via the PCI configuration space and updating the PCI ID as necessary . Deletes the list during traversal .
static ACPI_STATUS
AcpiHwProcessPciList (
    ACPI_PCI_ID             *PciId,
    ACPI_PCI_DEVICE         *ListHead)
{
    ACPI_STATUS             Status = AE_OK;
    ACPI_PCI_DEVICE         *Info;
    UINT16                  BusNumber;
    BOOLEAN                 IsBridge = TRUE;
    ACPI_FUNCTION_NAME (HwProcessPciList);
    ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
        "Input PciId:  Seg %4.4X Bus %4.4X Dev %4.4X Func %4.4X\n",
        PciId->Segment, PciId->Bus, PciId->Device, PciId->Function));
    BusNumber = PciId->Bus;
    Info = ListHead;
    while (Info)
    {
        Status = AcpiHwGetPciDeviceInfo (PciId, Info->Device,
            &BusNumber, &IsBridge);
        if (ACPI_FAILURE (Status))
        {
            return (Status);
        }
        Info = Info->Next;
    }
    ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
        "Output PciId: Seg %4.4X Bus %4.4X Dev %4.4X Func %4.4X "
        "Status %X BusNumber %X IsBridge %X\n",
        PciId->Segment, PciId->Bus, PciId->Device, PciId->Function,
        Status, BusNumber, IsBridge));
    return (AE_OK);
}
static ACPI_STATUS AcpiHwProcessPciList ( ACPI_PCI_ID * PciId , ACPI_PCI_DEVICE * ListHead ) { ACPI_STATUS Status = AE_OK ; ACPI_PCI_DEVICE * Info ; UINT16 BusNumber ; BOOLEAN IsBridge = TRUE ; ACPI_FUNCTION_NAME ( HwProcessPciList ) ; ACPI_DEBUG_PRINT ( ( ACPI_DB_OPREGION , " \n " , PciId -> Segment , PciId -> Bus , PciId -> Device , PciId -> Function ) ) ; BusNumber = PciId -> Bus ; Info = ListHead ; while ( Info ) { Status = AcpiHwGetPciDeviceInfo ( PciId , Info -> Device , & BusNumber , & IsBridge ) ; if ( ACPI_FAILURE ( Status ) ) { return ( Status ) ; } Info = Info -> Next ; } ACPI_DEBUG_PRINT ( ( ACPI_DB_OPREGION , " " " \n " , PciId -> Segment , PciId -> Bus , PciId -> Device , PciId -> Function , Status , BusNumber , IsBridge ) ) ; return ( AE_OK ) ; }
FUNCTION:    AcpiHwProcessPciList
 PARAMETERS:  PciId               - Initial values for the PCI ID.
FUNCTION : AcpiHwProcessPciList PARAMETERS : PciId - Initial values for the PCI ID .
/*
     * Descend down the namespace tree, collecting PCI device, function,
     * and bus numbers. BusNumber is only important for PCI bridges.
     * Algorithm: As we descend the tree, use the last valid PCI device,
     * function, and bus numbers that are discovered, and assign them
     * to the PCI ID for the target device.
     */