Skip to content

Commit 8ef67e0

Browse files
Maxim Altshulgregkh
authored andcommitted
mac80211: RX BA support for sta max_rx_aggregation_subframes
commit 480dd46b9d6812e5fb7172c305ee0f1154c26eed upstream. The ability to change the max_rx_aggregation frames is useful in cases of IOP. There exist some devices (latest mobile phones and some AP's) that tend to not respect a BA sessions maximum size (in Kbps). These devices won't respect the AMPDU size that was negotiated during association (even though they do respect the maximal number of packets). This violation is characterized by a valid number of packets in a single AMPDU. Even so, the total size will exceed the size negotiated during association. Eventually, this will cause some undefined behavior, which in turn causes the hw to drop packets, causing the throughput to plummet. This patch will make the subframe limitation to be held by each station, instead of being held only by hw. Signed-off-by: Maxim Altshul <maxim.altshul@ti.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Amit Pundir <amit.pundir@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d13333e commit 8ef67e0

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

include/net/mac80211.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,6 +1662,9 @@ struct ieee80211_sta_rates {
16621662
* @supp_rates: Bitmap of supported rates (per band)
16631663
* @ht_cap: HT capabilities of this STA; restricted to our own capabilities
16641664
* @vht_cap: VHT capabilities of this STA; restricted to our own capabilities
1665+
* @max_rx_aggregation_subframes: maximal amount of frames in a single AMPDU
1666+
* that this station is allowed to transmit to us.
1667+
* Can be modified by driver.
16651668
* @wme: indicates whether the STA supports QoS/WME (if local devices does,
16661669
* otherwise always false)
16671670
* @drv_priv: data area for driver use, will always be aligned to
@@ -1688,6 +1691,7 @@ struct ieee80211_sta {
16881691
u16 aid;
16891692
struct ieee80211_sta_ht_cap ht_cap;
16901693
struct ieee80211_sta_vht_cap vht_cap;
1694+
u8 max_rx_aggregation_subframes;
16911695
bool wme;
16921696
u8 uapsd_queues;
16931697
u8 max_sp;

net/mac80211/agg-rx.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,13 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta,
290290
buf_size = IEEE80211_MAX_AMPDU_BUF;
291291

292292
/* make sure the size doesn't exceed the maximum supported by the hw */
293-
if (buf_size > local->hw.max_rx_aggregation_subframes)
294-
buf_size = local->hw.max_rx_aggregation_subframes;
293+
if (buf_size > sta->sta.max_rx_aggregation_subframes)
294+
buf_size = sta->sta.max_rx_aggregation_subframes;
295295
params.buf_size = buf_size;
296296

297+
ht_dbg(sta->sdata, "AddBA Req buf_size=%d for %pM\n",
298+
buf_size, sta->sta.addr);
299+
297300
/* examine state machine */
298301
mutex_lock(&sta->ampdu_mlme.mtx);
299302

net/mac80211/sta_info.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,9 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
329329

330330
memcpy(sta->addr, addr, ETH_ALEN);
331331
memcpy(sta->sta.addr, addr, ETH_ALEN);
332+
sta->sta.max_rx_aggregation_subframes =
333+
local->hw.max_rx_aggregation_subframes;
334+
332335
sta->local = local;
333336
sta->sdata = sdata;
334337
sta->rx_stats.last_rx = jiffies;

0 commit comments

Comments
 (0)