Matthew Dharm wrote:
I think that is a better approach than your patch.  Perhaps the zd1211rw
driver could know the VID/PID of the fake CD-ROM to attach to it and send
the fake eject command.  The usb-storage (and probably ub) would just have
to ignore the device.

Ok, I've handled the zd1211rw side. Unless I'm mistaken, usb-storage doesn't currently have a way of blacklisting a device.

How does this patch look?


diff --git a/drivers/usb/storage/unusual_devs.h 
b/drivers/usb/storage/unusual_devs.h
index 543244d..f01a3f8 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1074,7 +1074,15 @@ UNUSUAL_DEV( 0x0a17, 0x006, 0x0000, 0xff
                 "Optio S/S4",
                 US_SC_DEVICE, US_PR_DEVICE, NULL,
                 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
 UNUSUAL_DEV(  0x0bf6, 0xa001, 0x0100, 0x0110,
                "ATI",
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index e232c7c..d5774bd 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -963,6 +963,12 @@ static int storage_probe(struct usb_inte
         */
        get_device_info(us, id);
 
+       if (us->flags & US_FL_IGNORE_DEVICE) {
+               printk(KERN_INFO USB_STORAGE "device ignored\n");
+               release_everything(us);
+               return -ENODEV;
+       }
+
        /* Get the transport, protocol, and pipe settings */
        result = get_transport(us);
        if (result)
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index 608487a..4cf3bf1 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -43,6 +43,8 @@ #define US_DO_ALL_FLAGS                                       
        \
                /* Need delay after Command phase */            \
        US_FLAG(NO_WP_DETECT,   0x00000200)                     \
                /* Don't check for write-protect */             \
+       US_FLAG(IGNORE_DEVICE,  0x00000400)                     \
+               /* Don't claim device */
 
 #define US_FLAG(name, value)   US_FL_##name = value ,
 enum { US_DO_ALL_FLAGS };
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to