From ee43d395f23778051691eb4bfc357fa8a319dc36 Mon Sep 17 00:00:00 2001 From: Uwe Stuehler Date: Sat, 22 Nov 2008 04:42:59 +0000 Subject: Sync bluetooth with NetBSD --- sys/netbt/bt_proto.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'sys/netbt/bt_proto.c') 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 * @@ -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); +} -- cgit v1.2.3