wmi.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * User API methods for ACPI-WMI mapping driver
  3. *
  4. * Copyright (C) 2017 Dell, Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef _UAPI_LINUX_WMI_H
  11. #define _UAPI_LINUX_WMI_H
  12. #include <linux/ioctl.h>
  13. #include <linux/types.h>
  14. /* WMI bus will filter all WMI vendor driver requests through this IOC */
  15. #define WMI_IOC 'W'
  16. /* All ioctl requests through WMI should declare their size followed by
  17. * relevant data objects
  18. */
  19. struct wmi_ioctl_buffer {
  20. __u64 length;
  21. __u8 data[];
  22. };
  23. /* This structure may be modified by the firmware when we enter
  24. * system management mode through SMM, hence the volatiles
  25. */
  26. struct calling_interface_buffer {
  27. __u16 cmd_class;
  28. __u16 cmd_select;
  29. volatile __u32 input[4];
  30. volatile __u32 output[4];
  31. } __packed;
  32. struct dell_wmi_extensions {
  33. __u32 argattrib;
  34. __u32 blength;
  35. __u8 data[];
  36. } __packed;
  37. struct dell_wmi_smbios_buffer {
  38. __u64 length;
  39. struct calling_interface_buffer std;
  40. struct dell_wmi_extensions ext;
  41. } __packed;
  42. /* Whitelisted smbios class/select commands */
  43. #define CLASS_TOKEN_READ 0
  44. #define CLASS_TOKEN_WRITE 1
  45. #define SELECT_TOKEN_STD 0
  46. #define SELECT_TOKEN_BAT 1
  47. #define SELECT_TOKEN_AC 2
  48. #define CLASS_FLASH_INTERFACE 7
  49. #define SELECT_FLASH_INTERFACE 3
  50. #define CLASS_ADMIN_PROP 10
  51. #define SELECT_ADMIN_PROP 3
  52. #define CLASS_INFO 17
  53. #define SELECT_RFKILL 11
  54. #define SELECT_APP_REGISTRATION 3
  55. #define SELECT_DOCK 22
  56. /* whitelisted tokens */
  57. #define CAPSULE_EN_TOKEN 0x0461
  58. #define CAPSULE_DIS_TOKEN 0x0462
  59. #define WSMT_EN_TOKEN 0x04EC
  60. #define WSMT_DIS_TOKEN 0x04ED
  61. /* Dell SMBIOS calling IOCTL command used by dell-smbios-wmi */
  62. #define DELL_WMI_SMBIOS_CMD _IOWR(WMI_IOC, 0, struct dell_wmi_smbios_buffer)
  63. #endif