aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/scsi_tgt_if.h
diff options
context:
space:
mode:
authorFUJITA Tomonori <tomof@acm.org>2007-07-11 02:08:17 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-10-12 14:37:50 -0400
commit2c47f9efbedbe5749b6bb16e59bc11d6e460855f (patch)
treebfc1a2154f67c3aa45f92e586678ffc37e5f80eb /include/scsi/scsi_tgt_if.h
parentaebd5e476ecc8ceb53577b20f2a352ff4ceffd8d (diff)
[SCSI] tgt: add I_T nexus support
tgt uses scsi_host as I_T nexus. This works for ibmvstgt because it creates one scsi_host for one initiator. However, other target drivers don't work like that. This adds I_T nexus support, which enable one scsi_host to handle multiple initiators. New scsi_tgt_it_nexus_create/destroy functions are expected be called transport classes. For example, ibmvstgt creates an initiator remote port, then the srp transport calls tgt_it_nexus_create. tgt doesn't manages I_T nexus, instead it tells tgtd, user-space daemon, to create a new I_T nexus. On the receiving the response from tgtd, tgt calls shost->transportt->it_nexus_response. transports should notify a lld. The srp transport uses it_nexus_response callback in srp_function_template to do that. 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/scsi_tgt_if.h')
-rw-r--r--include/scsi/scsi_tgt_if.h35
1 files changed, 27 insertions, 8 deletions
diff --git a/include/scsi/scsi_tgt_if.h b/include/scsi/scsi_tgt_if.h
index 4cf9dff29a2f..f2ee7c238a45 100644
--- a/include/scsi/scsi_tgt_if.h
+++ b/include/scsi/scsi_tgt_if.h
@@ -23,13 +23,15 @@
23#define __SCSI_TARGET_IF_H 23#define __SCSI_TARGET_IF_H
24 24
25/* user -> kernel */ 25/* user -> kernel */
26#define TGT_UEVENT_CMD_RSP 0x0001 26#define TGT_UEVENT_CMD_RSP 0x0001
27#define TGT_UEVENT_TSK_MGMT_RSP 0x0002 27#define TGT_UEVENT_IT_NEXUS_RSP 0x0002
28#define TGT_UEVENT_TSK_MGMT_RSP 0x0003
28 29
29/* kernel -> user */ 30/* kernel -> user */
30#define TGT_KEVENT_CMD_REQ 0x1001 31#define TGT_KEVENT_CMD_REQ 0x1001
31#define TGT_KEVENT_CMD_DONE 0x1002 32#define TGT_KEVENT_CMD_DONE 0x1002
32#define TGT_KEVENT_TSK_MGMT_REQ 0x1003 33#define TGT_KEVENT_IT_NEXUS_REQ 0x1003
34#define TGT_KEVENT_TSK_MGMT_REQ 0x1004
33 35
34struct tgt_event_hdr { 36struct tgt_event_hdr {
35 uint16_t version; 37 uint16_t version;
@@ -46,6 +48,7 @@ struct tgt_event {
46 struct { 48 struct {
47 int host_no; 49 int host_no;
48 int result; 50 int result;
51 aligned_u64 itn_id;
49 aligned_u64 tag; 52 aligned_u64 tag;
50 aligned_u64 uaddr; 53 aligned_u64 uaddr;
51 aligned_u64 sense_uaddr; 54 aligned_u64 sense_uaddr;
@@ -55,15 +58,22 @@ struct tgt_event {
55 } cmd_rsp; 58 } cmd_rsp;
56 struct { 59 struct {
57 int host_no; 60 int host_no;
58 aligned_u64 mid;
59 int result; 61 int result;
62 aligned_u64 itn_id;
63 aligned_u64 mid;
60 } tsk_mgmt_rsp; 64 } tsk_mgmt_rsp;
61 65 struct {
66 __s32 host_no;
67 __s32 result;
68 aligned_u64 itn_id;
69 __u32 function;
70 } it_nexus_rsp;
62 71
63 /* kernel -> user */ 72 /* kernel -> user */
64 struct { 73 struct {
65 int host_no; 74 int host_no;
66 uint32_t data_len; 75 uint32_t data_len;
76 aligned_u64 itn_id;
67 uint8_t scb[16]; 77 uint8_t scb[16];
68 uint8_t lun[8]; 78 uint8_t lun[8];
69 int attribute; 79 int attribute;
@@ -71,16 +81,25 @@ struct tgt_event {
71 } cmd_req; 81 } cmd_req;
72 struct { 82 struct {
73 int host_no; 83 int host_no;
74 aligned_u64 tag;
75 int result; 84 int result;
85 aligned_u64 itn_id;
86 aligned_u64 tag;
76 } cmd_done; 87 } cmd_done;
77 struct { 88 struct {
78 int host_no; 89 int host_no;
79 int function; 90 int function;
91 aligned_u64 itn_id;
80 aligned_u64 tag; 92 aligned_u64 tag;
81 uint8_t lun[8]; 93 uint8_t lun[8];
82 aligned_u64 mid; 94 aligned_u64 mid;
83 } tsk_mgmt_req; 95 } tsk_mgmt_req;
96 struct {
97 __s32 host_no;
98 __u32 function;
99 aligned_u64 itn_id;
100 __u32 max_cmds;
101 __u8 initiator_id[16];
102 } it_nexus_req;
84 } p; 103 } p;
85} __attribute__ ((aligned (sizeof(uint64_t)))); 104} __attribute__ ((aligned (sizeof(uint64_t))));
86 105