]> git.baikalelectronics.ru Git - kernel.git/commit
can: error: specify the values of data[5..7] of CAN error frames
authorVincent Mailhol <mailhol.vincent@wanadoo.fr>
Tue, 19 Jul 2022 14:35:48 +0000 (23:35 +0900)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 20 Jul 2022 07:26:50 +0000 (09:26 +0200)
commit81eded254168b4348246351917c81fcf19baca4d
tree2af6096a88f235253013aca90e1f129e0af368cc
parent04a035fb3b51fd50df8207fec61c2bb900e40fe1
can: error: specify the values of data[5..7] of CAN error frames

Currently, data[5..7] of struct can_frame, when used as a CAN error
frame, are defined as being "controller specific". Device specific
behaviours are problematic because it prevents someone from writing
code which is portable between devices.

As a matter of fact, data[5] is never used, data[6] is always used to
report TX error counter and data[7] is always used to report RX error
counter. can-utils also relies on this.

This patch updates the comment in the uapi header to specify that
data[5] is reserved (and thus should not be used) and that data[6..7]
are used for error counters.

Fixes: d5a7672aa56e ("[CAN]: Add PF_CAN core module")
Link: https://lore.kernel.org/all/20220719143550.3681-11-mailhol.vincent@wanadoo.fr
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
include/uapi/linux/can/error.h