]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iwlwifi: pcie: set cmd_len in the correct place
authorSara Sharon <sara.sharon@intel.com>
Mon, 20 Aug 2018 07:07:32 +0000 (10:07 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 14 Dec 2018 11:04:49 +0000 (13:04 +0200)
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: a0ec0169b7a9 ("iwlwifi: support new tx api")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c

index 0c5f11d2c5da495cd31b8e568a51f24c5ba60e08..16e8c3eb09b82511012262f961bb3255e5b5b562 100644 (file)
@@ -583,18 +583,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);
 
@@ -632,6 +620,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));