1 /* SPDX-License-Identifier: GPL-2.0-or-later */
6 #include <linux/types.h>
8 #define TLMI_SETTINGS_COUNT 256
9 #define TLMI_SETTINGS_MAXLEN 512
10 #define TLMI_PWD_BUFSIZE 129
11 #define TLMI_LANG_MAXLEN 4
12 #define TLMI_INDEX_MAX 32
14 /* Possible error values */
15 struct tlmi_err_codes {
20 enum encoding_option {
22 TLMI_ENCODING_SCANCODE,
31 * There are a limit on the number of WMI operations you can do if you use
32 * the default implementation of saving on every set. This is due to a
33 * limitation in EFI variable space used.
34 * Have a 'bulk save' mode where you can manually trigger the save, and can
35 * therefore set unlimited variables - for users that need it.
43 /* password configuration details */
44 struct tlmi_pwdcfg_core {
45 uint32_t password_mode;
46 uint32_t password_state;
49 uint32_t supported_encodings;
50 uint32_t supported_keyboard;
53 struct tlmi_pwdcfg_ext {
54 uint32_t hdd_user_password;
55 uint32_t hdd_master_password;
56 uint32_t nvme_user_password;
57 uint32_t nvme_master_password;
61 struct tlmi_pwdcfg_core core;
62 struct tlmi_pwdcfg_ext ext;
65 /* password setting details */
66 struct tlmi_pwd_setting {
69 char password[TLMI_PWD_BUFSIZE];
74 enum encoding_option encoding;
75 char kbdlang[TLMI_LANG_MAXLEN];
76 int index; /*Used for HDD and NVME auth */
77 enum level_option level;
83 /* Attribute setting details */
84 struct tlmi_attr_setting {
87 char display_name[TLMI_SETTINGS_MAXLEN];
88 char *possible_values;
92 struct wmi_device *wmi_device;
94 bool can_set_bios_settings;
95 bool can_get_bios_selections;
96 bool can_set_bios_password;
97 bool can_get_password_settings;
101 bool certificate_support;
102 enum save_mode save_mode;
104 bool reboot_required;
106 struct tlmi_attr_setting *setting[TLMI_SETTINGS_COUNT];
107 struct device *class_dev;
108 struct kset *attribute_kset;
109 struct kset *authentication_kset;
111 struct tlmi_pwdcfg pwdcfg;
112 struct tlmi_pwd_setting *pwd_admin;
113 struct tlmi_pwd_setting *pwd_power;
114 struct tlmi_pwd_setting *pwd_system;
115 struct tlmi_pwd_setting *pwd_hdd;
116 struct tlmi_pwd_setting *pwd_nvme;
119 #endif /* !_THINK_LMI_H_ */