summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c
diff options
context:
space:
mode:
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>2024-01-31 10:24:39 +0200
committerJohannes Berg <johannes.berg@intel.com>2024-02-02 14:15:14 +0100
commit427661e4c48887ea2a226cd972e574ae7686fb95 (patch)
tree32fe77d9da95bfe2955a72650822521e6af8919a /drivers/net/wireless/intel/iwlwifi/fw/regulatory.c
parentc0a3dfc1ce955732ae8cd301a052f2277aa55436 (diff)
wifi: iwlwifi: read SAR tables from UEFI
All the regulatory tables will be read from UEFI, and only if it doesn't exist - they will be read from ACPI. Read SAR tables (WRDS, EWRD and WGDS) from UEFI. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Reviewed-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://msgid.link/20240131091413.533b687e1efb.Icb316291e593c8d53f41fdea2d083367dc97e3c4@changeid 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.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c b/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c
index 58290bf64f42..862d8b8b0fc9 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c
@@ -6,6 +6,23 @@
#include "iwl-debug.h"
#include "regulatory.h"
#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) \
+{ \
+ int ret = -ENOENT; \
+ if (fwrt->uefi_tables_lock_status > UEFI_WIFI_GUID_UNLOCKED) \
+ ret = iwl_uefi_get_ ## __name ## _table(fwrt); \
+ if (ret < 0) \
+ ret = iwl_acpi_get_ ## __name ## _table(fwrt); \
+ return ret; \
+} \
+IWL_EXPORT_SYMBOL(iwl_bios_get_ ## __name ## _table)
+
+IWL_BIOS_TABLE_LOADER(wrds);
+IWL_BIOS_TABLE_LOADER(ewrd);
+IWL_BIOS_TABLE_LOADER(wgds);
bool iwl_sar_geo_support(struct iwl_fw_runtime *fwrt)
{