Date: Wed, 16 Dec 2009 19:49:23 +0000 (UTC) From: Pyun YongHyeon <yongari@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r200616 - head/sys/dev/vge Message-ID: <200912161949.nBGJnNJ9009026@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912161949.nBGJnNJ9009026>