summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2009-11-24 17:40:44 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2009-11-24 17:40:44 +0000
commitfe4dbca5b913f33b1391b68389884d8516ce85f5 (patch)
tree9396ce4fd19f37ca9be80af1bfb3c4d30cd4b380 /sys/dev/pci
parent521eb75d16273199008aaca90db306e2b376f246 (diff)
Reset the chip an re-initialise the interface after reset. Resetting the
PHY doesn't seem to be necessary on re(4) so don't descend further for now. Based on a diff from mlarkin@ ok deraadt@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_re_pci.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/sys/dev/pci/if_re_pci.c b/sys/dev/pci/if_re_pci.c
index 0e2a0ade841..89f7a2d9c1c 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.25 2009/08/10 20:29:52 deraadt Exp $ */
+/* $OpenBSD: if_re_pci.c,v 1.26 2009/11/24 17:40:43 kettenis Exp $ */
/*
* Copyright (c) 2005 Peter Valchev <pvalchev@openbsd.org>
@@ -81,6 +81,7 @@ const struct pci_matchid re_pci_devices[] = {
int re_pci_probe(struct device *, void *, void *);
void re_pci_attach(struct device *, struct device *, void *);
int re_pci_detach(struct device *, int);
+int re_pci_activate(struct device *, int);
/*
* PCI autoconfig definitions
@@ -89,7 +90,8 @@ struct cfattach re_pci_ca = {
sizeof(struct re_pci_softc),
re_pci_probe,
re_pci_attach,
- re_pci_detach
+ re_pci_detach,
+ re_pci_activate
};
/*
@@ -237,3 +239,22 @@ re_pci_detach(struct device *self, int flags)
return (0);
}
+
+int
+re_pci_activate(struct device *self, int act)
+{
+ struct re_pci_softc *psc = (struct re_pci_softc *)self;
+ struct rl_softc *sc = &psc->sc_rl;
+ struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+
+ switch(act) {
+ case DVACT_SUSPEND:
+ break;
+ case DVACT_RESUME:
+ re_reset(sc);
+ re_init(ifp);
+ break;
+ }
+
+ return (0);
+}