aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/usb.h
diff options
context:
space:
mode:
authorInaky Perez-Gonzalez <inaky@linux.intel.com>2007-07-31 23:34:06 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-12 17:55:07 -0400
commit93993a0a3e528357ae4b9b0eb82fd4b428ebbf64 (patch)
treed97f96f9fc8f11431570a15d00731fc246c3724a /drivers/usb/core/usb.h
parentd9d16e8a92e385c9f57d2081b7aa737770a0a829 (diff)
usb: introduce usb_authorize/deauthorize()
These USB API functions will do the full authorization/deauthorization to be used for a device. When authorized we effectively allow a configuration to be set. Reverse that when deauthorized. Effectively this means that we have to clean all the configuration descriptors on deauthorize and reload them when we authorized. We could do without throwing them out for wired devices, but for wireless, we can read them only after authenticating, and thus, when authorizing an authenticated device we would need to read them. So to simplify, always release them on deauthorize(), re-read them on authorize(). Also fix leak reported by Ragner Magalhaes; in usb_deauthorize_device(), bNumConfigurations was being set to zero before the for loop, and thus the different raw descriptors where never being freed. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/usb.h')
-rw-r--r--drivers/usb/core/usb.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
index cde6e52b84f..e22ec7f8eb1 100644
--- a/drivers/usb/core/usb.h
+++ b/drivers/usb/core/usb.h
@@ -15,12 +15,15 @@ extern void usb_disable_interface (struct usb_device *dev,
15 struct usb_interface *intf); 15 struct usb_interface *intf);
16extern void usb_release_interface_cache(struct kref *ref); 16extern void usb_release_interface_cache(struct kref *ref);
17extern void usb_disable_device (struct usb_device *dev, int skip_ep0); 17extern void usb_disable_device (struct usb_device *dev, int skip_ep0);
18extern int usb_deauthorize_device (struct usb_device *);
19extern int usb_authorize_device (struct usb_device *);
18extern void usb_detect_quirks(struct usb_device *udev); 20extern void usb_detect_quirks(struct usb_device *udev);
19 21
20extern int usb_get_device_descriptor(struct usb_device *dev, 22extern int usb_get_device_descriptor(struct usb_device *dev,
21 unsigned int size); 23 unsigned int size);
22extern char *usb_cache_string(struct usb_device *udev, int index); 24extern char *usb_cache_string(struct usb_device *udev, int index);
23extern int usb_set_configuration(struct usb_device *dev, int configuration); 25extern int usb_set_configuration(struct usb_device *dev, int configuration);
26extern int choose_configuration(struct usb_device *udev);
24 27
25extern void usb_kick_khubd(struct usb_device *dev); 28extern void usb_kick_khubd(struct usb_device *dev);
26extern int usb_match_device(struct usb_device *dev, 29extern int usb_match_device(struct usb_device *dev,