1 /*****************************************************************************/
2 /* srp.h -- SCSI RDMA Protocol definitions */
4 /* Written By: Colin Devilbis, IBM Corporation */
6 /* Copyright (C) 2003 IBM Corporation */
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. */
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. */
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 */
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 */
27 /*****************************************************************************/
31 #define PACKED __attribute__((packed))
34 SRP_LOGIN_REQ_TYPE = 0x00,
35 SRP_LOGIN_RSP_TYPE = 0xC0,
36 SRP_LOGIN_REJ_TYPE = 0x80,
37 SRP_I_LOGOUT_TYPE = 0x03,
38 SRP_T_LOGOUT_TYPE = 0x80,
39 SRP_TSK_MGMT_TYPE = 0x01,
42 SRP_CRED_REQ_TYPE = 0x81,
43 SRP_CRED_RSP_TYPE = 0x41,
44 SRP_AER_REQ_TYPE = 0x82,
45 SRP_AER_RSP_TYPE = 0x42
48 enum srp_descriptor_formats {
50 SRP_DIRECT_BUFFER = 0x01,
51 SRP_INDIRECT_BUFFER = 0x02
54 struct memory_descriptor {
60 struct indirect_descriptor {
61 struct memory_descriptor head;
63 struct memory_descriptor list[1] PACKED;
72 struct srp_login_req {
76 u32 max_requested_initiator_to_target_iulen;
78 u16 required_buffer_formats;
80 u8 multi_channel_action:2;
83 u8 initiator_port_identifier[16];
84 u8 target_port_identifier[16];
87 struct srp_login_rsp {
90 u32 request_limit_delta;
92 u32 max_initiator_to_target_iulen;
93 u32 max_target_to_initiator_iulen;
94 u16 supported_buffer_formats;
96 u8 multi_channel_result:2;
101 struct srp_login_rej {
107 u16 supported_buffer_formats;
111 struct srp_i_logout {
117 struct srp_t_logout {
124 struct srp_tsk_mgmt {
134 u64 managed_task_tag;
140 u32 reserved1 PACKED;
141 u8 data_out_format:4;
152 u8 additional_cdb_len;
154 u8 additional_data[0x100 - 0x30];
160 u32 request_limit_delta;
171 u32 data_in_residual_count;
172 u32 data_out_residual_count;
173 u32 sense_data_list_length;
174 u32 response_data_list_length;
175 u8 sense_and_response_data[18];
178 struct srp_cred_req {
181 u32 request_limit_delta;
185 struct srp_cred_rsp {
194 u32 request_limit_delta;
198 u32 sense_data_list_length;
210 struct srp_generic generic;
211 struct srp_login_req login_req;
212 struct srp_login_rsp login_rsp;
213 struct srp_login_rej login_rej;
214 struct srp_i_logout i_logout;
215 struct srp_t_logout t_logout;
216 struct srp_tsk_mgmt tsk_mgmt;
219 struct srp_cred_req cred_req;
220 struct srp_cred_rsp cred_rsp;
221 struct srp_aer_req aer_req;
222 struct srp_aer_rsp aer_rsp;