diff --git a/configure.ac b/configure.ac index 91d34e8..c0508eb 100644 --- a/configure.ac +++ b/configure.ac @@ -33,6 +33,7 @@ PKG_PROG_PKG_CONFIG([0.20]) PKG_CHECK_MODULES(TALLOC, [talloc >= 2.0.1]) PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.0.1.120) +PKG_CHECK_MODULES(LIBOSMOUSB, libosmousb) PKG_CHECK_MODULES(LIBUSB, libusb-1.0 >= 1.0.21) AC_CONFIG_MACRO_DIR([m4]) diff --git a/src/Makefile.am b/src/Makefile.am index fd9ec35..2890554 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,7 +4,7 @@ LIBVERSION=0:0:0 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) -AM_CFLAGS=-Wall -Wno-unused-result $(LIBOSMOCORE_CFLAGS) $(LIBUSB_CFLAGS) +AM_CFLAGS=-Wall -Wno-unused-result $(LIBOSMOCORE_CFLAGS) $(LIBOSMOUSB_LIBS) $(LIBUSB_CFLAGS) lib_LTLIBRARIES = libosmo-e1d.la @@ -35,4 +35,4 @@ osmo_e1d_SOURCES = \ usb.c \ $(NULL) -osmo_e1d_LDADD = $(LIBOSMOCORE_LIBS) $(LIBUSB_LIBS) libosmo-e1d.la +osmo_e1d_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOUSB_LIBS) $(LIBUSB_LIBS) libosmo-e1d.la diff --git a/src/osmo-e1d.c b/src/osmo-e1d.c index fa3fc6c..92d98d3 100644 --- a/src/osmo-e1d.c +++ b/src/osmo-e1d.c @@ -42,7 +42,6 @@ extern struct osmo_e1dp_server_handler e1d_ctl_handlers[]; extern int e1_usb_probe(struct e1_daemon *e1d); -extern int e1_usb_poll(void); @@ -122,8 +121,7 @@ int main(int argc, char *argv[]) /* main loop */ while (!g_shutdown) { - osmo_select_main(1); - e1_usb_poll(); + osmo_select_main(0); } /* cleanup */ diff --git a/src/usb.c b/src/usb.c index 18e3053..19855f8 100644 --- a/src/usb.c +++ b/src/usb.c @@ -30,6 +30,7 @@ #include #include +#include #include @@ -572,7 +573,7 @@ e1_usb_probe(struct e1_daemon *e1d) int i, ret; if (!g_usb) { - ret = libusb_init(&g_usb); + ret = osmo_libusb_init(&g_usb); if (ret) { LOGP(DE1D, LOGL_ERROR, "Failed to initialize libusb\n"); return -EIO; @@ -602,15 +603,3 @@ e1_usb_probe(struct e1_daemon *e1d) return 0; } - -int -e1_usb_poll(void) -{ - int rv; - - rv = libusb_handle_events(g_usb); - if (rv != LIBUSB_SUCCESS) - return -EIO; - - return 0; -}