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

cannot locate "usbhid/usbhid.h" - #1

Closed
mkoreneff opened this issue Nov 7, 2020 · 4 comments
Closed

cannot locate "usbhid/usbhid.h" - #1

mkoreneff opened this issue Nov 7, 2020 · 4 comments

Comments

@mkoreneff
Copy link
Contributor

Sorry to ask here as I know it's (probably) not the right place, however i'm at a loss.
I cannot find the ubshid header files package for ubuntu 1804.
I'm getting this error when trying to make.

/home/mickie/Documents/code/hid-fanatecff/hid-ftec.c:6:10: fatal error: usbhid/usbhid.h: No such file or directory
 #include "usbhid/usbhid.h"
          ^~~~~~~~~~~~~~~~~
compilation terminated.

@gotzl
Copy link
Owner

gotzl commented Nov 7, 2020

For me, the header is found in the kernel sources. I don't know if there is a package for ubuntu.
What you can do is to download the kernel source tar and edit the Kbuild file to s.t. like

...
ccflags-y := -Idrivers/hid -I/path/to/linux-5.X.X/drivers/hid/

Hope that helps.

@mkoreneff
Copy link
Contributor Author

mkoreneff commented Nov 7, 2020

super helpful, thank you.

I had to untar the linux-source files for my kernel version
mickie@mickie-All-Series:/usr/src/linux-source-4.15.0$ sudo tar vxjf linux-source-4.15.0.tar.bz2

then I updated Kbuild
ccflags-y := -Idrivers/hid -I /usr/src/linux-source-4.15.0/linux-source-4.15.0/drivers/hid/

I have another error now which is possibly due to an old version of usbhid in my kernel, maybe its time to update my ubuntu version from 18.04 LTS -> 20.04 LTS

/home/mickie/Documents/code/hid-fanatecff/hid-ftec.c:125:35: error: ‘struct hid_report’ has no member named ‘application’
   report->id, report->type, report->application,   
                                   ^
./include/linux/hid.h:1135:45: note: in definition of macro ‘dbg_hid’
   printk(KERN_DEBUG "%s: " fmt, __FILE__, ##__VA_ARGS__); \
                                             ^~~~~~~~~~~

@gotzl
Copy link
Owner

gotzl commented Nov 7, 2020

Jea, seems like the hid_report changed.. I'll add a kernel switch. But you can just comment these lines 124-129, this is only debug output.

@mkoreneff
Copy link
Contributor Author

that worked, thanks for the help. Have compiled the driver now, will test and report back soon.

failed

        dbg_hid(" ... %i %i %i %i %i %i\n%i %i %i %i\n\n",  
                /report->id, report->type, report->application,

commented

        dbg_hid(" ... %i %i %i %i %i\n%i %i %i %i\n\n",
                report->id, report->type, // report->application,

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