Add new flag VGE_FLAG_SUSPENDED to mark suspended state and

remove suspended member in softc.
This commit is contained in:
Pyun YongHyeon 2009-12-16 19:49:23 +00:00
parent 7129fb20d6
commit a931e5497b
2 changed files with 6 additions and 11 deletions

View File

@ -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);

View File

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