Commit 28db1862 authored by Luca Coelho's avatar Luca Coelho

iwlwifi: mvm: assign SAR table revision to the command later

The call to iwl_sar_geo_init() was moved to the end of the
iwl_mvm_sar_geo_init() function, after the table revision is assigned
to the FW command.  But the revision is only known after
iwl_sar_geo_init() is called, so we were always assigning zero to it.

Fix that by moving the assignment code after the iwl_sar_geo_init()
function is called.
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Fixes: 45acebf8 ("iwlwifi: fix sar geo table initialization")
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210210135352.cef55ef3a065.If96c60f08d24c2262c287168a6f0dbd7cf0f8f5c@changeidSigned-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 34b79fcf
...@@ -862,12 +862,10 @@ static int iwl_mvm_sar_geo_init(struct iwl_mvm *mvm) ...@@ -862,12 +862,10 @@ static int iwl_mvm_sar_geo_init(struct iwl_mvm *mvm)
if (cmd_ver == 3) { if (cmd_ver == 3) {
len = sizeof(cmd.v3); len = sizeof(cmd.v3);
n_bands = ARRAY_SIZE(cmd.v3.table[0]); n_bands = ARRAY_SIZE(cmd.v3.table[0]);
cmd.v3.table_revision = cpu_to_le32(mvm->fwrt.geo_rev);
} else if (fw_has_api(&mvm->fwrt.fw->ucode_capa, } else if (fw_has_api(&mvm->fwrt.fw->ucode_capa,
IWL_UCODE_TLV_API_SAR_TABLE_VER)) { IWL_UCODE_TLV_API_SAR_TABLE_VER)) {
len = sizeof(cmd.v2); len = sizeof(cmd.v2);
n_bands = ARRAY_SIZE(cmd.v2.table[0]); n_bands = ARRAY_SIZE(cmd.v2.table[0]);
cmd.v2.table_revision = cpu_to_le32(mvm->fwrt.geo_rev);
} else { } else {
len = sizeof(cmd.v1); len = sizeof(cmd.v1);
n_bands = ARRAY_SIZE(cmd.v1.table[0]); n_bands = ARRAY_SIZE(cmd.v1.table[0]);
...@@ -887,6 +885,16 @@ static int iwl_mvm_sar_geo_init(struct iwl_mvm *mvm) ...@@ -887,6 +885,16 @@ static int iwl_mvm_sar_geo_init(struct iwl_mvm *mvm)
if (ret) if (ret)
return 0; return 0;
/*
* Set the revision on versions that contain it.
* This must be done after calling iwl_sar_geo_init().
*/
if (cmd_ver == 3)
cmd.v3.table_revision = cpu_to_le32(mvm->fwrt.geo_rev);
else if (fw_has_api(&mvm->fwrt.fw->ucode_capa,
IWL_UCODE_TLV_API_SAR_TABLE_VER))
cmd.v2.table_revision = cpu_to_le32(mvm->fwrt.geo_rev);
return iwl_mvm_send_cmd_pdu(mvm, return iwl_mvm_send_cmd_pdu(mvm,
WIDE_ID(PHY_OPS_GROUP, GEO_TX_POWER_LIMIT), WIDE_ID(PHY_OPS_GROUP, GEO_TX_POWER_LIMIT),
0, len, &cmd); 0, len, &cmd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment