aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-07 22:23:21 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-07 22:23:21 -0500
commitc96e2c92072d3e78954c961f53d8c7352f7abbd7 (patch)
treed844f26f926ff40e98e9eae0e11fd71acad81df4 /include/linux/usb.h
parentf2aca47dc3c2d0c2d5dbd972558557e74232bbce (diff)
parent64358164f5bfe5e11d4040c1eb674c29e1436ce5 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (70 commits) USB: remove duplicate device id from zc0301 USB: remove duplicate device id from usb_storage USB: remove duplicate device id from keyspan USB: remove duplicate device id from ftdi_sio USB: remove duplicate device id from visor USB: a bit more coding style cleanup usbcore: trivial whitespace fixes usb-storage: use first bulk endpoints, not last EHCI: fix interrupt-driven remote wakeup USB: switch ehci-hcd to new polling scheme USB: autosuspend for usb printer driver USB Input: Added kernel module to support all GTCO CalComp USB InterWrite School products USB: Sierra Wireless auto set D0 USB: usb ethernet gadget recognizes HUSB2DEV USB: list atmel husb2_udc gadget controller USB: gadgetfs AIO tweaks USB: gadgetfs behaves better on userspace init bug USB: gadgetfs race fix USB: gadgetfs simplifications USB: gadgetfs cleanups ...
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r--include/linux/usb.h34
1 files changed, 29 insertions, 5 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 733f38de4978..b5c226a87ed8 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -2,7 +2,7 @@
2#define __LINUX_USB_H 2#define __LINUX_USB_H
3 3
4#include <linux/mod_devicetable.h> 4#include <linux/mod_devicetable.h>
5#include <linux/usb_ch9.h> 5#include <linux/usb/ch9.h>
6 6
7#define USB_MAJOR 180 7#define USB_MAJOR 180
8#define USB_DEVICE_MAJOR 189 8#define USB_DEVICE_MAJOR 189
@@ -107,7 +107,8 @@ enum usb_interface_condition {
107 * @needs_remote_wakeup: flag set when the driver requires remote-wakeup 107 * @needs_remote_wakeup: flag set when the driver requires remote-wakeup
108 * capability during autosuspend. 108 * capability during autosuspend.
109 * @dev: driver model's view of this device 109 * @dev: driver model's view of this device
110 * @class_dev: driver model's class view of this device. 110 * @usb_dev: if an interface is bound to the USB major, this will point
111 * to the sysfs representation for that device.
111 * @pm_usage_cnt: PM usage counter for this interface; autosuspend is not 112 * @pm_usage_cnt: PM usage counter for this interface; autosuspend is not
112 * allowed unless the counter is 0. 113 * allowed unless the counter is 0.
113 * 114 *
@@ -152,7 +153,7 @@ struct usb_interface {
152 unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ 153 unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */
153 154
154 struct device dev; /* interface specific device info */ 155 struct device dev; /* interface specific device info */
155 struct class_device *class_dev; 156 struct device *usb_dev; /* pointer to the usb class's device, if any */
156 int pm_usage_cnt; /* usage counter for autosuspend */ 157 int pm_usage_cnt; /* usage counter for autosuspend */
157}; 158};
158#define to_usb_interface(d) container_of(d, struct usb_interface, dev) 159#define to_usb_interface(d) container_of(d, struct usb_interface, dev)
@@ -372,7 +373,7 @@ struct usb_device {
372 char *serial; /* iSerialNumber string, if present */ 373 char *serial; /* iSerialNumber string, if present */
373 374
374 struct list_head filelist; 375 struct list_head filelist;
375 struct class_device *class_dev; 376 struct device *usbfs_dev;
376 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ 377 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */
377 378
378 /* 379 /*
@@ -475,6 +476,8 @@ extern void usb_driver_release_interface(struct usb_driver *driver,
475 struct usb_interface *iface); 476 struct usb_interface *iface);
476const struct usb_device_id *usb_match_id(struct usb_interface *interface, 477const struct usb_device_id *usb_match_id(struct usb_interface *interface,
477 const struct usb_device_id *id); 478 const struct usb_device_id *id);
479extern int usb_match_one_id(struct usb_interface *interface,
480 const struct usb_device_id *id);
478 481
479extern struct usb_interface *usb_find_interface(struct usb_driver *drv, 482extern struct usb_interface *usb_find_interface(struct usb_driver *drv,
480 int minor); 483 int minor);
@@ -554,6 +557,18 @@ static inline int usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *e
554} 557}
555 558
556/** 559/**
560 * usb_endpoint_xfer_control - check if the endpoint has control transfer type
561 * @epd: endpoint to be checked
562 *
563 * Returns true if the endpoint is of type control, otherwise it returns false.
564 */
565static inline int usb_endpoint_xfer_control(const struct usb_endpoint_descriptor *epd)
566{
567 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
568 USB_ENDPOINT_XFER_CONTROL);
569}
570
571/**
557 * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type 572 * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type
558 * @epd: endpoint to be checked 573 * @epd: endpoint to be checked
559 * 574 *
@@ -723,11 +738,21 @@ static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor
723 738
724/* ----------------------------------------------------------------------- */ 739/* ----------------------------------------------------------------------- */
725 740
741/* Stuff for dynamic usb ids */
726struct usb_dynids { 742struct usb_dynids {
727 spinlock_t lock; 743 spinlock_t lock;
728 struct list_head list; 744 struct list_head list;
729}; 745};
730 746
747struct usb_dynid {
748 struct list_head node;
749 struct usb_device_id id;
750};
751
752extern ssize_t usb_store_new_id(struct usb_dynids *dynids,
753 struct device_driver *driver,
754 const char *buf, size_t count);
755
731/** 756/**
732 * struct usbdrv_wrap - wrapper for driver-model structure 757 * struct usbdrv_wrap - wrapper for driver-model structure
733 * @driver: The driver-model core driver structure. 758 * @driver: The driver-model core driver structure.
@@ -1086,7 +1111,6 @@ struct urb
1086 struct kref kref; /* reference count of the URB */ 1111 struct kref kref; /* reference count of the URB */
1087 spinlock_t lock; /* lock for the URB */ 1112 spinlock_t lock; /* lock for the URB */
1088 void *hcpriv; /* private data for host controller */ 1113 void *hcpriv; /* private data for host controller */
1089 int bandwidth; /* bandwidth for INT/ISO request */
1090 atomic_t use_count; /* concurrent submissions counter */ 1114 atomic_t use_count; /* concurrent submissions counter */
1091 u8 reject; /* submissions will fail */ 1115 u8 reject; /* submissions will fail */
1092 1116