[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220708181235.4104943-3-frank.jungclaus@esd.eu>
Date: Fri, 8 Jul 2022 20:12:33 +0200
From: Frank Jungclaus <frank.jungclaus@....eu>
To: linux-can@...r.kernel.org, Marc Kleine-Budde <mkl@...gutronix.de>,
Wolfgang Grandegger <wg@...ndegger.com>,
Vincent Mailhol <mailhol.vincent@...adoo.fr>
Cc: Stefan Mätje <stefan.maetje@....eu>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Frank Jungclaus <frank.jungclaus@....eu>
Subject: [PATCH 2/6] can: esd_usb: Improved behavior on esd CAN_ERROR_EXT event (1)
Always report CAN_ERR_PROT | CAN_ERR_BUSERROR if ESD_EV_CAN_ERROR_EXT
and ecc != 0. Before we missed those EVENTs when state was unequal to
priv->old_state
Signed-off-by: Frank Jungclaus <frank.jungclaus@....eu>
---
drivers/net/can/usb/esd_usb.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/usb/esd_usb.c b/drivers/net/can/usb/esd_usb.c
index 0b907bc54b70..e14f08d30b0b 100644
--- a/drivers/net/can/usb/esd_usb.c
+++ b/drivers/net/can/usb/esd_usb.c
@@ -274,12 +274,15 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv,
rxerr = 0;
break;
}
- } else {
+ }
+
+ if (ecc) {
priv->can.can_stats.bus_error++;
stats->rx_errors++;
cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR;
+ /* Store error in CAN protocol (type) in data[2] */
switch (ecc & SJA1000_ECC_MASK) {
case SJA1000_ECC_BIT:
cf->data[2] |= CAN_ERR_PROT_BIT;
--
2.25.1
Powered by blists - more mailing lists