mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
iwlwifi: pcie: set cmd_len in the correct place
[ Upstream commit956343a612] command len is set too early in the code, since when building AMSDU, the size changes. This causes the byte count table to have the wrong size. Fixes:a0ec0169b7("iwlwifi: support new tx api") Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
fd31ea11e8
commit
116301fff7
@@ -560,18 +560,6 @@ int iwl_trans_pcie_gen2_tx(struct iwl_trans *trans, struct sk_buff *skb,
|
||||
|
||||
spin_lock(&txq->lock);
|
||||
|
||||
if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) {
|
||||
struct iwl_tx_cmd_gen3 *tx_cmd_gen3 =
|
||||
(void *)dev_cmd->payload;
|
||||
|
||||
cmd_len = le16_to_cpu(tx_cmd_gen3->len);
|
||||
} else {
|
||||
struct iwl_tx_cmd_gen2 *tx_cmd_gen2 =
|
||||
(void *)dev_cmd->payload;
|
||||
|
||||
cmd_len = le16_to_cpu(tx_cmd_gen2->len);
|
||||
}
|
||||
|
||||
if (iwl_queue_space(trans, txq) < txq->high_mark) {
|
||||
iwl_stop_queue(trans, txq);
|
||||
|
||||
@@ -609,6 +597,18 @@ int iwl_trans_pcie_gen2_tx(struct iwl_trans *trans, struct sk_buff *skb,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) {
|
||||
struct iwl_tx_cmd_gen3 *tx_cmd_gen3 =
|
||||
(void *)dev_cmd->payload;
|
||||
|
||||
cmd_len = le16_to_cpu(tx_cmd_gen3->len);
|
||||
} else {
|
||||
struct iwl_tx_cmd_gen2 *tx_cmd_gen2 =
|
||||
(void *)dev_cmd->payload;
|
||||
|
||||
cmd_len = le16_to_cpu(tx_cmd_gen2->len);
|
||||
}
|
||||
|
||||
/* Set up entry for this TFD in Tx byte-count array */
|
||||
iwl_pcie_gen2_update_byte_tbl(trans_pcie, txq, cmd_len,
|
||||
iwl_pcie_gen2_get_num_tbs(trans, tfd));
|
||||
|
||||
Reference in New Issue
Block a user