xairy / raw-gadget

USB Raw Gadget — a low-level interface for the Linux USB Gadget subsystem
333 stars 35 forks source link

Inability to compile raw gadget #69

Closed RampantDespair closed 1 month ago

RampantDespair commented 1 month ago

Hey there, I'm trying to compile raw gadget on my Raspberry Pi 5, kernel 6.6.28+rpt-rpi-2712 but am facing this issue:

op@raspberrypi:~/Sources/raw-gadget/raw_gadget $ make
make -C /lib/modules/6.6.28+rpt-rpi-2712/build M=/home/op/Sources/raw-gadget/raw_gadget SUBDIRS=/home/op/Sources/raw-gadget/raw_gadget modules
make[1]: Entering directory '/usr/src/linux-headers-6.6.28+rpt-rpi-2712'
  CC [M]  /home/op/Sources/raw-gadget/raw_gadget/raw_gadget.o
/home/op/Sources/raw-gadget/raw_gadget/raw_gadget.c: In function 'raw_ioctl_run':
/home/op/Sources/raw-gadget/raw_gadget/raw_gadget.c:595:15: error: implicit declaration of function 'usb_gadget_probe_driver'; did you mean 'usb_gadget_frame_number'? [-Werror=implicit-function-declaration]
  595 |         ret = usb_gadget_probe_driver(&dev->driver);
      |               ^~~~~~~~~~~~~~~~~~~~~~~
      |               usb_gadget_frame_number
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-headers-6.6.28+rpt-common-rpi/scripts/Makefile.build:248: /home/op/Sources/raw-gadget/raw_gadget/raw_gadget.o] Error 1
make[2]: *** [/usr/src/linux-headers-6.6.28+rpt-common-rpi/Makefile:1938: /home/op/Sources/raw-gadget/raw_gadget] Error 2
make[1]: *** [/usr/src/linux-headers-6.6.28+rpt-common-rpi/Makefile:246: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.6.28+rpt-rpi-2712'
make: *** [Makefile:8: default] Error 2

I see that Raspberry Pi 5 is not listed under the tested devices; Nevertheless, am I doing something wrong or is it not possible to compile with my current setup?

xairy commented 1 month ago

Hi!

You need to revert this patch.

I'll keep this issue open as a reminder to write better documentation for this.

Thanks!