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_AFTER_DTIM (WFX_MAX_STA_IN_AP_MODE + 1)
17#define WFX_LINK_ID_UAPSD (WFX_MAX_STA_IN_AP_MODE + 2)
18#define WFX_LINK_ID_MAX (WFX_MAX_STA_IN_AP_MODE + 3)
19
20struct wfx_dev;
21struct wfx_vif;
22
23struct wfx_queue {
24 struct sk_buff_head queue;
25 int tx_locked_cnt;
26 int link_map_cache[WFX_LINK_ID_MAX];
27 u8 queue_id;
28};
29
30struct wfx_queue_stats {
31 int link_map_cache[WFX_LINK_ID_MAX];
32 struct sk_buff_head pending;
33 wait_queue_head_t wait_link_id_empty;
34};
35
36void wfx_tx_lock(struct wfx_dev *wdev);
37void wfx_tx_unlock(struct wfx_dev *wdev);
38void wfx_tx_flush(struct wfx_dev *wdev);
39void wfx_tx_lock_flush(struct wfx_dev *wdev);
40
41void wfx_tx_queues_init(struct wfx_dev *wdev);
42void wfx_tx_queues_deinit(struct wfx_dev *wdev);
43void wfx_tx_queues_lock(struct wfx_dev *wdev);
44void wfx_tx_queues_unlock(struct wfx_dev *wdev);
45void wfx_tx_queues_clear(struct wfx_dev *wdev);
46bool wfx_tx_queues_is_empty(struct wfx_dev *wdev);
47void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif);
48struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev);
49
50void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue,
51 struct sk_buff *skb);
52size_t wfx_tx_queue_get_num_queued(struct wfx_queue *queue, u32 link_id_map);
53
54struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id);
55int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb);
56int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb);
57unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev,
58 struct sk_buff *skb);
59void wfx_pending_dump_old_frames(struct wfx_dev *wdev, unsigned int limit_ms);
60
61#endif /* WFX_QUEUE_H */