diff --git a/mt76.h b/mt76.h index 33e4e3e6..eaf6c7f5 100644 --- a/mt76.h +++ b/mt76.h @@ -279,7 +279,8 @@ void mt76_tx(struct mt76_dev *dev, struct ieee80211_sta *sta, void mt76_txq_init(struct mt76_dev *dev, struct ieee80211_txq *txq); void mt76_txq_remove(struct mt76_dev *dev, struct ieee80211_txq *txq); void mt76_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq); -void mt76_stop_tx_queues(struct mt76_dev *dev, struct ieee80211_sta *sta); +void mt76_stop_tx_queues(struct mt76_dev *dev, struct ieee80211_sta *sta, + bool send_bar); void mt76_txq_schedule(struct mt76_dev *dev, struct mt76_queue *hwq); void mt76_txq_schedule_all(struct mt76_dev *dev); void mt76_release_buffered_frames(struct ieee80211_hw *hw, diff --git a/mt7603_main.c b/mt7603_main.c index 451834c6..de7bb580 100644 --- a/mt7603_main.c +++ b/mt7603_main.c @@ -304,7 +304,7 @@ mt7603_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif, switch (cmd) { case STA_NOTIFY_SLEEP: mt7603_wtbl_set_ps(dev, idx, true); - mt76_stop_tx_queues(&dev->mt76, sta); + mt76_stop_tx_queues(&dev->mt76, sta, false); break; case STA_NOTIFY_AWAKE: mt7603_wtbl_set_ps(dev, idx, false); diff --git a/mt76x2_main.c b/mt76x2_main.c index 1aaa6384..eabff8b8 100644 --- a/mt76x2_main.c +++ b/mt76x2_main.c @@ -288,7 +288,7 @@ mt76x2_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif, switch (cmd) { case STA_NOTIFY_SLEEP: mt76_set(dev, MT_WCID_DROP(idx), MT_WCID_DROP_MASK(idx)); - mt76_stop_tx_queues(&dev->mt76, sta); + mt76_stop_tx_queues(&dev->mt76, sta, true); break; case STA_NOTIFY_AWAKE: mt76_clear(dev, MT_WCID_DROP(idx), MT_WCID_DROP_MASK(idx)); diff --git a/tx.c b/tx.c index 59edfa22..382ea13f 100644 --- a/tx.c +++ b/tx.c @@ -433,7 +433,8 @@ void mt76_txq_schedule_all(struct mt76_dev *dev) } EXPORT_SYMBOL_GPL(mt76_txq_schedule_all); -void mt76_stop_tx_queues(struct mt76_dev *dev, struct ieee80211_sta *sta) +void mt76_stop_tx_queues(struct mt76_dev *dev, struct ieee80211_sta *sta, + bool send_bar) { int i; @@ -442,7 +443,7 @@ void mt76_stop_tx_queues(struct mt76_dev *dev, struct ieee80211_sta *sta) struct mt76_txq *mtxq = (struct mt76_txq *) txq->drv_priv; spin_lock_bh(&mtxq->hwq->lock); - mtxq->send_bar = mtxq->aggr; + mtxq->send_bar = mtxq->aggr && send_bar; if (!list_empty(&mtxq->list)) list_del_init(&mtxq->list); spin_unlock_bh(&mtxq->hwq->lock);