diff options
| author | plunky <plunky@NetBSD.org> | 2010-04-28 06:13:51 +0000 |
|---|---|---|
| committer | plunky <plunky@NetBSD.org> | 2010-04-28 06:13:51 +0000 |
| commit | 0f7dbb350e704c37e2c6af23679244fb02045bbd (patch) | |
| tree | 31a3deb033a1c93ff882ec46a53540aa4da837c5 /sys/dev | |
| parent | 0b415f4e44802c8965131ad75e446bc8ff8f2dd2 (diff) | |
allow for vendor-id and product-id properties, passing them
through to child devices
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/bluetooth/btdev.h | 4 | ||||
| -rw-r--r-- | sys/dev/bluetooth/bthidev.c | 13 | ||||
| -rw-r--r-- | sys/dev/bluetooth/bthidev.h | 4 |
3 files changed, 17 insertions, 4 deletions
diff --git a/sys/dev/bluetooth/btdev.h b/sys/dev/bluetooth/btdev.h index 6b471fe1098..73fb7e067f3 100644 --- a/sys/dev/bluetooth/btdev.h +++ b/sys/dev/bluetooth/btdev.h @@ -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 --git a/sys/dev/bluetooth/bthidev.c b/sys/dev/bluetooth/bthidev.c index 929e5137a98..4c97370ffb0 100644 --- a/sys/dev/bluetooth/bthidev.c +++ b/sys/dev/bluetooth/bthidev.c @@ -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 @@ bthidev_attach(device_t parent, device_t self, void *aux) const void *desc; int locs[BTHIDBUSCF_NLOCS]; int maxid, rep, dlen; + int vendor, product; /* * Init softc @@ -205,6 +206,12 @@ bthidev_attach(device_t parent, device_t self, void *aux) 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 @@ bthidev_attach(device_t parent, device_t self, void *aux) && 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 --git a/sys/dev/bluetooth/bthidev.h b/sys/dev/bluetooth/bthidev.h index 554d14bcd95..e483f83c1d6 100644 --- a/sys/dev/bluetooth/bthidev.h +++ b/sys/dev/bluetooth/bthidev.h @@ -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 @@ struct bthidev { /* 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 */ |
