FreeBSD/sys/contrib/dev/acpica/compiler/aslmaputils.c
/*******************************************************************************
 *
 * FUNCTION:    MpGetHidValue
 *
 * PARAMETERS:  DeviceNode          - Node for parent device
 *
 * RETURN:      An _HID string value. Automatically converts _HID integers
 *              to strings. Never NULL.
 *
 * DESCRIPTION: Extract _HID value from within a device scope. Does not
 *              actually execute a method, just gets the string or integer
 *              value for the _HID.
 *
 ******************************************************************************/
MpGetHidValue
PARAMETERS:  DeviceNode          - Node for parent device

An _HID string value. Automatically converts _HID integers
to strings. Never NULL.

Extract _HID value from within a device scope. Does not
actually execute a method, just gets the string or integer
value for the _HID.
MpGetHidValue PARAMETERS : DeviceNode - Node for parent device An _HID string value . Automatically converts _HID integers to strings . Never NULL . Extract _HID value from within a device scope . Does not actually execute a method just gets the string or integer value for the _HID .
char *
MpGetHidValue (
    ACPI_NAMESPACE_NODE     *DeviceNode)
{
    ACPI_NAMESPACE_NODE     *HidNode;
    char                    *HidString;
    ACPI_STATUS             Status;
    Status = AcpiNsGetNode (DeviceNode, METHOD_NAME__HID,
        ACPI_NS_NO_UPSEARCH, &HidNode);
    if (ACPI_FAILURE (Status))
    {
        goto ErrorExit;
    }
    if (!HidNode->Object)
    {
        return (MpGetHidFromParseTree (HidNode));
    }
    switch (HidNode->Type)
    {
    case ACPI_TYPE_STRING:
        return (HidNode->Object->String.Pointer);
    case ACPI_TYPE_INTEGER:
        HidString = UtStringCacheCalloc (ACPI_EISAID_STRING_SIZE);
        AcpiExEisaIdToString (HidString, HidNode->Object->Integer.Value);
        return (HidString);
    case ACPI_TYPE_METHOD:
        return ("-Method-");
    default:
        FlPrintFile (ASL_FILE_MAP_OUTPUT, "BAD HID TYPE: %u", HidNode->Type);
        break;
    }
ErrorExit:
    return ("-No HID-");
}
char * MpGetHidValue ( ACPI_NAMESPACE_NODE * DeviceNode ) { ACPI_NAMESPACE_NODE * HidNode ; char * HidString ; ACPI_STATUS Status ; Status = AcpiNsGetNode ( DeviceNode , METHOD_NAME__HID , ACPI_NS_NO_UPSEARCH , & HidNode ) ; if ( ACPI_FAILURE ( Status ) ) { goto ErrorExit ; } if ( ! HidNode -> Object ) { return ( MpGetHidFromParseTree ( HidNode ) ) ; } switch ( HidNode -> Type ) { case ACPI_TYPE_STRING : return ( HidNode -> Object -> String . Pointer ) ; case ACPI_TYPE_INTEGER : HidString = UtStringCacheCalloc ( ACPI_EISAID_STRING_SIZE ) ; AcpiExEisaIdToString ( HidString , HidNode -> Object -> Integer . Value ) ; return ( HidString ) ; case ACPI_TYPE_METHOD : return ( " " ) ; default : FlPrintFile ( ASL_FILE_MAP_OUTPUT , " " , HidNode -> Type ) ; break ; } ErrorExit : return ( " " ) ; }
FUNCTION:    MpGetHidValue
 PARAMETERS:  DeviceNode          - Node for parent device
FUNCTION : MpGetHidValue PARAMETERS : DeviceNode - Node for parent device
/* If only partial namespace, get the _HID from the parse tree */ /* Handle the different _HID flavors */ /* Convert EISAID to a string */