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>
This commit is contained in:
Daniel Drake 2006-07-26 13:59:23 +01:00 committed by Greg Kroah-Hartman
parent b7aa94b682
commit 3c332422f7
3 changed files with 23 additions and 4 deletions

View File

@ -1107,6 +1107,14 @@ UNUSUAL_DEV( 0x0a17, 0x006, 0x0000, 0xffff,
US_SC_DEVICE, US_PR_DEVICE, NULL, US_SC_DEVICE, US_PR_DEVICE, NULL,
US_FL_FIX_INQUIRY ), US_FL_FIX_INQUIRY ),
/* This is a virtual windows driver CD, which the zd1211rw driver automatically
* converts into a WLAN device. */
UNUSUAL_DEV( 0x0ace, 0x2011, 0x0101, 0x0101,
"ZyXEL",
"G-220F USB-WLAN Install",
US_SC_DEVICE, US_PR_DEVICE, NULL,
US_FL_IGNORE_DEVICE ),
#ifdef CONFIG_USB_STORAGE_ISD200 #ifdef CONFIG_USB_STORAGE_ISD200
UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110, UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110,
"ATI", "ATI",

View File

@ -483,7 +483,7 @@ static struct us_unusual_dev *find_unusual(const struct usb_device_id *id)
} }
/* Get the unusual_devs entries and the string descriptors */ /* Get the unusual_devs entries and the string descriptors */
static void get_device_info(struct us_data *us, const struct usb_device_id *id) static int get_device_info(struct us_data *us, const struct usb_device_id *id)
{ {
struct usb_device *dev = us->pusb_dev; struct usb_device *dev = us->pusb_dev;
struct usb_interface_descriptor *idesc = struct usb_interface_descriptor *idesc =
@ -500,6 +500,11 @@ static void get_device_info(struct us_data *us, const struct usb_device_id *id)
unusual_dev->useTransport; unusual_dev->useTransport;
us->flags = USB_US_ORIG_FLAGS(id->driver_info); us->flags = USB_US_ORIG_FLAGS(id->driver_info);
if (us->flags & US_FL_IGNORE_DEVICE) {
printk(KERN_INFO USB_STORAGE "device ignored\n");
return -ENODEV;
}
/* /*
* This flag is only needed when we're in high-speed, so let's * This flag is only needed when we're in high-speed, so let's
* disable it if we're in full-speed * 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)
msgs[msg], msgs[msg],
UTS_RELEASE); UTS_RELEASE);
} }
return 0;
} }
/* Get the transport settings */ /* Get the transport settings */
@ -969,7 +976,9 @@ static int storage_probe(struct usb_interface *intf,
* of the match from the usb_device_id table, so we can find the * of the match from the usb_device_id table, so we can find the
* corresponding entry in the private table. * corresponding entry in the private table.
*/ */
get_device_info(us, id); result = get_device_info(us, id);
if (result)
goto BadDevice;
/* Get the transport, protocol, and pipe settings */ /* Get the transport, protocol, and pipe settings */
result = get_transport(us); result = get_transport(us);

View File

@ -44,7 +44,9 @@
US_FLAG(NO_WP_DETECT, 0x00000200) \ US_FLAG(NO_WP_DETECT, 0x00000200) \
/* Don't check for write-protect */ \ /* Don't check for write-protect */ \
US_FLAG(MAX_SECTORS_64, 0x00000400) \ US_FLAG(MAX_SECTORS_64, 0x00000400) \
/* Sets max_sectors to 64 */ /* Sets max_sectors to 64 */ \
US_FLAG(IGNORE_DEVICE, 0x00000800) \
/* Don't claim device */
#define US_FLAG(name, value) US_FL_##name = value , #define US_FLAG(name, value) US_FL_##name = value ,
enum { US_DO_ALL_FLAGS }; enum { US_DO_ALL_FLAGS };