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