Can't build vhci_hcd
Brought to you by:
m_singer
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,
i have the same issue.
Ubuntu 18.04
Last edit: Alex 2020-01-26
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>'Cheers
Last edit: Stef77 2020-04-01