diff --git a/libnfc/buses/libusb-compat-core.c b/libnfc/buses/libusb-compat-core.c index 85f6231..dd8a5d8 100644 --- a/libnfc/buses/libusb-compat-core.c +++ b/libnfc/buses/libusb-compat-core.c @@ -28,7 +28,6 @@ #include #include "libusb-compat-usb.h" -#include "libusb-compat-usbi.h" static libusb_context *ctx = NULL; static int usb_debug = 0; diff --git a/libnfc/buses/libusb-compat-usb.h b/libnfc/buses/libusb-compat-usb.h index 55de01c..f7c4a59 100644 --- a/libnfc/buses/libusb-compat-usb.h +++ b/libnfc/buses/libusb-compat-usb.h @@ -32,6 +32,42 @@ #include +/* Some quick and generic macros for the simple kind of lists we use */ +#define LIST_ADD(begin, ent) \ + do { \ + if (begin) { \ + ent->next = begin; \ + ent->next->prev = ent; \ + } else \ + ent->next = NULL; \ + ent->prev = NULL; \ + begin = ent; \ + } while(0) + +#define LIST_DEL(begin, ent) \ + do { \ + if (ent->prev) \ + ent->prev->next = ent->next; \ + else \ + begin = ent->next; \ + if (ent->next) \ + ent->next->prev = ent->prev; \ + ent->prev = NULL; \ + ent->next = NULL; \ + } while (0) + +struct usbbus_dev_handle { + libusb_device_handle *handle; + struct usbbus_device *device; + + /* libusb-0.1 is buggy w.r.t. interface claiming. it allows you to claim + * multiple interfaces but only tracks the most recently claimed one, + * which is used for usb_set_altinterface(). we clone the buggy behaviour + * here. */ + int last_claimed_interface; +}; + + /* * USB spec information * @@ -191,9 +227,6 @@ struct usb_bus { struct usb_device *root_dev; }; -struct usb_dev_handle; -typedef struct usb_dev_handle usb_dev_handle; - /* Variables */ extern struct usb_bus *usb_busses; diff --git a/libnfc/buses/libusb-compat-usbi.h b/libnfc/buses/libusb-compat-usbi.h deleted file mode 100644 index 9d75e54..0000000 --- a/libnfc/buses/libusb-compat-usbi.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Internal header for libusb-compat-0.1 - * Copyright (C) 2008 Daniel Drake - * Copyright (c) 2000-2003 Johannes Erdfelt - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef __LIBUSB_USBI_H__ -#define __LIBUSB_USBI_H__ - -/* Some quick and generic macros for the simple kind of lists we use */ -#define LIST_ADD(begin, ent) \ - do { \ - if (begin) { \ - ent->next = begin; \ - ent->next->prev = ent; \ - } else \ - ent->next = NULL; \ - ent->prev = NULL; \ - begin = ent; \ - } while(0) - -#define LIST_DEL(begin, ent) \ - do { \ - if (ent->prev) \ - ent->prev->next = ent->next; \ - else \ - begin = ent->next; \ - if (ent->next) \ - ent->next->prev = ent->prev; \ - ent->prev = NULL; \ - ent->next = NULL; \ - } while (0) - -struct usb_dev_handle { - libusb_device_handle *handle; - struct usb_device *device; - - /* libusb-0.1 is buggy w.r.t. interface claiming. it allows you to claim - * multiple interfaces but only tracks the most recently claimed one, - * which is used for usb_set_altinterface(). we clone the buggy behaviour - * here. */ - int last_claimed_interface; -}; - -struct usbbus_dev_handle { - libusb_device_handle *handle; - struct usbbus_device *device; - - /* libusb-0.1 is buggy w.r.t. interface claiming. it allows you to claim - * multiple interfaces but only tracks the most recently claimed one, - * which is used for usb_set_altinterface(). we clone the buggy behaviour - * here. */ - int last_claimed_interface; -}; - -#endif - diff --git a/libnfc/buses/usbbus.c b/libnfc/buses/usbbus.c index 3ac9dda..6a92e2e 100644 --- a/libnfc/buses/usbbus.c +++ b/libnfc/buses/usbbus.c @@ -38,7 +38,6 @@ #include #include #include "libusb-compat-usb.h" -#include "libusb-compat-usbi.h" #include "usbbus.h" #include "log.h" #define LOG_CATEGORY "libnfc.buses.usbbus"