diff options
author | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2007-08-01 03:34:06 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-12 21:55:07 (GMT) |
commit | 93993a0a3e528357ae4b9b0eb82fd4b428ebbf64 (patch) | |
tree | d97f96f9fc8f11431570a15d00731fc246c3724a /drivers/usb/core/generic.c | |
parent | d9d16e8a92e385c9f57d2081b7aa737770a0a829 (diff) | |
download | linux-93993a0a3e528357ae4b9b0eb82fd4b428ebbf64.tar.xz |
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/generic.c')
-rw-r--r-- | drivers/usb/core/generic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c index 20b0950..7b9e1ec 100644 --- a/drivers/usb/core/generic.c +++ b/drivers/usb/core/generic.c @@ -40,7 +40,7 @@ static int is_activesync(struct usb_interface_descriptor *desc) && desc->bInterfaceProtocol == 1; } -static int choose_configuration(struct usb_device *udev) +int choose_configuration(struct usb_device *udev) { int i; int num_configs; |