toshiba.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* toshiba.h -- Linux driver for accessing the SMM on Toshiba laptops
  2. *
  3. * Copyright (c) 1996-2000 Jonathan A. Buzzard (jonathan@buzzard.org.uk)
  4. * Copyright (c) 2015 Azael Avalos <coproscefalo@gmail.com>
  5. *
  6. * Thanks to Juergen Heinzl <juergen@monocerus.demon.co.uk> for the pointers
  7. * on making sure the structure is aligned and packed.
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the
  11. * Free Software Foundation; either version 2, or (at your option) any
  12. * later version.
  13. *
  14. * This program is distributed in the hope that it will be useful, but
  15. * WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. */
  20. #ifndef _UAPI_LINUX_TOSHIBA_H
  21. #define _UAPI_LINUX_TOSHIBA_H
  22. /*
  23. * Toshiba modules paths
  24. */
  25. #define TOSH_PROC "/proc/toshiba"
  26. #define TOSH_DEVICE "/dev/toshiba"
  27. #define TOSHIBA_ACPI_PROC "/proc/acpi/toshiba"
  28. #define TOSHIBA_ACPI_DEVICE "/dev/toshiba_acpi"
  29. /*
  30. * Toshiba SMM structure
  31. */
  32. typedef struct {
  33. unsigned int eax;
  34. unsigned int ebx __attribute__ ((packed));
  35. unsigned int ecx __attribute__ ((packed));
  36. unsigned int edx __attribute__ ((packed));
  37. unsigned int esi __attribute__ ((packed));
  38. unsigned int edi __attribute__ ((packed));
  39. } SMMRegisters;
  40. /*
  41. * IOCTLs (0x90 - 0x91)
  42. */
  43. #define TOSH_SMM _IOWR('t', 0x90, SMMRegisters)
  44. /*
  45. * Convenience toshiba_acpi command.
  46. *
  47. * The System Configuration Interface (SCI) is opened/closed internally
  48. * to avoid userspace of buggy BIOSes.
  49. *
  50. * The toshiba_acpi module checks whether the eax register is set with
  51. * SCI_GET (0xf300) or SCI_SET (0xf400), returning -EINVAL if not.
  52. */
  53. #define TOSHIBA_ACPI_SCI _IOWR('t', 0x91, SMMRegisters)
  54. #endif /* _UAPI_LINUX_TOSHIBA_H */