summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--acinclude.m42
-rw-r--r--extra/bcm203x.c14
-rw-r--r--tools/hid2hci.c4
3 files changed, 18 insertions, 2 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index f45c138c..e9aa2aca 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -97,6 +97,8 @@ AC_DEFUN([AC_PATH_USB], [
LDFLAGS="$LDFLAGS $USB_LIBS"
AC_CHECK_LIB(usb, usb_open, USB_LIBS="$USB_LIBS -lusb", usb_found=no)
+ AC_CHECK_LIB(usb, usb_get_busses, dummy=yes, AC_DEFINE(NEED_USB_GET_BUSSES, 1, [Define to 1 if you need the usb_get_busses() function.]))
+ AC_CHECK_LIB(usb, usb_interrupt_read, dummy=yes, AC_DEFINE(NEED_USB_INTERRUPT_READ, 1, [Define to 1 if you need the usb_interrupt_read() function.]))
CPPFLAGS=$ac_save_CPPFLAGS
LDFLAGS=$ac_save_LDFLAGS
diff --git a/extra/bcm203x.c b/extra/bcm203x.c
index f4c48364..1aa9257b 100644
--- a/extra/bcm203x.c
+++ b/extra/bcm203x.c
@@ -40,6 +40,20 @@
#include <usb.h>
+#ifdef NEED_USB_GET_BUSSES
+static inline struct usb_bus *usb_get_busses(void)
+{
+ return usb_busses;
+}
+#endif
+
+#ifdef NEED_USB_INTERRUPT_READ
+static inline int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, int timeout)
+{
+ return usb_bulk_read(dev, ep, bytes, size, timeout);
+}
+#endif
+
static char *fw_path = "/lib/firmware";
static int load_file(struct usb_dev_handle *udev, char *filename)
diff --git a/tools/hid2hci.c b/tools/hid2hci.c
index 6b2aec72..c800c7ee 100644
--- a/tools/hid2hci.c
+++ b/tools/hid2hci.c
@@ -40,8 +40,8 @@
#include <usb.h>
-#ifndef usb_get_busses
-struct usb_bus *usb_get_busses(void)
+#ifdef NEED_USB_GET_BUSSES
+static inline struct usb_bus *usb_get_busses(void)
{
return usb_busses;
}