Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'fixes-for-3.6' of git://gitorious.org/linux-can/linux-can

Marc Kleine-Budde says:

====================
here's a fix intended for the v3.6 release cycle. Oliver noticed and
fixed that the flags definition for the new canfd_frame contains
redundant and confusing information.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+13 -12
+13 -12
include/linux/can.h
··· 74 74 /* 75 75 * defined bits for canfd_frame.flags 76 76 * 77 - * As the default for CAN FD should be to support the high data rate in the 78 - * payload section of the frame (HDR) and to support up to 64 byte in the 79 - * data section (EDL) the bits are only set in the non-default case. 80 - * Btw. as long as there's no real implementation for CAN FD network driver 81 - * these bits are only preliminary. 77 + * The use of struct canfd_frame implies the Extended Data Length (EDL) bit to 78 + * be set in the CAN frame bitstream on the wire. The EDL bit switch turns 79 + * the CAN controllers bitstream processor into the CAN FD mode which creates 80 + * two new options within the CAN FD frame specification: 82 81 * 83 - * RX: NOHDR/NOEDL - info about received CAN FD frame 84 - * ESI - bit from originating CAN controller 85 - * TX: NOHDR/NOEDL - control per-frame settings if supported by CAN controller 86 - * ESI - bit is set by local CAN controller 82 + * Bit Rate Switch - to indicate a second bitrate is/was used for the payload 83 + * Error State Indicator - represents the error state of the transmitting node 84 + * 85 + * As the CANFD_ESI bit is internally generated by the transmitting CAN 86 + * controller only the CANFD_BRS bit is relevant for real CAN controllers when 87 + * building a CAN FD frame for transmission. Setting the CANFD_ESI bit can make 88 + * sense for virtual CAN interfaces to test applications with echoed frames. 87 89 */ 88 - #define CANFD_NOHDR 0x01 /* frame without high data rate */ 89 - #define CANFD_NOEDL 0x02 /* frame without extended data length */ 90 - #define CANFD_ESI 0x04 /* error state indicator */ 90 + #define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */ 91 + #define CANFD_ESI 0x02 /* error state indicator of the transmitting node */ 91 92 92 93 /** 93 94 * struct canfd_frame - CAN flexible data rate frame structure