Skip to contentSkip to conversation

wifi: rtw89: debugfs: support multiple adapters debugging

PATCH In review Ping-Ke Shih 1 participant 2 messages Aug 16, 2024 – Aug 22, 2024 Realtek wireless driver (rtw89)

lore
Share & tools
lore

Ping-Ke Shih

author maintainer
#0 lore raw

PATCH v2 1/1 wifi: rtw89: debugfs: support multiple adapters debugging

The rtw89 uses debugfs to access registers and driver states. To get a range of registers, the range value is set and stored to a variable, and get the set of register values by the stored range. However, the variable is a static global variable, which multiple adapters will be a problem, so move the variable to adapter context rtw89_dev.

---
v2: fix smatch warning of "rtw89_debugfs_init() parse error: turning off
implications after 60 seconds"

---
 drivers/net/wireless/realtek/rtw89/core.c  |   2 +
 drivers/net/wireless/realtek/rtw89/core.h  |   3 +
 drivers/net/wireless/realtek/rtw89/debug.c | 180 +++++++++++----------
 drivers/net/wireless/realtek/rtw89/debug.h |   2 +
 4 files changed, 100 insertions(+), 87 deletions(-)
drivers/net/wireless/realtek/rtw89/core.c +2 -0
index 7b28f2c2a08e..885c759e694a 100644
@@ -4767,6 +4767,8 @@ EXPORT_SYMBOL(rtw89_core_register);
 void rtw89_core_unregister(struct rtw89_dev *rtwdev)
 {
 	rtw89_core_unregister_hw(rtwdev);
+
+	rtw89_debugfs_deinit(rtwdev);
 }
 EXPORT_SYMBOL(rtw89_core_unregister);
 
drivers/net/wireless/realtek/rtw89/core.h +3 -0
index 3edb2f4372e4..c4702882367e 100644
@@ -21,6 +21,7 @@ struct rtw89_efuse_block_cfg;
 struct rtw89_h2c_rf_tssi;
 struct rtw89_fw_txpwr_track_cfg;
 struct rtw89_phy_rfk_log_fmt;
+struct rtw89_debugfs;
 
 extern const struct ieee80211_ops rtw89_ops;
 
@@ -5529,6 +5530,8 @@ struct rtw89_dev {
 	struct napi_struct napi;
 	int napi_budget_countdown;
 
+	struct rtw89_debugfs *debugfs;
+
 	/* HCI related data, keep last */
 	u8 priv[] __aligned(sizeof(void *));
 };
drivers/net/wireless/realtek/rtw89/debug.c +93 -87

225 lines not on this page · raw message

drivers/net/wireless/realtek/rtw89/debug.h +2 -0
index 800ea59873a1..fc690f7c55dc 100644
@@ -49,8 +49,10 @@ enum rtw89_debug_mac_reg_sel {
 
 #ifdef CONFIG_RTW89_DEBUGFS
 void rtw89_debugfs_init(struct rtw89_dev *rtwdev);
+void rtw89_debugfs_deinit(struct rtw89_dev *rtwdev);
 #else
 static inline void rtw89_debugfs_init(struct rtw89_dev *rtwdev) {}
+static inline void rtw89_debugfs_deinit(struct rtw89_dev *rtwdev) {}
 #endif
 
 #define rtw89_info(rtwdev, a...) dev_info((rtwdev)->dev, ##a)
Signature · 1 line
2.25.1
author maintainer
#1 lore raw
Quoted 7 lines · Ping-Ke Shih

The rtw89 uses debugfs to access registers and driver states. To get a range of registers, the range value is set and stored to a variable, and get the set of register values by the stored range. However, the variable is a static global variable, which multiple adapters will be a problem, so move the variable to adapter context rtw89_dev.

1 patch(es) applied to rtw-next branch of rtw.git, thanks.

a3f00afc250a wifi: rtw89: debugfs: support multiple adapters debugging

---
https://github.com/pkshih/rtw.git