forked from mirrors/linux
		
	The Microsoft WMI documentation requires all data blocks to implement the Query Control Method (WQxx). If we encounter a data block not implementing this control method, issue a warning, and ignore the data block. Remove the "readable" attribute as all data blocks must be readable (query-able). Be consistent with the language in the documentation, replace the "writable" attribute with "setable". Simplify (flatten) the control flow of wmi_create_device a bit while we are updating it for the above changes. Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Mario Limonciello <mario_limonciello@dell.com> Cc: Pali Rohár <pali.rohar@gmail.com> Cc: linux-kernel@vger.kernel.org Cc: platform-driver-x86@vger.kernel.org Cc: linux-acpi@vger.kernel.org Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
		
			
				
	
	
		
			59 lines
		
	
	
	
		
			1.7 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			59 lines
		
	
	
	
		
			1.7 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
/*
 | 
						|
 * wmi.h - ACPI WMI interface
 | 
						|
 *
 | 
						|
 * Copyright (c) 2015 Andrew Lutomirski
 | 
						|
 *
 | 
						|
 * This program is free software; you can redistribute it and/or modify
 | 
						|
 * it under the terms of the GNU General Public License version 2 as
 | 
						|
 * published by the Free Software Foundation.
 | 
						|
 *
 | 
						|
 * This program is distributed in the hope that it will be useful, but
 | 
						|
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
						|
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
						|
 * General Public License for more details.
 | 
						|
 */
 | 
						|
 | 
						|
#ifndef _LINUX_WMI_H
 | 
						|
#define _LINUX_WMI_H
 | 
						|
 | 
						|
#include <linux/device.h>
 | 
						|
#include <linux/acpi.h>
 | 
						|
 | 
						|
struct wmi_device {
 | 
						|
	struct device dev;
 | 
						|
 | 
						|
	 /* True for data blocks implementing the Set Control Method */
 | 
						|
	bool setable;
 | 
						|
};
 | 
						|
 | 
						|
/* Caller must kfree the result. */
 | 
						|
extern union acpi_object *wmidev_block_query(struct wmi_device *wdev,
 | 
						|
					     u8 instance);
 | 
						|
 | 
						|
/* Gets another device on the same bus.  Caller must put_device the result. */
 | 
						|
extern struct wmi_device *wmidev_get_other_guid(struct wmi_device *wdev,
 | 
						|
						const char *guid_string);
 | 
						|
 | 
						|
struct wmi_device_id {
 | 
						|
	const char *guid_string;
 | 
						|
};
 | 
						|
 | 
						|
struct wmi_driver {
 | 
						|
	struct device_driver driver;
 | 
						|
	const struct wmi_device_id *id_table;
 | 
						|
 | 
						|
	int (*probe)(struct wmi_device *wdev);
 | 
						|
	int (*remove)(struct wmi_device *wdev);
 | 
						|
	void (*notify)(struct wmi_device *device, union acpi_object *data);
 | 
						|
};
 | 
						|
 | 
						|
extern int __must_check __wmi_driver_register(struct wmi_driver *driver,
 | 
						|
					      struct module *owner);
 | 
						|
extern void wmi_driver_unregister(struct wmi_driver *driver);
 | 
						|
#define wmi_driver_register(driver) __wmi_driver_register((driver), THIS_MODULE)
 | 
						|
 | 
						|
#define module_wmi_driver(__wmi_driver) \
 | 
						|
	module_driver(__wmi_driver, wmi_driver_register, \
 | 
						|
		      wmi_driver_unregister)
 | 
						|
 | 
						|
#endif
 |