forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/net/can/usb/esd_usb2.c
....@@ -278,7 +278,6 @@
278278 cf->data[2] |= CAN_ERR_PROT_STUFF;
279279 break;
280280 default:
281
- cf->data[3] = ecc & SJA1000_ECC_SEG;
282281 break;
283282 }
284283
....@@ -286,6 +285,9 @@
286285 if (!(ecc & SJA1000_ECC_DIR))
287286 cf->data[2] |= CAN_ERR_PROT_TX;
288287
288
+ /* Bit stream position in CAN frame as the error was detected */
289
+ cf->data[3] = ecc & SJA1000_ECC_SEG;
290
+
289291 if (priv->can.state == CAN_STATE_ERROR_WARNING ||
290292 priv->can.state == CAN_STATE_ERROR_PASSIVE) {
291293 cf->data[1] = (txerr > rxerr) ?