Page MenuHomeFreeBSD

acpi(4): Add _CID to PNP info string
ClosedPublic

Authored by cem on Dec 17 2019, 3:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 13, 12:33 PM
Unknown Object (File)
Mon, Nov 4, 10:42 PM
Unknown Object (File)
Oct 5 2024, 6:59 PM
Unknown Object (File)
Sep 29 2024, 9:26 PM
Unknown Object (File)
Sep 27 2024, 11:50 AM
Unknown Object (File)
Sep 27 2024, 9:05 AM
Unknown Object (File)
Sep 23 2024, 9:42 PM
Unknown Object (File)
Sep 22 2024, 12:31 PM
Subscribers
None

Details

Summary

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).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I think just doing the first one is probably fine. You could also do a comma-separated list? A comma separated list would require using
something like strlcat perhaps, but that wouldn't be the worst thing.

In D22846#500393, @jhb wrote:

I think just doing the first one is probably fine. You could also do a comma-separated list? A comma separated list would require using
something like strlcat perhaps, but that wouldn't be the worst thing.

Devmatch isn't set up to match on comma-separated values, so I don't think there's much use in adding that at this time. I.e., if a device provided several CIDs, PNP info of "... _CID=foo,bar,baz", a MODULE_PNP_INFO("Z:_CID") match with a table including "foo", "bar", "baz" wouldn't match; only a table entry of "foo,bar,baz" would. Support for comma-separated values could definitely be added, but I would lean towards not doing so at this time.

(I'm also not to worried about just the first one — it seems like most devices have 0 or 1 _CIDs. When we find a device that needs matching on a 2nd _CID, we can implement that support.)

This revision is now accepted and ready to land.Dec 17 2019, 11:32 PM

I'll echo what jhb said...
And note that devmatch doesn't know CID and hid are the same namespace for auto loading. I'm unsure how to communicate that to devmatch.... that shouldn't block this commit though

This revision was automatically updated to reflect the committed changes.