aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ciss
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2013-06-18 00:36:53 +0000
committerScott Long <scottl@FreeBSD.org>2013-06-18 00:36:53 +0000
commit039e422c063977ba9073fd2c93883dd8a5a36d48 (patch)
treeac9f929e7c22086aea07210a03683e5d77a1f585 /sys/dev/ciss
parentde93d9ce32e709231bb626392d9ae78d08441eb2 (diff)
Notes
Diffstat (limited to 'sys/dev/ciss')
-rw-r--r--sys/dev/ciss/ciss.c30
-rw-r--r--sys/dev/ciss/cissvar.h1
2 files changed, 13 insertions, 18 deletions
diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c
index 0793c26051ba..74fc873642ae 100644
--- a/sys/dev/ciss/ciss.c
+++ b/sys/dev/ciss/ciss.c
@@ -2697,9 +2697,14 @@ ciss_map_request(struct ciss_request *cr)
BUS_DMASYNC_PREWRITE);
if (cr->cr_data != NULL) {
- error = bus_dmamap_load(sc->ciss_buffer_dmat, cr->cr_datamap,
- cr->cr_data, cr->cr_length,
- ciss_request_map_helper, cr, 0);
+ if (cr->cr_flags & CISS_REQ_CCB)
+ error = bus_dmamap_load_ccb(sc->ciss_buffer_dmat,
+ cr->cr_datamap, cr->cr_data,
+ ciss_request_map_helper, cr, 0);
+ else
+ error = bus_dmamap_load(sc->ciss_buffer_dmat, cr->cr_datamap,
+ cr->cr_data, cr->cr_length,
+ ciss_request_map_helper, cr, 0);
if (error != 0)
return (error);
} else {
@@ -3065,18 +3070,6 @@ ciss_cam_action_io(struct cam_sim *sim, struct ccb_scsiio *csio)
csio->ccb_h.status = CAM_REQ_CMP_ERR;
}
- /* if there is data transfer, it must be to/from a virtual address */
- if ((csio->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) {
- if (csio->ccb_h.flags & CAM_DATA_PHYS) { /* we can't map it */
- debug(3, " data pointer is to physical address");
- csio->ccb_h.status = CAM_REQ_CMP_ERR;
- }
- if (csio->ccb_h.flags & CAM_SCATTER_VALID) { /* we want to do the s/g setup */
- debug(3, " data has premature s/g setup");
- csio->ccb_h.status = CAM_REQ_CMP_ERR;
- }
- }
-
/* abandon aborted ccbs or those that have failed validation */
if ((csio->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_INPROG) {
debug(3, "abandoning CCB due to abort/validation failure");
@@ -3103,7 +3096,7 @@ ciss_cam_action_io(struct cam_sim *sim, struct ccb_scsiio *csio)
* Build the command.
*/
cc = cr->cr_cc;
- cr->cr_data = csio->data_ptr;
+ cr->cr_data = csio;
cr->cr_length = csio->dxfer_len;
cr->cr_complete = ciss_cam_complete;
cr->cr_private = csio;
@@ -3121,12 +3114,13 @@ ciss_cam_action_io(struct cam_sim *sim, struct ccb_scsiio *csio)
cc->cdb.type = CISS_CDB_TYPE_COMMAND;
cc->cdb.attribute = CISS_CDB_ATTRIBUTE_SIMPLE; /* XXX ordered tags? */
if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) {
- cr->cr_flags = CISS_REQ_DATAOUT;
+ cr->cr_flags = CISS_REQ_DATAOUT | CISS_REQ_CCB;
cc->cdb.direction = CISS_CDB_DIRECTION_WRITE;
} else if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) {
- cr->cr_flags = CISS_REQ_DATAIN;
+ cr->cr_flags = CISS_REQ_DATAIN | CISS_REQ_CCB;
cc->cdb.direction = CISS_CDB_DIRECTION_READ;
} else {
+ cr->cr_data = NULL;
cr->cr_flags = 0;
cc->cdb.direction = CISS_CDB_DIRECTION_NONE;
}
diff --git a/sys/dev/ciss/cissvar.h b/sys/dev/ciss/cissvar.h
index e89e4e9831ee..b3719cfaf1a1 100644
--- a/sys/dev/ciss/cissvar.h
+++ b/sys/dev/ciss/cissvar.h
@@ -116,6 +116,7 @@ struct ciss_request
#define CISS_REQ_DATAOUT (1<<3) /* data host->adapter */
#define CISS_REQ_DATAIN (1<<4) /* data adapter->host */
#define CISS_REQ_BUSY (1<<5) /* controller has req */
+#define CISS_REQ_CCB (1<<6) /* data is ccb */
void (* cr_complete)(struct ciss_request *);
void *cr_private;