From owner-svn-src-stable@FreeBSD.ORG Fri Oct 8 23:14:21 2010 Return-Path: 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 BC57D106564A; Fri, 8 Oct 2010 23:14:21 +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 AC2238FC0A; Fri, 8 Oct 2010 23:14:21 +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 o98NELWH017305; Fri, 8 Oct 2010 23:14:21 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o98NELFE017303; Fri, 8 Oct 2010 23:14:21 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010082314.o98NELFE017303@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Oct 2010 23:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213636 - stable/7/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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2010 23:14:21 -0000 Author: yongari Date: Fri Oct 8 23:14:21 2010 New Revision: 213636 URL: http://svn.freebsd.org/changeset/base/213636 Log: MFC r212166: Implement initial device suspend/resume method. Modified: stable/7/sys/dev/sis/if_sis.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sis/if_sis.c ============================================================================== --- stable/7/sys/dev/sis/if_sis.c Fri Oct 8 23:11:46 2010 (r213635) +++ stable/7/sys/dev/sis/if_sis.c Fri Oct 8 23:14:21 2010 (r213636) @@ -2388,6 +2388,35 @@ sis_shutdown(device_t dev) SIS_UNLOCK(sc); } +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) { @@ -2420,6 +2449,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),