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
30
31
32
33
34#ifndef PPC_VIOSRP_H
35#define PPC_VIOSRP_H
36
37#include "hw/scsi/srp.h"
38
39#define SRP_VERSION "16.a"
40#define SRP_MAX_IU_LEN 256
41#define SRP_MAX_LOC_LEN 32
42
43union srp_iu {
44 struct srp_login_req login_req;
45 struct srp_login_rsp login_rsp;
46 struct srp_login_rej login_rej;
47 struct srp_i_logout i_logout;
48 struct srp_t_logout t_logout;
49 struct srp_tsk_mgmt tsk_mgmt;
50 struct srp_cmd cmd;
51 struct srp_rsp rsp;
52};
53
54enum viosrp_crq_formats {
55 VIOSRP_SRP_FORMAT = 0x01,
56 VIOSRP_MAD_FORMAT = 0x02,
57 VIOSRP_OS400_FORMAT = 0x03,
58 VIOSRP_AIX_FORMAT = 0x04,
59 VIOSRP_LINUX_FORMAT = 0x06,
60 VIOSRP_INLINE_FORMAT = 0x07
61};
62
63enum viosrp_crq_status {
64 VIOSRP_OK = 0x0,
65 VIOSRP_NONRECOVERABLE_ERR = 0x1,
66 VIOSRP_VIOLATES_MAX_XFER = 0x2,
67 VIOSRP_PARTNER_PANIC = 0x3,
68 VIOSRP_DEVICE_BUSY = 0x8,
69 VIOSRP_ADAPTER_FAIL = 0x10,
70 VIOSRP_OK2 = 0x99,
71};
72
73struct viosrp_crq {
74 uint8_t valid;
75 uint8_t format;
76 uint8_t reserved;
77 uint8_t status;
78 uint16_t timeout;
79 uint16_t IU_length;
80 uint64_t IU_data_ptr;
81};
82
83
84
85
86enum viosrp_mad_types {
87 VIOSRP_EMPTY_IU_TYPE = 0x01,
88 VIOSRP_ERROR_LOG_TYPE = 0x02,
89 VIOSRP_ADAPTER_INFO_TYPE = 0x03,
90 VIOSRP_HOST_CONFIG_TYPE = 0x04,
91 VIOSRP_CAPABILITIES_TYPE = 0x05,
92 VIOSRP_ENABLE_FAST_FAIL = 0x08,
93};
94
95enum viosrp_mad_status {
96 VIOSRP_MAD_SUCCESS = 0x00,
97 VIOSRP_MAD_NOT_SUPPORTED = 0xF1,
98 VIOSRP_MAD_FAILED = 0xF7,
99};
100
101enum viosrp_capability_type {
102 MIGRATION_CAPABILITIES = 0x01,
103 RESERVATION_CAPABILITIES = 0x02,
104};
105
106enum viosrp_capability_support {
107 SERVER_DOES_NOT_SUPPORTS_CAP = 0x0,
108 SERVER_SUPPORTS_CAP = 0x01,
109 SERVER_CAP_DATA = 0x02,
110};
111
112enum viosrp_reserve_type {
113 CLIENT_RESERVE_SCSI_2 = 0x01,
114};
115
116enum viosrp_capability_flag {
117 CLIENT_MIGRATED = 0x01,
118 CLIENT_RECONNECT = 0x02,
119 CAP_LIST_SUPPORTED = 0x04,
120 CAP_LIST_DATA = 0x08,
121};
122
123
124
125
126struct mad_common {
127 uint32_t type;
128 uint16_t status;
129 uint16_t length;
130 uint64_t tag;
131};
132
133
134
135
136
137
138
139
140struct viosrp_empty_iu {
141 struct mad_common common;
142 uint64_t buffer;
143 uint32_t port;
144};
145
146struct viosrp_error_log {
147 struct mad_common common;
148 uint64_t buffer;
149};
150
151struct viosrp_adapter_info {
152 struct mad_common common;
153 uint64_t buffer;
154};
155
156struct viosrp_host_config {
157 struct mad_common common;
158 uint64_t buffer;
159};
160
161struct viosrp_fast_fail {
162 struct mad_common common;
163};
164
165struct viosrp_capabilities {
166 struct mad_common common;
167 uint64_t buffer;
168};
169
170struct mad_capability_common {
171 uint32_t cap_type;
172 uint16_t length;
173 uint16_t server_support;
174};
175
176struct mad_reserve_cap {
177 struct mad_capability_common common;
178 uint32_t type;
179};
180
181struct mad_migration_cap {
182 struct mad_capability_common common;
183 uint32_t ecl;
184};
185
186struct capabilities {
187 uint32_t flags;
188 char name[SRP_MAX_LOC_LEN];
189 char loc[SRP_MAX_LOC_LEN];
190 struct mad_migration_cap migration;
191 struct mad_reserve_cap reserve;
192};
193
194union mad_iu {
195 struct viosrp_empty_iu empty_iu;
196 struct viosrp_error_log error_log;
197 struct viosrp_adapter_info adapter_info;
198 struct viosrp_host_config host_config;
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 uint32_t partition_number;
212 uint32_t mad_version;
213 uint32_t os_type;
214 uint32_t port_max_txu[8];
215};
216
217#endif
218