lin-bus / linux-lin

Linux kernel LIN bus support implemented as TTY line discipline for generic UART conrollers, documentation https://github.com/lin-bus/linux-lin/wiki, based on https://github.com/lin-bus/linux-lin/wiki/sllin-rtlws14-paper.pdf, more CAN related projects http://canbus.pages.fel.cvut.cz/
https://github.com/lin-bus/linux-lin/wiki
38 stars 26 forks source link

Multiple LIN interfaces #18

Open christian-steiniche opened 2 years ago

christian-steiniche commented 2 years ago

Hi

I have a system with multiple LIN interfaces each connected to a dedicated hw UART. This works well.

However, I have one issue. When using multiple LIN interfaces I am not able to control the mapping to the resulting network interface names.

E.g. with two UARTs if I do:

sudo ldattach 28 /dev/ttyAMA0
sudo ldattach 28 /dev/ttyAMA1

The mappings become:

ttyAMA0 -> sllin0
ttyAMA1 -> sllin1

However, if I initialize the interfaces in reversed order:

sudo ldattach 28 /dev/ttyAMA1
sudo ldattach 28 /dev/ttyAMA0

The mappings now become:

ttyAMA0 -> sllin1
ttyAMA1 -> sllin0

The interfaces are attached and de-attached independently by separate processes - making it hard to know what the resulting network interface names become.

Would it be possible to take a specific network interface index as input argument to sllin? It seems that ldattach accepts an optional "--iflag" input argument which potentially could be used to provide the index / name?

Thanks

br Christian