aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage/usb.c
diff options
context:
space:
mode:
authorDaniel Drake <dsd@gentoo.org>2006-07-26 08:59:23 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-08-02 19:41:42 -0400
commit3c332422f78159a0f5e4bc5f0ed8bbcbf51d9462 (patch)
tree3fdb307aac396d9ae022d78b547cda48fb7d1aa2 /drivers/usb/storage/usb.c
parentb7aa94b682dc6b6dcdc01d36f8e65cef5aae81e2 (diff)
usb-storage: Add US_FL_IGNORE_DEVICE flag; ignore ZyXEL G220F
This patch adds a new unusual_devs flag for when usb-storage needs to ignore a device that it would otherwise claim. We need to ignore the ZyXEL G220F as it is a virtual CDROM drive which includes the windows driver for this USB-WLAN adapter. After the windows driver is installed on a windows system, it converts it into a WLAN adapter (by ejecting the virtual disc). The virtual CDROM is of no interest to Linux users. The zd1211rw driver will automatically perform the eject operation, we just need to ensure that usb-storage does not claim the device. Signed-off-by: Daniel Drake <dsd@gentoo.org> Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Signed-off-by: Phil Dibowitz <phil@ipom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/storage/usb.c')
-rw-r--r--drivers/usb/storage/usb.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 5ee19be52f65..8d7bdcb5924d 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -483,7 +483,7 @@ static struct us_unusual_dev *find_unusual(const struct usb_device_id *id)
483} 483}
484 484
485/* Get the unusual_devs entries and the string descriptors */ 485/* Get the unusual_devs entries and the string descriptors */
486static void get_device_info(struct us_data *us, const struct usb_device_id *id) 486static int get_device_info(struct us_data *us, const struct usb_device_id *id)
487{ 487{
488 struct usb_device *dev = us->pusb_dev; 488 struct usb_device *dev = us->pusb_dev;
489 struct usb_interface_descriptor *idesc = 489 struct usb_interface_descriptor *idesc =
@@ -500,6 +500,11 @@ static void get_device_info(struct us_data *us, const struct usb_device_id *id)
500 unusual_dev->useTransport; 500 unusual_dev->useTransport;
501 us->flags = USB_US_ORIG_FLAGS(id->driver_info); 501 us->flags = USB_US_ORIG_FLAGS(id->driver_info);
502 502
503 if (us->flags & US_FL_IGNORE_DEVICE) {
504 printk(KERN_INFO USB_STORAGE "device ignored\n");
505 return -ENODEV;
506 }
507
503 /* 508 /*
504 * This flag is only needed when we're in high-speed, so let's 509 * This flag is only needed when we're in high-speed, so let's
505 * disable it if we're in full-speed 510 * disable it if we're in full-speed
@@ -541,6 +546,8 @@ static void get_device_info(struct us_data *us, const struct usb_device_id *id)
541 msgs[msg], 546 msgs[msg],
542 UTS_RELEASE); 547 UTS_RELEASE);
543 } 548 }
549
550 return 0;
544} 551}
545 552
546/* Get the transport settings */ 553/* Get the transport settings */
@@ -969,7 +976,9 @@ static int storage_probe(struct usb_interface *intf,
969 * of the match from the usb_device_id table, so we can find the 976 * of the match from the usb_device_id table, so we can find the
970 * corresponding entry in the private table. 977 * corresponding entry in the private table.
971 */ 978 */
972 get_device_info(us, id); 979 result = get_device_info(us, id);
980 if (result)
981 goto BadDevice;
973 982
974 /* Get the transport, protocol, and pipe settings */ 983 /* Get the transport, protocol, and pipe settings */
975 result = get_transport(us); 984 result = get_transport(us);