Sat Oct 6 14:37:41 2012 UTC ()
recognize apple bluetooth adapter in MacBook Air. (Ryo Onodera)


(christos)
diff -r1.48 -r1.49 src/sys/dev/usb/ubt.c
diff -r1.629 -r1.630 src/sys/dev/usb/usbdevs

cvs diff -r1.48 -r1.49 src/sys/dev/usb/ubt.c (expand / switch to unified diff)

--- src/sys/dev/usb/ubt.c 2012/06/02 21:36:45 1.48
+++ src/sys/dev/usb/ubt.c 2012/10/06 14:37:41 1.49
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ubt.c,v 1.48 2012/06/02 21:36:45 dsl Exp $ */ 1/* $NetBSD: ubt.c,v 1.49 2012/10/06 14:37:41 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2006 Itronix Inc. 4 * Copyright (c) 2006 Itronix Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Iain Hibbert for Itronix Inc. 7 * Written by Iain Hibbert for Itronix Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -57,27 +57,27 @@ @@ -57,27 +57,27 @@
57 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 57 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
58 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 58 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
59 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 59 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
60 * POSSIBILITY OF SUCH DAMAGE. 60 * POSSIBILITY OF SUCH DAMAGE.
61 */ 61 */
62/* 62/*
63 * This driver originally written by Lennart Augustsson and David Sainty, 63 * This driver originally written by Lennart Augustsson and David Sainty,
64 * but was mostly rewritten for the NetBSD Bluetooth protocol stack by 64 * but was mostly rewritten for the NetBSD Bluetooth protocol stack by
65 * Iain Hibbert for Itronix, Inc using the FreeBSD ng_ubt.c driver as a 65 * Iain Hibbert for Itronix, Inc using the FreeBSD ng_ubt.c driver as a
66 * reference. 66 * reference.
67 */ 67 */
68 68
69#include <sys/cdefs.h> 69#include <sys/cdefs.h>
70__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.48 2012/06/02 21:36:45 dsl Exp $"); 70__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.49 2012/10/06 14:37:41 christos Exp $");
71 71
72#include <sys/param.h> 72#include <sys/param.h>
73#include <sys/device.h> 73#include <sys/device.h>
74#include <sys/ioctl.h> 74#include <sys/ioctl.h>
75#include <sys/kernel.h> 75#include <sys/kernel.h>
76#include <sys/malloc.h> 76#include <sys/malloc.h>
77#include <sys/mbuf.h> 77#include <sys/mbuf.h>
78#include <sys/proc.h> 78#include <sys/proc.h>
79#include <sys/sysctl.h> 79#include <sys/sysctl.h>
80#include <sys/systm.h> 80#include <sys/systm.h>
81 81
82#include <dev/usb/usb.h> 82#include <dev/usb/usb.h>
83#include <dev/usb/usbdi.h> 83#include <dev/usb/usbdi.h>
@@ -295,46 +295,54 @@ static const struct hci_if ubt_hci = { @@ -295,46 +295,54 @@ static const struct hci_if ubt_hci = {
295 295
296int ubt_match(device_t, cfdata_t, void *); 296int ubt_match(device_t, cfdata_t, void *);
297void ubt_attach(device_t, device_t, void *); 297void ubt_attach(device_t, device_t, void *);
298int ubt_detach(device_t, int); 298int ubt_detach(device_t, int);
299int ubt_activate(device_t, enum devact); 299int ubt_activate(device_t, enum devact);
300extern struct cfdriver ubt_cd; 300extern struct cfdriver ubt_cd;
301CFATTACH_DECL_NEW(ubt, sizeof(struct ubt_softc), ubt_match, ubt_attach, ubt_detach, ubt_activate); 301CFATTACH_DECL_NEW(ubt, sizeof(struct ubt_softc), ubt_match, ubt_attach, ubt_detach, ubt_activate);
302 302
303static int ubt_set_isoc_config(struct ubt_softc *); 303static int ubt_set_isoc_config(struct ubt_softc *);
304static int ubt_sysctl_config(SYSCTLFN_PROTO); 304static int ubt_sysctl_config(SYSCTLFN_PROTO);
305static void ubt_abortdealloc(struct ubt_softc *); 305static void ubt_abortdealloc(struct ubt_softc *);
306 306
307/* 307/*
308 * Match against the whole device, since we want to take 308 * To match or ignore forcibly, add
309 * both interfaces. If a device should be ignored then add 
310 * 309 *
311 * { VendorID, ProductID } 310 * { { VendorID, ProductID } , UMATCH_VENDOR_PRODUCT|UMATCH_NONE }
312 * 311 *
313 * to the ubt_ignore list. 312 * to the ubt_dev list.
314 */ 313 */
315static const struct usb_devno ubt_ignore[] = { 314const struct ubt_devno {
316 { USB_VENDOR_BROADCOM, USB_PRODUCT_BROADCOM_BCM2033NF }, 315 struct usb_devno devno;
 316 int match;
 317} ubt_dev[] = {
 318 { { USB_VENDOR_BROADCOM, USB_PRODUCT_BROADCOM_BCM2033NF },
 319 UMATCH_NONE },
 320 { { USB_VENDOR_APPLE, USB_PRODUCT_APPLE_BLUETOOTH_HOST_C },
 321 UMATCH_VENDOR_PRODUCT },
317}; 322};
 323#define ubt_lookup(vendor, product) \
 324 ((const struct ubt_devno *)usb_lookup(ubt_dev, vendor, product))
318 325
319int  326int
320ubt_match(device_t parent, cfdata_t match, void *aux) 327ubt_match(device_t parent, cfdata_t match, void *aux)
321{ 328{
322 struct usb_attach_arg *uaa = aux; 329 struct usb_attach_arg *uaa = aux;
 330 const struct ubt_devno *dev;
323 331
324 DPRINTFN(50, "ubt_match\n"); 332 DPRINTFN(50, "ubt_match\n");
325 333
326 if (usb_lookup(ubt_ignore, uaa->vendor, uaa->product)) 334 if ((dev = ubt_lookup(uaa->vendor, uaa->product)) != NULL)
327 return UMATCH_NONE; 335 return dev->match;
328 336
329 if (uaa->class == UDCLASS_WIRELESS 337 if (uaa->class == UDCLASS_WIRELESS
330 && uaa->subclass == UDSUBCLASS_RF 338 && uaa->subclass == UDSUBCLASS_RF
331 && uaa->proto == UDPROTO_BLUETOOTH) 339 && uaa->proto == UDPROTO_BLUETOOTH)
332 return UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO; 340 return UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO;
333 341
334 return UMATCH_NONE; 342 return UMATCH_NONE;
335} 343}
336 344
337void  345void
338ubt_attach(device_t parent, device_t self, void *aux) 346ubt_attach(device_t parent, device_t self, void *aux)
339{ 347{
340 struct ubt_softc *sc = device_private(self); 348 struct ubt_softc *sc = device_private(self);

cvs diff -r1.629 -r1.630 src/sys/dev/usb/usbdevs (expand / switch to unified diff)

--- src/sys/dev/usb/usbdevs 2012/10/05 22:04:56 1.629
+++ src/sys/dev/usb/usbdevs 2012/10/06 14:37:41 1.630
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1$NetBSD: usbdevs,v 1.629 2012/10/05 22:04:56 khorben Exp $ 1$NetBSD: usbdevs,v 1.630 2012/10/06 14:37:41 christos Exp $
2 2
3/* 3/*
4 * Copyright (c) 1998-2004 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Lennart Augustsson (lennart@augustsson.net) at 8 * by Lennart Augustsson (lennart@augustsson.net) at
9 * Carlstedt Research & Technology. 9 * Carlstedt Research & Technology.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -833,26 +833,27 @@ product APPLE GEYSER1_TP 0x030b Apple In @@ -833,26 +833,27 @@ product APPLE GEYSER1_TP 0x030b Apple In
833product APPLE MAGICMOUSE 0x030d Magic Mouse 833product APPLE MAGICMOUSE 0x030d Magic Mouse
834product APPLE BLUETOOTH_HIDMODE 0x1000 Bluetooth HCI (HID-proxy mode) 834product APPLE BLUETOOTH_HIDMODE 0x1000 Bluetooth HCI (HID-proxy mode)
835product APPLE EXT_KBD_HUB 0x1003 Hub in Apple Extended USB Keyboard 835product APPLE EXT_KBD_HUB 0x1003 Hub in Apple Extended USB Keyboard
836product APPLE SPEAKERS 0x1101 Speakers 836product APPLE SPEAKERS 0x1101 Speakers
837product APPLE SHUFFLE2 0x1301 iPod Shuffle (2nd generation) 837product APPLE SHUFFLE2 0x1301 iPod Shuffle (2nd generation)
838product APPLE IPHONE 0x1290 iPhone 838product APPLE IPHONE 0x1290 iPhone
839product APPLE IPOD_TOUCH 0x1291 iPod Touch 839product APPLE IPOD_TOUCH 0x1291 iPod Touch
840product APPLE IPOD_TOUCH_4G 0x129e iPod Touch 4G 840product APPLE IPOD_TOUCH_4G 0x129e iPod Touch 4G
841product APPLE IPHONE_3G 0x1292 iPhone 3G 841product APPLE IPHONE_3G 0x1292 iPhone 3G
842product APPLE IPHONE_3GS 0x1294 iPhone 3GS 842product APPLE IPHONE_3GS 0x1294 iPhone 3GS
843product APPLE IPAD 0x129a Apple iPad 843product APPLE IPAD 0x129a Apple iPad
844product APPLE ETHERNET 0x1402 Apple USB to Ethernet 844product APPLE ETHERNET 0x1402 Apple USB to Ethernet
845product APPLE BLUETOOTH2 0x8205 Bluetooth 845product APPLE BLUETOOTH2 0x8205 Bluetooth
 846product APPLE BLUETOOTH_HOST_C 0x821f Bluetooth USB Host Controller
846product APPLE BLUETOOTH 0x8300 Bluetooth 847product APPLE BLUETOOTH 0x8300 Bluetooth
847 848
848/* ArkMicroChips products */ 849/* ArkMicroChips products */
849product ARKMICROCHIPS USBSERIAL 0x0232 USB-UART Controller 850product ARKMICROCHIPS USBSERIAL 0x0232 USB-UART Controller
850 851
851/* Asahi Optical products */ 852/* Asahi Optical products */
852product ASAHIOPTICAL OPTIO230 0x0004 PENTAX Optio230 853product ASAHIOPTICAL OPTIO230 0x0004 PENTAX Optio230
853product ASAHIOPTICAL OPTIO330 0x0006 Digital camera 854product ASAHIOPTICAL OPTIO330 0x0006 Digital camera
854 855
855/* Asante products */ 856/* Asante products */
856product ASANTE EA 0x1427 Ethernet Adapter 857product ASANTE EA 0x1427 Ethernet Adapter
857 858
858/* Askey Computer products */ 859/* Askey Computer products */