git: b4886c4ece3e - main - rtw88/rtw89: avoid duplicate top-level directory with debugfs
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 31 Jan 2025 23:53:45 UTC
The branch main has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=b4886c4ece3e692c294aa853da7aec849f8d00a2
commit b4886c4ece3e692c294aa853da7aec849f8d00a2
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-01-25 23:55:53 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-01-31 23:53:31 +0000
rtw88/rtw89: avoid duplicate top-level directory with debugfs
If people like me having multiple cards in the same system
creating the debugfs dirctory leads to a panic upon attaching
the 2nd card due to the duplicate name.
Rather than using the hard coded driver name, use the device name
(e.g., rtw880, rtw881, rtw882).
This solves two issues: it avoids the duplicate name and we get
individual debugging/statistic information for each card.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
X-Note: ath1[01]k and mt76 likely will need a similar change
---
sys/contrib/dev/rtw88/debug.c | 4 ++++
sys/contrib/dev/rtw89/debug.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/sys/contrib/dev/rtw88/debug.c b/sys/contrib/dev/rtw88/debug.c
index e84f25b34c46..1373633d73ee 100644
--- a/sys/contrib/dev/rtw88/debug.c
+++ b/sys/contrib/dev/rtw88/debug.c
@@ -1223,7 +1223,11 @@ void rtw_debugfs_init(struct rtw_dev *rtwdev)
{
struct dentry *debugfs_topdir;
+#if defined(__linux__)
debugfs_topdir = debugfs_create_dir("rtw88",
+#elif defined(__FreeBSD__)
+ debugfs_topdir = debugfs_create_dir(dev_name(rtwdev->dev),
+#endif
rtwdev->hw->wiphy->debugfsdir);
rtw_debugfs_add_w(write_reg);
rtw_debugfs_add_rw(read_reg);
diff --git a/sys/contrib/dev/rtw89/debug.c b/sys/contrib/dev/rtw89/debug.c
index 750ef1578e18..a87f4b49829d 100644
--- a/sys/contrib/dev/rtw89/debug.c
+++ b/sys/contrib/dev/rtw89/debug.c
@@ -3974,7 +3974,11 @@ void rtw89_debugfs_init(struct rtw89_dev *rtwdev)
{
struct dentry *debugfs_topdir;
+#if defined(__linux__)
debugfs_topdir = debugfs_create_dir("rtw89",
+#elif defined(__FreeBSD__)
+ debugfs_topdir = debugfs_create_dir(dev_name(rtwdev->dev),
+#endif
rtwdev->hw->wiphy->debugfsdir);
rtw89_debugfs_add_rw(read_reg);