Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ */
0002 /*
0003  * EFI Test driver Header
0004  *
0005  * Copyright(C) 2012-2016 Canonical Ltd.
0006  *
0007  */
0008 
0009 #ifndef _DRIVERS_FIRMWARE_EFI_TEST_H_
0010 #define _DRIVERS_FIRMWARE_EFI_TEST_H_
0011 
0012 #include <linux/efi.h>
0013 
0014 struct efi_getvariable {
0015     efi_char16_t    *variable_name;
0016     efi_guid_t  *vendor_guid;
0017     u32     *attributes;
0018     unsigned long   *data_size;
0019     void        *data;
0020     efi_status_t    *status;
0021 } __packed;
0022 
0023 struct efi_setvariable {
0024     efi_char16_t    *variable_name;
0025     efi_guid_t  *vendor_guid;
0026     u32     attributes;
0027     unsigned long   data_size;
0028     void        *data;
0029     efi_status_t    *status;
0030 } __packed;
0031 
0032 struct efi_getnextvariablename {
0033     unsigned long   *variable_name_size;
0034     efi_char16_t    *variable_name;
0035     efi_guid_t  *vendor_guid;
0036     efi_status_t    *status;
0037 } __packed;
0038 
0039 struct efi_queryvariableinfo {
0040     u32     attributes;
0041     u64     *maximum_variable_storage_size;
0042     u64     *remaining_variable_storage_size;
0043     u64     *maximum_variable_size;
0044     efi_status_t    *status;
0045 } __packed;
0046 
0047 struct efi_gettime {
0048     efi_time_t  *time;
0049     efi_time_cap_t  *capabilities;
0050     efi_status_t    *status;
0051 } __packed;
0052 
0053 struct efi_settime {
0054     efi_time_t  *time;
0055     efi_status_t    *status;
0056 } __packed;
0057 
0058 struct efi_getwakeuptime {
0059     efi_bool_t  *enabled;
0060     efi_bool_t  *pending;
0061     efi_time_t  *time;
0062     efi_status_t    *status;
0063 } __packed;
0064 
0065 struct efi_setwakeuptime {
0066     efi_bool_t  enabled;
0067     efi_time_t  *time;
0068     efi_status_t    *status;
0069 } __packed;
0070 
0071 struct efi_getnexthighmonotoniccount {
0072     u32     *high_count;
0073     efi_status_t    *status;
0074 } __packed;
0075 
0076 struct efi_querycapsulecapabilities {
0077     efi_capsule_header_t    **capsule_header_array;
0078     unsigned long       capsule_count;
0079     u64         *maximum_capsule_size;
0080     int         *reset_type;
0081     efi_status_t        *status;
0082 } __packed;
0083 
0084 struct efi_resetsystem {
0085     int         reset_type;
0086     efi_status_t        status;
0087     unsigned long       data_size;
0088     efi_char16_t        *data;
0089 } __packed;
0090 
0091 #define EFI_RUNTIME_GET_VARIABLE \
0092     _IOWR('p', 0x01, struct efi_getvariable)
0093 #define EFI_RUNTIME_SET_VARIABLE \
0094     _IOW('p', 0x02, struct efi_setvariable)
0095 
0096 #define EFI_RUNTIME_GET_TIME \
0097     _IOR('p', 0x03, struct efi_gettime)
0098 #define EFI_RUNTIME_SET_TIME \
0099     _IOW('p', 0x04, struct efi_settime)
0100 
0101 #define EFI_RUNTIME_GET_WAKETIME \
0102     _IOR('p', 0x05, struct efi_getwakeuptime)
0103 #define EFI_RUNTIME_SET_WAKETIME \
0104     _IOW('p', 0x06, struct efi_setwakeuptime)
0105 
0106 #define EFI_RUNTIME_GET_NEXTVARIABLENAME \
0107     _IOWR('p', 0x07, struct efi_getnextvariablename)
0108 
0109 #define EFI_RUNTIME_QUERY_VARIABLEINFO \
0110     _IOR('p', 0x08, struct efi_queryvariableinfo)
0111 
0112 #define EFI_RUNTIME_GET_NEXTHIGHMONOTONICCOUNT \
0113     _IOR('p', 0x09, struct efi_getnexthighmonotoniccount)
0114 
0115 #define EFI_RUNTIME_QUERY_CAPSULECAPABILITIES \
0116     _IOR('p', 0x0A, struct efi_querycapsulecapabilities)
0117 
0118 #define EFI_RUNTIME_RESET_SYSTEM \
0119     _IOW('p', 0x0B, struct efi_resetsystem)
0120 
0121 #define EFI_RUNTIME_GET_SUPPORTED_MASK \
0122     _IOR('p', 0x0C, unsigned int)
0123 
0124 #endif /* _DRIVERS_FIRMWARE_EFI_TEST_H_ */