]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Revert "iwlwifi: remove wide_cmd_header field"
authorLuca Coelho <luciano.coelho@intel.com>
Fri, 9 Oct 2020 09:21:23 +0000 (12:21 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 9 Oct 2020 15:04:50 +0000 (18:04 +0300)
This reverts commit 406fb0ce70d9c104388af507bf1a06292c082b6b.

It turns out that this flag is used by iwldvm, so we can't get rid of
it.  This broke iwldvm devices with BAD_COMMAND errors.

Fixes: 406fb0ce70d9 ("iwlwifi: remove wide_cmd_header field")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20201009122123.3e4ee0ad7a71.Id6d95ae601f048aeb4d2ed63a1712e469da84369@changeid
drivers/net/wireless/intel/iwlwifi/iwl-trans.c
drivers/net/wireless/intel/iwlwifi/iwl-trans.h
drivers/net/wireless/intel/iwlwifi/mvm/ops.c
drivers/net/wireless/intel/iwlwifi/pcie/tx.c

index a26da96763ddb07a74a21eeb60c92e2f84285691..becee92a5fd65a48eb73623465a8204b2104970c 100644 (file)
@@ -200,7 +200,7 @@ int iwl_trans_send_cmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
        if (!(cmd->flags & CMD_ASYNC))
                lock_map_acquire_read(&trans->sync_cmd_lockdep_map);
 
-       if (!iwl_cmd_groupid(cmd->id))
+       if (trans->wide_cmd_header && !iwl_cmd_groupid(cmd->id))
                cmd->id = DEF_ID(cmd->id);
 
        ret = trans->ops->send_cmd(trans, cmd);
index b70294e9d07b2c28089dfd821dae20673fdbb562..11a040e75bf36ec3f3071225dad83f092c2c81b3 100644 (file)
@@ -968,6 +968,7 @@ struct iwl_trans_txqs {
  * @hw_id_str: a string with info about HW ID. Set during transport allocation.
  * @pm_support: set to true in start_hw if link pm is supported
  * @ltr_enabled: set to true if the LTR is enabled
+ * @wide_cmd_header: true when ucode supports wide command header format
  * @num_rx_queues: number of RX queues allocated by the transport;
  *     the transport must set this before calling iwl_drv_start()
  * @iml_len: the length of the image loader
@@ -1009,6 +1010,7 @@ struct iwl_trans {
 
        const struct iwl_hcmd_arr *command_groups;
        int command_groups_size;
+       bool wide_cmd_header;
 
        u8 num_rx_queues;
 
index 1e44a176b3d9eeae997893df6528ee165009cd51..f1c5b3a9c26f7596ba55c1227dce9464920cce9a 100644 (file)
@@ -761,6 +761,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
                trans_cfg.rx_buf_size = rb_size_default;
        }
 
+       trans->wide_cmd_header = true;
        trans_cfg.bc_table_dword =
                mvm->trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_AX210;
 
index 8c89e4a2f7f8ebf47694e04f93923e5fc7eb5e99..966be5689d63adc46cdea270854e54d37638798e 100644 (file)
@@ -1180,6 +1180,11 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
        const u8 *cmddata[IWL_MAX_CMD_TBS_PER_TFD];
        u16 cmdlen[IWL_MAX_CMD_TBS_PER_TFD];
 
+       if (WARN(!trans->wide_cmd_header &&
+                group_id > IWL_ALWAYS_LONG_GROUP,
+                "unsupported wide command %#x\n", cmd->id))
+               return -EINVAL;
+
        if (group_id != 0) {
                copy_size = sizeof(struct iwl_cmd_header_wide);
                cmd_size = sizeof(struct iwl_cmd_header_wide);