From e7bd802cf728f76ce42b6b7529db14e7fc027f0c Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 19 Mar 2019 10:09:15 +0100 Subject: [PATCH] mt76: adjust for mac80211 txq scheduling API changes Signed-off-by: Felix Fietkau --- mac80211.c | 15 +++++++++++++++ tx.c | 5 +++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/mac80211.c b/mac80211.c index 1beb7fbc..1132583e 100644 --- a/mac80211.c +++ b/mac80211.c @@ -562,6 +562,7 @@ mt76_check_sta(struct mt76_dev *dev, struct sk_buff *skb) struct ieee80211_sta *sta; struct mt76_wcid *wcid = status->wcid; bool ps; + int i; if (ieee80211_is_pspoll(hdr->frame_control) && !wcid) { sta = ieee80211_find_sta_by_ifaddr(dev->hw, hdr->addr2, NULL); @@ -608,6 +609,20 @@ mt76_check_sta(struct mt76_dev *dev, struct sk_buff *skb) dev->drv->sta_ps(dev, sta, ps); ieee80211_sta_ps_transition(sta, ps); + + if (ps) + return; + + for (i = 0; i < ARRAY_SIZE(sta->txq); i++) { + struct mt76_txq *mtxq; + + if (!sta->txq[i]) + continue; + + mtxq = (struct mt76_txq *) sta->txq[i]->drv_priv; + if (!skb_queue_empty(&mtxq->retry_q)) + ieee80211_schedule_txq(dev->hw, sta->txq[i]); + } } void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames, diff --git a/tx.c b/tx.c index 60bbb656..638b8390 100644 --- a/tx.c +++ b/tx.c @@ -524,8 +524,9 @@ mt76_txq_schedule_list(struct mt76_dev *dev, enum mt76_txq_id qid) } ret += mt76_txq_send_burst(dev, sq, mtxq, &empty); - if (!empty) - ieee80211_return_txq(dev->hw, txq); + if (skb_queue_empty(&mtxq->retry_q)) + empty = true; + ieee80211_return_txq(dev->hw, txq, !empty); } spin_unlock_bh(&hwq->lock);