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.h39
1 files changed, 35 insertions, 4 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 3aa2cd1f8d08..b1e3c2fbfe11 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -36,6 +36,7 @@ struct wusb_dev;
36 * - configs have one (often) or more interfaces; 36 * - configs have one (often) or more interfaces;
37 * - interfaces have one (usually) or more settings; 37 * - interfaces have one (usually) or more settings;
38 * - each interface setting has zero or (usually) more endpoints. 38 * - each interface setting has zero or (usually) more endpoints.
39 * - a SuperSpeed endpoint has a companion descriptor
39 * 40 *
40 * And there might be other descriptors mixed in with those. 41 * And there might be other descriptors mixed in with those.
41 * 42 *
@@ -44,6 +45,19 @@ struct wusb_dev;
44 45
45struct ep_device; 46struct ep_device;
46 47
48/* For SS devices */
49/**
50 * struct usb_host_ss_ep_comp - Valid for SuperSpeed devices only
51 * @desc: endpoint companion descriptor, wMaxPacketSize in native byteorder
52 * @extra: descriptors following this endpoint companion descriptor
53 * @extralen: how many bytes of "extra" are valid
54 */
55struct usb_host_ss_ep_comp {
56 struct usb_ss_ep_comp_descriptor desc;
57 unsigned char *extra; /* Extra descriptors */
58 int extralen;
59};
60
47/** 61/**
48 * struct usb_host_endpoint - host-side endpoint descriptor and queue 62 * struct usb_host_endpoint - host-side endpoint descriptor and queue
49 * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder 63 * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder
@@ -51,6 +65,7 @@ struct ep_device;
51 * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) 65 * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH)
52 * with one or more transfer descriptors (TDs) per urb 66 * with one or more transfer descriptors (TDs) per urb
53 * @ep_dev: ep_device for sysfs info 67 * @ep_dev: ep_device for sysfs info
68 * @ss_ep_comp: companion descriptor information for this endpoint
54 * @extra: descriptors following this endpoint in the configuration 69 * @extra: descriptors following this endpoint in the configuration
55 * @extralen: how many bytes of "extra" are valid 70 * @extralen: how many bytes of "extra" are valid
56 * @enabled: URBs may be submitted to this endpoint 71 * @enabled: URBs may be submitted to this endpoint
@@ -63,6 +78,7 @@ struct usb_host_endpoint {
63 struct list_head urb_list; 78 struct list_head urb_list;
64 void *hcpriv; 79 void *hcpriv;
65 struct ep_device *ep_dev; /* For sysfs info */ 80 struct ep_device *ep_dev; /* For sysfs info */
81 struct usb_host_ss_ep_comp *ss_ep_comp; /* For SS devices */
66 82
67 unsigned char *extra; /* Extra descriptors */ 83 unsigned char *extra; /* Extra descriptors */
68 int extralen; 84 int extralen;
@@ -336,7 +352,6 @@ struct usb_bus {
336#ifdef CONFIG_USB_DEVICEFS 352#ifdef CONFIG_USB_DEVICEFS
337 struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ 353 struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */
338#endif 354#endif
339 struct device *dev; /* device for this bus */
340 355
341#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) 356#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE)
342 struct mon_bus *mon_bus; /* non-null when associated */ 357 struct mon_bus *mon_bus; /* non-null when associated */
@@ -363,6 +378,7 @@ struct usb_tt;
363 * struct usb_device - kernel's representation of a USB device 378 * struct usb_device - kernel's representation of a USB device
364 * @devnum: device number; address on a USB bus 379 * @devnum: device number; address on a USB bus
365 * @devpath: device ID string for use in messages (e.g., /port/...) 380 * @devpath: device ID string for use in messages (e.g., /port/...)
381 * @route: tree topology hex string for use with xHCI
366 * @state: device state: configured, not attached, etc. 382 * @state: device state: configured, not attached, etc.
367 * @speed: device speed: high/full/low (or error) 383 * @speed: device speed: high/full/low (or error)
368 * @tt: Transaction Translator info; used with low/full speed dev, highspeed hub 384 * @tt: Transaction Translator info; used with low/full speed dev, highspeed hub
@@ -420,6 +436,7 @@ struct usb_tt;
420 * @skip_sys_resume: skip the next system resume 436 * @skip_sys_resume: skip the next system resume
421 * @wusb_dev: if this is a Wireless USB device, link to the WUSB 437 * @wusb_dev: if this is a Wireless USB device, link to the WUSB
422 * specific data for the device. 438 * specific data for the device.
439 * @slot_id: Slot ID assigned by xHCI
423 * 440 *
424 * Notes: 441 * Notes:
425 * Usbcore drivers should not set usbdev->state directly. Instead use 442 * Usbcore drivers should not set usbdev->state directly. Instead use
@@ -428,6 +445,7 @@ struct usb_tt;
428struct usb_device { 445struct usb_device {
429 int devnum; 446 int devnum;
430 char devpath [16]; 447 char devpath [16];
448 u32 route;
431 enum usb_device_state state; 449 enum usb_device_state state;
432 enum usb_device_speed speed; 450 enum usb_device_speed speed;
433 451
@@ -503,6 +521,7 @@ struct usb_device {
503 unsigned skip_sys_resume:1; 521 unsigned skip_sys_resume:1;
504#endif 522#endif
505 struct wusb_dev *wusb_dev; 523 struct wusb_dev *wusb_dev;
524 int slot_id;
506}; 525};
507#define to_usb_device(d) container_of(d, struct usb_device, dev) 526#define to_usb_device(d) container_of(d, struct usb_device, dev)
508 527
@@ -903,6 +922,8 @@ extern struct bus_type usb_bus_type;
903/** 922/**
904 * struct usb_class_driver - identifies a USB driver that wants to use the USB major number 923 * struct usb_class_driver - identifies a USB driver that wants to use the USB major number
905 * @name: the usb class device name for this driver. Will show up in sysfs. 924 * @name: the usb class device name for this driver. Will show up in sysfs.
925 * @nodename: Callback to provide a naming hint for a possible
926 * device node to create.
906 * @fops: pointer to the struct file_operations of this driver. 927 * @fops: pointer to the struct file_operations of this driver.
907 * @minor_base: the start of the minor range for this driver. 928 * @minor_base: the start of the minor range for this driver.
908 * 929 *
@@ -912,6 +933,7 @@ extern struct bus_type usb_bus_type;
912 */ 933 */
913struct usb_class_driver { 934struct usb_class_driver {
914 char *name; 935 char *name;
936 char *(*nodename)(struct device *dev);
915 const struct file_operations *fops; 937 const struct file_operations *fops;
916 int minor_base; 938 int minor_base;
917}; 939};
@@ -1024,6 +1046,8 @@ typedef void (*usb_complete_t)(struct urb *);
1024 * the device driver is saying that it provided this DMA address, 1046 * the device driver is saying that it provided this DMA address,
1025 * which the host controller driver should use in preference to the 1047 * which the host controller driver should use in preference to the
1026 * transfer_buffer. 1048 * transfer_buffer.
1049 * @sg: scatter gather buffer list
1050 * @num_sgs: number of entries in the sg list
1027 * @transfer_buffer_length: How big is transfer_buffer. The transfer may 1051 * @transfer_buffer_length: How big is transfer_buffer. The transfer may
1028 * be broken up into chunks according to the current maximum packet 1052 * be broken up into chunks according to the current maximum packet
1029 * size for the endpoint, which is a function of the configuration 1053 * size for the endpoint, which is a function of the configuration
@@ -1041,7 +1065,9 @@ typedef void (*usb_complete_t)(struct urb *);
1041 * @setup_dma: For control transfers with URB_NO_SETUP_DMA_MAP set, the 1065 * @setup_dma: For control transfers with URB_NO_SETUP_DMA_MAP set, the
1042 * device driver has provided this DMA address for the setup packet. 1066 * device driver has provided this DMA address for the setup packet.
1043 * The host controller driver should use this in preference to 1067 * The host controller driver should use this in preference to
1044 * setup_packet. 1068 * setup_packet, but the HCD may chose to ignore the address if it must
1069 * copy the setup packet into internal structures. Therefore, setup_packet
1070 * must always point to a valid buffer.
1045 * @start_frame: Returns the initial frame for isochronous transfers. 1071 * @start_frame: Returns the initial frame for isochronous transfers.
1046 * @number_of_packets: Lists the number of ISO transfer buffers. 1072 * @number_of_packets: Lists the number of ISO transfer buffers.
1047 * @interval: Specifies the polling interval for interrupt or isochronous 1073 * @interval: Specifies the polling interval for interrupt or isochronous
@@ -1177,6 +1203,8 @@ struct urb {
1177 unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/ 1203 unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/
1178 void *transfer_buffer; /* (in) associated data buffer */ 1204 void *transfer_buffer; /* (in) associated data buffer */
1179 dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */ 1205 dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */
1206 struct usb_sg_request *sg; /* (in) scatter gather buffer list */
1207 int num_sgs; /* (in) number of entries in the sg list */
1180 u32 transfer_buffer_length; /* (in) data buffer length */ 1208 u32 transfer_buffer_length; /* (in) data buffer length */
1181 u32 actual_length; /* (return) actual transfer length */ 1209 u32 actual_length; /* (return) actual transfer length */
1182 unsigned char *setup_packet; /* (in) setup packet (control only) */ 1210 unsigned char *setup_packet; /* (in) setup packet (control only) */
@@ -1422,8 +1450,8 @@ struct usb_sg_request {
1422 int status; 1450 int status;
1423 size_t bytes; 1451 size_t bytes;
1424 1452
1425 /* 1453 /* private:
1426 * members below are private: to usbcore, 1454 * members below are private to usbcore,
1427 * and are not provided for driver access! 1455 * and are not provided for driver access!
1428 */ 1456 */
1429 spinlock_t lock; 1457 spinlock_t lock;
@@ -1558,6 +1586,9 @@ extern void usb_unregister_notify(struct notifier_block *nb);
1558#define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \ 1586#define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \
1559 format "\n" , ## arg) 1587 format "\n" , ## arg)
1560 1588
1589/* debugfs stuff */
1590extern struct dentry *usb_debug_root;
1591
1561#endif /* __KERNEL__ */ 1592#endif /* __KERNEL__ */
1562 1593
1563#endif 1594#endif