Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * O(1) TX queue with built-in allocator.
4 *
5 * Copyright (c) 2017-2018, Silicon Laboratories, Inc.
6 * Copyright (c) 2010, ST-Ericsson
7 */
8#ifndef WFX_QUEUE_H
9#define WFX_QUEUE_H
10
11#include <linux/skbuff.h>
12
13#include "hif_api_cmd.h"
14
15#define WFX_MAX_STA_IN_AP_MODE 14
16#define WFX_LINK_ID_NO_ASSOC 15
17#define WFX_LINK_ID_AFTER_DTIM (WFX_LINK_ID_NO_ASSOC + 1)
18#define WFX_LINK_ID_UAPSD (WFX_LINK_ID_NO_ASSOC + 2)
19#define WFX_LINK_ID_MAX (WFX_LINK_ID_NO_ASSOC + 3)
20
21struct wfx_dev;
22struct wfx_vif;
23
24struct wfx_queue {
25 struct sk_buff_head queue;
26 int tx_locked_cnt;
27 int link_map_cache[WFX_LINK_ID_MAX];
28 u8 queue_id;
29};
30
31struct wfx_queue_stats {
32 int link_map_cache[WFX_LINK_ID_MAX];
33 struct sk_buff_head pending;
34 wait_queue_head_t wait_link_id_empty;
35};
36
37void wfx_tx_lock(struct wfx_dev *wdev);
38void wfx_tx_unlock(struct wfx_dev *wdev);
39void wfx_tx_flush(struct wfx_dev *wdev);
40void wfx_tx_lock_flush(struct wfx_dev *wdev);
41
42void wfx_tx_queues_init(struct wfx_dev *wdev);
43void wfx_tx_queues_deinit(struct wfx_dev *wdev);
44void wfx_tx_queues_lock(struct wfx_dev *wdev);
45void wfx_tx_queues_unlock(struct wfx_dev *wdev);
46void wfx_tx_queues_clear(struct wfx_dev *wdev);
47bool wfx_tx_queues_is_empty(struct wfx_dev *wdev);
48void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif);
49struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev);
50struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif);
51
52void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue,
53 struct sk_buff *skb);
54int wfx_tx_queue_get_num_queued(struct wfx_queue *queue, u32 link_id_map);
55
56struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id);
57int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb);
58int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb);
59unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev,
60 struct sk_buff *skb);
61void wfx_pending_dump_old_frames(struct wfx_dev *wdev, unsigned int limit_ms);
62
63#endif /* WFX_QUEUE_H */