diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2007-03-03 03:55:54 +0300 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-03-11 19:39:27 +0300 |
commit | bc7e380a6a4c94f79a49c36bdb28062a750b3c2b (patch) | |
tree | c5ae13015fd0f7f15e9dbf16f865a11d0c495f3b /include/scsi | |
parent | 181011e04a2a32f8d5df212254239ac9a3c8ab5e (diff) | |
download | linux-bc7e380a6a4c94f79a49c36bdb28062a750b3c2b.tar.xz |
[SCSI] tgt: fix sesnse buffer problems
This patch simplify the way to notify LLDs of the command completion
and addresses the following sense buffer problems:
- can't handle both data and sense.
- forces user-space to use aligned sense buffer
tgt copies sense_data from userspace to cmnd->sense_buffer (if
necessary), maps user-space pages (if necessary) and then calls
host->transfer_response (host->transfer_data is removed).
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/scsi_host.h | 19 | ||||
-rw-r--r-- | include/scsi/scsi_tgt_if.h | 6 |
2 files changed, 9 insertions, 16 deletions
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 7f1f411d07af..965b6b8ffec5 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -129,6 +129,11 @@ struct scsi_host_template { * the LLD. When the driver is finished processing the command * the done callback is invoked. * + * This is called to inform the LLD to transfer + * cmd->request_bufflen bytes. The cmd->use_sg speciefies the + * number of scatterlist entried in the command and + * cmd->request_buffer contains the scatterlist. + * * return values: see queuecommand * * If the LLD accepts the cmd, it should set the result to an @@ -139,20 +144,6 @@ struct scsi_host_template { /* TODO: rename */ int (* transfer_response)(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *)); - /* - * This is called to inform the LLD to transfer cmd->request_bufflen - * bytes of the cmd at cmd->offset in the cmd. The cmd->use_sg - * speciefies the number of scatterlist entried in the command - * and cmd->request_buffer contains the scatterlist. - * - * If the command cannot be processed in one transfer_data call - * becuase a scatterlist within the LLD's limits cannot be - * created then transfer_data will be called multiple times. - * It is initially called from process context, and later - * calls are from the interrup context. - */ - int (* transfer_data)(struct scsi_cmnd *, - void (*done)(struct scsi_cmnd *)); /* Used as callback for the completion of task management request. */ int (* tsk_mgmt_response)(u64 mid, int result); diff --git a/include/scsi/scsi_tgt_if.h b/include/scsi/scsi_tgt_if.h index 07d6e77ae895..4cf9dff29a2f 100644 --- a/include/scsi/scsi_tgt_if.h +++ b/include/scsi/scsi_tgt_if.h @@ -45,11 +45,13 @@ struct tgt_event { /* user-> kernel */ struct { int host_no; - uint32_t len; int result; + aligned_u64 tag; aligned_u64 uaddr; + aligned_u64 sense_uaddr; + uint32_t len; + uint32_t sense_len; uint8_t rw; - aligned_u64 tag; } cmd_rsp; struct { int host_no; |