diff options
author | joerg <joerg@FreeBSD.org> | 1995-05-06 19:34:28 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1995-05-06 19:34:28 +0000 |
commit | 09a74d468d8a1a0c4e36cddb3053598075a3ebc4 (patch) | |
tree | baa17f4183a802c7a3c7ef1b60fc45fccab27343 /sys/i386/isa | |
parent | 9369e9783877d7da0269acf377e7651b9d634fcc (diff) | |
download | FreeBSD-src-09a74d468d8a1a0c4e36cddb3053598075a3ebc4.zip FreeBSD-src-09a74d468d8a1a0c4e36cddb3053598075a3ebc4.tar.gz |
Restructured the floppy tape probe.
The ``flags 1'' in the fdc line is now only needed for owners of an
Insight tape (perhaps there aren't any? Mine is disfunctional). All
other probes are safe wrt. to the motor-control line of floppy disk
drives. Document the flag in LINT finally.
Diffstat (limited to 'sys/i386/isa')
-rw-r--r-- | sys/i386/isa/fd.c | 8 | ||||
-rw-r--r-- | sys/i386/isa/ft.c | 35 |
2 files changed, 25 insertions, 18 deletions
diff --git a/sys/i386/isa/fd.c b/sys/i386/isa/fd.c index e573e83..86bcc55 100644 --- a/sys/i386/isa/fd.c +++ b/sys/i386/isa/fd.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.57 1995/04/12 20:47:41 wollman Exp $ + * $Id: fd.c,v 1.58 1995/04/20 03:17:44 julian Exp $ * */ @@ -53,9 +53,6 @@ #endif #include "fd.h" -/* Flags */ -#define FT_PROBE 0x1 - #if NFDC > 0 #include <sys/param.h> @@ -605,8 +602,7 @@ fdattach(struct isa_device *dev) unithasfd = 0; if (fdu < NFD && fd->type != NO_TYPE) unithasfd = 1; - if ((dev->id_flags & FT_PROBE) && - ftattach(dev, fdup, unithasfd)) + if (ftattach(dev, fdup, unithasfd)) continue; if (fdsu < DRVS_PER_CTLR) fd->type = NO_TYPE; diff --git a/sys/i386/isa/ft.c b/sys/i386/isa/ft.c index 9470fb9..f1dd370 100644 --- a/sys/i386/isa/ft.c +++ b/sys/i386/isa/ft.c @@ -17,7 +17,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * ft.c - QIC-40/80 floppy tape driver - * $Id: ft.c,v 1.19 1995/04/09 06:23:12 rgrimes Exp $ + * $Id: ft.c,v 1.20 1995/04/12 20:47:43 wollman Exp $ * * 01/19/95 ++sg * Cleaned up recalibrate/seek code at attach time for FreeBSD 2.x. @@ -104,6 +104,9 @@ extern int out_fdc(int, int); /* write fdc registers */ extern int hz; /* system clock rate */ +/* Flags in isadev struct */ +#define FT_PROBE 0x1 /* allow for "dangerous" tape probes */ + /* Type of tape attached */ /* use numbers that don't interfere with the possible floppy types */ #define NO_TYPE 0 /* (same as NO_TYPE in fd.c) */ @@ -494,21 +497,29 @@ ftattach(isadev, fdup, unithasfd) goto out; } - /* - * FT_INSIGHT - insight style - * - * Since insight requires turning the drive motor on, we will not - * perform this probe if a floppy drive was already found with the - * the given unit and controller. - */ - if (unithasfd) goto out; - tape_start(ftu, 1); - if (tape_status(ftu) >= 0) { + if(isadev->id_flags & FT_PROBE) { + /* + * Insight probe is dangerous, since it requires the motor being + * enabled and therefore risks attached floppy disk drives to jam. + * Probe only if explicitly requested by a flag 0x1 from config + */ + + /* + * FT_INSIGHT - insight style + * + * Since insight requires turning the drive motor on, we will not + * perform this probe if a floppy drive was already found with the + * the given unit and controller. + */ + if (unithasfd) goto out; + tape_start(ftu, 1); + if (tape_status(ftu) >= 0) { ft->type = FT_INSIGHT; ftreq_hwinfo(ftu, &hw); goto out; + } } - + out: tape_end(ftu); if (ft->type != NO_TYPE) { |