diff options
author | yar <yar@FreeBSD.org> | 2003-06-16 08:42:20 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2003-06-16 08:42:20 +0000 |
commit | 2efdcd558c180476006bb5886c13e6f094b4cf32 (patch) | |
tree | 3965153c5f651509fad5004a6b2e0cdabaa40538 /sys/isa | |
parent | d30e2638a51d8f802f0719a0f8f03f00463b0c6a (diff) | |
download | FreeBSD-src-2efdcd558c180476006bb5886c13e6f094b4cf32.zip FreeBSD-src-2efdcd558c180476006bb5886c13e6f094b4cf32.tar.gz |
Force media autodetection if the device has lost its parameter table.
Previously, any normal I/O on an fdc(4) device would fail with ENXIO
if the device had been opened in non-blocking mode and then closed
prior to the conventional access; that would last until the floppy
disk was ejected and re-inserted to raise the unit attention condition.
Add a clarifying comment.
Diffstat (limited to 'sys/isa')
-rw-r--r-- | sys/isa/fd.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/isa/fd.c b/sys/isa/fd.c index 7599392..7d30d8f 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -1588,6 +1588,11 @@ Fdopen(dev_t dev, int flags, int mode, struct thread *td) * * If UA has been forced, proceed. * + * If the drive has no changeline support, + * or if the drive parameters have been lost + * due to previous non-blocking access, + * assume a forced UA condition. + * * If motor is off, turn it on for a moment * and select our drive, in order to read the * UA hardware signal. @@ -1603,7 +1608,8 @@ Fdopen(dev_t dev, int flags, int mode, struct thread *td) */ unitattn = 0; if ((dflags & FD_NO_CHLINE) != 0 || - (fd->flags & FD_UA) != 0) { + (fd->flags & FD_UA) != 0 || + fd->ft == 0) { unitattn = 1; fd->flags &= ~FD_UA; } else if (fdc->fdout & (FDO_MOEN0 | FDO_MOEN1 | |