aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/mac80211.h17
-rw-r--r--net/mac80211/agg-rx.c15
-rw-r--r--net/mac80211/ht.c6
-rw-r--r--net/mac80211/sta_info.h3
4 files changed, 41 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index b250c6303d6f..3b31ec95dd8e 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2969,6 +2969,23 @@ void ieee80211_ready_on_channel(struct ieee80211_hw *hw);
2969 */ 2969 */
2970void ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw); 2970void ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw);
2971 2971
2972/**
2973 * ieee80211_stop_rx_ba_session - callback to stop existing BA sessions
2974 *
2975 * in order not to harm the system performance and user experience, the device
2976 * may request not to allow any rx ba session and tear down existing rx ba
2977 * sessions based on system constraints such as periodic BT activity that needs
2978 * to limit wlan activity (eg.sco or a2dp)."
2979 * in such cases, the intention is to limit the duration of the rx ppdu and
2980 * therefore prevent the peer device to use a-mpdu aggregation.
2981 *
2982 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
2983 * @ba_rx_bitmap: Bit map of open rx ba per tid
2984 * @addr: & to bssid mac address
2985 */
2986void ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, u16 ba_rx_bitmap,
2987 const u8 *addr);
2988
2972/* Rate control API */ 2989/* Rate control API */
2973 2990
2974/** 2991/**
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
index 9c0d76cdca92..89b0b2ca6db6 100644
--- a/net/mac80211/agg-rx.c
+++ b/net/mac80211/agg-rx.c
@@ -100,6 +100,21 @@ void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
100 mutex_unlock(&sta->ampdu_mlme.mtx); 100 mutex_unlock(&sta->ampdu_mlme.mtx);
101} 101}
102 102
103void ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, u16 ba_rx_bitmap,
104 const u8 *addr)
105{
106 struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
107 struct sta_info *sta = sta_info_get(sdata, addr);
108 int i;
109
110 for (i = 0; i < STA_TID_NUM; i++)
111 if (ba_rx_bitmap & BIT(i))
112 set_bit(i, sta->ampdu_mlme.tid_rx_stop_requested);
113
114 ieee80211_queue_work(&sta->local->hw, &sta->ampdu_mlme.work);
115}
116EXPORT_SYMBOL(ieee80211_stop_rx_ba_session);
117
103/* 118/*
104 * After accepting the AddBA Request we activated a timer, 119 * After accepting the AddBA Request we activated a timer,
105 * resetting it after each frame that arrives from the originator. 120 * resetting it after each frame that arrives from the originator.
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index 591add22bcc0..7cfc286946c0 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -140,6 +140,12 @@ void ieee80211_ba_session_work(struct work_struct *work)
140 sta, tid, WLAN_BACK_RECIPIENT, 140 sta, tid, WLAN_BACK_RECIPIENT,
141 WLAN_REASON_QSTA_TIMEOUT, true); 141 WLAN_REASON_QSTA_TIMEOUT, true);
142 142
143 if (test_and_clear_bit(tid,
144 sta->ampdu_mlme.tid_rx_stop_requested))
145 ___ieee80211_stop_rx_ba_session(
146 sta, tid, WLAN_BACK_RECIPIENT,
147 WLAN_REASON_UNSPECIFIED, true);
148
143 tid_tx = sta->ampdu_mlme.tid_start_tx[tid]; 149 tid_tx = sta->ampdu_mlme.tid_start_tx[tid];
144 if (tid_tx) { 150 if (tid_tx) {
145 /* 151 /*
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index c6ae8718bd57..a06d64ebc177 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -158,6 +158,8 @@ struct tid_ampdu_rx {
158 * @work: work struct for starting/stopping aggregation 158 * @work: work struct for starting/stopping aggregation
159 * @tid_rx_timer_expired: bitmap indicating on which TIDs the 159 * @tid_rx_timer_expired: bitmap indicating on which TIDs the
160 * RX timer expired until the work for it runs 160 * RX timer expired until the work for it runs
161 * @tid_rx_stop_requested: bitmap indicating which BA sessions per TID the
162 * driver requested to close until the work for it runs
161 * @mtx: mutex to protect all TX data (except non-NULL assignments 163 * @mtx: mutex to protect all TX data (except non-NULL assignments
162 * to tid_tx[idx], which are protected by the sta spinlock) 164 * to tid_tx[idx], which are protected by the sta spinlock)
163 */ 165 */
@@ -166,6 +168,7 @@ struct sta_ampdu_mlme {
166 /* rx */ 168 /* rx */
167 struct tid_ampdu_rx __rcu *tid_rx[STA_TID_NUM]; 169 struct tid_ampdu_rx __rcu *tid_rx[STA_TID_NUM];
168 unsigned long tid_rx_timer_expired[BITS_TO_LONGS(STA_TID_NUM)]; 170 unsigned long tid_rx_timer_expired[BITS_TO_LONGS(STA_TID_NUM)];
171 unsigned long tid_rx_stop_requested[BITS_TO_LONGS(STA_TID_NUM)];
169 /* tx */ 172 /* tx */
170 struct work_struct work; 173 struct work_struct work;
171 struct tid_ampdu_tx __rcu *tid_tx[STA_TID_NUM]; 174 struct tid_ampdu_tx __rcu *tid_tx[STA_TID_NUM];