All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Bader <stefan.bader@canonical.com>
To: linux-usb@vger.kernel.org, netdev@vger.kernel.org
Cc: Petko Manolov <petkan@nucleusys.com>
Subject: [PATCH] Enhanced matching code for pegasus driver (was blacklist support)
Date: Thu, 10 Apr 2008 18:27:18 -0400	[thread overview]
Message-ID: <47FE9446.7010404@canonical.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1199 bytes --]

I have reworked the patch from using a blacklist to using the enhanced
matching macros. While certainly going into the right direction I got
one problem: although this certainly will prevent the bluetooth adapter
from loading I cannot tell (due to missing hardware) whether this will
not prevent the ethernet dongle from working.
So question is a) does the approach look good and b) has somebode a
Belkin usb ethernet adapter to verify the class, subclass and protocol?

Regards,
Stefan

> I have been working on a problem which arose from the fact that (at
> least one vendor) some vendors use the same vendor and model number for
> different pieces of hardware.
> In this case the Belkin bluetooth dongle uses the same numbers as the
> network adapter which causes machines to lock up as soon as the
> bluetooth dongle gets inserted.
> As far as I found there had been discussions about adding some sort of
> blacklisting support to the pegasus module before but I have not found
> any code doing so.
> This is what the attached patch does. There is possibly much room for
> improvement but at least it seems to work. Would it be possible to
> include something like this in the mainline driver?


[-- Attachment #2: pegasus4.diff --]
[-- Type: text/x-diff, Size: 1735 bytes --]

diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
index d1ed68a..61f4f72 100644
--- a/drivers/net/usb/pegasus.c
+++ b/drivers/net/usb/pegasus.c
@@ -62,17 +62,23 @@ static char *devid=NULL;
 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_DEVINT(pn, vid, pid, flags, cl, sc, pr) \
+	PEGASUS_DEV(pn, vid, pid, flags)
 #include "pegasus.h"
 #undef	PEGASUS_DEV
+#undef	PEGASUS_DEVINT
 	{NULL, 0, 0, 0},
 	{NULL, 0, 0, 0}
 };
 
 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},
+	{USB_DEVICE(vid, pid)},
+#define PEGASUS_DEVINT(pn, vid, pid, flags, cl, sc, pr) \
+	{USB_DEVICE_AND_INTERFACE_INFO(vid, pid, cl, sc, pr)},
 #include "pegasus.h"
 #undef	PEGASUS_DEV
+#undef	PEGASUS_DEVINT
 	{},
 	{}
 };
diff --git a/drivers/net/usb/pegasus.h b/drivers/net/usb/pegasus.h
index c746782..a7000ed 100644
--- a/drivers/net/usb/pegasus.h
+++ b/drivers/net/usb/pegasus.h
@@ -202,8 +202,8 @@ PEGASUS_DEV( "AEI USB Fast Ethernet Adapter", VENDOR_AEILAB, 0x1701,
 		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_DEVINT( "Belkin F5D5050 USB Ethernet", VENDOR_BELKIN, 0x0121,
+		DEFAULT_GPIO_RESET | PEGASUS_II, 0xff, 0xff, 0xff )
 PEGASUS_DEV( "Billionton USB-100", VENDOR_BILLIONTON, 0x0986,
 		DEFAULT_GPIO_RESET )
 PEGASUS_DEV( "Billionton USBLP-100", VENDOR_BILLIONTON, 0x0987,

                 reply	other threads:[~2008-04-10 22:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47FE9446.7010404@canonical.com \
    --to=stefan.bader@canonical.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=petkan@nucleusys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.