From owner-svn-src-all@FreeBSD.ORG Wed Dec 16 19:49:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A12BE1065676; Wed, 16 Dec 2009 19:49:23 +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 9067E8FC1C; Wed, 16 Dec 2009 19:49:23 +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 nBGJnNYq009029; Wed, 16 Dec 2009 19:49:23 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBGJnNJ9009026; Wed, 16 Dec 2009 19:49:23 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912161949.nBGJnNJ9009026@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 16 Dec 2009 19:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200616 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2009 19:49:23 -0000 Author: yongari Date: Wed Dec 16 19:49:23 2009 New Revision: 200616 URL: http://svn.freebsd.org/changeset/base/200616 Log: Add new flag VGE_FLAG_SUSPENDED to mark suspended state and remove suspended member in softc. Modified: head/sys/dev/vge/if_vge.c head/sys/dev/vge/if_vgevar.h Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Wed Dec 16 19:41:40 2009 (r200615) +++ head/sys/dev/vge/if_vge.c Wed Dec 16 19:49:23 2009 (r200616) @@ -1728,15 +1728,11 @@ vge_intr(void *arg) uint32_t status; sc = arg; - - if (sc->suspended) { - return; - } - VGE_LOCK(sc); - ifp = sc->vge_ifp; - if (!(ifp->if_flags & IFF_UP)) { + ifp = sc->vge_ifp; + if ((sc->vge_flags & VGE_FLAG_SUSPENDED) != 0 || + (ifp->if_flags & IFF_UP) == 0) { VGE_UNLOCK(sc); return; } @@ -2430,7 +2426,7 @@ vge_suspend(device_t dev) VGE_LOCK(sc); vge_stop(sc); - sc->suspended = 1; + sc->vge_flags |= VGE_FLAG_SUSPENDED; VGE_UNLOCK(sc); return (0); @@ -2460,7 +2456,7 @@ vge_resume(device_t dev) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vge_init_locked(sc); } - sc->suspended = 0; + sc->vge_flags &= ~VGE_FLAG_SUSPENDED; VGE_UNLOCK(sc); return (0); Modified: head/sys/dev/vge/if_vgevar.h ============================================================================== --- head/sys/dev/vge/if_vgevar.h Wed Dec 16 19:41:40 2009 (r200615) +++ head/sys/dev/vge/if_vgevar.h Wed Dec 16 19:49:23 2009 (r200616) @@ -179,6 +179,7 @@ struct vge_softc { int vge_flags; #define VGE_FLAG_PCIE 0x0001 #define VGE_FLAG_MSI 0x0002 +#define VGE_FLAG_SUSPENDED 0x4000 #define VGE_FLAG_LINK 0x8000 int vge_expcap; int vge_camidx; @@ -189,8 +190,6 @@ struct vge_softc { struct vge_chain_data vge_cdata; struct vge_ring_data vge_rdata; struct vge_hw_stats vge_stats; - - int suspended; /* 0 = normal 1 = suspended */ }; #define VGE_LOCK(_sc) mtx_lock(&(_sc)->vge_mtx)