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 SRP_VERSION "16.a"
33 #define PACKED __attribute__((packed))
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,
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
{
52 SRP_DIRECT_BUFFER
= 0x01,
53 SRP_INDIRECT_BUFFER
= 0x02
56 struct memory_descriptor
{
62 struct indirect_descriptor
{
63 struct memory_descriptor head
;
65 struct memory_descriptor list
[1] PACKED
;
74 struct srp_login_req
{
78 u32 max_requested_initiator_to_target_iulen
;
80 u16 required_buffer_formats
;
82 u8 multi_channel_action
:2;
85 u8 initiator_port_identifier
[16];
86 u8 target_port_identifier
[16];
89 struct srp_login_rsp
{
92 u32 request_limit_delta
;
94 u32 max_initiator_to_target_iulen
;
95 u32 max_target_to_initiator_iulen
;
96 u16 supported_buffer_formats
;
98 u8 multi_channel_result
:2;
103 struct srp_login_rej
{
109 u16 supported_buffer_formats
;
113 struct srp_i_logout
{
119 struct srp_t_logout
{
126 struct srp_tsk_mgmt
{
136 u64 managed_task_tag
;
142 u32 reserved1 PACKED
;
143 u8 data_out_format
:4;
154 u8 additional_cdb_len
;
156 u8 additional_data
[0x100 - 0x30];
162 u32 request_limit_delta
;
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
{
183 u32 request_limit_delta
;
187 struct srp_cred_rsp
{
196 u32 request_limit_delta
;
200 u32 sense_data_list_length
;
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
;
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
;