diff options
| author | yamt <yamt@NetBSD.org> | 2005-10-15 17:29:10 +0000 |
|---|---|---|
| committer | yamt <yamt@NetBSD.org> | 2005-10-15 17:29:10 +0000 |
| commit | aec75b1cc6f7fcd41709ce0aa7e7ade322def5a3 (patch) | |
| tree | 3d8326f9f2afd0eaa46aa8ff839b0971179ffb68 /sys/dev/mscp | |
| parent | 9a9aac907941a0004579a71d85ffbe3d7c4c4b1c (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/dev/mscp')
| -rw-r--r-- | sys/dev/mscp/mscp_disk.c | 6 | ||||
| -rw-r--r-- | sys/dev/mscp/mscp_subr.c | 14 | ||||
| -rw-r--r-- | sys/dev/mscp/mscpvar.h | 4 |
3 files changed, 12 insertions, 12 deletions
diff --git a/sys/dev/mscp/mscp_disk.c b/sys/dev/mscp/mscp_disk.c index 4989357d688..022910c33ae 100644 --- a/sys/dev/mscp/mscp_disk.c +++ b/sys/dev/mscp/mscp_disk.c @@ -1,4 +1,4 @@ -/* $NetBSD: mscp_disk.c,v 1.47 2005/02/27 00:27:32 perry Exp $ */ +/* $NetBSD: mscp_disk.c,v 1.48 2005/10/15 17:29:25 yamt Exp $ */ /* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. @@ -81,7 +81,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mscp_disk.c,v 1.47 2005/02/27 00:27:32 perry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mscp_disk.c,v 1.48 2005/10/15 17:29:25 yamt Exp $"); #include <sys/param.h> #include <sys/buf.h> @@ -342,7 +342,7 @@ raclose(dev, flags, fmt, p) #if notyet if (ra->ra_openpart == 0) { s = spluba(); - while (BUFQ_PEEK(&udautab[unit]) != NULL) + while (BUFQ_PEEK(udautab[unit]) != NULL) (void) tsleep(&udautab[unit], PZERO - 1, "raclose", 0); splx(s); diff --git a/sys/dev/mscp/mscp_subr.c b/sys/dev/mscp/mscp_subr.c index d96539272fd..f6863710057 100644 --- a/sys/dev/mscp/mscp_subr.c +++ b/sys/dev/mscp/mscp_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: mscp_subr.c,v 1.28 2005/06/27 11:05:24 ragge Exp $ */ +/* $NetBSD: mscp_subr.c,v 1.29 2005/10/15 17:29:25 yamt Exp $ */ /* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. @@ -75,7 +75,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mscp_subr.c,v 1.28 2005/06/27 11:05:24 ragge Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mscp_subr.c,v 1.29 2005/10/15 17:29:25 yamt Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -196,7 +196,7 @@ mscp_attach(parent, self, aux) mi->mi_rsp.mri_size = NRSP; mi->mi_rsp.mri_desc = mi->mi_uda->mp_ca.ca_rspdsc; mi->mi_rsp.mri_ring = mi->mi_uda->mp_rsp; - bufq_alloc(&mi->mi_resq, BUFQ_FCFS); + bufq_alloc(&mi->mi_resq, "fcfs", 0); if (mscp_init(mi)) { printf("%s: can't init, controller hung\n", @@ -487,7 +487,7 @@ mscp_intr(mi) /* * If there are any not-yet-handled request, try them now. */ - if (BUFQ_PEEK(&mi->mi_resq)) + if (BUFQ_PEEK(mi->mi_resq)) mscp_kickaway(mi); } @@ -522,7 +522,7 @@ mscp_strategy(bp, usc) struct mscp_softc *mi = (void *)usc; int s = spluba(); - BUFQ_PUT(&mi->mi_resq, bp); + BUFQ_PUT(mi->mi_resq, bp); mscp_kickaway(mi); splx(s); } @@ -536,7 +536,7 @@ mscp_kickaway(mi) struct mscp *mp; int next; - while ((bp = BUFQ_PEEK(&mi->mi_resq)) != NULL) { + while ((bp = BUFQ_PEEK(mi->mi_resq)) != NULL) { /* * Ok; we are ready to try to start a xfer. Get a MSCP packet * and try to start... @@ -569,7 +569,7 @@ mscp_kickaway(mi) bp->b_resid = next; (*mi->mi_me->me_fillin)(bp, mp); (*mi->mi_mc->mc_go)(mi->mi_dev.dv_parent, &mi->mi_xi[next]); - (void)BUFQ_GET(&mi->mi_resq); + (void)BUFQ_GET(mi->mi_resq); } } diff --git a/sys/dev/mscp/mscpvar.h b/sys/dev/mscp/mscpvar.h index dece320abda..ccc790a11b7 100644 --- a/sys/dev/mscp/mscpvar.h +++ b/sys/dev/mscp/mscpvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: mscpvar.h,v 1.12 2005/06/27 11:05:24 ragge Exp $ */ +/* $NetBSD: mscpvar.h,v 1.13 2005/10/15 17:29:25 yamt Exp $ */ /* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. @@ -223,7 +223,7 @@ struct mscp_softc { bus_space_handle_t mi_iph; /* initialisation and polling */ bus_space_handle_t mi_sah; /* status & address (read part) */ bus_space_handle_t mi_swh; /* status & address (write part) */ - struct bufq_state mi_resq; /* While waiting for packets */ + struct bufq_state *mi_resq; /* While waiting for packets */ }; /* mi_flags */ |
