mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
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 <steve2@genesis.tiac.net>
This commit is contained in:
parent
d31b19afb1
commit
74fa89f4f5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=7643
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -17,7 +17,10 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ft.c - QIC-40/80 floppy tape driver
|
||||
* $Id: ft.c,v 1.16 1995/03/26 19:28:22 rgrimes Exp $
|
||||
* $Id: ft.c,v 1.17 1995/03/28 07:55:26 bde Exp $
|
||||
*
|
||||
* 01/19/95 ++sg
|
||||
* Cleaned up recalibrate/seek code at attach time for FreeBSD 2.x.
|
||||
*
|
||||
* 06/07/94 v0.9 ++sg
|
||||
* Tape stuck on segment problem should be gone. Re-wrote buffering
|
||||
@ -433,8 +436,9 @@ ft_externalize(struct proc *p, struct kern_devconf *kdc, void *userp,
|
||||
* Probe/attach floppy tapes.
|
||||
*/
|
||||
int
|
||||
ftattach(isadev, fdup)
|
||||
ftattach(isadev, fdup, unithasfd)
|
||||
struct isa_device *isadev, *fdup;
|
||||
int unithasfd;
|
||||
{
|
||||
fdcu_t fdcu = isadev->id_unit; /* fdc active unit */
|
||||
fdc_p fdc = fdc_data + fdcu; /* pointer to controller structure */
|
||||
@ -491,7 +495,12 @@ ftattach(isadev, fdup)
|
||||
|
||||
/*
|
||||
* 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;
|
||||
@ -1470,15 +1479,16 @@ ftintr_wait(ftu_t ftu, int cmd, int ticks)
|
||||
case FTCMD_RECAL:
|
||||
case FTCMD_SEEK:
|
||||
for (retries = 0; retries < 10000; retries++) {
|
||||
DELAY(100);
|
||||
out_fdc(fdcu, NE7CMD_SENSEI);
|
||||
st0 = in_fdc(fdcu);
|
||||
if ((st0 & 0xc0) == 0x80) continue;
|
||||
pcn = in_fdc(fdcu);
|
||||
if (st0 & 0x20) {
|
||||
ft->sts_wait = FTSTS_INTERRUPT;
|
||||
ft->pcn = pcn;
|
||||
goto intrdone;
|
||||
}
|
||||
DELAY(100);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1665,6 +1675,7 @@ tape_start(ftu_t ftu, int motor)
|
||||
ft_p ft = &ft_data[ftu];
|
||||
fdc_p fdc = ft->fdc;
|
||||
int s, mbits;
|
||||
static int mbmotor[] = { FDO_MOEN0, FDO_MOEN1, FDO_MOEN2, FDO_MOEN3 };
|
||||
|
||||
s = splbio();
|
||||
DPRT(("tape_start start\n"));
|
||||
@ -1674,10 +1685,9 @@ tape_start(ftu_t ftu, int motor)
|
||||
(void)ftintr_wait(ftu, FTCMD_RESET, hz/10);
|
||||
|
||||
/* raise reset, enable DMA, motor on if needed */
|
||||
if (motor)
|
||||
mbits = (!ftu) ? FDO_MOEN0 : FDO_MOEN1;
|
||||
else
|
||||
mbits = 0;
|
||||
mbits = ftu & 3;
|
||||
if (motor && ftu < 4)
|
||||
mbits |= mbmotor[ftu];
|
||||
|
||||
outb(fdc->baseport+FDOUT, FDO_FRST | FDO_FDMAEN | mbits);
|
||||
(void)ftintr_wait(ftu, FTCMD_RESET, hz/10);
|
||||
|
15
sys/isa/fd.c
15
sys/isa/fd.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;
|
||||
|
Loading…
Reference in New Issue
Block a user