summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/machdep.c36
-rw-r--r--sys/i386/isa/labpc.c90
-rw-r--r--sys/i386/isa/matcd/matcd.c70
-rw-r--r--sys/i386/isa/mcd.c66
-rw-r--r--sys/i386/isa/scd.c64
-rw-r--r--sys/i386/isa/wt.c28
6 files changed, 177 insertions, 177 deletions
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 72bb9a7..67dc0b8 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -2362,54 +2362,54 @@ Debugger(const char *msg)
* if needed, and signal errors or early completion.
*/
int
-bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel)
+bounds_check_with_label(struct bio *bp, struct disklabel *lp, int wlabel)
{
- struct partition *p = lp->d_partitions + dkpart(bp->b_dev);
+ struct partition *p = lp->d_partitions + dkpart(bp->bio_dev);
int labelsect = lp->d_partitions[0].p_offset;
int maxsz = p->p_size,
- sz = (bp->b_bcount + DEV_BSIZE - 1) >> DEV_BSHIFT;
+ sz = (bp->bio_bcount + DEV_BSIZE - 1) >> DEV_BSHIFT;
/* overwriting disk label ? */
/* XXX should also protect bootstrap in first 8K */
- if (bp->b_blkno + p->p_offset <= LABELSECTOR + labelsect &&
+ if (bp->bio_blkno + p->p_offset <= LABELSECTOR + labelsect &&
#if LABELSECTOR != 0
- bp->b_blkno + p->p_offset + sz > LABELSECTOR + labelsect &&
+ bp->bio_blkno + p->p_offset + sz > LABELSECTOR + labelsect &&
#endif
- (bp->b_iocmd == BIO_WRITE) && wlabel == 0) {
- bp->b_error = EROFS;
+ (bp->bio_cmd == BIO_WRITE) && wlabel == 0) {
+ bp->bio_error = EROFS;
goto bad;
}
#if defined(DOSBBSECTOR) && defined(notyet)
/* overwriting master boot record? */
- if (bp->b_blkno + p->p_offset <= DOSBBSECTOR &&
- (bp->b_iocmd == BIO_WRITE) && wlabel == 0) {
- bp->b_error = EROFS;
+ if (bp->bio_blkno + p->p_offset <= DOSBBSECTOR &&
+ (bp->bio_cmd == BIO_WRITE) && wlabel == 0) {
+ bp->bio_error = EROFS;
goto bad;
}
#endif
/* beyond partition? */
- if (bp->b_blkno < 0 || bp->b_blkno + sz > maxsz) {
+ if (bp->bio_blkno < 0 || bp->bio_blkno + sz > maxsz) {
/* if exactly at end of disk, return an EOF */
- if (bp->b_blkno == maxsz) {
- bp->b_resid = bp->b_bcount;
+ if (bp->bio_blkno == maxsz) {
+ bp->bio_resid = bp->bio_bcount;
return(0);
}
/* or truncate if part of it fits */
- sz = maxsz - bp->b_blkno;
+ sz = maxsz - bp->bio_blkno;
if (sz <= 0) {
- bp->b_error = EINVAL;
+ bp->bio_error = EINVAL;
goto bad;
}
- bp->b_bcount = sz << DEV_BSHIFT;
+ bp->bio_bcount = sz << DEV_BSHIFT;
}
- bp->b_pblkno = bp->b_blkno + p->p_offset;
+ bp->bio_pblkno = bp->bio_blkno + p->p_offset;
return(1);
bad:
- bp->b_ioflags |= BIO_ERROR;
+ bp->bio_flags |= BIO_ERROR;
return(-1);
}
diff --git a/sys/i386/isa/labpc.c b/sys/i386/isa/labpc.c
index 7913534..ba59bc8 100644
--- a/sys/i386/isa/labpc.c
+++ b/sys/i386/isa/labpc.c
@@ -51,7 +51,7 @@
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/buf.h>
-#define b_actf b_act.tqe_next
+#define b_actf bio_queue.tqe_next
#include <sys/dataacq.h>
#include <sys/conf.h>
@@ -122,8 +122,8 @@ struct ctlr
u_short sample_us;
- struct buf start_queue; /* Start queue */
- struct buf *last; /* End of start queue */
+ struct bio start_queue; /* Start queue */
+ struct bio *last; /* End of start queue */
u_char *data;
u_char *data_end;
long tmo; /* Timeout in Herz */
@@ -307,13 +307,13 @@ static ointhand2_t labpcintr;
static void start(struct ctlr *ctlr);
static void
-bp_done(struct buf *bp, int err)
+bp_done(struct bio *bp, int err)
{
- bp->b_error = err;
+ bp->bio_error = err;
- if (err || bp->b_resid)
+ if (err || bp->bio_resid)
{
- bp->b_ioflags |= BIO_ERROR;
+ bp->bio_flags |= BIO_ERROR;
}
biodone(bp);
@@ -322,9 +322,9 @@ bp_done(struct buf *bp, int err)
static void tmo_stop(void *p);
static void
-done_and_start_next(struct ctlr *ctlr, struct buf *bp, int err)
+done_and_start_next(struct ctlr *ctlr, struct bio *bp, int err)
{
- bp->b_resid = ctlr->data_end - ctlr->data;
+ bp->bio_resid = ctlr->data_end - ctlr->data;
ctlr->data = 0;
@@ -592,7 +592,7 @@ static void
tmo_stop(void *p)
{
struct ctlr *ctlr = (struct ctlr *)p;
- struct buf *bp;
+ struct bio *bp;
int s = spltty();
@@ -643,7 +643,7 @@ static void ad_intr(struct ctlr *ctlr)
{
if ((status & (OVERRUN|OVERFLOW)))
{
- struct buf *bp = ctlr->start_queue.b_actf;
+ struct bio *bp = ctlr->start_queue.b_actf;
printf("ad_intr: error: bp %p, data %p, status %x",
(void *)bp, (void *)ctlr->data, status);
@@ -670,7 +670,7 @@ static void ad_intr(struct ctlr *ctlr)
}
else /* FIFO interrupt */
{
- struct buf *bp = ctlr->start_queue.b_actf;
+ struct bio *bp = ctlr->start_queue.b_actf;
if (ctlr->data)
{
@@ -768,7 +768,7 @@ labpcclose(dev_t dev, int flags, int fmt, struct proc *p)
static void
start(struct ctlr *ctlr)
{
- struct buf *bp;
+ struct bio *bp;
if ((bp = ctlr->start_queue.b_actf) == 0)
{
@@ -778,12 +778,12 @@ start(struct ctlr *ctlr)
*/
CR_EXPR(ctlr, 3, &= ~(FIFOINTEN|ERRINTEN));
ctlr->cleared_intr = 1;
- ctlr->start_queue.b_bcount = 0;
+ ctlr->start_queue.bio_bcount = 0;
return;
}
- ctlr->data = (u_char *)bp->b_data;
- ctlr->data_end = ctlr->data + bp->b_bcount;
+ ctlr->data = (u_char *)bp->bio_data;
+ ctlr->data_end = ctlr->data + bp->bio_bcount;
if (ctlr->err)
{
@@ -800,7 +800,7 @@ start(struct ctlr *ctlr)
}
- (*ctlr->starter)(ctlr, bp->b_bcount);
+ (*ctlr->starter)(ctlr, bp->bio_bcount);
if (!FIFOINTENABLED(ctlr)) /* We can store the data again */
{
@@ -815,21 +815,21 @@ start(struct ctlr *ctlr)
}
static void
-ad_strategy(struct buf *bp, struct ctlr *ctlr)
+ad_strategy(struct bio *bp, struct ctlr *ctlr)
{
int s;
s = spltty();
bp->b_actf = NULL;
- if (ctlr->start_queue.b_bcount)
+ if (ctlr->start_queue.bio_bcount)
{
ctlr->last->b_actf = bp;
ctlr->last = bp;
}
else
{
- ctlr->start_queue.b_bcount = 1;
+ ctlr->start_queue.bio_bcount = 1;
ctlr->start_queue.b_actf = bp;
ctlr->last = bp;
start(ctlr);
@@ -850,14 +850,14 @@ ad_strategy(struct buf *bp, struct ctlr *ctlr)
* 2. No interrupt support yet.
*/
static void
-da_strategy(struct buf *bp, struct ctlr *ctlr)
+da_strategy(struct bio *bp, struct ctlr *ctlr)
{
int len;
u_char *data;
int port;
int i;
- switch(CHAN(bp->b_dev))
+ switch(CHAN(bp->bio_dev))
{
case 0:
port = DAC0L(ctlr);
@@ -868,14 +868,14 @@ da_strategy(struct buf *bp, struct ctlr *ctlr)
break;
case 2: /* Device 2 handles both ports interleaved. */
- if (bp->b_bcount <= 2)
+ if (bp->bio_bcount <= 2)
{
port = DAC0L(ctlr);
break;
}
- len = bp->b_bcount / 2;
- data = (u_char *)bp->b_data;
+ len = bp->bio_bcount / 2;
+ data = (u_char *)bp->bio_data;
for (i = 0; i < len; i++)
{
@@ -885,7 +885,7 @@ da_strategy(struct buf *bp, struct ctlr *ctlr)
loutb(DAC1L(ctlr), *data++);
}
- bp->b_resid = bp->b_bcount & 3;
+ bp->bio_resid = bp->bio_bcount & 3;
bp_done(bp, 0);
return;
@@ -896,11 +896,11 @@ da_strategy(struct buf *bp, struct ctlr *ctlr)
/* Port 0 or 1 falls through to here.
*/
- if (bp->b_bcount & 1) /* Odd transfers are illegal */
+ if (bp->bio_bcount & 1) /* Odd transfers are illegal */
bp_done(bp, EIO);
- len = bp->b_bcount;
- data = (u_char *)bp->b_data;
+ len = bp->bio_bcount;
+ data = (u_char *)bp->bio_data;
for (i = 0; i < len; i++)
{
@@ -908,7 +908,7 @@ da_strategy(struct buf *bp, struct ctlr *ctlr)
loutb(port, *data++);
}
- bp->b_resid = 0;
+ bp->bio_resid = 0;
bp_done(bp, 0);
}
@@ -931,28 +931,28 @@ static void flush_dcr(struct ctlr *ctlr)
/* do: Digital output
*/
static void
-digital_out_strategy(struct buf *bp, struct ctlr *ctlr)
+digital_out_strategy(struct bio *bp, struct ctlr *ctlr)
{
int len;
u_char *data;
int port;
int i;
- int chan = CHAN(bp->b_dev);
+ int chan = CHAN(bp->bio_dev);
ctlr->dcr_val &= ~set_input[chan]; /* Digital out: Clear bit */
flush_dcr(ctlr);
port = PORTX(ctlr, chan);
- len = bp->b_bcount;
- data = (u_char *)bp->b_data;
+ len = bp->bio_bcount;
+ data = (u_char *)bp->bio_data;
for (i = 0; i < len; i++)
{
loutb(port, *data++);
}
- bp->b_resid = 0;
+ bp->bio_resid = 0;
bp_done(bp, 0);
}
@@ -960,39 +960,39 @@ digital_out_strategy(struct buf *bp, struct ctlr *ctlr)
/* digital_in_strategy: Digital input
*/
static void
-digital_in_strategy(struct buf *bp, struct ctlr *ctlr)
+digital_in_strategy(struct bio *bp, struct ctlr *ctlr)
{
int len;
u_char *data;
int port;
int i;
- int chan = CHAN(bp->b_dev);
+ int chan = CHAN(bp->bio_dev);
ctlr->dcr_val |= set_input[chan]; /* Digital in: Set bit */
flush_dcr(ctlr);
port = PORTX(ctlr, chan);
- len = bp->b_bcount;
- data = (u_char *)bp->b_data;
+ len = bp->bio_bcount;
+ data = (u_char *)bp->bio_data;
for (i = 0; i < len; i++)
{
*data++ = inb(port);
}
- bp->b_resid = 0;
+ bp->bio_resid = 0;
bp_done(bp, 0);
}
static void
-labpcstrategy(struct buf *bp)
+labpcstrategy(struct bio *bp)
{
- struct ctlr *ctlr = labpcs[UNIT(bp->b_dev)];
+ struct ctlr *ctlr = labpcs[UNIT(bp->bio_dev)];
- if (DIGITAL(bp->b_dev)) {
- if (bp->b_iocmd == BIO_READ) {
+ if (DIGITAL(bp->bio_dev)) {
+ if (bp->bio_cmd == BIO_READ) {
ctlr->starter = null_start;
ctlr->stop = all_stop;
ctlr->intr = null_intr;
@@ -1007,7 +1007,7 @@ labpcstrategy(struct buf *bp)
}
}
else {
- if (bp->b_iocmd == BIO_READ) {
+ if (bp->bio_cmd == BIO_READ) {
ctlr->starter = INTERVAL(ctlr->dev) ? ad_interval_start : ad_start;
ctlr->stop = all_stop;
diff --git a/sys/i386/isa/matcd/matcd.c b/sys/i386/isa/matcd/matcd.c
index 9993932..4b48446 100644
--- a/sys/i386/isa/matcd/matcd.c
+++ b/sys/i386/isa/matcd/matcd.c
@@ -403,7 +403,7 @@ struct matcd_mbx {
short nblk;
int sz;
u_long skip;
- struct buf *bp;
+ struct bio *bp;
int p_offset;
short count;
};
@@ -447,7 +447,7 @@ static struct matcd_data {
#define ERR_FATAL 3 /*This cannot be recovered from*/
-static struct buf_queue_head request_head[NUMCTRLRS]; /*<18>A queue for each host interface*/
+static struct bio_queue_head request_head[NUMCTRLRS]; /*<18>A queue for each host interface*/
static int nextcontroller=0; /*<18>Number of interface units found*/
static int drivepresent=0; /*<18>Don't change this - see license*/
static int iftype; /*<20>Probe/Attach i.f. type relay*/
@@ -849,52 +849,52 @@ int matcdclose(dev_t dev, int flags, int fmt,
rely on the current request starting the next one before exiting.
---------------------------------------------------------------------------*/
-void matcdstrategy(struct buf *bp)
+void matcdstrategy(struct bio *bp)
{
struct matcd_data *cd;
int s;
int ldrive,controller;
- ldrive=matcd_ldrive(bp->b_dev);
- controller=matcd_controller(bp->b_dev);
+ ldrive=matcd_ldrive(bp->bio_dev);
+ controller=matcd_controller(bp->bio_dev);
cd= &matcd_data[ldrive];
#ifdef DEBUGIO
printf("matcd%d: Strategy: buf=0x%lx, block#=%ld bcount=%ld\n",
- ldrive,(unsigned long)bp,bp->b_blkno,bp->b_bcount);
+ ldrive,(unsigned long)bp,bp->bio_blkno,bp->bio_bcount);
#endif /*DEBUGIO*/
- if (ldrive >= TOTALDRIVES || bp->b_blkno < 0) {
+ if (ldrive >= TOTALDRIVES || bp->bio_blkno < 0) {
printf("matcd%d: Bogus parameters received - kernel may be corrupted\n",ldrive);
- bp->b_error=EINVAL;
+ bp->bio_error=EINVAL;
goto bad;
}
if (!(cd->flags & MATCDLABEL)) {
- bp->b_error = EIO;
+ bp->bio_error = EIO;
goto bad;
}
- if (!(bp->b_iocmd == BIO_READ)) {
- bp->b_error = EROFS;
+ if (!(bp->bio_cmd == BIO_READ)) {
+ bp->bio_error = EROFS;
goto bad;
}
- if (bp->b_bcount==0) /*Request is zero-length - all done*/
+ if (bp->bio_bcount==0) /*Request is zero-length - all done*/
goto done;
- if (matcd_partition(bp->b_dev) != RAW_PART) {
+ if (matcd_partition(bp->bio_dev) != RAW_PART) {
if (bounds_check_with_label(bp,&cd->dlabel,1) <= 0) {
goto done;
}
} else {
- bp->b_pblkno=bp->b_blkno;
- bp->b_resid=0;
+ bp->bio_pblkno=bp->bio_blkno;
+ bp->bio_resid=0;
}
s=splbio(); /*Make sure we don't get intr'ed*/
- bufqdisksort(&request_head[controller], bp);/*Add new request (bp) to queue (dp
+ bioqdisksort(&request_head[controller], bp);/*Add new request (bp) to queue (dp
and sort the requests in a way that
may not be ideal for CD-ROM media*/
@@ -905,8 +905,8 @@ void matcdstrategy(struct buf *bp)
splx(s); /*Return priorities to normal*/
return; /*All done*/
-bad: bp->b_ioflags |= BIO_ERROR; /*Request bad in some way*/
-done: bp->b_resid = bp->b_bcount; /*Show amount of data un read*/
+bad: bp->bio_flags |= BIO_ERROR; /*Request bad in some way*/
+done: bp->bio_resid = bp->bio_bcount; /*Show amount of data un read*/
biodone(bp); /*Signal we have done all we plan to*/
return;
}
@@ -919,17 +919,17 @@ done: bp->b_resid = bp->b_bcount; /*Show amount of data un read*/
static void matcd_start(int controller)
{
struct matcd_data *cd;
- struct buf *bp;
+ struct bio *bp;
struct partition *p;
int part,ldrive;
- bp = bufq_first(&request_head[controller]);
+ bp = bioq_first(&request_head[controller]);
if (bp == NULL) { /*Nothing on read queue to do?*/
wakeup((caddr_t)&matcd_data->status); /*Wakeup any blocked*/
return; /* opens, ioctls, etc*/
}
- ldrive=matcd_ldrive(bp->b_dev); /*Get logical drive#*/
+ ldrive=matcd_ldrive(bp->bio_dev); /*Get logical drive#*/
cd=&matcd_data[ldrive]; /*Get pointer to data for this drive*/
#ifdef DEBUGIO
printf("matcd%d: In start controller %d\n",ldrive,controller);
@@ -947,9 +947,9 @@ static void matcd_start(int controller)
get the command to do and issue it
*/
- bufq_remove(&request_head[controller], bp);
+ bioq_remove(&request_head[controller], bp);
- part=matcd_partition(bp->b_dev);
+ part=matcd_partition(bp->bio_dev);
p=cd->dlabel.d_partitions + part;
if_state[controller] |= BUSBUSY;/*<18>Mark bus as busy*/
@@ -1351,7 +1351,7 @@ matcd_attach(struct isa_device *dev)
#endif /*DEBUGPROBE*/
printf("matcdc%d Host interface type %d\n",
nextcontroller,iftype);
- bufq_init(&request_head[nextcontroller]);
+ bioq_init(&request_head[nextcontroller]);
for (cdrive=0; cdrive<4; cdrive++) { /*We're hunting drives...*/
zero_cmd(cmd);
cmd[0]=NOP; /*A reasonably harmless command.
@@ -1836,7 +1836,7 @@ static void matcd_blockread(int state)
int ldrive,cdrive;
int port, controller;
short iftype;
- struct buf *bp;
+ struct bio *bp;
struct matcd_data *cd;
int i;
struct matcd_read2 rbuf;
@@ -1888,17 +1888,17 @@ loop:
#ifdef DEBUGIO
printf("matcd%d: A mbx %x bp %x b_bcount %x sz %x\n",
ldrive,(unsigned int)mbx,(unsigned int)bp,
- (unsigned int)bp->b_bcount,mbx->sz);
+ (unsigned int)bp->bio_bcount,mbx->sz);
#endif /*DEBUGIO*/
- mbx->nblk = (bp->b_bcount + (mbx->sz-1)) / mbx->sz;
+ mbx->nblk = (bp->bio_bcount + (mbx->sz-1)) / mbx->sz;
mbx->skip=0;
nextblock:
#ifdef DEBUGIO
printf("matcd%d: at Nextblock b_blkno %d\n",
- ldrive,(unsigned int)bp->b_blkno);
+ ldrive,(unsigned int)bp->bio_blkno);
#endif /*DEBUGIO*/
- blknum=(bp->b_blkno / (mbx->sz/DEV_BSIZE))
+ blknum=(bp->bio_blkno / (mbx->sz/DEV_BSIZE))
+ mbx->p_offset + mbx->skip/mbx->sz;
blk_to_msf(blknum,rbuf.start_msf);
@@ -1940,7 +1940,7 @@ nextblock:
#ifdef DEBUGIO
printf("matcd%d: Data Phase\n",ldrive);
#endif /*DEBUGIO*/
- addr=bp->b_data + mbx->skip;
+ addr=bp->bio_data + mbx->skip;
#ifdef DEBUGIO
printf("matcd%d: Xfer Addr %x size %x",
ldrive,(unsigned int)addr,mbx->sz);
@@ -1982,7 +1982,7 @@ nextblock:
if (status & MATCD_ST_ERROR) {
i=get_error(port,ldrive,cdrive);
printf("matcd%d: %s while reading block %d [Soft]\n",
- ldrive,matcderrors[i],(int)bp->b_blkno);
+ ldrive,matcderrors[i],(int)bp->bio_blkno);
media_chk(cd,i,ldrive,0);/*<14>was wrong place*/
}
@@ -1990,7 +1990,7 @@ nextblock:
mbx->skip += mbx->sz;
goto nextblock; /*Oooooh, you flunk the course*/
}
- bp->b_resid=0;
+ bp->bio_resid=0;
biodone(bp); /*Signal transfer complete*/
unlockbus(ldrive>>2, ldrive); /*Release bus lock*/
@@ -2014,7 +2014,7 @@ nextblock:
errtyp=get_error(port,ldrive,cdrive);
printf("matcd%d: %s while reading block %d\n",
- ldrive,matcderrors[errtyp],(int)bp->b_blkno);
+ ldrive,matcderrors[errtyp],(int)bp->bio_blkno);
if (media_chk(cd,errtyp,ldrive,0)==0) {
errtyp=chk_error(errtyp);
@@ -2035,8 +2035,8 @@ nextblock:
<14> has been removed by the user. In both cases there is no retry
<14> for this call. We will invalidate the label in both cases.
*/
- bp->b_ioflags |= BIO_ERROR;
- bp->b_resid = bp->b_bcount;
+ bp->bio_flags |= BIO_ERROR;
+ bp->bio_resid = bp->bio_bcount;
biodone(bp);
unlockbus(ldrive>>2, ldrive);
matcd_start(controller);
diff --git a/sys/i386/isa/mcd.c b/sys/i386/isa/mcd.c
index 70614d7..1bdc726 100644
--- a/sys/i386/isa/mcd.c
+++ b/sys/i386/isa/mcd.c
@@ -116,7 +116,7 @@ struct mcd_mbx {
short nblk;
int sz;
u_long skip;
- struct buf *bp;
+ struct bio *bp;
int p_offset;
short count;
short mode;
@@ -141,7 +141,7 @@ static struct mcd_data {
short curr_mode;
struct mcd_read2 lastpb;
short debug;
- struct buf_queue_head head; /* head of buf queue */
+ struct bio_queue_head head; /* head of bio queue */
struct mcd_mbx mbx;
} mcd_data[NMCD];
@@ -250,7 +250,7 @@ int mcd_attach(struct isa_device *dev)
cd->iobase = dev->id_iobase;
cd->flags |= MCDINIT;
mcd_soft_reset(unit);
- bufq_init(&cd->head);
+ bioq_init(&cd->head);
#ifdef NOTYET
/* wire controller for interrupts and dma */
@@ -385,48 +385,48 @@ int mcdclose(dev_t dev, int flags, int fmt, struct proc *p)
}
void
-mcdstrategy(struct buf *bp)
+mcdstrategy(struct bio *bp)
{
struct mcd_data *cd;
int s;
- int unit = mcd_unit(bp->b_dev);
+ int unit = mcd_unit(bp->bio_dev);
cd = mcd_data + unit;
/* test validity */
/*MCD_TRACE("strategy: buf=0x%lx, unit=%ld, block#=%ld bcount=%ld\n",
- bp,unit,bp->b_blkno,bp->b_bcount);*/
- if (unit >= NMCD || bp->b_blkno < 0) {
+ bp,unit,bp->bio_blkno,bp->bio_bcount);*/
+ if (unit >= NMCD || bp->bio_blkno < 0) {
printf("mcdstrategy: unit = %d, blkno = %ld, bcount = %ld\n",
- unit, (long)bp->b_blkno, bp->b_bcount);
+ unit, (long)bp->bio_blkno, bp->bio_bcount);
printf("mcd: mcdstratregy failure");
- bp->b_error = EINVAL;
- bp->b_ioflags |= BIO_ERROR;
+ bp->bio_error = EINVAL;
+ bp->bio_flags |= BIO_ERROR;
goto bad;
}
/* if device invalidated (e.g. media change, door open), error */
if (!(cd->flags & MCDVALID)) {
MCD_TRACE("strategy: drive not valid\n");
- bp->b_error = EIO;
+ bp->bio_error = EIO;
goto bad;
}
/* read only */
- if (!(bp->b_iocmd == BIO_READ)) {
- bp->b_error = EROFS;
+ if (!(bp->bio_cmd == BIO_READ)) {
+ bp->bio_error = EROFS;
goto bad;
}
/* no data to read */
- if (bp->b_bcount == 0)
+ if (bp->bio_bcount == 0)
goto done;
/* for non raw access, check partition limits */
- if (mcd_part(bp->b_dev) != RAW_PART) {
+ if (mcd_part(bp->bio_dev) != RAW_PART) {
if (!(cd->flags & MCDLABEL)) {
- bp->b_error = EIO;
+ bp->bio_error = EIO;
goto bad;
}
/* adjust transfer if necessary */
@@ -434,13 +434,13 @@ MCD_TRACE("strategy: drive not valid\n");
goto done;
}
} else {
- bp->b_pblkno = bp->b_blkno;
- bp->b_resid = 0;
+ bp->bio_pblkno = bp->bio_blkno;
+ bp->bio_resid = 0;
}
/* queue it */
s = splbio();
- bufqdisksort(&cd->head, bp);
+ bioqdisksort(&cd->head, bp);
splx(s);
/* now check whether we can perform processing */
@@ -448,9 +448,9 @@ MCD_TRACE("strategy: drive not valid\n");
return;
bad:
- bp->b_ioflags |= BIO_ERROR;
+ bp->bio_flags |= BIO_ERROR;
done:
- bp->b_resid = bp->b_bcount;
+ bp->bio_resid = bp->bio_bcount;
biodone(bp);
return;
}
@@ -459,7 +459,7 @@ static void mcd_start(int unit)
{
struct mcd_data *cd = mcd_data + unit;
struct partition *p;
- struct buf *bp;
+ struct bio *bp;
int s = splbio();
if (cd->flags & MCDMBXBSY) {
@@ -467,11 +467,11 @@ static void mcd_start(int unit)
return;
}
- bp = bufq_first(&cd->head);
+ bp = bioq_first(&cd->head);
if (bp != 0) {
/* block found to process, dequeue */
/*MCD_TRACE("mcd_start: found block bp=0x%x\n",bp,0,0,0);*/
- bufq_remove(&cd->head, bp);
+ bioq_remove(&cd->head, bp);
splx(s);
} else {
/* nothing to do */
@@ -485,10 +485,10 @@ static void mcd_start(int unit)
return;
}
- p = cd->dlabel.d_partitions + mcd_part(bp->b_dev);
+ p = cd->dlabel.d_partitions + mcd_part(bp->bio_dev);
cd->flags |= MCDMBXBSY;
- if (cd->partflags[mcd_part(bp->b_dev)] & MCDREADRAW)
+ if (cd->partflags[mcd_part(bp->bio_dev)] & MCDREADRAW)
cd->flags |= MCDREADRAW;
cd->mbx.unit = unit;
cd->mbx.port = cd->iobase;
@@ -993,7 +993,7 @@ mcd_doread(int state, struct mcd_mbx *mbxin)
int port = mbx->port;
int com_port = mbx->port + mcd_command;
int data_port = mbx->port + mcd_rdata;
- struct buf *bp = mbx->bp;
+ struct bio *bp = mbx->bp;
struct mcd_data *cd = mcd_data + unit;
int rm,i,k;
@@ -1086,11 +1086,11 @@ retry_mode:
RDELAY_WAITMODE-mbx->count);
modedone:
/* for first block */
- mbx->nblk = (bp->b_bcount + (mbx->sz-1)) / mbx->sz;
+ mbx->nblk = (bp->bio_bcount + (mbx->sz-1)) / mbx->sz;
mbx->skip = 0;
nextblock:
- blknum = (bp->b_blkno / (mbx->sz/DEV_BSIZE))
+ blknum = (bp->bio_blkno / (mbx->sz/DEV_BSIZE))
+ mbx->p_offset + mbx->skip/mbx->sz;
MCD_TRACE("mcd_doread: read blknum=%d for bp=%p\n",
@@ -1131,7 +1131,7 @@ retry_read:
RDELAY_WAITREAD-mbx->count);
got_it:
/* data is ready */
- addr = bp->b_data + mbx->skip;
+ addr = bp->bio_data + mbx->skip;
outb(port+mcd_ctl2,0x04); /* XXX */
for (i=0; i<mbx->sz; i++)
@@ -1153,7 +1153,7 @@ retry_read:
}
/* return buffer */
- bp->b_resid = 0;
+ bp->bio_resid = 0;
biodone(bp);
cd->flags &= ~(MCDMBXBSY|MCDREADRAW);
@@ -1184,8 +1184,8 @@ readerr:
}
harderr:
/* invalidate the buffer */
- bp->b_ioflags |= BIO_ERROR;
- bp->b_resid = bp->b_bcount;
+ bp->bio_flags |= BIO_ERROR;
+ bp->bio_resid = bp->bio_bcount;
biodone(bp);
cd->flags &= ~(MCDMBXBSY|MCDREADRAW);
diff --git a/sys/i386/isa/scd.c b/sys/i386/isa/scd.c
index 6863bf6..d0ae35e 100644
--- a/sys/i386/isa/scd.c
+++ b/sys/i386/isa/scd.c
@@ -104,7 +104,7 @@ struct scd_mbx {
short nblk;
int sz;
u_long skip;
- struct buf *bp;
+ struct bio *bp;
int p_offset;
short count;
};
@@ -128,7 +128,7 @@ static struct scd_data {
struct ioc_play_msf last_play;
short audio_status;
- struct buf_queue_head head; /* head of buf queue */
+ struct bio_queue_head head; /* head of bio queue */
struct scd_mbx mbx;
} scd_data[NSCD];
@@ -213,7 +213,7 @@ scd_attach(struct isa_device *dev)
cd->flags = SCDINIT;
cd->audio_status = CD_AS_AUDIO_INVALID;
- bufq_init(&cd->head);
+ bioq_init(&cd->head);
make_dev(&scd_cdevsw, dkmakeminor(unit, 0, 0),
UID_ROOT, GID_OPERATOR, 0640, "rscd%da", unit);
@@ -310,56 +310,56 @@ scdclose(dev_t dev, int flags, int fmt, struct proc *p)
}
static void
-scdstrategy(struct buf *bp)
+scdstrategy(struct bio *bp)
{
struct scd_data *cd;
int s;
- int unit = scd_unit(bp->b_dev);
+ int unit = scd_unit(bp->bio_dev);
cd = scd_data + unit;
XDEBUG(2, ("scd%d: DEBUG: strategy: block=%ld, bcount=%ld\n",
- unit, (long)bp->b_blkno, bp->b_bcount));
+ unit, (long)bp->bio_blkno, bp->bio_bcount));
- if (unit >= NSCD || bp->b_blkno < 0 || (bp->b_bcount % SCDBLKSIZE)) {
+ if (unit >= NSCD || bp->bio_blkno < 0 || (bp->bio_bcount % SCDBLKSIZE)) {
printf("scd%d: strategy failure: blkno = %ld, bcount = %ld\n",
- unit, (long)bp->b_blkno, bp->b_bcount);
- bp->b_error = EINVAL;
- bp->b_ioflags |= BIO_ERROR;
+ unit, (long)bp->bio_blkno, bp->bio_bcount);
+ bp->bio_error = EINVAL;
+ bp->bio_flags |= BIO_ERROR;
goto bad;
}
/* if device invalidated (e.g. media change, door open), error */
if (!(cd->flags & SCDVALID)) {
printf("scd%d: media changed\n", unit);
- bp->b_error = EIO;
+ bp->bio_error = EIO;
goto bad;
}
/* read only */
- if (!(bp->b_iocmd == BIO_READ)) {
- bp->b_error = EROFS;
+ if (!(bp->bio_cmd == BIO_READ)) {
+ bp->bio_error = EROFS;
goto bad;
}
/* no data to read */
- if (bp->b_bcount == 0)
+ if (bp->bio_bcount == 0)
goto done;
if (!(cd->flags & SCDTOC)) {
- bp->b_error = EIO;
+ bp->bio_error = EIO;
goto bad;
}
/* adjust transfer if necessary */
if (bounds_check_with_label(bp,&cd->dlabel,1) <= 0)
goto done;
- bp->b_pblkno = bp->b_blkno;
- bp->b_resid = 0;
+ bp->bio_pblkno = bp->bio_blkno;
+ bp->bio_resid = 0;
/* queue it */
s = splbio();
- bufqdisksort(&cd->head, bp);
+ bioqdisksort(&cd->head, bp);
splx(s);
/* now check whether we can perform processing */
@@ -367,9 +367,9 @@ scdstrategy(struct buf *bp)
return;
bad:
- bp->b_ioflags |= BIO_ERROR;
+ bp->bio_flags |= BIO_ERROR;
done:
- bp->b_resid = bp->b_bcount;
+ bp->bio_resid = bp->bio_bcount;
biodone(bp);
return;
}
@@ -378,7 +378,7 @@ static void
scd_start(int unit)
{
struct scd_data *cd = scd_data + unit;
- struct buf *bp;
+ struct bio *bp;
struct partition *p;
int s = splbio();
@@ -387,10 +387,10 @@ scd_start(int unit)
return;
}
- bp = bufq_first(&cd->head);
+ bp = bioq_first(&cd->head);
if (bp != 0) {
/* block found to process, dequeue */
- bufq_remove(&cd->head, bp);
+ bioq_remove(&cd->head, bp);
cd->flags |= SCDMBXBSY;
splx(s);
} else {
@@ -399,7 +399,7 @@ scd_start(int unit)
return;
}
- p = cd->dlabel.d_partitions + scd_part(bp->b_dev);
+ p = cd->dlabel.d_partitions + scd_part(bp->bio_dev);
cd->mbx.unit = unit;
cd->mbx.port = cd->iobase;
@@ -793,7 +793,7 @@ scd_doread(int state, struct scd_mbx *mbxin)
struct scd_mbx *mbx = (state!=SCD_S_BEGIN) ? mbxsave : mbxin;
int unit = mbx->unit;
int port = mbx->port;
- struct buf *bp = mbx->bp;
+ struct bio *bp = mbx->bp;
struct scd_data *cd = scd_data + unit;
int reg,i;
int blknum;
@@ -837,14 +837,14 @@ trystat:
mbx->sz = cd->blksize;
/* for first block */
- mbx->nblk = (bp->b_bcount + (mbx->sz-1)) / mbx->sz;
+ mbx->nblk = (bp->bio_bcount + (mbx->sz-1)) / mbx->sz;
mbx->skip = 0;
nextblock:
if (!(cd->flags & SCDVALID))
goto changed;
- blknum = (bp->b_blkno / (mbx->sz/DEV_BSIZE))
+ blknum = (bp->bio_blkno / (mbx->sz/DEV_BSIZE))
+ mbx->p_offset + mbx->skip/mbx->sz;
XDEBUG(2, ("scd%d: scd_doread: read blknum=%d\n", unit, blknum));
@@ -959,7 +959,7 @@ writeparam:
got_data:
/* data is ready */
- addr = bp->b_data + mbx->skip;
+ addr = bp->bio_data + mbx->skip;
write_control(port, CBIT_DATA_READY_CLEAR);
insb(port+IREG_DATA, addr, mbx->sz);
@@ -1026,7 +1026,7 @@ got_param:
}
/* return buffer */
- bp->b_resid = 0;
+ bp->bio_resid = 0;
biodone(bp);
cd->flags &= ~SCDMBXBSY;
@@ -1042,9 +1042,9 @@ readerr:
}
harderr:
/* invalidate the buffer */
- bp->b_error = EIO;
- bp->b_ioflags |= BIO_ERROR;
- bp->b_resid = bp->b_bcount;
+ bp->bio_error = EIO;
+ bp->bio_flags |= BIO_ERROR;
+ bp->bio_resid = bp->bio_bcount;
biodone(bp);
cd->flags &= ~SCDMBXBSY;
diff --git a/sys/i386/isa/wt.c b/sys/i386/isa/wt.c
index 0aa7015..f6e65a5 100644
--- a/sys/i386/isa/wt.c
+++ b/sys/i386/isa/wt.c
@@ -506,15 +506,15 @@ wtioctl (dev_t dev, u_long cmd, caddr_t arg, int flags, struct proc *p)
* Strategy routine.
*/
static void
-wtstrategy (struct buf *bp)
+wtstrategy (struct bio *bp)
{
- int u = minor (bp->b_dev) & T_UNIT;
+ int u = minor (bp->bio_dev) & T_UNIT;
wtinfo_t *t = wttab + u;
int s;
- bp->b_resid = bp->b_bcount;
+ bp->bio_resid = bp->bio_bcount;
if (u >= NWT || t->type == UNKNOWN) {
- bp->b_error = ENXIO;
+ bp->bio_error = ENXIO;
goto err2xit;
}
@@ -522,12 +522,12 @@ wtstrategy (struct buf *bp)
if (t->flags & TPVOL)
goto xit;
- if (bp->b_bcount % t->bsize != 0) {
- bp->b_error = EINVAL;
+ if (bp->bio_bcount % t->bsize != 0) {
+ bp->bio_error = EINVAL;
goto err2xit;
}
- if (bp->b_iocmd == BIO_READ) {
+ if (bp->bio_cmd == BIO_READ) {
/* Check read access and no previous write to this tape. */
if (! (t->flags & TPREAD) || (t->flags & TPWANY))
goto errxit;
@@ -561,21 +561,21 @@ wtstrategy (struct buf *bp)
}
}
- if (! bp->b_bcount)
+ if (! bp->bio_bcount)
goto xit;
t->flags &= ~TPEXCEP;
s = splbio ();
- if (wtstart (t, bp->b_iocmd == BIO_READ ? ISADMA_READ : ISADMA_WRITE,
- bp->b_data, bp->b_bcount)) {
- wtwait (t, 0, (bp->b_iocmd == BIO_READ) ? "wtread" : "wtwrite");
- bp->b_resid -= t->dmacount;
+ if (wtstart (t, bp->bio_cmd == BIO_READ ? ISADMA_READ : ISADMA_WRITE,
+ bp->bio_data, bp->bio_bcount)) {
+ wtwait (t, 0, (bp->bio_cmd == BIO_READ) ? "wtread" : "wtwrite");
+ bp->bio_resid -= t->dmacount;
}
splx (s);
if (t->flags & TPEXCEP) {
-errxit: bp->b_error = EIO;
-err2xit: bp->b_ioflags |= BIO_ERROR;
+errxit: bp->bio_error = EIO;
+err2xit: bp->bio_flags |= BIO_ERROR;
}
xit: biodone (bp);
return;
OpenPOWER on IntegriCloud