platform/x86: dell-smbios-wmi: introduce userspace interface
authorMario Limonciello <mario.limonciello@dell.com>
Wed, 1 Nov 2017 19:25:36 +0000 (14:25 -0500)
committerDarren Hart (VMware) <dvhart@infradead.org>
Fri, 3 Nov 2017 23:34:00 +0000 (16:34 -0700)
commitf2645fa317b8905b8934f06a0601d5b7fa66aba0
tree67e5c5b646383869298a60dd0c6b1e44c345399e
parent44b6b7661132b1b0e5fd3147ded66f1e4a817ca9
platform/x86: dell-smbios-wmi: introduce userspace interface

It's important for the driver to provide a R/W ioctl to ensure that
two competing userspace processes don't race to provide or read each
others data.

This userspace character device will be used to perform SMBIOS calls
from any applications.

It provides an ioctl that will allow passing the WMI calling
interface buffer between userspace and kernel space.

This character device is intended to deprecate the dcdbas kernel module
and the interface that it provides to userspace.

To perform an SMBIOS IOCTL call using the character device userspace will
perform a read() on the the character device.  The WMI bus will provide
a u64 variable containing the necessary size of the IOCTL buffer.

The API for interacting with this interface is defined in documentation
as well as the WMI uapi header provides the format of the structures.

Not all userspace requests will be accepted.  The dell-smbios filtering
functionality will be used to prevent access to certain tokens and calls.

All whitelisted commands and tokens are now shared out to userspace so
applications don't need to define them in their own headers.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Reviewed-by: Edward O'Callaghan <quasisec@google.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Documentation/ABI/testing/dell-smbios-wmi [new file with mode: 0644]
drivers/platform/x86/dell-smbios-wmi.c
drivers/platform/x86/dell-smbios.h
include/uapi/linux/wmi.h