Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/dev USB bluetooth device rump component.



details:   https://anonhg.NetBSD.org/src/rev/febb25b989fc
branches:  trunk
changeset: 753286:febb25b989fc
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Mar 22 12:14:51 2010 +0000

description:
USB bluetooth device rump component.

This is a curious driver in the sense that unlike all other current
device drivers, it does not require vfs.  This is because the driver
is controlled via bluetooth, which is controlled via PF_BLUETOOTH
sockets (as opposed to a /dev node).

diffstat:

 sys/rump/dev/Makefile.rumpdev         |   4 ++--
 sys/rump/dev/lib/libubt/Makefile      |  16 ++++++++++++++++
 sys/rump/dev/lib/libubt/UBT.ioconf    |  14 ++++++++++++++
 sys/rump/dev/lib/libubt/shlib_version |   4 ++++
 sys/rump/dev/lib/libubt/ubt_at_usb.c  |  28 ++++++++++++++++++++++++++++
 5 files changed, 64 insertions(+), 2 deletions(-)

diffs (91 lines):

diff -r f31b23ea1b42 -r febb25b989fc sys/rump/dev/Makefile.rumpdev
--- a/sys/rump/dev/Makefile.rumpdev     Mon Mar 22 12:08:44 2010 +0000
+++ b/sys/rump/dev/Makefile.rumpdev     Mon Mar 22 12:14:51 2010 +0000
@@ -1,7 +1,7 @@
-#      $NetBSD: Makefile.rumpdev,v 1.9 2010/02/11 02:22:09 pooka Exp $
+#      $NetBSD: Makefile.rumpdev,v 1.10 2010/03/22 12:14:51 pooka Exp $
 #
 
-RUMPDEVLIST=   bpf cgd disk dm netsmb raidframe rnd sysmon ucom        \
+RUMPDEVLIST=   bpf cgd disk dm netsmb raidframe rnd sysmon ubt ucom    \
                ugenhc ulpt umass usb wscons
 
 
diff -r f31b23ea1b42 -r febb25b989fc sys/rump/dev/lib/libubt/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libubt/Makefile  Mon Mar 22 12:14:51 2010 +0000
@@ -0,0 +1,16 @@
+#      $NetBSD: Makefile,v 1.1 2010/03/22 12:14:51 pooka Exp $
+#
+
+.PATH: ${.CURDIR}/../../../../dev/usb
+
+LIB=   rumpdev_ubt
+IOCONF= UBT.ioconf
+
+SRCS=  ubt.c
+
+SRCS+= ubt_at_usb.c
+
+CPPFLAGS+= -I${RUMPTOP}/net/lib/libnetbt
+
+.include <bsd.lib.mk>
+.include <bsd.klinks.mk>
diff -r f31b23ea1b42 -r febb25b989fc sys/rump/dev/lib/libubt/UBT.ioconf
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libubt/UBT.ioconf        Mon Mar 22 12:14:51 2010 +0000
@@ -0,0 +1,14 @@
+#      $NetBSD: UBT.ioconf,v 1.1 2010/03/22 12:14:51 pooka Exp $
+#
+
+ioconf ubt
+
+include "conf/files"
+include "dev/usb/files.usb"
+include "rump/dev/files.rump"
+
+pseudo-root uhub*
+
+# Bluetooth USB Controllers
+ubt* at uhub? port ?
+bthub* at ubt?
diff -r f31b23ea1b42 -r febb25b989fc sys/rump/dev/lib/libubt/shlib_version
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libubt/shlib_version     Mon Mar 22 12:14:51 2010 +0000
@@ -0,0 +1,4 @@
+#      $NetBSD: shlib_version,v 1.1 2010/03/22 12:14:51 pooka Exp $
+#
+major=0
+minor=0
diff -r f31b23ea1b42 -r febb25b989fc sys/rump/dev/lib/libubt/ubt_at_usb.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libubt/ubt_at_usb.c      Mon Mar 22 12:14:51 2010 +0000
@@ -0,0 +1,28 @@
+/*     $NetBSD: ubt_at_usb.c,v 1.1 2010/03/22 12:14:51 pooka Exp $     */
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/conf.h>
+#include <sys/device.h>
+#include <sys/kmem.h>
+
+#include "ioconf.c"
+
+#include "rump_private.h"
+#include "rump_dev_private.h"
+
+#define FLAWLESSCALL(call)                                             \
+do {                                                                   \
+       int att_error;                                                  \
+       if ((att_error = call) != 0)                                    \
+               panic("\"%s\" failed", #call);                          \
+} while (/*CONSTCOND*/0)
+
+RUMP_COMPONENT(RUMP_COMPONENT_DEV)
+{
+
+       FLAWLESSCALL(config_cfdata_attach(cfdata_ubt, 0));
+
+       FLAWLESSCALL(config_cfdriver_attach(&ubt_cd));
+       FLAWLESSCALL(config_cfattach_attach("ubt", &ubt_ca));
+}



Home | Main Index | Thread Index | Old Index