Re: [PATCH 3/4] Bluetooth: btmrvl: add debug mask debugfs parameter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Amitkumar,

> This patch adds support for debug mask read/write operations
> via debugfs. It is useful during debugging driver logs.
> 
> Examples:
> 
> Read current debug mask:
> cat /sys/kernel/debug/bluetooth/hci0/config/debug_mask
> 
> Update debug mask:
> echo 0xff > /sys/kernel/debug/bluetooth/hci0/config/debug_mask
> 
> Signed-off-by: Zhaoyang Liu <liuzy@xxxxxxxxxxx>
> Signed-off-by: Cathy Luo <cluo@xxxxxxxxxxx>
> Signed-off-by: Amitkumar Karwar <akarwar@xxxxxxxxxxx>
> ---
> drivers/bluetooth/btmrvl_debugfs.c | 51 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 51 insertions(+)
> 
> diff --git a/drivers/bluetooth/btmrvl_debugfs.c b/drivers/bluetooth/btmrvl_debugfs.c
> index 1828ed8..af52b03 100644
> --- a/drivers/bluetooth/btmrvl_debugfs.c
> +++ b/drivers/bluetooth/btmrvl_debugfs.c
> @@ -196,6 +196,55 @@ static const struct file_operations btmrvl_fwdump_fops = {
> 	.llseek = default_llseek,
> };
> 
> +/* Proc debug_mask file read handler.
> + * This function is called when the 'debug_mask' file is opened for reading
> + * This function can be used read driver debugging mask value.
> + */
> +static ssize_t btmrvl_debug_mask_read(struct file *file, char __user *ubuf,
> +				      size_t count, loff_t *ppos)
> +{
> +	struct btmrvl_private *priv = file->private_data;
> +	char buf[32];
> +	int ret;
> +
> +	ret = snprintf(buf, sizeof(buf) - 1, "debug mask=0x%08x\n",
> +		       priv->adapter->debug_mask);

the file is already called debug mask, no need to prefix the file content with some key=val thing. Just return the value.

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux