~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/wmi.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * wmi.h - ACPI WMI interface
  4  *
  5  * Copyright (c) 2015 Andrew Lutomirski
  6  */
  7 
  8 #ifndef _LINUX_WMI_H
  9 #define _LINUX_WMI_H
 10 
 11 #include <linux/device.h>
 12 #include <linux/acpi.h>
 13 #include <linux/mod_devicetable.h>
 14 
 15 /**
 16  * struct wmi_device - WMI device structure
 17  * @dev: Device associated with this WMI device
 18  * @setable: True for devices implementing the Set Control Method
 19  * @driver_override: Driver name to force a match; do not set directly,
 20  *                   because core frees it; use driver_set_override() to
 21  *                   set or clear it.
 22  *
 23  * This represents WMI devices discovered by the WMI driver core.
 24  */
 25 struct wmi_device {
 26         struct device dev;
 27         bool setable;
 28         const char *driver_override;
 29 };
 30 
 31 /**
 32  * to_wmi_device() - Helper macro to cast a device to a wmi_device
 33  * @device: device struct
 34  *
 35  * Cast a struct device to a struct wmi_device.
 36  */
 37 #define to_wmi_device(device)   container_of(device, struct wmi_device, dev)
 38 
 39 extern acpi_status wmidev_evaluate_method(struct wmi_device *wdev,
 40                                           u8 instance, u32 method_id,
 41                                           const struct acpi_buffer *in,
 42                                           struct acpi_buffer *out);
 43 
 44 extern union acpi_object *wmidev_block_query(struct wmi_device *wdev,
 45                                              u8 instance);
 46 
 47 acpi_status wmidev_block_set(struct wmi_device *wdev, u8 instance, const struct acpi_buffer *in);
 48 
 49 u8 wmidev_instance_count(struct wmi_device *wdev);
 50 
 51 /**
 52  * struct wmi_driver - WMI driver structure
 53  * @driver: Driver model structure
 54  * @id_table: List of WMI GUIDs supported by this driver
 55  * @no_notify_data: Driver supports WMI events which provide no event data
 56  * @no_singleton: Driver can be instantiated multiple times
 57  * @probe: Callback for device binding
 58  * @remove: Callback for device unbinding
 59  * @notify: Callback for receiving WMI events
 60  *
 61  * This represents WMI drivers which handle WMI devices.
 62  */
 63 struct wmi_driver {
 64         struct device_driver driver;
 65         const struct wmi_device_id *id_table;
 66         bool no_notify_data;
 67         bool no_singleton;
 68 
 69         int (*probe)(struct wmi_device *wdev, const void *context);
 70         void (*remove)(struct wmi_device *wdev);
 71         void (*notify)(struct wmi_device *device, union acpi_object *data);
 72 };
 73 
 74 extern int __must_check __wmi_driver_register(struct wmi_driver *driver,
 75                                               struct module *owner);
 76 extern void wmi_driver_unregister(struct wmi_driver *driver);
 77 
 78 /**
 79  * wmi_driver_register() - Helper macro to register a WMI driver
 80  * @driver: wmi_driver struct
 81  *
 82  * Helper macro for registering a WMI driver. It automatically passes
 83  * THIS_MODULE to the underlying function.
 84  */
 85 #define wmi_driver_register(driver) __wmi_driver_register((driver), THIS_MODULE)
 86 
 87 /**
 88  * module_wmi_driver() - Helper macro to register/unregister a WMI driver
 89  * @__wmi_driver: wmi_driver struct
 90  *
 91  * Helper macro for WMI drivers which do not do anything special in module
 92  * init/exit. This eliminates a lot of boilerplate. Each module may only
 93  * use this macro once, and calling it replaces module_init() and module_exit().
 94  */
 95 #define module_wmi_driver(__wmi_driver) \
 96         module_driver(__wmi_driver, wmi_driver_register, \
 97                       wmi_driver_unregister)
 98 
 99 #endif
100 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php