1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Data transmitting implementation.
4 *
5 * Copyright (c) 2017-2020, Silicon Laboratories, Inc.
6 * Copyright (c) 2010, ST-Ericsson
7 */
8#ifndef WFX_DATA_TX_H
9#define WFX_DATA_TX_H
10
11#include <linux/list.h>
12#include <net/mac80211.h>
13
14#include "hif_api_cmd.h"
15#include "hif_api_mib.h"
16
17struct wfx_tx_priv;
18struct wfx_dev;
19struct wfx_vif;
20
21struct wfx_tx_policy {
22	struct list_head link;
23	int usage_count;
24	u8 rates[12];
25	bool uploaded;
26};
27
28struct wfx_tx_policy_cache {
29	struct wfx_tx_policy cache[HIF_TX_RETRY_POLICY_MAX];
30	/* FIXME: use a trees and drop hash from tx_policy */
31	struct list_head used;
32	struct list_head free;
33	spinlock_t lock;
34};
35
36struct wfx_tx_priv {
37	ktime_t xmit_timestamp;
38	unsigned char icv_size;
39	unsigned char vif_id;
40};
41
42void wfx_tx_policy_init(struct wfx_vif *wvif);
43void wfx_tx_policy_upload_work(struct work_struct *work);
44
45void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struct sk_buff *skb);
46void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct wfx_hif_cnf_tx *arg);
47void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u32 queues, bool drop);
48
49struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb);
50struct wfx_hif_req_tx *wfx_skb_txreq(struct sk_buff *skb);
51struct wfx_vif *wfx_skb_wvif(struct wfx_dev *wdev, struct sk_buff *skb);
52
53#endif
54