summaryrefslogtreecommitdiff
path: root/drivers/staging/wfx/data_tx.c
diff options
context:
space:
mode:
authorJérôme Pouiller <jerome.pouiller@silabs.com>2020-04-01 13:03:36 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-13 08:55:33 +0200
commit055d20cf72fe90f5b3141e2d88b98f15e4e190c5 (patch)
tree2277446ba82bb36d195b4c7b977c1ed12d4e8875 /drivers/staging/wfx/data_tx.c
parentaf9d2f79dcb52e336dcb7edabf6c64b8d74412c3 (diff)
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/data_tx.c')
-rw-r--r--drivers/staging/wfx/data_tx.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index 7a7c2518f6cf..889ebc2f5d83 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -189,10 +189,8 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif,
idx = entry - cache->cache;
}
wfx_tx_policy_use(cache, &cache->cache[idx]);
- if (list_empty(&cache->free)) {
- /* Lock TX queues. */
- wfx_tx_queues_lock(wvif->wdev);
- }
+ if (list_empty(&cache->free))
+ ieee80211_stop_queues(wvif->wdev->hw);
spin_unlock_bh(&cache->lock);
return idx;
}
@@ -207,10 +205,8 @@ static void wfx_tx_policy_put(struct wfx_vif *wvif, int idx)
spin_lock_bh(&cache->lock);
locked = list_empty(&cache->free);
usage = wfx_tx_policy_release(cache, &cache->cache[idx]);
- if (locked && !usage) {
- /* Unlock TX queues. */
- wfx_tx_queues_unlock(wvif->wdev);
- }
+ if (locked && !usage)
+ ieee80211_wake_queues(wvif->wdev->hw);
spin_unlock_bh(&cache->lock);
}