diff options
| author | Scott Long <scottl@FreeBSD.org> | 2013-06-18 00:36:53 +0000 |
|---|---|---|
| committer | Scott Long <scottl@FreeBSD.org> | 2013-06-18 00:36:53 +0000 |
| commit | 039e422c063977ba9073fd2c93883dd8a5a36d48 (patch) | |
| tree | ac9f929e7c22086aea07210a03683e5d77a1f585 /sys/dev/aac | |
| parent | de93d9ce32e709231bb626392d9ae78d08441eb2 (diff) | |
Notes
Diffstat (limited to 'sys/dev/aac')
| -rw-r--r-- | sys/dev/aac/aac_cam.c | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/sys/dev/aac/aac_cam.c b/sys/dev/aac/aac_cam.c index f1523868b00c..31ea90806fe2 100644 --- a/sys/dev/aac/aac_cam.c +++ b/sys/dev/aac/aac_cam.c @@ -446,26 +446,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"); } |
