aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r--include/linux/usb.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index e34e5e3dce5..d2bd0c8e015 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -10,7 +10,6 @@
10 10
11#ifdef __KERNEL__ 11#ifdef __KERNEL__
12 12
13#include <linux/config.h>
14#include <linux/errno.h> /* for -ENODEV */ 13#include <linux/errno.h> /* for -ENODEV */
15#include <linux/delay.h> /* for mdelay() */ 14#include <linux/delay.h> /* for mdelay() */
16#include <linux/interrupt.h> /* for in_interrupt() */ 15#include <linux/interrupt.h> /* for in_interrupt() */
@@ -41,13 +40,15 @@ struct usb_driver;
41 * Devices may also have class-specific or vendor-specific descriptors. 40 * Devices may also have class-specific or vendor-specific descriptors.
42 */ 41 */
43 42
43struct ep_device;
44
44/** 45/**
45 * struct usb_host_endpoint - host-side endpoint descriptor and queue 46 * struct usb_host_endpoint - host-side endpoint descriptor and queue
46 * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder 47 * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder
47 * @urb_list: urbs queued to this endpoint; maintained by usbcore 48 * @urb_list: urbs queued to this endpoint; maintained by usbcore
48 * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) 49 * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH)
49 * with one or more transfer descriptors (TDs) per urb 50 * with one or more transfer descriptors (TDs) per urb
50 * @kobj: kobject for sysfs info 51 * @ep_dev: ep_device for sysfs info
51 * @extra: descriptors following this endpoint in the configuration 52 * @extra: descriptors following this endpoint in the configuration
52 * @extralen: how many bytes of "extra" are valid 53 * @extralen: how many bytes of "extra" are valid
53 * 54 *
@@ -58,7 +59,7 @@ struct usb_host_endpoint {
58 struct usb_endpoint_descriptor desc; 59 struct usb_endpoint_descriptor desc;
59 struct list_head urb_list; 60 struct list_head urb_list;
60 void *hcpriv; 61 void *hcpriv;
61 struct kobject *kobj; /* For sysfs info */ 62 struct ep_device *ep_dev; /* For sysfs info */
62 63
63 unsigned char *extra; /* Extra descriptors */ 64 unsigned char *extra; /* Extra descriptors */
64 int extralen; 65 int extralen;
@@ -387,6 +388,8 @@ extern int usb_lock_device_for_reset(struct usb_device *udev,
387 388
388/* USB port reset for device reinitialization */ 389/* USB port reset for device reinitialization */
389extern int usb_reset_device(struct usb_device *dev); 390extern int usb_reset_device(struct usb_device *dev);
391extern int usb_reset_composite_device(struct usb_device *dev,
392 struct usb_interface *iface);
390 393
391extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); 394extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id);
392 395
@@ -555,6 +558,10 @@ struct usb_dynids {
555 * do (or don't) show up otherwise in the filesystem. 558 * do (or don't) show up otherwise in the filesystem.
556 * @suspend: Called when the device is going to be suspended by the system. 559 * @suspend: Called when the device is going to be suspended by the system.
557 * @resume: Called when the device is being resumed by the system. 560 * @resume: Called when the device is being resumed by the system.
561 * @pre_reset: Called by usb_reset_composite_device() when the device
562 * is about to be reset.
563 * @post_reset: Called by usb_reset_composite_device() after the device
564 * has been reset.
558 * @id_table: USB drivers use ID table to support hotplugging. 565 * @id_table: USB drivers use ID table to support hotplugging.
559 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set 566 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set
560 * or your driver's probe function will never get called. 567 * or your driver's probe function will never get called.
@@ -593,6 +600,9 @@ struct usb_driver {
593 int (*suspend) (struct usb_interface *intf, pm_message_t message); 600 int (*suspend) (struct usb_interface *intf, pm_message_t message);
594 int (*resume) (struct usb_interface *intf); 601 int (*resume) (struct usb_interface *intf);
595 602
603 void (*pre_reset) (struct usb_interface *intf);
604 void (*post_reset) (struct usb_interface *intf);
605
596 const struct usb_device_id *id_table; 606 const struct usb_device_id *id_table;
597 607
598 struct usb_dynids dynids; 608 struct usb_dynids dynids;
@@ -1009,6 +1019,8 @@ void usb_buffer_unmap_sg (struct usb_device *dev, unsigned pipe,
1009extern int usb_control_msg(struct usb_device *dev, unsigned int pipe, 1019extern int usb_control_msg(struct usb_device *dev, unsigned int pipe,
1010 __u8 request, __u8 requesttype, __u16 value, __u16 index, 1020 __u8 request, __u8 requesttype, __u16 value, __u16 index,
1011 void *data, __u16 size, int timeout); 1021 void *data, __u16 size, int timeout);
1022extern int usb_interrupt_msg(struct usb_device *usb_dev, unsigned int pipe,
1023 void *data, int len, int *actual_length, int timeout);
1012extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, 1024extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
1013 void *data, int len, int *actual_length, 1025 void *data, int len, int *actual_length,
1014 int timeout); 1026 int timeout);