diff mbox series

[30/38] ra6w: add stats.h

Message ID 20250417135236.52410-31-oleksandr.savchenko.dn@bp.renesas.com (mailing list archive)
State New
Delegated to: Johannes Berg
Headers show
Series wireless: ra6w driver for Renesas IEEE 802.11ax devices | expand

Checks

Context Check Description
wifibot/tree_selection success Guessed tree name to be wireless-next
wifibot/fixes_present success Fixes tag not required for -next series
wifibot/series_format fail Series longer than 15 patches; Target tree name not specified in the subject
wifibot/ynl success Generated files up to date; no warnings/errors; no diff in generated;
wifibot/build_clang fail Errors and warnings before: 5 this patch: 5
wifibot/build_clang_rust success No Rust files in patch. Skipping build
wifibot/build_tools success No tools touched, skip
wifibot/check_selftest success No net selftest shell script
wifibot/deprecated_api success None detected
wifibot/header_inline success No static functions without inline keyword in header files
wifibot/source_inline success Was 0 now: 0
wifibot/verify_fixes success No Fixes tag
wifibot/build_32bit fail Errors and warnings before: 5 this patch: 5
wifibot/build_allmodconfig_warn fail Errors and warnings before: 5 this patch: 5
wifibot/checkpatch warning WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? WARNING: line length of 83 exceeds 80 columns
wifibot/kdoc success Errors and warnings before: 0 this patch: 0
wifibot/verify_signedoff success Signed-off-by tag matches author and committer

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/stats.h | 100 ++++++++++++++++++++++
 1 file changed, 100 insertions(+)
 create mode 100644 drivers/net/wireless/renesas/ra6w/stats.h
diff mbox series

Patch

diff --git a/drivers/net/wireless/renesas/ra6w/stats.h b/drivers/net/wireless/renesas/ra6w/stats.h
new file mode 100644
index 000000000000..06e870f6ae0f
--- /dev/null
+++ b/drivers/net/wireless/renesas/ra6w/stats.h
@@ -0,0 +1,100 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (C) [2022-2025] Renesas Electronics Corporation and/or its affiliates.
+ */
+
+#ifndef RA6W_STATS_H
+#define RA6W_STATS_H
+
+#define RA6W_MCS_MAX_HT		8
+#define RA6W_MCS_MAX_VHT	9
+#define RA6W_MCS_MAX_HE		12
+#define RA6W_GI_MAX_HT		2
+#define RA6W_GI_MAX_VHT		2
+#define RA6W_GI_MAX_HE		3
+
+enum ra6w_stats_bits {
+	RA6W_STATS_RX_CCK_BIT = BIT(0),
+	RA6W_STATS_RX_OFDM_BIT = BIT(1),
+	RA6W_STATS_RX_HT_BIT = BIT(2),
+	RA6W_STATS_RX_VHT_BIT = BIT(3),
+	RA6W_STATS_RX_HE_SU_BIT = BIT(4),
+	RA6W_STATS_RX_HE_MU_BIT = BIT(5),
+	RA6W_STATS_RX_HE_EXT_BIT = BIT(6),
+	RA6W_STATS_RX_HE_TRIGFLAG_LONG_BIT = BIT(7)
+};
+
+enum ra6w_stats_status {
+	RA6W_STATS_STATUS_DISABLED,
+	RA6W_STATS_STATUS_ENABLED,
+
+	RA6W_STATS_STATUS_MAX
+};
+
+struct ra6w_stats_non_ht {
+	u8 bw;
+	u64 ofdm;
+	u64 cck;
+};
+
+struct ra6w_stats_rx {
+	u8 format_mode;
+	u8 flags;
+	struct ra6w_stats_non_ht non_ht;
+	struct {
+		u8 bw;
+		u8 mcs;
+		u8 gi;
+		u8 nss;
+		u64 ht[RA6W_GI_MAX_HT][RA6W_MCS_MAX_HT];
+	} ht;
+	struct {
+		u8 bw;
+		u8 mcs;
+		u8 gi;
+		u8 nss;
+		u64 vht[RA6W_GI_MAX_VHT][RA6W_MCS_MAX_VHT];
+	} vht;
+	struct {
+		u8 bw;
+		u8 mcs;
+		u8 gi;
+		u8 nss;
+		u64 he[RA6W_GI_MAX_HE][RA6W_MCS_MAX_HE];
+	} he_su;
+};
+
+struct ra6w_stats {
+	struct ra6w_stats_rx *rx_stats;
+	bool stats_enabled;
+};
+
+struct ra6w_cfg80211_sta_stats;
+
+#ifdef CONFIG_NL80211_TESTMODE
+
+int ra6w_stats_init(struct ra6w_stats *stats);
+void ra6w_stats_deinit(struct ra6w_stats *stats);
+void ra6w_stats_rx_update(struct ra6w_stats *stats,
+			  const struct ra6w_cfg80211_sta_stats *sta_stats);
+
+#else
+
+static inline int ra6w_stats_init(struct ra6w_stats *stats)
+{
+	return 0;
+}
+
+static inline void ra6w_stats_deinit(struct ra6w_stats *stats)
+{
+}
+
+static inline
+void ra6w_stats_rx_update(struct ra6w_stats *stats,
+			  const struct ra6w_cfg80211_sta_stats *sta_stats)
+{
+}
+
+#endif /* CONFIG_NL80211_TESTMODE */
+
+#endif /* RA6W_STATS_H */