aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/bsg.h
diff options
context:
space:
mode:
authorFUJITA Tomonori <tomof@acm.org>2006-12-20 05:19:32 -0500
committerJens Axboe <jens.axboe@oracle.com>2007-07-16 02:52:44 -0400
commit45977d0e87ac988d04fccfb89221727aaf8d78a4 (patch)
treef3020ef3f6562e77ae8d70c43f175d713a98da6c /include/linux/bsg.h
parent337ad41deae1b56e56731246322a93251df86e79 (diff)
bsg: add sg_io_v4 structure
This patch adds sg_io_v4 structure that Doug proposed last month. There's one major change from the RFC. I dropped iovec, which needs compat stuff. The bsg code simply calls blk_rq_map_user against dout_xferp/din_xferp. So if possible, the page frames are directly mapped. If not possible, the block layer allocates new page frames and does memory copies. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/linux/bsg.h')
-rw-r--r--include/linux/bsg.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/include/linux/bsg.h b/include/linux/bsg.h
index dc0d7282c4cb..0d212cc06abf 100644
--- a/include/linux/bsg.h
+++ b/include/linux/bsg.h
@@ -1,6 +1,47 @@
1#ifndef BSG_H 1#ifndef BSG_H
2#define BSG_H 2#define BSG_H
3 3
4struct sg_io_v4 {
5 int32_t guard; /* [i] 'Q' to differentiate from v3 */
6 uint32_t protocol; /* [i] 0 -> SCSI , .... */
7 uint32_t subprotocol; /* [i] 0 -> SCSI command, 1 -> SCSI task
8 management function, .... */
9
10 uint32_t request_len; /* [i] in bytes */
11 uint64_t request; /* [i], [*i] {SCSI: cdb} */
12 uint32_t request_attr; /* [i] {SCSI: task attribute} */
13 uint32_t request_tag; /* [i] {SCSI: task tag (only if flagged)} */
14 uint32_t request_priority; /* [i] {SCSI: task priority} */
15 uint32_t max_response_len; /* [i] in bytes */
16 uint64_t response; /* [i], [*o] {SCSI: (auto)sense data} */
17
18 /* "din_" for data in (from device); "dout_" for data out (to device) */
19 uint32_t dout_xfer_len; /* [i] bytes to be transferred to device */
20 uint32_t din_xfer_len; /* [i] bytes to be transferred from device */
21 uint64_t dout_xferp; /* [i], [*i] */
22 uint64_t din_xferp; /* [i], [*o] */
23
24 uint32_t timeout; /* [i] units: millisecond */
25 uint32_t flags; /* [i] bit mask */
26 uint64_t usr_ptr; /* [i->o] unused internally */
27 uint32_t spare_in; /* [i] */
28
29 uint32_t driver_status; /* [o] 0 -> ok */
30 uint32_t transport_status; /* [o] 0 -> ok */
31 uint32_t device_status; /* [o] {SCSI: command completion status} */
32 uint32_t retry_delay; /* [o] {SCSI: status auxiliary information} */
33 uint32_t info; /* [o] additional information */
34 uint32_t duration; /* [o] time to complete, in milliseconds */
35 uint32_t response_len; /* [o] bytes of response actually written */
36 int32_t din_resid; /* [o] actual_din_xfer_len - din_xfer_len */
37 uint32_t generated_tag; /* [o] {SCSI: task tag that transport chose} */
38 uint32_t spare_out; /* [o] */
39
40 uint32_t padding;
41};
42
43#ifdef __KERNEL__
44
4#if defined(CONFIG_BLK_DEV_BSG) 45#if defined(CONFIG_BLK_DEV_BSG)
5struct bsg_class_device { 46struct bsg_class_device {
6 struct class_device *class_dev; 47 struct class_device *class_dev;
@@ -18,4 +59,6 @@ struct bsg_class_device { };
18#define bsg_unregister_disk(disk) do { } while (0) 59#define bsg_unregister_disk(disk) do { } while (0)
19#endif 60#endif
20 61
62#endif /* __KERNEL__ */
63
21#endif 64#endif