diff options
| author | Miri Korenblit <[email protected]> | 2025-04-30 12:23:08 +0000 |
|---|---|---|
| committer | Miri Korenblit <[email protected]> | 2025-05-06 17:22:37 +0000 |
| commit | 200d89b4233fa0ac6e211597cb4935d794a2ca12 (patch) | |
| tree | 6b1d34ff3b0db553c84da7faafc65744e14c3899 /drivers/net/wireless/intel/iwlwifi/fw/uefi.c | |
| parent | wifi: iwlwifi: prepare for reading WPFC from UEFI (diff) | |
| download | kernel-200d89b4233fa0ac6e211597cb4935d794a2ca12.tar.gz kernel-200d89b4233fa0ac6e211597cb4935d794a2ca12.zip | |
wifi: iwlwifi: read WPFC also from UEFI
We are currently reading it only from ACPI, but we need to read it from
UEFI too (if exists, and if the UEFI variables are locked)
Add the reading from the UEFI and use IWL_BIOS_TABLE_LOADER to generate
the code that determines the source from which the table should be read
(ACPI/UEFI).
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://patch.msgid.link/20250430151952.839a5e7dd89b.I491acbf68047874df97b3971f1ba692ebc998a52@changeid
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/fw/uefi.c')
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/uefi.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/uefi.c b/drivers/net/wireless/intel/iwlwifi/fw/uefi.c index 386aadbce2a2..b0f4c217b2a5 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/uefi.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/uefi.c @@ -810,3 +810,31 @@ out: kfree(data); return ret; } + +int iwl_uefi_get_phy_filters(struct iwl_fw_runtime *fwrt) +{ + struct uefi_cnv_wpfc_data *data __free(kfree); + struct iwl_phy_specific_cfg *filters = &fwrt->phy_filters; + + data = iwl_uefi_get_verified_variable(fwrt->trans, IWL_UEFI_WPFC_NAME, + "WPFC", sizeof(*data), NULL); + if (IS_ERR(data)) + return -EINVAL; + + if (data->revision != 0) { + IWL_DEBUG_RADIO(fwrt, "Unsupported UEFI WPFC revision:%d\n", + data->revision); + return -EINVAL; + } + + BUILD_BUG_ON(ARRAY_SIZE(filters->filter_cfg_chains) != + ARRAY_SIZE(data->chains)); + + for (int i = 0; i < ARRAY_SIZE(filters->filter_cfg_chains); i++) { + filters->filter_cfg_chains[i] = cpu_to_le32(data->chains[i]); + IWL_DEBUG_RADIO(fwrt, "WPFC: chain %d: %u\n", i, data->chains[i]); + } + + IWL_DEBUG_RADIO(fwrt, "Loaded WPFC config from UEFI\n"); + return 0; +} |
