netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pull-request: can 2012-08-07
@ 2012-08-07 10:04 Marc Kleine-Budde
  2012-08-07 10:04 ` [PATCH] canfd: remove redundant CAN FD flag Marc Kleine-Budde
  2012-08-08 22:55 ` pull-request: can 2012-08-07 David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Marc Kleine-Budde @ 2012-08-07 10:04 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-can

Hello David,

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.

regards,
Marc

--

The following changes since commit 5d299f3d3c8a2fbc732b1bf03af36333ccec3130:

  net: ipv6: fix TCP early demux (2012-08-06 13:33:21 -0700)

are available in the git repository at:

  git://gitorious.org/linux-can/linux-can.git fixes-for-3.6

for you to fetch changes up to 035534ed3377d9def2c17717899fd64a111a785b:

  canfd: remove redundant CAN FD flag (2012-08-07 10:10:57 +0200)

----------------------------------------------------------------
Oliver Hartkopp (1):
      canfd: remove redundant CAN FD flag

 include/linux/can.h |   25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] canfd: remove redundant CAN FD flag
  2012-08-07 10:04 pull-request: can 2012-08-07 Marc Kleine-Budde
@ 2012-08-07 10:04 ` Marc Kleine-Budde
  2012-08-08 22:55 ` pull-request: can 2012-08-07 David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Kleine-Budde @ 2012-08-07 10:04 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-can, Oliver Hartkopp, Marc Kleine-Budde

From: Oliver Hartkopp <socketcan@hartkopp.net>

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>
---
 include/linux/can.h |   25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/include/linux/can.h b/include/linux/can.h
index 018055e..e52958d 100644
--- a/include/linux/can.h
+++ b/include/linux/can.h
@@ -74,20 +74,21 @@ struct can_frame {
 /*
  * defined bits for canfd_frame.flags
  *
- * As the default for CAN FD should be to support the high data rate in the
- * payload section of the frame (HDR) and to support up to 64 byte in the
- * data section (EDL) the bits are only set in the non-default case.
- * Btw. as long as there's no real implementation for CAN FD network driver
- * these bits are only preliminary.
+ * The use of struct canfd_frame implies the Extended Data Length (EDL) bit to
+ * be set in the CAN frame bitstream on the wire. The EDL bit switch turns
+ * the CAN controllers bitstream processor into the CAN FD mode which creates
+ * two new options within the CAN FD frame specification:
  *
- * RX: NOHDR/NOEDL - info about received CAN FD frame
- *     ESI         - bit from originating CAN controller
- * TX: NOHDR/NOEDL - control per-frame settings if supported by CAN controller
- *     ESI         - bit is set by local CAN controller
+ * Bit Rate Switch - to indicate a second bitrate is/was used for the payload
+ * Error State Indicator - represents the error state of the transmitting node
+ *
+ * As the CANFD_ESI bit is internally generated by the transmitting CAN
+ * controller only the CANFD_BRS bit is relevant for real CAN controllers when
+ * building a CAN FD frame for transmission. Setting the CANFD_ESI bit can make
+ * sense for virtual CAN interfaces to test applications with echoed frames.
  */
-#define CANFD_NOHDR 0x01 /* frame without high data rate */
-#define CANFD_NOEDL 0x02 /* frame without extended data length */
-#define CANFD_ESI   0x04 /* error state indicator */
+#define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */
+#define CANFD_ESI 0x02 /* error state indicator of the transmitting node */
 
 /**
  * struct canfd_frame - CAN flexible data rate frame structure
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: pull-request: can 2012-08-07
  2012-08-07 10:04 pull-request: can 2012-08-07 Marc Kleine-Budde
  2012-08-07 10:04 ` [PATCH] canfd: remove redundant CAN FD flag Marc Kleine-Budde
@ 2012-08-08 22:55 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2012-08-08 22:55 UTC (permalink / raw)
  To: mkl; +Cc: netdev, linux-can

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Tue,  7 Aug 2012 12:04:17 +0200

> 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.
 ...
>   git://gitorious.org/linux-can/linux-can.git fixes-for-3.6

Pulled, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-08 22:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-07 10:04 pull-request: can 2012-08-07 Marc Kleine-Budde
2012-08-07 10:04 ` [PATCH] canfd: remove redundant CAN FD flag Marc Kleine-Budde
2012-08-08 22:55 ` pull-request: can 2012-08-07 David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).