Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make failed #11

Open
GeorgeJirka opened this issue Jan 10, 2025 · 1 comment
Open

Make failed #11

GeorgeJirka opened this issue Jan 10, 2025 · 1 comment

Comments

@GeorgeJirka
Copy link

GeorgeJirka commented Jan 10, 2025

I have a USB2CAN device from www.canlab.cz (https://www.canlab.cz/cs/usb2can_interface) and when I try run make, it fails. Any idea, how to solve it?

Base linux:

  • PRETTY_NAME="Kali GNU/Linux Rolling"
  • NAME="Kali GNU/Linux"
  • VERSION_ID="2024.4"
  • VERSION="2024.4"
  • VERSION_CODENAME=kali-rolling
  • ID=kali
  • ID_LIKE=debian
  • BUILD_ID=20250103T215459Z

└─$ make
make[1]: Entering directory '/home/pless/triple/driver'
make -C/lib/modules/uname -r/build M=/home/pless/triple/driver modules
make[2]: Entering directory '/usr/src/linux-headers-6.11.2-amd64'
CC [M] /home/pless/triple/driver/main.o
/home/pless/triple/driver/main.c:117:19: error: initialization of ‘void (*)(struct tty_struct )’ from incompatible pointer type ‘int ()(struct tty_struct )’ [-Wincompatible-pointer-types]
117 | .hangup = triple_hangup,
| ^~~~~~~~~~~~~
/home/pless/triple/driver/main.c:117:19: note: (near initialization for ‘triple_ldisc.hangup’)
/home/pless/triple/driver/main.c:118:18: 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)’ [-Wincompatible-pointer-types]
118 | .ioctl = triple_ioctl,
| ^~~~~~~~~~~~
/home/pless/triple/driver/main.c:118:18: note: (near initialization for ‘triple_ldisc.ioctl’)
/home/pless/triple/driver/main.c:119:24: error: initialization of ‘void (
)(struct tty_struct *, const u8 *, const u8 , size_t)’ {aka ‘void ()(struct tty_struct *, const unsigned char *, const unsigned char , long unsigned int)’} from incompatible pointer type ‘void ()(struct tty_struct *, const unsigned char *, const char *, int)’ [-Wincompatible-pointer-types]
119 | .receive_buf = triple_receive_buf,
| ^~~~~~~~~~~~~~~~~~
/home/pless/triple/driver/main.c:119:24: note: (near initialization for ‘triple_ldisc.receive_buf’)
/home/pless/triple/driver/main.c: In function ‘triple_ioctl’:
/home/pless/triple/driver/main.c:488:32: error: passing argument 2 of ‘tty_mode_ioctl’ makes integer from pointer without a cast [-Wint-conversion]
488 | return tty_mode_ioctl(tty, file, cmd, arg);
| ^~~~
| |
| struct file *
In file included from /home/pless/triple/driver/main.c:43:
/usr/src/linux-headers-6.11.2-common/include/linux/tty.h:453:57: note: expected ‘unsigned int’ but argument is of type ‘struct file *’
453 | int tty_mode_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg);
| ~~~~~~~~~~~~~^~~
/home/pless/triple/driver/main.c:488:12: error: too many arguments to function ‘tty_mode_ioctl’
488 | return tty_mode_ioctl(tty, file, cmd, arg);
| ^~~~~~~~~~~~~~
/usr/src/linux-headers-6.11.2-common/include/linux/tty.h:453:5: note: declared here
453 | int tty_mode_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg);
| ^~~~~~~~~~~~~~
make[4]: *** [/usr/src/linux-headers-6.11.2-common/scripts/Makefile.build:249: /home/pless/triple/driver/main.o] Error 1
make[3]: *** [/usr/src/linux-headers-6.11.2-common/Makefile:1951: /home/pless/triple/driver] Error 2
make[2]: *** [/usr/src/linux-headers-6.11.2-common/Makefile:236: __sub-make] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-6.11.2-amd64'
make[1]: *** [Makefile:14: default] Error 2
make[1]: Leaving directory '/home/pless/triple/driver'
make: *** [Makefile:4: all] Error 2

@koupypavel
Copy link
Contributor

Hi,

driver hasn't been tested with kernel 6.11, so it probably won't match system calls correctly. Also, this driver is only for USB2CAN Triple https://www.canlab.cz/cs/node/123 , not for regular USB2CAN .

You can either use virtual machine referenced in readme or update tty_mode_ioctl call and tty_struct so it matches tyour kernel version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants