diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-08-06 05:24:17 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-08-06 05:24:17 +0000 |
commit | 91da7e4b30336f80f8e4180d53861e117377c072 (patch) | |
tree | 3e1a77140ac3fc51066151eb2e6ee4e2586995a8 /sys | |
parent | 3906bdb8396930b9700cfef02940ee92e5dc1c64 (diff) |
ca_activate function for suspend/resume; tested by mlarkin
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_sis.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/sys/dev/pci/if_sis.c b/sys/dev/pci/if_sis.c index 335b274f697..2d80c46805a 100644 --- a/sys/dev/pci/if_sis.c +++ b/sys/dev/pci/if_sis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sis.c,v 1.98 2010/05/19 15:27:35 oga Exp $ */ +/* $OpenBSD: if_sis.c,v 1.99 2010/08/06 05:24:16 deraadt Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. @@ -104,9 +104,11 @@ int sis_probe(struct device *, void *, void *); void sis_attach(struct device *, struct device *, void *); +int sis_activate(struct device *, int); struct cfattach sis_ca = { - sizeof(struct sis_softc), sis_probe, sis_attach + sizeof(struct sis_softc), sis_probe, sis_attach, NULL, + sis_activate }; struct cfdriver sis_cd = { @@ -1151,6 +1153,27 @@ fail_1: bus_space_unmap(sc->sis_btag, sc->sis_bhandle, size); } +int +sis_activate(struct device *self, int act) +{ + struct sis_softc *sc = (struct sis_softc *)self; + struct ifnet *ifp = &sc->arpcom.ac_if; + + switch (act) { + case DVACT_SUSPEND: + if (ifp->if_flags & IFF_RUNNING) + sis_stop(sc); + config_activate_children(self, act); + break; + case DVACT_RESUME: + config_activate_children(self, act); + if (ifp->if_flags & IFF_UP) + sis_init(sc); + break; + } + return (0); +} + /* * Initialize the TX and RX descriptors and allocate mbufs for them. Note that * we arrange the descriptors in a closed ring, so that the last descriptor |