alexmohr / usb-can

USB-CAN Analyzer Linux Support
GNU General Public License v2.0
36 stars 13 forks source link

Kernel 5.15 updates #42

Closed chrism0dwk closed 1 year ago

chrism0dwk commented 2 years ago

This PR contains modifications to track changes in tty_ldisc.h for kernel 5.15. The modifications are relatively minor, and no attempt has been made to improve upon the driver in any other respect.

alexmohr commented 2 years ago

Thanks for the contribution. I've created a new branch kernel-5.15 as I want to keep compatibility with older kernels. Could you please set the target branch to this (as you've already stated in the readme)

chrism0dwk commented 2 years ago

No problem. linux/version.h has a macro KERNEL_VERSION. Is it worth using this to create a conditional compile, I wonder? I notice that the SLCAN driver doesn't do this, the of course it's part of the overall kernel source tree. Is this what you're aiming hlcan at, btw?

C

alexmohr commented 1 year ago

Sorry for the late reply, I totally forgot to respond here. Adding conditional compilation to only have one branch is a very good idea.

I'm not aiming to bring it to the upstream kernel, as it hijacks the slcan functionality. It would require some changes in upstream to add support for this device. The way it's implemented at the moment won't be accepted upstream. It should a separate kernel driver, but probing is a bit complicated, as the serial adapter this can interface is based on has it's own driver and I haven't found a proper way yet to differentiate between the serial and the can adapter.

MrManlu commented 1 year ago

Hello and happy new year!

If it helps, I just tested this modification for the Kernel 5.15 and seems to work properly.

My setup is an Arduino MEGA sending at 500 Kbps and the usb-can adapter, both with 120 ohms resistor line terminators. I'm able to see every packet in Wireshark.

Thank you both for this useful module!

alexmohr commented 1 year ago

Thanks for the feedback, I'm going to test and merge it as soon as the conflicts are solved :)