From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Christoph Fritz <christoph.fritz@hexdev.de>
Cc: Pavel Pisa <pisa@cmp.felk.cvut.cz>,
Richard Weinberger <richard@nod.at>,
Andreas Lauser <andreas.lauser@mbition.io>,
Wolfgang Grandegger <wg@grandegger.com>,
Marc Kleine-Budde <mkl@pengutronix.de>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Jonathan Corbet <corbet@lwn.net>,
linux-can@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH 0/2] LIN support for Linux
Date: Wed, 30 Nov 2022 22:02:23 +0100 [thread overview]
Message-ID: <ed685ce0-16e2-3f7c-173a-ac14f32d9ca6@hartkopp.net> (raw)
In-Reply-To: <Y4SKZb9woV5XE1bU@mars>
Hi Christoph, all,
On 28.11.22 11:16, Christoph Fritz wrote:
>> IIRC the implementation of the master/slave timings was the biggest
>
> Currently sllin only supports master mode, I guess because of the tight
> timing constraints.
I think this has to be corrected.
In the master mode the SocketCAN Broadcast Manager (BCM) is configured
to periodically send LIN headers
(according to LIN schedule table).
https://www.kernel.org/doc/html/latest/networking/can.html#broadcast-manager-protocol-sockets-sock-dgram
This is a very easy approach to precisely send the the LIN frames from
kernel space and also atomically change the content of (all) the
configured LIN frames while the schedule table is continuously processed.
Sending LIN frames directly from *userspace* (and handling timers there)
was *never* intended for real LIN communication - although the examples
(with cangen) in the document look like this.
Same applies to the slave mode:
If you check out
https://raw.githubusercontent.com/wiki/lin-bus/linux-lin/sllin-doc.pdf
on page 11 you are able to enable the slave mode with
insmod ./sllin.ko master=0
The 'trick' about this mode is that the RTR-functionality of the BCM is
able process the incoming CAN/LIN identifier and *instantly* send back
some pre-defined data for that specific LIN-ID, so that the SLLIN driver
sends/answers the 'data' section of the received LIN-ID within the
required timing constrains for LIN slaves.
Not sure if the info about this concept got lost somehow, but the
CAN_BCM is the key for handling the LIN protocol and offload the LIN
scheduling (master/slave) to the kernel for the comparably dumb tty
interfaces.
Best regards,
Oliver
prev parent reply other threads:[~2022-11-30 21:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-27 19:02 [RFC][PATCH 0/2] LIN support for Linux Christoph Fritz
2022-11-27 19:02 ` [PATCH 1/2] [RFC] can: Introduce LIN bus as CANFD abstraction Christoph Fritz
2022-11-27 19:02 ` [PATCH 2/2] [RFC] can: Add LIN proto skeleton Christoph Fritz
2022-11-28 8:21 ` [RFC][PATCH 0/2] LIN support for Linux Oliver Hartkopp
2022-11-28 10:16 ` Christoph Fritz
2022-11-28 14:49 ` Pavel Pisa
2022-11-28 17:02 ` Ryan Edwards
2022-11-28 17:52 ` Pavel Pisa
2022-11-28 18:47 ` Ryan Edwards
2022-11-28 21:48 ` Christoph Fritz
2022-11-28 22:47 ` Andrew Lunn
2022-11-30 21:02 ` Oliver Hartkopp [this message]
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=ed685ce0-16e2-3f7c-173a-ac14f32d9ca6@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=andreas.lauser@mbition.io \
--cc=christoph.fritz@hexdev.de \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pisa@cmp.felk.cvut.cz \
--cc=richard@nod.at \
--cc=wg@grandegger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox