Lines Matching refs:setting

338 static int tlmi_opcode_setting(char *setting, const char *value)  in tlmi_opcode_setting()  argument
343 opcode_str = kasprintf(GFP_KERNEL, "%s:%s;", setting, value); in tlmi_opcode_setting()
393 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in is_enabled_show() local
395 return sysfs_emit(buf, "%d\n", setting->valid); in is_enabled_show()
404 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in current_password_store() local
409 if (pwdlen && ((pwdlen < setting->minlen) || (pwdlen > setting->maxlen))) in current_password_store()
412 strscpy(setting->password, buf, setting->maxlen); in current_password_store()
414 strip_cr(setting->password); in current_password_store()
424 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in new_password_store() local
447 if (pwdlen && ((pwdlen < setting->minlen) || (pwdlen > setting->maxlen))) { in new_password_store()
457 if (setting == tlmi_priv.pwd_hdd) { in new_password_store()
458 if (setting->level == TLMI_LEVEL_USER) in new_password_store()
459 sprintf(pwd_type, "uhdp%d", setting->index); in new_password_store()
461 sprintf(pwd_type, "mhdp%d", setting->index); in new_password_store()
462 } else if (setting == tlmi_priv.pwd_nvme) { in new_password_store()
463 if (setting->level == TLMI_LEVEL_USER) in new_password_store()
464 sprintf(pwd_type, "udrp%d", setting->index); in new_password_store()
466 sprintf(pwd_type, "adrp%d", setting->index); in new_password_store()
468 sprintf(pwd_type, "%s", setting->pwd_type); in new_password_store()
481 ret = tlmi_opcode_setting("WmiOpcodePasswordCurrent01", setting->password); in new_password_store()
491 setting->pwd_type, setting->password, new_pwd, in new_password_store()
492 encoding_options[setting->encoding], setting->kbdlang); in new_password_store()
511 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in min_password_length_show() local
513 return sysfs_emit(buf, "%d\n", setting->minlen); in min_password_length_show()
521 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in max_password_length_show() local
523 return sysfs_emit(buf, "%d\n", setting->maxlen); in max_password_length_show()
537 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in encoding_show() local
539 return sysfs_emit(buf, "%s\n", encoding_options[setting->encoding]); in encoding_show()
546 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in encoding_store() local
554 setting->encoding = i; in encoding_store()
563 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in kbdlang_show() local
565 return sysfs_emit(buf, "%s\n", setting->kbdlang); in kbdlang_show()
572 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in kbdlang_store() local
580 memcpy(setting->kbdlang, buf, length); in kbdlang_store()
581 setting->kbdlang[length] = '\0'; in kbdlang_store()
590 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in role_show() local
592 return sysfs_emit(buf, "%s\n", setting->role); in role_show()
599 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in index_show() local
601 return sysfs_emit(buf, "%d\n", setting->index); in index_show()
608 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in index_store() local
618 setting->index = val; in index_store()
627 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in level_show() local
629 return sysfs_emit(buf, "%s\n", level_options[setting->level]); in level_show()
636 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in level_store() local
644 setting->level = i; in level_store()
678 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in certificate_thumbprint_show() local
681 if (!tlmi_priv.certificate_support || !setting->cert_installed) in certificate_thumbprint_show()
696 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in cert_to_password_store() local
706 if (!setting->cert_installed) in cert_to_password_store()
709 if (!setting->signature || !setting->signature[0]) in cert_to_password_store()
720 auth_str = kasprintf(GFP_KERNEL, "%s,%s", passwd, setting->signature); in cert_to_password_store()
738 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in certificate_store() local
752 if (!setting->signature || !setting->signature[0]) in certificate_store()
758 setting->signature); in certificate_store()
774 if (setting->cert_installed) { in certificate_store()
776 if (!setting->signature || !setting->signature[0]) { in certificate_store()
783 new_cert, setting->signature); in certificate_store()
786 if (!setting->valid || !setting->password[0]) { in certificate_store()
793 new_cert, setting->password); in certificate_store()
811 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in signature_store() local
828 kfree(setting->signature); in signature_store()
829 setting->signature = new_signature; in signature_store()
840 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in save_signature_store() local
857 kfree(setting->save_signature); in save_signature_store()
858 setting->save_signature = new_signature; in save_signature_store()
868 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in auth_attr_is_visible() local
872 if ((setting == tlmi_priv.pwd_hdd) || (setting == tlmi_priv.pwd_nvme)) in auth_attr_is_visible()
883 if ((setting == tlmi_priv.pwd_admin) && tlmi_priv.certificate_support) in auth_attr_is_visible()
925 struct tlmi_attr_setting *setting = to_tlmi_attr_setting(kobj); in display_name_show() local
927 return sysfs_emit(buf, "%s\n", setting->display_name); in display_name_show()
932 struct tlmi_attr_setting *setting = to_tlmi_attr_setting(kobj); in current_value_show() local
936 ret = tlmi_setting(setting->index, &item, LENOVO_BIOS_SETTING_GUID); in current_value_show()
957 struct tlmi_attr_setting *setting = to_tlmi_attr_setting(kobj); in possible_values_show() local
959 return sysfs_emit(buf, "%s\n", setting->possible_values); in possible_values_show()
965 struct tlmi_attr_setting *setting = to_tlmi_attr_setting(kobj); in type_show() local
967 if (setting->possible_values) { in type_show()
969 if (strchr(setting->possible_values, ';')) in type_show()
980 struct tlmi_attr_setting *setting = to_tlmi_attr_setting(kobj); in current_value_store() local
1004 set_str = kasprintf(GFP_KERNEL, "%s,%s,%s", setting->display_name, in current_value_store()
1025 set_str = kasprintf(GFP_KERNEL, "%s,%s;", setting->display_name, in current_value_store()
1057 set_str = kasprintf(GFP_KERNEL, "%s,%s,%s", setting->display_name, in current_value_store()
1060 set_str = kasprintf(GFP_KERNEL, "%s,%s;", setting->display_name, in current_value_store()
1100 struct tlmi_attr_setting *setting = to_tlmi_attr_setting(kobj); in attr_is_visible() local
1103 if ((attr == &attr_possible_values.attr) && (!setting->possible_values)) in attr_is_visible()
1124 struct tlmi_attr_setting *setting = to_tlmi_attr_setting(kobj); in tlmi_attr_setting_release() local
1126 kfree(setting->possible_values); in tlmi_attr_setting_release()
1127 kfree(setting); in tlmi_attr_setting_release()
1132 struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj); in tlmi_pwd_setting_release() local
1134 kfree(setting); in tlmi_pwd_setting_release()
1218 if (tlmi_priv.setting[i]) { in tlmi_release_attr()
1219 sysfs_remove_group(&tlmi_priv.setting[i]->kobj, &tlmi_attr_group); in tlmi_release_attr()
1220 kobject_put(&tlmi_priv.setting[i]->kobj); in tlmi_release_attr()
1293 if (!tlmi_priv.setting[i]) in tlmi_sysfs_init()
1298 tlmi_priv.setting[i]->display_name) < 0) { in tlmi_sysfs_init()
1299 kfree(tlmi_priv.setting[i]->possible_values); in tlmi_sysfs_init()
1300 kfree(tlmi_priv.setting[i]); in tlmi_sysfs_init()
1301 tlmi_priv.setting[i] = NULL; in tlmi_sysfs_init()
1306 tlmi_priv.setting[i]->kobj.kset = tlmi_priv.attribute_kset; in tlmi_sysfs_init()
1307 ret = kobject_add(&tlmi_priv.setting[i]->kobj, NULL, in tlmi_sysfs_init()
1308 "%s", tlmi_priv.setting[i]->display_name); in tlmi_sysfs_init()
1312 ret = sysfs_create_group(&tlmi_priv.setting[i]->kobj, &tlmi_attr_group); in tlmi_sysfs_init()
1448 struct tlmi_attr_setting *setting; in tlmi_analyze() local
1452 tlmi_priv.setting[i] = NULL; in tlmi_analyze()
1471 setting = kzalloc(sizeof(*setting), GFP_KERNEL); in tlmi_analyze()
1472 if (!setting) { in tlmi_analyze()
1477 setting->index = i; in tlmi_analyze()
1478 strscpy(setting->display_name, item, TLMI_SETTINGS_MAXLEN); in tlmi_analyze()
1481 ret = tlmi_get_bios_selections(setting->display_name, in tlmi_analyze()
1482 &setting->possible_values); in tlmi_analyze()
1483 if (ret || !setting->possible_values) in tlmi_analyze()
1485 i, setting->display_name); in tlmi_analyze()
1495 if (!tlmi_setting(setting->index, &optitem, LENOVO_BIOS_SETTING_GUID)) { in tlmi_analyze()
1501 setting->possible_values = in tlmi_analyze()
1512 if (setting->possible_values) in tlmi_analyze()
1513 strreplace(setting->possible_values, ',', ';'); in tlmi_analyze()
1515 kobject_init(&setting->kobj, &tlmi_attr_setting_ktype); in tlmi_analyze()
1516 tlmi_priv.setting[i] = setting; in tlmi_analyze()
1595 if (tlmi_priv.setting[i]) { in tlmi_analyze()
1596 kfree(tlmi_priv.setting[i]->possible_values); in tlmi_analyze()
1597 kfree(tlmi_priv.setting[i]); in tlmi_analyze()