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
This commit is contained in:
Bjoern A. Zeeb 2025-01-25 23:55:53 +00:00
parent 446eab491e
commit b4886c4ece
2 changed files with 8 additions and 0 deletions

View file

@ -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);

View file

@ -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);