diff options
author | Conrad Meyer <cem@FreeBSD.org> | 2019-12-18 06:22:28 +0000 |
---|---|---|
committer | Vladimir Kondratyev <wulf@FreeBSD.org> | 2020-12-25 18:22:57 +0000 |
commit | 162b82dfa0cbc4a744f13559ac0574ae7dc9f663 (patch) | |
tree | a048e39b20dee0b2eda37891552edb7f5f21a5b8 | |
parent | 5e179af595cb206a4ded85b6290d8952f426f8a6 (diff) | |
download | src-162b82dfa0cbc4a744f13559ac0574ae7dc9f663.tar.gz src-162b82dfa0cbc4a744f13559ac0574ae7dc9f663.zip |
MFC r355876 (by cem):
acpi(4): Add _CID to PNP info string
While a given ACPI device may have 0-N compatibility IDs, in practice most
seem to have 0 or 1. If one is present, emit it as part of the PNP info
string associated with a device. This could enable MODULE_PNP_INFO-based
automatic kldload for ACPI drivers associated with a given _CID (but without
a good _HID or _UID identifier).
Reviewed by: imp, jhb
Differential Revision: https://reviews.freebsd.org/D22846
(cherry picked from commit 359a5f96a1685f6779e7ddbe5daafd67e73a066e)
-rw-r--r-- | sys/dev/acpica/acpi.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index a0b9a19f6090..6d7ed154c463 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -885,11 +885,14 @@ acpi_pnpinfo_str(ACPI_HANDLE handle, char *buf, size_t buflen) return (0); } - snprintf(buf, buflen, "_HID=%s _UID=%lu", + snprintf(buf, buflen, "_HID=%s _UID=%lu _CID=%s", (adinfo->Valid & ACPI_VALID_HID) ? adinfo->HardwareId.String : "none", (adinfo->Valid & ACPI_VALID_UID) ? - strtoul(adinfo->UniqueId.String, NULL, 10) : 0UL); + strtoul(adinfo->UniqueId.String, NULL, 10) : 0UL, + ((adinfo->Valid & ACPI_VALID_CID) && + adinfo->CompatibleIdList.Count > 0) ? + adinfo->CompatibleIdList.Ids[0].String : "none"); AcpiOsFree(adinfo); return (0); |