diff options
author | Luca Coelho <luciano.coelho@intel.com> | 2019-11-06 09:27:51 +0200 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2020-03-27 08:12:49 +0200 |
commit | 095650c0541e1898751a25073f1a57cfd309f7eb (patch) | |
tree | eb69e20d184492a514abb56ee541a34f4ee736d4 /drivers/net/wireless/intel/iwlwifi/mvm/fw.c | |
parent | 6815e3d0bbee886dfd13bba485066ff830ed7f14 (diff) |
iwlwifi: add support for version 2 of SOC_CONFIGURATION_CMD
This new command is mostly backwards compatible, with the exception
that the device_type element was changed into a bitmask. The device
type bit remains the same (because we only had 0 and 1 anyway), but
when using v1 we can't set any other bits, because that would change
the integer.
Other than that, the struct remains the same and the driver can set
the device_type bit in both cases, but it can only set the low_latency
bit if VER_2 is used.
Change-Id: Ib68d4c821ebcce253b42ed0ea15881fb4e3e01da
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/fw.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c index 98978a475d93..bc040e9ca55f 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c @@ -90,13 +90,24 @@ struct iwl_mvm_alive_data { /* set device type and latency */ static int iwl_set_soc_latency(struct iwl_mvm *mvm) { - struct iwl_soc_configuration_cmd cmd; + struct iwl_soc_configuration_cmd cmd = {}; int ret; - cmd.device_type = (mvm->trans->trans_cfg->integrated) ? - cpu_to_le32(SOC_CONFIG_CMD_INTEGRATED) : - cpu_to_le32(SOC_CONFIG_CMD_DISCRETE); - cmd.soc_latency = cpu_to_le32(mvm->trans->trans_cfg->xtal_latency); + /* + * In VER_1 of this command, the discrete value is considered + * an integer; In VER_2, it's a bitmask. Since we have only 2 + * values in VER_1, this is backwards-compatible with VER_2, + * as long as we don't set any other bits. + */ + if (!mvm->trans->trans_cfg->integrated) + cmd.flags = cpu_to_le32(SOC_CONFIG_CMD_FLAGS_DISCRETE); + + if (iwl_mvm_lookup_cmd_ver(mvm->fw, IWL_ALWAYS_LONG_GROUP, + SCAN_REQ_UMAC) >= 2 && + (mvm->trans->trans_cfg->low_latency_xtal)) + cmd.flags |= cpu_to_le32(SOC_CONFIG_CMD_FLAGS_LOW_LATENCY); + + cmd.latency = cpu_to_le32(mvm->trans->trans_cfg->xtal_latency); ret = iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(SOC_CONFIGURATION_CMD, SYSTEM_GROUP, 0), 0, |