Daniel Drake wrote:
> 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.

Not that my sign-off is needed with Matt's there, but just for good measure,
since it's playing around with unusual_dev flags..

> Signed-off-by: Daniel Drake <[EMAIL PROTECTED]>
> Signed-off-by: Matthew Dharm <[EMAIL PROTECTED]>
Signed-off-by: Phil Dibowitz <[EMAIL PROTECTED]>

> 
> 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..04cd0e6 100644
> --- a/drivers/usb/storage/usb.c
> +++ b/drivers/usb/storage/usb.c
> @@ -479,7 +479,7 @@ static struct us_unusual_dev *find_unusu
>  }
>  
>  /* 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_interface_descriptor *idesc =
> @@ -496,6 +496,11 @@ static void get_device_info(struct us_da
>                       unusual_dev->useTransport;
>       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
>        * disable it if we're in full-speed
> @@ -535,6 +540,8 @@ static void get_device_info(struct us_da
>                               idesc->bInterfaceProtocol,
>                               msgs[msg]);
>       }
> +
> +     return 0;
>  }
>  
>  /* Get the transport settings */
> @@ -961,7 +968,9 @@ static int storage_probe(struct usb_inte
>        * of the match from the usb_device_id table, so we can find the
>        * 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 */
>       result = get_transport(us);
> 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 };
> _______________________________________________
> Usb-storage mailing list
> [EMAIL PROTECTED]
> https://lists.one-eyed-alien.net/mailman/listinfo/usb-storage
> 


-- 
Phil Dibowitz                             [EMAIL PROTECTED]
Freeware and Technical Pages              Insanity Palace of Metallica
http://www.phildev.net/                   http://www.ipom.com/

"Be who you are and say what you feel, because those who mind don't matter
and those who matter don't mind."
 - Dr. Seuss


Attachment: signature.asc
Description: OpenPGP digital signature

-------------------------------------------------------------------------
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
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to