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.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 1f492c0c7047..8dead32e7ebf 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -40,6 +40,8 @@ struct usb_driver;
40 * Devices may also have class-specific or vendor-specific descriptors. 40 * Devices may also have class-specific or vendor-specific descriptors.
41 */ 41 */
42 42
43struct ep_device;
44
43/** 45/**
44 * struct usb_host_endpoint - host-side endpoint descriptor and queue 46 * struct usb_host_endpoint - host-side endpoint descriptor and queue
45 * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder 47 * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder
@@ -57,7 +59,7 @@ struct usb_host_endpoint {
57 struct usb_endpoint_descriptor desc; 59 struct usb_endpoint_descriptor desc;
58 struct list_head urb_list; 60 struct list_head urb_list;
59 void *hcpriv; 61 void *hcpriv;
60 struct kobject *kobj; /* For sysfs info */ 62 struct ep_device *ep_dev; /* For sysfs info */
61 63
62 unsigned char *extra; /* Extra descriptors */ 64 unsigned char *extra; /* Extra descriptors */
63 int extralen; 65 int extralen;
@@ -101,7 +103,8 @@ enum usb_interface_condition {
101 * @condition: binding state of the interface: not bound, binding 103 * @condition: binding state of the interface: not bound, binding
102 * (in probe()), bound to a driver, or unbinding (in disconnect()) 104 * (in probe()), bound to a driver, or unbinding (in disconnect())
103 * @dev: driver model's view of this device 105 * @dev: driver model's view of this device
104 * @class_dev: driver model's class view of this device. 106 * @usb_dev: if an interface is bound to the USB major, this will point
107 * to the sysfs representation for that device.
105 * 108 *
106 * USB device drivers attach to interfaces on a physical device. Each 109 * USB device drivers attach to interfaces on a physical device. Each
107 * interface encapsulates a single high level function, such as feeding 110 * interface encapsulates a single high level function, such as feeding
@@ -141,7 +144,7 @@ struct usb_interface {
141 * bound to */ 144 * bound to */
142 enum usb_interface_condition condition; /* state of binding */ 145 enum usb_interface_condition condition; /* state of binding */
143 struct device dev; /* interface specific device info */ 146 struct device dev; /* interface specific device info */
144 struct class_device *class_dev; 147 struct device *usb_dev; /* pointer to the usb class's device, if any */
145}; 148};
146#define to_usb_interface(d) container_of(d, struct usb_interface, dev) 149#define to_usb_interface(d) container_of(d, struct usb_interface, dev)
147#define interface_to_usbdev(intf) \ 150#define interface_to_usbdev(intf) \
@@ -358,7 +361,7 @@ struct usb_device {
358 char *serial; /* iSerialNumber string, if present */ 361 char *serial; /* iSerialNumber string, if present */
359 362
360 struct list_head filelist; 363 struct list_head filelist;
361 struct class_device *class_dev; 364 struct device *usbfs_dev;
362 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ 365 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */
363 366
364 /* 367 /*
@@ -386,6 +389,8 @@ extern int usb_lock_device_for_reset(struct usb_device *udev,
386 389
387/* USB port reset for device reinitialization */ 390/* USB port reset for device reinitialization */
388extern int usb_reset_device(struct usb_device *dev); 391extern int usb_reset_device(struct usb_device *dev);
392extern int usb_reset_composite_device(struct usb_device *dev,
393 struct usb_interface *iface);
389 394
390extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); 395extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id);
391 396
@@ -554,6 +559,10 @@ struct usb_dynids {
554 * do (or don't) show up otherwise in the filesystem. 559 * do (or don't) show up otherwise in the filesystem.
555 * @suspend: Called when the device is going to be suspended by the system. 560 * @suspend: Called when the device is going to be suspended by the system.
556 * @resume: Called when the device is being resumed by the system. 561 * @resume: Called when the device is being resumed by the system.
562 * @pre_reset: Called by usb_reset_composite_device() when the device
563 * is about to be reset.
564 * @post_reset: Called by usb_reset_composite_device() after the device
565 * has been reset.
557 * @id_table: USB drivers use ID table to support hotplugging. 566 * @id_table: USB drivers use ID table to support hotplugging.
558 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set 567 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set
559 * or your driver's probe function will never get called. 568 * or your driver's probe function will never get called.
@@ -592,6 +601,9 @@ struct usb_driver {
592 int (*suspend) (struct usb_interface *intf, pm_message_t message); 601 int (*suspend) (struct usb_interface *intf, pm_message_t message);
593 int (*resume) (struct usb_interface *intf); 602 int (*resume) (struct usb_interface *intf);
594 603
604 void (*pre_reset) (struct usb_interface *intf);
605 void (*post_reset) (struct usb_interface *intf);
606
595 const struct usb_device_id *id_table; 607 const struct usb_device_id *id_table;
596 608
597 struct usb_dynids dynids; 609 struct usb_dynids dynids;
@@ -1008,6 +1020,8 @@ void usb_buffer_unmap_sg (struct usb_device *dev, unsigned pipe,
1008extern int usb_control_msg(struct usb_device *dev, unsigned int pipe, 1020extern int usb_control_msg(struct usb_device *dev, unsigned int pipe,
1009 __u8 request, __u8 requesttype, __u16 value, __u16 index, 1021 __u8 request, __u8 requesttype, __u16 value, __u16 index,
1010 void *data, __u16 size, int timeout); 1022 void *data, __u16 size, int timeout);
1023extern int usb_interrupt_msg(struct usb_device *usb_dev, unsigned int pipe,
1024 void *data, int len, int *actual_length, int timeout);
1011extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, 1025extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
1012 void *data, int len, int *actual_length, 1026 void *data, int len, int *actual_length,
1013 int timeout); 1027 int timeout);