include: update linux/can/error.h

Update the linux/can/error.h hearder to incorporate the changes made
in Linux 6.0.0. Namely:

  - commit 3e5c291c7942 ("can: add CAN_ERR_CNT flag to notify
    availability of error counter")
    Link: https://git.kernel.org/torvalds/linux/c/3e5c291c7942

  - commit 3f9c26210cf8 ("can: error: add definitions for the
    different CAN error thresholds")
    Link: https://git.kernel.org/torvalds/linux/c/3f9c26210cf8

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/all/20221114163848.3398-3-mailhol.vincent@wanadoo.fr
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
pull/387/head
Vincent Mailhol 2022-11-15 01:38:44 +09:00 committed by Marc Kleine-Budde
parent 4c9f046615
commit f3ce3efe66
1 changed files with 19 additions and 1 deletions

View File

@ -57,6 +57,8 @@
#define CAN_ERR_BUSOFF 0x00000040U /* bus off */ #define CAN_ERR_BUSOFF 0x00000040U /* bus off */
#define CAN_ERR_BUSERROR 0x00000080U /* bus error (may flood!) */ #define CAN_ERR_BUSERROR 0x00000080U /* bus error (may flood!) */
#define CAN_ERR_RESTARTED 0x00000100U /* controller restarted */ #define CAN_ERR_RESTARTED 0x00000100U /* controller restarted */
#define CAN_ERR_CNT 0x00000200U /* TX error counter / data[6] */
/* RX error counter / data[7] */
/* arbitration lost in bit ... / data[0] */ /* arbitration lost in bit ... / data[0] */
#define CAN_ERR_LOSTARB_UNSPEC 0x00 /* unspecified */ #define CAN_ERR_LOSTARB_UNSPEC 0x00 /* unspecified */
@ -120,6 +122,22 @@
#define CAN_ERR_TRX_CANL_SHORT_TO_GND 0x70 /* 0111 0000 */ #define CAN_ERR_TRX_CANL_SHORT_TO_GND 0x70 /* 0111 0000 */
#define CAN_ERR_TRX_CANL_SHORT_TO_CANH 0x80 /* 1000 0000 */ #define CAN_ERR_TRX_CANL_SHORT_TO_CANH 0x80 /* 1000 0000 */
/* controller specific additional information / data[5..7] */ /* data[5] is reserved (do not use) */
/* TX error counter / data[6] */
/* RX error counter / data[7] */
/* CAN state thresholds
*
* Error counter Error state
* -----------------------------------
* 0 - 95 Error-active
* 96 - 127 Error-warning
* 128 - 255 Error-passive
* 256 and greater Bus-off
*/
#define CAN_ERROR_WARNING_THRESHOLD 96
#define CAN_ERROR_PASSIVE_THRESHOLD 128
#define CAN_BUS_OFF_THRESHOLD 256
#endif /* _UAPI_CAN_ERROR_H */ #endif /* _UAPI_CAN_ERROR_H */