diff mbox series

[08/38] ra6w: add core.h

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

Patch

diff --git a/drivers/net/wireless/renesas/ra6w/core.h b/drivers/net/wireless/renesas/ra6w/core.h
new file mode 100644
index 000000000000..78f7102e15f6
--- /dev/null
+++ b/drivers/net/wireless/renesas/ra6w/core.h
@@ -0,0 +1,99 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (C) [2022-2025] Renesas Electronics Corporation and/or its affiliates.
+ */
+
+#ifndef RA6W_CORE_H
+#define RA6W_CORE_H
+
+#include <linux/spinlock.h>
+#include <linux/mutex.h>
+#include <linux/completion.h>
+#include <linux/workqueue.h>
+#include <linux/netdevice.h>
+
+#include "status.h"
+#include "cmd.h"
+#include "rx.h"
+#include "tx.h"
+#include "indi.h"
+#include "ctrl.h"
+#include "sdio.h"
+#include "recovery.h"
+
+#define RA6W_BASE_HDR_SIZE			(sizeof(u8) + sizeof(u8) + sizeof(u16))
+#define RA6W_GET_DATA_SIZE(ext_len, data_len)	(RA6W_BASE_HDR_SIZE + (ext_len) + (data_len))
+
+struct ra6w_core_stat {
+	u32 packets;
+	u32 err;
+};
+
+struct ra6w_core_stats {
+	struct ra6w_core_stat tx;
+	struct ra6w_core_stat rx;
+};
+
+struct ra6w_sys_info {
+	struct ra6w_cmd_fw_ver_rsp fw_ver;
+	char fw_version[32];
+	u8 machw_support_type;
+	u8 default_mac[ETH_ALEN];
+};
+
+enum ra6w_core_data_event {
+	RA6W_CORE_EVENT_DATA,
+
+	RA6W_CORE_EVENT_DATA_MAX,
+};
+
+#define RA6W_CORE_EVENT_RESET RA6W_CORE_EVENT_DATA_MAX
+#define RA6W_CORE_EVENT_MASK (BIT(RA6W_CORE_EVENT_DATA) | BIT(RA6W_CORE_EVENT_RESET))
+
+enum ra6w_core_handler_id {
+	RA6W_CORE_HNDL_RX,
+	RA6W_CORE_HNDL_CTRL,
+	RA6W_CORE_HNDL_INDI,
+	RA6W_CORE_HNDL_STATUS,
+
+	RA6W_CORE_HNDL_MAX,
+};
+
+/*
+ * @priv: private cfg80211 data
+ * @task: main kthread task
+ * @event: main kthread event data
+ * @status: status of Tx, Rx, ctrl fw routines
+ * @ctrl: synchronous fw routine data
+ * @indi: asynchronous fw routine data
+ * @rx: Rx routine data
+ * @tx: Tx routine data
+ * @stats: Rx, Tx statistics
+ * @sinfo: fw version information
+ * @recovery: recovery data
+ */
+struct ra6w_core {
+	struct ra6w_cfg80211_priv *priv;
+	struct task_struct *task;
+	struct ra6w_q_event event;
+	struct ra6w_status status;
+	struct ra6w_ctrl ctrl;
+	struct ra6w_indi indi;
+	struct ra6w_rx rx;
+	struct ra6w_tx tx;
+	struct ra6w_core_stats stats;
+	struct ra6w_sys_info sinfo;
+	struct ra6w_recovery recovery;
+};
+
+union ra6w_core_data {
+	struct ra6w_rx_buf rx;
+	struct ra6w_indi_buf indi;
+	struct ra6w_ctrl_rsp ctrl;
+};
+
+int ra6w_core_init(struct ra6w_core *core);
+void ra6w_core_deinit(struct ra6w_core *core);
+int ra6w_core_post_init(struct ra6w_core *core);
+
+#endif /* RA6W_CORE_H */