Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
srp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2005 Cisco Systems. All rights reserved.
3  *
4  * This software is available to you under a choice of one of two
5  * licenses. You may choose to be licensed under the terms of the GNU
6  * General Public License (GPL) Version 2, available from the file
7  * COPYING in the main directory of this source tree, or the
8  * OpenIB.org BSD license below:
9  *
10  * Redistribution and use in source and binary forms, with or
11  * without modification, are permitted provided that the following
12  * conditions are met:
13  *
14  * - Redistributions of source code must retain the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer.
17  *
18  * - Redistributions in binary form must reproduce the above
19  * copyright notice, this list of conditions and the following
20  * disclaimer in the documentation and/or other materials
21  * provided with the distribution.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30  * SOFTWARE.
31  *
32  * $Id$
33  */
34 
35 #ifndef SCSI_SRP_H
36 #define SCSI_SRP_H
37 
38 /*
39  * Structures and constants for the SCSI RDMA Protocol (SRP) as
40  * defined by the INCITS T10 committee. This file was written using
41  * draft Revision 16a of the SRP standard.
42  */
43 
44 #include <linux/types.h>
45 
46 enum {
47  SRP_LOGIN_REQ = 0x00,
48  SRP_TSK_MGMT = 0x01,
49  SRP_CMD = 0x02,
50  SRP_I_LOGOUT = 0x03,
51  SRP_LOGIN_RSP = 0xc0,
52  SRP_RSP = 0xc1,
53  SRP_LOGIN_REJ = 0xc2,
54  SRP_T_LOGOUT = 0x80,
55  SRP_CRED_REQ = 0x81,
56  SRP_AER_REQ = 0x82,
57  SRP_CRED_RSP = 0x41,
58  SRP_AER_RSP = 0x42
59 };
60 
61 enum {
64 };
65 
66 enum {
70 };
71 
72 enum {
78 };
79 
88 };
89 
90 enum {
93 };
94 
99 };
100 
101 /*
102  * We need the packed attribute because the SRP spec puts the list of
103  * descriptors at an offset of 20, which is not aligned to the size of
104  * struct srp_direct_buf. The whole structure must be packed to avoid
105  * having the 20-byte structure padded to 24 bytes on 64-bit architectures.
106  */
111 } __attribute__((packed));
113 enum {
116 };
117 
129 };
130 
131 /*
132  * The SRP spec defines the size of the LOGIN_RSP structure to be 52
133  * bytes, so it needs to be packed to avoid having it padded to 56
134  * bytes on 64-bit architectures.
135  */
146 } __attribute__((packed));
156 };
157 
158 struct srp_i_logout {
162 };
163 
164 struct srp_t_logout {
170 };
171 
172 /*
173  * We need the packed attribute because the SRP spec only aligns the
174  * 8-byte LUN field to 4 bytes.
175  */
176 struct srp_tsk_mgmt {
182  __be64 lun __attribute__((packed));
188 };
189 
190 /*
191  * We need the packed attribute because the SRP spec only aligns the
192  * 8-byte LUN field to 4 bytes.
193  */
194 struct srp_cmd {
203  __be64 lun __attribute__((packed));
208  u8 cdb[16];
210 };
211 
212 enum {
219 };
220 
221 /*
222  * The SRP spec defines the size of the RSP structure to be 36 bytes,
223  * so it needs to be packed to avoid having it padded to 40 bytes on
224  * 64-bit architectures.
225  */
226 struct srp_rsp {
239  u8 data[0];
240 } __attribute__((packed));
241 
242 struct srp_cred_req {
248 };
250 struct srp_cred_rsp {
254 };
255 
256 /*
257  * The SRP spec defines the fixed portion of the AER_REQ structure to be
258  * 36 bytes, so it needs to be packed to avoid having it padded to 40 bytes
259  * on 64-bit architectures.
260  */
261 struct srp_aer_req {
272 } __attribute__((packed));
273 
274 struct srp_aer_rsp {
278 };
280 #endif /* SCSI_SRP_H */