diff options
author | Oliver Hartkopp <socketcan@hartkopp.net> | 2012-08-06 12:02:29 -0400 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2012-08-07 04:10:57 -0400 |
commit | 035534ed3377d9def2c17717899fd64a111a785b (patch) | |
tree | 25efb74e0abecd07bc07e2c73ce7f92e7b67c70c /include/linux/can.h | |
parent | 5d299f3d3c8a2fbc732b1bf03af36333ccec3130 (diff) |
canfd: remove redundant CAN FD flag
The first idea of the CAN FD implementation started with a new struct
canfd_frame to be used for both CAN FD frames and legacy CAN frames.
The now mainlined implementation supports both CAN frame types simultaneously
and distinguishes them only by their required sizes: CAN_MTU and CANFD_MTU.
Only the struct canfd_frame contains a flags element which is needed for the
additional CAN FD information. As CAN FD implicitly means that the 'Extened
Data Length' mode is enabled the formerly defined CANFD_EDL bit became
redundant and also confusing as an unset bit would be an error and would
always need to be tested.
This patch removes the obsolete CANFD_EDL bit and clarifies the documentation
for the use of struct canfd_frame and the CAN FD relevant flags.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'include/linux/can.h')
-rw-r--r-- | include/linux/can.h | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/include/linux/can.h b/include/linux/can.h index 018055efc034..e52958d7c2d1 100644 --- a/include/linux/can.h +++ b/include/linux/can.h | |||
@@ -74,20 +74,21 @@ struct can_frame { | |||
74 | /* | 74 | /* |
75 | * defined bits for canfd_frame.flags | 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 | 77 | * The use of struct canfd_frame implies the Extended Data Length (EDL) bit to |
78 | * payload section of the frame (HDR) and to support up to 64 byte in the | 78 | * be set in the CAN frame bitstream on the wire. The EDL bit switch turns |
79 | * data section (EDL) the bits are only set in the non-default case. | 79 | * the CAN controllers bitstream processor into the CAN FD mode which creates |
80 | * Btw. as long as there's no real implementation for CAN FD network driver | 80 | * two new options within the CAN FD frame specification: |
81 | * these bits are only preliminary. | ||
82 | * | 81 | * |
83 | * RX: NOHDR/NOEDL - info about received CAN FD frame | 82 | * Bit Rate Switch - to indicate a second bitrate is/was used for the payload |
84 | * ESI - bit from originating CAN controller | 83 | * Error State Indicator - represents the error state of the transmitting node |
85 | * TX: NOHDR/NOEDL - control per-frame settings if supported by CAN controller | 84 | * |
86 | * ESI - bit is set by local CAN controller | 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 */ | 90 | #define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */ |
89 | #define CANFD_NOEDL 0x02 /* frame without extended data length */ | 91 | #define CANFD_ESI 0x02 /* error state indicator of the transmitting node */ |
90 | #define CANFD_ESI 0x04 /* error state indicator */ | ||
91 | 92 | ||
92 | /** | 93 | /** |
93 | * struct canfd_frame - CAN flexible data rate frame structure | 94 | * struct canfd_frame - CAN flexible data rate frame structure |