2019-09-19 14:25:45 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
/*
|
2021-09-13 15:01:56 +02:00
|
|
|
* Queue between the tx operation and the bh workqueue.
|
2019-09-19 14:25:45 +00:00
|
|
|
*
|
2020-10-07 12:19:41 +02:00
|
|
|
* Copyright (c) 2017-2020, Silicon Laboratories, Inc.
|
2019-09-19 14:25:45 +00:00
|
|
|
* Copyright (c) 2010, ST-Ericsson
|
|
|
|
*/
|
|
|
|
#ifndef WFX_QUEUE_H
|
|
|
|
#define WFX_QUEUE_H
|
|
|
|
|
2021-03-09 15:51:56 +01:00
|
|
|
#include <linux/skbuff.h>
|
|
|
|
#include <linux/atomic.h>
|
|
|
|
|
2019-09-19 14:25:45 +00:00
|
|
|
struct wfx_dev;
|
|
|
|
struct wfx_vif;
|
|
|
|
|
|
|
|
struct wfx_queue {
|
2022-01-13 09:55:15 +01:00
|
|
|
struct sk_buff_head normal;
|
|
|
|
struct sk_buff_head cab; /* Content After (DTIM) Beacon */
|
2023-10-04 19:28:42 +02:00
|
|
|
struct sk_buff_head offchan;
|
2022-01-13 09:55:15 +01:00
|
|
|
atomic_t pending_frames;
|
|
|
|
int priority;
|
2019-09-19 14:25:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void wfx_tx_lock(struct wfx_dev *wdev);
|
|
|
|
void wfx_tx_unlock(struct wfx_dev *wdev);
|
|
|
|
void wfx_tx_flush(struct wfx_dev *wdev);
|
|
|
|
void wfx_tx_lock_flush(struct wfx_dev *wdev);
|
|
|
|
|
2020-07-01 17:06:55 +02:00
|
|
|
void wfx_tx_queues_init(struct wfx_vif *wvif);
|
|
|
|
void wfx_tx_queues_check_empty(struct wfx_vif *wvif);
|
2020-04-01 13:03:53 +02:00
|
|
|
bool wfx_tx_queues_has_cab(struct wfx_vif *wvif);
|
2020-07-01 17:06:55 +02:00
|
|
|
void wfx_tx_queues_put(struct wfx_vif *wvif, struct sk_buff *skb);
|
2022-01-13 09:55:11 +01:00
|
|
|
struct wfx_hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev);
|
2019-09-19 14:25:45 +00:00
|
|
|
|
2020-07-01 17:06:55 +02:00
|
|
|
bool wfx_tx_queue_empty(struct wfx_vif *wvif, struct wfx_queue *queue);
|
|
|
|
void wfx_tx_queue_drop(struct wfx_vif *wvif, struct wfx_queue *queue,
|
|
|
|
struct sk_buff_head *dropped);
|
2019-09-19 14:25:45 +00:00
|
|
|
|
2020-07-01 17:06:57 +02:00
|
|
|
struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id);
|
2020-04-01 13:04:01 +02:00
|
|
|
void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped);
|
2022-01-13 09:55:13 +01:00
|
|
|
unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, struct sk_buff *skb);
|
2019-09-19 14:25:45 +00:00
|
|
|
void wfx_pending_dump_old_frames(struct wfx_dev *wdev, unsigned int limit_ms);
|
|
|
|
|
2021-09-13 15:02:00 +02:00
|
|
|
#endif
|