diff options
| author | Attilio Rao <attilio@FreeBSD.org> | 2010-09-15 14:24:21 +0000 |
|---|---|---|
| committer | Attilio Rao <attilio@FreeBSD.org> | 2010-09-15 14:24:21 +0000 |
| commit | 04f798ecea0d726407db6fe9435cf10852eee4af (patch) | |
| tree | dfe56a0618424f9d7219c9f0cbd2ef0b62fb9d2d /sys/dev/aac | |
| parent | 89d10571dbd835a79c96ba9a6de5b8607c234295 (diff) | |
Notes
Diffstat (limited to 'sys/dev/aac')
| -rw-r--r-- | sys/dev/aac/aac.c | 13 | ||||
| -rw-r--r-- | sys/dev/aac/aacvar.h | 3 |
2 files changed, 4 insertions, 12 deletions
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c index 36996177738a..4ff1640ab840 100644 --- a/sys/dev/aac/aac.c +++ b/sys/dev/aac/aac.c @@ -212,7 +212,7 @@ static struct aac_mntinforesp * static struct cdevsw aac_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, + .d_flags = D_NEEDGIANT | D_TRACKCLOSE, .d_open = aac_open, .d_close = aac_close, .d_ioctl = aac_ioctl, @@ -660,9 +660,6 @@ aac_detach(device_t dev) sc = device_get_softc(dev); fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - if (sc->aac_state & AAC_STATE_OPEN) - return(EBUSY); - callout_drain(&sc->aac_daemontime); /* Remove the child containers */ @@ -2804,8 +2801,7 @@ aac_open(struct cdev *dev, int flags, int fmt, struct thread *td) sc = dev->si_drv1; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - sc->aac_open_cnt++; - sc->aac_state |= AAC_STATE_OPEN; + device_busy(sc->aac_dev); return 0; } @@ -2817,10 +2813,7 @@ aac_close(struct cdev *dev, int flags, int fmt, struct thread *td) sc = dev->si_drv1; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - sc->aac_open_cnt--; - /* Mark this unit as no longer open */ - if (sc->aac_open_cnt == 0) - sc->aac_state &= ~AAC_STATE_OPEN; + device_unbusy(sc->aac_dev); return 0; } diff --git a/sys/dev/aac/aacvar.h b/sys/dev/aac/aacvar.h index 29eb8169e02d..192616b34ded 100644 --- a/sys/dev/aac/aacvar.h +++ b/sys/dev/aac/aacvar.h @@ -319,10 +319,9 @@ struct aac_softc /* controller features, limits and status */ int aac_state; #define AAC_STATE_SUSPEND (1<<0) -#define AAC_STATE_OPEN (1<<1) +#define AAC_STATE_UNUSED0 (1<<1) #define AAC_STATE_INTERRUPTS_ON (1<<2) #define AAC_STATE_AIF_SLEEPER (1<<3) - int aac_open_cnt; struct FsaRevision aac_revision; /* controller hardware interface */ |
