sd: remove 'ssd' driver support
[unleashed/tickless.git] / usr / src / lib / udapl / libdat / include / dat / dat_error.h
blob4746c2011259317a6c53c3cca7b128b3efd4075d
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright (c) 2002-2004, Network Appliance, Inc. All rights reserved.
26 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
30 #ifndef _DAT_ERROR_H_
31 #define _DAT_ERROR_H_
35 * HEADER: dat_error.h
37 * PURPOSE: DAT return codes
39 * Description: Header file for "uDAPL: User Direct Access Programming
40 * Library, Version: 1.2"
42 * Mapping rules:
43 * Error types are compound types, as mapped out below.
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
54 * All return codes are actually a 3-way tuple:
56 * type: DAT_RETURN_CLASS DAT_RETURN_TYPE DAT_RETURN_SUBTYPE
57 * bits: 31-30 29-16 15-0
59 * +----------------------------------------------------------------------+
60 * |3130 | 29282726252423222120191817 | 1615141312111009080706054003020100|
61 * |CLAS | DAT_TYPE_STATUS | SUBTYPE_STATUS |
62 * +----------------------------------------------------------------------+
66 * Class Bits
68 #define DAT_CLASS_ERROR 0x80000000
69 #define DAT_CLASS_WARNING 0x40000000
70 #define DAT_CLASS_SUCCESS 0x00000000
73 * DAT Error bits
75 #define DAT_TYPE_MASK 0x3fff0000 /* mask for DAT_TYPE_STATUS bits */
76 #define DAT_SUBTYPE_MASK 0x0000FFFF /* mask for DAT_SUBTYPE_STATUS bits */
79 * Determining the success of an operation is best done with a macro;
80 * each of these returns a boolean value.
82 #define DAT_IS_WARNING(status) ((DAT_UINT32)(status) & DAT_CLASS_WARNING)
84 #define DAT_GET_TYPE(status) ((DAT_UINT32)(status) & DAT_TYPE_MASK)
85 #define DAT_GET_SUBTYPE(status) ((DAT_UINT32)(status) & DAT_SUBTYPE_MASK)
88 * DAT return types. The ERROR bit is enabled for these definitions
90 typedef enum dat_return_type
92 /* The operation was successful. */
93 DAT_SUCCESS = 0x000000,
96 * The operation was aborted because IA was closed or EVD was
97 * destroyed.
99 DAT_ABORT = 0x00010000,
101 /* The specified Connection Qualifier was in use. */
102 DAT_CONN_QUAL_IN_USE = 0x00020000,
104 /* The operation failed due to resource limitations. */
105 DAT_INSUFFICIENT_RESOURCES = 0x00030000,
108 * Provider internal error. This error can be returned by any
109 * operation when the Provider have detected an internal error.
110 * This error does no mask any error causes by Consumer.
112 DAT_INTERNAL_ERROR = 0x00040000,
114 /* One of the DAT handles was invalid. */
115 DAT_INVALID_HANDLE = 0x00050000,
117 /* One of the parameters was invalid. */
118 DAT_INVALID_PARAMETER = 0x00060000,
121 * One of the parameters was invalid for this operation. There
122 * are Event Streams associated with the Event Dispatcher feeding
123 * it.
125 DAT_INVALID_STATE = 0x00070000,
128 * The size of the receiving buffer is too small for sending
129 * buffer data. The size of the local buffer is too small for
130 * the data of the remote buffer.
132 DAT_LENGTH_ERROR = 0x00080000,
134 /* The requested Model was not supported by the Provider. */
135 DAT_MODEL_NOT_SUPPORTED = 0x00090000,
138 * The provider name or specified attributes are not found in
139 * the registry.
142 DAT_PROVIDER_NOT_FOUND = 0x000A0000,
145 * Protection violation for local or remote memory
146 * access. Protection Zone mismatch between an LMR of one of the
147 * local_iov segments and the local Endpoint.
149 DAT_PRIVILEGES_VIOLATION = 0x000B0000,
152 * Privileges violation for local or re-mote memory access. One
153 * of the LMRs used in local_iov was either invalid or did not
154 * have the local read privileges.
156 DAT_PROTECTION_VIOLATION = 0x000C0000,
158 /* The operation timed out without a notification. */
159 DAT_QUEUE_EMPTY = 0x000D0000,
161 /* The Event Dispatcher queue is full. */
162 DAT_QUEUE_FULL = 0x000E0000,
164 /* The operation timed out. UDAPL ONLY */
165 DAT_TIMEOUT_EXPIRED = 0x000F0000,
167 /* The provider name was already registered */
168 DAT_PROVIDER_ALREADY_REGISTERED = 0x00100000,
170 /* The provider is "in-use" and cannot be closed at this time */
171 DAT_PROVIDER_IN_USE = 0x00110000,
173 /* The requested remote address is not valid or not reachable */
174 DAT_INVALID_ADDRESS = 0x00120000,
176 /* [Unix only] dat_evd_wait or dat_cno_wait has been interrupted. */
177 DAT_INTERRUPTED_CALL = 0x00130000,
179 /* No Connection Qualifiers are available */
180 DAT_CONN_QUAL_UNAVAILABLE = 0x00140000,
182 /* Provider does not support the operation yet. */
183 DAT_NOT_IMPLEMENTED = 0x0FFF0000
185 } DAT_RETURN_TYPE;
187 typedef DAT_UINT32 DAT_RETURN;
189 /* Backwared compatibility with DAT 1.0 */
190 #define DAT_NAME_NOT_FOUND DAT_PROVIDER_NOT_FOUND
193 * DAT_RETURN_SUBTYPE listing
196 typedef enum dat_return_subtype
198 /* First element is no subtype */
199 DAT_NO_SUBTYPE,
200 /* ABORT sub types */
201 /* call was interrupted by a signal, or otherwise */
202 DAT_SUB_INTERRUPTED,
204 /* DAT_CONN_QUAL_IN_USE has no subtypes */
206 /* INSUFFICIENT_RESOURCES subtypes */
207 DAT_RESOURCE_MEMORY,
208 DAT_RESOURCE_DEVICE,
209 DAT_RESOURCE_TEP, /* transport endpoint, e.g. QP */
210 DAT_RESOURCE_TEVD, /* transport EVD, e.g. CQ */
211 DAT_RESOURCE_PROTECTION_DOMAIN,
212 DAT_RESOURCE_MEMORY_REGION, /* HCA memory for LMR or RMR */
213 DAT_RESOURCE_ERROR_HANDLER,
214 DAT_RESOURCE_CREDITS, /* e.g outstanding RDMA Read credit as target */
215 DAT_RESOURCE_SRQ,
217 /* DAT_INTERNAL_ERROR has no subtypes */
219 /* INVALID_HANDLE subtypes */
220 DAT_INVALID_HANDLE_IA,
221 DAT_INVALID_HANDLE_EP,
222 DAT_INVALID_HANDLE_LMR,
223 DAT_INVALID_HANDLE_RMR,
224 DAT_INVALID_HANDLE_PZ,
225 DAT_INVALID_HANDLE_PSP,
226 DAT_INVALID_HANDLE_RSP,
227 DAT_INVALID_HANDLE_CR,
228 DAT_INVALID_HANDLE_CNO,
229 DAT_INVALID_HANDLE_EVD_CR,
230 DAT_INVALID_HANDLE_EVD_REQUEST,
231 DAT_INVALID_HANDLE_EVD_RECV,
232 DAT_INVALID_HANDLE_EVD_CONN,
233 DAT_INVALID_HANDLE_EVD_ASYNC,
234 DAT_INVALID_HANDLE_SRQ,
235 DAT_INVALID_HANDLE1,
236 DAT_INVALID_HANDLE2,
237 DAT_INVALID_HANDLE3,
238 DAT_INVALID_HANDLE4,
239 DAT_INVALID_HANDLE5,
240 DAT_INVALID_HANDLE6,
241 DAT_INVALID_HANDLE7,
242 DAT_INVALID_HANDLE8,
243 DAT_INVALID_HANDLE9,
244 DAT_INVALID_HANDLE10,
246 /* DAT_INVALID_PARAMETER subtypes */
247 DAT_INVALID_ARG1,
248 DAT_INVALID_ARG2,
249 DAT_INVALID_ARG3,
250 DAT_INVALID_ARG4,
251 DAT_INVALID_ARG5,
252 DAT_INVALID_ARG6,
253 DAT_INVALID_ARG7,
254 DAT_INVALID_ARG8,
255 DAT_INVALID_ARG9,
256 DAT_INVALID_ARG10,
258 /* DAT_INVALID_EP_STATE subtypes */
259 DAT_INVALID_STATE_EP_UNCONNECTED,
260 DAT_INVALID_STATE_EP_ACTCONNPENDING,
261 DAT_INVALID_STATE_EP_PASSCONNPENDING,
262 DAT_INVALID_STATE_EP_TENTCONNPENDING,
263 DAT_INVALID_STATE_EP_CONNECTED,
264 DAT_INVALID_STATE_EP_DISCONNECTED,
265 DAT_INVALID_STATE_EP_RESERVED,
266 DAT_INVALID_STATE_EP_COMPLPENDING,
267 DAT_INVALID_STATE_EP_DISCPENDING,
268 DAT_INVALID_STATE_EP_PROVIDERCONTROL,
269 DAT_INVALID_STATE_EP_NOTREADY,
270 DAT_INVALID_STATE_EP_RECV_WATERMARK,
271 DAT_INVALID_STATE_EP_PZ,
272 DAT_INVALID_STATE_EP_EVD_REQUEST,
273 DAT_INVALID_STATE_EP_EVD_RECV,
274 DAT_INVALID_STATE_EP_EVD_CONNECT,
275 DAT_INVALID_STATE_EP_UNCONFIGURED,
276 DAT_INVALID_STATE_EP_UNCONFRESERVED,
277 DAT_INVALID_STATE_EP_UNCONFPASSIVE,
278 DAT_INVALID_STATE_EP_UNCONFTENTATIVE,
280 DAT_INVALID_STATE_CNO_IN_USE,
281 DAT_INVALID_STATE_CNO_DEAD,
284 * EVD states. Enabled/Disabled, Waitable/Unwaitable,
285 * and Notify/Solicited/Threshold are 3 orthogonal
286 * bands of EVD state.The Threshold one is uDAPL specific.
288 DAT_INVALID_STATE_EVD_OPEN,
290 * EVD can be either in enabled or disabled but not both
291 * or neither at the same time
293 DAT_INVALID_STATE_EVD_ENABLED,
294 DAT_INVALID_STATE_EVD_DISABLED,
296 * EVD can be either in waitable or unwaitable but not
297 * both or neither at the same time
299 DAT_INVALID_STATE_EVD_WAITABLE,
300 DAT_INVALID_STATE_EVD_UNWAITABLE,
301 /* Do not release an EVD if it is in use */
302 DAT_INVALID_STATE_EVD_IN_USE,
305 * EVD can be either in notify or solicited or threshold
306 * but not any pair, or all, or none at the same time.
307 * The threshold one is for uDAPL only
309 DAT_INVALID_STATE_EVD_CONFIG_NOTIFY,
310 DAT_INVALID_STATE_EVD_CONFIG_SOLICITED,
311 DAT_INVALID_STATE_EVD_CONFIG_THRESHOLD,
312 DAT_INVALID_STATE_EVD_WAITER,
313 DAT_INVALID_STATE_EVD_ASYNC, /* Async EVD required */
314 DAT_INVALID_STATE_IA_IN_USE,
315 DAT_INVALID_STATE_LMR_IN_USE,
316 DAT_INVALID_STATE_LMR_FREE,
317 DAT_INVALID_STATE_PZ_IN_USE,
318 DAT_INVALID_STATE_PZ_FREE,
320 /* DAT_INVALID_STATE_SRQ subtypes */
321 DAT_INVALID_STATE_SRQ_OPERATIONAL,
322 DAT_INVALID_STATE_SRQ_ERROR,
323 DAT_INVALID_STATE_SRQ_IN_USE,
325 /* DAT_LENGTH_ERROR has no subtypes */
326 /* DAT_MODEL_NOT_SUPPORTED has no subtypes */
328 /* DAT_PRIVILEGES_VIOLATION subtypes */
329 DAT_PRIVILEGES_READ,
330 DAT_PRIVILEGES_WRITE,
331 DAT_PRIVILEGES_RDMA_READ,
332 DAT_PRIVILEGES_RDMA_WRITE,
334 /* DAT_PROTECTION_VIOLATION subtypes */
335 DAT_PROTECTION_READ,
336 DAT_PROTECTION_WRITE,
337 DAT_PROTECTION_RDMA_READ,
338 DAT_PROTECTION_RDMA_WRITE,
340 /* DAT_QUEUE_EMPTY has no subtypes */
341 /* DAT_QUEUE_FULL has no subtypes */
342 /* DAT_TIMEOUT_EXPIRED has no subtypes */
343 /* DAT_PROVIDER_ALREADY_REGISTERED has no subtypes */
344 /* DAT_PROVIDER_IN_USE has no subtypes */
346 /* DAT_INVALID_ADDRESS subtypes */
348 * Unsupported addresses - those that are not Malformed,
349 * but are incorrect for use in DAT (regardless of local
350 * routing capabilities): IPv6 Multicast Addresses (ff/8)
351 * IPv4 Broadcast/Multicast Addresses
353 DAT_INVALID_ADDRESS_UNSUPPORTED,
355 * Unreachable addresses - A Provider may know that certain
356 * addresses are unreachable immediately. One examples would
357 * be an IPv6 addresses on an IPv4-only system. This may also
358 * be returned if it is known that there is no route to the
359 * host. A Provider is not obligated to check for this
360 * condition.
362 DAT_INVALID_ADDRESS_UNREACHABLE,
364 * Malformed addresses -- these cannot be valid in any context.
365 * Those listed in RFC1884 section 2.3 as "Reserved" or
366 * "Unassigned".
368 DAT_INVALID_ADDRESS_MALFORMED,
370 /* DAT_INTERRUPTED_CALL has no subtypes */
371 /* DAT_CONN_QUAL_UNAVAILABLE has no subtypes */
373 /* DAT_PROVIDER_NOT_FOUND subtypes. Erratta to the 1.1 spec */
374 DAT_NAME_NOT_REGISTERED,
375 DAT_MAJOR_NOT_FOUND,
376 DAT_MINOR_NOT_FOUND,
377 DAT_THREAD_SAFETY_NOT_FOUND,
379 /* DAT_INVALID_PARAMETER Sun specific */
380 DAT_INVALID_RO_COOKIE
382 } DAT_RETURN_SUBTYPE;
384 #ifdef __cplusplus
386 #endif
388 #endif /* _DAT_ERROR_H_ */