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

Can't build vhci_hcd #1

Open
linuxbuh opened this issue May 12, 2021 · 1 comment
Open

Can't build vhci_hcd #1

linuxbuh opened this issue May 12, 2021 · 1 comment

Comments

@linuxbuh
Copy link
Owner

Hi,

I've downloaded the code from vhci_hcd and tried to build it, but get the following errors:

/home/dev/workspace/fido/vhci_hcd/usb-vhci-hcd.c:59:3: warning: #warning DEBUG is defined [-Wcpp]

warning DEBUG is defined

^~~~~~~
In file included from ./include/linux/stat.h:7:0,
from ./include/linux/module.h:10,
from /home/dev/workspace/fido/vhci_hcd/usb-vhci-hcd.c:24:
./include/uapi/linux/stat.h:30:17: error: expected ‘)’ before numeric constant
#define S_IRUSR 00400
^
/home/dev/workspace/fido/vhci_hcd/usb-vhci-hcd.c:1312:34: note: in expansion of macro ‘S_IRUSR’
static DRIVER_ATTR(debug_output, S_IRUSR | S_IWUSR, show_debug_output, store_debug_output);
^~~~~~~
/home/dev/workspace/fido/vhci_hcd/usb-vhci-hcd.c: In function ‘init’:
/home/dev/workspace/fido/vhci_hcd/usb-vhci-hcd.c:1334:56: error: ‘driver_attr_debug_output’ undeclared (first use in this function); did you mean ‘store_debug_output’?
retval = driver_create_file(&vhci_hcd_driver.driver, &driver_attr_debug_output);
^~~~~~~~~~~~~~~~~~~~~~~~
store_debug_output
/home/dev/workspace/fido/vhci_hcd/usb-vhci-hcd.c:1334:56: note: each undeclared identifier is reported only once for each function it appears in
/home/dev/workspace/fido/vhci_hcd/usb-vhci-hcd.c: In function ‘cleanup’:
/home/dev/workspace/fido/vhci_hcd/usb-vhci-hcd.c:1349:47: error: ‘driver_attr_debug_output’ undeclared (first use in this function); did you mean ‘store_debug_output’?
driver_remove_file(&vhci_hcd_driver.driver, &driver_attr_debug_output);
^~~~~~~~~~~~~~~~~~~~~~~~
store_debug_output
At top level:
/home/dev/workspace/fido/vhci_hcd/usb-vhci-hcd.c:1299:16: warning: ‘store_debug_output’ defined but not used [-Wunused-function]
static ssize_t store_debug_output(struct device_driver *drv, const char *buf, size_t count)
^~~~~~~~~~~~~~~~~~
/home/dev/workspace/fido/vhci_hcd/usb-vhci-hcd.c:1284:16: warning: ‘show_debug_output’ defined but not used [-Wunused-function]
static ssize_t show_debug_output(struct device_driver *drv, char *buf)
^~~~~~~~~~~~~~~~~
scripts/Makefile.build:339: recipe for target '/home/dev/workspace/fido/vhci_hcd/usb-vhci-hcd.o' failed
make[2]: *** [/home/dev/workspace/fido/vhci_hcd/usb-vhci-hcd.o] Error 1
Makefile:1551: recipe for target 'module/home/dev/workspace/fido/vhci_hcd' failed
make[1]: *** [module/home/dev/workspace/fido/vhci_hcd] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-42-generic'
Makefile:35: recipe for target 'default' failed
make: *** [default] Error 2
I'm building it on ubuntu 18.04.

Thanks,

@linuxbuh
Copy link
Owner Author

Same issue:
File 'usb-vhci-hcd.c' :
replace 'show_debug_output' by 'debug_output_show'
replace 'store_debug_output' by 'debug_output_store'
replace 'static DRIVER_ATTR(debug_output, S_IRUSR | S_IWUSR, show_debug_output, store_debug_output);' by 'static DRIVER_ATTR_RW(debug_output);'

Do the same for file 'usb-vhci-iocifc.c' & add the following header
#include <linux/uaccess.h>'

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

1 participant