summaryrefslogtreecommitdiff
path: root/libusb/os/darwin_usb.h
diff options
context:
space:
mode:
authorNathan Hjelm <hjelmn@me.com>2015-11-21 10:30:23 -0700
committerNathan Hjelm <hjelmn@me.com>2015-11-21 10:30:23 -0700
commitb7526c19a57e9c584bdc689fa2447804580dbf94 (patch)
tree3f347e64eb033e419d58c080b1902e4d4ca3d146 /libusb/os/darwin_usb.h
parent5e45e0741daee4fa295c6cc977edfb986c872152 (diff)
downloadlibusb-b7526c19a57e9c584bdc689fa2447804580dbf94.tar.gz
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 <hjelmn@me.com>
Diffstat (limited to 'libusb/os/darwin_usb.h')
-rw-r--r--libusb/os/darwin_usb.h10
1 files changed, 8 insertions, 2 deletions
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 <hjelmn@users.sourceforge.net>
+ * Copyright © 2008-2015 Nathan Hjelm <hjelmn@users.sourceforge.net>
*
* 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 <IOKit/IOCFPlugIn.h>
/* 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