Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/bluetooth allow for vendor-id and product-id propert...



details:   https://anonhg.NetBSD.org/src/rev/65c4d2ab74a0
branches:  trunk
changeset: 754333:65c4d2ab74a0
user:      plunky <plunky%NetBSD.org@localhost>
date:      Wed Apr 28 06:13:51 2010 +0000

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

diffstat:

 sys/dev/bluetooth/btdev.h   |   4 +++-
 sys/dev/bluetooth/bthidev.c |  13 +++++++++++--
 sys/dev/bluetooth/bthidev.h |   4 +++-
 3 files changed, 17 insertions(+), 4 deletions(-)

diffs (84 lines):

diff -r 36a1c5961c25 -r 65c4d2ab74a0 sys/dev/bluetooth/btdev.h
--- a/sys/dev/bluetooth/btdev.h Wed Apr 28 06:06:11 2010 +0000
+++ b/sys/dev/bluetooth/btdev.h Wed Apr 28 06:13:51 2010 +0000
@@ -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"
diff -r 36a1c5961c25 -r 65c4d2ab74a0 sys/dev/bluetooth/bthidev.c
--- a/sys/dev/bluetooth/bthidev.c       Wed Apr 28 06:06:11 2010 +0000
+++ b/sys/dev/bluetooth/bthidev.c       Wed Apr 28 06:13:51 2010 +0000
@@ -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;
diff -r 36a1c5961c25 -r 65c4d2ab74a0 sys/dev/bluetooth/bthidev.h
--- a/sys/dev/bluetooth/bthidev.h       Wed Apr 28 06:06:11 2010 +0000
+++ b/sys/dev/bluetooth/bthidev.h       Wed Apr 28 06:13:51 2010 +0000
@@ -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 */



Home | Main Index | Thread Index | Old Index