[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220708181235.4104943-4-frank.jungclaus@esd.eu>
Date: Fri, 8 Jul 2022 20:12:34 +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 3/6] can: esd_usb: Improved behavior on esd CAN_ERROR_EXT event (2)
Moved mislocated supply for cf->data[3] (location of CAN error)
outside of the "switch (ecc & SJA1000_ECC_MASK){}"-statement
Signed-off-by: Frank Jungclaus <frank.jungclaus@....eu>
---
drivers/net/can/usb/esd_usb.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/usb/esd_usb.c b/drivers/net/can/usb/esd_usb.c
index e14f08d30b0b..0a402a23d7ac 100644
--- a/drivers/net/can/usb/esd_usb.c
+++ b/drivers/net/can/usb/esd_usb.c
@@ -294,7 +294,6 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv,
cf->data[2] |= CAN_ERR_PROT_STUFF;
break;
default:
- cf->data[3] = ecc & SJA1000_ECC_SEG;
break;
}
@@ -302,6 +301,9 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv,
if (!(ecc & SJA1000_ECC_DIR))
cf->data[2] |= CAN_ERR_PROT_TX;
+ /* Store error in CAN protocol (location) in data[3] */
+ cf->data[3] = ecc & SJA1000_ECC_SEG;
+
if (priv->can.state == CAN_STATE_ERROR_WARNING ||
priv->can.state == CAN_STATE_ERROR_PASSIVE) {
cf->data[1] = (txerr > rxerr) ?
--
2.25.1
Powered by blists - more mailing lists