drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c
Source file repositories/reference/linux-study-clean/drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/x86/hp/hp-bioscfg/passwdobj-attributes.c- Extension
.c- Size
- 15613 bytes
- Lines
- 547
- 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.
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
bioscfg.h
Detected Declarations
function clear_passwordsfunction hp_clear_all_credentialsfunction hp_get_password_instance_for_typefunction validate_password_inputfunction store_password_instancefunction current_password_storefunction new_password_storefunction role_showfunction mechanism_showfunction hp_alloc_password_datafunction hp_populate_password_elements_from_packagefunction hp_populate_password_package_datafunction hp_populate_password_elements_from_bufferfunction hp_populate_password_buffer_datafunction hp_exit_password_attributes
Annotated Snippet
switch (password_obj[elem].type) {
case ACPI_TYPE_STRING:
if (PREREQUISITES != elem && PSWD_ENCODINGS != elem) {
ret = hp_convert_hexstr_to_str(password_obj[elem].string.pointer,
password_obj[elem].string.length,
&str_value, &value_len);
if (ret)
continue;
}
break;
case ACPI_TYPE_INTEGER:
int_value = (u32)password_obj[elem].integer.value;
break;
default:
pr_warn("Unsupported object type [%d]\n", password_obj[elem].type);
continue;
}
/* Check that both expected and read object type match */
if (expected_password_types[eloc] != password_obj[elem].type) {
pr_err("Error expected type %d for elem %d, but got type %d instead\n",
expected_password_types[eloc], elem, password_obj[elem].type);
kfree(str_value);
return -EIO;
}
/* Assign appropriate element value to corresponding field*/
switch (eloc) {
case VALUE:
break;
case PATH:
strscpy(password_data->common.path, str_value);
break;
case IS_READONLY:
password_data->common.is_readonly = int_value;
break;
case DISPLAY_IN_UI:
password_data->common.display_in_ui = int_value;
break;
case REQUIRES_PHYSICAL_PRESENCE:
password_data->common.requires_physical_presence = int_value;
break;
case SEQUENCE:
password_data->common.sequence = int_value;
break;
case PREREQUISITES_SIZE:
if (int_value > MAX_PREREQUISITES_SIZE) {
pr_warn("Prerequisites size value exceeded the maximum number of elements supported or data may be malformed\n");
int_value = MAX_PREREQUISITES_SIZE;
}
password_data->common.prerequisites_size = int_value;
/* This step is needed to keep the expected
* element list pointing to the right obj[elem].type
* when the size is zero. PREREQUISITES
* object is omitted by BIOS when the size is
* zero.
*/
if (int_value == 0)
eloc++;
break;
case PREREQUISITES:
size = min_t(u32, password_data->common.prerequisites_size,
MAX_PREREQUISITES_SIZE);
for (reqs = 0; reqs < size; reqs++) {
if (elem + reqs >= password_obj_count) {
pr_err("Error elem-objects package is too small\n");
return -EINVAL;
}
ret = hp_convert_hexstr_to_str(password_obj[elem + reqs].string.pointer,
password_obj[elem + reqs].string.length,
&str_value, &value_len);
if (ret)
break;
strscpy(password_data->common.prerequisites[reqs], str_value);
kfree(str_value);
str_value = NULL;
}
break;
case SECURITY_LEVEL:
password_data->common.security_level = int_value;
break;
case PSWD_MIN_LENGTH:
password_data->min_password_length = int_value;
Annotation
- Immediate include surface: `bioscfg.h`.
- Detected declarations: `function clear_passwords`, `function hp_clear_all_credentials`, `function hp_get_password_instance_for_type`, `function validate_password_input`, `function store_password_instance`, `function current_password_store`, `function new_password_store`, `function role_show`, `function mechanism_show`, `function hp_alloc_password_data`.
- Atlas domain: Driver Families / drivers/platform.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.