Thread (62 messages) 62 messages, 10 authors, 2019-01-07

[RFC net-next 08/15] net: lora: sx1276: Add debugfs

From: afaerber@suse.de (Andreas Färber)
Date: 2018-07-02 17:58:05
Also in: lkml, netdev

Am 02.07.2018 um 18:26 schrieb Jiri Pirko:
Sun, Jul 01, 2018 at 01:07:57PM CEST, afaerber at suse.de wrote:
quoted
Allow some interactive inspection at runtime via debugfs.

Signed-off-by: Andreas F?rber <afaerber@suse.de>
[...]
quoted
@@ -566,6 +691,10 @@ static int sx1276_probe(struct spi_device *spi)
		return ret;
	}

+	priv->debugfs = debugfs_create_dir(dev_name(&spi->dev), NULL);
+	debugfs_create_file("state", S_IRUGO, priv->debugfs, netdev, &sx1276_state_fops);
+	debugfs_create_file("frequency", S_IRUGO, priv->debugfs, netdev, &sx1276_freq_fops);
Hmm. These look like useful information not only for debugging. I think
it would be worth to expose these via some standard uapi. Like generic
netlink, similar to nl80211
Which API to use for reading/writing such config data was question 4) in
my cover letter. :)

"frequency" was added first and helped me debug a calculation overflow.
Netlink might indeed be an option here, haven't worked on it before,
I'll look into nl80211. Thanks.

"state" was just a partial dump of SPI registers, to monitor status
changes after the initial probe or other callbacks with printks, while
debugging GPIO interrupts iirc. So I'd think merging that to mainline
would be unnecessary, but it could remain useful during development.

Cheers,
Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help