drivers/platform/x86/lenovo/think-lmi.h

Source file repositories/reference/linux-study-clean/drivers/platform/x86/lenovo/think-lmi.h

File Facts

System
Linux kernel
Corpus path
drivers/platform/x86/lenovo/think-lmi.h
Extension
.h
Size
3219 bytes
Lines
141
Domain
Driver Families
Bucket
drivers/platform
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct tlmi_err_codes {
	const char *err_str;
	int err_code;
};

enum encoding_option {
	TLMI_ENCODING_ASCII,
	TLMI_ENCODING_SCANCODE,
};

enum level_option {
	TLMI_LEVEL_USER,
	TLMI_LEVEL_MASTER,
};

/*
 * There are a limit on the number of WMI operations you can do if you use
 * the default implementation of saving on every set. This is due to a
 * limitation in EFI variable space used.
 * Have a 'bulk save' mode where you can manually trigger the save, and can
 * therefore set unlimited variables - for users that need it.
 */
enum save_mode {
	TLMI_SAVE_SINGLE,
	TLMI_SAVE_BULK,
	TLMI_SAVE_SAVE,
};

/* GUIDs can differ between platforms */
struct tlmi_cert_guids {
	const char *thumbprint;
	const char *set_bios_setting;
	const char *save_bios_setting;
	const char *cert_to_password;
	const char *clear_bios_cert;
	const char *update_bios_cert;
	const char *set_bios_cert;
};

/* password configuration details */
#define TLMI_PWDCFG_MODE_LEGACY    0
#define TLMI_PWDCFG_MODE_PASSWORD  1
#define TLMI_PWDCFG_MODE_MULTICERT 3

struct tlmi_pwdcfg_core {
	uint32_t password_mode;
	uint32_t password_state;
	uint32_t min_length;
	uint32_t max_length;
	uint32_t supported_encodings;
	uint32_t supported_keyboard;
};

struct tlmi_pwdcfg_ext {
	uint32_t hdd_user_password;
	uint32_t hdd_master_password;
	uint32_t nvme_user_password;
	uint32_t nvme_master_password;
};

struct tlmi_pwdcfg {
	struct tlmi_pwdcfg_core core;
	struct tlmi_pwdcfg_ext ext;
};

/* password setting details */
struct tlmi_pwd_setting {
	struct kobject kobj;
	bool pwd_enabled;
	char password[TLMI_PWD_BUFSIZE];
	const char *pwd_type;
	const char *role;
	int minlen;
	int maxlen;
	enum encoding_option encoding;
	char kbdlang[TLMI_LANG_MAXLEN];
	int index; /*Used for HDD and NVME auth */
	enum level_option level;
	bool cert_installed;
	char *signature;
	char *save_signature;
};

/* Attribute setting details */
struct tlmi_attr_setting {
	struct kobject kobj;
	struct wmi_device *wdev;
	int index;
	char name[TLMI_SETTINGS_MAXLEN];
	char display_name[TLMI_SETTINGS_MAXLEN];

Annotation

Implementation Notes