Re: [RFC PATCH 00/13] can: slcan: extend supported features

From: Max Staudt
Date: Tue Jun 07 2022 - 22:04:36 EST


On Tue, 7 Jun 2022 21:19:54 +0900
Vincent MAILHOL <mailhol.vincent@xxxxxxxxxx> wrote:

> In his CAN327 driver, Max manages to bring the can0 device without the
> need of dedicated user space daemon by using line discipline
> (ldattach):
> https://lore.kernel.org/linux-can/20220602213544.68273-1-max@xxxxxxxxx/
>
> Isn't the same feasible with slcan so that we completely remove the
> dependency toward slcand?
> Max what do you think of this?

I think it is a good idea to move this into the kernel driver. I don't
have a slcan device, but a quick peek at its protocol suggests that
it can be done much easier and cleaner than in can327.


Fun fact: The use of a userspace "ignition" tool is a possible use case
baked into can327's design ;)

There is only one use case I can see for it though: Probing the
ELM327's baud rate, and/or setting it before attaching the ldisc. This
is the single thing that the kernel driver cannot do, since it is
attached to an already running TTY, with a fixed speed. Everything else
is configurable via "ip link".

slcand could be used to auto-probe and set the baud rate as well.

Then again, these stripped-down tools could likely be implemented as
shell scripts calling stty and ldattach...


Max