Dario Binacchi 4de0e8efa0 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>
2022-07-03 11:34:44 +02:00

19 lines
601 B
C

/* SPDX-License-Identifier: GPL-2.0
* slcan.h - serial line CAN interface driver
*
* Copyright (C) Laurence Culhane <loz@holmes.demon.co.uk>
* Copyright (C) Fred N. van Kempen <waltje@uwalt.nl.mugnet.org>
* Copyright (C) Oliver Hartkopp <socketcan@hartkopp.net>
* Copyright (C) 2022 Amarula Solutions, Dario Binacchi <dario.binacchi@amarulasolutions.com>
*
*/
#ifndef _SLCAN_H
#define _SLCAN_H
bool slcan_err_rst_on_open(struct net_device *ndev);
int slcan_enable_err_rst_on_open(struct net_device *ndev, bool on);
void slcan_set_ethtool_ops(struct net_device *ndev);
#endif /* _SLCAN_H */