Commit 551d793f authored by Luca Coelho's avatar Luca Coelho
Browse files

iwlwifi: mvm: store PPAG enabled/disabled flag properly



When reading the PPAG table from ACPI, we should store everything in
our fwrt structure, so it can be accessed later.  But we had a local
ppag_table variable in the function and were erroneously storing the
enabled/disabled flag in it instead of storing it in the fwrt.  Fix
this by removing the local variable and storing everything directly in
fwrt.

Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Fixes: f2134f66 ("iwlwifi: acpi: support ppag table command v2")
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210210135352.889862e6d393.I8b894c1b2b3fe0ad2fb39bf438273ea47eb5afa4@changeid


Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 5a684245
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -895,7 +895,6 @@ static int iwl_mvm_sar_geo_init(struct iwl_mvm *mvm)
static int iwl_mvm_get_ppag_table(struct iwl_mvm *mvm)
{
	union acpi_object *wifi_pkg, *data, *enabled;
	union iwl_ppag_table_cmd ppag_table;
	int i, j, ret, tbl_rev, num_sub_bands;
	int idx = 2;
	s8 *gain;
@@ -949,8 +948,8 @@ static int iwl_mvm_get_ppag_table(struct iwl_mvm *mvm)
		goto out_free;
	}

	ppag_table.v1.enabled = cpu_to_le32(enabled->integer.value);
	if (!ppag_table.v1.enabled) {
	mvm->fwrt.ppag_table.v1.enabled = cpu_to_le32(enabled->integer.value);
	if (!mvm->fwrt.ppag_table.v1.enabled) {
		ret = 0;
		goto out_free;
	}
@@ -978,7 +977,7 @@ static int iwl_mvm_get_ppag_table(struct iwl_mvm *mvm)
			    (j != 0 &&
			     (gain[i * num_sub_bands + j] > ACPI_PPAG_MAX_HB ||
			      gain[i * num_sub_bands + j] < ACPI_PPAG_MIN_HB))) {
				ppag_table.v1.enabled = cpu_to_le32(0);
				mvm->fwrt.ppag_table.v1.enabled = cpu_to_le32(0);
				ret = -EINVAL;
				goto out_free;
			}