summaryrefslogtreecommitdiffstats
path: root/sys/dev/aac
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/aac
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/aac')
-rw-r--r--sys/dev/aac/aac_cam.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/sys/dev/aac/aac_cam.c b/sys/dev/aac/aac_cam.c
index 57e87da..7f0d7ee 100644
--- a/sys/dev/aac/aac_cam.c
+++ b/sys/dev/aac/aac_cam.c
@@ -448,26 +448,28 @@ aac_cam_action(struct cam_sim *sim, union ccb *ccb)
/* Map the s/g list. XXX 32bit addresses only! */
if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) {
- if ((ccb->ccb_h.flags & CAM_SCATTER_VALID) == 0) {
+ switch ((ccb->ccb_h.flags & CAM_DATA_MASK)) {
+ case CAM_DATA_VADDR:
srb->data_len = csio->dxfer_len;
- if (ccb->ccb_h.flags & CAM_DATA_PHYS) {
- /* Send a 32bit command */
- fib->Header.Command = ScsiPortCommand;
- srb->sg_map.SgCount = 1;
- srb->sg_map.SgEntry[0].SgAddress =
- (uint32_t)(uintptr_t)csio->data_ptr;
- srb->sg_map.SgEntry[0].SgByteCount =
- csio->dxfer_len;
- } else {
- /*
- * Arrange things so that the S/G
- * map will get set up automagically
- */
- cm->cm_data = (void *)csio->data_ptr;
- cm->cm_datalen = csio->dxfer_len;
- cm->cm_sgtable = &srb->sg_map;
- }
- } else {
+ /*
+ * Arrange things so that the S/G
+ * map will get set up automagically
+ */
+ cm->cm_data = (void *)csio->data_ptr;
+ cm->cm_datalen = csio->dxfer_len;
+ cm->cm_sgtable = &srb->sg_map;
+ break;
+ case CAM_DATA_PADDR:
+ /* Send a 32bit command */
+ fib->Header.Command = ScsiPortCommand;
+ srb->sg_map.SgCount = 1;
+ srb->sg_map.SgEntry[0].SgAddress =
+ (uint32_t)(uintptr_t)csio->data_ptr;
+ srb->sg_map.SgEntry[0].SgByteCount =
+ csio->dxfer_len;
+ srb->data_len = csio->dxfer_len;
+ break;
+ default:
/* XXX Need to handle multiple s/g elements */
panic("aac_cam: multiple s/g elements");
}
OpenPOWER on IntegriCloud