aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
diff options
context:
space:
mode:
authorMiri Korenblit <[email protected]>2024-01-31 08:24:42 +0000
committerJohannes Berg <[email protected]>2024-02-02 13:15:15 +0000
commit8408e83e16bb4d1d8f0ccf6937cae0357478ec50 (patch)
tree5df4d643595df1cdc8d52bc60e0f9d80dcaa23a2 /drivers/net/wireless/intel/iwlwifi/fw/acpi.c
parentwifi: iwlwifi: prepare for reading PPAG table from UEFI (diff)
downloadkernel-8408e83e16bb4d1d8f0ccf6937cae0357478ec50.tar.gz
kernel-8408e83e16bb4d1d8f0ccf6937cae0357478ec50.zip
wifi: iwlwifi: validate PPAG table when sent to FW
We used to check enablement/validity of the PPAG table while reading it from BIOS. For newer FWs this checks were offloaded, and the driver needs to send the PPAG table anyway. The desicion whether the table needs to be validated before sending it is FW related and shouln't be in 'read-from-bios' flow. Move it to 'send-to-fw' flow instead. This will also help to avoid code duplication of checking validity in both ACPI and UEFI caes. Signed-off-by: Miri Korenblit <[email protected]> Reviewed-by: Gregory Greenman <[email protected]> Link: https://msgid.link/20240131091413.7043b4087dda.I5a189f9a349556b84a79597fe1e46ffa93664df9@changeid Signed-off-by: Johannes Berg <[email protected]>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/fw/acpi.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/fw/acpi.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
index 9b0ecfc087ab..b029e88501a1 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
@@ -896,9 +896,6 @@ int iwl_acpi_get_ppag_table(struct iwl_fw_runtime *fwrt)
union acpi_object *wifi_pkg, *data, *flags;
int i, j, ret, tbl_rev, num_sub_bands = 0;
int idx = 2;
- u8 cmd_ver;
-
- fwrt->ppag_table_valid = false;
data = iwl_acpi_get_object(fwrt->dev, ACPI_PPAG_METHOD);
if (IS_ERR(data))
@@ -945,18 +942,6 @@ read_table:
}
fwrt->ppag_flags = flags->integer.value & IWL_PPAG_ETSI_CHINA_MASK;
- cmd_ver = iwl_fw_lookup_cmd_ver(fwrt->fw,
- WIDE_ID(PHY_OPS_GROUP,
- PER_PLATFORM_ANT_GAIN_CMD),
- IWL_FW_CMD_VER_UNKNOWN);
- if (cmd_ver == IWL_FW_CMD_VER_UNKNOWN) {
- ret = -EINVAL;
- goto out_free;
- }
- if (!fwrt->ppag_flags && cmd_ver <= 3) {
- ret = 0;
- goto out_free;
- }
/*
* read, verify gain values and save them into the PPAG table.
@@ -974,22 +959,9 @@ read_table:
}
fwrt->ppag_chains[i].subbands[j] = ent->integer.value;
- /* from ver 4 the fw deals with out of range values */
- if (cmd_ver >= 4)
- continue;
- if ((j == 0 &&
- (fwrt->ppag_chains[i].subbands[j] > IWL_PPAG_MAX_LB ||
- fwrt->ppag_chains[i].subbands[j] < IWL_PPAG_MIN_LB)) ||
- (j != 0 &&
- (fwrt->ppag_chains[i].subbands[j] > IWL_PPAG_MAX_HB ||
- fwrt->ppag_chains[i].subbands[j] < IWL_PPAG_MIN_HB))) {
- ret = -EINVAL;
- goto out_free;
- }
}
}
- fwrt->ppag_table_valid = true;
ret = 0;
out_free: