diff options
author | Miri Korenblit <miriam.rachel.korenblit@intel.com> | 2024-01-31 10:24:47 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2024-02-02 14:20:26 +0100 |
commit | 084e0452a42b1d4ccde601cc1873a4ee9d8a4cbb (patch) | |
tree | 0f50ad4c5a85c029526d020b01a179fc1f2fb550 /drivers/net/wireless/intel/iwlwifi/fw/regulatory.c | |
parent | 3bc67e7c18cd69e88b801336cfe2a4dc7b4981a4 (diff) |
wifi: iwlwifi: read WTAS table from UEFI
Try to read the WTAS table from UEFI first,
and if the WIFI UEFI tables are unlocked or the
table doesn't exist - try to read it from ACPI.
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240131091413.45e6ff7b5063.Id3aec70887e14533b10d564f32c0cf5f2a14b792@changeid
[move uefi_tables_lock_status outside ifdef to fix build errors]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/fw/regulatory.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/regulatory.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c b/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c index 20154b0fb7e6..4cf22e280dfc 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c @@ -9,22 +9,32 @@ #include "fw/runtime.h" #include "fw/uefi.h" -#define IWL_BIOS_TABLE_LOADER(__name) \ -int iwl_bios_get_ ## __name ## _table(struct iwl_fw_runtime *fwrt) \ -{ \ +#define GET_BIOS_TABLE(__name, ...) \ +do { \ int ret = -ENOENT; \ if (fwrt->uefi_tables_lock_status > UEFI_WIFI_GUID_UNLOCKED) \ - ret = iwl_uefi_get_ ## __name ## _table(fwrt); \ + ret = iwl_uefi_get_ ## __name(__VA_ARGS__); \ if (ret < 0) \ - ret = iwl_acpi_get_ ## __name ## _table(fwrt); \ + ret = iwl_acpi_get_ ## __name(__VA_ARGS__); \ return ret; \ -} \ -IWL_EXPORT_SYMBOL(iwl_bios_get_ ## __name ## _table) +} while (0) -IWL_BIOS_TABLE_LOADER(wrds); -IWL_BIOS_TABLE_LOADER(ewrd); -IWL_BIOS_TABLE_LOADER(wgds); -IWL_BIOS_TABLE_LOADER(ppag); +#define IWL_BIOS_TABLE_LOADER(__name) \ +int iwl_bios_get_ ## __name(struct iwl_fw_runtime *fwrt) \ +{GET_BIOS_TABLE(__name, fwrt); } \ +IWL_EXPORT_SYMBOL(iwl_bios_get_ ## __name) + +#define IWL_BIOS_TABLE_LOADER_DATA(__name, data_type) \ +int iwl_bios_get_ ## __name(struct iwl_fw_runtime *fwrt, \ + data_type * data) \ +{GET_BIOS_TABLE(__name, fwrt, data); } \ +IWL_EXPORT_SYMBOL(iwl_bios_get_ ## __name) + +IWL_BIOS_TABLE_LOADER(wrds_table); +IWL_BIOS_TABLE_LOADER(ewrd_table); +IWL_BIOS_TABLE_LOADER(wgds_table); +IWL_BIOS_TABLE_LOADER(ppag_table); +IWL_BIOS_TABLE_LOADER_DATA(tas_table, struct iwl_tas_data); static const struct dmi_system_id dmi_ppag_approved_list[] = { { .ident = "HP", |