diff options
author | Oliver Neukum <oneukum@suse.de> | 2007-01-26 14:26:21 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-02-23 15:03:46 -0800 |
commit | 7ceec1f1d26f966c0816b86a1aab1e0b3b208757 (patch) | |
tree | 3b444fb3eedff17366a7aa01106ee7eed50e051a /drivers/usb/core/message.c | |
parent | bb417020ba8c559eb52f57379ba17f669f8f72cd (diff) | |
download | lwn-7ceec1f1d26f966c0816b86a1aab1e0b3b208757.tar.gz lwn-7ceec1f1d26f966c0816b86a1aab1e0b3b208757.zip |
USB: add a blacklist for devices that can't handle some things we throw at them.
This adds a blacklist to the USB core to handle some autosuspend and
string issues that devices have.
Originally written by Oliver, but hacked up a lot by Greg.
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/message.c')
-rw-r--r-- | drivers/usb/core/message.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 74edaea5665d..2f17468b5c1e 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -11,6 +11,7 @@ #include <linux/timer.h> #include <linux/ctype.h> #include <linux/device.h> +#include <linux/usb/quirks.h> #include <asm/byteorder.h> #include <asm/scatterlist.h> @@ -685,7 +686,10 @@ static int usb_string_sub(struct usb_device *dev, unsigned int langid, /* Try to read the string descriptor by asking for the maximum * possible number of bytes */ - rc = usb_get_string(dev, langid, index, buf, 255); + if (dev->quirks & USB_QUIRK_STRING_FETCH_255) + rc = -EIO; + else + rc = usb_get_string(dev, langid, index, buf, 255); /* If that failed try to read the descriptor length, then * ask for just that many bytes */ |