summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/nsxfeval.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/nsxfeval.c')
-rw-r--r--sys/contrib/dev/acpica/nsxfeval.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/sys/contrib/dev/acpica/nsxfeval.c b/sys/contrib/dev/acpica/nsxfeval.c
index 3e732b0..e779c44 100644
--- a/sys/contrib/dev/acpica/nsxfeval.c
+++ b/sys/contrib/dev/acpica/nsxfeval.c
@@ -2,7 +2,7 @@
*
* Module Name: nsxfeval - Public interfaces to the ACPI subsystem
* ACPI Object evaluation interfaces
- * $Revision: 7 $
+ * $Revision: 10 $
*
******************************************************************************/
@@ -542,16 +542,15 @@ AcpiNsGetDeviceCallback (
void *Context,
void **ReturnValue)
{
+ ACPI_GET_DEVICES_INFO *Info = Context;
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node;
UINT32 Flags;
ACPI_DEVICE_ID Hid;
- ACPI_DEVICE_ID Cid;
- ACPI_GET_DEVICES_INFO *Info;
+ ACPI_COMPATIBLE_ID_LIST *Cid;
+ ACPI_NATIVE_UINT i;
- Info = Context;
-
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
@@ -570,9 +569,8 @@ AcpiNsGetDeviceCallback (
return (AE_BAD_PARAMETER);
}
- /*
- * Run _STA to determine if device is present
- */
+ /* Run _STA to determine if device is present */
+
Status = AcpiUtExecute_STA (Node, &Flags);
if (ACPI_FAILURE (Status))
{
@@ -582,12 +580,12 @@ AcpiNsGetDeviceCallback (
if (!(Flags & 0x01))
{
/* Don't return at the device or children of the device if not there */
+
return (AE_CTRL_DEPTH);
}
- /*
- * Filter based on device HID & CID
- */
+ /* Filter based on device HID & CID */
+
if (Info->Hid != NULL)
{
Status = AcpiUtExecute_HID (Node, &Hid);
@@ -600,8 +598,10 @@ AcpiNsGetDeviceCallback (
return (AE_CTRL_DEPTH);
}
- if (ACPI_STRNCMP (Hid.Buffer, Info->Hid, sizeof (Hid.Buffer)) != 0)
+ if (ACPI_STRNCMP (Hid.Value, Info->Hid, sizeof (Hid.Value)) != 0)
{
+ /* Get the list of Compatible IDs */
+
Status = AcpiUtExecute_CID (Node, &Cid);
if (Status == AE_NOT_FOUND)
{
@@ -612,12 +612,18 @@ AcpiNsGetDeviceCallback (
return (AE_CTRL_DEPTH);
}
- /* TBD: Handle CID packages */
+ /* Walk the CID list */
- if (ACPI_STRNCMP (Cid.Buffer, Info->Hid, sizeof (Cid.Buffer)) != 0)
+ for (i = 0; i < Cid->Count; i++)
{
- return (AE_OK);
+ if (ACPI_STRNCMP (Cid->Id[i].Value, Info->Hid,
+ sizeof (ACPI_COMPATIBLE_ID)) != 0)
+ {
+ ACPI_MEM_FREE (Cid);
+ return (AE_OK);
+ }
}
+ ACPI_MEM_FREE (Cid);
}
}
@@ -641,8 +647,8 @@ AcpiNsGetDeviceCallback (
*
* DESCRIPTION: Performs a modified depth-first walk of the namespace tree,
* starting (and ending) at the object specified by StartHandle.
- * The UserFunction is called whenever an object that matches
- * the type parameter is found. If the user function returns
+ * The UserFunction is called whenever an object of type
+ * Device is found. If the user function returns
* a non-zero value, the search is terminated immediately and this
* value is returned to the caller.
*
OpenPOWER on IntegriCloud