From: Oliver Hartkopp <socketcan@hartkopp.net>
To: "Maximilian Güntner" <maximilian.guentner@gmail.com>
Cc: Mike Purvis <mpurvis@clearpathrobotics.com>,
linux-can@vger.kernel.org, tom_usenet@optusnet.com.au
Subject: Re: Standard CAN over IP
Date: Mon, 23 Feb 2015 17:22:23 +0100 [thread overview]
Message-ID: <54EB53BF.2010902@hartkopp.net> (raw)
In-Reply-To: <CAKSnaaddj_UNrzkr=pZ5KM0r8xkHMPeLHqBr2Y_KHr1tZZBN+g@mail.gmail.com>
On 23.02.2015 15:27, Maximilian Güntner wrote:
>> There can be CAN FD frames with <=8 bytes too.
>
> Sure. My intent was not to make a distinction between CAN and CAN FD
> based on the frame length but rather to check whether it is possible to send the
> data section on that particular bus.
> But I think dropping CAN FD frames on non CAN FD interfaces is the right choice
> in the long run.
>
Yep :-)
>> You need to make sure that the difference between CAN FD with 8 bytes and
>> CAN2.0 with 8 bytes does not get lost. So I would suggest to add an
>> additional attribute to each transfered CAN frame which tells you:
>>
>> - Is a CAN FD frame (or not)
>> - Has bitrate setting (CANFD_BRS) enabled (for CAN FD)
>
> Both flags make sense to me. Maybe we can use the MSB of LEN (so 0x80)
> to encode whether it is a CAN FD frame. The next byte is either
> the first DATA byte or FLAGS followed by the first DATA byte.
Yes. That was my intention too.
>> - Has error state (CANFD_ESI) enabled (for CAN FD)
>
> Do you think that this flag is necessary for two independent CAN buses?
> When sending the frame on a physical bus, the error state of that
> interface/node can be different compared to the original sender.
> If host A receives a frame on bus A where CANFD_ESI is set and
> transmits it to host B which in return writes it to bus B, the CANFD_ESI
> bit will represent the state of a different node (host B instead of the
> original sender).
> Maybe I am wrong, but I think that the CANFD_ESI flag needs to be
> masked prior to transmission on bus B.
Good catch. Indeed this was discussed at CAN in Automation too.
When you think of a gateway (in automotive) the original ESI bit can be
interesting for the receiver placed behind the gateway.
Therefore the ability to set the ESI bit explicitly in an outgoing CAN FD
frame is specified for CAN controllers.
So the ESI bit on the wire is an OR'ed value of the value set into the
controllers registers and the internal state of the controller.
For your implementation this turns out to forward the ESI bit value transparently.
>
>>
>> My suggestion would be to add a single byte for each frame that contains
>> CANFD_BRS and CANFD_ESI as-is and e.g. 0x80 when this is a CAN FD frame.
>>
>> [...]
>> On the sender side 0x80 is OR'ed when the read frame length was CANFD_MTU.
>> And on the receiver a CAN or CAN FD frame is created based on 0x80 in FLAGS.
>
> Sounds good.
>
:-)
Regards,
Oliver
next prev parent reply other threads:[~2015-02-23 16:22 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-04 20:27 Standard CAN over IP Mike Purvis
2015-02-04 20:44 ` Armin Burchardt
2015-02-04 21:38 ` Mike Purvis
2015-02-04 22:42 ` Gerhard Bertelsmann
2015-02-05 0:50 ` Tom Evans
2015-02-05 13:15 ` Mike Purvis
2015-02-06 8:33 ` Michal Sojka
2015-02-09 16:00 ` Mike Purvis
2015-02-09 18:32 ` Oliver Hartkopp
2015-02-04 23:43 ` Tom Evans
2015-02-18 17:57 ` Maximilian Güntner
[not found] ` <CACsJT9M4QbYkDvQkGfhFuwA6haNyV5zesUFtLzB5VEbxP=obBA@mail.gmail.com>
2015-02-19 3:21 ` Mike Purvis
2015-02-19 14:58 ` Maximilian Güntner
2015-02-20 11:43 ` Oliver Hartkopp
2015-02-23 12:25 ` Maximilian Güntner
2015-02-23 13:08 ` Oliver Hartkopp
2015-02-23 14:27 ` Maximilian Güntner
2015-02-23 16:22 ` Oliver Hartkopp [this message]
2015-03-20 16:54 ` Maximilian Güntner
2015-03-23 10:28 ` Pankajkumar Misra (RBEI/EEA2)
2015-03-23 13:15 ` Maximilian Güntner
2015-03-23 16:57 ` Pankajkumar Misra (RBEI/EEA2)
2015-03-23 13:23 ` GARNERO, PIERRE (P.)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54EB53BF.2010902@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=linux-can@vger.kernel.org \
--cc=maximilian.guentner@gmail.com \
--cc=mpurvis@clearpathrobotics.com \
--cc=tom_usenet@optusnet.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).