summaryrefslogtreecommitdiff
path: root/sys/netbt/bt_proto.c
diff options
context:
space:
mode:
authorUwe Stuehler <uwe@cvs.openbsd.org>2008-11-22 04:42:59 +0000
committerUwe Stuehler <uwe@cvs.openbsd.org>2008-11-22 04:42:59 +0000
commitee43d395f23778051691eb4bfc357fa8a319dc36 (patch)
tree39f64994e1dc4a1a4688f1cd259f7a4ac2a1fa41 /sys/netbt/bt_proto.c
parent40b98550b7357a09aad4dfe870e508bc05f03705 (diff)
Sync bluetooth with NetBSD
Diffstat (limited to 'sys/netbt/bt_proto.c')
-rw-r--r--sys/netbt/bt_proto.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/netbt/bt_proto.c b/sys/netbt/bt_proto.c
index 5d379e33137..a07f4071053 100644
--- a/sys/netbt/bt_proto.c
+++ b/sys/netbt/bt_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bt_proto.c,v 1.4 2007/06/24 20:55:27 uwe Exp $ */
+/* $OpenBSD: bt_proto.c,v 1.5 2008/11/22 04:42:58 uwe Exp $ */
/*
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
*
@@ -30,6 +30,8 @@
struct domain btdomain;
+void bt_init(void);
+
struct protosw btsw[] = {
{ SOCK_RAW, &btdomain, BTPROTO_HCI,
PR_ATOMIC | PR_ADDR,
@@ -63,8 +65,22 @@ struct protosw btsw[] = {
struct domain btdomain = {
AF_BLUETOOTH, "bluetooth",
- NULL/*init*/, NULL/*externalize*/, NULL/*dispose*/,
+ bt_init, NULL/*externalize*/, NULL/*dispose*/,
btsw, &btsw[sizeof(btsw) / sizeof(btsw[0])], NULL,
NULL/*rtattach*/, 32, sizeof(struct sockaddr_bt),
NULL/*ifattach*/, NULL/*ifdetach*/
};
+
+struct mutex bt_lock;
+
+void
+bt_init(void)
+{
+ /*
+ * In accordance with mutex(9), since hci_intr() uses the
+ * lock, we associate the subsystem lock with IPL_SOFTNET.
+ * For unknown reasons, in NetBSD the interrupt level is
+ * IPL_NONE.
+ */
+ mtx_init(&bt_lock, IPL_SOFTNET);
+}