Module Name: src
Committed By: christos
Date: Sat Oct 6 14:37:41 UTC 2012
Modified Files:
src/sys/dev/usb: ubt.c usbdevs
Log Message:
recognize apple bluetooth adapter in MacBook Air. (Ryo Onodera)
To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/usb/ubt.c
cvs rdiff -u -r1.629 -r1.630 src/sys/dev/usb/usbdevs
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/usb/ubt.c
diff -u src/sys/dev/usb/ubt.c:1.48 src/sys/dev/usb/ubt.c:1.49
--- src/sys/dev/usb/ubt.c:1.48 Sat Jun 2 17:36:45 2012
+++ src/sys/dev/usb/ubt.c Sat Oct 6 10:37:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: ubt.c,v 1.48 2012/06/02 21:36:45 dsl Exp $ */
+/* $NetBSD: ubt.c,v 1.49 2012/10/06 14:37:41 christos Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.48 2012/06/02 21:36:45 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.49 2012/10/06 14:37:41 christos Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -305,26 +305,34 @@ static int ubt_sysctl_config(SYSCTLFN_PR
static void ubt_abortdealloc(struct ubt_softc *);
/*
- * Match against the whole device, since we want to take
- * both interfaces. If a device should be ignored then add
+ * To match or ignore forcibly, add
*
- * { VendorID, ProductID }
+ * { { VendorID, ProductID } , UMATCH_VENDOR_PRODUCT|UMATCH_NONE }
*
- * to the ubt_ignore list.
+ * to the ubt_dev list.
*/
-static const struct usb_devno ubt_ignore[] = {
- { USB_VENDOR_BROADCOM, USB_PRODUCT_BROADCOM_BCM2033NF },
+const struct ubt_devno {
+ struct usb_devno devno;
+ int match;
+} ubt_dev[] = {
+ { { USB_VENDOR_BROADCOM, USB_PRODUCT_BROADCOM_BCM2033NF },
+ UMATCH_NONE },
+ { { USB_VENDOR_APPLE, USB_PRODUCT_APPLE_BLUETOOTH_HOST_C },
+ UMATCH_VENDOR_PRODUCT },
};
+#define ubt_lookup(vendor, product) \
+ ((const struct ubt_devno *)usb_lookup(ubt_dev, vendor, product))
int
ubt_match(device_t parent, cfdata_t match, void *aux)
{
struct usb_attach_arg *uaa = aux;
+ const struct ubt_devno *dev;
DPRINTFN(50, "ubt_match\n");
- if (usb_lookup(ubt_ignore, uaa->vendor, uaa->product))
- return UMATCH_NONE;
+ if ((dev = ubt_lookup(uaa->vendor, uaa->product)) != NULL)
+ return dev->match;
if (uaa->class == UDCLASS_WIRELESS
&& uaa->subclass == UDSUBCLASS_RF
Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.629 src/sys/dev/usb/usbdevs:1.630
--- src/sys/dev/usb/usbdevs:1.629 Fri Oct 5 18:04:56 2012
+++ src/sys/dev/usb/usbdevs Sat Oct 6 10:37:41 2012
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.629 2012/10/05 22:04:56 khorben Exp $
+$NetBSD: usbdevs,v 1.630 2012/10/06 14:37:41 christos Exp $
/*
* Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -843,6 +843,7 @@ product APPLE IPHONE_3GS 0x1294 iPhone 3
product APPLE IPAD 0x129a Apple iPad
product APPLE ETHERNET 0x1402 Apple USB to Ethernet
product APPLE BLUETOOTH2 0x8205 Bluetooth
+product APPLE BLUETOOTH_HOST_C 0x821f Bluetooth USB Host Controller
product APPLE BLUETOOTH 0x8300 Bluetooth
/* ArkMicroChips products */