Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 610247f4 authored by Ping-Ke Shih's avatar Ping-Ke Shih Committed by Kalle Valo
Browse files

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: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 981a2b6e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2530,6 +2530,9 @@ static int __init rtl_core_module_init(void)
	if (rtl_rate_control_register())
		pr_err("rtl: Unable to register rtl_rc, use default RC !!\n");

	/* add debugfs */
	rtl_debugfs_add_topdir();

	/* init some global vars */
	INIT_LIST_HEAD(&rtl_global_var.glb_priv_list);
	spin_lock_init(&rtl_global_var.glb_list_lock);
@@ -2541,6 +2544,9 @@ static void __exit rtl_core_module_exit(void)
{
	/*RC*/
	rtl_rate_control_unregister();

	/* remove debugfs */
	rtl_debugfs_remove_topdir();
}

module_init(rtl_core_module_init);
+2 −1
Original line number Diff line number Diff line
@@ -1513,7 +1513,8 @@ void exhalbtc_set_single_ant_path(u8 single_ant_path)
	gl_bt_coexist.board_info.single_ant_path = single_ant_path;
}

void exhalbtc_display_bt_coex_info(struct btc_coexist *btcoexist)
void exhalbtc_display_bt_coex_info(struct btc_coexist *btcoexist,
				   struct seq_file *m)
{
	if (!halbtc_is_bt_coexist_available(btcoexist))
		return;
+2 −1
Original line number Diff line number Diff line
@@ -626,7 +626,8 @@ void exhalbtc_update_min_bt_rssi(s8 bt_rssi);
void exhalbtc_set_bt_exist(bool bt_exist);
void exhalbtc_set_chip_type(u8 chip_type);
void exhalbtc_set_ant_num(struct rtl_priv *rtlpriv, u8 type, u8 ant_num);
void exhalbtc_display_bt_coex_info(struct btc_coexist *btcoexist);
void exhalbtc_display_bt_coex_info(struct btc_coexist *btcoexist,
				   struct seq_file *m);
void exhalbtc_signal_compensation(struct btc_coexist *btcoexist,
				  u8 *rssi_wifi, u8 *rssi_bt);
void exhalbtc_lps_leave(struct btc_coexist *btcoexist);
+6 −0
Original line number Diff line number Diff line
@@ -52,8 +52,14 @@ static struct rtl_btc_ops rtl_btc_operation = {
	.btc_is_bt_ctrl_lps = rtl_btc_is_bt_ctrl_lps,
	.btc_is_bt_lps_on = rtl_btc_is_bt_lps_on,
	.btc_get_ampdu_cfg = rtl_btc_get_ampdu_cfg,
	.btc_display_bt_coex_info = rtl_btc_display_bt_coex_info,
};

void rtl_btc_display_bt_coex_info(struct rtl_priv *rtlpriv, struct seq_file *m)
{
	exhalbtc_display_bt_coex_info(&gl_bt_coexist, m);
}

void rtl_btc_record_pwr_mode(struct rtl_priv *rtlpriv, u8 *buf, u8 len)
{
	u8 safe_len;
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ bool rtl_btc_is_limited_dig(struct rtl_priv *rtlpriv);
bool rtl_btc_is_disable_edca_turbo(struct rtl_priv *rtlpriv);
bool rtl_btc_is_bt_disabled(struct rtl_priv *rtlpriv);
void rtl_btc_special_packet_notify(struct rtl_priv *rtlpriv, u8 pkt_type);
void rtl_btc_display_bt_coex_info(struct rtl_priv *rtlpriv, struct seq_file *m);
void rtl_btc_record_pwr_mode(struct rtl_priv *rtlpriv, u8 *buf, u8 len);
u8   rtl_btc_get_lps_val(struct rtl_priv *rtlpriv);
u8   rtl_btc_get_rpwm_val(struct rtl_priv *rtlpriv);
Loading