alexmohr / usb-can

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

kmod: could not insert module hlcan.ko: Invalid parameters #8

Closed Ciusss89 closed 4 years ago

Ciusss89 commented 4 years ago
~/mcu/gtip-riotos/test_04/tools/_usbcan (_dev) $ cd src/module/
~/mcu/gtip-riotos/test_04/tools/_usbcan/src/module (_dev) $ ls
hlcan.c  hlcan.h  hlcan.ko  hlcan.mod  hlcan.mod.c  hlcan.mod.o  hlcan.o  Makefile  modules.order  Module.symvers
~/mcu/gtip-riotos/test_04/tools/_usbcan/src/module (_dev) $ make clean
make -C /lib/modules/5.5.9-200.fc31.x86_64/build/ M=/home/giuseppe/mcu/gtip-riotos/test_04/tools/_usbcan/src/module clean
make[1]: Entering directory '/usr/src/kernels/5.5.9-200.fc31.x86_64'
  CLEAN   /home/giuseppe/mcu/gtip-riotos/test_04/tools/_usbcan/src/module/Module.symvers
make[1]: Leaving directory '/usr/src/kernels/5.5.9-200.fc31.x86_64'
~/mcu/gtip-riotos/test_04/tools/_usbcan/src/module (_dev) $ make
make -C /lib/modules/5.5.9-200.fc31.x86_64/build/ M=/home/giuseppe/mcu/gtip-riotos/test_04/tools/_usbcan/src/module modules
make[1]: Entering directory '/usr/src/kernels/5.5.9-200.fc31.x86_64'
  CC [M]  /home/giuseppe/mcu/gtip-riotos/test_04/tools/_usbcan/src/module/hlcan.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC [M]  /home/giuseppe/mcu/gtip-riotos/test_04/tools/_usbcan/src/module/hlcan.mod.o
  LD [M]  /home/giuseppe/mcu/gtip-riotos/test_04/tools/_usbcan/src/module/hlcan.ko
make[1]: Leaving directory '/usr/src/kernels/5.5.9-200.fc31.x86_64'
~/mcu/gtip-riotos/test_04/tools/_usbcan/src/module (_dev) $ sudo make install
cp hlcan.ko /usr/lib/modules/5.5.9-200.fc31.x86_64/kernel/drivers/net/can
~/mcu/gtip-riotos/test_04/tools/_usbcan/src/module (_dev) $ sudo insmod hlcan.ko 
insmod: ERROR: could not insert module hlcan.ko: Invalid parameters
~/mcu/gtip-riotos/test_04/tools/_usbcan/src/module (_dev) $ 
alexmohr commented 4 years ago

Are you using the latest commit? There was a minor change missing regarding the line discipline parameter. If you use the latest version and still get this error please post the output of

sudo dmesg 
Ciusss89 commented 4 years ago

you've right

[346107.881006] hlcan: QinHeng serial line CAN interface driver
[346107.881008] hlcan: 10 dynamic interface channels.
[346107.881009] hlcan: can't register line discipline
alexmohr commented 4 years ago

What kernel are you using? The module loading is working with 5.5.13

Ciusss89 commented 4 years ago

4a310e978cb1ec3b5e fixes the issue