Subject: Re: Belkin Bluetooth vs aue vs ubt
To: Jason Thorpe <thorpej@shagadelic.org>
From: Stephen Borrill <netbsd@precedence.co.uk>
List: tech-kern
Date: 03/07/2007 22:14:34
On Wed, 7 Mar 2007, Jason Thorpe wrote:
> On Mar 7, 2007, at 1:40 PM, Stephen Borrill wrote:
>
>> I've had a quick look at that and we don't define any other subclass or 
>> proto for UDCLASS_WIRELESS (though I guess they must be defined somewhere). 
>> As its 'other' match is Wireless Ethernet, the class is the same. This 
>> could do with testing on real hardware.
>
> Well, aue shouldn't be WIRELESS :-)  It's Ethernet.

I'm not sure what class that would actually be:

http://www.usb.org/developers/defined_class

Communications Devices probably.

We can either make aue reject UDCLASS_WIRELESS or look for the correct 
class. The former would be sufficient in this case, but I think this whole 
issue has highlighted that we should perhaps check sanity check class 
throughout our product-specific drivers. Does anyone have a real aue they 
can test with?

How about this?

Index: if_aue.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/if_aue.c,v
retrieving revision 1.100
diff -u -r1.100 if_aue.c
--- if_aue.c	4 Mar 2007 06:02:47 -0000	1.100
+++ if_aue.c	7 Mar 2007 21:58:47 -0000
@@ -712,10 +712,16 @@
  USB_MATCH(aue)
  {
  	USB_MATCH_START(aue, uaa);
+	usb_device_descriptor_t *dd;

  	if (uaa->iface != NULL)
  		return (UMATCH_NONE);

+	/* Sanity check device class */
+	dd = usbd_get_device_descriptor(uaa->device);
+	if (dd != NULL && dd->bDeviceClass == UDCLASS_WIRELESS)
+		return (UMATCH_NONE);
+
  	return (aue_lookup(uaa->vendor, uaa->product) != NULL ?
  		UMATCH_VENDOR_PRODUCT : UMATCH_NONE);
  }

Or perhaps

+	if (dd != NULL && dd->bDeviceClass != UDCLASS_COMM)

Iain, should I skip this if dd->bDeviceClass == UDCLASS_IN_INTERFACE?

-- 
Stephen