From 74fa89f4f54bd5c6f8daba3ccfc6bb48f8878dd8 Mon Sep 17 00:00:00 2001 From: "Rodney W. Grimes" Date: Thu, 6 Apr 1995 07:20:16 +0000 Subject: Correct recalibrate/seek code at attach time so that we do not get all the ``fdc0: ready for output in input'' messages when probing for ft devices. Submitted by: Steve Gerakines --- sys/dev/fdc/fdc.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index 8330f4fde0ab..9a6816f189b7 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.54 1995/03/16 18:11:59 bde Exp $ + * $Id: fd.c,v 1.55 1995/03/26 19:28:18 rgrimes Exp $ * */ @@ -262,7 +262,7 @@ void ftstrategy(struct buf *); int ftioctl(dev_t, int, caddr_t, int, struct proc *); int ftdump(dev_t); int ftsize(dev_t); -int ftattach(struct isa_device *, struct isa_device *); +int ftattach(struct isa_device *, struct isa_device *, int); #endif /* autoconfig functions */ @@ -549,7 +549,7 @@ fdattach(struct isa_device *dev) fdcu_t fdcu = dev->id_unit; fdc_p fdc = fdc_data + fdcu; fd_p fd; - int fdsu, st0, st3, i; + int fdsu, st0, st3, i, unithasfd; struct isa_device *fdup; int ic_type = 0; @@ -591,7 +591,14 @@ fdattach(struct isa_device *dev) #if NFT > 0 /* If BIOS says no floppy, or > 2nd device */ /* Probe for and attach a floppy tape. */ - if ((dev->id_flags & FT_PROBE) && ftattach(dev, fdup)) + /* Tell FT if there was already a disk */ + /* with this unit number found. */ + + unithasfd = 0; + if (fdu < NFD && fd->type != NO_TYPE) + unithasfd = 1; + if ((dev->id_flags & FT_PROBE) && + ftattach(dev, fdup, unithasfd)) continue; if (fdsu < DRVS_PER_CTLR) fd->type = NO_TYPE; -- cgit v1.3