Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/1dca2600ce00
branches:  trunk
changeset: 807396:1dca2600ce00
user:      nonaka <nonaka%NetBSD.org@localhost>
date:      Wed Apr 08 12:29:42 2015 +0000

description:
Add pmf hook.

fix PR/49783 USB WiFi ural0 rejects hw.acpi.sleep.state=3.

diffstat:

 sys/dev/usb/if_ural.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r 7a1b5905ff3c -r 1dca2600ce00 sys/dev/usb/if_ural.c
--- a/sys/dev/usb/if_ural.c     Wed Apr 08 12:07:40 2015 +0000
+++ b/sys/dev/usb/if_ural.c     Wed Apr 08 12:29:42 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ural.c,v 1.44 2013/01/22 12:40:43 jmcneill Exp $ */
+/*     $NetBSD: if_ural.c,v 1.45 2015/04/08 12:29:42 nonaka Exp $ */
 /*     $FreeBSD: /repoman/r/ncvs/src/sys/dev/usb/if_ural.c,v 1.40 2006/06/02 23:14:40 sam Exp $        */
 
 /*-
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ural.c,v 1.44 2013/01/22 12:40:43 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ural.c,v 1.45 2015/04/08 12:29:42 nonaka Exp $");
 
 #include <sys/param.h>
 #include <sys/sockio.h>
@@ -524,6 +524,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;
 }
 
@@ -535,6 +538,8 @@
        struct ifnet *ifp = &sc->sc_if;
        int s;
 
+       pmf_device_deregister(self);
+
        s = splusb();
 
        ural_stop(ifp, 1);



Home | Main Index | Thread Index | Old Index