summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMatthew Dempsky <matthew@cvs.openbsd.org>2010-07-10 03:06:52 +0000
committerMatthew Dempsky <matthew@cvs.openbsd.org>2010-07-10 03:06:52 +0000
commit57d4028ec6ef2e2b8b9f00e2fd378a128848a6aa (patch)
tree88210d68cd47d729eb03015d4fbd9a4758f2417f /sys
parent9ffe11532208e6170095e5f7d275ebd5542abd01 (diff)
Eliminate two of the remaining three instances of drivers passing
their own buf to physio(9). compiler tested by nick@ and miod@; ok miod@ general approval thib@, deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/hp300/dev/mt.c41
-rw-r--r--sys/arch/vax/qbus/qd.c9
2 files changed, 16 insertions, 34 deletions
diff --git a/sys/arch/hp300/dev/mt.c b/sys/arch/hp300/dev/mt.c
index 4117fd7e0b6..b0615f51166 100644
--- a/sys/arch/hp300/dev/mt.c
+++ b/sys/arch/hp300/dev/mt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mt.c,v 1.23 2009/07/26 13:43:38 blambert Exp $ */
+/* $OpenBSD: mt.c,v 1.24 2010/07/10 03:06:51 matthew Exp $ */
/* $NetBSD: mt.c,v 1.8 1997/03/31 07:37:29 scottr Exp $ */
/*
@@ -75,7 +75,6 @@ struct mt_softc {
short sc_type; /* tape drive model (hardware IDs) */
struct hpibqueue sc_hq; /* HPIB device queue member */
struct buf sc_tab; /* buf queue */
- struct buf sc_bufstore; /* XXX buffer storage */
struct timeout sc_start_to; /* spl_mtstart timeout */
struct timeout sc_intr_to; /* spl_mtintr timeout */
};
@@ -396,30 +395,22 @@ mtcommand(dev, cmd, cnt)
int cmd;
int cnt;
{
- struct mt_softc *sc = mt_cd.cd_devs[UNIT(dev)];
- struct buf *bp = &sc->sc_bufstore;
+ struct buf b;
int error = 0;
-#if 1
- if (bp->b_flags & B_BUSY)
- return (EBUSY);
-#endif
- bp->b_cmd = cmd;
- bp->b_dev = dev;
+ bzero(&b, sizeof(b));
+ b.b_cmd = cmd;
+ b.b_dev = dev;
do {
- bp->b_flags = B_BUSY | B_CMD | B_RAW;
- mtstrategy(bp);
- biowait(bp);
- if (bp->b_flags & B_ERROR) {
- error = (int) (unsigned) bp->b_error;
+ b.b_flags = B_BUSY | B_CMD | B_RAW;
+ mtstrategy(&b);
+ biowait(&b);
+ if (b.b_flags & B_ERROR) {
+ error = (int) (unsigned) b.b_error;
break;
}
} while (--cnt > 0);
-#if 0
- bp->b_flags = 0 /*&= ~B_BUSY*/;
-#else
- bp->b_flags &= ~B_BUSY;
-#endif
+
return (error);
}
@@ -923,10 +914,7 @@ mtread(dev, uio, flags)
struct uio *uio;
int flags;
{
- struct mt_softc *sc = mt_cd.cd_devs[UNIT(dev)];
-
- return(physio(mtstrategy, &sc->sc_bufstore,
- dev, B_READ, minphys, uio));
+ return (physio(mtstrategy, NULL, dev, B_READ, minphys, uio));
}
int
@@ -935,10 +923,7 @@ mtwrite(dev, uio, flags)
struct uio *uio;
int flags;
{
- struct mt_softc *sc = mt_cd.cd_devs[UNIT(dev)];
-
- return(physio(mtstrategy, &sc->sc_bufstore,
- dev, B_WRITE, minphys, uio));
+ return (physio(mtstrategy, NULL, dev, B_WRITE, minphys, uio));
}
int
diff --git a/sys/arch/vax/qbus/qd.c b/sys/arch/vax/qbus/qd.c
index 940e8a0e9c3..5b46316e2e6 100644
--- a/sys/arch/vax/qbus/qd.c
+++ b/sys/arch/vax/qbus/qd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qd.c,v 1.18 2010/06/28 14:13:31 deraadt Exp $ */
+/* $OpenBSD: qd.c,v 1.19 2010/07/10 03:06:51 matthew Exp $ */
/* $NetBSD: qd.c,v 1.17 2000/01/24 02:40:29 matt Exp $ */
/*-
@@ -167,7 +167,6 @@ int Qbus_unmap[NQD]; /* Qbus mapper release code */
struct qdmap qdmap[NQD]; /* QDSS register map structure */
struct qdflags qdflags[NQD]; /* QDSS register map structure */
caddr_t qdbase[NQD]; /* base address of each QDSS unit */
-struct buf qdbuf[NQD]; /* buf structs used by strategy */
short qdopened[NQD]; /* graphics device is open exclusive use */
/*
@@ -1602,8 +1601,7 @@ qdwrite(dev, uio, flag)
/*
* this is a DMA xfer from user space
*/
- return (physio(qd_strategy, &qdbuf[unit],
- dev, B_WRITE, minphys, uio));
+ return (physio(qd_strategy, NULL, dev, B_WRITE, minphys, uio));
}
return (ENXIO);
}
@@ -1631,8 +1629,7 @@ qdread(dev, uio, flag)
/*
* this is a bitmap-to-processor xfer
*/
- return (physio(qd_strategy, &qdbuf[unit],
- dev, B_READ, minphys, uio));
+ return (physio(qd_strategy, NULL, dev, B_READ, minphys, uio));
}
return (ENXIO);
}