diff options
author | Luca Coelho <luciano.coelho@intel.com> | 2016-06-29 00:38:40 +0300 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2016-07-06 10:30:06 +0300 |
commit | 55bfa4b9d47d905b068b255659cc0ff039af2d21 (patch) | |
tree | 0b6c55d0c843163d9e3e6b9acb44d55b600df1e0 /drivers/net/wireless/intel/iwlwifi/mvm/fw.c | |
parent | 564cdce735da0ad036051052e5c01760cc70494f (diff) |
iwlwifi: mvm: support v4 of the TX power command
Add support for the v4 version of the TX power command. Just add a
new version and do the same sizing tricks that were done when support
for v3 was introduced.
This patch doesn't support the new functionality introduced, but makes
the driver work with the new size of the command.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
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 | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c index 4c16fa79b462..7e0cdbf8bf74 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c @@ -1027,9 +1027,10 @@ static int iwl_mvm_sar_init(struct iwl_mvm *mvm) { struct iwl_mvm_sar_table sar_table; struct iwl_dev_tx_power_cmd cmd = { - .v2.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_CHAINS), + .v3.v2.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_CHAINS), }; int ret, i, j, idx; + int len = sizeof(cmd); /* we can't do anything with the table if the FW doesn't support it */ if (!fw_has_api(&mvm->fw->ucode_capa, @@ -1039,6 +1040,9 @@ static int iwl_mvm_sar_init(struct iwl_mvm *mvm) return 0; } + if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TX_POWER_ACK)) + len = sizeof(cmd.v3); + ret = iwl_mvm_sar_get_table(mvm, &sar_table); if (ret < 0) { IWL_DEBUG_RADIO(mvm, @@ -1060,15 +1064,14 @@ static int iwl_mvm_sar_init(struct iwl_mvm *mvm) IWL_DEBUG_RADIO(mvm, " Chain[%d]:\n", i); for (j = 0; j < IWL_NUM_SUB_BANDS; j++) { idx = (i * IWL_NUM_SUB_BANDS) + j; - cmd.per_chain_restriction[i][j] = + cmd.v3.per_chain_restriction[i][j] = cpu_to_le16(sar_table.values[idx]); IWL_DEBUG_RADIO(mvm, " Band[%d] = %d * .125dBm\n", j, sar_table.values[idx]); } } - ret = iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, - sizeof(cmd), &cmd); + ret = iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, len, &cmd); if (ret) IWL_ERR(mvm, "failed to set per-chain TX power: %d\n", ret); |