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,
30 /* password configuration details */
31 struct tlmi_pwdcfg_core {
32 uint32_t password_mode;
33 uint32_t password_state;
36 uint32_t supported_encodings;
37 uint32_t supported_keyboard;
40 struct tlmi_pwdcfg_ext {
41 uint32_t hdd_user_password;
42 uint32_t hdd_master_password;
43 uint32_t nvme_user_password;
44 uint32_t nvme_master_password;
48 struct tlmi_pwdcfg_core core;
49 struct tlmi_pwdcfg_ext ext;
52 /* password setting details */
53 struct tlmi_pwd_setting {
56 char password[TLMI_PWD_BUFSIZE];
61 enum encoding_option encoding;
62 char kbdlang[TLMI_LANG_MAXLEN];
63 int index; /*Used for HDD and NVME auth */
64 enum level_option level;
70 /* Attribute setting details */
71 struct tlmi_attr_setting {
74 char display_name[TLMI_SETTINGS_MAXLEN];
75 char *possible_values;
79 struct wmi_device *wmi_device;
81 bool can_set_bios_settings;
82 bool can_get_bios_selections;
83 bool can_set_bios_password;
84 bool can_get_password_settings;
88 bool certificate_support;
90 struct tlmi_attr_setting *setting[TLMI_SETTINGS_COUNT];
91 struct device *class_dev;
92 struct kset *attribute_kset;
93 struct kset *authentication_kset;
95 struct tlmi_pwdcfg pwdcfg;
96 struct tlmi_pwd_setting *pwd_admin;
97 struct tlmi_pwd_setting *pwd_power;
98 struct tlmi_pwd_setting *pwd_system;
99 struct tlmi_pwd_setting *pwd_hdd;
100 struct tlmi_pwd_setting *pwd_nvme;
103 #endif /* !_THINK_LMI_H_ */