diff options
Diffstat (limited to 'sys/dev/mfi/mfi.c')
-rw-r--r-- | sys/dev/mfi/mfi.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c index b20ddc5..1a618ce 100644 --- a/sys/dev/mfi/mfi.c +++ b/sys/dev/mfi/mfi.c @@ -2122,6 +2122,8 @@ mfi_build_cdb(int readop, uint8_t byte2, u_int64_t lba, u_int32_t block_count, u return cdb_len; } +extern char *unmapped_buf; + static struct mfi_command * mfi_build_syspdio(struct mfi_softc *sc, struct bio *bio) { @@ -2145,11 +2147,11 @@ mfi_build_syspdio(struct mfi_softc *sc, struct bio *bio) pass->header.cmd = MFI_CMD_PD_SCSI_IO; switch (bio->bio_cmd & 0x03) { case BIO_READ: - flags = MFI_CMD_DATAIN; + flags = MFI_CMD_DATAIN | MFI_CMD_BIO; readop = 1; break; case BIO_WRITE: - flags = MFI_CMD_DATAOUT; + flags = MFI_CMD_DATAOUT | MFI_CMD_BIO; readop = 0; break; default: @@ -2174,7 +2176,7 @@ mfi_build_syspdio(struct mfi_softc *sc, struct bio *bio) pass->sense_addr_hi = (uint32_t)((uint64_t)cm->cm_sense_busaddr >> 32); cm->cm_complete = mfi_bio_complete; cm->cm_private = bio; - cm->cm_data = bio->bio_data; + cm->cm_data = unmapped_buf; cm->cm_len = bio->bio_bcount; cm->cm_sg = &pass->sgl; cm->cm_total_frame_size = MFI_PASS_FRAME_SIZE; @@ -2205,11 +2207,11 @@ mfi_build_ldio(struct mfi_softc *sc, struct bio *bio) switch (bio->bio_cmd & 0x03) { case BIO_READ: io->header.cmd = MFI_CMD_LD_READ; - flags = MFI_CMD_DATAIN; + flags = MFI_CMD_DATAIN | MFI_CMD_BIO; break; case BIO_WRITE: io->header.cmd = MFI_CMD_LD_WRITE; - flags = MFI_CMD_DATAOUT; + flags = MFI_CMD_DATAOUT | MFI_CMD_BIO; break; default: /* TODO: what about BIO_DELETE??? */ @@ -2230,7 +2232,7 @@ mfi_build_ldio(struct mfi_softc *sc, struct bio *bio) io->lba_lo = bio->bio_pblkno & 0xffffffff; cm->cm_complete = mfi_bio_complete; cm->cm_private = bio; - cm->cm_data = bio->bio_data; + cm->cm_data = unmapped_buf; cm->cm_len = bio->bio_bcount; cm->cm_sg = &io->sgl; cm->cm_total_frame_size = MFI_IO_FRAME_SIZE; @@ -2316,6 +2318,10 @@ mfi_mapcmd(struct mfi_softc *sc, struct mfi_command *cm) error = bus_dmamap_load_ccb(sc->mfi_buffer_dmat, cm->cm_dmamap, cm->cm_data, mfi_data_cb, cm, polled); + else if (cm->cm_flags & MFI_CMD_BIO) + error = bus_dmamap_load_bio(sc->mfi_buffer_dmat, + cm->cm_dmamap, cm->cm_private, mfi_data_cb, cm, + polled); else error = bus_dmamap_load(sc->mfi_buffer_dmat, cm->cm_dmamap, cm->cm_data, cm->cm_len, |