summaryrefslogtreecommitdiffstats
path: root/include/libusb-1.0/os/darwin_usb.h
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2013-09-26 10:41:13 +0200
committerGravatar Martin Szulecki2013-09-26 10:41:13 +0200
commit07391edbf2ca1feaf4357259fd9e477ec53e6d81 (patch)
tree09bc0ab7de21b994dcb039a3e652ccfe173c310d /include/libusb-1.0/os/darwin_usb.h
parentafb8735176869db20219c35a341e89158651bffe (diff)
downloadlibirecovery-07391edbf2ca1feaf4357259fd9e477ec53e6d81.tar.gz
libirecovery-07391edbf2ca1feaf4357259fd9e477ec53e6d81.tar.bz2
Remove obsolete "in-tree" copy of libusb-1.0
Diffstat (limited to 'include/libusb-1.0/os/darwin_usb.h')
-rw-r--r--include/libusb-1.0/os/darwin_usb.h167
1 files changed, 0 insertions, 167 deletions
diff --git a/include/libusb-1.0/os/darwin_usb.h b/include/libusb-1.0/os/darwin_usb.h
deleted file mode 100644
index a71d464..0000000
--- a/include/libusb-1.0/os/darwin_usb.h
+++ /dev/null
@@ -1,167 +0,0 @@
1/*
2 * darwin backend for libusb 1.0
3 * Copyright (C) 2008-2009 Nathan Hjelm <hjelmn@users.sourceforge.net>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#if !defined(LIBUSB_DARWIN_H)
21#define LIBUSB_DARWIN_H
22
23#include "libusbi.h"
24
25#include <IOKit/IOTypes.h>
26#include <IOKit/IOCFBundle.h>
27#include <IOKit/usb/IOUSBLib.h>
28#include <IOKit/IOCFPlugIn.h>
29
30/* IOUSBInterfaceInferface */
31#if defined (kIOUSBInterfaceInterfaceID300)
32
33#define usb_interface_t IOUSBInterfaceInterface300
34#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID300
35#define InterfaceVersion 300
36
37#elif defined (kIOUSBInterfaceInterfaceID245)
38
39#define usb_interface_t IOUSBInterfaceInterface245
40#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID245
41#define InterfaceVersion 245
42
43#elif defined (kIOUSBInterfaceInterfaceID220)
44
45#define usb_interface_t IOUSBInterfaceInterface220
46#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID220
47#define InterfaceVersion 220
48
49#elif defined (kIOUSBInterfaceInterfaceID197)
50
51#define usb_interface_t IOUSBInterfaceInterface197
52#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID197
53#define InterfaceVersion 197
54
55#elif defined (kIOUSBInterfaceInterfaceID190)
56
57#define usb_interface_t IOUSBInterfaceInterface190
58#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID190
59#define InterfaceVersion 190
60
61#elif defined (kIOUSBInterfaceInterfaceID182)
62
63#define usb_interface_t IOUSBInterfaceInterface182
64#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID182
65#define InterfaceVersion 182
66
67#else
68
69#error "IOUSBFamily is too old. Please upgrade your OS"
70
71#endif
72
73/* IOUSBDeviceInterface */
74#if defined (kIOUSBDeviceInterfaceID320)
75
76#define usb_device_t IOUSBDeviceInterface320
77#define DeviceInterfaceID kIOUSBDeviceInterfaceID320
78#define DeviceVersion 320
79
80#elif defined (kIOUSBDeviceInterfaceID300)
81
82#define usb_device_t IOUSBDeviceInterface300
83#define DeviceInterfaceID kIOUSBDeviceInterfaceID300
84#define DeviceVersion 300
85
86#elif defined (kIOUSBDeviceInterfaceID245)
87
88#define usb_device_t IOUSBDeviceInterface245
89#define DeviceInterfaceID kIOUSBDeviceInterfaceID245
90#define DeviceVersion 245
91
92#elif defined (kIOUSBDeviceInterfaceID197)
93
94#define usb_device_t IOUSBDeviceInterface197
95#define DeviceInterfaceID kIOUSBDeviceInterfaceID197
96#define DeviceVersion 197
97
98#elif defined (kIOUSBDeviceInterfaceID187)
99
100#define usb_device_t IOUSBDeviceInterface187
101#define DeviceInterfaceID kIOUSBDeviceInterfaceID187
102#define DeviceVersion 187
103
104#elif defined (kIOUSBDeviceInterfaceID182)
105
106#define usb_device_t IOUSBDeviceInterface182
107#define DeviceInterfaceID kIOUSBDeviceInterfaceID182
108#define DeviceVersion 182
109
110#else
111
112#error "IOUSBFamily is too old. Please upgrade your OS"
113
114#endif
115
116#if !defined(IO_OBJECT_NULL)
117#define IO_OBJECT_NULL ((io_object_t) 0)
118#endif
119
120typedef IOCFPlugInInterface *io_cf_plugin_ref_t;
121typedef IONotificationPortRef io_notification_port_t;
122
123/* private structures */
124struct darwin_device_priv {
125 IOUSBDeviceDescriptor dev_descriptor;
126 UInt32 location;
127 char sys_path[21];
128 usb_device_t **device;
129 int open_count;
130 UInt8 first_config, active_config;
131};
132
133struct darwin_device_handle_priv {
134 int is_open;
135 CFRunLoopSourceRef cfSource;
136 int fds[2];
137
138 struct __darwin_interface {
139 usb_interface_t **interface;
140 uint8_t num_endpoints;
141 CFRunLoopSourceRef cfSource;
142 uint8_t endpoint_addrs[USB_MAXENDPOINTS];
143 } interfaces[USB_MAXINTERFACES];
144};
145
146struct darwin_transfer_priv {
147 /* Isoc */
148 IOUSBIsocFrame *isoc_framelist;
149
150 /* Control */
151#if !defined (LIBUSB_NO_TIMEOUT_DEVICE)
152 IOUSBDevRequestTO req;
153#else
154 IOUSBDevRequest req;
155#endif
156
157 /* Bulk */
158};
159
160enum {
161 MESSAGE_DEVICE_GONE,
162 MESSAGE_ASYNC_IO_COMPLETE
163};
164
165
166
167#endif