summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2010-07-27 20:53:40 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2010-07-27 20:53:40 +0000
commitf5caf2c16280a2b1985558d8994986806a099b74 (patch)
tree0b392d2effc32e427184bbe9053794ce4d0769ad
parente6d9feefb68413d560afe2038d382a45a852a4ea (diff)
Make sure we stop DMA before we suspend. Remove unused argument to re_stop()
to avoid the dilemma what meaningless value to pass. ok deraadt@
-rw-r--r--sys/dev/ic/re.c8
-rw-r--r--sys/dev/ic/revar.h4
-rw-r--r--sys/dev/pci/if_re_pci.c6
3 files changed, 10 insertions, 8 deletions
diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c
index ecd58ce86be..0cc77f7c519 100644
--- a/sys/dev/ic/re.c
+++ b/sys/dev/ic/re.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: re.c,v 1.123 2010/07/14 19:24:27 naddy Exp $ */
+/* $OpenBSD: re.c,v 1.124 2010/07/27 20:53:39 kettenis Exp $ */
/* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */
/*
* Copyright (c) 1997, 1998-2003
@@ -1942,7 +1942,7 @@ re_init(struct ifnet *ifp)
/*
* Cancel pending I/O and free all RX/TX buffers.
*/
- re_stop(ifp, 0);
+ re_stop(ifp);
/*
* Enable C+ RX and TX mode, as well as RX checksum offload.
@@ -2118,7 +2118,7 @@ re_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
re_init(ifp);
} else {
if (ifp->if_flags & IFF_RUNNING)
- re_stop(ifp, 1);
+ re_stop(ifp);
}
break;
case SIOCGIFMEDIA:
@@ -2163,7 +2163,7 @@ re_watchdog(struct ifnet *ifp)
* RX and TX lists.
*/
void
-re_stop(struct ifnet *ifp, int disable)
+re_stop(struct ifnet *ifp)
{
struct rl_softc *sc;
int i;
diff --git a/sys/dev/ic/revar.h b/sys/dev/ic/revar.h
index ba96758a6fd..971a4da8c88 100644
--- a/sys/dev/ic/revar.h
+++ b/sys/dev/ic/revar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: revar.h,v 1.6 2009/11/24 17:40:43 kettenis Exp $ */
+/* $OpenBSD: revar.h,v 1.7 2010/07/27 20:53:39 kettenis Exp $ */
/*
* Copyright (c) 2005 Peter Valchev <pvalchev@openbsd.org>
@@ -20,4 +20,4 @@ int re_intr(void *);
int re_attach(struct rl_softc *, const char *);
void re_reset(struct rl_softc *);
int re_init(struct ifnet *);
-void re_stop(struct ifnet *, int);
+void re_stop(struct ifnet *);
diff --git a/sys/dev/pci/if_re_pci.c b/sys/dev/pci/if_re_pci.c
index 34011c517b4..9588b64972e 100644
--- a/sys/dev/pci/if_re_pci.c
+++ b/sys/dev/pci/if_re_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_re_pci.c,v 1.27 2009/11/26 00:12:31 kettenis Exp $ */
+/* $OpenBSD: if_re_pci.c,v 1.28 2010/07/27 20:53:39 kettenis Exp $ */
/*
* Copyright (c) 2005 Peter Valchev <pvalchev@openbsd.org>
@@ -249,10 +249,12 @@ re_pci_activate(struct device *self, int act)
switch(act) {
case DVACT_SUSPEND:
+ if (ifp->if_flags & IFF_RUNNING)
+ re_stop(ifp);
break;
case DVACT_RESUME:
re_reset(sc);
- if (ifp->if_flags & IFF_RUNNING)
+ if (ifp->if_flags & IFF_UP)
re_init(ifp);
break;
}