[PATCH] W1: w1_netlink: New init/fini netlink callbacks.
[linux-2.6/verdex.git] / drivers / scsi / ibmvscsi / srp.h
blob7d8e4c4accb9571260d1921fe05fa31cdc1afd87
1 /*****************************************************************************/
2 /* srp.h -- SCSI RDMA Protocol definitions */
3 /* */
4 /* Written By: Colin Devilbis, IBM Corporation */
5 /* */
6 /* Copyright (C) 2003 IBM Corporation */
7 /* */
8 /* This program is free software; you can redistribute it and/or modify */
9 /* it under the terms of the GNU General Public License as published by */
10 /* the Free Software Foundation; either version 2 of the License, or */
11 /* (at your option) any later version. */
12 /* */
13 /* This program is distributed in the hope that it will be useful, */
14 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
15 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
16 /* GNU General Public License for more details. */
17 /* */
18 /* You should have received a copy of the GNU General Public License */
19 /* along with this program; if not, write to the Free Software */
20 /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
21 /* */
22 /* */
23 /* This file contains structures and definitions for the SCSI RDMA Protocol */
24 /* (SRP) as defined in the T10 standard available at www.t10.org. This */
25 /* file was based on the 16a version of the standard */
26 /* */
27 /*****************************************************************************/
28 #ifndef SRP_H
29 #define SRP_H
31 #define SRP_VERSION "16.a"
33 #define PACKED __attribute__((packed))
35 enum srp_types {
36 SRP_LOGIN_REQ_TYPE = 0x00,
37 SRP_LOGIN_RSP_TYPE = 0xC0,
38 SRP_LOGIN_REJ_TYPE = 0xC2,
39 SRP_I_LOGOUT_TYPE = 0x03,
40 SRP_T_LOGOUT_TYPE = 0x80,
41 SRP_TSK_MGMT_TYPE = 0x01,
42 SRP_CMD_TYPE = 0x02,
43 SRP_RSP_TYPE = 0xC1,
44 SRP_CRED_REQ_TYPE = 0x81,
45 SRP_CRED_RSP_TYPE = 0x41,
46 SRP_AER_REQ_TYPE = 0x82,
47 SRP_AER_RSP_TYPE = 0x42
50 enum srp_descriptor_formats {
51 SRP_NO_BUFFER = 0x00,
52 SRP_DIRECT_BUFFER = 0x01,
53 SRP_INDIRECT_BUFFER = 0x02
56 struct memory_descriptor {
57 u64 virtual_address;
58 u32 memory_handle;
59 u32 length;
62 struct indirect_descriptor {
63 struct memory_descriptor head;
64 u32 total_length;
65 struct memory_descriptor list[1] PACKED;
68 struct srp_generic {
69 u8 type;
70 u8 reserved1[7];
71 u64 tag;
74 struct srp_login_req {
75 u8 type;
76 u8 reserved1[7];
77 u64 tag;
78 u32 max_requested_initiator_to_target_iulen;
79 u32 reserved2;
80 u16 required_buffer_formats;
81 u8 reserved3:6;
82 u8 multi_channel_action:2;
83 u8 reserved4;
84 u32 reserved5;
85 u8 initiator_port_identifier[16];
86 u8 target_port_identifier[16];
89 struct srp_login_rsp {
90 u8 type;
91 u8 reserved1[3];
92 u32 request_limit_delta;
93 u64 tag;
94 u32 max_initiator_to_target_iulen;
95 u32 max_target_to_initiator_iulen;
96 u16 supported_buffer_formats;
97 u8 reserved2:6;
98 u8 multi_channel_result:2;
99 u8 reserved3;
100 u8 reserved4[24];
103 struct srp_login_rej {
104 u8 type;
105 u8 reserved1[3];
106 u32 reason;
107 u64 tag;
108 u64 reserved2;
109 u16 supported_buffer_formats;
110 u8 reserved3[6];
113 struct srp_i_logout {
114 u8 type;
115 u8 reserved1[7];
116 u64 tag;
119 struct srp_t_logout {
120 u8 type;
121 u8 reserved1[3];
122 u32 reason;
123 u64 tag;
126 struct srp_tsk_mgmt {
127 u8 type;
128 u8 reserved1[7];
129 u64 tag;
130 u32 reserved2;
131 u64 lun PACKED;
132 u8 reserved3;
133 u8 reserved4;
134 u8 task_mgmt_flags;
135 u8 reserved5;
136 u64 managed_task_tag;
137 u64 reserved6;
140 struct srp_cmd {
141 u8 type;
142 u32 reserved1 PACKED;
143 u8 data_out_format:4;
144 u8 data_in_format:4;
145 u8 data_out_count;
146 u8 data_in_count;
147 u64 tag;
148 u32 reserved2;
149 u64 lun PACKED;
150 u8 reserved3;
151 u8 reserved4:5;
152 u8 task_attribute:3;
153 u8 reserved5;
154 u8 additional_cdb_len;
155 u8 cdb[16];
156 u8 additional_data[0x100 - 0x30];
159 struct srp_rsp {
160 u8 type;
161 u8 reserved1[3];
162 u32 request_limit_delta;
163 u64 tag;
164 u16 reserved2;
165 u8 reserved3:2;
166 u8 diunder:1;
167 u8 diover:1;
168 u8 dounder:1;
169 u8 doover:1;
170 u8 snsvalid:1;
171 u8 rspvalid:1;
172 u8 status;
173 u32 data_in_residual_count;
174 u32 data_out_residual_count;
175 u32 sense_data_list_length;
176 u32 response_data_list_length;
177 u8 sense_and_response_data[18];
180 struct srp_cred_req {
181 u8 type;
182 u8 reserved1[3];
183 u32 request_limit_delta;
184 u64 tag;
187 struct srp_cred_rsp {
188 u8 type;
189 u8 reserved1[7];
190 u64 tag;
193 struct srp_aer_req {
194 u8 type;
195 u8 reserved1[3];
196 u32 request_limit_delta;
197 u64 tag;
198 u32 reserved2;
199 u64 lun;
200 u32 sense_data_list_length;
201 u32 reserved3;
202 u8 sense_data[20];
205 struct srp_aer_rsp {
206 u8 type;
207 u8 reserved1[7];
208 u64 tag;
211 union srp_iu {
212 struct srp_generic generic;
213 struct srp_login_req login_req;
214 struct srp_login_rsp login_rsp;
215 struct srp_login_rej login_rej;
216 struct srp_i_logout i_logout;
217 struct srp_t_logout t_logout;
218 struct srp_tsk_mgmt tsk_mgmt;
219 struct srp_cmd cmd;
220 struct srp_rsp rsp;
221 struct srp_cred_req cred_req;
222 struct srp_cred_rsp cred_rsp;
223 struct srp_aer_req aer_req;
224 struct srp_aer_rsp aer_rsp;
227 #endif