Re: [PATCH v1 10/12] can: error: specify the values of data[5..7] of CAN error frames

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue. 19 Jul. 2022 at 19:50, Stefan Mätje <Stefan.Maetje@xxxxxx> wrote:
> Hi Vincent,
>
> I'm a bit late to the party, but shouldn't the patch do that what you promise in
> the commit message? See at the end.
>
> Best regards,
>     Stefan
>
> Am Mittwoch, den 13.07.2022, 00:31 +0900 schrieb Vincent Mailhol:
> > 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: 0d66548a10cb ("[CAN]: Add PF_CAN core module")
> > Signed-off-by: Vincent Mailhol <mailhol.vincent@xxxxxxxxxx>
> > ---
> >  include/uapi/linux/can/error.h | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/uapi/linux/can/error.h b/include/uapi/linux/can/error.h
> > index 34633283de64..4eb7da568dde 100644
> > --- a/include/uapi/linux/can/error.h
> > +++ b/include/uapi/linux/can/error.h
> > @@ -120,6 +120,9 @@
> >  #define CAN_ERR_TRX_CANL_SHORT_TO_GND  0x70 /* 0111 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] */
> > +/* TX error counter / data[7] */
>
> /* RX error counter / data[7] */
>    ^

Maybe I should pay a visit to my ophthalmologist? Thank you for
spotting the typo, I will send a v2.


Yours sincerely,
Vincent Mailhol



[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux