Commit 390298e8 authored by Toke Høiland-Jørgensen's avatar Toke Høiland-Jørgensen Committed by Johannes Berg

mac80211: Expose ieee80211_schedule_txq() function

Since we reworked ieee80211_return_txq() so it assumes that the caller
takes care of logging, we need another function that can be called without
holding any locks. Introduce ieee80211_schedule_txq() which serves this
purpose.
Signed-off-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent e073f7ca
...@@ -6209,6 +6209,19 @@ void ieee80211_txq_schedule_start(struct ieee80211_hw *hw, u8 ac) ...@@ -6209,6 +6209,19 @@ void ieee80211_txq_schedule_start(struct ieee80211_hw *hw, u8 ac)
void ieee80211_txq_schedule_end(struct ieee80211_hw *hw, u8 ac) void ieee80211_txq_schedule_end(struct ieee80211_hw *hw, u8 ac)
__releases(txq_lock); __releases(txq_lock);
/**
* ieee80211_schedule_txq - schedule a TXQ for transmission
*
* @hw: pointer as obtained from ieee80211_alloc_hw()
* @txq: pointer obtained from station or virtual interface
*
* Schedules a TXQ for transmission if it is not already scheduled. Takes a
* lock, which means it must *not* be called between
* ieee80211_txq_schedule_start() and ieee80211_txq_schedule_end()
*/
void ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
__acquires(txq_lock) __releases(txq_lock);
/** /**
* ieee80211_txq_may_transmit - check whether TXQ is allowed to transmit * ieee80211_txq_may_transmit - check whether TXQ is allowed to transmit
* *
......
...@@ -1176,9 +1176,7 @@ static inline void drv_wake_tx_queue(struct ieee80211_local *local, ...@@ -1176,9 +1176,7 @@ static inline void drv_wake_tx_queue(struct ieee80211_local *local,
static inline void schedule_and_wake_txq(struct ieee80211_local *local, static inline void schedule_and_wake_txq(struct ieee80211_local *local,
struct txq_info *txqi) struct txq_info *txqi)
{ {
spin_lock_bh(&local->active_txq_lock[txqi->txq.ac]); ieee80211_schedule_txq(&local->hw, &txqi->txq);
ieee80211_return_txq(&local->hw, &txqi->txq);
spin_unlock_bh(&local->active_txq_lock[txqi->txq.ac]);
drv_wake_tx_queue(local, txqi); drv_wake_tx_queue(local, txqi);
} }
......
...@@ -3703,6 +3703,19 @@ void ieee80211_return_txq(struct ieee80211_hw *hw, ...@@ -3703,6 +3703,19 @@ void ieee80211_return_txq(struct ieee80211_hw *hw,
} }
EXPORT_SYMBOL(ieee80211_return_txq); EXPORT_SYMBOL(ieee80211_return_txq);
void ieee80211_schedule_txq(struct ieee80211_hw *hw,
struct ieee80211_txq *txq)
__acquires(txq_lock) __releases(txq_lock)
{
struct ieee80211_local *local = hw_to_local(hw);
struct txq_info *txqi = to_txq_info(txq);
spin_lock_bh(&local->active_txq_lock[txq->ac]);
ieee80211_return_txq(hw, txq);
spin_unlock_bh(&local->active_txq_lock[txq->ac]);
}
EXPORT_SYMBOL(ieee80211_schedule_txq);
bool ieee80211_txq_may_transmit(struct ieee80211_hw *hw, bool ieee80211_txq_may_transmit(struct ieee80211_hw *hw,
struct ieee80211_txq *txq) struct ieee80211_txq *txq)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment