summaryrefslogtreecommitdiffstats
path: root/sys/dev/twa/tw_osl_cam.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-03-21 13:06:28 +0000
committerkib <kib@FreeBSD.org>2013-03-21 13:06:28 +0000
commit0487ef2754a1634d4a11098002923f70f5b863ba (patch)
treee713155b460f197fcda0ae6a9784ec82b6f9a6f0 /sys/dev/twa/tw_osl_cam.c
parent128b1093e992e9e67d428b97cb5d9c7efda0fba1 (diff)
downloadFreeBSD-src-0487ef2754a1634d4a11098002923f70f5b863ba.zip
FreeBSD-src-0487ef2754a1634d4a11098002923f70f5b863ba.tar.gz
Fix twa(4) after the r246713. The driver copies data around to
satisfy some alignment restrictions. Do not set TW_OSLI_REQ_FLAGS_CCB flag for mapped data, pass the csio->data_ptr in the req->data. Do not put the ccb pointer into req->data ever, ccb is stored in req->orig_req already. Submitted by: Shuichi KITAGUCHI <ki@hh.iij4u.or.jp> PR: kern/177020
Diffstat (limited to 'sys/dev/twa/tw_osl_cam.c')
-rw-r--r--sys/dev/twa/tw_osl_cam.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/twa/tw_osl_cam.c b/sys/dev/twa/tw_osl_cam.c
index 9c4de23..67fcae3 100644
--- a/sys/dev/twa/tw_osl_cam.c
+++ b/sys/dev/twa/tw_osl_cam.c
@@ -273,9 +273,13 @@ tw_osli_execute_scsi(struct tw_osli_req_context *req, union ccb *ccb)
xpt_done(ccb);
return(1);
}
- req->data = ccb;
- req->length = csio->dxfer_len;
- req->flags |= TW_OSLI_REQ_FLAGS_CCB;
+ if ((ccb_h->flags & CAM_DATA_MASK) == CAM_DATA_VADDR) {
+ if ((req->length = csio->dxfer_len) != 0) {
+ req->data = csio->data_ptr;
+ scsi_req->sgl_entries = 1;
+ }
+ } else
+ req->flags |= TW_OSLI_REQ_FLAGS_CCB;
req->deadline = tw_osl_get_local_time() + (ccb_h->timeout / 1000);
/*
OpenPOWER on IntegriCloud