diff options
author | Jérôme Pouiller <jerome.pouiller@silabs.com> | 2020-04-01 13:03:36 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-13 08:55:33 +0200 |
commit | 055d20cf72fe90f5b3141e2d88b98f15e4e190c5 (patch) | |
tree | 2277446ba82bb36d195b4c7b977c1ed12d4e8875 /drivers/staging/wfx/queue.c | |
parent | staging: wfx: do not stop mac80211 queueing during tx_policy upload (diff) | |
download | linux-dev-055d20cf72fe90f5b3141e2d88b98f15e4e190c5.tar.xz linux-dev-055d20cf72fe90f5b3141e2d88b98f15e4e190c5.zip |
staging: wfx: take advantage of ieee80211_{stop/start}_queues
Instead of maintaining stop status for each queue, we can just maintain
a global status for all queues.
In add, wfx_tx_queues_{lock/unlock} are only used when no more
tx_policies are available. Therefore, the counter of recursive locks
("tx_locked_cnt") is useless.
So, wfx_tx_queues_{lock/unlock} can be replaced by
ieee80211_{stop/start}_queues.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-4-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx/queue.c')
-rw-r--r-- | drivers/staging/wfx/queue.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 39d9127ce4b9..e3aa1e346c70 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -55,35 +55,6 @@ void wfx_tx_lock_flush(struct wfx_dev *wdev) wfx_tx_flush(wdev); } -void wfx_tx_queues_lock(struct wfx_dev *wdev) -{ - int i; - struct wfx_queue *queue; - - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - queue = &wdev->tx_queue[i]; - spin_lock_bh(&queue->queue.lock); - if (queue->tx_locked_cnt++ == 0) - ieee80211_stop_queue(wdev->hw, queue->queue_id); - spin_unlock_bh(&queue->queue.lock); - } -} - -void wfx_tx_queues_unlock(struct wfx_dev *wdev) -{ - int i; - struct wfx_queue *queue; - - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - queue = &wdev->tx_queue[i]; - spin_lock_bh(&queue->queue.lock); - WARN(!queue->tx_locked_cnt, "queue already unlocked"); - if (--queue->tx_locked_cnt == 0) - ieee80211_wake_queue(wdev->hw, queue->queue_id); - spin_unlock_bh(&queue->queue.lock); - } -} - /* If successful, LOCKS the TX queue! */ void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif) { |