summaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 842881ca8f20..18381581b5e9 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3566,7 +3566,7 @@ bool ieee80211_schedule_txq(struct ieee80211_hw *hw,
3566 spin_lock_bh(&local->active_txq_lock); 3566 spin_lock_bh(&local->active_txq_lock);
3567 3567
3568 if (list_empty(&txqi->schedule_order)) { 3568 if (list_empty(&txqi->schedule_order)) {
3569 list_add_tail(&txqi->schedule_order, &local->active_txqs); 3569 list_add_tail(&txqi->schedule_order, &local->active_txqs_new);
3570 ret = true; 3570 ret = true;
3571 } 3571 }
3572 3572
@@ -3580,14 +3580,35 @@ struct ieee80211_txq *ieee80211_next_txq(struct ieee80211_hw *hw)
3580{ 3580{
3581 struct ieee80211_local *local = hw_to_local(hw); 3581 struct ieee80211_local *local = hw_to_local(hw);
3582 struct txq_info *txqi = NULL; 3582 struct txq_info *txqi = NULL;
3583 struct list_head *head;
3583 3584
3584 spin_lock_bh(&local->active_txq_lock); 3585 spin_lock_bh(&local->active_txq_lock);
3585 3586
3586 if (list_empty(&local->active_txqs)) 3587begin:
3587 goto out; 3588 head = &local->active_txqs_new;
3589 if (list_empty(head)) {
3590 head = &local->active_txqs_old;
3591 if (list_empty(head))
3592 goto out;
3593 }
3594
3595 txqi = list_first_entry(head, struct txq_info, schedule_order);
3596
3597 if (txqi->txq.sta) {
3598 struct sta_info *sta = container_of(txqi->txq.sta,
3599 struct sta_info, sta);
3600
3601 spin_lock_bh(&sta->lock);
3602 if (sta->airtime_deficit < 0) {
3603 sta->airtime_deficit += IEEE80211_AIRTIME_QUANTUM;
3604 list_move_tail(&txqi->schedule_order,
3605 &local->active_txqs_old);
3606 spin_unlock_bh(&sta->lock);
3607 goto begin;
3608 }
3609 spin_unlock_bh(&sta->lock);
3610 }
3588 3611
3589 txqi = list_first_entry(&local->active_txqs,
3590 struct txq_info, schedule_order);
3591 list_del_init(&txqi->schedule_order); 3612 list_del_init(&txqi->schedule_order);
3592 3613
3593out: 3614out: