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