On Mon, Dec 31, 2007 at 02:20:42AM +0100, Marcel Holtmann wrote:
> Hi Chris,
> 
> > In its infinite wisdom, Belkin has released two products with identical 
> > VID:PID numbers; namely
> > 0x050d:0x0121. The first devices is a network adapter that uses the pegasus 
> > driver, and the second
> > is a Bluetooth adapter that uses the "Wireless" class to load the hci_usb 
> > module. Here is the
> > Bluetooth adapter's device descriptor:
> > 
> > T:  Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
> > D:  Ver= 2.00 Cls=e0(unk. ) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
> > P:  Vendor=050d ProdID=0121 Rev= 4.13
> > S:  Manufacturer=Broadcom Corp
> > S:  Product=BELKIN BLUETOOTH USB ADAPTER CL. 1
> > S:  SerialNumber=000A3A7DFF80
> > C:* #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=100mA
> > I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(unk. ) Sub=01 Prot=01 Driver=hci_usb
> > E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
> > E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
> > E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
> > I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=hci_usb
> > E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
> > E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
> > I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=hci_usb
> > E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
> > E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
> > I:* If#= 1 Alt= 2 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=hci_usb
> > E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
> > E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
> > I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=hci_usb
> > E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
> > E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
> > I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=hci_usb
> > E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
> > E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
> > I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(unk. ) Sub=01 Prot=01 Driver=hci_usb
> > E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
> > E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
> > I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
> > E:  Ad=84(I) Atr=02(Bulk) MxPS=  32 Ivl=0ms
> > E:  Ad=04(O) Atr=02(Bulk) MxPS=  32 Ivl=0ms
> > I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=00 Driver=(none)
> > 
> > Unfortunately, I need to be able to use both these drivers simultaneously 
> > (I have a 3com adapter
> > that needs the pegasus driver) and so I cannot just put "blacklist pegasus" 
> > in my modprobe.conf
> > file. I have therefore tried patching the pegasus module instead so that it 
> > requires a device
> > class of 0xFF just for the Belkin adapter.
> 
> I heard of this clash, but I never got on of the Belkin network dongles
> to actually proof it. You seem to be the first one that have both of
> these dongles.
> 
> > --- linux-2.6.23/drivers/net/usb/pegasus.h.orig     2007-07-09 
> > 23:59:53.000000000 +0100
> > +++ linux-2.6.23/drivers/net/usb/pegasus.h  2007-12-29 22:29:36.000000000 
> > +0000
> > @@ -202,8 +202,8 @@
> >             DEFAULT_GPIO_RESET | PEGASUS_II )
> >  PEGASUS_DEV( "Allied Telesyn Int. AT-USB100", VENDOR_ALLIEDTEL, 0xb100,
> >             DEFAULT_GPIO_RESET | PEGASUS_II )
> > -PEGASUS_DEV( "Belkin F5D5050 USB Ethernet", VENDOR_BELKIN, 0x0121,
> > -           DEFAULT_GPIO_RESET | PEGASUS_II )
> > +PEGASUS_DEV_CLASS( "Belkin F5D5050 USB Ethernet", VENDOR_BELKIN, 0x0121, 
> > 0xFF,
> > +              DEFAULT_GPIO_RESET | PEGASUS_II )
> >  PEGASUS_DEV( "Billionton USB-100", VENDOR_BILLIONTON, 0x0986,
> >             DEFAULT_GPIO_RESET )
> >  PEGASUS_DEV( "Billionton USBLP-100", VENDOR_BILLIONTON, 0x0987,
> > --- linux-2.6.23/drivers/net/usb/pegasus.c.orig     2007-10-16 
> > 18:44:30.000000000 +0100
> > +++ linux-2.6.23/drivers/net/usb/pegasus.c  2007-12-29 22:33:07.000000000 
> > +0000
> > @@ -62,8 +62,11 @@
> >  static struct usb_eth_dev usb_dev_id[] = {
> >  #define    PEGASUS_DEV(pn, vid, pid, flags)        \
> >     {.name = pn, .vendor = vid, .device = pid, .private = flags},
> > +#define PEGASUS_DEV_CLASS(pn, vid, pid, dclass, flags) \
> > +   PEGASUS_DEV(pn, vid, pid, flags)
> >  #include "pegasus.h"
> >  #undef     PEGASUS_DEV
> > +#undef  PEGASUS_DEV_CLASS
> >     {NULL, 0, 0, 0},
> >     {NULL, 0, 0, 0}
> >  };
> > @@ -71,8 +74,12 @@
> >  static struct usb_device_id pegasus_ids[] = {
> >  #define    PEGASUS_DEV(pn, vid, pid, flags) \
> >     {.match_flags = USB_DEVICE_ID_MATCH_DEVICE, .idVendor = vid, .idProduct 
> > = pid},
> > +#define PEGASUS_DEV_CLASS(pn, vid, pid, dclass, flags) \
> > +   {.match_flags = (USB_DEVICE_ID_MATCH_DEVICE | 
> > USB_DEVICE_ID_MATCH_DEV_CLASS), \
> > +    .idVendor = vid, .idProduct = pid, .bDeviceClass = dclass},
> >  #include "pegasus.
> >  #undef     PEGASUS_DEV
> > +#undef  PEGASUS_DEV_CLASS
> >     {},
> >     {}
> >  };
> 
> If you can add an extra comment for the matching table I would be okay
> with this patch. So people remember why this has been done and they
> don't remove it in the future. It is easy to think that it is
> superfluous.
> 
> It is not the cleanest thing to do, but it seems to be the only one. The
> hci_usb driver for example doesn't use any direct VID:PID matching (not
> fully true, but as few as possible). So adding the Belkin ID to it won't
> do it any good, because then it comes done to an alphabetical order when
> the drivers are loaded. That is bad.
> 
> Greg, patch is acked by me. Feel free to apply it.

Ok, Chris, care to redo this and then send it to the netdev mailing
list, which handles all network driver patches?

thanks,

greg k-h
-
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