diff options
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r-- | include/linux/usb.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index e34e5e3dce52..8dead32e7ebf 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,6 +40,8 @@ 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 | ||
43 | struct 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 |
@@ -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; |
@@ -102,7 +103,8 @@ enum usb_interface_condition { | |||
102 | * @condition: binding state of the interface: not bound, binding | 103 | * @condition: binding state of the interface: not bound, binding |
103 | * (in probe()), bound to a driver, or unbinding (in disconnect()) | 104 | * (in probe()), bound to a driver, or unbinding (in disconnect()) |
104 | * @dev: driver model's view of this device | 105 | * @dev: driver model's view of this device |
105 | * @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. | ||
106 | * | 108 | * |
107 | * USB device drivers attach to interfaces on a physical device. Each | 109 | * USB device drivers attach to interfaces on a physical device. Each |
108 | * interface encapsulates a single high level function, such as feeding | 110 | * interface encapsulates a single high level function, such as feeding |
@@ -142,7 +144,7 @@ struct usb_interface { | |||
142 | * bound to */ | 144 | * bound to */ |
143 | enum usb_interface_condition condition; /* state of binding */ | 145 | enum usb_interface_condition condition; /* state of binding */ |
144 | struct device dev; /* interface specific device info */ | 146 | struct device dev; /* interface specific device info */ |
145 | struct class_device *class_dev; | 147 | struct device *usb_dev; /* pointer to the usb class's device, if any */ |
146 | }; | 148 | }; |
147 | #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) |
148 | #define interface_to_usbdev(intf) \ | 150 | #define interface_to_usbdev(intf) \ |
@@ -359,7 +361,7 @@ struct usb_device { | |||
359 | char *serial; /* iSerialNumber string, if present */ | 361 | char *serial; /* iSerialNumber string, if present */ |
360 | 362 | ||
361 | struct list_head filelist; | 363 | struct list_head filelist; |
362 | struct class_device *class_dev; | 364 | struct device *usbfs_dev; |
363 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ | 365 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ |
364 | 366 | ||
365 | /* | 367 | /* |
@@ -387,6 +389,8 @@ extern int usb_lock_device_for_reset(struct usb_device *udev, | |||
387 | 389 | ||
388 | /* USB port reset for device reinitialization */ | 390 | /* USB port reset for device reinitialization */ |
389 | extern int usb_reset_device(struct usb_device *dev); | 391 | extern int usb_reset_device(struct usb_device *dev); |
392 | extern int usb_reset_composite_device(struct usb_device *dev, | ||
393 | struct usb_interface *iface); | ||
390 | 394 | ||
391 | extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); | 395 | extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); |
392 | 396 | ||
@@ -555,6 +559,10 @@ struct usb_dynids { | |||
555 | * do (or don't) show up otherwise in the filesystem. | 559 | * do (or don't) show up otherwise in the filesystem. |
556 | * @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. |
557 | * @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. | ||
558 | * @id_table: USB drivers use ID table to support hotplugging. | 566 | * @id_table: USB drivers use ID table to support hotplugging. |
559 | * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set | 567 | * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set |
560 | * or your driver's probe function will never get called. | 568 | * or your driver's probe function will never get called. |
@@ -593,6 +601,9 @@ struct usb_driver { | |||
593 | int (*suspend) (struct usb_interface *intf, pm_message_t message); | 601 | int (*suspend) (struct usb_interface *intf, pm_message_t message); |
594 | int (*resume) (struct usb_interface *intf); | 602 | int (*resume) (struct usb_interface *intf); |
595 | 603 | ||
604 | void (*pre_reset) (struct usb_interface *intf); | ||
605 | void (*post_reset) (struct usb_interface *intf); | ||
606 | |||
596 | const struct usb_device_id *id_table; | 607 | const struct usb_device_id *id_table; |
597 | 608 | ||
598 | struct usb_dynids dynids; | 609 | struct usb_dynids dynids; |
@@ -1009,6 +1020,8 @@ void usb_buffer_unmap_sg (struct usb_device *dev, unsigned pipe, | |||
1009 | extern int usb_control_msg(struct usb_device *dev, unsigned int pipe, | 1020 | extern int usb_control_msg(struct usb_device *dev, unsigned int pipe, |
1010 | __u8 request, __u8 requesttype, __u16 value, __u16 index, | 1021 | __u8 request, __u8 requesttype, __u16 value, __u16 index, |
1011 | void *data, __u16 size, int timeout); | 1022 | void *data, __u16 size, int timeout); |
1023 | extern int usb_interrupt_msg(struct usb_device *usb_dev, unsigned int pipe, | ||
1024 | void *data, int len, int *actual_length, int timeout); | ||
1012 | extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, | 1025 | extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, |
1013 | void *data, int len, int *actual_length, | 1026 | void *data, int len, int *actual_length, |
1014 | int timeout); | 1027 | int timeout); |