~ubuntu-branches/ubuntu/trusty/argyll/trusty-proposed

« back to all changes in this revision

Viewing changes to libusb1/libusb/os/darwin_usb.h

  • Committer: Package Import Robot
  • Author(s): Artur Rona
  • Date: 2014-02-12 00:35:39 UTC
  • mfrom: (13.1.24 sid)
  • Revision ID: package-import@ubuntu.com-20140212003539-24tautzlitsiz61w
Tags: 1.5.1-5ubuntu1
* Merge from Debian unstable. (LP: #1275572) Remaining changes:
  - debian/control:
    + Build-depend on libtiff-dev rather than libtiff4-dev.
  - debian/control, debian/patches/06_fix_udev_rule.patch:
    + Fix udev rules to actually work; ENV{ACL_MANAGE} has
      stopped working ages ago, and with logind it's now the
      "uaccess" tag. Dropping also consolekit from Recommends.
  - debian/patches/drop-usb-db.patch:
    + Use hwdb builtin, instead of the obsolete usb-db
      in the udev rules.
* debian/patches/05_ftbfs-underlinkage.diff:
  - Dropped change, no needed anymore.
* Refresh the patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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/IOCFBundle.h>
26
 
#include <IOKit/usb/IOUSBLib.h>
27
 
#include <IOKit/IOCFPlugIn.h>
28
 
 
29
 
/* IOUSBInterfaceInferface */
30
 
#if defined (kIOUSBInterfaceInterfaceID300)
31
 
 
32
 
#define usb_interface_t IOUSBInterfaceInterface300
33
 
#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID300
34
 
#define InterfaceVersion 300
35
 
 
36
 
#elif defined (kIOUSBInterfaceInterfaceID245)
37
 
 
38
 
#define usb_interface_t IOUSBInterfaceInterface245
39
 
#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID245
40
 
#define InterfaceVersion 245
41
 
 
42
 
#elif defined (kIOUSBInterfaceInterfaceID220)
43
 
 
44
 
#define usb_interface_t IOUSBInterfaceInterface220
45
 
#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID220
46
 
#define InterfaceVersion 220
47
 
 
48
 
#elif defined (kIOUSBInterfaceInterfaceID197)
49
 
 
50
 
#define usb_interface_t IOUSBInterfaceInterface197
51
 
#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID197
52
 
#define InterfaceVersion 197
53
 
 
54
 
#elif defined (kIOUSBInterfaceInterfaceID190)
55
 
 
56
 
#define usb_interface_t IOUSBInterfaceInterface190
57
 
#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID190
58
 
#define InterfaceVersion 190
59
 
 
60
 
#elif defined (kIOUSBInterfaceInterfaceID182)
61
 
 
62
 
#define usb_interface_t IOUSBInterfaceInterface182
63
 
#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID182
64
 
#define InterfaceVersion 182
65
 
 
66
 
#else
67
 
 
68
 
#error "IOUSBFamily is too old. Please upgrade your OS"
69
 
 
70
 
#endif
71
 
 
72
 
/* IOUSBDeviceInterface */
73
 
#if defined (kIOUSBDeviceInterfaceID320)
74
 
 
75
 
#define usb_device_t    IOUSBDeviceInterface320
76
 
#define DeviceInterfaceID kIOUSBDeviceInterfaceID320
77
 
#define DeviceVersion 320
78
 
 
79
 
#elif defined (kIOUSBDeviceInterfaceID300)
80
 
 
81
 
#define usb_device_t    IOUSBDeviceInterface300
82
 
#define DeviceInterfaceID kIOUSBDeviceInterfaceID300
83
 
#define DeviceVersion 300
84
 
 
85
 
#elif defined (kIOUSBDeviceInterfaceID245)
86
 
 
87
 
#define usb_device_t    IOUSBDeviceInterface245
88
 
#define DeviceInterfaceID kIOUSBDeviceInterfaceID245
89
 
#define DeviceVersion 245
90
 
 
91
 
#elif defined (kIOUSBDeviceInterfaceID197)
92
 
 
93
 
#define usb_device_t    IOUSBDeviceInterface197
94
 
#define DeviceInterfaceID kIOUSBDeviceInterfaceID197
95
 
#define DeviceVersion 197
96
 
 
97
 
#elif defined (kIOUSBDeviceInterfaceID187)
98
 
 
99
 
#define usb_device_t    IOUSBDeviceInterface187
100
 
#define DeviceInterfaceID kIOUSBDeviceInterfaceID187
101
 
#define DeviceVersion 187
102
 
 
103
 
#elif defined (kIOUSBDeviceInterfaceID182)
104
 
 
105
 
#define usb_device_t    IOUSBDeviceInterface182
106
 
#define DeviceInterfaceID kIOUSBDeviceInterfaceID182
107
 
#define DeviceVersion 182
108
 
 
109
 
#else
110
 
 
111
 
#error "IOUSBFamily is too old. Please upgrade your OS"
112
 
 
113
 
#endif
114
 
 
115
 
typedef IOCFPlugInInterface *io_cf_plugin_ref_t;
116
 
typedef IONotificationPortRef io_notification_port_t;
117
 
 
118
 
/* private structures */
119
 
struct darwin_device_priv {
120
 
  IOUSBDeviceDescriptor dev_descriptor;
121
 
  UInt32                location;
122
 
  char                  sys_path[21];
123
 
  usb_device_t        **device;
124
 
  int                  open_count;
125
 
  UInt8                active_config;
126
 
};
127
 
 
128
 
struct darwin_device_handle_priv {
129
 
  int                  is_open;
130
 
  CFRunLoopSourceRef   cfSource;
131
 
  int                  fds[2];
132
 
 
133
 
  struct __darwin_interface {
134
 
    usb_interface_t    **interface;
135
 
    uint8_t              num_endpoints;
136
 
    CFRunLoopSourceRef   cfSource;
137
 
    uint8_t            endpoint_addrs[USB_MAXENDPOINTS];
138
 
  } interfaces[USB_MAXINTERFACES];
139
 
};
140
 
 
141
 
struct darwin_transfer_priv {
142
 
  /* Isoc */
143
 
  IOUSBIsocFrame *isoc_framelist;
144
 
 
145
 
  /* Control */
146
 
#if !defined (LIBUSB_NO_TIMEOUT_DEVICE)
147
 
  IOUSBDevRequestTO req;
148
 
#else
149
 
  IOUSBDevRequest req;
150
 
#endif
151
 
 
152
 
  /* Bulk */
153
 
};
154
 
 
155
 
enum {
156
 
  MESSAGE_DEVICE_GONE,
157
 
  MESSAGE_ASYNC_IO_COMPLETE
158
 
};
159
 
 
160
 
 
161
 
 
162
 
#endif