Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Added pmf hook.



details:   https://anonhg.NetBSD.org/src/rev/4c04c852b8fa
branches:  trunk
changeset: 337255:4c04c852b8fa
user:      nonaka <nonaka%NetBSD.org@localhost>
date:      Wed Apr 08 12:38:13 2015 +0000

description:
Added pmf hook.

diffstat:

 sys/dev/usb/if_axe.c  |  9 +++++++--
 sys/dev/usb/if_axen.c |  9 +++++++--
 sys/dev/usb/if_rum.c  |  9 +++++++--
 3 files changed, 21 insertions(+), 6 deletions(-)

diffs (112 lines):

diff -r 96920a4ac260 -r 4c04c852b8fa sys/dev/usb/if_axe.c
--- a/sys/dev/usb/if_axe.c      Wed Apr 08 12:29:42 2015 +0000
+++ b/sys/dev/usb/if_axe.c      Wed Apr 08 12:38:13 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_axe.c,v 1.67 2014/08/10 16:44:36 tls Exp $  */
+/*     $NetBSD: if_axe.c,v 1.68 2015/04/08 12:38:13 nonaka Exp $       */
 /*     $OpenBSD: if_axe.c,v 1.96 2010/01/09 05:33:08 jsg Exp $ */
 
 /*
@@ -89,7 +89,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.67 2014/08/10 16:44:36 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.68 2015/04/08 12:38:13 nonaka Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -852,6 +852,9 @@
        splx(s);
 
        usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->axe_udev, sc->axe_dev);
+
+       if (!pmf_device_register(self, NULL, NULL))
+               aprint_error_dev(self, "couldn't establish power handler\n");
 }
 
 int
@@ -867,6 +870,8 @@
        if (!sc->axe_attached)
                return 0;
 
+       pmf_device_deregister(self);
+
        sc->axe_dying = true;
 
        /*
diff -r 96920a4ac260 -r 4c04c852b8fa sys/dev/usb/if_axen.c
--- a/sys/dev/usb/if_axen.c     Wed Apr 08 12:29:42 2015 +0000
+++ b/sys/dev/usb/if_axen.c     Wed Apr 08 12:38:13 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_axen.c,v 1.4 2015/02/12 13:07:37 nonaka Exp $       */
+/*     $NetBSD: if_axen.c,v 1.5 2015/04/08 12:38:13 nonaka Exp $       */
 /*     $OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $ */
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.4 2015/02/12 13:07:37 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.5 2015/04/08 12:38:13 nonaka Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -803,6 +803,9 @@
        splx(s);
 
        usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->axen_udev,sc->axen_dev);
+
+       if (!pmf_device_register(self, NULL, NULL))
+               aprint_error_dev(self, "couldn't establish power handler\n");
 }
 
 static int
@@ -818,6 +821,8 @@
        if (!sc->axen_attached)
                return 0;
 
+       pmf_device_deregister(self);
+
        sc->axen_dying = true;
 
        /*
diff -r 96920a4ac260 -r 4c04c852b8fa sys/dev/usb/if_rum.c
--- a/sys/dev/usb/if_rum.c      Wed Apr 08 12:29:42 2015 +0000
+++ b/sys/dev/usb/if_rum.c      Wed Apr 08 12:38:13 2015 +0000
@@ -1,5 +1,5 @@
 /*     $OpenBSD: if_rum.c,v 1.40 2006/09/18 16:20:20 damien Exp $      */
-/*     $NetBSD: if_rum.c,v 1.49 2015/01/07 07:05:48 ozaki-r Exp $      */
+/*     $NetBSD: if_rum.c,v 1.50 2015/04/08 12:38:13 nonaka Exp $       */
 
 /*-
  * Copyright (c) 2005-2007 Damien Bergamini <damien.bergamini%free.fr@localhost>
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.49 2015/01/07 07:05:48 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.50 2015/04/08 12:38:13 nonaka Exp $");
 
 #include <sys/param.h>
 #include <sys/sockio.h>
@@ -483,6 +483,9 @@
        usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
            sc->sc_dev);
 
+       if (!pmf_device_register(self, NULL, NULL))
+               aprint_error_dev(self, "couldn't establish power handler\n");
+
        return;
 }
 
@@ -497,6 +500,8 @@
        if (!ifp->if_softc)
                return 0;
 
+       pmf_device_deregister(self);
+
        s = splusb();
 
        rum_stop(ifp, 1);



Home | Main Index | Thread Index | Old Index