1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29#ifndef VIOSRP_H
30#define VIOSRP_H
31#include <scsi/srp.h>
32
33#define SRP_VERSION "16.a"
34#define SRP_MAX_IU_LEN 256
35#define SRP_MAX_LOC_LEN 32
36
37union srp_iu {
38 struct srp_login_req login_req;
39 struct srp_login_rsp login_rsp;
40 struct srp_login_rej login_rej;
41 struct srp_i_logout i_logout;
42 struct srp_t_logout t_logout;
43 struct srp_tsk_mgmt tsk_mgmt;
44 struct srp_cmd cmd;
45 struct srp_rsp rsp;
46 u8 reserved[SRP_MAX_IU_LEN];
47};
48
49enum viosrp_crq_headers {
50 VIOSRP_CRQ_FREE = 0x00,
51 VIOSRP_CRQ_CMD_RSP = 0x80,
52 VIOSRP_CRQ_INIT_RSP = 0xC0,
53 VIOSRP_CRQ_XPORT_EVENT = 0xFF
54};
55
56enum viosrp_crq_init_formats {
57 VIOSRP_CRQ_INIT = 0x01,
58 VIOSRP_CRQ_INIT_COMPLETE = 0x02
59};
60
61enum viosrp_crq_formats {
62 VIOSRP_SRP_FORMAT = 0x01,
63 VIOSRP_MAD_FORMAT = 0x02,
64 VIOSRP_OS400_FORMAT = 0x03,
65 VIOSRP_AIX_FORMAT = 0x04,
66 VIOSRP_LINUX_FORMAT = 0x05,
67 VIOSRP_INLINE_FORMAT = 0x06
68};
69
70enum viosrp_crq_status {
71 VIOSRP_OK = 0x0,
72 VIOSRP_NONRECOVERABLE_ERR = 0x1,
73 VIOSRP_VIOLATES_MAX_XFER = 0x2,
74 VIOSRP_PARTNER_PANIC = 0x3,
75 VIOSRP_DEVICE_BUSY = 0x8,
76 VIOSRP_ADAPTER_FAIL = 0x10,
77 VIOSRP_OK2 = 0x99,
78};
79
80struct viosrp_crq {
81 u8 valid;
82 u8 format;
83 u8 reserved;
84 u8 status;
85 __be16 timeout;
86 __be16 IU_length;
87 __be64 IU_data_ptr;
88};
89
90
91
92
93enum viosrp_mad_types {
94 VIOSRP_EMPTY_IU_TYPE = 0x01,
95 VIOSRP_ERROR_LOG_TYPE = 0x02,
96 VIOSRP_ADAPTER_INFO_TYPE = 0x03,
97 VIOSRP_CAPABILITIES_TYPE = 0x05,
98 VIOSRP_ENABLE_FAST_FAIL = 0x08,
99};
100
101enum viosrp_mad_status {
102 VIOSRP_MAD_SUCCESS = 0x00,
103 VIOSRP_MAD_NOT_SUPPORTED = 0xF1,
104 VIOSRP_MAD_FAILED = 0xF7,
105};
106
107enum viosrp_capability_type {
108 MIGRATION_CAPABILITIES = 0x01,
109 RESERVATION_CAPABILITIES = 0x02,
110};
111
112enum viosrp_capability_support {
113 SERVER_DOES_NOT_SUPPORTS_CAP = 0x0,
114 SERVER_SUPPORTS_CAP = 0x01,
115 SERVER_CAP_DATA = 0x02,
116};
117
118enum viosrp_reserve_type {
119 CLIENT_RESERVE_SCSI_2 = 0x01,
120};
121
122enum viosrp_capability_flag {
123 CLIENT_MIGRATED = 0x01,
124 CLIENT_RECONNECT = 0x02,
125 CAP_LIST_SUPPORTED = 0x04,
126 CAP_LIST_DATA = 0x08,
127};
128
129
130
131
132struct mad_common {
133 __be32 type;
134 __be16 status;
135 __be16 length;
136 __be64 tag;
137};
138
139
140
141
142
143
144
145
146struct viosrp_empty_iu {
147 struct mad_common common;
148 __be64 buffer;
149 __be32 port;
150};
151
152struct viosrp_error_log {
153 struct mad_common common;
154 __be64 buffer;
155};
156
157struct viosrp_adapter_info {
158 struct mad_common common;
159 __be64 buffer;
160};
161
162struct viosrp_fast_fail {
163 struct mad_common common;
164};
165
166struct viosrp_capabilities {
167 struct mad_common common;
168 __be64 buffer;
169};
170
171struct mad_capability_common {
172 __be32 cap_type;
173 __be16 length;
174 __be16 server_support;
175};
176
177struct mad_reserve_cap {
178 struct mad_capability_common common;
179 __be32 type;
180};
181
182struct mad_migration_cap {
183 struct mad_capability_common common;
184 __be32 ecl;
185};
186
187struct capabilities {
188 __be32 flags;
189 char name[SRP_MAX_LOC_LEN];
190 char loc[SRP_MAX_LOC_LEN];
191 struct mad_migration_cap migration;
192 struct mad_reserve_cap reserve;
193};
194
195union mad_iu {
196 struct viosrp_empty_iu empty_iu;
197 struct viosrp_error_log error_log;
198 struct viosrp_adapter_info adapter_info;
199 struct viosrp_fast_fail fast_fail;
200 struct viosrp_capabilities capabilities;
201};
202
203union viosrp_iu {
204 union srp_iu srp;
205 union mad_iu mad;
206};
207
208struct mad_adapter_info_data {
209 char srp_version[8];
210 char partition_name[96];
211 __be32 partition_number;
212#define SRP_MAD_VERSION_1 1
213 __be32 mad_version;
214#define SRP_MAD_OS_LINUX 2
215#define SRP_MAD_OS_AIX 3
216 __be32 os_type;
217 __be32 port_max_txu[8];
218};
219
220#endif
221