svn commit: r213635 - stable/8/sys/dev/sis
Pyun YongHyeon
yongari at FreeBSD.org
Fri Oct 8 23:11:46 UTC 2010
Author: yongari
Date: Fri Oct 8 23:11:46 2010
New Revision: 213635
URL: http://svn.freebsd.org/changeset/base/213635
Log:
MFC r212166:
Implement initial device suspend/resume method.
Modified:
stable/8/sys/dev/sis/if_sis.c
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
stable/8/sys/dev/xen/xenpci/ (props changed)
Modified: stable/8/sys/dev/sis/if_sis.c
==============================================================================
--- stable/8/sys/dev/sis/if_sis.c Fri Oct 8 23:01:38 2010 (r213634)
+++ stable/8/sys/dev/sis/if_sis.c Fri Oct 8 23:11:46 2010 (r213635)
@@ -2393,6 +2393,35 @@ sis_shutdown(device_t dev)
return (0);
}
+static int
+sis_suspend(device_t dev)
+{
+ struct sis_softc *sc;
+
+ sc = device_get_softc(dev);
+ SIS_LOCK(sc);
+ sis_stop(sc);
+ SIS_UNLOCK(sc);
+ return (0);
+}
+
+static int
+sis_resume(device_t dev)
+{
+ struct sis_softc *sc;
+ struct ifnet *ifp;
+
+ sc = device_get_softc(dev);
+ SIS_LOCK(sc);
+ ifp = sc->sis_ifp;
+ if ((ifp->if_flags & IFF_UP) != 0) {
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+ sis_initl(sc);
+ }
+ SIS_UNLOCK(sc);
+ return (0);
+}
+
static void
sis_add_sysctls(struct sis_softc *sc)
{
@@ -2425,6 +2454,8 @@ static device_method_t sis_methods[] = {
DEVMETHOD(device_attach, sis_attach),
DEVMETHOD(device_detach, sis_detach),
DEVMETHOD(device_shutdown, sis_shutdown),
+ DEVMETHOD(device_suspend, sis_suspend),
+ DEVMETHOD(device_resume, sis_resume),
/* bus interface */
DEVMETHOD(bus_print_child, bus_generic_print_child),
More information about the svn-src-stable
mailing list