From owner-svn-src-stable@FreeBSD.ORG  Fri Oct  8 23:11:46 2010
Return-Path: <owner-svn-src-stable@FreeBSD.ORG>
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 86CFA106564A;
	Fri,  8 Oct 2010 23:11:46 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 76A508FC18;
	Fri,  8 Oct 2010 23:11:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o98NBkIh017214;
	Fri, 8 Oct 2010 23:11:46 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98NBk6t017212;
	Fri, 8 Oct 2010 23:11:46 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201010082311.o98NBk6t017212@svn.freebsd.org>
From: Pyun YongHyeon <yongari@FreeBSD.org>
Date: Fri, 8 Oct 2010 23:11:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r213635 - stable/8/sys/dev/sis
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	<svn-src-stable.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable>, 
	<mailto:svn-src-stable-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-stable>
List-Post: <mailto:svn-src-stable@freebsd.org>
List-Help: <mailto:svn-src-stable-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable>,
	<mailto:svn-src-stable-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 08 Oct 2010 23:11:46 -0000

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),