On Sun, Jan 27, 2008 at 12:32:18PM -0800, Greg KH wrote:
> On Sun, Jan 27, 2008 at 02:06:29PM -0600, Felipe Balbi wrote:
> > 
> > 
> > On Sun, 27 Jan 2008 11:58:03 -0800, Greg KH <[EMAIL PROTECTED]> wrote:
> > > On Sun, Jan 27, 2008 at 07:07:48AM -0600, Felipe Balbi wrote:
> > >>
> > >>
> > >> On Sat, 26 Jan 2008 20:59:44 -0800, Greg KH <[EMAIL PROTECTED]> wrote:
> > >> > On Sat, Jan 26, 2008 at 08:40:48PM -0600, Felipe Balbi wrote:
> > >> >>
> > >> >>
> > >> >> On Fri, 25 Jan 2008 08:56:35 -0800, Greg KH <[EMAIL PROTECTED]> wrote:
> > >> >> > Hi all,
> > >> >> >
> > >> >> > I have a report here of a device in the wild that is using a USB
> > >> > vendor
> > >> >> > id of 0x0000.  From everything I can tell, this _could_ be a valid
> > >> >> > vendor id, but I'm pretty sure that it isn't :)
> > >> >>
> > >> >> Why would usb-if give someone the Vendor ID of 0 ?
> > >> >> This can't be valid.
> > >> >
> > >> > I know, it looks like it would be invalid, but you have a shipping
> > >> > device with it, and I can't see anything in the USB documentation that
> > >> > forbids it :(
> > >>
> > >> FYI, If you know the company name, you can at least search for it in
> > >> usb.org.
> > >>
> > >> Log in to members area and go to Member search.
> > > 
> > > Yes, but it does not show the vendor id for the company.  Or am I
> > > missing something on that page somewhere?
> > 
> > Well, it doesn't but if the company is not listed there, it doesn't really
> > has a vendor id. ;-)
> 
> I agree, they could be lying, but as this is a device seen "in the
> wild", and one that Windows has no problems with, we need to fix our
> code to support it :(

And here's the patch that I added to the tree to hopefully fix this
issue.  Note, depmod also needs a patch to ensure it all works
properly...

thanks,

greg k-h

--------------

From: Greg Kroah-Hartman <[EMAIL PROTECTED]>
Subject: USB: handle idVendor of 0x0000

Some crazy devices in the wild have a vendor id of 0x0000.  If we try to
add a module alias with this id, we just can't do it due to a check in
the file2alias.c file.  Change the test to verify that both the vendor
and product ids are 0x0000 to show a real "blank" module alias.

Note, the module-init-tools package also needs to be changed to properly
generate the depmod tables.

Cc: Janusz <[EMAIL PROTECTED]>
Cc: stable <[EMAIL PROTECTED]>
Cc: Jon Masters <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>

---
 drivers/usb/core/driver.c |    4 ++--
 scripts/mod/file2alias.c  |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -534,8 +534,8 @@ const struct usb_device_id *usb_match_id
           id->driver_info is the way to create an entry that
           indicates that the driver want to examine every
           device and interface. */
-       for (; id->idVendor || id->bDeviceClass || id->bInterfaceClass ||
-              id->driver_info; id++) {
+       for (; id->idVendor || id->idProduct || id->bDeviceClass ||
+              id->bInterfaceClass || id->driver_info; id++) {
                if (usb_match_one_id(interface, id))
                        return id;
        }
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -155,7 +155,7 @@ static void do_usb_entry_multi(struct us
         * Some modules (visor) have empty slots as placeholder for
         * run-time specification that results in catch-all alias
         */
-       if (!(id->idVendor | id->bDeviceClass | id->bInterfaceClass))
+       if (!(id->idVendor | id->idProduct | id->bDeviceClass | 
id->bInterfaceClass))
                return;
 
        /* Convert numeric bcdDevice range into fnmatch-able pattern(s) */
-
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to