summaryrefslogtreecommitdiffstats
path: root/sys/dev/isci
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/isci
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/isci')
-rw-r--r--sys/dev/isci/isci_io_request.c35
1 files changed, 13 insertions, 22 deletions
diff --git a/sys/dev/isci/isci_io_request.c b/sys/dev/isci/isci_io_request.c
index 719034e..9778ed0 100644
--- a/sys/dev/isci/isci_io_request.c
+++ b/sys/dev/isci/isci_io_request.c
@@ -713,7 +713,6 @@ void
isci_io_request_execute_scsi_io(union ccb *ccb,
struct ISCI_CONTROLLER *controller)
{
- struct ccb_scsiio *csio = &ccb->csio;
target_id_t target_id = ccb->ccb_h.target_id;
struct ISCI_REQUEST *request;
struct ISCI_IO_REQUEST *io_request;
@@ -748,29 +747,21 @@ isci_io_request_execute_scsi_io(union ccb *ccb,
io_request->current_sge_index = 0;
io_request->parent.remote_device_handle = device->sci_object;
- if ((ccb->ccb_h.flags & CAM_SCATTER_VALID) != 0)
- panic("Unexpected CAM_SCATTER_VALID flag! flags = 0x%x\n",
+ if ((ccb->ccb_h.flags & CAM_DATA_MASK) != CAM_DATA_VADDR)
+ panic("Unexpected cam data format! flags = 0x%x\n",
ccb->ccb_h.flags);
- if ((ccb->ccb_h.flags & CAM_DATA_PHYS) != 0)
- panic("Unexpected CAM_DATA_PHYS flag! flags = 0x%x\n",
- ccb->ccb_h.flags);
-
- if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) {
- error = bus_dmamap_load(io_request->parent.dma_tag,
- io_request->parent.dma_map, csio->data_ptr, csio->dxfer_len,
- isci_io_request_construct, io_request, 0x0);
-
- /* A resource shortage from BUSDMA will be automatically
- * continued at a later point, pushing the CCB processing
- * forward, which will in turn unfreeze the simq.
- */
- if (error == EINPROGRESS) {
- xpt_freeze_simq(controller->sim, 1);
- ccb->ccb_h.flags |= CAM_RELEASE_SIMQ;
- }
- } else
- isci_io_request_construct(io_request, NULL, 0, 0);
+ error = bus_dmamap_load_ccb(io_request->parent.dma_tag,
+ io_request->parent.dma_map, ccb,
+ isci_io_request_construct, io_request, 0x0);
+ /* A resource shortage from BUSDMA will be automatically
+ * continued at a later point, pushing the CCB processing
+ * forward, which will in turn unfreeze the simq.
+ */
+ if (error == EINPROGRESS) {
+ xpt_freeze_simq(controller->sim, 1);
+ ccb->ccb_h.flags |= CAM_RELEASE_SIMQ;
+ }
}
void
OpenPOWER on IntegriCloud