efi_test.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * EFI Test driver Header
  4. *
  5. * Copyright(C) 2012-2016 Canonical Ltd.
  6. *
  7. */
  8. #ifndef _DRIVERS_FIRMWARE_EFI_TEST_H_
  9. #define _DRIVERS_FIRMWARE_EFI_TEST_H_
  10. #include <linux/efi.h>
  11. struct efi_getvariable {
  12. efi_char16_t *variable_name;
  13. efi_guid_t *vendor_guid;
  14. u32 *attributes;
  15. unsigned long *data_size;
  16. void *data;
  17. efi_status_t *status;
  18. } __packed;
  19. struct efi_setvariable {
  20. efi_char16_t *variable_name;
  21. efi_guid_t *vendor_guid;
  22. u32 attributes;
  23. unsigned long data_size;
  24. void *data;
  25. efi_status_t *status;
  26. } __packed;
  27. struct efi_getnextvariablename {
  28. unsigned long *variable_name_size;
  29. efi_char16_t *variable_name;
  30. efi_guid_t *vendor_guid;
  31. efi_status_t *status;
  32. } __packed;
  33. struct efi_queryvariableinfo {
  34. u32 attributes;
  35. u64 *maximum_variable_storage_size;
  36. u64 *remaining_variable_storage_size;
  37. u64 *maximum_variable_size;
  38. efi_status_t *status;
  39. } __packed;
  40. struct efi_gettime {
  41. efi_time_t *time;
  42. efi_time_cap_t *capabilities;
  43. efi_status_t *status;
  44. } __packed;
  45. struct efi_settime {
  46. efi_time_t *time;
  47. efi_status_t *status;
  48. } __packed;
  49. struct efi_getwakeuptime {
  50. efi_bool_t *enabled;
  51. efi_bool_t *pending;
  52. efi_time_t *time;
  53. efi_status_t *status;
  54. } __packed;
  55. struct efi_setwakeuptime {
  56. efi_bool_t enabled;
  57. efi_time_t *time;
  58. efi_status_t *status;
  59. } __packed;
  60. struct efi_getnexthighmonotoniccount {
  61. u32 *high_count;
  62. efi_status_t *status;
  63. } __packed;
  64. struct efi_querycapsulecapabilities {
  65. efi_capsule_header_t **capsule_header_array;
  66. unsigned long capsule_count;
  67. u64 *maximum_capsule_size;
  68. int *reset_type;
  69. efi_status_t *status;
  70. } __packed;
  71. #define EFI_RUNTIME_GET_VARIABLE \
  72. _IOWR('p', 0x01, struct efi_getvariable)
  73. #define EFI_RUNTIME_SET_VARIABLE \
  74. _IOW('p', 0x02, struct efi_setvariable)
  75. #define EFI_RUNTIME_GET_TIME \
  76. _IOR('p', 0x03, struct efi_gettime)
  77. #define EFI_RUNTIME_SET_TIME \
  78. _IOW('p', 0x04, struct efi_settime)
  79. #define EFI_RUNTIME_GET_WAKETIME \
  80. _IOR('p', 0x05, struct efi_getwakeuptime)
  81. #define EFI_RUNTIME_SET_WAKETIME \
  82. _IOW('p', 0x06, struct efi_setwakeuptime)
  83. #define EFI_RUNTIME_GET_NEXTVARIABLENAME \
  84. _IOWR('p', 0x07, struct efi_getnextvariablename)
  85. #define EFI_RUNTIME_QUERY_VARIABLEINFO \
  86. _IOR('p', 0x08, struct efi_queryvariableinfo)
  87. #define EFI_RUNTIME_GET_NEXTHIGHMONOTONICCOUNT \
  88. _IOR('p', 0x09, struct efi_getnexthighmonotoniccount)
  89. #define EFI_RUNTIME_QUERY_CAPSULECAPABILITIES \
  90. _IOR('p', 0x0A, struct efi_querycapsulecapabilities)
  91. #endif /* _DRIVERS_FIRMWARE_EFI_TEST_H_ */