]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iwlwifi: pcie: don't pad AMSDU packets
authorSara Sharon <sara.sharon@intel.com>
Mon, 2 Jul 2018 11:48:15 +0000 (14:48 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Mon, 8 Oct 2018 07:28:33 +0000 (10:28 +0300)
When we TX AMSDU, we shouldn't pad the packet. In the past,
we were building AMSDU only in transport layer, and gen2
functions are built based on this. However, now that op mode
may build AMSDUs, we need to take care of padding also in
gen2 "non-pcie-amsdu" path.

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 b71cf55480fce7a5a4be7fbf2543036146b97733..09cdc15f764504d42dab1048adb768e57822f934 100644 (file)
@@ -454,7 +454,8 @@ iwl_tfh_tfd *iwl_pcie_gen2_build_tx(struct iwl_trans *trans,
                                    struct sk_buff *skb,
                                    struct iwl_cmd_meta *out_meta,
                                    int hdr_len,
-                                   int tx_cmd_len)
+                                   int tx_cmd_len,
+                                   bool pad)
 {
        int idx = iwl_pcie_get_cmd_index(txq, txq->write_ptr);
        struct iwl_tfh_tfd *tfd = iwl_pcie_get_tfd(trans, txq, idx);
@@ -478,7 +479,10 @@ iwl_tfh_tfd *iwl_pcie_gen2_build_tx(struct iwl_trans *trans,
        len = tx_cmd_len + sizeof(struct iwl_cmd_header) + hdr_len -
              IWL_FIRST_TB_SIZE;
 
-       tb1_len = ALIGN(len, 4);
+       if (pad)
+               tb1_len = ALIGN(len, 4);
+       else
+               tb1_len = len;
 
        /* map the data for TB1 */
        tb1_addr = ((u8 *)&dev_cmd->hdr) + IWL_FIRST_TB_SIZE;
@@ -551,7 +555,7 @@ struct iwl_tfh_tfd *iwl_pcie_gen2_build_tfd(struct iwl_trans *trans,
                                                    out_meta, hdr_len, len);
 
        return iwl_pcie_gen2_build_tx(trans, txq, dev_cmd, skb, out_meta,
-                                     hdr_len, len);
+                                     hdr_len, len, !amsdu);
 }
 
 int iwl_trans_pcie_gen2_tx(struct iwl_trans *trans, struct sk_buff *skb,