summaryrefslogtreecommitdiffstats
path: root/sys/dev/mfi
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-02-12 16:57:20 +0000
committerkib <kib@FreeBSD.org>2013-02-12 16:57:20 +0000
commitbd7f0fa0bb4b7b0f87227e0c4d49a4bd9b113cf0 (patch)
treee550f2c754f1edf951a8b93963ebcfc4fa0d20ce /sys/dev/mfi
parente0a463e76c719f11788ec107b5aa3e2da4e57c0b (diff)
downloadFreeBSD-src-bd7f0fa0bb4b7b0f87227e0c4d49a4bd9b113cf0.zip
FreeBSD-src-bd7f0fa0bb4b7b0f87227e0c4d49a4bd9b113cf0.tar.gz
Reform the busdma API so that new types may be added without modifying
every architecture's busdma_machdep.c. It is done by unifying the bus_dmamap_load_buffer() routines so that they may be called from MI code. The MD busdma is then given a chance to do any final processing in the complete() callback. The cam changes unify the bus_dmamap_load* handling in cam drivers. The arm and mips implementations are updated to track virtual addresses for sync(). Previously this was done in a type specific way. Now it is done in a generic way by recording the list of virtuals in the map. Submitted by: jeff (sponsored by EMC/Isilon) Reviewed by: kan (previous version), scottl, mjacob (isp(4), no objections for target mode changes) Discussed with: ian (arm changes) Tested by: marius (sparc64), mips (jmallet), isci(4) on x86 (jharris), amd64 (Fabian Keil <freebsd-listen@fabiankeil.de>)
Diffstat (limited to 'sys/dev/mfi')
-rw-r--r--sys/dev/mfi/mfi.c10
-rw-r--r--sys/dev/mfi/mfi_cam.c17
-rw-r--r--sys/dev/mfi/mfivar.h1
3 files changed, 12 insertions, 16 deletions
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c
index 7cb19d2..ed759fc 100644
--- a/sys/dev/mfi/mfi.c
+++ b/sys/dev/mfi/mfi.c
@@ -2267,8 +2267,14 @@ mfi_mapcmd(struct mfi_softc *sc, struct mfi_command *cm)
if ((cm->cm_data != NULL) && (cm->cm_frame->header.cmd != MFI_CMD_STP )) {
polled = (cm->cm_flags & MFI_CMD_POLLED) ? BUS_DMA_NOWAIT : 0;
- error = bus_dmamap_load(sc->mfi_buffer_dmat, cm->cm_dmamap,
- cm->cm_data, cm->cm_len, mfi_data_cb, cm, polled);
+ if (cm->cm_flags & MFI_CMD_CCB)
+ error = bus_dmamap_load_ccb(sc->mfi_buffer_dmat,
+ cm->cm_dmamap, cm->cm_data, mfi_data_cb, cm,
+ polled);
+ else
+ error = bus_dmamap_load(sc->mfi_buffer_dmat,
+ cm->cm_dmamap, cm->cm_data, cm->cm_len,
+ mfi_data_cb, cm, polled);
if (error == EINPROGRESS) {
sc->mfi_flags |= MFI_FLAGS_QFRZN;
return (0);
diff --git a/sys/dev/mfi/mfi_cam.c b/sys/dev/mfi/mfi_cam.c
index 2bbfafe..325b064 100644
--- a/sys/dev/mfi/mfi_cam.c
+++ b/sys/dev/mfi/mfi_cam.c
@@ -265,17 +265,6 @@ mfip_cam_action(struct cam_sim *sim, union ccb *ccb)
ccbh->status = CAM_REQ_INVALID;
break;
}
- if ((ccbh->flags & CAM_DIR_MASK) != CAM_DIR_NONE) {
- if (ccbh->flags & CAM_DATA_PHYS) {
- ccbh->status = CAM_REQ_INVALID;
- break;
- }
- if (ccbh->flags & CAM_SCATTER_VALID) {
- ccbh->status = CAM_REQ_INVALID;
- break;
- }
- }
-
ccbh->ccb_mfip_ptr = sc;
TAILQ_INSERT_TAIL(&mfisc->mfi_cam_ccbq, ccbh, sim_links.tqe);
mfi_startio(mfisc);
@@ -380,14 +369,14 @@ mfip_start(void *data)
cm->cm_private = ccb;
cm->cm_sg = &pt->sgl;
cm->cm_total_frame_size = MFI_PASS_FRAME_SIZE;
- cm->cm_data = csio->data_ptr;
+ cm->cm_data = ccb;
cm->cm_len = csio->dxfer_len;
switch (ccbh->flags & CAM_DIR_MASK) {
case CAM_DIR_IN:
- cm->cm_flags = MFI_CMD_DATAIN;
+ cm->cm_flags = MFI_CMD_DATAIN | MFI_CMD_CCB;
break;
case CAM_DIR_OUT:
- cm->cm_flags = MFI_CMD_DATAOUT;
+ cm->cm_flags = MFI_CMD_DATAOUT | MFI_CMD_CCB;
break;
case CAM_DIR_NONE:
default:
diff --git a/sys/dev/mfi/mfivar.h b/sys/dev/mfi/mfivar.h
index 435ca8d..bb2a324 100644
--- a/sys/dev/mfi/mfivar.h
+++ b/sys/dev/mfi/mfivar.h
@@ -107,6 +107,7 @@ struct mfi_command {
#define MFI_ON_MFIQ_BUSY (1<<7)
#define MFI_ON_MFIQ_MASK ((1<<5)|(1<<6)|(1<<7))
#define MFI_CMD_SCSI (1<<8)
+#define MFI_CMD_CCB (1<<9)
uint8_t retry_for_fw_reset;
void (* cm_complete)(struct mfi_command *cm);
void *cm_private;
OpenPOWER on IntegriCloud