Module Name:    src
Committed By:   nonaka
Date:           Wed Apr  8 12:38:13 UTC 2015

Modified Files:
        src/sys/dev/usb: if_axe.c if_axen.c if_rum.c

Log Message:
Added pmf hook.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/usb/if_rum.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/usb/if_axe.c
diff -u src/sys/dev/usb/if_axe.c:1.67 src/sys/dev/usb/if_axe.c:1.68
--- src/sys/dev/usb/if_axe.c:1.67	Sun Aug 10 16:44:36 2014
+++ src/sys/dev/usb/if_axe.c	Wed Apr  8 12:38:13 2015
@@ -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 @@ axe_attach(device_t parent, device_t sel
 	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 @@ axe_detach(device_t self, int flags)
 	if (!sc->axe_attached)
 		return 0;
 
+	pmf_device_deregister(self);
+
 	sc->axe_dying = true;
 
 	/*

Index: src/sys/dev/usb/if_axen.c
diff -u src/sys/dev/usb/if_axen.c:1.4 src/sys/dev/usb/if_axen.c:1.5
--- src/sys/dev/usb/if_axen.c:1.4	Thu Feb 12 13:07:37 2015
+++ src/sys/dev/usb/if_axen.c	Wed Apr  8 12:38:13 2015
@@ -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 @@ axen_attach(device_t parent, device_t se
 	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 @@ axen_detach(device_t self, int flags)
 	if (!sc->axen_attached)
 		return 0;
 
+	pmf_device_deregister(self);
+
 	sc->axen_dying = true;
 
 	/*

Index: src/sys/dev/usb/if_rum.c
diff -u src/sys/dev/usb/if_rum.c:1.49 src/sys/dev/usb/if_rum.c:1.50
--- src/sys/dev/usb/if_rum.c:1.49	Wed Jan  7 07:05:48 2015
+++ src/sys/dev/usb/if_rum.c	Wed Apr  8 12:38:13 2015
@@ -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.bergam...@free.fr>
@@ -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 @@ rum_attach(device_t parent, device_t sel
 	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 @@ rum_detach(device_t self, int flags)
 	if (!ifp->if_softc)
 		return 0;
 
+	pmf_device_deregister(self);
+
 	s = splusb();
 
 	rum_stop(ifp, 1);

Reply via email to