aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/usb.h
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2009-06-29 10:56:54 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-23 09:46:22 -0400
commit7cbe5dca399a50ce8aa74314b1d276e2fb904e1b (patch)
treef7a565f3d2f5e9584faffa69d8e8545d4e0c4cdb /drivers/usb/core/usb.h
parent831baa4915de465357b25c471bbb9b36472024df (diff)
USB: add API for userspace drivers to "claim" ports
This patch (as1258) implements a feature that users have been asking for: It gives programs the ability to "claim" a port on a hub, via a new usbfs ioctl. A device plugged into a "claimed" port will not be touched by the kernel beyond the immediate necessities of initialization and enumeration. In particular, when a device is plugged into a "claimed" port, the kernel will not select and install a configuration. And when a config is installed by usbfs or sysfs, the kernel will not probe any drivers for any of the interfaces. (However the kernel will fetch various string descriptors during enumeration. One could argue that this isn't really necessary, but the strings are exported in sysfs.) The patch does not guarantee exclusive access to these devices; it is still possible for more than one program to open the device file concurrently. Programs are responsible for coordinating access among themselves. A demonstration program showing how to use the new interface can be found in an attachment to http://marc.info/?l=linux-usb&m=124345857431452&w=2 The patch also makes a small simplification to the hub driver, replacing a bunch of more-or-less useless variants of "out of memory" with a single message. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/usb.h')
-rw-r--r--drivers/usb/core/usb.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
index c0e0ae2bb8e7..9a8b15e6377a 100644
--- a/drivers/usb/core/usb.h
+++ b/drivers/usb/core/usb.h
@@ -37,6 +37,13 @@ extern int usb_match_device(struct usb_device *dev,
37extern void usb_forced_unbind_intf(struct usb_interface *intf); 37extern void usb_forced_unbind_intf(struct usb_interface *intf);
38extern void usb_rebind_intf(struct usb_interface *intf); 38extern void usb_rebind_intf(struct usb_interface *intf);
39 39
40extern int usb_hub_claim_port(struct usb_device *hdev, unsigned port,
41 void *owner);
42extern int usb_hub_release_port(struct usb_device *hdev, unsigned port,
43 void *owner);
44extern void usb_hub_release_all_ports(struct usb_device *hdev, void *owner);
45extern bool usb_device_is_owned(struct usb_device *udev);
46
40extern int usb_hub_init(void); 47extern int usb_hub_init(void);
41extern void usb_hub_cleanup(void); 48extern void usb_hub_cleanup(void);
42extern int usb_major_init(void); 49extern int usb_major_init(void);