diff mbox series

[36/38] ra6w: add tx.h

Message ID 20250417135236.52410-37-oleksandr.savchenko.dn@bp.renesas.com
State New
Headers show
Series wireless: ra6w driver for Renesas IEEE 802.11ax devices | expand

Commit Message

Alexander Savchenko April 17, 2025, 1:52 p.m. UTC
Part of the split. Please, take a look at the cover letter for more details

Reviewed-by: Viktor Barna <viktor.barna.rj@bp.renesas.com>
Reviewed-by: Gal Gur <gal.gur.jx@renesas.com>
Signed-off-by: Alexander Savchenko <oleksandr.savchenko.dn@bp.renesas.com>
---
 drivers/net/wireless/renesas/ra6w/tx.h | 69 ++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)
 create mode 100644 drivers/net/wireless/renesas/ra6w/tx.h
diff mbox series

Patch

diff --git a/drivers/net/wireless/renesas/ra6w/tx.h b/drivers/net/wireless/renesas/ra6w/tx.h
new file mode 100644
index 000000000000..3020946468af
--- /dev/null
+++ b/drivers/net/wireless/renesas/ra6w/tx.h
@@ -0,0 +1,69 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (C) [2022-2025] Renesas Electronics Corporation and/or its affiliates.
+ */
+
+#ifndef RA6W_TX_H
+#define RA6W_TX_H
+
+#include <net/cfg80211.h>
+
+#include "q.h"
+
+#define RA6W_TX_EXT_LEN		(sizeof(struct ra6w_tx_ext_hdr))
+#define RA6W_TX_BUF_Q_MAX	128
+#define RA6W_TX_POWER_BUF_Q_MAX	32
+
+enum ra6w_tx_data_ac {
+	RA6W_TX_DATA_AC,
+	RA6W_TX_DATA_AC_POWER,
+
+	RA6W_TX_DATA_AC_MAX,
+};
+
+#define RA6W_TX_EVENT_RESET	RA6W_TX_DATA_AC_MAX
+#define RA6W_TX_EVENT_MASK	(BIT(RA6W_TX_DATA_AC) | \
+				BIT(RA6W_TX_DATA_AC_POWER) | \
+				BIT(RA6W_TX_EVENT_RESET))
+
+#define RA6W_TX_EVENT_TIMEOUT_MS 100
+
+struct ra6w_tx_ext_hdr {
+	u32 buf_idx : 3;
+	u32 tid : 5;
+	u32 vif_idx : 8;
+	u32 sta_idx : 8;
+	u32 flags : 10;
+	u32 sn : 24;
+};
+
+struct ra6w_tx_buf {
+	u8 cmd;
+	u8 ext_len;
+	__le16 data_len;
+	struct ra6w_tx_ext_hdr ext_hdr;
+	u8 data[RA6W_CMD_DATA_SIZE];
+};
+
+struct ra6w_tx_q_ac {
+	struct ra6w_q q;
+};
+
+struct ra6w_tx {
+	struct task_struct *task;
+	struct ra6w_q_event event;
+	struct ra6w_tx_q_ac q_ac[RA6W_TX_DATA_AC_MAX];
+};
+
+struct ra6w_cfg80211_vif;
+struct ra6w_cfg80211_sta;
+
+int ra6w_tx_init(struct ra6w_tx *tx);
+void ra6w_tx_deinit(struct ra6w_tx *tx);
+int ra6w_tx_event_post(struct ra6w_tx *tx, u8 ac, struct sk_buff *skb);
+int ra6w_tx_mgmt(struct ra6w_tx *tx, const struct ra6w_cfg80211_vif *vif,
+		 const struct ra6w_cfg80211_sta *sta,
+		 const struct cfg80211_mgmt_tx_params *params,
+		 u64 *cookie);
+
+#endif /* RA6W_TX_H */