aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/bus_if.m
diff options
context:
space:
mode:
authorKornel Duleba <mindal@semihalf.com>2022-01-28 09:28:37 +0000
committerMarcin Wojtas <mw@FreeBSD.org>2022-03-10 11:11:32 +0000
commitb344de4d0d163cbd8bf88cb5d226c18fe96f488f (patch)
treec1637f71d5b8566b9d3e9451d4eb0694958bac96 /sys/kern/bus_if.m
parent206dc82bc3fc5e1d90200e189ce5f2240dfec874 (diff)
downloadsrc-b344de4d0d163cbd8bf88cb5d226c18fe96f488f.tar.gz
src-b344de4d0d163cbd8bf88cb5d226c18fe96f488f.zip
Extend device_get_property API
In order to support various types of data stored in device tree properties or ACPI _DSD packages, create a new enum so the caller can specify the expected type of a property they want to read, according to the binding. The bus logic will use that information to process the underlying data. For example in DT all integer properties are stored in BE format. In order to get constant results across different platforms we need to convert its endianness to match the host. Another example are ACPI_TYPE_INTEGER properties stored as uint64_t. Before this patch the ACPI logic would refuse to read them if the provided buffer was smaller than 8 bytes. Now this can be handled by using DEVICE_PROP_UINT32 type. Modify the existing consumers of this API to reflect the changes and update the man pages accordingly. Reviewed by: mw Obtained from: Semihalf MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D33457
Diffstat (limited to 'sys/kern/bus_if.m')
-rw-r--r--sys/kern/bus_if.m1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/bus_if.m b/sys/kern/bus_if.m
index cf6470c220ef..1e4102e52d29 100644
--- a/sys/kern/bus_if.m
+++ b/sys/kern/bus_if.m
@@ -938,6 +938,7 @@ METHOD ssize_t get_property {
const char *_propname;
void *_propvalue;
size_t _size;
+ device_property_type_t type;
} DEFAULT bus_generic_get_property;
/**