usb.h (3a37471551cd3b287ce7f02ed25bcf8ec37a191d) usb.h (21470e32ca7f976bf131aa3c7b54019d07f7d821)
1#ifndef __LINUX_USB_H
2#define __LINUX_USB_H
3
4#include <linux/mod_devicetable.h>
5#include <linux/usb/ch9.h>
6
7#define USB_MAJOR 180
8#define USB_DEVICE_MAJOR 189

--- 85 unchanged lines hidden (view full) ---

94
95enum usb_interface_condition {
96 USB_INTERFACE_UNBOUND = 0,
97 USB_INTERFACE_BINDING,
98 USB_INTERFACE_BOUND,
99 USB_INTERFACE_UNBINDING,
100};
101
1#ifndef __LINUX_USB_H
2#define __LINUX_USB_H
3
4#include <linux/mod_devicetable.h>
5#include <linux/usb/ch9.h>
6
7#define USB_MAJOR 180
8#define USB_DEVICE_MAJOR 189

--- 85 unchanged lines hidden (view full) ---

94
95enum usb_interface_condition {
96 USB_INTERFACE_UNBOUND = 0,
97 USB_INTERFACE_BINDING,
98 USB_INTERFACE_BOUND,
99 USB_INTERFACE_UNBINDING,
100};
101
102int __must_check
103usb_find_common_endpoints(struct usb_host_interface *alt,
104 struct usb_endpoint_descriptor **bulk_in,
105 struct usb_endpoint_descriptor **bulk_out,
106 struct usb_endpoint_descriptor **int_in,
107 struct usb_endpoint_descriptor **int_out);
108
109int __must_check
110usb_find_common_endpoints_reverse(struct usb_host_interface *alt,
111 struct usb_endpoint_descriptor **bulk_in,
112 struct usb_endpoint_descriptor **bulk_out,
113 struct usb_endpoint_descriptor **int_in,
114 struct usb_endpoint_descriptor **int_out);
115
116static inline int __must_check
117usb_find_bulk_in_endpoint(struct usb_host_interface *alt,
118 struct usb_endpoint_descriptor **bulk_in)
119{
120 return usb_find_common_endpoints(alt, bulk_in, NULL, NULL, NULL);
121}
122
123static inline int __must_check
124usb_find_bulk_out_endpoint(struct usb_host_interface *alt,
125 struct usb_endpoint_descriptor **bulk_out)
126{
127 return usb_find_common_endpoints(alt, NULL, bulk_out, NULL, NULL);
128}
129
130static inline int __must_check
131usb_find_int_in_endpoint(struct usb_host_interface *alt,
132 struct usb_endpoint_descriptor **int_in)
133{
134 return usb_find_common_endpoints(alt, NULL, NULL, int_in, NULL);
135}
136
137static inline int __must_check
138usb_find_int_out_endpoint(struct usb_host_interface *alt,
139 struct usb_endpoint_descriptor **int_out)
140{
141 return usb_find_common_endpoints(alt, NULL, NULL, NULL, int_out);
142}
143
144static inline int __must_check
145usb_find_last_bulk_in_endpoint(struct usb_host_interface *alt,
146 struct usb_endpoint_descriptor **bulk_in)
147{
148 return usb_find_common_endpoints_reverse(alt, bulk_in, NULL, NULL, NULL);
149}
150
151static inline int __must_check
152usb_find_last_bulk_out_endpoint(struct usb_host_interface *alt,
153 struct usb_endpoint_descriptor **bulk_out)
154{
155 return usb_find_common_endpoints_reverse(alt, NULL, bulk_out, NULL, NULL);
156}
157
158static inline int __must_check
159usb_find_last_int_in_endpoint(struct usb_host_interface *alt,
160 struct usb_endpoint_descriptor **int_in)
161{
162 return usb_find_common_endpoints_reverse(alt, NULL, NULL, int_in, NULL);
163}
164
165static inline int __must_check
166usb_find_last_int_out_endpoint(struct usb_host_interface *alt,
167 struct usb_endpoint_descriptor **int_out)
168{
169 return usb_find_common_endpoints_reverse(alt, NULL, NULL, NULL, int_out);
170}
171
102/**
103 * struct usb_interface - what usb device drivers talk to
104 * @altsetting: array of interface structures, one for each alternate
105 * setting that may be selected. Each one includes a set of
106 * endpoint configurations. They will be in no particular order.
107 * @cur_altsetting: the current altsetting.
108 * @num_altsetting: number of altsettings defined.
109 * @intf_assoc: interface association descriptor

--- 133 unchanged lines hidden (view full) ---

243 * @altsetting: variable-length array of interface structures, one for
244 * each alternate setting that may be selected. Each one includes a
245 * set of endpoint configurations. They will be in no particular order.
246 *
247 * These structures persist for the lifetime of a usb_device, unlike
248 * struct usb_interface (which persists only as long as its configuration
249 * is installed). The altsetting arrays can be accessed through these
250 * structures at any time, permitting comparison of configurations and
172/**
173 * struct usb_interface - what usb device drivers talk to
174 * @altsetting: array of interface structures, one for each alternate
175 * setting that may be selected. Each one includes a set of
176 * endpoint configurations. They will be in no particular order.
177 * @cur_altsetting: the current altsetting.
178 * @num_altsetting: number of altsettings defined.
179 * @intf_assoc: interface association descriptor

--- 133 unchanged lines hidden (view full) ---

313 * @altsetting: variable-length array of interface structures, one for
314 * each alternate setting that may be selected. Each one includes a
315 * set of endpoint configurations. They will be in no particular order.
316 *
317 * These structures persist for the lifetime of a usb_device, unlike
318 * struct usb_interface (which persists only as long as its configuration
319 * is installed). The altsetting arrays can be accessed through these
320 * structures at any time, permitting comparison of configurations and
251 * providing support for the /proc/bus/usb/devices pseudo-file.
321 * providing support for the /sys/kernel/debug/usb/devices pseudo-file.
252 */
253struct usb_interface_cache {
254 unsigned num_altsetting; /* number of alternate settings */
255 struct kref ref; /* reference counter */
256
257 /* variable-length array of alternate settings for this interface,
258 * stored in no particular order */
259 struct usb_host_interface altsetting[0];

--- 89 unchanged lines hidden (view full) ---

349 unsigned long devicemap[128 / (8*sizeof(unsigned long))];
350};
351
352/*
353 * Allocated per bus (tree of devices) we have:
354 */
355struct usb_bus {
356 struct device *controller; /* host/master side hardware */
322 */
323struct usb_interface_cache {
324 unsigned num_altsetting; /* number of alternate settings */
325 struct kref ref; /* reference counter */
326
327 /* variable-length array of alternate settings for this interface,
328 * stored in no particular order */
329 struct usb_host_interface altsetting[0];

--- 89 unchanged lines hidden (view full) ---

419 unsigned long devicemap[128 / (8*sizeof(unsigned long))];
420};
421
422/*
423 * Allocated per bus (tree of devices) we have:
424 */
425struct usb_bus {
426 struct device *controller; /* host/master side hardware */
427 struct device *sysdev; /* as seen from firmware or bus */
357 int busnum; /* Bus number (in order of reg) */
358 const char *bus_name; /* stable id (PCI slot_name etc) */
359 u8 uses_dma; /* Does the host controller use DMA? */
360 u8 uses_pio_for_control; /*
361 * Does the host controller use PIO
362 * for control transfers?
363 */
364 u8 otg_port; /* 0, or number of OTG/HNP port */

--- 1544 unchanged lines hidden ---
428 int busnum; /* Bus number (in order of reg) */
429 const char *bus_name; /* stable id (PCI slot_name etc) */
430 u8 uses_dma; /* Does the host controller use DMA? */
431 u8 uses_pio_for_control; /*
432 * Does the host controller use PIO
433 * for control transfers?
434 */
435 u8 otg_port; /* 0, or number of OTG/HNP port */

--- 1544 unchanged lines hidden ---