summaryrefslogtreecommitdiff
path: root/sys/dev
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/dev
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/dev')
-rw-r--r--sys/dev/ata/wd.c14
-rw-r--r--sys/dev/ata/wdvar.h4
-rw-r--r--sys/dev/ccd.c16
-rw-r--r--sys/dev/ccdvar.h4
-rw-r--r--sys/dev/cgd.c10
-rw-r--r--sys/dev/dksubr.c10
-rw-r--r--sys/dev/dkvar.h4
-rw-r--r--sys/dev/dkwedge/dk.c24
-rw-r--r--sys/dev/fss.c12
-rw-r--r--sys/dev/fssvar.h4
-rw-r--r--sys/dev/gpib/ct.c20
-rw-r--r--sys/dev/gpib/mt.c22
-rw-r--r--sys/dev/gpib/rd.c22
-rw-r--r--sys/dev/ic/rrunner.c12
-rw-r--r--sys/dev/ic/rrunnervar.h4
-rw-r--r--sys/dev/isa/fd.c18
-rw-r--r--sys/dev/isa/fdvar.h4
-rw-r--r--sys/dev/isa/mcd.c12
-rw-r--r--sys/dev/ld.c18
-rw-r--r--sys/dev/ldvar.h4
-rw-r--r--sys/dev/mca/ed_mca.c8
-rw-r--r--sys/dev/mca/edc_mca.c6
-rw-r--r--sys/dev/mca/edvar.h4
-rw-r--r--sys/dev/md.c12
-rw-r--r--sys/dev/mscp/mscp_disk.c6
-rw-r--r--sys/dev/mscp/mscp_subr.c14
-rw-r--r--sys/dev/mscp/mscpvar.h4
-rw-r--r--sys/dev/qbus/rf.c16
-rw-r--r--sys/dev/qbus/rl.c12
-rw-r--r--sys/dev/qbus/rlvar.h6
-rw-r--r--sys/dev/qbus/ts.c24
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c14
-rw-r--r--sys/dev/scsipi/cd.c22
-rw-r--r--sys/dev/scsipi/cdvar.h4
-rw-r--r--sys/dev/scsipi/sd.c21
-rw-r--r--sys/dev/scsipi/sdvar.h4
-rw-r--r--sys/dev/scsipi/ss.c14
-rw-r--r--sys/dev/scsipi/ss_mustek.c8
-rw-r--r--sys/dev/scsipi/ss_scanjet.c8
-rw-r--r--sys/dev/scsipi/ssvar.h4
-rw-r--r--sys/dev/scsipi/st.c26
-rw-r--r--sys/dev/scsipi/stvar.h4
-rw-r--r--sys/dev/vme/xd.c18
-rw-r--r--sys/dev/vme/xdvar.h4
-rw-r--r--sys/dev/vme/xy.c16
-rw-r--r--sys/dev/vme/xyvar.h4
-rw-r--r--sys/dev/vnd.c14
-rw-r--r--sys/dev/vndvar.h4
48 files changed, 269 insertions, 270 deletions
diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c
index cae5552c6ed..4c088dccb55 100644
--- a/sys/dev/ata/wd.c
+++ b/sys/dev/ata/wd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wd.c,v 1.311 2005/09/05 22:55:31 riz Exp $ */
+/* $NetBSD: wd.c,v 1.312 2005/10/15 17:29:12 yamt Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.311 2005/09/05 22:55:31 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.312 2005/10/15 17:29:12 yamt Exp $");
#ifndef ATADEBUG
#define ATADEBUG
@@ -294,7 +294,7 @@ wdattach(struct device *parent, struct device *self, void *aux)
ATADEBUG_PRINT(("wdattach\n"), DEBUG_FUNCS | DEBUG_PROBE);
callout_init(&wd->sc_restart_ch);
- bufq_alloc(&wd->sc_q, BUFQ_DISK_DEFAULT_STRAT()|BUFQ_SORT_RAWBLOCK);
+ bufq_alloc(&wd->sc_q, BUFQ_DISK_DEFAULT_STRAT, BUFQ_SORT_RAWBLOCK);
#ifdef WD_SOFTBADSECT
SLIST_INIT(&wd->sc_bslist);
#endif
@@ -452,9 +452,9 @@ wddetach(struct device *self, int flags)
s = splbio();
/* Kill off any queued buffers. */
- bufq_drain(&sc->sc_q);
+ bufq_drain(sc->sc_q);
- bufq_free(&sc->sc_q);
+ bufq_free(sc->sc_q);
sc->atabus->ata_killpending(sc->drvp);
splx(s);
@@ -571,7 +571,7 @@ wdstrategy(struct buf *bp)
/* Queue transfer on drive, activate drive and controller if idle. */
s = splbio();
- BUFQ_PUT(&wd->sc_q, bp);
+ BUFQ_PUT(wd->sc_q, bp);
wdstart(wd);
splx(s);
return;
@@ -597,7 +597,7 @@ wdstart(void *arg)
while (wd->openings > 0) {
/* Is there a buf for us ? */
- if ((bp = BUFQ_GET(&wd->sc_q)) == NULL)
+ if ((bp = BUFQ_GET(wd->sc_q)) == NULL)
return;
/*
diff --git a/sys/dev/ata/wdvar.h b/sys/dev/ata/wdvar.h
index b3e530e3bcf..5d4a4b9e5ee 100644
--- a/sys/dev/ata/wdvar.h
+++ b/sys/dev/ata/wdvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: wdvar.h,v 1.30 2005/07/25 12:52:44 drochner Exp $ */
+/* $NetBSD: wdvar.h,v 1.31 2005/10/15 17:29:12 yamt Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -40,7 +40,7 @@ struct wd_softc {
/* General disk infos */
struct device sc_dev;
struct disk sc_dk;
- struct bufq_state sc_q;
+ struct bufq_state *sc_q;
struct callout sc_restart_ch;
int sc_quirks; /* any quirks drive might have */
/* IDE disk soft states */
diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c
index b131a9f4e16..a1eb7c98918 100644
--- a/sys/dev/ccd.c
+++ b/sys/dev/ccd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ccd.c,v 1.105 2005/08/20 12:01:04 yamt Exp $ */
+/* $NetBSD: ccd.c,v 1.106 2005/10/15 17:29:11 yamt Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -125,7 +125,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.105 2005/08/20 12:01:04 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.106 2005/10/15 17:29:11 yamt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -692,7 +692,7 @@ ccdstrategy(struct buf *bp)
/* Place it in the queue and start I/O on the unit. */
s = splbio();
- BUFQ_PUT(&cs->sc_bufq, bp);
+ BUFQ_PUT(cs->sc_bufq, bp);
ccdstart(cs);
splx(s);
return;
@@ -718,7 +718,7 @@ ccdstart(struct ccd_softc *cs)
#endif
/* See if there is work for us to do. */
- while ((bp = BUFQ_PEEK(&cs->sc_bufq)) != NULL) {
+ while ((bp = BUFQ_PEEK(cs->sc_bufq)) != NULL) {
/* Instrumentation. */
disk_busy(&cs->sc_dkdev);
@@ -754,7 +754,7 @@ ccdstart(struct ccd_softc *cs)
}
/* Transfer all set up, remove job from the queue. */
- (void) BUFQ_GET(&cs->sc_bufq);
+ (void) BUFQ_GET(cs->sc_bufq);
/* Now fire off the requests. */
while ((cbp = SIMPLEQ_FIRST(&cbufq)) != NULL) {
@@ -1129,7 +1129,7 @@ ccdioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
ccio->ccio_unit = unit;
ccio->ccio_size = cs->sc_size;
- bufq_alloc(&cs->sc_bufq, BUFQ_FCFS);
+ bufq_alloc(&cs->sc_bufq, "fcfs", 0);
/* Attach the disk. */
pseudo_disk_attach(&cs->sc_dkdev);
@@ -1155,10 +1155,10 @@ ccdioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
/* Kill off any queued buffers. */
s = splbio();
- bufq_drain(&cs->sc_bufq);
+ bufq_drain(cs->sc_bufq);
splx(s);
- bufq_free(&cs->sc_bufq);
+ bufq_free(cs->sc_bufq);
/*
* Free ccd_softc information and clear entry.
diff --git a/sys/dev/ccdvar.h b/sys/dev/ccdvar.h
index bf31060761e..f83dd3790c3 100644
--- a/sys/dev/ccdvar.h
+++ b/sys/dev/ccdvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ccdvar.h,v 1.26 2004/10/28 06:59:18 yamt Exp $ */
+/* $NetBSD: ccdvar.h,v 1.27 2005/10/15 17:29:11 yamt Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -214,7 +214,7 @@ struct ccd_softc {
struct disk sc_dkdev; /* generic disk device info */
struct lock sc_lock; /* lock on this structure */
#if defined(_KERNEL) /* XXX ccdconfig(8) refers softc directly using kvm */
- struct bufq_state sc_bufq; /* buffer queue */
+ struct bufq_state *sc_bufq; /* buffer queue */
#endif
};
diff --git a/sys/dev/cgd.c b/sys/dev/cgd.c
index f9fc25461d1..8b6a269c67f 100644
--- a/sys/dev/cgd.c
+++ b/sys/dev/cgd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.29 2005/08/20 12:03:52 yamt Exp $ */
+/* $NetBSD: cgd.c,v 1.30 2005/10/15 17:29:11 yamt Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.29 2005/08/20 12:03:52 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.30 2005/10/15 17:29:11 yamt Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -568,7 +568,7 @@ cgd_ioctl_set(struct cgd_softc *cs, void *data, struct proc *p)
goto bail;
}
- bufq_alloc(&cs->sc_dksc.sc_bufq, BUFQ_FCFS);
+ bufq_alloc(&cs->sc_dksc.sc_bufq, "fcfs", 0);
cs->sc_data = malloc(MAXPHYS, M_DEVBUF, M_WAITOK);
cs->sc_data_used = 0;
@@ -602,9 +602,9 @@ cgd_ioctl_clr(struct cgd_softc *cs, void *data, struct proc *p)
/* Kill off any queued buffers. */
s = splbio();
- bufq_drain(&cs->sc_dksc.sc_bufq);
+ bufq_drain(cs->sc_dksc.sc_bufq);
splx(s);
- bufq_free(&cs->sc_dksc.sc_bufq);
+ bufq_free(cs->sc_dksc.sc_bufq);
(void)vn_close(cs->sc_tvn, FREAD|FWRITE, p->p_ucred, p);
cs->sc_cfuncs->cf_destroy(cs->sc_cdata.cf_priv);
diff --git a/sys/dev/dksubr.c b/sys/dev/dksubr.c
index 73216912403..923d33a0c27 100644
--- a/sys/dev/dksubr.c
+++ b/sys/dev/dksubr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.16 2005/08/20 12:03:52 yamt Exp $ */
+/* $NetBSD: dksubr.c,v 1.17 2005/10/15 17:29:11 yamt Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.16 2005/08/20 12:03:52 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.17 2005/10/15 17:29:11 yamt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -222,7 +222,7 @@ dk_strategy(struct dk_intf *di, struct dk_softc *dksc, struct buf *bp)
* provided by the individual driver.
*/
s = splbio();
- BUFQ_PUT(&dksc->sc_bufq, bp);
+ BUFQ_PUT(dksc->sc_bufq, bp);
dk_start(di, dksc);
splx(s);
return;
@@ -236,9 +236,9 @@ dk_start(struct dk_intf *di, struct dk_softc *dksc)
DPRINTF_FOLLOW(("dk_start(%s, %p)\n", di->di_dkname, dksc));
/* Process the work queue */
- while ((bp = BUFQ_GET(&dksc->sc_bufq)) != NULL) {
+ while ((bp = BUFQ_GET(dksc->sc_bufq)) != NULL) {
if (di->di_diskstart(dksc, bp) != 0) {
- BUFQ_PUT(&dksc->sc_bufq, bp);
+ BUFQ_PUT(dksc->sc_bufq, bp);
break;
}
}
diff --git a/sys/dev/dkvar.h b/sys/dev/dkvar.h
index bc24764bcec..9950eb840d1 100644
--- a/sys/dev/dkvar.h
+++ b/sys/dev/dkvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: dkvar.h,v 1.7 2005/08/20 12:03:52 yamt Exp $ */
+/* $NetBSD: dkvar.h,v 1.8 2005/10/15 17:29:11 yamt Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@ struct dk_softc {
#define DK_XNAME_SIZE 8
char sc_xname[DK_XNAME_SIZE]; /* external name */
struct disk sc_dkdev; /* generic disk info */
- struct bufq_state sc_bufq; /* buffer queue */
+ struct bufq_state *sc_bufq; /* buffer queue */
};
/* sc_flags:
diff --git a/sys/dev/dkwedge/dk.c b/sys/dev/dkwedge/dk.c
index c7208c12ab1..d29674ad988 100644
--- a/sys/dev/dkwedge/dk.c
+++ b/sys/dev/dkwedge/dk.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dk.c,v 1.8 2005/09/28 18:25:19 nathanw Exp $ */
+/* $NetBSD: dk.c,v 1.9 2005/10/15 17:29:12 yamt Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.8 2005/09/28 18:25:19 nathanw Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.9 2005/10/15 17:29:12 yamt Exp $");
#include "opt_dkwedge.h"
@@ -88,7 +88,7 @@ struct dkwedge_softc {
LIST_ENTRY(dkwedge_softc) sc_plink;
struct disk sc_dk; /* our own disk structure */
- struct bufq_state sc_bufq; /* buffer queue */
+ struct bufq_state *sc_bufq; /* buffer queue */
struct callout sc_restart_ch; /* callout to restart I/O */
u_int sc_iopend; /* I/Os pending */
@@ -301,7 +301,7 @@ dkwedge_add(struct dkwedge_info *dkw)
memcpy(sc->sc_ptype, dkw->dkw_ptype, sizeof(sc->sc_ptype));
sc->sc_ptype[sizeof(sc->sc_ptype) - 1] = '\0';
- bufq_alloc(&sc->sc_bufq, BUFQ_FCFS);
+ bufq_alloc(&sc->sc_bufq, "fcfs", 0);
callout_init(&sc->sc_restart_ch);
callout_setfunc(&sc->sc_restart_ch, dkrestart, sc);
@@ -339,7 +339,7 @@ dkwedge_add(struct dkwedge_info *dkw)
}
(void) lockmgr(&pdk->dk_openlock, LK_RELEASE, NULL);
if (error) {
- bufq_free(&sc->sc_bufq);
+ bufq_free(sc->sc_bufq);
free(sc, M_DKWEDGE);
return (error);
}
@@ -392,7 +392,7 @@ dkwedge_add(struct dkwedge_info *dkw)
LIST_REMOVE(sc, sc_plink);
(void) lockmgr(&pdk->dk_openlock, LK_RELEASE, NULL);
- bufq_free(&sc->sc_bufq);
+ bufq_free(sc->sc_bufq);
free(sc, M_DKWEDGE);
return (error);
}
@@ -419,7 +419,7 @@ dkwedge_add(struct dkwedge_info *dkw)
LIST_REMOVE(sc, sc_plink);
(void) lockmgr(&pdk->dk_openlock, LK_RELEASE, NULL);
- bufq_free(&sc->sc_bufq);
+ bufq_free(sc->sc_bufq);
free(sc, M_DKWEDGE);
return (ENOMEM);
}
@@ -532,7 +532,7 @@ dkwedge_del(struct dkwedge_info *dkw)
(void) lockmgr(&sc->sc_parent->dk_openlock, LK_RELEASE, NULL);
/* Delete our buffer queue. */
- bufq_free(&sc->sc_bufq);
+ bufq_free(sc->sc_bufq);
/* Detach from the disk list. */
disk_detach(&sc->sc_dk);
@@ -997,7 +997,7 @@ dkstrategy(struct buf *bp)
/* Place it in the queue and start I/O on the unit. */
s = splbio();
sc->sc_iopend++;
- BUFQ_PUT(&sc->sc_bufq, bp);
+ BUFQ_PUT(sc->sc_bufq, bp);
dkstart(sc);
splx(s);
return;
@@ -1019,9 +1019,9 @@ dkstart(struct dkwedge_softc *sc)
struct buf *bp, *nbp;
/* Do as much work as has been enqueued. */
- while ((bp = BUFQ_PEEK(&sc->sc_bufq)) != NULL) {
+ while ((bp = BUFQ_PEEK(sc->sc_bufq)) != NULL) {
if (sc->sc_state != DKW_STATE_RUNNING) {
- (void) BUFQ_GET(&sc->sc_bufq);
+ (void) BUFQ_GET(sc->sc_bufq);
if (sc->sc_iopend-- == 1 &&
(sc->sc_flags & DK_F_WAIT_DRAIN) != 0) {
sc->sc_flags &= ~DK_F_WAIT_DRAIN;
@@ -1048,7 +1048,7 @@ dkstart(struct dkwedge_softc *sc)
return;
}
- (void) BUFQ_GET(&sc->sc_bufq);
+ (void) BUFQ_GET(sc->sc_bufq);
BUF_INIT(nbp);
nbp->b_data = bp->b_data;
diff --git a/sys/dev/fss.c b/sys/dev/fss.c
index 1ec9a93c4ce..10978534e2a 100644
--- a/sys/dev/fss.c
+++ b/sys/dev/fss.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fss.c,v 1.15 2005/04/17 16:28:26 hannken Exp $ */
+/* $NetBSD: fss.c,v 1.16 2005/10/15 17:29:11 yamt Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.15 2005/04/17 16:28:26 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.16 2005/10/15 17:29:11 yamt Exp $");
#include "fss.h"
@@ -165,7 +165,7 @@ fssattach(int num)
sc->sc_unit = i;
sc->sc_bdev = NODEV;
simple_lock_init(&sc->sc_slock);
- bufq_alloc(&sc->sc_bufq, BUFQ_FCFS|BUFQ_SORT_RAWBLOCK);
+ bufq_alloc(&sc->sc_bufq, "fcfs", 0);
}
}
@@ -244,7 +244,7 @@ fss_strategy(struct buf *bp)
}
bp->b_rawblkno = bp->b_blkno;
- BUFQ_PUT(&sc->sc_bufq, bp);
+ BUFQ_PUT(sc->sc_bufq, bp);
wakeup(&sc->sc_bs_proc);
FSS_UNLOCK(sc, s);
@@ -1283,7 +1283,7 @@ fss_bs_thread(void *arg)
if (sc->sc_flags & FSS_PERSISTENT) {
nfreed = nio = 0;
- if ((bp = BUFQ_GET(&sc->sc_bufq)) == NULL)
+ if ((bp = BUFQ_GET(sc->sc_bufq)) == NULL)
continue;
nio++;
@@ -1346,7 +1346,7 @@ fss_bs_thread(void *arg)
*/
nio = 0;
- if ((bp = BUFQ_GET(&sc->sc_bufq)) == NULL)
+ if ((bp = BUFQ_GET(sc->sc_bufq)) == NULL)
continue;
nio++;
diff --git a/sys/dev/fssvar.h b/sys/dev/fssvar.h
index 162c3760f72..fc156b343d8 100644
--- a/sys/dev/fssvar.h
+++ b/sys/dev/fssvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: fssvar.h,v 1.9 2005/04/17 16:28:26 hannken Exp $ */
+/* $NetBSD: fssvar.h,v 1.10 2005/10/15 17:29:11 yamt Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@ struct fss_softc {
long sc_clresid; /* Bytes in last cluster */
int sc_cache_size; /* Number of entries in sc_cache */
struct fss_cache *sc_cache; /* Cluster cache */
- struct bufq_state sc_bufq; /* Transfer queue */
+ struct bufq_state *sc_bufq; /* Transfer queue */
u_int32_t sc_clnext; /* Next free cluster on backing store */
int sc_indir_size; /* # clusters for indirect mapping */
u_int8_t *sc_indir_valid; /* Map of valid indirect clusters */
diff --git a/sys/dev/gpib/ct.c b/sys/dev/gpib/ct.c
index 4f9d94318c5..5d9b44fda06 100644
--- a/sys/dev/gpib/ct.c
+++ b/sys/dev/gpib/ct.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ct.c,v 1.4 2005/02/27 00:26:59 perry Exp $ */
+/* $NetBSD: ct.c,v 1.5 2005/10/15 17:29:12 yamt Exp $ */
/*-
* Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
@@ -128,7 +128,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ct.c,v 1.4 2005/02/27 00:26:59 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ct.c,v 1.5 2005/10/15 17:29:12 yamt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -172,7 +172,7 @@ struct ct_softc {
struct ct_iocmd sc_ioc;
struct ct_rscmd sc_rsc;
struct cs80_stat sc_stat;
- struct bufq_state sc_tab;
+ struct bufq_state *sc_tab;
int sc_active;
struct buf *sc_bp;
struct buf sc_bufstore; /* XXX */
@@ -365,7 +365,7 @@ ctattach(parent, self, aux)
printf(": %s %stape\n", ctinfo[type].desc,
canstream ? "streaming " : "");
- bufq_alloc(&sc->sc_tab, BUFQ_FCFS);
+ bufq_alloc(&sc->sc_tab, "fcfs", 0);
if (gpibregister(sc->sc_ic, sc->sc_slave, ctcallback, sc,
&sc->sc_hdl)) {
@@ -513,7 +513,7 @@ ctstrategy(bp)
sc = device_lookup(&ct_cd, CTUNIT(bp->b_dev));
s = splbio();
- BUFQ_PUT(&sc->sc_tab, bp);
+ BUFQ_PUT(sc->sc_tab, bp);
if (sc->sc_active == 0) {
sc->sc_active = 1;
ctustart(sc);
@@ -527,7 +527,7 @@ ctustart(sc)
{
struct buf *bp;
- bp = BUFQ_PEEK(&sc->sc_tab);
+ bp = BUFQ_PEEK(sc->sc_tab);
sc->sc_addr = bp->b_data;
sc->sc_resid = bp->b_bcount;
if (gpibrequest(sc->sc_ic, sc->sc_hdl))
@@ -546,7 +546,7 @@ ctstart(sc)
slave = sc->sc_slave;
punit = sc->sc_punit;
- bp = BUFQ_PEEK(&sc->sc_tab);
+ bp = BUFQ_PEEK(sc->sc_tab);
if ((sc->sc_flags & CTF_CMD) && sc->sc_bp == bp) {
switch(sc->sc_cmd) {
case MTFSF:
@@ -748,7 +748,7 @@ ctintr(sc)
slave = sc->sc_slave;
punit = sc->sc_punit;
- bp = BUFQ_PEEK(&sc->sc_tab);
+ bp = BUFQ_PEEK(sc->sc_tab);
if (bp == NULL) {
printf("%s: bp == NULL\n", sc->sc_dev.dv_xname);
return;
@@ -878,10 +878,10 @@ ctdone(sc, bp)
struct buf *bp;
{
- (void)BUFQ_GET(&sc->sc_tab);
+ (void)BUFQ_GET(sc->sc_tab);
biodone(bp);
gpibrelease(sc->sc_ic, sc->sc_hdl);
- if (BUFQ_PEEK(&sc->sc_tab) == NULL) {
+ if (BUFQ_PEEK(sc->sc_tab) == NULL) {
sc->sc_active = 0;
return;
}
diff --git a/sys/dev/gpib/mt.c b/sys/dev/gpib/mt.c
index e7d9c54056c..4802f3b13ff 100644
--- a/sys/dev/gpib/mt.c
+++ b/sys/dev/gpib/mt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mt.c,v 1.3 2004/10/28 07:07:40 yamt Exp $ */
+/* $NetBSD: mt.c,v 1.4 2005/10/15 17:29:12 yamt Exp $ */
/*-
* Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
@@ -121,7 +121,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.3 2004/10/28 07:07:40 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.4 2005/10/15 17:29:12 yamt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -168,7 +168,7 @@ struct mt_softc {
short sc_density; /* current density of tape (mtio.h format) */
short sc_type; /* tape drive model (hardware IDs) */
tpr_t sc_ttyp;
- struct bufq_state sc_tab;/* buf queue */
+ struct bufq_state *sc_tab;/* buf queue */
int sc_active;
struct buf sc_bufstore; /* XXX buffer storage */
@@ -278,7 +278,7 @@ mtattach(parent, self, aux)
sc->sc_type = type;
sc->sc_flags = MTF_EXISTS;
- bufq_alloc(&sc->sc_tab, BUFQ_FCFS);
+ bufq_alloc(&sc->sc_tab, "fcfs", 0);
callout_init(&sc->sc_start_ch);
callout_init(&sc->sc_intr_ch);
@@ -588,7 +588,7 @@ mtstrategy(bp)
}
}
s = splbio();
- BUFQ_PUT(&sc->sc_tab, bp);
+ BUFQ_PUT(sc->sc_tab, bp);
if (sc->sc_active == 0) {
sc->sc_active = 1;
mtustart(sc);
@@ -662,7 +662,7 @@ mtstart(sc)
DPRINTF(MDB_ANY, ("%s start", sc->sc_dev.dv_xname));
sc->sc_flags &= ~MTF_WRT;
- bp = BUFQ_PEEK(&sc->sc_tab);
+ bp = BUFQ_PEEK(sc->sc_tab);
if ((sc->sc_flags & MTF_ALIVE) == 0 &&
((bp->b_flags & B_CMD) == 0 || bp->b_cmd != MTRESET))
goto fatalerror;
@@ -843,10 +843,10 @@ errdone:
bp->b_flags |= B_ERROR;
done:
sc->sc_flags &= ~(MTF_HITEOF | MTF_HITBOF);
- (void)BUFQ_GET(&sc->sc_tab);
+ (void)BUFQ_GET(sc->sc_tab);
biodone(bp);
gpibrelease(sc->sc_ic, sc->sc_hdl);
- if ((bp = BUFQ_PEEK(&sc->sc_tab)) == NULL)
+ if ((bp = BUFQ_PEEK(sc->sc_tab)) == NULL)
sc->sc_active = 0;
else
mtustart(sc);
@@ -862,7 +862,7 @@ mtintr(sc)
slave = sc->sc_slave;
- bp = BUFQ_PEEK(&sc->sc_tab);
+ bp = BUFQ_PEEK(sc->sc_tab);
if (bp == NULL) {
printf("%s intr: bp == NULL", sc->sc_dev.dv_xname);
return;
@@ -1010,10 +1010,10 @@ error:
cmdbuf[0] = MTE_COMPLETE | MTE_IDLE;
(void) gpibsend(sc->sc_ic, slave, MTL_ECMD, cmdbuf, 1);
bp->b_flags &= ~B_CMD;
- (void)BUFQ_GET(&sc->sc_tab);
+ (void)BUFQ_GET(sc->sc_tab);
biodone(bp);
gpibrelease(sc->sc_ic, sc->sc_hdl);
- if (BUFQ_PEEK(&sc->sc_tab) == NULL)
+ if (BUFQ_PEEK(sc->sc_tab) == NULL)
sc->sc_active = 0;
else
mtustart(sc);
diff --git a/sys/dev/gpib/rd.c b/sys/dev/gpib/rd.c
index e75187b5bf3..e1d40fec98e 100644
--- a/sys/dev/gpib/rd.c
+++ b/sys/dev/gpib/rd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rd.c,v 1.5 2005/02/27 00:26:59 perry Exp $ */
+/* $NetBSD: rd.c,v 1.6 2005/10/15 17:29:12 yamt Exp $ */
/*-
* Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.5 2005/02/27 00:26:59 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.6 2005/10/15 17:29:12 yamt Exp $");
#include "rnd.h"
@@ -182,7 +182,7 @@ struct rd_softc {
u_int8_t *sc_addr;
int sc_resid;
struct rd_iocmd sc_ioc;
- struct bufq_state sc_tab;
+ struct bufq_state *sc_tab;
int sc_active;
int sc_errcnt;
@@ -442,7 +442,7 @@ rdattach(parent, self, aux)
rdidentinfo[type].ri_ntpc, rdidentinfo[type].ri_nblocks,
DEV_BSIZE);
- bufq_alloc(&sc->sc_tab, BUFQ_FCFS);
+ bufq_alloc(&sc->sc_tab, "fcfs", 0);
/*
* Initialize and attach the disk structure.
@@ -662,7 +662,7 @@ rdstrategy(bp)
}
bp->b_rawblkno = bn + offset;
s = splbio();
- BUFQ_PUT(&sc->sc_tab, bp);
+ BUFQ_PUT(sc->sc_tab, bp);
if (sc->sc_active == 0) {
sc->sc_active = 1;
rdustart(sc);
@@ -698,7 +698,7 @@ rdustart(sc)
{
struct buf *bp;
- bp = BUFQ_PEEK(&sc->sc_tab);
+ bp = BUFQ_PEEK(sc->sc_tab);
sc->sc_addr = bp->b_data;
sc->sc_resid = bp->b_bcount;
if (gpibrequest(sc->sc_ic, sc->sc_hdl))
@@ -712,11 +712,11 @@ rdfinish(sc, bp)
{
sc->sc_errcnt = 0;
- (void)BUFQ_GET(&sc->sc_tab);
+ (void)BUFQ_GET(sc->sc_tab);
bp->b_resid = 0;
biodone(bp);
gpibrelease(sc->sc_ic, sc->sc_hdl);
- if ((bp = BUFQ_PEEK(&sc->sc_tab)) != NULL)
+ if ((bp = BUFQ_PEEK(sc->sc_tab)) != NULL)
return (bp);
sc->sc_active = 0;
if (sc->sc_flags & RDF_WANTED) {
@@ -758,7 +758,7 @@ void
rdstart(sc)
struct rd_softc *sc;
{
- struct buf *bp = BUFQ_PEEK(&sc->sc_tab);
+ struct buf *bp = BUFQ_PEEK(sc->sc_tab);
int part, slave, punit;
slave = sc->sc_slave;
@@ -828,7 +828,7 @@ rdintr(sc)
int rv, dir, restart, slave;
slave = sc->sc_slave;
- bp = BUFQ_PEEK(&sc->sc_tab);
+ bp = BUFQ_PEEK(sc->sc_tab);
DPRINTF(RDB_FOLLOW, ("rdintr(%s): bp %p, %c, flags %x\n",
sc->sc_dev.dv_xname, bp, (bp->b_flags & B_READ) ? 'R' : 'W',
@@ -944,7 +944,7 @@ rderror(sc)
/*
* First conjure up the block number at which the error occurred.
*/
- bp = BUFQ_PEEK(&sc->sc_tab);
+ bp = BUFQ_PEEK(sc->sc_tab);
pbn = sc->sc_dk.dk_label->d_partitions[RDPART(bp->b_dev)].p_offset;
if ((css.c_fef & FEF_CU) || (css.c_fef & FEF_DR) ||
(css.c_ief & IEF_RRMASK)) {
diff --git a/sys/dev/ic/rrunner.c b/sys/dev/ic/rrunner.c
index 8e1e9d21b50..ab16a8787ef 100644
--- a/sys/dev/ic/rrunner.c
+++ b/sys/dev/ic/rrunner.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rrunner.c,v 1.49 2005/05/30 04:43:47 christos Exp $ */
+/* $NetBSD: rrunner.c,v 1.50 2005/10/15 17:29:12 yamt Exp $ */
/*
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rrunner.c,v 1.49 2005/05/30 04:43:47 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rrunner.c,v 1.50 2005/10/15 17:29:12 yamt Exp $");
#include "opt_inet.h"
#include "opt_ns.h"
@@ -310,7 +310,7 @@ eshconfig(sc)
sc->sc_send.ec_offset = 0;
sc->sc_send.ec_descr = sc->sc_send_ring;
TAILQ_INIT(&sc->sc_send.ec_di_queue);
- bufq_alloc(&sc->sc_send.ec_buf_queue, BUFQ_FCFS);
+ bufq_alloc(&sc->sc_send.ec_buf_queue, "fcfs", 0);
for (i = 0; i < RR_MAX_SNAP_RECV_RING_SIZE; i++)
if (bus_dmamap_create(sc->sc_dmat, RR_DMA_MAX, 1, RR_DMA_MAX,
@@ -1404,7 +1404,7 @@ esh_fpstrategy(bp)
*/
struct esh_send_ring_ctl *ring = &sc->sc_send;
- BUFQ_PUT(&ring->ec_buf_queue, bp);
+ BUFQ_PUT(ring->ec_buf_queue, bp);
#ifdef ESH_PRINTF
printf("esh_fpstrategy: ready to call eshstart to write!\n");
#endif
@@ -2018,7 +2018,7 @@ eshstart(ifp)
if ((sc->sc_flags & ESH_FL_FP_RING_UP) != 0 &&
send->ec_cur_mbuf == NULL && send->ec_cur_buf == NULL &&
send->ec_cur_dmainfo == NULL &&
- BUFQ_PEEK(&send->ec_buf_queue) != NULL) {
+ BUFQ_PEEK(send->ec_buf_queue) != NULL) {
struct buf *bp;
#ifdef ESH_PRINTF
@@ -2026,7 +2026,7 @@ eshstart(ifp)
send->ec_queue);
#endif
- bp = send->ec_cur_buf = BUFQ_GET(&send->ec_buf_queue);
+ bp = send->ec_cur_buf = BUFQ_GET(send->ec_buf_queue);
send->ec_offset = 0;
send->ec_len = bp->b_bcount;
diff --git a/sys/dev/ic/rrunnervar.h b/sys/dev/ic/rrunnervar.h
index 4fc5d1dfe52..391ab80cc04 100644
--- a/sys/dev/ic/rrunnervar.h
+++ b/sys/dev/ic/rrunnervar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rrunnervar.h,v 1.9 2005/02/27 00:27:02 perry Exp $ */
+/* $NetBSD: rrunnervar.h,v 1.10 2005/10/15 17:29:12 yamt Exp $ */
/* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -114,7 +114,7 @@ struct esh_send_ring_ctl {
struct buf *ec_cur_buf; /* current buf being processed */
struct esh_dmainfo *ec_cur_dmainfo;
/* current dmainfo being processed */
- struct bufq_state ec_buf_queue; /* queue of bufs to send */
+ struct bufq_state *ec_buf_queue;/* queue of bufs to send */
int ec_error; /* encountered error? */
u_int16_t ec_producer; /* latest buffer driver produced */
u_int16_t ec_consumer; /* latest buffer runcode consumed */
diff --git a/sys/dev/isa/fd.c b/sys/dev/isa/fd.c
index f0d61237307..683b32dde55 100644
--- a/sys/dev/isa/fd.c
+++ b/sys/dev/isa/fd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fd.c,v 1.59 2005/07/30 14:49:35 christos Exp $ */
+/* $NetBSD: fd.c,v 1.60 2005/10/15 17:29:12 yamt Exp $ */
/*-
* Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.59 2005/07/30 14:49:35 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.60 2005/10/15 17:29:12 yamt Exp $");
#include "rnd.h"
#include "opt_ddb.h"
@@ -487,7 +487,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;
@@ -620,7 +620,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);
@@ -673,11 +673,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 (TAILQ_NEXT(fd, sc_drivechain) && ++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;
@@ -932,7 +932,7 @@ fdctimeout(arg)
#endif
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;
@@ -985,7 +985,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);
@@ -1255,7 +1255,7 @@ fdcretry(fdc)
struct buf *bp;
fd = TAILQ_FIRST(&fdc->sc_drives);
- bp = BUFQ_PEEK(&fd->sc_q);
+ bp = BUFQ_PEEK(fd->sc_q);
if (fd->sc_opts & FDOPT_NORETRY)
goto fail;
diff --git a/sys/dev/isa/fdvar.h b/sys/dev/isa/fdvar.h
index 701fff9623c..8ee6ce438dd 100644
--- a/sys/dev/isa/fdvar.h
+++ b/sys/dev/isa/fdvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: fdvar.h,v 1.1 2003/01/08 23:51:11 jmcneill Exp $ */
+/* $NetBSD: fdvar.h,v 1.2 2005/10/15 17:29:12 yamt Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -94,7 +94,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 */
#if NRND > 0
diff --git a/sys/dev/isa/mcd.c b/sys/dev/isa/mcd.c
index 0cefda54f0c..4e73e6912b1 100644
--- a/sys/dev/isa/mcd.c
+++ b/sys/dev/isa/mcd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mcd.c,v 1.90 2005/03/12 22:54:48 christos Exp $ */
+/* $NetBSD: mcd.c,v 1.91 2005/10/15 17:29:12 yamt Exp $ */
/*
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved.
@@ -56,7 +56,7 @@
/*static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mcd.c,v 1.90 2005/03/12 22:54:48 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mcd.c,v 1.91 2005/10/15 17:29:12 yamt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -149,7 +149,7 @@ struct mcd_softc {
#define MCD_MD_UNKNOWN -1
int lastupc;
#define MCD_UPC_UNKNOWN -1
- struct bufq_state buf_queue;
+ struct bufq_state *buf_queue;
int active;
u_char readcmd;
u_char debug;
@@ -262,7 +262,7 @@ mcdattach(parent, self, aux)
return;
}
- bufq_alloc(&sc->buf_queue, BUFQ_DISKSORT|BUFQ_SORT_RAWBLOCK);
+ bufq_alloc(&sc->buf_queue, "disksort", BUFQ_SORT_RAWBLOCK);
callout_init(&sc->sc_pintr_ch);
/*
@@ -481,7 +481,7 @@ mcdstrategy(bp)
/* Queue it. */
s = splbio();
- BUFQ_PUT(&sc->buf_queue, bp);
+ BUFQ_PUT(sc->buf_queue, bp);
splx(s);
if (!sc->active)
mcdstart(sc);
@@ -504,7 +504,7 @@ mcdstart(sc)
loop:
s = splbio();
- if ((bp = BUFQ_GET(&sc->buf_queue)) == NULL) {
+ if ((bp = BUFQ_GET(sc->buf_queue)) == NULL) {
/* Nothing to do. */
sc->active = 0;
splx(s);
diff --git a/sys/dev/ld.c b/sys/dev/ld.c
index f111c00076b..19f89120259 100644
--- a/sys/dev/ld.c
+++ b/sys/dev/ld.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ld.c,v 1.37 2005/05/30 04:44:52 christos Exp $ */
+/* $NetBSD: ld.c,v 1.38 2005/10/15 17:29:11 yamt Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.37 2005/05/30 04:44:52 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.38 2005/10/15 17:29:11 yamt Exp $");
#include "rnd.h"
@@ -155,7 +155,7 @@ ldattach(struct ld_softc *sc)
/* Set the `shutdownhook'. */
if (ld_sdh == NULL)
ld_sdh = shutdownhook_establish(ldshutdown, NULL);
- bufq_alloc(&sc->sc_bufq, BUFQ_DISK_DEFAULT_STRAT()|BUFQ_SORT_RAWBLOCK);
+ bufq_alloc(&sc->sc_bufq, BUFQ_DISK_DEFAULT_STRAT, BUFQ_SORT_RAWBLOCK);
/* Discover wedges on this disk. */
dkwedge_discover(&sc->sc_dk);
@@ -217,10 +217,10 @@ ldenddetach(struct ld_softc *sc)
/* Kill off any queued buffers. */
s = splbio();
- bufq_drain(&sc->sc_bufq);
+ bufq_drain(sc->sc_bufq);
splx(s);
- bufq_free(&sc->sc_bufq);
+ bufq_free(sc->sc_bufq);
/* Nuke the vnodes for any open instances. */
for (i = 0; i < MAXPARTITIONS; i++) {
@@ -589,7 +589,7 @@ ldstrategy(struct buf *bp)
bp->b_rawblkno = blkno;
s = splbio();
- BUFQ_PUT(&sc->sc_bufq, bp);
+ BUFQ_PUT(sc->sc_bufq, bp);
ldstart(sc);
splx(s);
return;
@@ -609,7 +609,7 @@ ldstart(struct ld_softc *sc)
while (sc->sc_queuecnt < sc->sc_maxqueuecnt) {
/* See if there is work to do. */
- if ((bp = BUFQ_PEEK(&sc->sc_bufq)) == NULL)
+ if ((bp = BUFQ_PEEK(sc->sc_bufq)) == NULL)
break;
disk_busy(&sc->sc_dk);
@@ -620,7 +620,7 @@ ldstart(struct ld_softc *sc)
* The back-end is running the job; remove it from
* the queue.
*/
- (void) BUFQ_GET(&sc->sc_bufq);
+ (void) BUFQ_GET(sc->sc_bufq);
} else {
disk_unbusy(&sc->sc_dk, 0, (bp->b_flags & B_READ));
sc->sc_queuecnt--;
@@ -635,7 +635,7 @@ ldstart(struct ld_softc *sc)
*/
break;
} else {
- (void) BUFQ_GET(&sc->sc_bufq);
+ (void) BUFQ_GET(sc->sc_bufq);
bp->b_error = error;
bp->b_flags |= B_ERROR;
bp->b_resid = bp->b_bcount;
diff --git a/sys/dev/ldvar.h b/sys/dev/ldvar.h
index 0d11627eb02..0397634cfce 100644
--- a/sys/dev/ldvar.h
+++ b/sys/dev/ldvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ldvar.h,v 1.9 2004/09/25 04:28:08 thorpej Exp $ */
+/* $NetBSD: ldvar.h,v 1.10 2005/10/15 17:29:11 yamt Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
struct ld_softc {
struct device sc_dv;
struct disk sc_dk;
- struct bufq_state sc_bufq;
+ struct bufq_state *sc_bufq;
#if NRND > 0
rndsource_element_t sc_rnd_source;
#endif
diff --git a/sys/dev/mca/ed_mca.c b/sys/dev/mca/ed_mca.c
index fa19dc3407c..63eca7b411f 100644
--- a/sys/dev/mca/ed_mca.c
+++ b/sys/dev/mca/ed_mca.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ed_mca.c,v 1.29 2005/02/27 00:27:21 perry Exp $ */
+/* $NetBSD: ed_mca.c,v 1.30 2005/10/15 17:29:25 yamt Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ed_mca.c,v 1.29 2005/02/27 00:27:21 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ed_mca.c,v 1.30 2005/10/15 17:29:25 yamt Exp $");
#include "rnd.h"
@@ -155,7 +155,7 @@ ed_mca_attach(parent, self, aux)
ed->sc_devno = eda->edc_drive;
edc_add_disk(sc, ed);
- bufq_alloc(&ed->sc_q, BUFQ_DISKSORT|BUFQ_SORT_RAWBLOCK);
+ bufq_alloc(&ed->sc_q, "disksort", BUFQ_SORT_RAWBLOCK);
simple_lock_init(&ed->sc_q_lock);
if (ed_get_params(ed, &drv_flags)) {
@@ -257,7 +257,7 @@ edmcastrategy(bp)
/* Queue transfer on drive, activate drive and controller if idle. */
simple_lock(&ed->sc_q_lock);
- BUFQ_PUT(&ed->sc_q, bp);
+ BUFQ_PUT(ed->sc_q, bp);
simple_unlock(&ed->sc_q_lock);
/* Ring the worker thread */
diff --git a/sys/dev/mca/edc_mca.c b/sys/dev/mca/edc_mca.c
index 666f8bb5a43..2971b4dff7c 100644
--- a/sys/dev/mca/edc_mca.c
+++ b/sys/dev/mca/edc_mca.c
@@ -1,4 +1,4 @@
-/* $NetBSD: edc_mca.c,v 1.30 2005/08/26 11:20:33 drochner Exp $ */
+/* $NetBSD: edc_mca.c,v 1.31 2005/10/15 17:29:25 yamt Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: edc_mca.c,v 1.30 2005/08/26 11:20:33 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: edc_mca.c,v 1.31 2005/10/15 17:29:25 yamt Exp $");
#include "rnd.h"
@@ -862,7 +862,7 @@ edcworker(arg)
/* Is there a buf for us ? */
simple_lock(&ed->sc_q_lock);
- if ((bp = BUFQ_GET(&ed->sc_q)) == NULL) {
+ if ((bp = BUFQ_GET(ed->sc_q)) == NULL) {
simple_unlock(&ed->sc_q_lock);
i++;
continue;
diff --git a/sys/dev/mca/edvar.h b/sys/dev/mca/edvar.h
index 96712034f5c..03c28d7896f 100644
--- a/sys/dev/mca/edvar.h
+++ b/sys/dev/mca/edvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: edvar.h,v 1.9 2005/02/27 00:27:21 perry Exp $ */
+/* $NetBSD: edvar.h,v 1.10 2005/10/15 17:29:25 yamt Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@ struct ed_softc {
/* General disk infos */
struct disk sc_dk;
- struct bufq_state sc_q;
+ struct bufq_state *sc_q;
struct simplelock sc_q_lock;
struct edc_mca_softc *edc_softc; /* pointer to our controller */
diff --git a/sys/dev/md.c b/sys/dev/md.c
index 27da56484af..062767e2e70 100644
--- a/sys/dev/md.c
+++ b/sys/dev/md.c
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.41 2005/04/01 11:59:37 yamt Exp $ */
+/* $NetBSD: md.c,v 1.42 2005/10/15 17:29:11 yamt Exp $ */
/*
* Copyright (c) 1995 Gordon W. Ross, Leo Weppelman.
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.41 2005/04/01 11:59:37 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.42 2005/10/15 17:29:11 yamt Exp $");
#include "opt_md.h"
@@ -86,7 +86,7 @@ struct md_softc {
struct device sc_dev; /* REQUIRED first entry */
struct disk sc_dkdev; /* hook for generic disk handling */
struct md_conf sc_md;
- struct bufq_state sc_buflist;
+ struct bufq_state *sc_buflist;
};
/* shorthand for fields in sc_md: */
#define sc_addr sc_md.md_addr
@@ -163,7 +163,7 @@ md_attach(struct device *parent, struct device *self, void *aux)
{
struct md_softc *sc = (struct md_softc *)self;
- bufq_alloc(&sc->sc_buflist, BUFQ_FCFS);
+ bufq_alloc(&sc->sc_buflist, "fcfs", 0);
/* XXX - Could accept aux info here to set the config. */
#ifdef MEMORY_DISK_HOOKS
@@ -326,7 +326,7 @@ mdstrategy(struct buf *bp)
#if MEMORY_DISK_SERVER
case MD_UMEM_SERVER:
/* Just add this job to the server's queue. */
- BUFQ_PUT(&sc->sc_buflist, bp);
+ BUFQ_PUT(sc->sc_buflist, bp);
wakeup((caddr_t)sc);
/* see md_server_loop() */
/* no biodone in this case */
@@ -475,7 +475,7 @@ md_server_loop(struct md_softc *sc)
for (;;) {
/* Wait for some work to arrive. */
- while ((bp = BUFQ_GET(&sc->sc_buflist)) == NULL) {
+ while ((bp = BUFQ_GET(sc->sc_buflist)) == NULL) {
error = tsleep((caddr_t)sc, md_sleep_pri, "md_idle", 0);
if (error)
return error;
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 */
diff --git a/sys/dev/qbus/rf.c b/sys/dev/qbus/rf.c
index a80a4402c5c..ce6c9074910 100644
--- a/sys/dev/qbus/rf.c
+++ b/sys/dev/qbus/rf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf.c,v 1.8 2005/02/26 12:45:06 simonb Exp $ */
+/* $NetBSD: rf.c,v 1.9 2005/10/15 17:29:25 yamt Exp $ */
/*
* Copyright (c) 2002 Jochen Kunz.
* All rights reserved.
@@ -36,7 +36,7 @@ TODO:
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf.c,v 1.8 2005/02/26 12:45:06 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf.c,v 1.9 2005/10/15 17:29:25 yamt Exp $");
/* autoconfig stuff */
#include <sys/param.h>
@@ -173,7 +173,7 @@ CFATTACH_DECL(
struct rf_softc {
struct device sc_dev; /* common device data */
struct disk sc_disk; /* common disk device data */
- struct bufq_state sc_bufq; /* queue of pending transfers */
+ struct bufq_state *sc_bufq; /* queue of pending transfers */
int sc_state; /* state of drive */
u_int8_t sc_dnum; /* drive number, 0 or 1 */
};
@@ -496,7 +496,7 @@ rf_attach(struct device *parent, struct device *self, void *aux)
dl->d_partitions[2].p_fsize = 0; /* fs basic fragment size */
dl->d_partitions[2].p_fstype = 0; /* fs type */
dl->d_partitions[2].p_frag = 0; /* fs fragments per block */
- bufq_alloc(&rf_sc->sc_bufq, BUFQ_DISKSORT | BUFQ_SORT_CYLINDER);
+ bufq_alloc(&rf_sc->sc_bufq, "disksort", BUFQ_SORT_CYLINDER);
printf("\n");
return;
}
@@ -601,7 +601,7 @@ rfstrategy(struct buf *buf)
rfc_intr(rfc_sc);
} else {
buf->b_resid = buf->b_blkno / RX2_SECTORS;
- BUFQ_PUT(&rf_sc->sc_bufq, buf);
+ BUFQ_PUT(rf_sc->sc_bufq, buf);
buf->b_resid = 0;
}
splx(i);
@@ -626,7 +626,7 @@ get_new_buf( struct rfc_softc *rfc_sc)
struct rf_softc *other_drive;
rf_sc = (struct rf_softc *)rfc_sc->sc_childs[rfc_sc->sc_curchild];
- rfc_sc->sc_curbuf = BUFQ_GET(&rf_sc->sc_bufq);
+ rfc_sc->sc_curbuf = BUFQ_GET(rf_sc->sc_bufq);
if (rfc_sc->sc_curbuf != NULL) {
rfc_sc->sc_bufidx = rfc_sc->sc_curbuf->b_un.b_addr;
rfc_sc->sc_bytesleft = rfc_sc->sc_curbuf->b_bcount;
@@ -635,10 +635,10 @@ get_new_buf( struct rfc_softc *rfc_sc)
other_drive = (struct rf_softc *)
rfc_sc->sc_childs[ rfc_sc->sc_curchild == 0 ? 1 : 0];
if (other_drive != NULL
- && BUFQ_PEEK(&other_drive->sc_bufq) != NULL) {
+ && BUFQ_PEEK(other_drive->sc_bufq) != NULL) {
rfc_sc->sc_curchild = rfc_sc->sc_curchild == 0 ? 1 : 0;
rf_sc = other_drive;
- rfc_sc->sc_curbuf = BUFQ_GET(&rf_sc->sc_bufq);
+ rfc_sc->sc_curbuf = BUFQ_GET(rf_sc->sc_bufq);
rfc_sc->sc_bufidx = rfc_sc->sc_curbuf->b_un.b_addr;
rfc_sc->sc_bytesleft = rfc_sc->sc_curbuf->b_bcount;
} else
diff --git a/sys/dev/qbus/rl.c b/sys/dev/qbus/rl.c
index b486c46e869..f70b3a886c4 100644
--- a/sys/dev/qbus/rl.c
+++ b/sys/dev/qbus/rl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rl.c,v 1.25 2005/06/27 11:05:24 ragge Exp $ */
+/* $NetBSD: rl.c,v 1.26 2005/10/15 17:29:25 yamt Exp $ */
/*
* Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rl.c,v 1.25 2005/06/27 11:05:24 ragge Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rl.c,v 1.26 2005/10/15 17:29:25 yamt Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -221,7 +221,7 @@ rlcattach(struct device *parent, struct device *self, void *aux)
printf(": Failed to allocate DMA map, error %d\n", error);
return;
}
- bufq_alloc(&sc->sc_q, BUFQ_DISKSORT|BUFQ_SORT_CYLINDER);
+ bufq_alloc(&sc->sc_q, "disksort", BUFQ_SORT_CYLINDER);
for (i = 0; i < RL_MAXDPC; i++) {
waitcrdy(sc);
RL_WREG(RL_DA, RLDA_GS|RLDA_RST);
@@ -431,7 +431,7 @@ rlstrategy(struct buf *bp)
sc = (struct rlc_softc *)rc->rc_dev.dv_parent;
s = splbio();
- BUFQ_PUT(&sc->sc_q, bp);
+ BUFQ_PUT(sc->sc_q, bp);
rlcstart(sc, 0);
splx(s);
return;
@@ -647,7 +647,7 @@ rlcstart(struct rlc_softc *sc, struct buf *ob)
return; /* Already doing something */
if (ob == 0) {
- bp = BUFQ_GET(&sc->sc_q);
+ bp = BUFQ_GET(sc->sc_q);
if (bp == NULL)
return; /* Nothing to do */
sc->sc_bufaddr = bp->b_data;
@@ -740,7 +740,7 @@ rlcreset(struct device *dev)
if (sc->sc_active == 0)
return;
- BUFQ_PUT(&sc->sc_q, sc->sc_active);
+ BUFQ_PUT(sc->sc_q, sc->sc_active);
sc->sc_active = 0;
rlcstart(sc, 0);
}
diff --git a/sys/dev/qbus/rlvar.h b/sys/dev/qbus/rlvar.h
index 46efcb01f13..b9ced812e9e 100644
--- a/sys/dev/qbus/rlvar.h
+++ b/sys/dev/qbus/rlvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rlvar.h,v 1.4 2005/02/26 12:45:06 simonb Exp $ */
+/* $NetBSD: rlvar.h,v 1.5 2005/10/15 17:29:25 yamt Exp $ */
/*
* Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rlvar.h,v 1.4 2005/02/26 12:45:06 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rlvar.h,v 1.5 2005/10/15 17:29:25 yamt Exp $");
struct rlc_softc {
struct device sc_dev;
@@ -45,7 +45,7 @@ struct rlc_softc {
bus_space_handle_t sc_ioh;
bus_dma_tag_t sc_dmat;
bus_dmamap_t sc_dmam;
- struct bufq_state sc_q; /* Queue of waiting bufs */
+ struct bufq_state *sc_q; /* Queue of waiting bufs */
struct buf *sc_active; /* Currently active buf */
caddr_t sc_bufaddr; /* Current in-core address */
int sc_diskblk; /* Current block on disk */
diff --git a/sys/dev/qbus/ts.c b/sys/dev/qbus/ts.c
index ba8dc8c9952..4439672f605 100644
--- a/sys/dev/qbus/ts.c
+++ b/sys/dev/qbus/ts.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ts.c,v 1.13 2005/02/26 12:45:06 simonb Exp $ */
+/* $NetBSD: ts.c,v 1.14 2005/10/15 17:29:25 yamt Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ts.c,v 1.13 2005/02/26 12:45:06 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ts.c,v 1.14 2005/10/15 17:29:25 yamt Exp $");
#undef TSDEBUG
@@ -126,7 +126,7 @@ struct ts_softc {
struct ts *sc_bts; /* Unibus address of ts struct */
int sc_type; /* TS11 or TS05? */
short sc_waddr; /* Value to write to TSDB */
- struct bufq_state sc_bufq; /* pending I/O requests */
+ struct bufq_state *sc_bufq; /* pending I/O requests */
short sc_mapped; /* Unibus map allocated ? */
short sc_state; /* see below: ST_xxx */
@@ -250,7 +250,7 @@ tsattach(struct device *parent, struct device *self, void *aux)
0, BUS_DMA_NOWAIT, &sc->sc_dmam)))
return printf(": failed create DMA map %d\n", error);
- bufq_alloc(&sc->sc_bufq, BUFQ_FCFS);
+ bufq_alloc(&sc->sc_bufq, "fcfs", 0);
/*
* write the characteristics (again)
@@ -376,10 +376,10 @@ tsstart(struct ts_softc *sc, int isloaded)
struct buf *bp;
int cmd;
- if (TAILQ_EMPTY(&sc->sc_bufq.bq_head))
+ bp = BUFQ_PEEK(sc->sc_bufq);
+ if (bp == NULL) {
return 0;
-
- bp = BUFQ_PEEK(&sc->sc_bufq);
+ }
#ifdef TSDEBUG
printf("buf: %p bcount %ld blkno %d\n", bp, bp->b_bcount, bp->b_blkno);
#endif
@@ -467,7 +467,7 @@ int
tsready(struct uba_unit *uu)
{
struct ts_softc *sc = uu->uu_softc;
- struct buf *bp = BUFQ_PEEK(&sc->sc_bufq);
+ struct buf *bp = BUFQ_PEEK(sc->sc_bufq);
if (bus_dmamap_load(sc->sc_dmat, sc->sc_dmam, bp->b_data,
bp->b_bcount, bp->b_proc, BUS_DMA_NOWAIT))
@@ -785,9 +785,9 @@ tsintr(void *arg)
sc->sc_dev.dv_xname, sr & TS_TC);
tsreset(sc);
}
- if ((bp = BUFQ_GET(&sc->sc_bufq)) != NULL) {
+ if ((bp = BUFQ_GET(sc->sc_bufq)) != NULL) {
#ifdef TSDEBUG
- printf("tsintr2: que %p\n", TAILQ_FIRST(&sc->sc_bufq.bq_head));
+ printf("tsintr2: que %p\n", BUFQ_PEEK(sc->sc_bufq));
#endif
if (bp != &sc->ts_cbuf) { /* no ioctl */
bus_dmamap_unload(sc->sc_dmat, sc->sc_dmam);
@@ -909,8 +909,8 @@ tsstrategy(struct buf *bp)
printf("buf: %p bcount %ld blkno %d\n", bp, bp->b_bcount, bp->b_blkno);
#endif
s = splbio ();
- empty = (BUFQ_PEEK(&sc->sc_bufq) == NULL);
- BUFQ_PUT(&sc->sc_bufq, bp);
+ empty = (BUFQ_PEEK(sc->sc_bufq) == NULL);
+ BUFQ_PUT(sc->sc_bufq, bp);
if (empty)
tsstart(sc, 0);
splx(s);
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index b16d3b1032c..0c6057302d5 100644
--- a/sys/dev/raidframe/rf_netbsdkintf.c
+++ b/sys/dev/raidframe/rf_netbsdkintf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.190 2005/09/25 19:47:17 oster Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.191 2005/10/15 17:29:25 yamt Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -146,7 +146,7 @@
***********************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.190 2005/09/25 19:47:17 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.191 2005/10/15 17:29:25 yamt Exp $");
#include <sys/param.h>
#include <sys/errno.h>
@@ -253,7 +253,7 @@ struct raid_softc {
size_t sc_size; /* size of the raid device */
char sc_xname[20]; /* XXX external name */
struct disk sc_dkdev; /* generic disk device info */
- struct bufq_state buf_queue; /* used for the device queue */
+ struct bufq_state *buf_queue; /* used for the device queue */
};
/* sc_flags */
#define RAIDF_INITED 0x01 /* unit has been initialized */
@@ -395,7 +395,7 @@ raidattach(int num)
}
for (raidID = 0; raidID < num; raidID++) {
- bufq_alloc(&raid_softc[raidID].buf_queue, BUFQ_FCFS);
+ bufq_alloc(&raid_softc[raidID].buf_queue, "fcfs", 0);
pseudo_disk_init(&raid_softc[raidID].sc_dkdev);
raidrootdev[raidID].dv_class = DV_DISK;
@@ -733,7 +733,7 @@ raidstrategy(struct buf *bp)
bp->b_resid = 0;
/* stuff it onto our queue */
- BUFQ_PUT(&rs->buf_queue, bp);
+ BUFQ_PUT(rs->buf_queue, bp);
/* scheduled the IO to happen at the next convenient time */
wakeup(&(raidPtrs[raidID]->iodone));
@@ -1701,7 +1701,7 @@ raidstart(RF_Raid_t *raidPtr)
RF_UNLOCK_MUTEX(raidPtr->mutex);
/* get the next item, if any, from the queue */
- if ((bp = BUFQ_GET(&rs->buf_queue)) == NULL) {
+ if ((bp = BUFQ_GET(rs->buf_queue)) == NULL) {
/* nothing more to do */
return;
}
@@ -3343,7 +3343,7 @@ rf_pool_init(struct pool *p, size_t size, const char *w_chan,
int
rf_buf_queue_check(int raidid)
{
- if ((BUFQ_PEEK(&(raid_softc[raidid].buf_queue)) != NULL) &&
+ if ((BUFQ_PEEK(raid_softc[raidid].buf_queue) != NULL) &&
raidPtrs[raidid]->openings > 0) {
/* there is work to do */
return 0;
diff --git a/sys/dev/scsipi/cd.c b/sys/dev/scsipi/cd.c
index d11ec5a01b3..8fa256fff29 100644
--- a/sys/dev/scsipi/cd.c
+++ b/sys/dev/scsipi/cd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cd.c,v 1.227 2005/09/06 22:19:14 reinoud Exp $ */
+/* $NetBSD: cd.c,v 1.228 2005/10/15 17:29:25 yamt Exp $ */
/*-
* Copyright (c) 1998, 2001, 2003, 2004 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.227 2005/09/06 22:19:14 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.228 2005/10/15 17:29:25 yamt Exp $");
#include "rnd.h"
@@ -231,7 +231,7 @@ cdattach(struct device *parent, struct device *self, void *aux)
periph->periph_version == 0)
cd->flags |= CDF_ANCIENT;
- bufq_alloc(&cd->buf_queue, BUFQ_DISKSORT|BUFQ_SORT_RAWBLOCK);
+ bufq_alloc(&cd->buf_queue, "disksort", BUFQ_SORT_RAWBLOCK);
callout_init(&cd->sc_callout);
@@ -309,9 +309,9 @@ cddetach(struct device *self, int flags)
s = splbio();
/* Kill off any queued buffers. */
- bufq_drain(&cd->buf_queue);
+ bufq_drain(cd->buf_queue);
- bufq_free(&cd->buf_queue);
+ bufq_free(cd->buf_queue);
/* Kill off any pending commands. */
scsipi_kill_pending(cd->sc_periph);
@@ -697,7 +697,7 @@ cdstrategy(struct buf *bp)
* XXX Only do disksort() if the current operating mode does not
* XXX include tagged queueing.
*/
- BUFQ_PUT(&cd->buf_queue, bp);
+ BUFQ_PUT(cd->buf_queue, bp);
/*
* Tell the device to get going on the transfer if it's
@@ -768,7 +768,7 @@ cdstart(struct scsipi_periph *periph)
*/
if (__predict_false(
(periph->periph_flags & PERIPH_MEDIA_LOADED) == 0)) {
- if ((bp = BUFQ_GET(&cd->buf_queue)) != NULL) {
+ if ((bp = BUFQ_GET(cd->buf_queue)) != NULL) {
bp->b_error = EIO;
bp->b_flags |= B_ERROR;
bp->b_resid = bp->b_bcount;
@@ -782,7 +782,7 @@ cdstart(struct scsipi_periph *periph)
/*
* See if there is a buf with work for us to do..
*/
- if ((bp = BUFQ_PEEK(&cd->buf_queue)) == NULL)
+ if ((bp = BUFQ_PEEK(cd->buf_queue)) == NULL)
return;
/*
@@ -855,10 +855,10 @@ cdstart(struct scsipi_periph *periph)
* HBA driver
*/
#ifdef DIAGNOSTIC
- if (BUFQ_GET(&cd->buf_queue) != bp)
+ if (BUFQ_GET(cd->buf_queue) != bp)
panic("cdstart(): dequeued wrong buf");
#else
- BUFQ_GET(&cd->buf_queue);
+ BUFQ_GET(cd->buf_queue);
#endif
error = scsipi_execute_xs(xs);
/* with a scsipi_xfer preallocated, scsipi_command can't fail */
@@ -961,7 +961,7 @@ cdbounce(struct buf *bp)
* XXX Only do disksort() if the current operating mode
* XXX does not include tagged queueing.
*/
- BUFQ_PUT(&cd->buf_queue, nbp);
+ BUFQ_PUT(cd->buf_queue, nbp);
/*
* Tell the device to get going on the transfer if it's
diff --git a/sys/dev/scsipi/cdvar.h b/sys/dev/scsipi/cdvar.h
index 81e1e3929f7..b389277b1b4 100644
--- a/sys/dev/scsipi/cdvar.h
+++ b/sys/dev/scsipi/cdvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: cdvar.h,v 1.24 2005/02/01 00:19:34 reinoud Exp $ */
+/* $NetBSD: cdvar.h,v 1.25 2005/10/15 17:29:25 yamt Exp $ */
/*
* Copyright (c) 1997 Manuel Bouyer. All rights reserved.
@@ -49,7 +49,7 @@ struct cd_softc {
u_long disksize512; /* total number sectors */
} params;
- struct bufq_state buf_queue;
+ struct bufq_state *buf_queue;
struct callout sc_callout;
#if NRND > 0
diff --git a/sys/dev/scsipi/sd.c b/sys/dev/scsipi/sd.c
index 069c7a8b9b1..f046f20027d 100644
--- a/sys/dev/scsipi/sd.c
+++ b/sys/dev/scsipi/sd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sd.c,v 1.240 2005/05/29 22:00:50 christos Exp $ */
+/* $NetBSD: sd.c,v 1.241 2005/10/15 17:29:25 yamt Exp $ */
/*-
* Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.240 2005/05/29 22:00:50 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.241 2005/10/15 17:29:25 yamt Exp $");
#include "opt_scsi.h"
#include "rnd.h"
@@ -229,8 +229,7 @@ sdattach(struct device *parent, struct device *self, void *aux)
periph->periph_version == 0)
sd->flags |= SDF_ANCIENT;
- bufq_alloc(&sd->buf_queue,
- BUFQ_DISK_DEFAULT_STRAT()|BUFQ_SORT_RAWBLOCK);
+ bufq_alloc(&sd->buf_queue, BUFQ_DISK_DEFAULT_STRAT, BUFQ_SORT_RAWBLOCK);
callout_init(&sd->sc_callout);
@@ -369,9 +368,9 @@ sddetach(struct device *self, int flags)
s = splbio();
/* Kill off any queued buffers. */
- bufq_drain(&sd->buf_queue);
+ bufq_drain(sd->buf_queue);
- bufq_free(&sd->buf_queue);
+ bufq_free(sd->buf_queue);
/* Kill off any pending commands. */
scsipi_kill_pending(sd->sc_periph);
@@ -725,7 +724,7 @@ sdstrategy(struct buf *bp)
* XXX Only do disksort() if the current operating mode does not
* XXX include tagged queueing.
*/
- BUFQ_PUT(&sd->buf_queue, bp);
+ BUFQ_PUT(sd->buf_queue, bp);
/*
* Tell the device to get going on the transfer if it's
@@ -798,7 +797,7 @@ sdstart(struct scsipi_periph *periph)
*/
if (__predict_false(
(periph->periph_flags & PERIPH_MEDIA_LOADED) == 0)) {
- if ((bp = BUFQ_GET(&sd->buf_queue)) != NULL) {
+ if ((bp = BUFQ_GET(sd->buf_queue)) != NULL) {
bp->b_error = EIO;
bp->b_flags |= B_ERROR;
bp->b_resid = bp->b_bcount;
@@ -812,7 +811,7 @@ sdstart(struct scsipi_periph *periph)
/*
* See if there is a buf with work for us to do..
*/
- if ((bp = BUFQ_PEEK(&sd->buf_queue)) == NULL)
+ if ((bp = BUFQ_PEEK(sd->buf_queue)) == NULL)
return;
/*
@@ -900,10 +899,10 @@ sdstart(struct scsipi_periph *periph)
* HBA driver
*/
#ifdef DIAGNOSTIC
- if (BUFQ_GET(&sd->buf_queue) != bp)
+ if (BUFQ_GET(sd->buf_queue) != bp)
panic("sdstart(): dequeued wrong buf");
#else
- BUFQ_GET(&sd->buf_queue);
+ BUFQ_GET(sd->buf_queue);
#endif
error = scsipi_execute_xs(xs);
/* with a scsipi_xfer preallocated, scsipi_command can't fail */
diff --git a/sys/dev/scsipi/sdvar.h b/sys/dev/scsipi/sdvar.h
index fab47764c7c..887a7215c65 100644
--- a/sys/dev/scsipi/sdvar.h
+++ b/sys/dev/scsipi/sdvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: sdvar.h,v 1.26 2005/02/01 00:19:34 reinoud Exp $ */
+/* $NetBSD: sdvar.h,v 1.27 2005/10/15 17:29:25 yamt Exp $ */
/*-
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -93,7 +93,7 @@ struct sd_softc {
u_int64_t disksize512; /* total number sectors */
} params;
- struct bufq_state buf_queue;
+ struct bufq_state *buf_queue;
struct callout sc_callout;
u_int8_t type;
char name[16]; /* product name, for default disklabel */
diff --git a/sys/dev/scsipi/ss.c b/sys/dev/scsipi/ss.c
index 07dc15e573a..e0e0e3f19dc 100644
--- a/sys/dev/scsipi/ss.c
+++ b/sys/dev/scsipi/ss.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ss.c,v 1.61 2005/05/30 04:25:32 christos Exp $ */
+/* $NetBSD: ss.c,v 1.62 2005/10/15 17:29:25 yamt Exp $ */
/*
* Copyright (c) 1995 Kenneth Stailey. All rights reserved.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ss.c,v 1.61 2005/05/30 04:25:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ss.c,v 1.62 2005/10/15 17:29:25 yamt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -163,7 +163,7 @@ ssattach(struct device *parent, struct device *self, void *aux)
/*
* Set up the buf queue for this device
*/
- bufq_alloc(&ss->buf_queue, BUFQ_FCFS);
+ bufq_alloc(&ss->buf_queue, "fcfs", 0);
callout_init(&ss->sc_callout);
@@ -199,9 +199,9 @@ ssdetach(struct device *self, int flags)
s = splbio();
/* Kill off any queued buffers. */
- bufq_drain(&ss->buf_queue);
+ bufq_drain(ss->buf_queue);
- bufq_free(&ss->buf_queue);
+ bufq_free(ss->buf_queue);
/* Kill off any pending commands. */
scsipi_kill_pending(ss->sc_periph);
@@ -441,7 +441,7 @@ ssstrategy(struct buf *bp)
* at the end (a bit silly because we only have on user..
* (but it could fork()))
*/
- BUFQ_PUT(&ss->buf_queue, bp);
+ BUFQ_PUT(ss->buf_queue, bp);
/*
* Tell the device to get going on the transfer if it's
@@ -496,7 +496,7 @@ ssstart(struct scsipi_periph *periph)
/*
* See if there is a buf with work for us to do..
*/
- if ((bp = BUFQ_PEEK(&ss->buf_queue)) == NULL)
+ if ((bp = BUFQ_PEEK(ss->buf_queue)) == NULL)
return;
if (ss->special && ss->special->read) {
diff --git a/sys/dev/scsipi/ss_mustek.c b/sys/dev/scsipi/ss_mustek.c
index 1bdf1f82b11..09119c1cae2 100644
--- a/sys/dev/scsipi/ss_mustek.c
+++ b/sys/dev/scsipi/ss_mustek.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ss_mustek.c,v 1.30 2005/02/01 00:19:34 reinoud Exp $ */
+/* $NetBSD: ss_mustek.c,v 1.31 2005/10/15 17:29:25 yamt Exp $ */
/*
* Copyright (c) 1995 Joachim Koenig-Baltes. All rights reserved.
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ss_mustek.c,v 1.30 2005/02/01 00:19:34 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ss_mustek.c,v 1.31 2005/10/15 17:29:25 yamt Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -496,10 +496,10 @@ mustek_read(struct ss_softc *ss, struct buf *bp)
return(0);
}
#ifdef DIAGNOSTIC
- if (BUFQ_GET(&ss->buf_queue) != bp)
+ if (BUFQ_GET(ss->buf_queue) != bp)
panic("ssstart(): dequeued wrong buf");
#else
- BUFQ_GET(&ss->buf_queue);
+ BUFQ_GET(ss->buf_queue);
#endif
error = scsipi_execute_xs(xs);
/* with a scsipi_xfer preallocated, scsipi_command can't fail */
diff --git a/sys/dev/scsipi/ss_scanjet.c b/sys/dev/scsipi/ss_scanjet.c
index 2e02e159571..063f5e3aa41 100644
--- a/sys/dev/scsipi/ss_scanjet.c
+++ b/sys/dev/scsipi/ss_scanjet.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ss_scanjet.c,v 1.42 2005/05/30 04:25:32 christos Exp $ */
+/* $NetBSD: ss_scanjet.c,v 1.43 2005/10/15 17:29:26 yamt Exp $ */
/*
* Copyright (c) 1995 Kenneth Stailey. All rights reserved.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ss_scanjet.c,v 1.42 2005/05/30 04:25:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ss_scanjet.c,v 1.43 2005/10/15 17:29:26 yamt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -296,10 +296,10 @@ scanjet_read(struct ss_softc *ss, struct buf *bp)
return(0);
}
#ifdef DIAGNOSTIC
- if (BUFQ_GET(&ss->buf_queue) != bp)
+ if (BUFQ_GET(ss->buf_queue) != bp)
panic("ssstart(): dequeued wrong buf");
#else
- BUFQ_GET(&ss->buf_queue);
+ BUFQ_GET(ss->buf_queue);
#endif
error = scsipi_execute_xs(xs);
/* with a scsipi_xfer preallocated, scsipi_command can't fail */
diff --git a/sys/dev/scsipi/ssvar.h b/sys/dev/scsipi/ssvar.h
index 5ea574c0fbb..748fc5a1237 100644
--- a/sys/dev/scsipi/ssvar.h
+++ b/sys/dev/scsipi/ssvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ssvar.h,v 1.15 2005/02/27 00:27:48 perry Exp $ */
+/* $NetBSD: ssvar.h,v 1.16 2005/10/15 17:29:26 yamt Exp $ */
/*
* Copyright (c) 1995 Kenneth Stailey. All rights reserved.
@@ -67,7 +67,7 @@ struct ss_softc {
#define SSF_AUTOCONF 0x04 /* set during auto-configuration */
struct scsipi_periph *sc_periph; /* contains our targ, lun, etc. */
struct scan_io sio;
- struct bufq_state buf_queue; /* the queue of pending IO operations */
+ struct bufq_state *buf_queue; /* the queue of pending IO operations */
struct callout sc_callout; /* to restart the buf queue */
u_int quirks; /* scanner is only mildly twisted */
#define SS_Q_GET_BUFFER_SIZE 0x0001 /* poll for available data in ssread() */
diff --git a/sys/dev/scsipi/st.c b/sys/dev/scsipi/st.c
index 21615b68dfc..7d5d9db61de 100644
--- a/sys/dev/scsipi/st.c
+++ b/sys/dev/scsipi/st.c
@@ -1,4 +1,4 @@
-/* $NetBSD: st.c,v 1.184 2005/08/13 10:50:50 blymn Exp $ */
+/* $NetBSD: st.c,v 1.185 2005/10/15 17:29:26 yamt Exp $ */
/*-
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: st.c,v 1.184 2005/08/13 10:50:50 blymn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: st.c,v 1.185 2005/10/15 17:29:26 yamt Exp $");
#include "opt_scsi.h"
@@ -394,7 +394,7 @@ stattach(struct device *parent, struct st_softc *st, void *aux)
/*
* Set up the buf queue for this device
*/
- bufq_alloc(&st->buf_queue, BUFQ_FCFS);
+ bufq_alloc(&st->buf_queue, "fcfs", 0);
callout_init(&st->sc_callout);
@@ -466,9 +466,9 @@ stdetach(struct device *self, int flags)
s = splbio();
/* Kill off any queued buffers. */
- bufq_drain(&st->buf_queue);
+ bufq_drain(st->buf_queue);
- bufq_free(&st->buf_queue);
+ bufq_free(st->buf_queue);
/* Kill off any pending commands. */
scsipi_kill_pending(st->sc_periph);
@@ -1144,7 +1144,7 @@ ststrategy(struct buf *bp)
* at the end (a bit silly because we only have on user..
* (but it could fork()))
*/
- BUFQ_PUT(&st->buf_queue, bp);
+ BUFQ_PUT(st->buf_queue, bp);
/*
* Tell the device to get going on the transfer if it's
@@ -1208,7 +1208,7 @@ ststart(struct scsipi_periph *periph)
*/
if (__predict_false((st->flags & ST_MOUNTED) == 0 ||
(periph->periph_flags & PERIPH_MEDIA_LOADED) == 0)) {
- if ((bp = BUFQ_GET(&st->buf_queue)) != NULL) {
+ if ((bp = BUFQ_GET(st->buf_queue)) != NULL) {
/* make sure that one implies the other.. */
periph->periph_flags &= ~PERIPH_MEDIA_LOADED;
bp->b_flags |= B_ERROR;
@@ -1221,7 +1221,7 @@ ststart(struct scsipi_periph *periph)
}
}
- if ((bp = BUFQ_PEEK(&st->buf_queue)) == NULL)
+ if ((bp = BUFQ_PEEK(st->buf_queue)) == NULL)
return;
if (st->stats->busy++ == 0) {
@@ -1247,14 +1247,14 @@ ststart(struct scsipi_periph *periph)
* Back up over filemark
*/
if (st_space(st, 0, SP_FILEMARKS, 0)) {
- BUFQ_GET(&st->buf_queue);
+ BUFQ_GET(st->buf_queue);
bp->b_flags |= B_ERROR;
bp->b_error = EIO;
biodone(bp);
continue;
}
} else {
- BUFQ_GET(&st->buf_queue);
+ BUFQ_GET(st->buf_queue);
bp->b_resid = bp->b_bcount;
bp->b_error = 0;
bp->b_flags &= ~B_ERROR;
@@ -1269,7 +1269,7 @@ ststart(struct scsipi_periph *periph)
* yet then we should report it now.
*/
if (st->flags & (ST_EOM_PENDING|ST_EIO_PENDING)) {
- BUFQ_GET(&st->buf_queue);
+ BUFQ_GET(st->buf_queue);
bp->b_resid = bp->b_bcount;
if (st->flags & ST_EIO_PENDING) {
bp->b_error = EIO;
@@ -1331,10 +1331,10 @@ ststart(struct scsipi_periph *periph)
* HBA driver
*/
#ifdef DIAGNOSTIC
- if (BUFQ_GET(&st->buf_queue) != bp)
+ if (BUFQ_GET(st->buf_queue) != bp)
panic("ststart(): dequeued wrong buf");
#else
- BUFQ_GET(&st->buf_queue);
+ BUFQ_GET(st->buf_queue);
#endif
error = scsipi_execute_xs(xs);
/* with a scsipi_xfer preallocated, scsipi_command can't fail */
diff --git a/sys/dev/scsipi/stvar.h b/sys/dev/scsipi/stvar.h
index 39504b8f738..75ade8a23a5 100644
--- a/sys/dev/scsipi/stvar.h
+++ b/sys/dev/scsipi/stvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: stvar.h,v 1.14 2005/08/07 12:25:08 blymn Exp $ */
+/* $NetBSD: stvar.h,v 1.15 2005/10/15 17:29:26 yamt Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -146,7 +146,7 @@ struct st_softc {
* additional sense data needed
* for mode sense/select.
*/
- struct bufq_state buf_queue; /* the queue of pending IO */
+ struct bufq_state *buf_queue; /* the queue of pending IO */
/* operations */
struct callout sc_callout; /* restarting the queue after */
/* transient error */
diff --git a/sys/dev/vme/xd.c b/sys/dev/vme/xd.c
index 4abf38d668a..58689c2922f 100644
--- a/sys/dev/vme/xd.c
+++ b/sys/dev/vme/xd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: xd.c,v 1.57 2005/06/03 22:01:01 tsutsui Exp $ */
+/* $NetBSD: xd.c,v 1.58 2005/10/15 17:29:26 yamt Exp $ */
/*
*
@@ -51,7 +51,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.57 2005/06/03 22:01:01 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.58 2005/10/15 17:29:26 yamt Exp $");
#undef XDC_DEBUG /* full debug */
#define XDC_DIAG /* extra sanity checks */
@@ -634,7 +634,7 @@ xdcattach(parent, self, aux)
/* init queue of waiting bufs */
- bufq_alloc(&xdc->sc_wq, BUFQ_FCFS);
+ bufq_alloc(&xdc->sc_wq, "fcfs", 0);
callout_init(&xdc->sc_tick_ch);
/*
@@ -1303,7 +1303,7 @@ xdstrategy(bp)
/* first, give jobs in front of us a chance */
parent = xd->parent;
- while (parent->nfree > 0 && BUFQ_PEEK(&parent->sc_wq) != NULL)
+ while (parent->nfree > 0 && BUFQ_PEEK(parent->sc_wq) != NULL)
if (xdc_startbuf(parent, NULL, NULL) != XD_ERR_AOK)
break;
@@ -1312,7 +1312,7 @@ xdstrategy(bp)
*/
if (parent->nfree == 0) {
- BUFQ_PUT(&parent->sc_wq, bp);
+ BUFQ_PUT(parent->sc_wq, bp);
splx(s);
return;
}
@@ -1364,7 +1364,7 @@ xdcintr(v)
/* fill up any remaining iorq's with queue'd buffers */
- while (xdcsc->nfree > 0 && BUFQ_PEEK(&xdcsc->sc_wq) != NULL)
+ while (xdcsc->nfree > 0 && BUFQ_PEEK(xdcsc->sc_wq) != NULL)
if (xdc_startbuf(xdcsc, NULL, NULL) != XD_ERR_AOK)
break;
@@ -1604,7 +1604,7 @@ xdc_startbuf(xdcsc, xdsc, bp)
/* get buf */
if (bp == NULL) {
- bp = BUFQ_GET(&xdcsc->sc_wq);
+ bp = BUFQ_GET(xdcsc->sc_wq);
if (bp == NULL)
panic("xdc_startbuf bp");
xdsc = xdcsc->sc_drives[DISKUNIT(bp->b_dev)];
@@ -1634,7 +1634,7 @@ xdc_startbuf(xdcsc, xdsc, bp)
printf("%s: warning: cannot load DMA map\n",
xdcsc->sc_dev.dv_xname);
XDC_FREE(xdcsc, rqno);
- BUFQ_PUT(&xdcsc->sc_wq, bp);
+ BUFQ_PUT(xdcsc->sc_wq, bp);
return (XD_ERR_FAIL); /* XXX: need some sort of
* call-back scheme here? */
}
@@ -1840,7 +1840,7 @@ xdc_piodriver(xdcsc, iorqno, freeone)
/* now that we've drained everything, start up any bufs that have
* queued */
- while (xdcsc->nfree > 0 && BUFQ_PEEK(&xdcsc->sc_wq) != NULL)
+ while (xdcsc->nfree > 0 && BUFQ_PEEK(xdcsc->sc_wq) != NULL)
if (xdc_startbuf(xdcsc, NULL, NULL) != XD_ERR_AOK)
break;
diff --git a/sys/dev/vme/xdvar.h b/sys/dev/vme/xdvar.h
index 337d44ecae6..dda4c88f6a4 100644
--- a/sys/dev/vme/xdvar.h
+++ b/sys/dev/vme/xdvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: xdvar.h,v 1.8 2005/02/04 02:10:49 perry Exp $ */
+/* $NetBSD: xdvar.h,v 1.9 2005/10/15 17:29:26 yamt Exp $ */
/*
*
@@ -154,7 +154,7 @@ struct xdc_softc {
struct xd_iopb *dvmaiopb; /* iopb base in DVMA space, not kvm */
bus_dmamap_t iopmap; /* IOPB DMA handle */
bus_dmamap_t auxmap; /* auxiliary DMA handle */
- struct bufq_state sc_wq; /* queued IOPBs for this controller */
+ struct bufq_state *sc_wq; /* queued IOPBs for this controller */
char freereq[XDC_MAXIOPB]; /* free list (stack) */
char waitq[XDC_MAXIOPB]; /* wait queue */
u_char nfree; /* number of iopbs free */
diff --git a/sys/dev/vme/xy.c b/sys/dev/vme/xy.c
index b4cc81b3d3c..5b21c4fa059 100644
--- a/sys/dev/vme/xy.c
+++ b/sys/dev/vme/xy.c
@@ -1,4 +1,4 @@
-/* $NetBSD: xy.c,v 1.59 2005/06/03 22:00:34 tsutsui Exp $ */
+/* $NetBSD: xy.c,v 1.60 2005/10/15 17:29:26 yamt Exp $ */
/*
*
@@ -51,7 +51,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.59 2005/06/03 22:00:34 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.60 2005/10/15 17:29:26 yamt Exp $");
#undef XYC_DEBUG /* full debug */
#undef XYC_DIAG /* extra sanity checks */
@@ -651,7 +651,7 @@ xyattach(parent, self, aux)
/* init queue of waiting bufs */
- bufq_alloc(&xy->xyq, BUFQ_DISKSORT|BUFQ_SORT_RAWBLOCK);
+ bufq_alloc(&xy->xyq, "disksort", BUFQ_SORT_RAWBLOCK);
xy->xyrq = &xyc->reqs[xa->driveno];
@@ -1224,7 +1224,7 @@ xystrategy(bp)
*/
s = splbio(); /* protect the queues */
- BUFQ_PUT(&xy->xyq, bp);
+ BUFQ_PUT(xy->xyq, bp);
/* start 'em up */
@@ -1843,7 +1843,7 @@ xyc_reset(xycsc, quiet, blastmode, error, xysc)
bus_dmamap_unload(xycsc->dmatag, iorq->dmamap);
- (void)BUFQ_GET(&iorq->xy->xyq);
+ (void)BUFQ_GET(iorq->xy->xyq);
disk_unbusy(&xycsc->reqs[lcv].xy->sc_dk,
(xycsc->reqs[lcv].buf->b_bcount -
xycsc->reqs[lcv].buf->b_resid),
@@ -1890,9 +1890,9 @@ xyc_start(xycsc, iorq)
if (iorq == NULL) {
for (lcv = 0; lcv < XYC_MAXDEV ; lcv++) {
if ((xy = xycsc->sc_drives[lcv]) == NULL) continue;
- if (BUFQ_PEEK(&xy->xyq) == NULL) continue;
+ if (BUFQ_PEEK(xy->xyq) == NULL) continue;
if (xy->xyrq->mode != XY_SUB_FREE) continue;
- xyc_startbuf(xycsc, xy, BUFQ_PEEK(&xy->xyq));
+ xyc_startbuf(xycsc, xy, BUFQ_PEEK(xy->xyq));
}
}
xyc_submit_iorq(xycsc, iorq, XY_SUB_NOQ);
@@ -2027,7 +2027,7 @@ xyc_remove_iorq(xycsc)
bus_dmamap_unload(xycsc->dmatag, iorq->dmamap);
- (void)BUFQ_GET(&iorq->xy->xyq);
+ (void)BUFQ_GET(iorq->xy->xyq);
disk_unbusy(&iorq->xy->sc_dk,
(bp->b_bcount - bp->b_resid),
(bp->b_flags & B_READ));
diff --git a/sys/dev/vme/xyvar.h b/sys/dev/vme/xyvar.h
index bec11632ed7..7fc814bdcaf 100644
--- a/sys/dev/vme/xyvar.h
+++ b/sys/dev/vme/xyvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: xyvar.h,v 1.9 2005/02/04 02:10:49 perry Exp $ */
+/* $NetBSD: xyvar.h,v 1.10 2005/10/15 17:29:26 yamt Exp $ */
/*
*
@@ -113,7 +113,7 @@ struct xy_softc {
u_char nsect; /* number of sectors per track */
u_char hw_spt; /* as above, but includes spare sectors */
struct xy_iorq *xyrq; /* this disk's ioreq structure */
- struct bufq_state xyq; /* queued I/O requests */
+ struct bufq_state *xyq; /* queued I/O requests */
struct dkbad dkb; /* bad144 sectors */
};
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index 77475e3dcf7..f66b96c32be 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vnd.c,v 1.122 2005/08/28 08:56:14 christos Exp $ */
+/* $NetBSD: vnd.c,v 1.123 2005/10/15 17:29:12 yamt Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.122 2005/08/28 08:56:14 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.123 2005/10/15 17:29:12 yamt Exp $");
#if defined(_KERNEL_OPT)
#include "fs_nfs.h"
@@ -276,7 +276,7 @@ vndattach(int num)
vnd_softc[i].sc_comp_buff = NULL;
vnd_softc[i].sc_comp_decombuf = NULL;
bufq_alloc(&vnd_softc[i].sc_tab,
- BUFQ_DISKSORT|BUFQ_SORT_RAWBLOCK);
+ "disksort", BUFQ_SORT_RAWBLOCK);
pseudo_disk_init(&vnd_softc[i].sc_dkdev);
}
}
@@ -292,7 +292,7 @@ vnddetach(void)
return (EBUSY);
for (i = 0; i < numvnd; i++)
- bufq_free(&vnd_softc[i].sc_tab);
+ bufq_free(vnd_softc[i].sc_tab);
free(vnd_softc, M_DEVBUF);
vndattached = 0;
@@ -454,7 +454,7 @@ vndstrategy(struct buf *bp)
if (vnddebug & VDB_FOLLOW)
printf("vndstrategy(%p): unit %d\n", bp, unit);
#endif
- BUFQ_PUT(&vnd->sc_tab, bp);
+ BUFQ_PUT(vnd->sc_tab, bp);
wakeup(&vnd->sc_tab);
splx(s);
return;
@@ -486,7 +486,7 @@ vndthread(void *arg)
* VOP_BMAP/VOP_STRATEGY.
*/
while ((vnd->sc_flags & VNF_VUNCONF) == 0) {
- bp = BUFQ_GET(&vnd->sc_tab);
+ bp = BUFQ_GET(vnd->sc_tab);
if (bp == NULL) {
tsleep(&vnd->sc_tab, PRIBIO, "vndbp", 0);
continue;
@@ -1428,7 +1428,7 @@ vndclear(struct vnd_softc *vnd, int myminor)
fflags |= FWRITE;
s = splbio();
- bufq_drain(&vnd->sc_tab);
+ bufq_drain(vnd->sc_tab);
splx(s);
vnd->sc_flags |= VNF_VUNCONF;
diff --git a/sys/dev/vndvar.h b/sys/dev/vndvar.h
index 1a0d35ecd77..a12d66e5e52 100644
--- a/sys/dev/vndvar.h
+++ b/sys/dev/vndvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: vndvar.h,v 1.16 2005/08/19 02:04:03 christos Exp $ */
+/* $NetBSD: vndvar.h,v 1.17 2005/10/15 17:29:12 yamt Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -155,7 +155,7 @@ struct vnd_softc {
struct vnode *sc_vp; /* vnode */
struct ucred *sc_cred; /* credentials */
int sc_maxactive; /* max # of active requests */
- struct bufq_state sc_tab; /* transfer queue */
+ struct bufq_state *sc_tab; /* transfer queue */
int sc_active; /* number of active transfers */
char sc_xname[8]; /* XXX external name */
struct disk sc_dkdev; /* generic disk device info */