Module Name: src
Committed By: nonaka
Date: Wed Apr 8 12:29:42 UTC 2015
Modified Files:
src/sys/dev/usb: if_ural.c
Log Message:
Add pmf hook.
fix PR/49783 USB WiFi ural0 rejects hw.acpi.sleep.state=3.
To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/usb/if_ural.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_ural.c
diff -u src/sys/dev/usb/if_ural.c:1.44 src/sys/dev/usb/if_ural.c:1.45
--- src/sys/dev/usb/if_ural.c:1.44 Tue Jan 22 12:40:43 2013
+++ src/sys/dev/usb/if_ural.c Wed Apr 8 12:29:42 2015
@@ -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 @@ ural_attach(device_t parent, device_t se
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 @@ ural_detach(device_t self, int flags)
struct ifnet *ifp = &sc->sc_if;
int s;
+ pmf_device_deregister(self);
+
s = splusb();
ural_stop(ifp, 1);