Page 1 of 1

Chardev & Netdev devices on one system

Posted: Mon 17. Oct 2016, 04:55
by thomasteo
Hello,
Is it possible to have two CAN interfaces on one system; one chardev and the other netdev?
One possible way I can see is:
* have two different USB devices, one with a different device ID
* compile two kernel modules, renaming one (eg pcan_char)
* use modalias and udev to force one of the device IDs to use a particular driver

But perhaps there's an easier way (or perhaps having two almost identical kernel modules loaded will cause problems).

Any advice welcome.

Thanks,
Thomas

Re: Chardev & Netdev devices on one system

Posted: Mon 17. Oct 2016, 14:34
by S.Grosjean
Hello!

Your question is quite interesting... But I actually don't see any easy solution for you.

In fact, the driver module is attached to a USB Device Id, which fixed value is given at the time the USB device is plugged into the host. Our PCAN USB adapters define their own (0x000c) and this value can't be changed at all. So, each time you'll plug a PCAN-USB, then the system will load the driver module which has been registered for handling the 0x000c value. This could be "pcan.ko" but (also) "peak_usb.ko" (the mainline linux-can driver), or a (new) one named "pcan_char.ko"... But there're will always be only one driver module handling this Device Id. loaded by the system at one time.

Handling both netdev/chardev interfaces at the same time in pcan is not a conceivable option at the moment.

Regards,

Stéphane