2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright (c) 2002-2004, Network Appliance, Inc. All rights reserved.
2N/A */
2N/A
2N/A/*
2N/A * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A
2N/A#ifndef _DAT_ERROR_H_
2N/A#define _DAT_ERROR_H_
2N/A
2N/A/*
2N/A *
2N/A * HEADER: dat_error.h
2N/A *
2N/A * PURPOSE: DAT return codes
2N/A *
2N/A * Description: Header file for "uDAPL: User Direct Access Programming
2N/A * Library, Version: 1.2"
2N/A *
2N/A * Mapping rules:
2N/A * Error types are compound types, as mapped out below.
2N/A *
2N/A *
2N/A */
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A/*
2N/A *
2N/A * All return codes are actually a 3-way tuple:
2N/A *
2N/A * type: DAT_RETURN_CLASS DAT_RETURN_TYPE DAT_RETURN_SUBTYPE
2N/A * bits: 31-30 29-16 15-0
2N/A *
2N/A * +----------------------------------------------------------------------+
2N/A * |3130 | 29282726252423222120191817 | 1615141312111009080706054003020100|
2N/A * |CLAS | DAT_TYPE_STATUS | SUBTYPE_STATUS |
2N/A * +----------------------------------------------------------------------+
2N/A */
2N/A
2N/A/*
2N/A * Class Bits
2N/A */
2N/A#define DAT_CLASS_ERROR 0x80000000
2N/A#define DAT_CLASS_WARNING 0x40000000
2N/A#define DAT_CLASS_SUCCESS 0x00000000
2N/A
2N/A/*
2N/A * DAT Error bits
2N/A */
2N/A#define DAT_TYPE_MASK 0x3fff0000 /* mask for DAT_TYPE_STATUS bits */
2N/A#define DAT_SUBTYPE_MASK 0x0000FFFF /* mask for DAT_SUBTYPE_STATUS bits */
2N/A
2N/A/*
2N/A * Determining the success of an operation is best done with a macro;
2N/A * each of these returns a boolean value.
2N/A */
2N/A#define DAT_IS_WARNING(status) ((DAT_UINT32)(status) & DAT_CLASS_WARNING)
2N/A
2N/A#define DAT_GET_TYPE(status) ((DAT_UINT32)(status) & DAT_TYPE_MASK)
2N/A#define DAT_GET_SUBTYPE(status) ((DAT_UINT32)(status) & DAT_SUBTYPE_MASK)
2N/A
2N/A/*
2N/A * DAT return types. The ERROR bit is enabled for these definitions
2N/A */
2N/Atypedef enum dat_return_type
2N/A{
2N/A /* The operation was successful. */
2N/A DAT_SUCCESS = 0x000000,
2N/A
2N/A /*
2N/A * The operation was aborted because IA was closed or EVD was
2N/A * destroyed.
2N/A */
2N/A DAT_ABORT = 0x00010000,
2N/A
2N/A /* The specified Connection Qualifier was in use. */
2N/A DAT_CONN_QUAL_IN_USE = 0x00020000,
2N/A
2N/A /* The operation failed due to resource limitations. */
2N/A DAT_INSUFFICIENT_RESOURCES = 0x00030000,
2N/A
2N/A /*
2N/A * Provider internal error. This error can be returned by any
2N/A * operation when the Provider have detected an internal error.
2N/A * This error does no mask any error causes by Consumer.
2N/A */
2N/A DAT_INTERNAL_ERROR = 0x00040000,
2N/A
2N/A /* One of the DAT handles was invalid. */
2N/A DAT_INVALID_HANDLE = 0x00050000,
2N/A
2N/A /* One of the parameters was invalid. */
2N/A DAT_INVALID_PARAMETER = 0x00060000,
2N/A
2N/A /*
2N/A * One of the parameters was invalid for this operation. There
2N/A * are Event Streams associated with the Event Dispatcher feeding
2N/A * it.
2N/A */
2N/A DAT_INVALID_STATE = 0x00070000,
2N/A
2N/A /*
2N/A * The size of the receiving buffer is too small for sending
2N/A * buffer data. The size of the local buffer is too small for
2N/A * the data of the remote buffer.
2N/A */
2N/A DAT_LENGTH_ERROR = 0x00080000,
2N/A
2N/A /* The requested Model was not supported by the Provider. */
2N/A DAT_MODEL_NOT_SUPPORTED = 0x00090000,
2N/A
2N/A /*
2N/A * The provider name or specified attributes are not found in
2N/A * the registry.
2N/A */
2N/A
2N/A DAT_PROVIDER_NOT_FOUND = 0x000A0000,
2N/A
2N/A /*
2N/A * Protection violation for local or remote memory
2N/A * access. Protection Zone mismatch between an LMR of one of the
2N/A * local_iov segments and the local Endpoint.
2N/A */
2N/A DAT_PRIVILEGES_VIOLATION = 0x000B0000,
2N/A
2N/A /*
2N/A * Privileges violation for local or re-mote memory access. One
2N/A * of the LMRs used in local_iov was either invalid or did not
2N/A * have the local read privileges.
2N/A */
2N/A DAT_PROTECTION_VIOLATION = 0x000C0000,
2N/A
2N/A /* The operation timed out without a notification. */
2N/A DAT_QUEUE_EMPTY = 0x000D0000,
2N/A
2N/A /* The Event Dispatcher queue is full. */
2N/A DAT_QUEUE_FULL = 0x000E0000,
2N/A
2N/A /* The operation timed out. UDAPL ONLY */
2N/A DAT_TIMEOUT_EXPIRED = 0x000F0000,
2N/A
2N/A /* The provider name was already registered */
2N/A DAT_PROVIDER_ALREADY_REGISTERED = 0x00100000,
2N/A
2N/A /* The provider is "in-use" and cannot be closed at this time */
2N/A DAT_PROVIDER_IN_USE = 0x00110000,
2N/A
2N/A /* The requested remote address is not valid or not reachable */
2N/A DAT_INVALID_ADDRESS = 0x00120000,
2N/A
2N/A /* [Unix only] dat_evd_wait or dat_cno_wait has been interrupted. */
2N/A DAT_INTERRUPTED_CALL = 0x00130000,
2N/A
2N/A /* No Connection Qualifiers are available */
2N/A DAT_CONN_QUAL_UNAVAILABLE = 0x00140000,
2N/A
2N/A /* Provider does not support the operation yet. */
2N/A DAT_NOT_IMPLEMENTED = 0x0FFF0000
2N/A
2N/A} DAT_RETURN_TYPE;
2N/A
2N/Atypedef DAT_UINT32 DAT_RETURN;
2N/A
2N/A/* Backwared compatibility with DAT 1.0 */
2N/A#define DAT_NAME_NOT_FOUND DAT_PROVIDER_NOT_FOUND
2N/A
2N/A/*
2N/A * DAT_RETURN_SUBTYPE listing
2N/A */
2N/A
2N/Atypedef enum dat_return_subtype
2N/A{
2N/A /* First element is no subtype */
2N/A DAT_NO_SUBTYPE,
2N/A /* ABORT sub types */
2N/A /* call was interrupted by a signal, or otherwise */
2N/A DAT_SUB_INTERRUPTED,
2N/A
2N/A /* DAT_CONN_QUAL_IN_USE has no subtypes */
2N/A
2N/A /* INSUFFICIENT_RESOURCES subtypes */
2N/A DAT_RESOURCE_MEMORY,
2N/A DAT_RESOURCE_DEVICE,
2N/A DAT_RESOURCE_TEP, /* transport endpoint, e.g. QP */
2N/A DAT_RESOURCE_TEVD, /* transport EVD, e.g. CQ */
2N/A DAT_RESOURCE_PROTECTION_DOMAIN,
2N/A DAT_RESOURCE_MEMORY_REGION, /* HCA memory for LMR or RMR */
2N/A DAT_RESOURCE_ERROR_HANDLER,
2N/A DAT_RESOURCE_CREDITS, /* e.g outstanding RDMA Read credit as target */
2N/A DAT_RESOURCE_SRQ,
2N/A
2N/A /* DAT_INTERNAL_ERROR has no subtypes */
2N/A
2N/A /* INVALID_HANDLE subtypes */
2N/A DAT_INVALID_HANDLE_IA,
2N/A DAT_INVALID_HANDLE_EP,
2N/A DAT_INVALID_HANDLE_LMR,
2N/A DAT_INVALID_HANDLE_RMR,
2N/A DAT_INVALID_HANDLE_PZ,
2N/A DAT_INVALID_HANDLE_PSP,
2N/A DAT_INVALID_HANDLE_RSP,
2N/A DAT_INVALID_HANDLE_CR,
2N/A DAT_INVALID_HANDLE_CNO,
2N/A DAT_INVALID_HANDLE_EVD_CR,
2N/A DAT_INVALID_HANDLE_EVD_REQUEST,
2N/A DAT_INVALID_HANDLE_EVD_RECV,
2N/A DAT_INVALID_HANDLE_EVD_CONN,
2N/A DAT_INVALID_HANDLE_EVD_ASYNC,
2N/A DAT_INVALID_HANDLE_SRQ,
2N/A DAT_INVALID_HANDLE1,
2N/A DAT_INVALID_HANDLE2,
2N/A DAT_INVALID_HANDLE3,
2N/A DAT_INVALID_HANDLE4,
2N/A DAT_INVALID_HANDLE5,
2N/A DAT_INVALID_HANDLE6,
2N/A DAT_INVALID_HANDLE7,
2N/A DAT_INVALID_HANDLE8,
2N/A DAT_INVALID_HANDLE9,
2N/A DAT_INVALID_HANDLE10,
2N/A
2N/A /* DAT_INVALID_PARAMETER subtypes */
2N/A DAT_INVALID_ARG1,
2N/A DAT_INVALID_ARG2,
2N/A DAT_INVALID_ARG3,
2N/A DAT_INVALID_ARG4,
2N/A DAT_INVALID_ARG5,
2N/A DAT_INVALID_ARG6,
2N/A DAT_INVALID_ARG7,
2N/A DAT_INVALID_ARG8,
2N/A DAT_INVALID_ARG9,
2N/A DAT_INVALID_ARG10,
2N/A
2N/A /* DAT_INVALID_EP_STATE subtypes */
2N/A DAT_INVALID_STATE_EP_UNCONNECTED,
2N/A DAT_INVALID_STATE_EP_ACTCONNPENDING,
2N/A DAT_INVALID_STATE_EP_PASSCONNPENDING,
2N/A DAT_INVALID_STATE_EP_TENTCONNPENDING,
2N/A DAT_INVALID_STATE_EP_CONNECTED,
2N/A DAT_INVALID_STATE_EP_DISCONNECTED,
2N/A DAT_INVALID_STATE_EP_RESERVED,
2N/A DAT_INVALID_STATE_EP_COMPLPENDING,
2N/A DAT_INVALID_STATE_EP_DISCPENDING,
2N/A DAT_INVALID_STATE_EP_PROVIDERCONTROL,
2N/A DAT_INVALID_STATE_EP_NOTREADY,
2N/A DAT_INVALID_STATE_EP_RECV_WATERMARK,
2N/A DAT_INVALID_STATE_EP_PZ,
2N/A DAT_INVALID_STATE_EP_EVD_REQUEST,
2N/A DAT_INVALID_STATE_EP_EVD_RECV,
2N/A DAT_INVALID_STATE_EP_EVD_CONNECT,
2N/A DAT_INVALID_STATE_EP_UNCONFIGURED,
2N/A DAT_INVALID_STATE_EP_UNCONFRESERVED,
2N/A DAT_INVALID_STATE_EP_UNCONFPASSIVE,
2N/A DAT_INVALID_STATE_EP_UNCONFTENTATIVE,
2N/A
2N/A DAT_INVALID_STATE_CNO_IN_USE,
2N/A DAT_INVALID_STATE_CNO_DEAD,
2N/A
2N/A /*
2N/A * EVD states. Enabled/Disabled, Waitable/Unwaitable,
2N/A * and Notify/Solicited/Threshold are 3 orthogonal
2N/A * bands of EVD state.The Threshold one is uDAPL specific.
2N/A */
2N/A DAT_INVALID_STATE_EVD_OPEN,
2N/A /*
2N/A * EVD can be either in enabled or disabled but not both
2N/A * or neither at the same time
2N/A */
2N/A DAT_INVALID_STATE_EVD_ENABLED,
2N/A DAT_INVALID_STATE_EVD_DISABLED,
2N/A /*
2N/A * EVD can be either in waitable or unwaitable but not
2N/A * both or neither at the same time
2N/A */
2N/A DAT_INVALID_STATE_EVD_WAITABLE,
2N/A DAT_INVALID_STATE_EVD_UNWAITABLE,
2N/A /* Do not release an EVD if it is in use */
2N/A DAT_INVALID_STATE_EVD_IN_USE,
2N/A
2N/A /*
2N/A * EVD can be either in notify or solicited or threshold
2N/A * but not any pair, or all, or none at the same time.
2N/A * The threshold one is for uDAPL only
2N/A */
2N/A DAT_INVALID_STATE_EVD_CONFIG_NOTIFY,
2N/A DAT_INVALID_STATE_EVD_CONFIG_SOLICITED,
2N/A DAT_INVALID_STATE_EVD_CONFIG_THRESHOLD,
2N/A DAT_INVALID_STATE_EVD_WAITER,
2N/A DAT_INVALID_STATE_EVD_ASYNC, /* Async EVD required */
2N/A DAT_INVALID_STATE_IA_IN_USE,
2N/A DAT_INVALID_STATE_LMR_IN_USE,
2N/A DAT_INVALID_STATE_LMR_FREE,
2N/A DAT_INVALID_STATE_PZ_IN_USE,
2N/A DAT_INVALID_STATE_PZ_FREE,
2N/A
2N/A /* DAT_INVALID_STATE_SRQ subtypes */
2N/A DAT_INVALID_STATE_SRQ_OPERATIONAL,
2N/A DAT_INVALID_STATE_SRQ_ERROR,
2N/A DAT_INVALID_STATE_SRQ_IN_USE,
2N/A
2N/A /* DAT_LENGTH_ERROR has no subtypes */
2N/A /* DAT_MODEL_NOT_SUPPORTED has no subtypes */
2N/A
2N/A /* DAT_PRIVILEGES_VIOLATION subtypes */
2N/A DAT_PRIVILEGES_READ,
2N/A DAT_PRIVILEGES_WRITE,
2N/A DAT_PRIVILEGES_RDMA_READ,
2N/A DAT_PRIVILEGES_RDMA_WRITE,
2N/A
2N/A /* DAT_PROTECTION_VIOLATION subtypes */
2N/A DAT_PROTECTION_READ,
2N/A DAT_PROTECTION_WRITE,
2N/A DAT_PROTECTION_RDMA_READ,
2N/A DAT_PROTECTION_RDMA_WRITE,
2N/A
2N/A /* DAT_QUEUE_EMPTY has no subtypes */
2N/A /* DAT_QUEUE_FULL has no subtypes */
2N/A /* DAT_TIMEOUT_EXPIRED has no subtypes */
2N/A /* DAT_PROVIDER_ALREADY_REGISTERED has no subtypes */
2N/A /* DAT_PROVIDER_IN_USE has no subtypes */
2N/A
2N/A /* DAT_INVALID_ADDRESS subtypes */
2N/A /*
2N/A * Unsupported addresses - those that are not Malformed,
2N/A * but are incorrect for use in DAT (regardless of local
2N/A * routing capabilities): IPv6 Multicast Addresses (ff/8)
2N/A * IPv4 Broadcast/Multicast Addresses
2N/A */
2N/A DAT_INVALID_ADDRESS_UNSUPPORTED,
2N/A /*
2N/A * Unreachable addresses - A Provider may know that certain
2N/A * addresses are unreachable immediately. One examples would
2N/A * be an IPv6 addresses on an IPv4-only system. This may also
2N/A * be returned if it is known that there is no route to the
2N/A * host. A Provider is not obligated to check for this
2N/A * condition.
2N/A */
2N/A DAT_INVALID_ADDRESS_UNREACHABLE,
2N/A /*
2N/A * Malformed addresses -- these cannot be valid in any context.
2N/A * Those listed in RFC1884 section 2.3 as "Reserved" or
2N/A * "Unassigned".
2N/A */
2N/A DAT_INVALID_ADDRESS_MALFORMED,
2N/A
2N/A /* DAT_INTERRUPTED_CALL has no subtypes */
2N/A /* DAT_CONN_QUAL_UNAVAILABLE has no subtypes */
2N/A
2N/A /* DAT_PROVIDER_NOT_FOUND subtypes. Erratta to the 1.1 spec */
2N/A DAT_NAME_NOT_REGISTERED,
2N/A DAT_MAJOR_NOT_FOUND,
2N/A DAT_MINOR_NOT_FOUND,
2N/A DAT_THREAD_SAFETY_NOT_FOUND,
2N/A
2N/A /* DAT_INVALID_PARAMETER Sun specific */
2N/A DAT_INVALID_RO_COOKIE
2N/A
2N/A} DAT_RETURN_SUBTYPE;
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _DAT_ERROR_H_ */