From b7526c19a57e9c584bdc689fa2447804580dbf94 Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Sat, 21 Nov 2015 10:30:23 -0700 Subject: darwin: updates to support el capitan With the new USB stack Apple changed the underlying device class from IOUSBDevice to IOUSBHostDevice. Additionally, they removed the PortNum property from the IO registry entry. This commit add code to detect the currently running xnu version. If the version is at least 15 (10.11.0) the new device class is used to find usb devices and the port number is read from the IOService parent of the USB device instead of the PortNum property. Closes #127 May have some effect on either #123 or #96. Signed-off-by: Nathan Hjelm --- libusb/os/darwin_usb.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libusb/os/darwin_usb.h') diff --git a/libusb/os/darwin_usb.h b/libusb/os/darwin_usb.h index 4cf28bf..1180434 100644 --- a/libusb/os/darwin_usb.h +++ b/libusb/os/darwin_usb.h @@ -1,6 +1,6 @@ /* * darwin backend for libusb 1.0 - * Copyright © 2008-2013 Nathan Hjelm + * Copyright © 2008-2015 Nathan Hjelm * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,7 +28,13 @@ #include /* IOUSBInterfaceInferface */ -#if defined (kIOUSBInterfaceInterfaceID550) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 +#if defined (kIOUSBInterfaceInterfaceID700) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 + +#define usb_interface_t IOUSBInterfaceInterface700 +#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID700 +#define InterfaceVersion 700 + +#elif defined (kIOUSBInterfaceInterfaceID550) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 #define usb_interface_t IOUSBInterfaceInterface550 #define InterfaceInterfaceID kIOUSBInterfaceInterfaceID550 -- cgit v1.2.1