Module Name: src
Committed By: nat
Date: Wed Oct 12 02:50:44 UTC 2016
Modified Files:
src/sys/dev/usb: if_urtwn.c
Log Message:
Stop urtwn devices from usb suspend, allow remote wifi activity wakeup.
Addresses PR/51111.
OK christos@
To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/usb/if_urtwn.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_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.46 src/sys/dev/usb/if_urtwn.c:1.47
--- src/sys/dev/usb/if_urtwn.c:1.46 Tue Oct 4 21:36:38 2016
+++ src/sys/dev/usb/if_urtwn.c Wed Oct 12 02:50:44 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: if_urtwn.c,v 1.46 2016/10/04 21:36:38 christos Exp $ */
+/* $NetBSD: if_urtwn.c,v 1.47 2016/10/12 02:50:44 nat Exp $ */
/* $OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $ */
/*-
@@ -23,7 +23,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.46 2016/10/04 21:36:38 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.47 2016/10/12 02:50:44 nat Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -318,6 +318,7 @@ urtwn_attach(device_t parent, device_t s
struct usb_attach_arg *uaa = aux;
char *devinfop;
const struct urtwn_dev *dev;
+ usb_device_request_t req;
size_t i;
int error;
@@ -338,6 +339,14 @@ urtwn_attach(device_t parent, device_t s
aprint_normal_dev(self, "%s\n", devinfop);
usbd_devinfo_free(devinfop);
+ req.bmRequestType = UT_WRITE_DEVICE;
+ req.bRequest = UR_SET_FEATURE;
+ USETW(req.wValue, UF_DEVICE_REMOTE_WAKEUP);
+ USETW(req.wIndex, UHF_PORT_SUSPEND);
+ USETW(req.wLength, 0);
+
+ (void) usbd_do_request(sc->sc_udev, &req, 0);
+
mutex_init(&sc->sc_task_mtx, MUTEX_DEFAULT, IPL_NET);
mutex_init(&sc->sc_tx_mtx, MUTEX_DEFAULT, IPL_NONE);
mutex_init(&sc->sc_fwcmd_mtx, MUTEX_DEFAULT, IPL_NONE);