Merge tag 'pstore-v5.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees...
[linux-2.6-microblaze.git] / drivers / staging / wfx / queue.h
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * O(1) TX queue with built-in allocator.
4  *
5  * Copyright (c) 2017-2020, Silicon Laboratories, Inc.
6  * Copyright (c) 2010, ST-Ericsson
7  */
8 #ifndef WFX_QUEUE_H
9 #define WFX_QUEUE_H
10
11 struct wfx_dev;
12 struct wfx_vif;
13
14 struct wfx_queue {
15         struct sk_buff_head     normal;
16         struct sk_buff_head     cab; // Content After (DTIM) Beacon
17         atomic_t                pending_frames;
18         int                     priority;
19 };
20
21 void wfx_tx_lock(struct wfx_dev *wdev);
22 void wfx_tx_unlock(struct wfx_dev *wdev);
23 void wfx_tx_flush(struct wfx_dev *wdev);
24 void wfx_tx_lock_flush(struct wfx_dev *wdev);
25
26 void wfx_tx_queues_init(struct wfx_vif *wvif);
27 void wfx_tx_queues_check_empty(struct wfx_vif *wvif);
28 bool wfx_tx_queues_has_cab(struct wfx_vif *wvif);
29 void wfx_tx_queues_put(struct wfx_vif *wvif, struct sk_buff *skb);
30 struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev);
31
32 bool wfx_tx_queue_empty(struct wfx_vif *wvif, struct wfx_queue *queue);
33 void wfx_tx_queue_drop(struct wfx_vif *wvif, struct wfx_queue *queue,
34                        struct sk_buff_head *dropped);
35
36 struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id);
37 void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped);
38 unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev,
39                                           struct sk_buff *skb);
40 void wfx_pending_dump_old_frames(struct wfx_dev *wdev, unsigned int limit_ms);
41
42 #endif /* WFX_QUEUE_H */