net: sfp: add debugfs support
authorRussell King <rmk+kernel@armlinux.org.uk>
Sun, 10 Jan 2021 10:59:38 +0000 (10:59 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 13 Jan 2021 04:01:56 +0000 (20:01 -0800)
commit9cc8976c69eb626a7a5100239eb7c69b1a1a609f
treeee7bc18ef6055edf07f488b23ba77cfb1f5d1197
parentb866e72ca031f4462aa755d5ee66bdfd02357fa6
net: sfp: add debugfs support

Add debugfs support to SFP so that the internal state of the SFP state
machines and hardware signal state can be viewed from userspace, rather
than having to compile a debug kernel to view state transitions in the
kernel log.  The 'state' output looks like:

Module state: empty
Module probe attempts: 0 0
Device state: up
Main state: down
Fault recovery remaining retries: 5
PHY probe remaining retries: 12
moddef0: 0
rx_los: 1
tx_fault: 1
tx_disable: 1

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/E1kyYRe-0004kN-3F@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/sfp.c