diff mbox series

[26/38] ra6w: add rx.h

Message ID 20250417135236.52410-27-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/rx.h | 105 +++++++++++++++++++++++++
 1 file changed, 105 insertions(+)
 create mode 100644 drivers/net/wireless/renesas/ra6w/rx.h
diff mbox series

Patch

diff --git a/drivers/net/wireless/renesas/ra6w/rx.h b/drivers/net/wireless/renesas/ra6w/rx.h
new file mode 100644
index 000000000000..10ee61b3ed6f
--- /dev/null
+++ b/drivers/net/wireless/renesas/ra6w/rx.h
@@ -0,0 +1,105 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (C) [2022-2025] Renesas Electronics Corporation and/or its affiliates.
+ */
+
+#ifndef RA6W_RX_H
+#define RA6W_RX_H
+
+#include <linux/bitops.h>
+
+#include "q.h"
+
+#define RA6W_RX_EXT_LEN	(sizeof(struct ra6w_rx_ext_hdr))
+#define RA6W_RX_BUF_Q_MAX	64
+
+enum ra6w_rx_ext_hdr_flags {
+	RA6W_EXT_FLAGS_MGMT_BIT = BIT(1),
+	RA6W_EXT_FLAGS_MGMT_NO_CCK_BIT = BIT(2),
+	RA6W_EXT_FLAGS_AMSDU_BIT = BIT(3),
+	RA6W_EXT_FLAGS_MGMT_ROBUST_BIT = BIT(4),
+	RA6W_EXT_FLAGS_4ADDR_BIT = BIT(5),
+	RA6W_EXT_FLAGS_EOSP_BIT = BIT(6),
+	RA6W_EXT_FLAGS_MESH_FWD_BIT = BIT(7),
+	RA6W_EXT_FLAGS_TDLS_BIT = BIT(8),
+	RA6W_EXT_FLAGS_SN_BIT = BIT(9)
+};
+
+struct ra6w_rx_ext_ht {
+	u16 short_gi : 1;
+	u16 mcs : 7;
+	u16 num_extn_ss : 2;
+	u16 reserved : 6;
+};
+
+struct ra6w_rx_ext_vht {
+	u16 short_gi : 1;
+	u16 mcs : 7;
+	u16 nss : 3;
+	u16 reserved : 5;
+};
+
+struct ra6w_rx_ext_he {
+	u16 ru_size : 3;
+	u16 mcs : 7;
+	u16 nss : 3;
+	u16 gi_type : 2;
+	u16 dcm : 1;
+};
+
+struct ra6w_rx_ext_hdr {
+	u32 status : 32;
+	u32 amsdu : 1;
+	u32 mpdu : 1;
+	u32 addr_4 : 1;
+	u32 mesh_peer_new : 1;
+	u32 priority : 3;
+	u32 vif_idx : 8;
+	u32 sta_idx : 8;
+	u32 dest_sta_idx : 8;
+	u32 ch_bw : 2;
+	u32 rssi1 : 8;
+	u32 band : 4;
+	u32 channel_type : 8;
+	u32 prim20_freq : 16;
+	u32 center1_freq : 16;
+	u32 center2_freq : 16;
+	u32 format_mod : 4;
+	u32 pre_type : 1;
+	u32 leg_rate : 4;
+
+	union {
+		struct ra6w_rx_ext_ht ht;
+		struct ra6w_rx_ext_vht vht;
+		struct ra6w_rx_ext_he he;
+	};
+};
+
+struct ra6w_rx_buf {
+	u8 cmd;
+	u8 ext_len;
+	__le16 data_len;
+	struct ra6w_rx_ext_hdr ext_hdr;
+	u8 data[RA6W_CMD_DATA_SIZE];
+};
+
+enum ra6w_rx_data_event {
+	RA6W_RX_DATA_EVENT,
+
+	RA6W_RX_DATA_EVENT_MAX,
+};
+
+#define RA6W_RX_EVENT_RESET	RA6W_RX_DATA_EVENT_MAX
+#define RA6W_RX_EVENT_MASK	(BIT(RA6W_RX_DATA_EVENT) | BIT(RA6W_RX_EVENT_RESET))
+
+struct ra6w_rx {
+	struct task_struct *task;
+	struct ra6w_q_event event;
+	struct ra6w_q q;
+};
+
+int ra6w_rx_init(struct ra6w_rx *rx);
+void ra6w_rx_deinit(struct ra6w_rx *rx);
+int ra6w_rx_event_post(struct ra6w_rx *rx, struct sk_buff *skb);
+
+#endif /* RA6W_RX_H */