From: Kalle Valo <kvalo@codeaurora.org>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: linux-wireless@vger.kernel.org, Ping-Ke Shih <pkshih@realtek.com>,
Yan-Hsuan Chuang <yhchuang@realtek.com>,
Birming Chiu <birming@realtek.com>, Shaofu <shaofu@realtek.com>,
Steven Ting <steventing@realtek.com>
Subject: Re: [PATCH v2 1/2] rtlwifi: use debugfs to debug.
Date: Wed, 16 Aug 2017 17:54:21 +0300 [thread overview]
Message-ID: <87efsbtvfm.fsf@purkki.adurom.net> (raw)
In-Reply-To: <20170810164744.9336-2-Larry.Finger@lwfinger.net> (Larry Finger's message of "Thu, 10 Aug 2017 11:47:43 -0500")
Larry Finger <Larry.Finger@lwfinger.net> writes:
> From: Ping-Ke Shih <pkshih@realtek.com>
>
> Use debugfs to dump register and btcoex status.
>
> 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.
Not just dump but apparently also to write to registers, I see a
write_reg file there which takes commands like "h2c", "rf" and none
meaning BB/MAC registers. IMHO it would be cleaner to have separate files
for each register type, currently rtl_debugfs_set_write_reg() is pretty
ugly.
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
> Cc: Birming Chiu <birming@realtek.com>
> Cc: Shaofu <shaofu@realtek.com>
> Cc: Steven Ting <steventing@realtek.com>
[...]
> +static ssize_t rtl_debugfs_set_write_reg(struct file *filp,
> + const char __user *buffer,
> + size_t count, loff_t *loff)
> +{
> + struct rtl_debgufs_priv *debugfs_priv = filp->private_data;
> + struct rtl_priv *rtlpriv = debugfs_priv->rtlpriv;
> + struct ieee80211_hw *hw = rtlpriv->hw;
> + char tmp[32 + 1];
> + int tmp_len;
> + u32 addr, val, len;
> + int num;
> +
> + if (count < 3) {
> + /*printk("argument size is less than 3\n");*/
> + return -EFAULT;
> + }
Commented out code. I saw few other cases in this patch also.
--
Kalle Valo
next prev parent reply other threads:[~2017-08-16 14:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-10 16:47 [PATCH v2 0/2] rtlwifi: btcoex: Improve debugging system Larry Finger
2017-08-10 16:47 ` [PATCH v2 1/2] rtlwifi: use debugfs to debug Larry Finger
2017-08-14 4:49 ` Barry Day
2017-08-14 20:50 ` Larry Finger
2017-08-16 14:54 ` Kalle Valo [this message]
2017-08-10 16:47 ` [PATCH v2 2/2] rtlwifi: btcoex: Use seq_file to dump btcoex status Larry Finger
2017-08-16 14:57 ` Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87efsbtvfm.fsf@purkki.adurom.net \
--to=kvalo@codeaurora.org \
--cc=Larry.Finger@lwfinger.net \
--cc=birming@realtek.com \
--cc=linux-wireless@vger.kernel.org \
--cc=pkshih@realtek.com \
--cc=shaofu@realtek.com \
--cc=steventing@realtek.com \
--cc=yhchuang@realtek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).