Author: kib Date: Thu Jun 5 00:43:32 2014 New Revision: 267084 URL: http://svnweb.freebsd.org/changeset/base/267084
Log: MFC r266848: Add support for the unmapped i/o to mfi(4). Modified: stable/10/sys/dev/mfi/mfi.c stable/10/sys/dev/mfi/mfi_cam.c stable/10/sys/dev/mfi/mfi_disk.c stable/10/sys/dev/mfi/mfi_syspd.c stable/10/sys/dev/mfi/mfivar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mfi/mfi.c ============================================================================== --- stable/10/sys/dev/mfi/mfi.c Thu Jun 5 00:40:48 2014 (r267083) +++ stable/10/sys/dev/mfi/mfi.c Thu Jun 5 00:43:32 2014 (r267084) @@ -2122,6 +2122,8 @@ mfi_build_cdb(int readop, uint8_t byte2, 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, 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, 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, str 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, str 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 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, Modified: stable/10/sys/dev/mfi/mfi_cam.c ============================================================================== --- stable/10/sys/dev/mfi/mfi_cam.c Thu Jun 5 00:40:48 2014 (r267083) +++ stable/10/sys/dev/mfi/mfi_cam.c Thu Jun 5 00:43:32 2014 (r267084) @@ -218,7 +218,7 @@ mfip_cam_action(struct cam_sim *sim, uni cpi->version_num = 1; cpi->hba_inquiry = PI_TAG_ABLE; cpi->target_sprt = 0; - cpi->hba_misc = PIM_NOBUSRESET|PIM_SEQSCAN; + cpi->hba_misc = PIM_NOBUSRESET | PIM_SEQSCAN | PIM_UNMAPPED; cpi->hba_eng_cnt = 0; cpi->max_target = MFI_SCSI_MAX_TARGETS; cpi->max_lun = MFI_SCSI_MAX_LUNS; Modified: stable/10/sys/dev/mfi/mfi_disk.c ============================================================================== --- stable/10/sys/dev/mfi/mfi_disk.c Thu Jun 5 00:40:48 2014 (r267083) +++ stable/10/sys/dev/mfi/mfi_disk.c Thu Jun 5 00:43:32 2014 (r267084) @@ -169,6 +169,7 @@ mfi_disk_attach(device_t dev) sc->ld_disk->d_fwheads = 64; sc->ld_disk->d_fwsectors = 32; } + sc->ld_disk->d_flags = DISKFLAG_UNMAPPED_BIO; disk_create(sc->ld_disk, DISK_VERSION); return (0); Modified: stable/10/sys/dev/mfi/mfi_syspd.c ============================================================================== --- stable/10/sys/dev/mfi/mfi_syspd.c Thu Jun 5 00:40:48 2014 (r267083) +++ stable/10/sys/dev/mfi/mfi_syspd.c Thu Jun 5 00:43:32 2014 (r267084) @@ -143,6 +143,7 @@ mfi_syspd_attach(device_t dev) sc->pd_disk->d_fwheads = 64; sc->pd_disk->d_fwsectors = 32; } + sc->pd_disk->d_flags = DISKFLAG_UNMAPPED_BIO; disk_create(sc->pd_disk, DISK_VERSION); device_printf(dev, " SYSPD volume attached\n"); Modified: stable/10/sys/dev/mfi/mfivar.h ============================================================================== --- stable/10/sys/dev/mfi/mfivar.h Thu Jun 5 00:40:48 2014 (r267083) +++ stable/10/sys/dev/mfi/mfivar.h Thu Jun 5 00:43:32 2014 (r267084) @@ -104,10 +104,11 @@ struct mfi_command { #define MFI_CMD_POLLED (1<<4) #define MFI_CMD_SCSI (1<<5) #define MFI_CMD_CCB (1<<6) -#define MFI_CMD_TBOLT (1<<7) -#define MFI_ON_MFIQ_FREE (1<<8) -#define MFI_ON_MFIQ_READY (1<<9) -#define MFI_ON_MFIQ_BUSY (1<<10) +#define MFI_CMD_BIO (1<<7) +#define MFI_CMD_TBOLT (1<<8) +#define MFI_ON_MFIQ_FREE (1<<9) +#define MFI_ON_MFIQ_READY (1<<10) +#define MFI_ON_MFIQ_BUSY (1<<11) #define MFI_ON_MFIQ_MASK (MFI_ON_MFIQ_FREE | MFI_ON_MFIQ_READY| \ MFI_ON_MFIQ_BUSY) #define MFI_CMD_FLAGS_FMT "\20" \ @@ -117,10 +118,11 @@ struct mfi_command { "\4COMPLETED" \ "\5POLLED" \ "\6SCSI" \ - "\7TBOLT" \ - "\10Q_FREE" \ - "\11Q_READY" \ - "\12Q_BUSY" + "\7BIO" \ + "\10TBOLT" \ + "\11Q_FREE" \ + "\12Q_READY" \ + "\13Q_BUSY" uint8_t retry_for_fw_reset; void (* cm_complete)(struct mfi_command *cm); void *cm_private; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"