diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 2000-03-20 10:44:49 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2000-03-20 10:44:49 +0000 |
| commit | 21144e3bf1f416a758f6546bfabfa8e4e8cba507 (patch) | |
| tree | c87da548b12fd12c48f1e5c89d087ddfa088ee78 /sys/cam | |
| parent | 44bdcfa638d9ca31180090798a88116220f7f625 (diff) | |
Notes
Diffstat (limited to 'sys/cam')
| -rw-r--r-- | sys/cam/cam_periph.c | 13 | ||||
| -rw-r--r-- | sys/cam/scsi/scsi_cd.c | 2 | ||||
| -rw-r--r-- | sys/cam/scsi/scsi_da.c | 2 | ||||
| -rw-r--r-- | sys/cam/scsi/scsi_pt.c | 2 | ||||
| -rw-r--r-- | sys/cam/scsi/scsi_sa.c | 10 | ||||
| -rw-r--r-- | sys/cam/scsi/scsi_target.c | 2 |
6 files changed, 15 insertions, 16 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 2b6445f61a7d..080912bc5b08 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -556,7 +556,7 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) } if (dirs[i] & CAM_DIR_OUT) { - flags[i] = B_WRITE; + flags[i] = BIO_WRITE; if (!useracc(*data_ptrs[i], lengths[i], VM_PROT_READ)) { printf("cam_periph_mapmem: error, " @@ -568,12 +568,8 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) } } - /* - * XXX this check is really bogus, since B_WRITE currently - * is all 0's, and so it is "set" all the time. - */ if (dirs[i] & CAM_DIR_IN) { - flags[i] |= B_READ; + flags[i] = BIO_READ; if (!useracc(*data_ptrs[i], lengths[i], VM_PROT_WRITE)) { printf("cam_periph_mapmem: error, " @@ -610,7 +606,10 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) mapinfo->bp[i]->b_bufsize = lengths[i]; /* set the flags */ - mapinfo->bp[i]->b_flags = flags[i] | B_PHYS; + mapinfo->bp[i]->b_flags = B_PHYS; + + /* set the direction */ + mapinfo->bp[i]->b_iocmd = flags[i]; /* map the buffer into kernel memory */ vmapbuf(mapinfo->bp[i]); diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index c2e2e2507690..11df7be93a6e 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -1432,7 +1432,7 @@ cdstart(struct cam_periph *periph, union ccb *start_ccb) (bp->b_flags & B_ORDERED) != 0 ? MSG_ORDERED_Q_TAG : MSG_SIMPLE_Q_TAG, - /* read */bp->b_flags & B_READ, + /* read */bp->b_iocmd == BIO_READ, /* byte2 */ 0, /* minimum_cmd_size */ 10, /* lba */ bp->b_pblkno, diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index a9e1e219d091..ef359246fc0f 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -1056,7 +1056,7 @@ dastart(struct cam_periph *periph, union ccb *start_ccb) /*retries*/4, dadone, tag_code, - bp->b_flags & B_READ, + bp->b_iocmd == BIO_READ, /*byte2*/0, softc->minimum_cmd_size, bp->b_pblkno, diff --git a/sys/cam/scsi/scsi_pt.c b/sys/cam/scsi/scsi_pt.c index 4f7b8e03bb49..911f46a83be2 100644 --- a/sys/cam/scsi/scsi_pt.c +++ b/sys/cam/scsi/scsi_pt.c @@ -539,7 +539,7 @@ ptstart(struct cam_periph *periph, union ccb *start_ccb) /*retries*/4, ptdone, MSG_SIMPLE_Q_TAG, - bp->b_flags & B_READ, + bp->b_iocmd == BIO_READ, /*byte2*/0, bp->b_bcount, bp->b_data, diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c index 5bcb8027421e..77b044576d00 100644 --- a/sys/cam/scsi/scsi_sa.c +++ b/sys/cam/scsi/scsi_sa.c @@ -710,7 +710,7 @@ sastrategy(struct buf *bp) CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("sastrategy: enqueuing a %d " "%s byte %s queue count now %d\n", (int) bp->b_bcount, (softc->flags & SA_FLAG_FIXED)? "fixed" : "variable", - (bp->b_flags & B_READ)? "read" : "write", softc->queue_count)); + (bp->b_iocmd == BIO_READ)? "read" : "write", softc->queue_count)); splx(s); @@ -1491,7 +1491,7 @@ sastart(struct cam_periph *periph, union ccb *start_ccb) bp->b_resid = bp->b_bcount; bp->b_flags |= B_ERROR; if ((softc->flags & SA_FLAG_EOM_PENDING) != 0) { - if ((bp->b_flags & B_READ) == 0) + if (bp->b_iocmd == BIO_WRITE) bp->b_error = ENOSPC; else bp->b_error = EIO; @@ -1568,10 +1568,10 @@ sastart(struct cam_periph *periph, union ccb *start_ccb) * have to do deal with 512 byte or 1KB intermediate * records. */ - softc->dsreg = (bp->b_flags & B_READ)? + softc->dsreg = (bp->b_iocmd == BIO_READ)? MTIO_DSREG_RD : MTIO_DSREG_WR; scsi_sa_read_write(&start_ccb->csio, 0, sadone, - MSG_SIMPLE_Q_TAG, (bp->b_flags & B_READ) != 0, + MSG_SIMPLE_Q_TAG, (bp->b_iocmd == BIO_READ), FALSE, (softc->flags & SA_FLAG_FIXED) != 0, length, bp->b_data, bp->b_bcount, SSD_FULL_SIZE, 120 * 60 * 1000); @@ -1661,7 +1661,7 @@ sadone(struct cam_periph *periph, union ccb *done_ccb) if (csio->resid != 0) { bp->b_flags |= B_ERROR; } - if ((bp->b_flags & B_READ) == 0) { + if (bp->b_iocmd == BIO_WRITE) { softc->flags |= SA_FLAG_TAPE_WRITTEN; softc->filemarks = 0; } diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c index 0b810458b4da..541dbd6d558b 100644 --- a/sys/cam/scsi/scsi_target.c +++ b/sys/cam/scsi/scsi_target.c @@ -1165,7 +1165,7 @@ targstrategy(struct buf *bp) * */ bp->b_resid = bp->b_bcount; - if ((bp->b_flags & B_READ) != 0) { + if (bp->b_iocmd == BIO_READ) { CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH, ("Queued a SEND buffer\n")); bufq_insert_tail(&softc->snd_buf_queue, bp); |
