17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5015f8fffShiremath  * Common Development and Distribution License (the "License").
6015f8fffShiremath  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
221cfa752fSRamaswamy Tummala  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
237c478bd9Sstevel@tonic-gate  */
247c478bd9Sstevel@tonic-gate 
257c478bd9Sstevel@tonic-gate #ifndef	_SYS_IB_IBTL_IBTL_STATUS_H
267c478bd9Sstevel@tonic-gate #define	_SYS_IB_IBTL_IBTL_STATUS_H
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate /*
297c478bd9Sstevel@tonic-gate  * ibtl_status.h
307c478bd9Sstevel@tonic-gate  *
317c478bd9Sstevel@tonic-gate  * Define global IBTL return codes.
327c478bd9Sstevel@tonic-gate  */
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
357c478bd9Sstevel@tonic-gate extern "C" {
367c478bd9Sstevel@tonic-gate #endif
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate /*
397c478bd9Sstevel@tonic-gate  * Mnemonics
407c478bd9Sstevel@tonic-gate  *   APM   - Automatic Path Migration
417c478bd9Sstevel@tonic-gate  *   APR   - Alternate Path Response
427c478bd9Sstevel@tonic-gate  *   AH    - Address Handle
437c478bd9Sstevel@tonic-gate  *   CI    - Channel Interface (HCA)
447c478bd9Sstevel@tonic-gate  *   CQ    - Completion Queue
457c478bd9Sstevel@tonic-gate  *   DLID  - Destination Local Id
467c478bd9Sstevel@tonic-gate  *   DS    - Data Segment.
477c478bd9Sstevel@tonic-gate  *   GSI   - General Service Interface
487c478bd9Sstevel@tonic-gate  *   GUID  - Globally Unique Identifier
497c478bd9Sstevel@tonic-gate  *   HCA   - Host Channel Adapter.
507c478bd9Sstevel@tonic-gate  *   L_KEY - Local Key
517c478bd9Sstevel@tonic-gate  *   LAP   - Load Alternative Path
527c478bd9Sstevel@tonic-gate  *   MC    - Multicast
537c478bd9Sstevel@tonic-gate  *   MCG   - Multicast Group
547c478bd9Sstevel@tonic-gate  *   MR    - Memory Region
557c478bd9Sstevel@tonic-gate  *   MW    - Memory Window
567c478bd9Sstevel@tonic-gate  *   MTU   - Maximum Transfer Unit
577c478bd9Sstevel@tonic-gate  *   NAK   - Negative Acknowledge
587c478bd9Sstevel@tonic-gate  *   P_KEY - Partition Key
597c478bd9Sstevel@tonic-gate  *   PD    - Protection Domain
607c478bd9Sstevel@tonic-gate  *   PSN   - Packet Serial Number
617c478bd9Sstevel@tonic-gate  *   QP    - Queue Pair
627c478bd9Sstevel@tonic-gate  *   QPN   - Queue Pair Number
637c478bd9Sstevel@tonic-gate  *   R_KEY - Remote Key
647c478bd9Sstevel@tonic-gate  *   RC    - Reliable Connected
657c478bd9Sstevel@tonic-gate  *   RDMA  - Remote DMA
667c478bd9Sstevel@tonic-gate  *   RNR   - Receiver Not Ready
677c478bd9Sstevel@tonic-gate  *   RQ    - Receive Work Queue
687c478bd9Sstevel@tonic-gate  *   SGL   - Scatter/Gather List
697c478bd9Sstevel@tonic-gate  *   SL    - Service Level
707c478bd9Sstevel@tonic-gate  *   SMI   - Subnet Management Interface
717c478bd9Sstevel@tonic-gate  *   SQ    - Send Work Queue
727c478bd9Sstevel@tonic-gate  *   UC    - Unreliable Connected
737c478bd9Sstevel@tonic-gate  *   UD    - Unreliable Datagram
747c478bd9Sstevel@tonic-gate  *   VA    - Virtual Address
757c478bd9Sstevel@tonic-gate  *   WR    - Work Request
767c478bd9Sstevel@tonic-gate  *   WC    - Work Completion
777c478bd9Sstevel@tonic-gate  *   WRC   - Work Request Completion
787c478bd9Sstevel@tonic-gate  */
797c478bd9Sstevel@tonic-gate 
807c478bd9Sstevel@tonic-gate /*
817c478bd9Sstevel@tonic-gate  * IBTF Immediate status codes.
827c478bd9Sstevel@tonic-gate  */
837c478bd9Sstevel@tonic-gate typedef enum ibt_status_e {
847c478bd9Sstevel@tonic-gate 	/*
857c478bd9Sstevel@tonic-gate 	 * Generic Status codes.
867c478bd9Sstevel@tonic-gate 	 */
877c478bd9Sstevel@tonic-gate 	IBT_SUCCESS			= 0,	/* Operation Successful */
887c478bd9Sstevel@tonic-gate 	IBT_FAILURE			= 1,	/* Undefined IBTF Failure */
897c478bd9Sstevel@tonic-gate 	IBT_NOT_SUPPORTED		= 2,	/* Feature not supported */
907c478bd9Sstevel@tonic-gate 	IBT_ILLEGAL_OP			= 3,	/* Operation not supported */
917c478bd9Sstevel@tonic-gate 	IBT_INVALID_PARAM		= 4,	/* Invalid argument specified */
927c478bd9Sstevel@tonic-gate 	IBT_INSUFF_KERNEL_RESOURCE	= 5,	/* Not enough Kernel Resource */
937c478bd9Sstevel@tonic-gate 	IBT_CM_FAILURE			= 6,	/* A call to CM returned */
947c478bd9Sstevel@tonic-gate 						/* look into detailed error */
957c478bd9Sstevel@tonic-gate 						/* code for actual failure */
967c478bd9Sstevel@tonic-gate 	IBT_CM_SERVICE_EXISTS		= 7,	/* For the given parameters */
977c478bd9Sstevel@tonic-gate 						/* serviceId already exists */
987c478bd9Sstevel@tonic-gate 	IBT_APM_NOT_SUPPORTED		= 8,	/* Can not satisfy a request */
997c478bd9Sstevel@tonic-gate 						/* for APM */
100ae0581d1SShantkumar Hiremath 	IBT_IBMF_TIMEOUT		= 10,	/* IBMF call returned with */
101ae0581d1SShantkumar Hiremath 						/* TIMEOUT error code. */
1027c478bd9Sstevel@tonic-gate 	IBT_INSUFF_DATA			= 11,	/* Requested number of */
1037c478bd9Sstevel@tonic-gate 						/* paths/records are not */
1047c478bd9Sstevel@tonic-gate 						/* available. */
1057c478bd9Sstevel@tonic-gate 	IBT_NO_HCAS_AVAILABLE		= 12,	/* No HCAs have attached. */
1067c478bd9Sstevel@tonic-gate 	IBT_PATH_RECORDS_NOT_FOUND	= 13,	/* Path records not found. */
1077c478bd9Sstevel@tonic-gate 	IBT_SERVICE_RECORDS_NOT_FOUND	= 14,	/* Service records not found. */
1087c478bd9Sstevel@tonic-gate 	IBT_MCG_RECORDS_NOT_FOUND	= 15,	/* MCG records not found. */
1097c478bd9Sstevel@tonic-gate 	IBT_PATH_PKT_LT_TOO_HIGH	= 16,	/* Path's packet life time */
1107c478bd9Sstevel@tonic-gate 						/* is too high. */
1117c478bd9Sstevel@tonic-gate 	IBT_CM_SERVICE_BUSY		= 17,	/* Service still has bindings */
1127c478bd9Sstevel@tonic-gate 	IBT_STATIC_RATE_INVALID		= 18,	/* Invalid Static Rate */
1137c478bd9Sstevel@tonic-gate 	IBT_SGID_INVALID		= 19,	/* Invalid SGID or SGID index */
1147c478bd9Sstevel@tonic-gate 	IBT_NODE_RECORDS_NOT_FOUND	= 20,	/* NODEInfo records not found */
1157c478bd9Sstevel@tonic-gate 	IBT_GIDS_NOT_FOUND		= 21,	/* Companion GIDs not found */
1167c478bd9Sstevel@tonic-gate 	IBT_INCONSISTENT_AR		= 22,	/* Address Record contradicts */
1177c478bd9Sstevel@tonic-gate 						/* an existing Address Record */
1187c478bd9Sstevel@tonic-gate 	IBT_AR_NOT_REGISTERED		= 23,	/* Address Record is not */
1197c478bd9Sstevel@tonic-gate 						/* currently registered */
1207c478bd9Sstevel@tonic-gate 	IBT_MULTIPLE_AR			= 24,	/* Multiple records exist for */
1217c478bd9Sstevel@tonic-gate 						/* what should be a unique */
1227c478bd9Sstevel@tonic-gate 						/* query result. One of the */
1237c478bd9Sstevel@tonic-gate 						/* records was returned. */
124015f8fffShiremath 	IBT_DEST_IP_GID_NOT_FOUND	= 25,	/* No IP to GID Mapping */
125015f8fffShiremath 	IBT_SRC_IP_NOT_FOUND		= 26,	/* SRC IP Endpoint not found */
1261cfa752fSRamaswamy Tummala 	IBT_NO_SUCH_OBJECT		= 27,	/* No such object */
1277c478bd9Sstevel@tonic-gate 
1287c478bd9Sstevel@tonic-gate 	/*
1297c478bd9Sstevel@tonic-gate 	 * Resource Errors
1307c478bd9Sstevel@tonic-gate 	 */
1317c478bd9Sstevel@tonic-gate 	IBT_INSUFF_RESOURCE		= 100,	/* Not enough resources */
1327c478bd9Sstevel@tonic-gate 	IBT_HCA_CQ_EXCEEDED		= 101,	/* CQ capacity requested */
1337c478bd9Sstevel@tonic-gate 						/* exceeds HCA capability */
1347c478bd9Sstevel@tonic-gate 	IBT_HCA_WR_EXCEEDED		= 102,	/* Requested WRs exceed limit */
1357c478bd9Sstevel@tonic-gate 	IBT_HCA_SGL_EXCEEDED		= 103,	/* Requested SGL entries */
1367c478bd9Sstevel@tonic-gate 						/* exceed HCA max limit */
1377c478bd9Sstevel@tonic-gate 	IBT_ERR_OPAQUE1			= 104,
1387c478bd9Sstevel@tonic-gate 	IBT_HCA_MCG_CHAN_EXCEEDED	= 105,	/* Requested Channel exceeds */
1397c478bd9Sstevel@tonic-gate 						/* HCA multicast groups */
1407c478bd9Sstevel@tonic-gate 						/* channel limit */
1417c478bd9Sstevel@tonic-gate 	IBT_HCA_IN_USE			= 106,	/* HCA already open (in use) */
1427c478bd9Sstevel@tonic-gate 	IBT_HCA_RESOURCES_NOT_FREED	= 107,	/* HCA resources still in use */
1437c478bd9Sstevel@tonic-gate 	IBT_HCA_BUSY_DETACHING		= 108,	/* HCA detach in progress */
1447c478bd9Sstevel@tonic-gate 	IBT_HCA_BUSY_CLOSING		= 109,	/* This client is in the */
1457c478bd9Sstevel@tonic-gate 						/* process of closing this */
1467c478bd9Sstevel@tonic-gate 						/* HCA */
1477c478bd9Sstevel@tonic-gate 
1487c478bd9Sstevel@tonic-gate 	/*
1497c478bd9Sstevel@tonic-gate 	 * Host Channel Adapter (HCA) Attribute Errors.
1507c478bd9Sstevel@tonic-gate 	 */
1517c478bd9Sstevel@tonic-gate 	IBT_HCA_INVALID			= 200,	/* Invalid HCA GUID */
1527c478bd9Sstevel@tonic-gate 	IBT_HCA_HDL_INVALID		= 201,	/* Invalid HCA Handle */
1537c478bd9Sstevel@tonic-gate 	IBT_HCA_PORT_MTU_EXCEEDED	= 202,	/* MTU of HCA port exceeded */
1547c478bd9Sstevel@tonic-gate 	IBT_HCA_PORT_INVALID		= 203,	/* Invalid HCA physical port */
1557c478bd9Sstevel@tonic-gate 	IBT_HCA_CNTR_INVALID		= 204,	/* Invalid Counter Specified */
1567c478bd9Sstevel@tonic-gate 	IBT_HCA_CNTR_VAL_INVALID	= 205,	/* Invalid Counter value */
1577c478bd9Sstevel@tonic-gate 	IBT_HCA_PORT_NOT_ACTIVE		= 206,	/* Port is down */
1587c478bd9Sstevel@tonic-gate 	IBT_HCA_SRQ_NOT_SUPPORTED	= 207,	/* Shared Receive Queue */
15943ed929aSsrust 						/* not supported */
16043ed929aSsrust 	IBT_HCA_RESIZE_SRQ_NOT_SUPPORTED = 208,	/* SRQ Resize not supported */
16143ed929aSsrust 	IBT_HCA_PAGE_MODE		= 209,	/* Not opened in page mode */
16243ed929aSsrust 	IBT_HCA_BLOCK_MODE		= 210,	/* HCA does not support Block */
16343ed929aSsrust 						/* mode or Not opened in */
16443ed929aSsrust 						/* Block mode */
1657c478bd9Sstevel@tonic-gate 	IBT_HCA_BMM_NOT_SUPPORTED	= 211,	/* Base Memory Management */
1667c478bd9Sstevel@tonic-gate 						/* Extensions not supported */
1677c478bd9Sstevel@tonic-gate 	IBT_HCA_BQM_NOT_SUPPORTED	= 212,	/* Base Queue Management */
1687c478bd9Sstevel@tonic-gate 						/* Extensions not supported */
1697c478bd9Sstevel@tonic-gate 	IBT_HCA_ZBVA_NOT_SUPPORTED	= 213,	/* Zero Based Virtual */
1707c478bd9Sstevel@tonic-gate 						/* Addresses not supported */
1717c478bd9Sstevel@tonic-gate 	IBT_HCA_MR_MPB_SZ_NOT_SUPPORTED	= 214,	/* Multiple physical buffer */
1727c478bd9Sstevel@tonic-gate 						/* sizes per MR not supported */
1737c478bd9Sstevel@tonic-gate 	IBT_HCA_TYPE_2_MW_NOT_SUPPORTED	= 215,
1747c478bd9Sstevel@tonic-gate 
1757c478bd9Sstevel@tonic-gate 	IBT_HCA_LIF_NOT_SUPPORTED	= 216,	/* Local Invalidate Fencing */
1767c478bd9Sstevel@tonic-gate 						/* not supported */
17743ed929aSsrust 	IBT_HCA_FMR_NOT_SUPPORTED	= 217,	/* Fast Memory Registration */
17843ed929aSsrust 						/* not supported */
1797c478bd9Sstevel@tonic-gate 	/*
1807c478bd9Sstevel@tonic-gate 	 * Address errors
1817c478bd9Sstevel@tonic-gate 	 */
1827c478bd9Sstevel@tonic-gate 	IBT_UD_DEST_HDL_INVALID		= 300,	/* Invalid Address Handle */
1837c478bd9Sstevel@tonic-gate 
1847c478bd9Sstevel@tonic-gate 	/*
1857c478bd9Sstevel@tonic-gate 	 * Channel Errors
1867c478bd9Sstevel@tonic-gate 	 */
1877c478bd9Sstevel@tonic-gate 	IBT_CHAN_HDL_INVALID		= 400,	/* Invalid channel Handle */
1887c478bd9Sstevel@tonic-gate 	IBT_CHAN_ATTR_RO		= 401,	/* Cannot Change channel */
1897c478bd9Sstevel@tonic-gate 						/* Attribute */
1907c478bd9Sstevel@tonic-gate 	IBT_CHAN_STATE_INVALID		= 402,	/* Invalid channel State */
1917c478bd9Sstevel@tonic-gate 	IBT_CHAN_SRV_TYPE_INVALID	= 403,	/* Invalid channel Service */
1927c478bd9Sstevel@tonic-gate 						/* Type */
1937c478bd9Sstevel@tonic-gate 	IBT_CHAN_IN_USE			= 404,	/* SMI/GSI channel in use */
1947c478bd9Sstevel@tonic-gate 	IBT_CHAN_ATOMICS_NOT_SUPPORTED	= 405,	/* Atomics not supported */
1957c478bd9Sstevel@tonic-gate 	IBT_ERR_OPAQUE2			= 406,
1967c478bd9Sstevel@tonic-gate 	IBT_ERR_OPAQUE3			= 407,
1977c478bd9Sstevel@tonic-gate 	IBT_CHAN_OP_TYPE_INVALID 	= 408,	/* Invalid Operation Type */
1987c478bd9Sstevel@tonic-gate 	IBT_CHAN_SGL_FORMAT_INVALID	= 409,	/* Invalid SG List format */
1997c478bd9Sstevel@tonic-gate 	IBT_CHAN_SGL_LEN_INVALID 	= 410,	/* Invalid SG List length */
2007c478bd9Sstevel@tonic-gate 	IBT_CHAN_APM_STATE_INVALID	= 411,	/* Invalid Path Migration */
2017c478bd9Sstevel@tonic-gate 						/* State */
2027c478bd9Sstevel@tonic-gate 	IBT_CHAN_SPECIAL_TYPE_INVALID	= 412,	/* Invalid Special channel */
2037c478bd9Sstevel@tonic-gate 	IBT_CHAN_SZ_INSUFFICIENT	= 413,	/* The Size of the WQ is too */
2047c478bd9Sstevel@tonic-gate 						/* small, there are more */
2057c478bd9Sstevel@tonic-gate 						/* outstanding entries than */
2067c478bd9Sstevel@tonic-gate 						/* than the requested size. */
2077c478bd9Sstevel@tonic-gate 	IBT_CHAN_FULL			= 414,	/* Too many WRs posted */
2087c478bd9Sstevel@tonic-gate 	IBT_CHAN_SRQ			= 415,	/* Handle used on a channel */
2097c478bd9Sstevel@tonic-gate 						/* that is associated with an */
2107c478bd9Sstevel@tonic-gate 						/* SRQ */
2117c478bd9Sstevel@tonic-gate 	IBT_CHAN_TYPE_2A_MW_BOUND	= 416,	/* Channel still has a type */
2127c478bd9Sstevel@tonic-gate 						/* 2A memory window bound */
21303494a98SBill Taylor 	IBT_CHAN_WQE_SZ_INSUFF		= 417,	/* inline-data/LSO too large */
2147c478bd9Sstevel@tonic-gate 
2157c478bd9Sstevel@tonic-gate 	/*
2167c478bd9Sstevel@tonic-gate 	 * Completion Queue (CQ) errors
2177c478bd9Sstevel@tonic-gate 	 */
2187c478bd9Sstevel@tonic-gate 	IBT_CQ_HDL_INVALID		= 500,	/* Invalid CQ Handle */
2197c478bd9Sstevel@tonic-gate 	IBT_CQ_SZ_INSUFFICIENT		= 501,  /* The Size of the CQ is too */
2207c478bd9Sstevel@tonic-gate 						/* small, there are more */
2217c478bd9Sstevel@tonic-gate 						/* outstanding completions */
2227c478bd9Sstevel@tonic-gate 						/* than the requested size. */
2237c478bd9Sstevel@tonic-gate 	IBT_CQ_BUSY			= 502,	/* WQ(s) Still Reference CQ */
2247c478bd9Sstevel@tonic-gate 	IBT_CQ_EMPTY			= 503,	/* Completion Queue Empty */
2257c478bd9Sstevel@tonic-gate 	IBT_CQ_NOTIFY_TYPE_INVALID	= 504,	/* Invalid notification type */
2267c478bd9Sstevel@tonic-gate 	IBT_CQ_INVALID_PRIORITY		= 505,	/* Invalid CQ Priority */
227*17a2b317SBill Taylor 	IBT_CQ_SCHED_INVALID		= 550,	/* Invalid CQ Sched Handle */
228*17a2b317SBill Taylor 	IBT_CQ_NO_SCHED_GROUP		= 551,	/* Schedule group not found */
229*17a2b317SBill Taylor 	IBT_CQ_HID_INVALID		= 552,	/* CQ Handler ID invalid */
2307c478bd9Sstevel@tonic-gate 
2317c478bd9Sstevel@tonic-gate 	/*
2327c478bd9Sstevel@tonic-gate 	 * Reserved for future use.
2337c478bd9Sstevel@tonic-gate 	 */
2347c478bd9Sstevel@tonic-gate 	IBT_ERR_OPAQUE4			= 600,
2357c478bd9Sstevel@tonic-gate 	IBT_ERR_OPAQUE5			= 601,
2367c478bd9Sstevel@tonic-gate 	IBT_ERR_OPAQUE6			= 602,
2377c478bd9Sstevel@tonic-gate 	IBT_ERR_OPAQUE7			= 700,
2387c478bd9Sstevel@tonic-gate 	IBT_ERR_OPAQUE8			= 701,
2397c478bd9Sstevel@tonic-gate 	IBT_ERR_OPAQUE9 		= 702,
2407c478bd9Sstevel@tonic-gate 	IBT_ERR_OPAQUE10		= 703,
2417c478bd9Sstevel@tonic-gate 
2427c478bd9Sstevel@tonic-gate 	/*
2437c478bd9Sstevel@tonic-gate 	 * Memory operation errors
2447c478bd9Sstevel@tonic-gate 	 */
2457c478bd9Sstevel@tonic-gate 	IBT_MR_VA_INVALID		= 800,	/* Invalid Virtual Address */
2467c478bd9Sstevel@tonic-gate 	IBT_MR_LEN_INVALID		= 801,	/* Invalid Memory Length */
2477c478bd9Sstevel@tonic-gate 	IBT_MR_PHYSBUF_INVALID 		= 802,	/* Invalid Physical Buffer */
2487c478bd9Sstevel@tonic-gate 						/* List */
2497c478bd9Sstevel@tonic-gate 	IBT_MR_OFFSET_INVALID		= 803,	/* Invalid Memory Offset */
2507c478bd9Sstevel@tonic-gate 	IBT_MR_LKEY_INVALID		= 804,	/* Invalid Memory L_KEY */
2517c478bd9Sstevel@tonic-gate 	IBT_MR_RKEY_INVALID		= 805,	/* Invalid Memory R_KEY */
2527c478bd9Sstevel@tonic-gate 	IBT_MR_HDL_INVALID 		= 806,	/* Invalid Memory Region */
2537c478bd9Sstevel@tonic-gate 						/* Handle */
2547c478bd9Sstevel@tonic-gate 	IBT_MR_ACCESS_REQ_INVALID 	= 807,	/* Invalid Access Control */
2557c478bd9Sstevel@tonic-gate 						/* Specifier */
2567c478bd9Sstevel@tonic-gate 	IBT_MR_IN_USE			= 808,	/* Mem region in Use */
2577c478bd9Sstevel@tonic-gate 	IBT_MW_HDL_INVALID 		= 809,	/* Invalid Memory Window */
2587c478bd9Sstevel@tonic-gate 						/* Handle */
2597c478bd9Sstevel@tonic-gate 	IBT_MW_TYPE_INVALID		= 810,
26043ed929aSsrust 	IBT_MA_HDL_INVALID		= 811,  /* Invalid Memory Area Hdl */
26103494a98SBill Taylor 	IBT_SGL_TOO_SMALL		= 812,
26203494a98SBill Taylor 	IBT_MI_HDL_INVALID		= 813,
2637c478bd9Sstevel@tonic-gate 
2647c478bd9Sstevel@tonic-gate 	/*
2657c478bd9Sstevel@tonic-gate 	 * Multicast errors
2667c478bd9Sstevel@tonic-gate 	 */
2677c478bd9Sstevel@tonic-gate 	IBT_MC_OPAQUE			= 900,	/* Invalid MLID */
2687c478bd9Sstevel@tonic-gate 	IBT_MC_MGID_INVALID		= 901,	/* Invalid MGID */
2697c478bd9Sstevel@tonic-gate 	IBT_MC_GROUP_INVALID		= 902,	/* Invalid MC Group */
2707c478bd9Sstevel@tonic-gate 
2717c478bd9Sstevel@tonic-gate 	/*
2727c478bd9Sstevel@tonic-gate 	 * Partition table errors.
2737c478bd9Sstevel@tonic-gate 	 */
2747c478bd9Sstevel@tonic-gate 	IBT_PKEY_IX_ILLEGAL		= 1000,	/* P_Key index Out of range */
2757c478bd9Sstevel@tonic-gate 	IBT_PKEY_IX_INVALID		= 1001,	/* P_Key index specifies */
2767c478bd9Sstevel@tonic-gate 						/* invalid entry in table */
2777c478bd9Sstevel@tonic-gate 	/*
2787c478bd9Sstevel@tonic-gate 	 * Protection Domain errors
2797c478bd9Sstevel@tonic-gate 	 */
2807c478bd9Sstevel@tonic-gate 	IBT_PD_HDL_INVALID		= 1100,	/* Invalid protection domain */
2817c478bd9Sstevel@tonic-gate 	IBT_PD_IN_USE			= 1101,	/* Protection Domain in Use */
28203494a98SBill Taylor 	IBT_MEM_ALLOC_HDL_INVALID	= 1102,	/* Invalid MEM handle */
2837c478bd9Sstevel@tonic-gate 
2847c478bd9Sstevel@tonic-gate 	/*
2857c478bd9Sstevel@tonic-gate 	 * Shared Receive Queue errors
2867c478bd9Sstevel@tonic-gate 	 */
2877c478bd9Sstevel@tonic-gate 	IBT_SRQ_HDL_INVALID		= 1200,	/* Invalid SRQ Handle */
2887c478bd9Sstevel@tonic-gate 	IBT_SRQ_ERROR_STATE		= 1201, /* SRQ in Error State */
2897c478bd9Sstevel@tonic-gate 	IBT_SRQ_LIMIT_EXCEEDED		= 1202, /* SRQ Limit exceeds max SRQ */
2907c478bd9Sstevel@tonic-gate 						/* size */
2917c478bd9Sstevel@tonic-gate 	IBT_SRQ_SZ_INSUFFICIENT		= 1203,	/* The Size of the WQ is too */
2927c478bd9Sstevel@tonic-gate 						/* small, there are more */
2937c478bd9Sstevel@tonic-gate 						/* outstanding entries than */
29443ed929aSsrust 	IBT_SRQ_IN_USE			= 1204,	/* SRQ Still has QPs */
2957c478bd9Sstevel@tonic-gate 						/* associated with it */
29643ed929aSsrust 	/*
29743ed929aSsrust 	 * FMR Errors
29843ed929aSsrust 	 */
29943ed929aSsrust 	IBT_FMR_POOL_HDL_INVALID	= 1300,	/* Invalid FMR Pool handle */
30043ed929aSsrust 	IBT_FMR_POOL_IN_USE		= 1301,	/* FMR Pool in use. */
30143ed929aSsrust 	IBT_PBL_TOO_SMALL		= 1302
3027c478bd9Sstevel@tonic-gate } ibt_status_t;
3037c478bd9Sstevel@tonic-gate 
3047c478bd9Sstevel@tonic-gate /*
3057c478bd9Sstevel@tonic-gate  * Work Request Completion Return Status.
3067c478bd9Sstevel@tonic-gate  *
3077c478bd9Sstevel@tonic-gate  * Refer InfiniBand Architecture Release Volume 1:
3087c478bd9Sstevel@tonic-gate  * Section 11.6.2 Completion Return Status.
3097c478bd9Sstevel@tonic-gate  *
3107c478bd9Sstevel@tonic-gate  * NOTE: this was converted from an enum to a uint8_t to save space.
3117c478bd9Sstevel@tonic-gate  */
3127c478bd9Sstevel@tonic-gate typedef uint8_t ibt_wc_status_t;
3137c478bd9Sstevel@tonic-gate #define	IBT_WC_SUCCESS			0	/* WR Completed Successfully */
3147c478bd9Sstevel@tonic-gate #define	IBT_WC_LOCAL_LEN_ERR		10	/* Data in WR posted to local */
3157c478bd9Sstevel@tonic-gate 						/* queue too big */
3167c478bd9Sstevel@tonic-gate #define	IBT_WC_LOCAL_CHAN_OP_ERR	11	/* Internal consistency error */
3177c478bd9Sstevel@tonic-gate #define	IBT_WC_LOCAL_PROTECT_ERR	13	/* Memory Region violation */
3187c478bd9Sstevel@tonic-gate 						/* for posted WR */
3197c478bd9Sstevel@tonic-gate #define	IBT_WC_WR_FLUSHED_ERR		14	/* WR was in process when the */
3207c478bd9Sstevel@tonic-gate 						/* chan went to error state */
321*17a2b317SBill Taylor #define	IBT_WC_MEM_MGT_OP_ERR		15	/* bind plus 1.2 mem ext */
322*17a2b317SBill Taylor #define	IBT_WC_MEM_WIN_BIND_ERR		IBT_WC_MEM_MGT_OP_ERR
3237c478bd9Sstevel@tonic-gate 
3247c478bd9Sstevel@tonic-gate 	/*
3257c478bd9Sstevel@tonic-gate 	 * Errors that are only reported for Reliable Queue Pairs.
3267c478bd9Sstevel@tonic-gate 	 */
3277c478bd9Sstevel@tonic-gate #define	IBT_WC_BAD_RESPONSE_ERR		20	/* An unexpected transport */
3287c478bd9Sstevel@tonic-gate 						/* layer opcode was returned */
3297c478bd9Sstevel@tonic-gate 						/* by the responder */
3307c478bd9Sstevel@tonic-gate #define	IBT_WC_LOCAL_ACCESS_ERR		21	/* A protection error */
3317c478bd9Sstevel@tonic-gate 						/* occurred on a local data */
3327c478bd9Sstevel@tonic-gate 						/* buffer during the */
3337c478bd9Sstevel@tonic-gate 						/* processing of a RDMA Write */
3347c478bd9Sstevel@tonic-gate 						/* with Immediate Data */
3357c478bd9Sstevel@tonic-gate 						/* operation sent from the */
3367c478bd9Sstevel@tonic-gate 						/* remote node */
3377c478bd9Sstevel@tonic-gate 						/* data buffer */
3387c478bd9Sstevel@tonic-gate #define	IBT_WC_REMOTE_INVALID_REQ_ERR	22	/* Responder detected invalid */
3397c478bd9Sstevel@tonic-gate 						/* message on the channel */
3407c478bd9Sstevel@tonic-gate #define	IBT_WC_REMOTE_ACCESS_ERR	23	/* Protection Error on remote */
3417c478bd9Sstevel@tonic-gate 						/* data buffer */
3427c478bd9Sstevel@tonic-gate #define	IBT_WC_REMOTE_OP_ERR		24	/* Operation could not be */
3437c478bd9Sstevel@tonic-gate 						/* completed by the responder */
3447c478bd9Sstevel@tonic-gate #define	IBT_WC_TRANS_TIMEOUT_ERR	25	/* Local transport retry */
3457c478bd9Sstevel@tonic-gate 						/* counter exceeded */
3467c478bd9Sstevel@tonic-gate #define	IBT_WC_RNR_NAK_TIMEOUT_ERR	26	/* RNR NAK retry counter */
3477c478bd9Sstevel@tonic-gate 						/* exceeded */
3487c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3497c478bd9Sstevel@tonic-gate }
3507c478bd9Sstevel@tonic-gate #endif
3517c478bd9Sstevel@tonic-gate 
3527c478bd9Sstevel@tonic-gate #endif /* _SYS_IB_IBTL_IBTL_STATUS_H */
353