]> git.baikalelectronics.ru Git - kernel.git/commit
can: slcan: add ethtool support to reset adapter errors
authorDario Binacchi <dario.binacchi@amarulasolutions.com>
Tue, 28 Jun 2022 16:31:34 +0000 (18:31 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 3 Jul 2022 09:34:44 +0000 (11:34 +0200)
commit4f6e7a4514e17cfdf571c378e06990f53638d4de
treec92b772e7fc77cc9498cceea7d28134a3f25e165
parent0aacfdcd5dfb8ccd1bbb41b4383f2c86609038e9
can: slcan: add ethtool support to reset adapter errors

This patch adds a private flag to the slcan driver to switch the
"err-rst-on-open" setting on and off.

"err-rst-on-open" on  - Reset error states on opening command

"err-rst-on-open" off - Don't reset error states on opening command
                        (default)

The setting can only be changed if the interface is down:

    ip link set dev can0 down
    ethtool --set-priv-flags can0 err-rst-on-open {off|on}
    ip link set dev can0 up

Link: https://lore.kernel.org/all/20220628163137.413025-11-dario.binacchi@amarulasolutions.com
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/slcan/Makefile
drivers/net/can/slcan/slcan-core.c
drivers/net/can/slcan/slcan-ethtool.c [new file with mode: 0644]
drivers/net/can/slcan/slcan.h [new file with mode: 0644]