Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Oct 2010 23:11:46 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r213635 - stable/8/sys/dev/sis
Message-ID:  <201010082311.o98NBk6t017212@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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),



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010082311.o98NBk6t017212>