summaryrefslogtreecommitdiff
path: root/sys/arch/atari/dev/hdfd.c
diff options
context:
space:
mode:
authoryamt <yamt@NetBSD.org>2005-10-15 17:29:10 +0000
committeryamt <yamt@NetBSD.org>2005-10-15 17:29:10 +0000
commitaec75b1cc6f7fcd41709ce0aa7e7ade322def5a3 (patch)
tree3d8326f9f2afd0eaa46aa8ff839b0971179ffb68 /sys/arch/atari/dev/hdfd.c
parent9a9aac907941a0004579a71d85ffbe3d7c4c4b1c (diff)
- change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc, have a pointer to the former. - move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c. - rename method to strategy for consistency. - move some definitions which don't need to be exposed to the rest of kernel from sys/bufq.h to sys/bufq_impl.h. (is it better to move it to kern/ or somewhere?) - fix some obvious breakage in dev/qbus/ts.c. (not tested)
Diffstat (limited to 'sys/arch/atari/dev/hdfd.c')
-rw-r--r--sys/arch/atari/dev/hdfd.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/arch/atari/dev/hdfd.c b/sys/arch/atari/dev/hdfd.c
index 108ad69ddc8..c24a6e07b1d 100644
--- a/sys/arch/atari/dev/hdfd.c
+++ b/sys/arch/atari/dev/hdfd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hdfd.c,v 1.45 2005/06/04 14:42:36 he Exp $ */
+/* $NetBSD: hdfd.c,v 1.46 2005/10/15 17:29:10 yamt Exp $ */
/*-
* Copyright (c) 1996 Leo Weppelman
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdfd.c,v 1.45 2005/06/04 14:42:36 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdfd.c,v 1.46 2005/10/15 17:29:10 yamt Exp $");
#include "opt_ddb.h"
@@ -274,7 +274,7 @@ struct fd_softc {
TAILQ_ENTRY(fd_softc) sc_drivechain;
int sc_ops; /* I/O ops since last switch */
- struct bufq_state sc_q; /* pending I/O requests */
+ struct bufq_state *sc_q; /* pending I/O requests */
int sc_active; /* number of active I/O operations */
};
@@ -537,7 +537,7 @@ fdattach(parent, self, aux)
else
printf(": density unknown\n");
- bufq_alloc(&fd->sc_q, BUFQ_DISKSORT|BUFQ_SORT_CYLINDER);
+ bufq_alloc(&fd->sc_q, "disksort", BUFQ_SORT_CYLINDER);
fd->sc_cylin = -1;
fd->sc_drive = drive;
fd->sc_deftype = type;
@@ -650,7 +650,7 @@ fdstrategy(bp)
/* Queue transfer on drive, activate drive and controller if idle. */
s = splbio();
- BUFQ_PUT(&fd->sc_q, bp);
+ BUFQ_PUT(fd->sc_q, bp);
callout_stop(&fd->sc_motoroff_ch); /* a good idea */
if (fd->sc_active == 0)
fdstart(fd);
@@ -703,11 +703,11 @@ fdfinish(fd, bp)
* another drive is waiting to be serviced, since there is a long motor
* startup delay whenever we switch.
*/
- (void)BUFQ_GET(&fd->sc_q);
+ (void)BUFQ_GET(fd->sc_q);
if (fd->sc_drivechain.tqe_next && ++fd->sc_ops >= 8) {
fd->sc_ops = 0;
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
- if (BUFQ_PEEK(&fd->sc_q) != NULL)
+ if (BUFQ_PEEK(fd->sc_q) != NULL)
TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
else
fd->sc_active = 0;
@@ -945,7 +945,7 @@ fdctimeout(arg)
s = splbio();
fdcstatus(&fd->sc_dev, 0, "timeout");
- if (BUFQ_PEEK(&fd->sc_q) != NULL)
+ if (BUFQ_PEEK(fd->sc_q) != NULL)
fdc->sc_state++;
else
fdc->sc_state = DEVIDLE;
@@ -990,7 +990,7 @@ loop:
}
/* Is there a transfer to this drive? If not, deactivate drive. */
- bp = BUFQ_PEEK(&fd->sc_q);
+ bp = BUFQ_PEEK(fd->sc_q);
if (bp == NULL) {
fd->sc_ops = 0;
TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
@@ -1280,7 +1280,7 @@ fdcretry(fdc)
struct buf *bp;
fd = fdc->sc_drives.tqh_first;
- bp = BUFQ_PEEK(&fd->sc_q);
+ bp = BUFQ_PEEK(fd->sc_q);
if (fd->sc_opts & FDOPT_NORETRY)
goto fail;