diff options
author | Emmanuel Grumbach | 2015-11-11 10:37:02 +0100 |
---|---|---|
committer | Emmanuel Grumbach | 2016-02-27 21:00:03 +0100 |
commit | 50b0213fdb830e21ed64375230c3271b21bb584a (patch) | |
tree | 40f75de9432139dcba7d4e8b3cefc27f79e95771 /drivers/net/wireless/intel/iwlwifi/mvm/tx.c | |
parent | iwlwifi: mvm: don't enable A-MSDU when the rates are too low (diff) | |
download | kernel-qcow2-linux-50b0213fdb830e21ed64375230c3271b21bb584a.tar.gz kernel-qcow2-linux-50b0213fdb830e21ed64375230c3271b21bb584a.tar.xz kernel-qcow2-linux-50b0213fdb830e21ed64375230c3271b21bb584a.zip |
iwlwifi: mvm: don't send an A-MSDU that is larger than the TXF
The A-MSDU must be smaller than the Transmit FIFO in the
device. Since the size of the TXF can change depending
on the device / firmware compilation mode, take the size
of the FIFO dynamically from the what the firmware tells us.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/tx.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c index a73ae01f3a48..dd616c1d59b7 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c @@ -449,7 +449,7 @@ static int iwl_mvm_tx_tso(struct iwl_mvm *mvm, struct sk_buff *skb, u16 ip_base_id = ipv4 ? ntohs(ip_hdr(skb)->id) : 0; u16 amsdu_add, snap_ip_tcp, pad, i = 0; unsigned int dbg_max_amsdu_len; - u8 *qc, tid; + u8 *qc, tid, txf; snap_ip_tcp = 8 + skb_transport_header(skb) - skb_network_header(skb) + tcp_hdrlen(skb); @@ -480,6 +480,19 @@ static int iwl_mvm_tx_tso(struct iwl_mvm *mvm, struct sk_buff *skb, max_amsdu_len = sta->max_amsdu_len; dbg_max_amsdu_len = ACCESS_ONCE(mvm->max_amsdu_len); + + /* the Tx FIFO to which this A-MSDU will be routed */ + txf = iwl_mvm_ac_to_tx_fifo[tid_to_mac80211_ac[tid]]; + + /* + * Don't send an AMSDU that will be longer than the TXF. + * Add a security margin of 256 for the TX command + headers. + * We also want to have the start of the next packet inside the + * fifo to be able to send bursts. + */ + max_amsdu_len = min_t(unsigned int, max_amsdu_len, + mvm->shared_mem_cfg.txfifo_size[txf] - 256); + if (dbg_max_amsdu_len) max_amsdu_len = min_t(unsigned int, max_amsdu_len, dbg_max_amsdu_len); |