summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2009-12-16 19:49:23 +0000
committeryongari <yongari@FreeBSD.org>2009-12-16 19:49:23 +0000
commite75eb0a487d2085779334965fa65491da48d96a3 (patch)
tree087cff1af8ab31c3de2342895c48d11b9da24b75
parentc57b5821c5df257bc7690f292a2e5c478565273d (diff)
downloadFreeBSD-src-e75eb0a487d2085779334965fa65491da48d96a3.zip
FreeBSD-src-e75eb0a487d2085779334965fa65491da48d96a3.tar.gz
Add new flag VGE_FLAG_SUSPENDED to mark suspended state and
remove suspended member in softc.
-rw-r--r--sys/dev/vge/if_vge.c14
-rw-r--r--sys/dev/vge/if_vgevar.h3
2 files changed, 6 insertions, 11 deletions
diff --git a/sys/dev/vge/if_vge.c b/sys/dev/vge/if_vge.c
index be785c1..d581357 100644
--- a/sys/dev/vge/if_vge.c
+++ b/sys/dev/vge/if_vge.c
@@ -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);
diff --git a/sys/dev/vge/if_vgevar.h b/sys/dev/vge/if_vgevar.h
index f622250..105dd72 100644
--- a/sys/dev/vge/if_vgevar.h
+++ b/sys/dev/vge/if_vgevar.h
@@ -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)
OpenPOWER on IntegriCloud