drivers/net/wireless/intel/iwlwifi/fw/uefi.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/fw/uefi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/fw/uefi.c- Extension
.c- Size
- 26018 bytes
- Lines
- 1052
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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
iwl-drv.hpnvm.hiwl-prph.hiwl-io.hfw/uefi.hfw/api/alive.hlinux/efi.hfw/runtime.h
Detected Declarations
struct iwl_uefi_pnvm_mem_descfunction iwl_uefi_get_verified_variable_guidfunction iwl_uefi_get_verified_variablefunction iwl_uefi_handle_tlv_mem_descfunction iwl_uefi_reduce_power_sectionfunction iwl_uefi_reduce_power_parsefunction iwl_uefi_step_parsefunction iwl_uefi_get_step_tablefunction iwl_uefi_sgom_parsefunction iwl_uefi_get_sgom_tablefunction iwl_uefi_uats_parsefunction iwl_uefi_get_uats_tablefunction iwl_uefi_get_uneb_tablefunction iwl_uefi_set_sar_profilefunction iwl_uefi_get_wrds_tablefunction iwl_uefi_get_ewrd_tablefunction iwl_uefi_get_wgds_tablefunction iwl_uefi_get_ppag_tablefunction ARRAY_SIZEfunction iwl_uefi_get_tas_tablefunction iwl_uefi_get_pwr_limitfunction iwl_uefi_get_mccfunction iwl_uefi_get_eckvfunction iwl_uefi_get_wbemfunction iwl_uefi_load_dsm_valuesfunction iwl_uefi_get_dsmfunction iwl_uefi_get_puncturingfunction iwl_uefi_get_dsbrfunction iwl_uefi_get_phy_filters
Annotated Snippet
struct iwl_uefi_pnvm_mem_desc {
__le32 addr;
__le32 size;
const u8 data[];
} __packed;
static void *iwl_uefi_get_variable(efi_char16_t *name, efi_guid_t *guid,
unsigned long *data_size)
{
efi_status_t status;
void *data;
if (!data_size)
return ERR_PTR(-EINVAL);
if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE))
return ERR_PTR(-ENODEV);
/* first call with NULL data to get the exact entry size */
*data_size = 0;
status = efi.get_variable(name, guid, NULL, data_size, NULL);
if (status != EFI_BUFFER_TOO_SMALL || !*data_size)
return ERR_PTR(-EIO);
data = kmalloc(*data_size, GFP_KERNEL);
if (!data)
return ERR_PTR(-ENOMEM);
status = efi.get_variable(name, guid, NULL, data_size, data);
if (status != EFI_SUCCESS) {
kfree(data);
return ERR_PTR(-ENOENT);
}
return data;
}
void *iwl_uefi_get_pnvm(struct iwl_trans *trans, size_t *len)
{
unsigned long package_size;
void *data;
*len = 0;
data = iwl_uefi_get_variable(IWL_UEFI_OEM_PNVM_NAME, &IWL_EFI_WIFI_GUID,
&package_size);
if (IS_ERR(data)) {
IWL_DEBUG_FW(trans,
"PNVM UEFI variable not found 0x%lx (len %lu)\n",
PTR_ERR(data), package_size);
return data;
}
IWL_DEBUG_FW(trans, "Read PNVM from UEFI with size %lu\n", package_size);
*len = package_size;
return data;
}
static void *
iwl_uefi_get_verified_variable_guid(struct iwl_trans *trans,
efi_guid_t *guid,
efi_char16_t *uefi_var_name,
char *var_name,
unsigned int expected_size,
unsigned long *size)
{
void *var;
unsigned long var_size;
var = iwl_uefi_get_variable(uefi_var_name, guid, &var_size);
if (IS_ERR(var)) {
IWL_DEBUG_RADIO(trans,
"%s UEFI variable not found 0x%lx\n", var_name,
PTR_ERR(var));
return var;
}
if (var_size < expected_size) {
IWL_DEBUG_RADIO(trans,
"Invalid %s UEFI variable len (%lu)\n",
var_name, var_size);
kfree(var);
return ERR_PTR(-EINVAL);
}
IWL_DEBUG_RADIO(trans, "%s from UEFI with size %lu\n", var_name,
var_size);
Annotation
- Immediate include surface: `iwl-drv.h`, `pnvm.h`, `iwl-prph.h`, `iwl-io.h`, `fw/uefi.h`, `fw/api/alive.h`, `linux/efi.h`, `fw/runtime.h`.
- Detected declarations: `struct iwl_uefi_pnvm_mem_desc`, `function iwl_uefi_get_verified_variable_guid`, `function iwl_uefi_get_verified_variable`, `function iwl_uefi_handle_tlv_mem_desc`, `function iwl_uefi_reduce_power_section`, `function iwl_uefi_reduce_power_parse`, `function iwl_uefi_step_parse`, `function iwl_uefi_get_step_table`, `function iwl_uefi_sgom_parse`, `function iwl_uefi_get_sgom_table`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.