Hi,

As mentioned in PR kern/46992, USB Bluetooth device on MacBook Air 5,1
reports wrong uaa->class value in ubt_match function,
so 0xff (UDCLASS_VENDOR) instead of correct 0xe0 (UDCLASS_WIRELESS).

To identify it as ubt(4) device, I want to introduce the following
mechanism.

Any opinion and suggestion?

Thank you.


Index: usbdevs
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/usbdevs,v
retrieving revision 1.627
diff -u -r1.627 usbdevs
--- usbdevs     23 Sep 2012 01:06:31 -0000      1.627
+++ usbdevs     2 Oct 2012 10:04:44 -0000
@@ -844,6 +844,7 @@
 product APPLE ETHERNET         0x1402  Apple USB to Ethernet
 product APPLE BLUETOOTH2       0x8205  Bluetooth
 product APPLE BLUETOOTH                0x8300  Bluetooth
+product APPLE BLUETOOTH_HOST_C 0x821f  Bluetooth USB Host Controller
 
 /* ArkMicroChips products */
 product ARKMICROCHIPS USBSERIAL 0x0232 USB-UART Controller
Index: ubt.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/ubt.c,v
retrieving revision 1.48
diff -u -r1.48 ubt.c
--- ubt.c       2 Jun 2012 21:36:45 -0000       1.48
+++ ubt.c       2 Oct 2012 10:04:44 -0000
@@ -316,6 +316,16 @@
        { USB_VENDOR_BROADCOM, USB_PRODUCT_BROADCOM_BCM2033NF },
 };
 
+/*
+ * Some device returns wrong class (UDCLASS_VENDOR).
+ * To force to detect, Add
+ * { VendorID, ProductID }
+ * to the ubt_force_detect list.
+ */
+static const struct usb_devno ubt_force_detect[] = {
+       { USB_VENDOR_APPLE, USB_PRODUCT_APPLE_BLUETOOTH_HOST_C },
+};
+
 int 
 ubt_match(device_t parent, cfdata_t match, void *aux)
 {
@@ -331,6 +341,9 @@
            && uaa->proto == UDPROTO_BLUETOOTH)
                return UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO;
 
+       if (usb_lookup(ubt_force_detect, uaa->vendor, uaa->product))
+               return UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO;
+
        return UMATCH_NONE;
 }
 

--
Ryo ONODERA // ryo...@yk.rim.or.jp
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


Reply via email to