summaryrefslogtreecommitdiff
path: root/net/mac80211/driver-ops.h
diff options
context:
space:
mode:
authorToke Høiland-Jørgensen <toke@toke.dk>2018-12-18 17:02:06 -0800
committerJohannes Berg <johannes.berg@intel.com>2019-01-19 09:24:12 +0100
commit1866760096bf40bcf6977a9076b3026598bc12ee (patch)
tree9ccf3723aa2f98fb6fc3acfdaf9ad69112ee3222 /net/mac80211/driver-ops.h
parentf04d402f2f00a0f0470b7e636b50170608b425c7 (diff)
downloadlwn-1866760096bf40bcf6977a9076b3026598bc12ee.tar.gz
lwn-1866760096bf40bcf6977a9076b3026598bc12ee.zip
mac80211: Add TXQ scheduling API
This adds an API to mac80211 to handle scheduling of TXQs. The interface between driver and mac80211 for TXQ handling is changed by adding two new functions: ieee80211_next_txq(), which will return the next TXQ to schedule in the current round-robin rotation, and ieee80211_return_txq(), which the driver uses to indicate that it has finished scheduling a TXQ (which will then be put back in the scheduling rotation if it isn't empty). The driver must call ieee80211_txq_schedule_start() at the start of each scheduling session, and ieee80211_txq_schedule_end() at the end. The API then guarantees that the same TXQ is not returned twice in the same session (so a driver can loop on ieee80211_next_txq() without worrying about breaking the loop. Usage of the new API is optional, so drivers can be ported one at a time. In this patch, the actual scheduling performed by mac80211 is simple round-robin, but a subsequent commit adds airtime fairness awareness to the scheduler. Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk> [minor kernel-doc fix, propagate sparse locking checks out] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/driver-ops.h')
-rw-r--r--net/mac80211/driver-ops.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 3e0d5922a440..1aab1734b26f 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1173,6 +1173,15 @@ static inline void drv_wake_tx_queue(struct ieee80211_local *local,
local->ops->wake_tx_queue(&local->hw, &txq->txq);
}
+static inline void schedule_and_wake_txq(struct ieee80211_local *local,
+ struct txq_info *txqi)
+{
+ spin_lock_bh(&local->active_txq_lock[txqi->txq.ac]);
+ ieee80211_return_txq(&local->hw, &txqi->txq);
+ spin_unlock_bh(&local->active_txq_lock[txqi->txq.ac]);
+ drv_wake_tx_queue(local, txqi);
+}
+
static inline int drv_can_aggregate_in_amsdu(struct ieee80211_local *local,
struct sk_buff *head,
struct sk_buff *skb)