aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-16 16:06:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-16 16:06:10 -0400
commite1f5b94fd0c93c3e27ede88b7ab652d086dc960f (patch)
treee8de7a132eb88521dd1c19e128eba2d5349bdf4f /include/linux/usb.h
parent6fd03301d76bc439382710e449f58efbb233df1b (diff)
parent1b6ed69f974f6f32c8be0d9a7fc952822eb83b6f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (143 commits) USB: xhci depends on PCI. USB: xhci: Add Makefile, MAINTAINERS, and Kconfig entries. USB: xhci: Respect critical sections. USB: xHCI: Fix interrupt moderation. USB: xhci: Remove packed attribute from structures. usb; xhci: Fix TRB offset calculations. USB: xhci: replace if-elseif-else with switch-case USB: xhci: Make xhci-mem.c include linux/dmapool.h USB: xhci: drop spinlock in xhci_urb_enqueue() error path. USB: Change names of SuperSpeed ep companion descriptor structs. USB: xhci: Avoid compiler reordering in Link TRB giveback. USB: xhci: Clean up xhci_irq() function. USB: xhci: Avoid global namespace pollution. USB: xhci: Fix Link TRB handoff bit twiddling. USB: xhci: Fix register write order. USB: xhci: fix some compiler warnings in xhci.h USB: xhci: fix lots of compiler warnings. USB: xhci: use xhci_handle_event instead of handle_event USB: xhci: URB cancellation support. USB: xhci: Scatter gather list support for bulk transfers. ...
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r--include/linux/usb.h34
1 files changed, 30 insertions, 4 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 34cdfcac455..84929e91403 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
@@ -1044,7 +1063,9 @@ typedef void (*usb_complete_t)(struct urb *);
1044 * @setup_dma: For control transfers with URB_NO_SETUP_DMA_MAP set, the 1063 * @setup_dma: For control transfers with URB_NO_SETUP_DMA_MAP set, the
1045 * device driver has provided this DMA address for the setup packet. 1064 * device driver has provided this DMA address for the setup packet.
1046 * The host controller driver should use this in preference to 1065 * The host controller driver should use this in preference to
1047 * setup_packet. 1066 * setup_packet, but the HCD may chose to ignore the address if it must
1067 * copy the setup packet into internal structures. Therefore, setup_packet
1068 * must always point to a valid buffer.
1048 * @start_frame: Returns the initial frame for isochronous transfers. 1069 * @start_frame: Returns the initial frame for isochronous transfers.
1049 * @number_of_packets: Lists the number of ISO transfer buffers. 1070 * @number_of_packets: Lists the number of ISO transfer buffers.
1050 * @interval: Specifies the polling interval for interrupt or isochronous 1071 * @interval: Specifies the polling interval for interrupt or isochronous
@@ -1180,6 +1201,8 @@ struct urb {
1180 unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/ 1201 unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/
1181 void *transfer_buffer; /* (in) associated data buffer */ 1202 void *transfer_buffer; /* (in) associated data buffer */
1182 dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */ 1203 dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */
1204 struct usb_sg_request *sg; /* (in) scatter gather buffer list */
1205 int num_sgs; /* (in) number of entries in the sg list */
1183 u32 transfer_buffer_length; /* (in) data buffer length */ 1206 u32 transfer_buffer_length; /* (in) data buffer length */
1184 u32 actual_length; /* (return) actual transfer length */ 1207 u32 actual_length; /* (return) actual transfer length */
1185 unsigned char *setup_packet; /* (in) setup packet (control only) */ 1208 unsigned char *setup_packet; /* (in) setup packet (control only) */
@@ -1425,8 +1448,8 @@ struct usb_sg_request {
1425 int status; 1448 int status;
1426 size_t bytes; 1449 size_t bytes;
1427 1450
1428 /* 1451 /* private:
1429 * members below are private: to usbcore, 1452 * members below are private to usbcore,
1430 * and are not provided for driver access! 1453 * and are not provided for driver access!
1431 */ 1454 */
1432 spinlock_t lock; 1455 spinlock_t lock;
@@ -1561,6 +1584,9 @@ extern void usb_unregister_notify(struct notifier_block *nb);
1561#define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \ 1584#define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \
1562 format "\n" , ## arg) 1585 format "\n" , ## arg)
1563 1586
1587/* debugfs stuff */
1588extern struct dentry *usb_debug_root;
1589
1564#endif /* __KERNEL__ */ 1590#endif /* __KERNEL__ */
1565 1591
1566#endif 1592#endif