Module Name:    src
Committed By:   plunky
Date:           Wed Apr 28 06:13:51 UTC 2010

Modified Files:
        src/sys/dev/bluetooth: btdev.h bthidev.c bthidev.h

Log Message:
allow for vendor-id and product-id properties, passing them
through to child devices


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/bluetooth/btdev.h
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/bluetooth/bthidev.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/bluetooth/bthidev.h

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/bluetooth/btdev.h
diff -u src/sys/dev/bluetooth/btdev.h:1.8 src/sys/dev/bluetooth/btdev.h:1.9
--- src/sys/dev/bluetooth/btdev.h:1.8	Fri Mar 28 21:17:37 2008
+++ src/sys/dev/bluetooth/btdev.h	Wed Apr 28 06:13:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: btdev.h,v 1.8 2008/03/28 21:17:37 plunky Exp $	*/
+/*	$NetBSD: btdev.h,v 1.9 2010/04/28 06:13:51 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -39,6 +39,8 @@
 #define BTDEV_DETACH		_IOW('b', 15, struct plistref)
 
 /* btdev properties */
+#define BTDEVvendor		"vendor-id"
+#define BTDEVproduct		"product-id"
 #define BTDEVtype		"device-type"
 #define BTDEVladdr		"local-bdaddr"
 #define BTDEVraddr		"remote-bdaddr"

Index: src/sys/dev/bluetooth/bthidev.c
diff -u src/sys/dev/bluetooth/bthidev.c:1.18 src/sys/dev/bluetooth/bthidev.c:1.19
--- src/sys/dev/bluetooth/bthidev.c:1.18	Fri Aug 21 10:01:25 2009
+++ src/sys/dev/bluetooth/bthidev.c	Wed Apr 28 06:13:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bthidev.c,v 1.18 2009/08/21 10:01:25 plunky Exp $	*/
+/*	$NetBSD: bthidev.c,v 1.19 2010/04/28 06:13:51 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bthidev.c,v 1.18 2009/08/21 10:01:25 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bthidev.c,v 1.19 2010/04/28 06:13:51 plunky Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -181,6 +181,7 @@
 	const void *desc;
 	int locs[BTHIDBUSCF_NLOCS];
 	int maxid, rep, dlen;
+	int vendor, product;
 
 	/*
 	 * Init softc
@@ -205,6 +206,12 @@
 	obj = prop_dictionary_get(dict, BTDEVraddr);
 	bdaddr_copy(&sc->sc_raddr, prop_data_data_nocopy(obj));
 
+	obj = prop_dictionary_get(dict, BTDEVvendor);
+	vendor = (int)prop_number_integer_value(obj);
+
+	obj = prop_dictionary_get(dict, BTDEVproduct);
+	product = (int)prop_number_integer_value(obj);
+
 	obj = prop_dictionary_get(dict, BTDEVmode);
 	if (prop_object_type(obj) == PROP_TYPE_STRING) {
 		if (prop_string_equals_cstring(obj, BTDEVauth))
@@ -279,6 +286,8 @@
 		    && hid_report_size(desc, dlen, hid_output, rep) == 0)
 			continue;
 
+		bha.ba_vendor = vendor;
+		bha.ba_product = product;
 		bha.ba_desc = desc;
 		bha.ba_dlen = dlen;
 		bha.ba_input = bthidev_null;

Index: src/sys/dev/bluetooth/bthidev.h
diff -u src/sys/dev/bluetooth/bthidev.h:1.4 src/sys/dev/bluetooth/bthidev.h:1.5
--- src/sys/dev/bluetooth/bthidev.h:1.4	Sat Nov  3 17:41:03 2007
+++ src/sys/dev/bluetooth/bthidev.h	Wed Apr 28 06:13:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bthidev.h,v 1.4 2007/11/03 17:41:03 plunky Exp $	*/
+/*	$NetBSD: bthidev.h,v 1.5 2010/04/28 06:13:51 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -60,6 +60,8 @@
 
 /* HID device attach arguments */
 struct bthidev_attach_args {
+	int		 ba_vendor;	/* USB Forum Vendor ID */
+	int		 ba_product;	/* USB Forum Product ID */
 	const void	*ba_desc;	/* descriptor */
 	int		 ba_dlen;	/* descriptor length */
 	int		 ba_id;		/* report id */

Reply via email to