Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac80211: always set the buf_size in AddBA req to 64

Advertising reordering window in ADDBA less than 64 can crash some APs,
an example is LinkSys WRT120N (with FW v1.0.07 build 002 Jun 18 2012).
On the other hand, a driver may need to limit Tx A-MPDU size for its own
reasons, like specific HW limitations.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Gregory Greenman and committed by
Johannes Berg
ac062197 5ad11b50

+6 -3
+4 -2
include/net/mac80211.h
··· 2003 2003 * it shouldn't be set. 2004 2004 * 2005 2005 * @max_tx_aggregation_subframes: maximum number of subframes in an 2006 - * aggregate an HT driver will transmit, used by the peer as a 2007 - * hint to size its reorder buffer. 2006 + * aggregate an HT driver will transmit. Though ADDBA will advertise 2007 + * a constant value of 64 as some older APs can crash if the window 2008 + * size is smaller (an example is LinkSys WRT120N with FW v1.0.07 2009 + * build 002 Jun 18 2012). 2008 2010 * 2009 2011 * @offchannel_tx_hw_queue: HW queue ID to use for offchannel TX 2010 2012 * (if %IEEE80211_HW_QUEUE_CONTROL is set)
+2 -1
net/mac80211/agg-tx.c
··· 500 500 /* send AddBA request */ 501 501 ieee80211_send_addba_request(sdata, sta->sta.addr, tid, 502 502 tid_tx->dialog_token, start_seq_num, 503 - local->hw.max_tx_aggregation_subframes, 503 + IEEE80211_MAX_AMPDU_BUF, 504 504 tid_tx->timeout); 505 505 } 506 506 ··· 926 926 amsdu = capab & IEEE80211_ADDBA_PARAM_AMSDU_MASK; 927 927 tid = (capab & IEEE80211_ADDBA_PARAM_TID_MASK) >> 2; 928 928 buf_size = (capab & IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK) >> 6; 929 + buf_size = min(buf_size, local->hw.max_tx_aggregation_subframes); 929 930 930 931 mutex_lock(&sta->ampdu_mlme.mtx); 931 932