From 9a702d8fe45a2f2f77622ebf8d179cbd5ee1597b Mon Sep 17 00:00:00 2001 From: pooka Date: Mon, 22 Mar 2010 12:14:51 +0000 Subject: [PATCH] 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). --- 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(-) create mode 100644 sys/rump/dev/lib/libubt/Makefile create mode 100644 sys/rump/dev/lib/libubt/UBT.ioconf create mode 100644 sys/rump/dev/lib/libubt/shlib_version create mode 100644 sys/rump/dev/lib/libubt/ubt_at_usb.c diff --git a/sys/rump/dev/Makefile.rumpdev b/sys/rump/dev/Makefile.rumpdev index a8f2693fa71e..f650f2098d1f 100644 --- a/sys/rump/dev/Makefile.rumpdev +++ b/sys/rump/dev/Makefile.rumpdev @@ -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 --git a/sys/rump/dev/lib/libubt/Makefile b/sys/rump/dev/lib/libubt/Makefile new file mode 100644 index 000000000000..16dfe51c57be --- /dev/null +++ b/sys/rump/dev/lib/libubt/Makefile @@ -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 +.include diff --git a/sys/rump/dev/lib/libubt/UBT.ioconf b/sys/rump/dev/lib/libubt/UBT.ioconf new file mode 100644 index 000000000000..731cc471fd95 --- /dev/null +++ b/sys/rump/dev/lib/libubt/UBT.ioconf @@ -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 --git a/sys/rump/dev/lib/libubt/shlib_version b/sys/rump/dev/lib/libubt/shlib_version new file mode 100644 index 000000000000..a6522633bb46 --- /dev/null +++ b/sys/rump/dev/lib/libubt/shlib_version @@ -0,0 +1,4 @@ +# $NetBSD: shlib_version,v 1.1 2010/03/22 12:14:51 pooka Exp $ +# +major=0 +minor=0 diff --git a/sys/rump/dev/lib/libubt/ubt_at_usb.c b/sys/rump/dev/lib/libubt/ubt_at_usb.c new file mode 100644 index 000000000000..d19f0b6fc2a4 --- /dev/null +++ b/sys/rump/dev/lib/libubt/ubt_at_usb.c @@ -0,0 +1,28 @@ +/* $NetBSD: ubt_at_usb.c,v 1.1 2010/03/22 12:14:51 pooka Exp $ */ + +#include +#include +#include +#include +#include + +#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)); +}