From 4f841ef1de8fbb44fb686d88ae00bf1aa1876ae1 Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Tue, 2 Oct 2012 08:07:03 -0600 Subject: [PATCH] Darwin: Add support for detecting superspeed devices * IOUSBFamily 5.0.0 or newer --- libusb/os/darwin_usb.c | 3 +++ libusb/os/darwin_usb.h | 8 +++++++- libusb/version_nano.h | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/libusb/os/darwin_usb.c b/libusb/os/darwin_usb.c index 187ccfc..c931815 100644 --- a/libusb/os/darwin_usb.c +++ b/libusb/os/darwin_usb.c @@ -787,6 +787,9 @@ static int process_new_device (struct libusb_context *ctx, usb_device_t **device case kUSBDeviceSpeedLow: dev->speed = LIBUSB_SPEED_LOW; break; case kUSBDeviceSpeedFull: dev->speed = LIBUSB_SPEED_FULL; break; case kUSBDeviceSpeedHigh: dev->speed = LIBUSB_SPEED_HIGH; break; +#if DeviceVersion >= 500 + case kUSBDeviceSpeedSuper: dev->speed = LIBUSB_SPEED_SUPER; break; +#endif default: usbi_warn (ctx, "Got unknown device speed %d", devSpeed); } diff --git a/libusb/os/darwin_usb.h b/libusb/os/darwin_usb.h index 7f64514..33760ba 100644 --- a/libusb/os/darwin_usb.h +++ b/libusb/os/darwin_usb.h @@ -71,7 +71,13 @@ #endif /* IOUSBDeviceInterface */ -#if defined (kIOUSBDeviceInterfaceID320) +#if defined (kIOUSBDeviceInterfaceID500) + +#define usb_device_t IOUSBDeviceInterface500 +#define DeviceInterfaceID kIOUSBDeviceInterfaceID500 +#define DeviceVersion 500 + +#elif defined (kIOUSBDeviceInterfaceID320) #define usb_device_t IOUSBDeviceInterface320 #define DeviceInterfaceID kIOUSBDeviceInterfaceID320 diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 771be77..3b23e4e 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 10583 +#define LIBUSB_NANO 10584 -- 2.7.4