Module Name: src
Committed By: plunky
Date: Tue Apr 3 09:32:54 UTC 2012
Modified Files:
src/sys/dev/bluetooth: bthidev.c bthub.c btkbd.c btmagic.c btms.c
btsco.c
Log Message:
register/deregister pmf(9) NULL handlers for bthub(4) and
bluetooth devices which attach there, to fix PR/39006
To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/bluetooth/bthidev.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/bluetooth/bthub.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/bluetooth/btkbd.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/bluetooth/btmagic.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/bluetooth/btms.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/bluetooth/btsco.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/bluetooth/bthidev.c
diff -u src/sys/dev/bluetooth/bthidev.c:1.21 src/sys/dev/bluetooth/bthidev.c:1.22
--- src/sys/dev/bluetooth/bthidev.c:1.21 Wed Jan 11 17:27:45 2012
+++ src/sys/dev/bluetooth/bthidev.c Tue Apr 3 09:32:53 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: bthidev.c,v 1.21 2012/01/11 17:27:45 plunky Exp $ */
+/* $NetBSD: bthidev.c,v 1.22 2012/04/03 09:32:53 plunky Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bthidev.c,v 1.21 2012/01/11 17:27:45 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bthidev.c,v 1.22 2012/04/03 09:32:53 plunky Exp $");
#include <sys/param.h>
#include <sys/condvar.h>
@@ -330,6 +330,8 @@ bthidev_attach(device_t parent, device_t
}
}
+ pmf_device_register(self, NULL, NULL);
+
/*
* start bluetooth connections
*/
@@ -382,6 +384,8 @@ bthidev_detach(device_t self, int flags)
mutex_exit(bt_lock);
+ pmf_device_deregister(self);
+
/* kill off the input processor */
if (sc->sc_lwp != NULL) {
mutex_enter(&sc->sc_lock);
Index: src/sys/dev/bluetooth/bthub.c
diff -u src/sys/dev/bluetooth/bthub.c:1.17 src/sys/dev/bluetooth/bthub.c:1.18
--- src/sys/dev/bluetooth/bthub.c:1.17 Sun Jul 31 13:51:53 2011
+++ src/sys/dev/bluetooth/bthub.c Tue Apr 3 09:32:53 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: bthub.c,v 1.17 2011/07/31 13:51:53 uebayasi Exp $ */
+/* $NetBSD: bthub.c,v 1.18 2012/04/03 09:32:53 plunky Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bthub.c,v 1.17 2011/07/31 13:51:53 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bthub.c,v 1.18 2012/04/03 09:32:53 plunky Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -110,12 +110,16 @@ bthub_attach(device_t parent, device_t s
addr->b[2], addr->b[1], addr->b[0]);
aprint_normal("\n");
+
+ pmf_device_register(self, NULL, NULL);
}
static int
bthub_detach(device_t self, int flags)
{
+ pmf_device_deregister(self);
+
return config_detach_children(self, flags);
}
Index: src/sys/dev/bluetooth/btkbd.c
diff -u src/sys/dev/bluetooth/btkbd.c:1.13 src/sys/dev/bluetooth/btkbd.c:1.14
--- src/sys/dev/bluetooth/btkbd.c:1.13 Wed Jan 11 17:27:45 2012
+++ src/sys/dev/bluetooth/btkbd.c Tue Apr 3 09:32:53 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: btkbd.c,v 1.13 2012/01/11 17:27:45 plunky Exp $ */
+/* $NetBSD: btkbd.c,v 1.14 2012/04/03 09:32:53 plunky Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: btkbd.c,v 1.13 2012/01/11 17:27:45 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btkbd.c,v 1.14 2012/04/03 09:32:53 plunky Exp $");
#include <sys/param.h>
#include <sys/callout.h>
@@ -237,6 +237,8 @@ btkbd_attach(device_t parent, device_t s
wska.accesscookie = sc;
sc->sc_wskbd = config_found(self, &wska, wskbddevprint);
+
+ pmf_device_register(self, NULL, NULL);
}
static int
@@ -245,6 +247,8 @@ btkbd_detach(device_t self, int flags)
struct btkbd_softc *sc = device_private(self);
int err = 0;
+ pmf_device_deregister(self);
+
#ifdef WSDISPLAY_COMPAT_RAWKBD
#ifdef BTKBD_REPEAT
callout_stop(&sc->sc_repeat);
Index: src/sys/dev/bluetooth/btmagic.c
diff -u src/sys/dev/bluetooth/btmagic.c:1.1 src/sys/dev/bluetooth/btmagic.c:1.2
--- src/sys/dev/bluetooth/btmagic.c:1.1 Sat May 22 18:56:01 2010
+++ src/sys/dev/bluetooth/btmagic.c Tue Apr 3 09:32:53 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: btmagic.c,v 1.1 2010/05/22 18:56:01 plunky Exp $ */
+/* $NetBSD: btmagic.c,v 1.2 2012/04/03 09:32:53 plunky Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -85,7 +85,7 @@
*****************************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: btmagic.c,v 1.1 2010/05/22 18:56:01 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btmagic.c,v 1.2 2012/04/03 09:32:53 plunky Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -385,6 +385,8 @@ btmagic_attach(device_t parent, device_t
return;
}
+ pmf_device_register(self, NULL, NULL);
+
/*
* start bluetooth connections
*/
@@ -433,6 +435,8 @@ btmagic_detach(device_t self, int flags)
mutex_exit(bt_lock);
+ pmf_device_deregister(self);
+
sockopt_destroy(&sc->sc_mode);
sysctl_teardown(&sc->sc_log);
Index: src/sys/dev/bluetooth/btms.c
diff -u src/sys/dev/bluetooth/btms.c:1.9 src/sys/dev/bluetooth/btms.c:1.10
--- src/sys/dev/bluetooth/btms.c:1.9 Tue May 12 12:10:46 2009
+++ src/sys/dev/bluetooth/btms.c Tue Apr 3 09:32:53 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: btms.c,v 1.9 2009/05/12 12:10:46 cegger Exp $ */
+/* $NetBSD: btms.c,v 1.10 2012/04/03 09:32:53 plunky Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: btms.c,v 1.9 2009/05/12 12:10:46 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btms.c,v 1.10 2012/04/03 09:32:53 plunky Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -276,6 +276,8 @@ btms_attach(device_t parent, device_t se
wsma.accesscookie = sc;
sc->sc_wsmouse = config_found(self, &wsma, wsmousedevprint);
+
+ pmf_device_register(self, NULL, NULL);
}
static int
@@ -284,6 +286,8 @@ btms_detach(device_t self, int flags)
struct btms_softc *sc = device_private(self);
int err = 0;
+ pmf_device_deregister(self);
+
if (sc->sc_wsmouse != NULL) {
err = config_detach(sc->sc_wsmouse, flags);
sc->sc_wsmouse = NULL;
Index: src/sys/dev/bluetooth/btsco.c
diff -u src/sys/dev/bluetooth/btsco.c:1.27 src/sys/dev/bluetooth/btsco.c:1.28
--- src/sys/dev/bluetooth/btsco.c:1.27 Mon Mar 26 06:49:15 2012
+++ src/sys/dev/bluetooth/btsco.c Tue Apr 3 09:32:53 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: btsco.c,v 1.27 2012/03/26 06:49:15 mrg Exp $ */
+/* $NetBSD: btsco.c,v 1.28 2012/04/03 09:32:53 plunky Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: btsco.c,v 1.27 2012/03/26 06:49:15 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btsco.c,v 1.28 2012/04/03 09:32:53 plunky Exp $");
#include <sys/param.h>
#include <sys/audioio.h>
@@ -343,6 +343,8 @@ btsco_attach(device_t parent, device_t s
aprint_error_dev(self, "audio_attach_mi failed\n");
return;
}
+
+ pmf_device_register(self, NULL, NULL);
}
static int
@@ -352,6 +354,8 @@ btsco_detach(device_t self, int flags)
DPRINTF("sc=%p\n", sc);
+ pmf_device_deregister(self);
+
mutex_enter(bt_lock);
if (sc->sc_sco != NULL) {
DPRINTF("sc_sco=%p\n", sc->sc_sco);