Page MenuHomeFreeBSD

Add ACPI support for _CLS
ClosedPublic

Authored by andrew on Dec 6 2016, 5:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 17 2024, 4:10 PM
Unknown Object (File)
Feb 11 2024, 8:18 PM
Unknown Object (File)
Feb 9 2024, 10:06 AM
Unknown Object (File)
Jan 27 2024, 9:20 PM
Unknown Object (File)
Jan 10 2024, 3:29 PM
Unknown Object (File)
Dec 23 2023, 3:14 PM
Unknown Object (File)
Dec 21 2023, 11:36 PM
Unknown Object (File)
Dec 20 2023, 2:52 AM
Subscribers

Details

Summary

Add support to read the _CLS entry if it's present. It is used by
memory-mapped devices that are normally PCIe drives. Devices can then
use the existing pci_get_class, etc. accessors to query this data.

The ivar values are different enough from the existing ACPI and ISA
values to not conflict.

Diff Detail

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

Event Timeline

andrew retitled this revision from to Add ACPI support for _CLS.
andrew updated this object.
andrew edited the test plan for this revision. (Show Details)
andrew added reviewers: jhb, jkim.
andrew added a subscriber: emaste.

My only thought is if you want to read _CLS once during device enumeration and cache it's value in 'struct acpi_device' rather than invoking it for each ivar access. Aside from that this looks fine.

andrew edited edge metadata.

Read _CLS once

sys/dev/acpica/acpi.c
930 โ†—(On Diff #22851)

While this would seem useful, it's probably not in practice. Accessors like 'pci_get_class()' have no way to return an error. They always return whatever is in '*result' so the caller will just get garbage. I think it would be better to always return a value, but use specific invalid values for devices without _CLS (namely 0xff). You can do this by just setting acpi_cls_class to '0xffffff' when enumerating a device if _CLS isn't present or has an error and then having these bits of code return the acpi_cls_class value unconditionally.

sys/dev/acpica/acpivar.h
89 โ†—(On Diff #22851)

If you do the above suggestion you won't need this variable.

Return 0xff if _CLS is missing

jhb edited edge metadata.

I should have noticed earlier, but it would be nice to use the same 'ad_' prefix as the rest of the structure members, and you probably don't need a blank line between ad_flags and the new field.

This revision is now accepted and ready to land.Dec 15 2016, 8:43 PM
This revision was automatically updated to reflect the committed changes.