aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wfx/queue.c
diff options
context:
space:
mode:
authorJérôme Pouiller <jerome.pouiller@silabs.com>2020-04-01 13:03:59 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-13 08:55:37 +0200
commit39dbfa536b406fbe516e0ec7b571264ccf567edb (patch)
tree7258b4cfc53ed9ff2a2d672d8d16e4eb68278350 /drivers/staging/wfx/queue.c
parentstaging: wfx: simplify usage of wfx_tx_queues_put() (diff)
downloadlinux-dev-39dbfa536b406fbe516e0ec7b571264ccf567edb.tar.xz
linux-dev-39dbfa536b406fbe516e0ec7b571264ccf567edb.zip
staging: wfx: improve interface between data_tx.c and queue.c
Currently, wfx_pending_remove() (from queue.c) call wfx_skb_dtor() (from data_tx.c) that forward the tx status to mac80211. Moreover, there no purpose to retrieve a frame from the pending queue without dequeuing it. So, the main purpose of wfx_pending_remove() is to forward the tx status to mac80211. Let's make the architecture cleaner: - merge wfx_pending_remove() into wfx_pending_get() - call wfx_skb_dtor() from data_tx.c 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-27-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.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c
index cc89bfe1dbb4..a1a2f7756a27 100644
--- a/drivers/staging/wfx/queue.c
+++ b/drivers/staging/wfx/queue.c
@@ -174,30 +174,22 @@ int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb)
return 0;
}
-int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb)
-{
- struct wfx_queue *queue = &wdev->tx_queue[skb_get_queue_mapping(skb)];
-
- WARN_ON(skb_get_queue_mapping(skb) > 3);
- WARN_ON(!atomic_read(&queue->pending_frames));
-
- atomic_dec(&queue->pending_frames);
- skb_unlink(skb, &wdev->tx_pending);
- wfx_skb_dtor(wdev, skb);
-
- return 0;
-}
-
struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id)
{
- struct sk_buff *skb;
+ struct wfx_queue *queue;
struct hif_req_tx *req;
+ struct sk_buff *skb;
spin_lock_bh(&wdev->tx_pending.lock);
skb_queue_walk(&wdev->tx_pending, skb) {
req = wfx_skb_txreq(skb);
if (req->packet_id == packet_id) {
spin_unlock_bh(&wdev->tx_pending.lock);
+ queue = &wdev->tx_queue[skb_get_queue_mapping(skb)];
+ WARN_ON(skb_get_queue_mapping(skb) > 3);
+ WARN_ON(!atomic_read(&queue->pending_frames));
+ atomic_dec(&queue->pending_frames);
+ skb_unlink(skb, &wdev->tx_pending);
return skb;
}
}