dat_error.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2002-2004, Network Appliance, Inc. All rights reserved.
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _DAT_ERROR_H_
#define _DAT_ERROR_H_
#pragma ident "%Z%%M% %I% %E% SMI"
/*
*
* HEADER: dat_error.h
*
* PURPOSE: DAT return codes
*
* Description: Header file for "uDAPL: User Direct Access Programming
* Library, Version: 1.2"
*
* Mapping rules:
* Error types are compound types, as mapped out below.
*
*
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
*
* All return codes are actually a 3-way tuple:
*
* type: DAT_RETURN_CLASS DAT_RETURN_TYPE DAT_RETURN_SUBTYPE
* bits: 31-30 29-16 15-0
*
* +----------------------------------------------------------------------+
* |3130 | 29282726252423222120191817 | 1615141312111009080706054003020100|
* |CLAS | DAT_TYPE_STATUS | SUBTYPE_STATUS |
* +----------------------------------------------------------------------+
*/
/*
* Class Bits
*/
#define DAT_CLASS_ERROR 0x80000000
#define DAT_CLASS_WARNING 0x40000000
#define DAT_CLASS_SUCCESS 0x00000000
/*
* DAT Error bits
*/
/*
* Determining the success of an operation is best done with a macro;
* each of these returns a boolean value.
*/
/*
* DAT return types. The ERROR bit is enabled for these definitions
*/
typedef enum dat_return_type
{
/* The operation was successful. */
DAT_SUCCESS = 0x000000,
/*
* The operation was aborted because IA was closed or EVD was
* destroyed.
*/
DAT_ABORT = 0x00010000,
/* The specified Connection Qualifier was in use. */
DAT_CONN_QUAL_IN_USE = 0x00020000,
/* The operation failed due to resource limitations. */
DAT_INSUFFICIENT_RESOURCES = 0x00030000,
/*
* Provider internal error. This error can be returned by any
* operation when the Provider have detected an internal error.
* This error does no mask any error causes by Consumer.
*/
DAT_INTERNAL_ERROR = 0x00040000,
/* One of the DAT handles was invalid. */
DAT_INVALID_HANDLE = 0x00050000,
/* One of the parameters was invalid. */
DAT_INVALID_PARAMETER = 0x00060000,
/*
* One of the parameters was invalid for this operation. There
* are Event Streams associated with the Event Dispatcher feeding
* it.
*/
DAT_INVALID_STATE = 0x00070000,
/*
* The size of the receiving buffer is too small for sending
* buffer data. The size of the local buffer is too small for
* the data of the remote buffer.
*/
DAT_LENGTH_ERROR = 0x00080000,
/* The requested Model was not supported by the Provider. */
DAT_MODEL_NOT_SUPPORTED = 0x00090000,
/*
* The provider name or specified attributes are not found in
* the registry.
*/
DAT_PROVIDER_NOT_FOUND = 0x000A0000,
/*
* Protection violation for local or remote memory
* access. Protection Zone mismatch between an LMR of one of the
* local_iov segments and the local Endpoint.
*/
DAT_PRIVILEGES_VIOLATION = 0x000B0000,
/*
* Privileges violation for local or re-mote memory access. One
* of the LMRs used in local_iov was either invalid or did not
* have the local read privileges.
*/
DAT_PROTECTION_VIOLATION = 0x000C0000,
/* The operation timed out without a notification. */
DAT_QUEUE_EMPTY = 0x000D0000,
/* The Event Dispatcher queue is full. */
DAT_QUEUE_FULL = 0x000E0000,
/* The operation timed out. UDAPL ONLY */
DAT_TIMEOUT_EXPIRED = 0x000F0000,
/* The provider name was already registered */
DAT_PROVIDER_ALREADY_REGISTERED = 0x00100000,
/* The provider is "in-use" and cannot be closed at this time */
DAT_PROVIDER_IN_USE = 0x00110000,
/* The requested remote address is not valid or not reachable */
DAT_INVALID_ADDRESS = 0x00120000,
/* [Unix only] dat_evd_wait or dat_cno_wait has been interrupted. */
DAT_INTERRUPTED_CALL = 0x00130000,
/* No Connection Qualifiers are available */
DAT_CONN_QUAL_UNAVAILABLE = 0x00140000,
/* Provider does not support the operation yet. */
DAT_NOT_IMPLEMENTED = 0x0FFF0000
typedef DAT_UINT32 DAT_RETURN;
/* Backwared compatibility with DAT 1.0 */
/*
* DAT_RETURN_SUBTYPE listing
*/
typedef enum dat_return_subtype
{
/* First element is no subtype */
/* ABORT sub types */
/* call was interrupted by a signal, or otherwise */
/* DAT_CONN_QUAL_IN_USE has no subtypes */
/* INSUFFICIENT_RESOURCES subtypes */
DAT_RESOURCE_TEP, /* transport endpoint, e.g. QP */
DAT_RESOURCE_TEVD, /* transport EVD, e.g. CQ */
DAT_RESOURCE_MEMORY_REGION, /* HCA memory for LMR or RMR */
DAT_RESOURCE_CREDITS, /* e.g outstanding RDMA Read credit as target */
/* DAT_INTERNAL_ERROR has no subtypes */
/* INVALID_HANDLE subtypes */
/* DAT_INVALID_PARAMETER subtypes */
/* DAT_INVALID_EP_STATE subtypes */
/*
* EVD states. Enabled/Disabled, Waitable/Unwaitable,
* bands of EVD state.The Threshold one is uDAPL specific.
*/
/*
* EVD can be either in enabled or disabled but not both
* or neither at the same time
*/
/*
* EVD can be either in waitable or unwaitable but not
* both or neither at the same time
*/
/* Do not release an EVD if it is in use */
/*
* EVD can be either in notify or solicited or threshold
* but not any pair, or all, or none at the same time.
* The threshold one is for uDAPL only
*/
DAT_INVALID_STATE_EVD_ASYNC, /* Async EVD required */
/* DAT_INVALID_STATE_SRQ subtypes */
/* DAT_LENGTH_ERROR has no subtypes */
/* DAT_MODEL_NOT_SUPPORTED has no subtypes */
/* DAT_PRIVILEGES_VIOLATION subtypes */
/* DAT_PROTECTION_VIOLATION subtypes */
/* DAT_QUEUE_EMPTY has no subtypes */
/* DAT_QUEUE_FULL has no subtypes */
/* DAT_TIMEOUT_EXPIRED has no subtypes */
/* DAT_PROVIDER_ALREADY_REGISTERED has no subtypes */
/* DAT_PROVIDER_IN_USE has no subtypes */
/* DAT_INVALID_ADDRESS subtypes */
/*
* Unsupported addresses - those that are not Malformed,
* but are incorrect for use in DAT (regardless of local
* routing capabilities): IPv6 Multicast Addresses (ff/8)
*/
/*
* Unreachable addresses - A Provider may know that certain
* addresses are unreachable immediately. One examples would
* be an IPv6 addresses on an IPv4-only system. This may also
* be returned if it is known that there is no route to the
* host. A Provider is not obligated to check for this
* condition.
*/
/*
* Malformed addresses -- these cannot be valid in any context.
* Those listed in RFC1884 section 2.3 as "Reserved" or
* "Unassigned".
*/
/* DAT_INTERRUPTED_CALL has no subtypes */
/* DAT_CONN_QUAL_UNAVAILABLE has no subtypes */
/* DAT_PROVIDER_NOT_FOUND subtypes. Erratta to the 1.1 spec */
#ifdef __cplusplus
}
#endif
#endif /* _DAT_ERROR_H_ */