diff options
author | Jeroen Hofstee <jhofstee@victronenergy.com> | 2022-08-28 10:59:10 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2022-10-20 11:59:27 +0200 |
commit | 2f3cdad1c616891ab25ce10c1ac146403605b960 (patch) | |
tree | 2ae8ab8b383dfbbdc0ca7f98c699d40d6e45b733 /drivers/net/can | |
parent | can: gs_usb: document GS_CAN_FEATURE_BERR_REPORTING (diff) | |
download | linux-2f3cdad1c616891ab25ce10c1ac146403605b960.tar.xz linux-2f3cdad1c616891ab25ce10c1ac146403605b960.zip |
can: gs_usb: add ability to enable / disable berr reporting
The open source firmware candleLight report bus errors
unconditionally. This adds support to enable / disable bus error
reporting with the standard netlink property.
Signed-off-by: Jeroen Hofstee <jhofstee@victronenergy.com>
Link: https://lore.kernel.org/all/20221019221016.1659260-6-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can')
-rw-r--r-- | drivers/net/can/usb/gs_usb.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c index 68e474a762c5..e2e23467caf2 100644 --- a/drivers/net/can/usb/gs_usb.c +++ b/drivers/net/can/usb/gs_usb.c @@ -921,6 +921,9 @@ static int gs_can_open(struct net_device *netdev) if (ctrlmode & CAN_CTRLMODE_ONE_SHOT) flags |= GS_CAN_MODE_ONE_SHOT; + if (ctrlmode & CAN_CTRLMODE_BERR_REPORTING) + flags |= GS_CAN_MODE_BERR_REPORTING; + if (ctrlmode & CAN_CTRLMODE_FD) flags |= GS_CAN_MODE_FD; @@ -1226,6 +1229,9 @@ static struct gs_can *gs_make_candev(unsigned int channel, } } + if (feature & GS_CAN_FEATURE_BERR_REPORTING) + dev->can.ctrlmode_supported |= CAN_CTRLMODE_BERR_REPORTING; + /* The CANtact Pro from LinkLayer Labs is based on the * LPC54616 µC, which is affected by the NXP LPC USB transfer * erratum. However, the current firmware (version 2) doesn't |