diff options
author | phk <phk@FreeBSD.org> | 1996-05-03 14:57:27 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1996-05-03 14:57:27 +0000 |
commit | 0e9ca345407e1cf074c1b9f705b0113449bf5315 (patch) | |
tree | b13d0dfcde55a10a9fa26328d1206db32729183a /sys/isa | |
parent | 50f75723854dcb4ccc7c14b49e8717b10a29f99c (diff) | |
download | FreeBSD-src-0e9ca345407e1cf074c1b9f705b0113449bf5315.zip FreeBSD-src-0e9ca345407e1cf074c1b9f705b0113449bf5315.tar.gz |
Move from the old buf.b_actf to the new TAILQ(buf.b_act).
Diffstat (limited to 'sys/isa')
-rw-r--r-- | sys/isa/fd.c | 29 | ||||
-rw-r--r-- | sys/isa/fdc.h | 4 |
2 files changed, 14 insertions, 19 deletions
diff --git a/sys/isa/fd.c b/sys/isa/fd.c index 10e38f9..5879733 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.86 1996/04/07 17:32:12 bde Exp $ + * $Id: fd.c,v 1.87 1996/04/08 19:40:56 smpatel Exp $ * */ @@ -581,6 +581,7 @@ fdattach(struct isa_device *dev) fdc->state = DEVIDLE; /* reset controller, turn motor off, clear fdout mirror reg */ outb(fdc->baseport + FDOUT, ((fdc->fdout = 0))); + TAILQ_INIT(&fdc->head); /* check for each floppy drive */ for (fdup = isa_biotab_fdc; fdup->id_driver != 0; fdup++) { @@ -1126,7 +1127,6 @@ fdclose(dev_t dev, int flags, int mode, struct proc *p) void fdstrategy(struct buf *bp) { - register struct buf *dp; long nblocks, blknum; int s; fdcu_t fdcu; @@ -1187,9 +1187,8 @@ fdstrategy(struct buf *bp) } bp->b_cylin = blknum / (fd->ft->sectrac * fd->ft->heads); bp->b_pblkno = bp->b_blkno; - dp = &(fdc->head); s = splbio(); - disksort(dp, bp); + tqdisksort(&fdc->head, bp); untimeout(fd_turnoff, (caddr_t)fdu); /* a good idea */ fdstart(fdcu); splx(s); @@ -1227,11 +1226,10 @@ fd_timeout(void *arg1) fdcu_t fdcu = (fdcu_t)arg1; fdu_t fdu = fdc_data[fdcu].fdu; int baseport = fdc_data[fdcu].baseport; - struct buf *dp, *bp; + struct buf *bp; int s; - dp = &fdc_data[fdcu].head; - bp = dp->b_actf; + bp = TAILQ_FIRST(&fdc_data[fdcu].head); /* * Due to IBM's brain-dead design, the FDC has a faked ready @@ -1314,14 +1312,12 @@ fdstate(fdcu_t fdcu, fdc_p fdc) unsigned long blknum; fdu_t fdu = fdc->fdu; fd_p fd; - register struct buf *dp, *bp; + register struct buf *bp; struct fd_formb *finfo = NULL; size_t fdblk; - dp = &(fdc->head); - bp = dp->b_actf; - if(!bp) - { + bp = TAILQ_EMPTY(&fdc->head); + if(!bp) { /***********************************************\ * nothing left for this controller to do * * Force into the IDLE state, * @@ -1619,7 +1615,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc) /* ALL DONE */ fd->skip = 0; bp->b_resid = 0; - dp->b_actf = bp->b_actf; + TAILQ_REMOVE(&fdc->head, bp, b_act); biodone(bp); fdc->fd = (fd_p) 0; fdc->fdu = -1; @@ -1727,10 +1723,9 @@ retrier(fdcu) fdcu_t fdcu; { fdc_p fdc = fdc_data + fdcu; - register struct buf *dp, *bp; + register struct buf *bp; - dp = &(fdc->head); - bp = dp->b_actf; + bp = TAILQ_FIRST(&fdc->head); if(fd_data[FDUNIT(minor(bp->b_dev))].options & FDOPT_NORETRY) goto fail; @@ -1774,7 +1769,7 @@ retrier(fdcu) bp->b_flags |= B_ERROR; bp->b_error = EIO; bp->b_resid = bp->b_bcount - fdc->fd->skip; - dp->b_actf = bp->b_actf; + TAILQ_REMOVE(&fdc->head, bp, b_act); fdc->fd->skip = 0; biodone(bp); fdc->state = FINDWORK; diff --git a/sys/isa/fdc.h b/sys/isa/fdc.h index 0216b7a..c0a99b8 100644 --- a/sys/isa/fdc.h +++ b/sys/isa/fdc.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fdc.h,v 1.4 1994/10/10 01:12:26 phk Exp $ + * $Id: fdc.h,v 1.5 1995/01/06 15:19:41 joerg Exp $ * */ @@ -62,7 +62,7 @@ struct fdc_data u_long status[7]; /* copy of the registers */ enum fdc_type fdct; /* chip version of FDC */ int fdc_errs; /* number of logged errors */ - struct buf head; /* Head of buf chain */ + struct buf_queue_head head; /* Head of buf chain */ }; /***********************************************************************\ |