summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2010-08-12 14:21:55 +0000
committerkettenis <kettenis@openbsd.org>2010-08-12 14:21:55 +0000
commitc22e77f10ab7b61fd01e5157c0dbfe618e7ea21f (patch)
treecaa1eb33c90f44e2740bb38ce9b970617b63600f /sys/dev/pci
parentmake fgetln fixups look like the man page. correct a pair of brances and (diff)
downloadwireguard-openbsd-c22e77f10ab7b61fd01e5157c0dbfe618e7ea21f.tar.xz
wireguard-openbsd-c22e77f10ab7b61fd01e5157c0dbfe618e7ea21f.zip
Reset the chip upon suspend, to make sure it stops DMA. Reset it again upon
resume to make sure the chip is initialized the same way as upon attach. Fixes memory corruption after resume on the Dell Inspirion 4150. ok deraadt@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_xl_pci.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/pci/if_xl_pci.c b/sys/dev/pci/if_xl_pci.c
index c01e9ea77c4..15bc79c4700 100644
--- a/sys/dev/pci/if_xl_pci.c
+++ b/sys/dev/pci/if_xl_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_xl_pci.c,v 1.30 2010/08/06 02:45:54 deraadt Exp $ */
+/* $OpenBSD: if_xl_pci.c,v 1.31 2010/08/12 14:21:55 kettenis Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -346,11 +346,14 @@ xl_pci_activate(struct device *self, int act)
switch (act) {
case DVACT_SUSPEND:
- if (ifp->if_flags & IFF_RUNNING)
+ if (ifp->if_flags & IFF_RUNNING) {
+ xl_reset(sc);
xl_stop(sc);
+ }
config_activate_children(self, act);
break;
case DVACT_RESUME:
+ xl_reset(sc);
config_activate_children(self, act);
if (ifp->if_flags & IFF_UP)
xl_init(sc);