FreeBSD/sys/contrib/dev/acpica/components/events/evrgnini.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiEvIsPciRootBridge
 *
 * PARAMETERS:  Node            - Device node being examined
 *
 * RETURN:      TRUE if device is a PCI/PCI-Express Root Bridge
 *
 * DESCRIPTION: Determine if the input device represents a PCI Root Bridge by
 *              examining the _HID and _CID for the device.
 *
 ******************************************************************************/
AcpiEvIsPciRootBridge
PARAMETERS:  Node            - Device node being examined

TRUE if device is a PCI/PCI-Express Root Bridge

Determine if the input device represents a PCI Root Bridge by
examining the _HID and _CID for the device.
AcpiEvIsPciRootBridge PARAMETERS : Node - Device node being examined TRUE if device is a PCI / PCI - Express Root Bridge Determine if the input device represents a PCI Root Bridge by examining the _HID and _CID for the device .
static BOOLEAN
AcpiEvIsPciRootBridge (
    ACPI_NAMESPACE_NODE     *Node)
{
    ACPI_STATUS             Status;
    ACPI_PNP_DEVICE_ID      *Hid;
    ACPI_PNP_DEVICE_ID_LIST *Cid;
    UINT32                  i;
    BOOLEAN                 Match;
    Status = AcpiUtExecute_HID (Node, &Hid);
    if (ACPI_FAILURE (Status))
    {
        return (FALSE);
    }
    Match = AcpiUtIsPciRootBridge (Hid->String);
    ACPI_FREE (Hid);
    if (Match)
    {
        return (TRUE);
    }
    Status = AcpiUtExecute_CID (Node, &Cid);
    if (ACPI_FAILURE (Status))
    {
        return (FALSE);
    }
    for (i = 0; i < Cid->Count; i++)
    {
        if (AcpiUtIsPciRootBridge (Cid->Ids[i].String))
        {
            ACPI_FREE (Cid);
            return (TRUE);
        }
    }
    ACPI_FREE (Cid);
    return (FALSE);
}
static BOOLEAN AcpiEvIsPciRootBridge ( ACPI_NAMESPACE_NODE * Node ) { ACPI_STATUS Status ; ACPI_PNP_DEVICE_ID * Hid ; ACPI_PNP_DEVICE_ID_LIST * Cid ; UINT32 i ; BOOLEAN Match ; Status = AcpiUtExecute_HID ( Node , & Hid ) ; if ( ACPI_FAILURE ( Status ) ) { return ( FALSE ) ; } Match = AcpiUtIsPciRootBridge ( Hid -> String ) ; ACPI_FREE ( Hid ) ; if ( Match ) { return ( TRUE ) ; } Status = AcpiUtExecute_CID ( Node , & Cid ) ; if ( ACPI_FAILURE ( Status ) ) { return ( FALSE ) ; } for ( i = 0 ; i < Cid -> Count ; i ++ ) { if ( AcpiUtIsPciRootBridge ( Cid -> Ids [ i ] . String ) ) { ACPI_FREE ( Cid ) ; return ( TRUE ) ; } } ACPI_FREE ( Cid ) ; return ( FALSE ) ; }
FUNCTION:    AcpiEvIsPciRootBridge
 PARAMETERS:  Node            - Device node being examined
FUNCTION : AcpiEvIsPciRootBridge PARAMETERS : Node - Device node being examined
/* Get the _HID and check for a PCI Root Bridge */ /* The _HID did not match. Get the _CID and check for a PCI Root Bridge */ /* Check all _CIDs in the returned list */