diff options
author | Ping-Ke Shih <pkshih@realtek.com> | 2017-12-29 03:31:10 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2018-01-08 12:07:45 -0500 |
commit | 610247f46feb23beda99d0bb44aa8f51a8dc27e1 (patch) | |
tree | 1c34f56e3580ad9e18f022ade34ce816610942c6 /drivers/net/wireless/realtek/rtlwifi/pci.c | |
parent | 981a2b6e055bce9a9f780fb074ffdf9a9bab0d47 (diff) |
rtlwifi: Improve debugging by using debugfs
Use debugfs to dump register and btcoex status, and also write registers
and h2c.
We create topdir in /sys/kernel/debug/rtlwifi/, and use the MAC address
as subdirectory with several entries to dump mac_reg, bb_reg, rf_reg etc.
An example is
/sys/kernel/debug/rtlwifi/00-11-22-33-44-55-66/mac_0
This change permits examination of device registers in a dynamic manner,
a feature not available with the current debug mechanism.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/realtek/rtlwifi/pci.c')
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/pci.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c index 4013394fac33..c1833a501be4 100644 --- a/drivers/net/wireless/realtek/rtlwifi/pci.c +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c | |||
@@ -2309,6 +2309,9 @@ int rtl_pci_probe(struct pci_dev *pdev, | |||
2309 | } | 2309 | } |
2310 | rtlpriv->mac80211.mac80211_registered = 1; | 2310 | rtlpriv->mac80211.mac80211_registered = 1; |
2311 | 2311 | ||
2312 | /* add for debug */ | ||
2313 | rtl_debug_add_one(hw); | ||
2314 | |||
2312 | /*init rfkill */ | 2315 | /*init rfkill */ |
2313 | rtl_init_rfkill(hw); /* Init PCI sw */ | 2316 | rtl_init_rfkill(hw); /* Init PCI sw */ |
2314 | 2317 | ||
@@ -2357,6 +2360,9 @@ void rtl_pci_disconnect(struct pci_dev *pdev) | |||
2357 | wait_for_completion(&rtlpriv->firmware_loading_complete); | 2360 | wait_for_completion(&rtlpriv->firmware_loading_complete); |
2358 | clear_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status); | 2361 | clear_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status); |
2359 | 2362 | ||
2363 | /* remove form debug */ | ||
2364 | rtl_debug_remove_one(hw); | ||
2365 | |||
2360 | /*ieee80211_unregister_hw will call ops_stop */ | 2366 | /*ieee80211_unregister_hw will call ops_stop */ |
2361 | if (rtlmac->mac80211_registered == 1) { | 2367 | if (rtlmac->mac80211_registered == 1) { |
2362 | ieee80211_unregister_hw(hw); | 2368 | ieee80211_unregister_hw(hw); |