summaryrefslogtreecommitdiff
path: root/sys/dev/dpt
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2013-02-12 16:57:20 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2013-02-12 16:57:20 +0000
commitdd0b4fb6d50631c140e800bdfac48d02e7e4c875 (patch)
treee550f2c754f1edf951a8b93963ebcfc4fa0d20ce /sys/dev/dpt
parent44c169253de5caec5de2a397c522ad3e359f86e6 (diff)
Notes
Diffstat (limited to 'sys/dev/dpt')
-rw-r--r--sys/dev/dpt/dpt_scsi.c62
1 files changed, 14 insertions, 48 deletions
diff --git a/sys/dev/dpt/dpt_scsi.c b/sys/dev/dpt/dpt_scsi.c
index b4a73c937c9a..908f0f891d94 100644
--- a/sys/dev/dpt/dpt_scsi.c
+++ b/sys/dev/dpt/dpt_scsi.c
@@ -910,56 +910,22 @@ dpt_action(struct cam_sim *sim, union ccb *ccb)
*/
/* Only use S/G if there is a transfer */
if ((ccbh->flags & CAM_DIR_MASK) != CAM_DIR_NONE) {
- if ((ccbh->flags & CAM_SCATTER_VALID) == 0) {
+ int error;
+
+ error = bus_dmamap_load_ccb(dpt->buffer_dmat,
+ dccb->dmamap,
+ ccb,
+ dptexecuteccb,
+ dccb, /*flags*/0);
+ if (error == EINPROGRESS) {
/*
- * We've been given a pointer
- * to a single buffer.
+ * So as to maintain ordering,
+ * freeze the controller queue
+ * until our mapping is
+ * returned.
*/
- if ((ccbh->flags & CAM_DATA_PHYS) == 0) {
- int error;
-
- error =
- bus_dmamap_load(dpt->buffer_dmat,
- dccb->dmamap,
- csio->data_ptr,
- csio->dxfer_len,
- dptexecuteccb,
- dccb, /*flags*/0);
- if (error == EINPROGRESS) {
- /*
- * So as to maintain ordering,
- * freeze the controller queue
- * until our mapping is
- * returned.
- */
- xpt_freeze_simq(sim, 1);
- dccb->state |= CAM_RELEASE_SIMQ;
- }
- } else {
- struct bus_dma_segment seg;
-
- /* Pointer to physical buffer */
- seg.ds_addr =
- (bus_addr_t)csio->data_ptr;
- seg.ds_len = csio->dxfer_len;
- dptexecuteccb(dccb, &seg, 1, 0);
- }
- } else {
- struct bus_dma_segment *segs;
-
- if ((ccbh->flags & CAM_DATA_PHYS) != 0)
- panic("dpt_action - Physical "
- "segment pointers "
- "unsupported");
-
- if ((ccbh->flags&CAM_SG_LIST_PHYS)==0)
- panic("dpt_action - Virtual "
- "segment addresses "
- "unsupported");
-
- /* Just use the segments provided */
- segs = (struct bus_dma_segment *)csio->data_ptr;
- dptexecuteccb(dccb, segs, csio->sglist_cnt, 0);
+ xpt_freeze_simq(sim, 1);
+ dccb->state |= CAM_RELEASE_SIMQ;
}
} else {
/*