alexmohr / usb-can

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

build error #46

Open DeeAitch opened 4 months ago

DeeAitch commented 4 months ago
$ ./build.sh 
Building module
make -C /lib/modules/6.1.0-20-amd64/build/ M=/tmp/usb-can/src/module modules
make[1]: Entering directory '/usr/src/linux-headers-6.1.0-20-amd64'
  CC [M]  /tmp/usb-can/src/module/hlcan.o
/tmp/usb-can/src/module/hlcan.c: In function ‘slcan_ioctl’:
/tmp/usb-can/src/module/hlcan.c:797:44: warning: passing argument 2 of ‘tty_mode_ioctl’ makes integer from pointer without a cast [-Wint-conversion]
  797 |                 return tty_mode_ioctl(tty, file, cmd, arg);
      |                                            ^~~~
      |                                            |
      |                                            struct file *
In file included from /tmp/usb-can/src/module/hlcan.c:47:
/usr/src/linux-headers-6.1.0-20-common/include/linux/tty.h:461:57: note: expected ‘unsigned int’ but argument is of type ‘struct file *’
  461 | int tty_mode_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg);
      |                                            ~~~~~~~~~~~~~^~~
/tmp/usb-can/src/module/hlcan.c:797:24: error: too many arguments to function ‘tty_mode_ioctl’
  797 |                 return tty_mode_ioctl(tty, file, cmd, arg);
      |                        ^~~~~~~~~~~~~~
/usr/src/linux-headers-6.1.0-20-common/include/linux/tty.h:461:5: note: declared here
  461 | int tty_mode_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg);
      |     ^~~~~~~~~~~~~~
/tmp/usb-can/src/module/hlcan.c: At top level:
/tmp/usb-can/src/module/hlcan.c:813:27: error: initialization of ‘void (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
  813 |         .hangup         = slcan_hangup,
      |                           ^~~~~~~~~~~~
/tmp/usb-can/src/module/hlcan.c:813:27: note: (near initialization for ‘slc_ldisc.hangup’)
/tmp/usb-can/src/module/hlcan.c:814:27: error: initialization of ‘int (*)(struct tty_struct *, unsigned int,  long unsigned int)’ from incompatible pointer type ‘int (*)(struct tty_struct *, struct file *, unsigned int,  long unsigned int)’ [-Werror=incompatible-pointer-types]
  814 |         .ioctl          = slcan_ioctl,
      |                           ^~~~~~~~~~~
/tmp/usb-can/src/module/hlcan.c:814:27: note: (near initialization for ‘slc_ldisc.ioctl’)
cc1: some warnings being treated as errors
make[2]: *** [/usr/src/linux-headers-6.1.0-20-common/scripts/Makefile.build:255: /tmp/usb-can/src/module/hlcan.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.1.0-20-common/Makefile:2035: /tmp/usb-can/src/module] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.1.0-20-amd64'
make: *** [Makefile:11: all] Error 2
Building userpace tools
$ cat /proc/version 
Linux version 6.1.0-20-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11)
alexmohr commented 4 months ago

The kernel interface received a lot of changes. It's not working with new kernels anymore and supporting many flavors of kernels isn't feasible time wise for me. To make this work again it was to be rewritten from scratch to implement an actual device driver. https://github.com/alexmohr/usb-can/issues/13 It's been on my bucket list for over 4 years now but I didn't find the time to do it, so it's unlikely to happen anytime soon. Sorry.

alexmohr commented 4 months ago

This is bascially the same issue like #45

DeeAitch commented 4 months ago

I see. Will look some way to make it works. Thanks