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.
This commit is contained in:
Yaroslav Tykhiy 2003-06-16 08:42:20 +00:00
parent e47e35e61b
commit 62cc1e0584
2 changed files with 14 additions and 2 deletions

View File

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

View File

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