From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Nikita Edward Baruzdin <nebaruzdin@gmail.com>, linux-can@vger.kernel.org
Subject: Re: SJA1000 loopback feature
Date: Mon, 16 Jun 2014 20:56:31 +0200 [thread overview]
Message-ID: <539F3DDF.70007@hartkopp.net> (raw)
In-Reply-To: <CAEJ7JO2ejHBVANYWXxXe_DstXCW-hm9xzJYXifiU+RwYNS3M1A@mail.gmail.com>
Hello Nikita,
On 16.06.2014 18:20, Nikita Edward Baruzdin wrote:
> We have several logical units working on the same CAN interface of a
> SJA1000-based CAN controller. We need them to communicate with each other even
> in a situation of one physical node on the bus. Thus we need some kind of a
> loopback functionality for that. Software loopback works fine aside from the
> fact it is performed only after an actual transmission has happened (which is a
> problem with a one-node bus).
>
> There is a CAN_CTRLMODE_LOOPBACK netlink option, but I didn't find any
> description of its semantics. And as far as I understand every controller
> interpretes it in its own way. For example, MCP2510 implies the loopback mode is
> a silent (listen-only) mode and Bosch C_CAN controller disregards actual
> rx-input in this mode according to the documentation. Hence the first question
> is: what does CAN_CTRLMODE_LOOPBACK mean precisely?
CAN_CTRLMODE_LOOPBACK means, that the controller is able to 'shortcut' the TX
line with the RX line.
This means that you send a CAN frame to your own input pin without the need
for external CAN nodes (including acks).
> I've also found out that this option is not implemented for SJA1000. Actually,
> SJA1000 has nothing called a "loopback" feature but instead it has a Self Test
> Mode, that seems like a reasonable solution for our problem. In this mode no
> acknowledgement is required for the successful transmission, so software
> loopback is working. However, it is not in the SJA1000 driver at the moment.
>
> It is also possible to have the hardware loopback for SJA1000 with the Self
> Reception Request feature (a message is transmitted and received simultaneously,
> not implemented in sja1000 module as well), although we don't need it for our
> specific case.
>
> So the next question is: how should we implement those features for SJA1000?
Oh, yes - why not :-)
>
> I attached a patch that adds support for the Self Test Mode using the
> CAN_CTRLMODE_LOOPBACK netlink option. As it is not exactly a loopback mode we
> enable with that option, it might be a better idea to have a separate one for
> that, smth like CAN_CTRLMODE_SELF_TEST. What do you think?
I think CAN_CTRLMODE_LOOPBACK still is the right description.
But when you read the SJA1000 spec, you would need to set CMD_SRR (self
reception request) instead of CMD_TR (transmission request) to have the
loopback functionality when the MOD_STM (self test mode) is enabled, right?
For the next patch post, please send the patch inline - so that is can be
reviewed and answered easier.
Many thanks,
Oliver
next prev parent reply other threads:[~2014-06-16 18:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-16 16:20 SJA1000 loopback feature Nikita Edward Baruzdin
2014-06-16 18:56 ` Oliver Hartkopp [this message]
2014-06-17 11:41 ` Nikita Edward Baruzdin
2014-06-17 12:13 ` Alexander GQ Gerasiov
2014-06-18 19:51 ` Oliver Hartkopp
2014-06-19 12:44 ` Alexander GQ Gerasiov
2014-06-19 14:55 ` Oliver Hartkopp
2014-06-19 16:01 ` Alexander GQ Gerasiov
2014-06-19 17:43 ` Oliver Hartkopp
2014-06-19 18:07 ` Alexander GQ Gerasiov
2014-06-19 20:32 ` vcan to can0 bridging Kurt Van Dijck
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=539F3DDF.70007@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=linux-can@vger.kernel.org \
--cc=nebaruzdin@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.