1271440Sjkim/******************************************************************************
2271440Sjkim *
3271440Sjkim * Module Name: ahuuids - Table of known ACPI-related UUIDs
4271440Sjkim *
5271440Sjkim *****************************************************************************/
6271440Sjkim
7271440Sjkim/*
8306536Sjkim * Copyright (C) 2000 - 2016, Intel Corp.
9271440Sjkim * All rights reserved.
10271440Sjkim *
11271440Sjkim * Redistribution and use in source and binary forms, with or without
12271440Sjkim * modification, are permitted provided that the following conditions
13271440Sjkim * are met:
14271440Sjkim * 1. Redistributions of source code must retain the above copyright
15271440Sjkim *    notice, this list of conditions, and the following disclaimer,
16271440Sjkim *    without modification.
17271440Sjkim * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18271440Sjkim *    substantially similar to the "NO WARRANTY" disclaimer below
19271440Sjkim *    ("Disclaimer") and any redistribution must be conditioned upon
20271440Sjkim *    including a substantially similar Disclaimer requirement for further
21271440Sjkim *    binary redistribution.
22271440Sjkim * 3. Neither the names of the above-listed copyright holders nor the names
23271440Sjkim *    of any contributors may be used to endorse or promote products derived
24271440Sjkim *    from this software without specific prior written permission.
25271440Sjkim *
26271440Sjkim * Alternatively, this software may be distributed under the terms of the
27271440Sjkim * GNU General Public License ("GPL") version 2 as published by the Free
28271440Sjkim * Software Foundation.
29271440Sjkim *
30271440Sjkim * NO WARRANTY
31271440Sjkim * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32271440Sjkim * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33271440Sjkim * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34271440Sjkim * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35271440Sjkim * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36271440Sjkim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37271440Sjkim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38271440Sjkim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39271440Sjkim * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40271440Sjkim * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41271440Sjkim * POSSIBILITY OF SUCH DAMAGES.
42271440Sjkim */
43271440Sjkim
44272444Sjkim#include <contrib/dev/acpica/include/acpi.h>
45272444Sjkim#include <contrib/dev/acpica/include/accommon.h>
46284460Sjkim#include <contrib/dev/acpica/include/acuuid.h>
47271440Sjkim
48271440Sjkim#define _COMPONENT          ACPI_UTILITIES
49271440Sjkim        ACPI_MODULE_NAME    ("ahuuids")
50271440Sjkim
51306536Sjkim
52271440Sjkim/*
53271440Sjkim * Table of "known" (ACPI-related) UUIDs
54271440Sjkim */
55271440Sjkimconst AH_UUID  AcpiUuids[] =
56271440Sjkim{
57284460Sjkim    {"[Controllers]",               NULL},
58284460Sjkim    {"GPIO Controller",             UUID_GPIO_CONTROLLER},
59284460Sjkim    {"USB Controller",              UUID_USB_CONTROLLER},
60284460Sjkim    {"SATA Controller",             UUID_SATA_CONTROLLER},
61271440Sjkim
62284460Sjkim    {"[Devices]",                   NULL},
63284460Sjkim    {"PCI Host Bridge Device",      UUID_PCI_HOST_BRIDGE},
64284460Sjkim    {"HID I2C Device",              UUID_I2C_DEVICE},
65284460Sjkim    {"Power Button Device",         UUID_POWER_BUTTON},
66271440Sjkim
67284460Sjkim    {"[Interfaces]",                NULL},
68284460Sjkim    {"Device Labeling Interface",   UUID_DEVICE_LABELING},
69284460Sjkim    {"Physical Presence Interface", UUID_PHYSICAL_PRESENCE},
70271440Sjkim
71284460Sjkim    {"[Non-volatile DIMM and NFIT table]",       NULL},
72284460Sjkim    {"Volatile Memory Region",      UUID_VOLATILE_MEMORY},
73284460Sjkim    {"Persistent Memory Region",    UUID_PERSISTENT_MEMORY},
74284460Sjkim    {"NVDIMM Control Region",       UUID_CONTROL_REGION},
75284460Sjkim    {"NVDIMM Data Region",          UUID_DATA_REGION},
76284460Sjkim    {"Volatile Virtual Disk",       UUID_VOLATILE_VIRTUAL_DISK},
77284460Sjkim    {"Volatile Virtual CD",         UUID_VOLATILE_VIRTUAL_CD},
78284460Sjkim    {"Persistent Virtual Disk",     UUID_PERSISTENT_VIRTUAL_DISK},
79284460Sjkim    {"Persistent Virtual CD",       UUID_PERSISTENT_VIRTUAL_CD},
80271440Sjkim
81284460Sjkim    {"[Miscellaneous]",             NULL},
82284460Sjkim    {"Platform-wide Capabilities",  UUID_PLATFORM_CAPABILITIES},
83284460Sjkim    {"Dynamic Enumeration",         UUID_DYNAMIC_ENUMERATION},
84284460Sjkim    {"Battery Thermal Limit",       UUID_BATTERY_THERMAL_LIMIT},
85284460Sjkim    {"Thermal Extensions",          UUID_THERMAL_EXTENSIONS},
86284460Sjkim    {"Device Properties for _DSD",  UUID_DEVICE_PROPERTIES},
87271440Sjkim
88271440Sjkim    {NULL, NULL}
89271440Sjkim};
90271440Sjkim
91271440Sjkim
92271440Sjkim/*******************************************************************************
93271440Sjkim *
94271440Sjkim * FUNCTION:    AcpiAhMatchUuid
95271440Sjkim *
96271440Sjkim * PARAMETERS:  Data                - Data buffer containing a UUID
97271440Sjkim *
98271440Sjkim * RETURN:      ASCII description string for the UUID if it is found.
99271440Sjkim *
100271440Sjkim * DESCRIPTION: Returns a description string for "known" UUIDs, which are
101271440Sjkim *              are UUIDs that are related to ACPI in some way.
102271440Sjkim *
103271440Sjkim ******************************************************************************/
104271440Sjkim
105271440Sjkimconst char *
106271440SjkimAcpiAhMatchUuid (
107271440Sjkim    UINT8                   *Data)
108271440Sjkim{
109271440Sjkim    const AH_UUID           *Info;
110271440Sjkim    UINT8                   UuidBuffer[UUID_BUFFER_LENGTH];
111271440Sjkim
112271440Sjkim
113271440Sjkim    /* Walk the table of known ACPI-related UUIDs */
114271440Sjkim
115271440Sjkim    for (Info = AcpiUuids; Info->Description; Info++)
116271440Sjkim    {
117284460Sjkim        /* Null string means desciption is a UUID class */
118284460Sjkim
119284460Sjkim        if (!Info->String)
120284460Sjkim        {
121284460Sjkim            continue;
122284460Sjkim        }
123284460Sjkim
124271440Sjkim        AcpiUtConvertStringToUuid (Info->String, UuidBuffer);
125271440Sjkim
126306536Sjkim        if (!memcmp (Data, UuidBuffer, UUID_BUFFER_LENGTH))
127271440Sjkim        {
128271440Sjkim            return (Info->Description);
129271440Sjkim        }
130271440Sjkim    }
131271440Sjkim
132271440Sjkim    return (NULL);
133271440Sjkim}
134