aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/twa/tw_osl_cam.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2013-03-21 13:06:28 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2013-03-21 13:06:28 +0000
commitc46262f8109e20617deddebd81374e3e6a219512 (patch)
treee713155b460f197fcda0ae6a9784ec82b6f9a6f0 /sys/dev/twa/tw_osl_cam.c
parent21f97e938d91d7b80e853b536d4347a365536982 (diff)
downloadsrc-c46262f8109e20617deddebd81374e3e6a219512.tar.gz
src-c46262f8109e20617deddebd81374e3e6a219512.zip
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
Notes
Notes: svn path=/head/; revision=248583
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 9c4de23b02e9..67fcae30569c 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);
/*