summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/cold-flash.c2
-rw-r--r--src/nolo.c2
-rw-r--r--src/usb-device.c14
-rw-r--r--src/usb-device.h7
4 files changed, 13 insertions, 12 deletions
diff --git a/src/cold-flash.c b/src/cold-flash.c
index fc2e86b..6338670 100644
--- a/src/cold-flash.c
+++ b/src/cold-flash.c
@@ -22,8 +22,6 @@
#include <string.h>
#include <errno.h>
-#include <usb.h>
-
#include "global.h"
#include "cold-flash.h"
#include "image.h"
diff --git a/src/nolo.c b/src/nolo.c
index 1dd9d61..9faea56 100644
--- a/src/nolo.c
+++ b/src/nolo.c
@@ -22,8 +22,6 @@
#include <stdlib.h>
#include <arpa/inet.h>
-#include <usb.h>
-
#include "nolo.h"
#include "image.h"
#include "global.h"
diff --git a/src/usb-device.c b/src/usb-device.c
index 391574a..24ce4be 100644
--- a/src/usb-device.c
+++ b/src/usb-device.c
@@ -31,14 +31,6 @@
#include <signal.h>
#include <dlfcn.h>
-#include <usb.h>
-
-#ifdef __linux__
-#ifdef LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP
-#include <sys/ioctl.h>
-#endif
-#endif
-
#include "global.h"
#include "device.h"
#include "usb-device.h"
@@ -47,6 +39,12 @@
#include "cold-flash.h"
#include "mkii.h"
+#ifdef __linux__
+#ifdef LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP
+#include <sys/ioctl.h>
+#endif
+#endif
+
static struct usb_flash_device usb_devices[] = {
{ 0x0421, 0x0096, -1, -1, -1, FLASH_DISK, { DEVICE_RX_44, 0 } },
{ 0x0421, 0x0105, 2, 1, -1, FLASH_NOLO, { DEVICE_SU_18, DEVICE_RX_44, DEVICE_RX_48, DEVICE_RX_51, DEVICE_RM_680, 0 } },
diff --git a/src/usb-device.h b/src/usb-device.h
index 101fbcd..082bf73 100644
--- a/src/usb-device.h
+++ b/src/usb-device.h
@@ -20,6 +20,13 @@
#ifndef USB_DEVICE_H
#define USB_DEVICE_H
+#include <stdint.h>
+
+/* u_int*_t types are not defined without _GNU_SOURCE but usb.h needs them */
+#define u_int8_t uint8_t
+#define u_int16_t uint16_t
+#define u_int32_t uint32_t
+
#include <usb.h>
#define USB_READ_EP (USB_ENDPOINT_IN | 0x1)