From 7bc3d635628db100c024aca7f836a18188e9bb62 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 19 Jun 2006 23:59:31 -0700 Subject: USB: move usb_device_class class devices to be real devices This moves the usb class devices that control the usbfs nodes to show up in the proper place in the larger device tree. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman --- include/linux/usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux/usb.h') diff --git a/include/linux/usb.h b/include/linux/usb.h index aab5b1b7202..f18ced00192 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -372,7 +372,7 @@ struct usb_device { char *serial; /* iSerialNumber string, if present */ struct list_head filelist; - struct class_device *class_dev; + struct device *usbfs_dev; struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ /* -- cgit v1.2.3 From 0873c76485c126a4df70a6961fd354b21b7987f7 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 20 Jun 2006 13:09:50 -0700 Subject: USB: convert usb class devices to real devices Signed-off-by: Greg Kroah-Hartman --- include/linux/usb.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/linux/usb.h') diff --git a/include/linux/usb.h b/include/linux/usb.h index f18ced00192..d6bf1297d88 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -107,7 +107,8 @@ enum usb_interface_condition { * @needs_remote_wakeup: flag set when the driver requires remote-wakeup * capability during autosuspend. * @dev: driver model's view of this device - * @class_dev: driver model's class view of this device. + * @usb_dev: if an interface is bound to the USB major, this will point + * to the sysfs representation for that device. * @pm_usage_cnt: PM usage counter for this interface; autosuspend is not * allowed unless the counter is 0. * @@ -152,7 +153,7 @@ struct usb_interface { unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ struct device dev; /* interface specific device info */ - struct class_device *class_dev; + struct device *usb_dev; /* pointer to the usb class's device, if any */ int pm_usage_cnt; /* usage counter for autosuspend */ }; #define to_usb_interface(d) container_of(d, struct usb_interface, dev) -- cgit v1.2.3 From 5f848137744106ee737f559454ce5adfceb38347 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Sat, 16 Dec 2006 15:34:53 -0800 Subject: USB: becomes This moves to to reduce some of the clutter of usb header files. Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- include/linux/usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux/usb.h') diff --git a/include/linux/usb.h b/include/linux/usb.h index d6bf1297d88..f3b21636c9d 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -2,7 +2,7 @@ #define __LINUX_USB_H #include -#include +#include #define USB_MAJOR 180 #define USB_DEVICE_MAJOR 189 -- cgit v1.2.3 From 93bacefc4cc0b53e1cb6a336d43847154fdf6886 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 17 Dec 2006 21:50:23 +0100 Subject: USB serial: add dynamic id support to usb-serial core MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to Johannes Hölzl for fixing a few things and getting it all working properly. This adds support for dynamic usb ids to the usb serial core. The file "new_id" will show up under the usb serial driver, not the usb driver associated with the usb-serial driver (yeah, it can be a bit confusing at first glance...) This patch also modifies the USB core to allow the usb-serial core to reuse much of the dynamic id logic. Signed-off-by: Greg Kroah-Hartman Signed-off-by: Johannes Hölzl --- include/linux/usb.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/linux/usb.h') diff --git a/include/linux/usb.h b/include/linux/usb.h index f3b21636c9d..3cb9285df2d 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -476,6 +476,8 @@ extern void usb_driver_release_interface(struct usb_driver *driver, struct usb_interface *iface); const struct usb_device_id *usb_match_id(struct usb_interface *interface, const struct usb_device_id *id); +extern int usb_match_one_id(struct usb_interface *interface, + const struct usb_device_id *id); extern struct usb_interface *usb_find_interface(struct usb_driver *drv, int minor); @@ -724,11 +726,21 @@ static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor /* ----------------------------------------------------------------------- */ +/* Stuff for dynamic usb ids */ struct usb_dynids { spinlock_t lock; struct list_head list; }; +struct usb_dynid { + struct list_head node; + struct usb_device_id id; +}; + +extern ssize_t usb_store_new_id(struct usb_dynids *dynids, + struct device_driver *driver, + const char *buf, size_t count); + /** * struct usbdrv_wrap - wrapper for driver-model structure * @driver: The driver-model core driver structure. -- cgit v1.2.3 From a8ef36bc0a5fe973bddaa54a5a07cda29e04a602 Mon Sep 17 00:00:00 2001 From: Sarah Bailey Date: Sat, 23 Dec 2006 23:14:58 -0800 Subject: USB: Add usb_endpoint_xfer_control to usb.h Added a function to check if an endpoint is a control endpoint. There were similar functions for bulk, interrupt, and isoc, but not for control endpoints. Signed-off-by: Sarah Bailey Signed-off-by: Greg Kroah-Hartman --- include/linux/usb.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/linux/usb.h') diff --git a/include/linux/usb.h b/include/linux/usb.h index 3cb9285df2d..1c56386de70 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -556,6 +556,18 @@ static inline int usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *e USB_ENDPOINT_XFER_BULK); } +/** + * usb_endpoint_xfer_control - check if the endpoint has control transfer type + * @epd: endpoint to be checked + * + * Returns true if the endpoint is of type control, otherwise it returns false. + */ +static inline int usb_endpoint_xfer_control(const struct usb_endpoint_descriptor *epd) +{ + return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == + USB_ENDPOINT_XFER_CONTROL); +} + /** * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type * @epd: endpoint to be checked -- cgit v1.2.3 From 896fbd7199035958013d106329843d8ae9618753 Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Tue, 16 Jan 2007 11:57:13 -0500 Subject: usbcore: remove unused bandwith-related code This patch (as841) removes from usbcore a couple of support routines meant to help with bandwidth allocation. With the changes to uhci-hcd in the previous patch, these routines are no longer used anywhere. Also removed is the CONFIG_USB_BANDWIDTH option; it no longer does anything and is no longer needed since the HCDs now handle bandwidth issues correctly. Signed-off-by: Alan Stern Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- include/linux/usb.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/linux/usb.h') diff --git a/include/linux/usb.h b/include/linux/usb.h index 1c56386de70..3b08ab39550 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -1110,7 +1110,6 @@ struct urb struct kref kref; /* reference count of the URB */ spinlock_t lock; /* lock for the URB */ void *hcpriv; /* private data for host controller */ - int bandwidth; /* bandwidth for INT/ISO request */ atomic_t use_count; /* concurrent submissions counter */ u8 reject; /* submissions will fail */ -- cgit v1.2.3