Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/bluetooth register/deregister pmf(9) NULL handlers f...



details:   https://anonhg.NetBSD.org/src/rev/15dcf7ae8717
branches:  trunk
changeset: 778534:15dcf7ae8717
user:      plunky <plunky%NetBSD.org@localhost>
date:      Tue Apr 03 09:32:53 2012 +0000

description:
register/deregister pmf(9) NULL handlers for bthub(4) and
bluetooth devices which attach there, to fix PR/39006

diffstat:

 sys/dev/bluetooth/bthidev.c |  8 ++++++--
 sys/dev/bluetooth/bthub.c   |  8 ++++++--
 sys/dev/bluetooth/btkbd.c   |  8 ++++++--
 sys/dev/bluetooth/btmagic.c |  8 ++++++--
 sys/dev/bluetooth/btms.c    |  8 ++++++--
 sys/dev/bluetooth/btsco.c   |  8 ++++++--
 6 files changed, 36 insertions(+), 12 deletions(-)

diffs (215 lines):

diff -r 934d514a8d20 -r 15dcf7ae8717 sys/dev/bluetooth/bthidev.c
--- a/sys/dev/bluetooth/bthidev.c       Mon Apr 02 22:06:47 2012 +0000
+++ b/sys/dev/bluetooth/bthidev.c       Tue Apr 03 09:32:53 2012 +0000
@@ -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 @@
                }
        }
 
+       pmf_device_register(self, NULL, NULL);
+
        /*
         * start bluetooth connections
         */
@@ -382,6 +384,8 @@
 
        mutex_exit(bt_lock);
 
+       pmf_device_deregister(self);
+
        /* kill off the input processor */
        if (sc->sc_lwp != NULL) {
                mutex_enter(&sc->sc_lock);
diff -r 934d514a8d20 -r 15dcf7ae8717 sys/dev/bluetooth/bthub.c
--- a/sys/dev/bluetooth/bthub.c Mon Apr 02 22:06:47 2012 +0000
+++ b/sys/dev/bluetooth/bthub.c Tue Apr 03 09:32:53 2012 +0000
@@ -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 @@
                        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);
 }
 
diff -r 934d514a8d20 -r 15dcf7ae8717 sys/dev/bluetooth/btkbd.c
--- a/sys/dev/bluetooth/btkbd.c Mon Apr 02 22:06:47 2012 +0000
+++ b/sys/dev/bluetooth/btkbd.c Tue Apr 03 09:32:53 2012 +0000
@@ -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 @@
        wska.accesscookie = sc;
 
        sc->sc_wskbd = config_found(self, &wska, wskbddevprint);
+
+       pmf_device_register(self, NULL, NULL);
 }
 
 static int
@@ -245,6 +247,8 @@
        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);
diff -r 934d514a8d20 -r 15dcf7ae8717 sys/dev/bluetooth/btmagic.c
--- a/sys/dev/bluetooth/btmagic.c       Mon Apr 02 22:06:47 2012 +0000
+++ b/sys/dev/bluetooth/btmagic.c       Tue Apr 03 09:32:53 2012 +0000
@@ -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 @@
                return;
        }
 
+       pmf_device_register(self, NULL, NULL);
+
        /*
         * start bluetooth connections
         */
@@ -433,6 +435,8 @@
 
        mutex_exit(bt_lock);
 
+       pmf_device_deregister(self);
+
        sockopt_destroy(&sc->sc_mode);
 
        sysctl_teardown(&sc->sc_log);
diff -r 934d514a8d20 -r 15dcf7ae8717 sys/dev/bluetooth/btms.c
--- a/sys/dev/bluetooth/btms.c  Mon Apr 02 22:06:47 2012 +0000
+++ b/sys/dev/bluetooth/btms.c  Tue Apr 03 09:32:53 2012 +0000
@@ -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 @@
        wsma.accesscookie = sc;
 
        sc->sc_wsmouse = config_found(self, &wsma, wsmousedevprint);
+
+       pmf_device_register(self, NULL, NULL);
 }
 
 static int
@@ -284,6 +286,8 @@
        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;
diff -r 934d514a8d20 -r 15dcf7ae8717 sys/dev/bluetooth/btsco.c
--- a/sys/dev/bluetooth/btsco.c Mon Apr 02 22:06:47 2012 +0000
+++ b/sys/dev/bluetooth/btsco.c Tue Apr 03 09:32:53 2012 +0000
@@ -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 @@
                aprint_error_dev(self, "audio_attach_mi failed\n");
                return;
        }
+
+       pmf_device_register(self, NULL, NULL);
 }
 
 static int
@@ -352,6 +354,8 @@
 
        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);



Home | Main Index | Thread Index | Old Index