10Sstevel@tonic-gate /*
20Sstevel@tonic-gate * CDDL HEADER START
30Sstevel@tonic-gate *
40Sstevel@tonic-gate * The contents of this file are subject to the terms of the
5*8580SBill.Taylor@Sun.COM * Common Development and Distribution License (the "License").
6*8580SBill.Taylor@Sun.COM * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate *
80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate * See the License for the specific language governing permissions
110Sstevel@tonic-gate * and limitations under the License.
120Sstevel@tonic-gate *
130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate *
190Sstevel@tonic-gate * CDDL HEADER END
200Sstevel@tonic-gate */
210Sstevel@tonic-gate /*
220Sstevel@tonic-gate * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved.
230Sstevel@tonic-gate */
240Sstevel@tonic-gate
250Sstevel@tonic-gate /*
26*8580SBill.Taylor@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
270Sstevel@tonic-gate * Use is subject to license terms.
280Sstevel@tonic-gate */
290Sstevel@tonic-gate
300Sstevel@tonic-gate /*
310Sstevel@tonic-gate *
320Sstevel@tonic-gate * MODULE: dat_strerror.c
330Sstevel@tonic-gate *
340Sstevel@tonic-gate * PURPOSE: Convert DAT_RETURN values to humman readable string
350Sstevel@tonic-gate *
360Sstevel@tonic-gate * $Id: dat_strerror.c,v 1.2 2003/08/06 14:40:29 jlentini Exp $
370Sstevel@tonic-gate */
380Sstevel@tonic-gate
390Sstevel@tonic-gate #include <dat/udat.h>
400Sstevel@tonic-gate
410Sstevel@tonic-gate
420Sstevel@tonic-gate /*
430Sstevel@tonic-gate *
440Sstevel@tonic-gate * Internal Function Declarations
450Sstevel@tonic-gate *
460Sstevel@tonic-gate */
470Sstevel@tonic-gate
480Sstevel@tonic-gate DAT_RETURN
490Sstevel@tonic-gate dat_strerror_major(
500Sstevel@tonic-gate IN DAT_RETURN value,
510Sstevel@tonic-gate OUT const char **message);
520Sstevel@tonic-gate
530Sstevel@tonic-gate DAT_RETURN
540Sstevel@tonic-gate dat_strerror_minor(
550Sstevel@tonic-gate IN DAT_RETURN value,
560Sstevel@tonic-gate OUT const char **message);
570Sstevel@tonic-gate
580Sstevel@tonic-gate
590Sstevel@tonic-gate /*
600Sstevel@tonic-gate *
610Sstevel@tonic-gate * Internal Function Definitions
620Sstevel@tonic-gate *
630Sstevel@tonic-gate */
640Sstevel@tonic-gate
650Sstevel@tonic-gate DAT_RETURN
dat_strerror_major(IN DAT_RETURN value,OUT const char ** message)660Sstevel@tonic-gate dat_strerror_major(
670Sstevel@tonic-gate IN DAT_RETURN value,
680Sstevel@tonic-gate OUT const char **message)
690Sstevel@tonic-gate {
700Sstevel@tonic-gate switch (DAT_GET_TYPE(value)) {
710Sstevel@tonic-gate case DAT_SUCCESS:
720Sstevel@tonic-gate {
730Sstevel@tonic-gate *message = "DAT_SUCCESS";
740Sstevel@tonic-gate return (DAT_SUCCESS);
750Sstevel@tonic-gate }
760Sstevel@tonic-gate case DAT_ABORT:
770Sstevel@tonic-gate {
780Sstevel@tonic-gate *message = "DAT_ABORT";
790Sstevel@tonic-gate return (DAT_SUCCESS);
800Sstevel@tonic-gate }
810Sstevel@tonic-gate case DAT_CONN_QUAL_IN_USE:
820Sstevel@tonic-gate {
830Sstevel@tonic-gate *message = "DAT_CONN_QUAL_IN_USE";
840Sstevel@tonic-gate return (DAT_SUCCESS);
850Sstevel@tonic-gate }
860Sstevel@tonic-gate case DAT_INSUFFICIENT_RESOURCES:
870Sstevel@tonic-gate {
880Sstevel@tonic-gate *message = "DAT_INSUFFICIENT_RESOURCES";
890Sstevel@tonic-gate return (DAT_SUCCESS);
900Sstevel@tonic-gate }
910Sstevel@tonic-gate case DAT_INTERNAL_ERROR:
920Sstevel@tonic-gate {
930Sstevel@tonic-gate *message = "DAT_INTERNAL_ERROR";
940Sstevel@tonic-gate return (DAT_SUCCESS);
950Sstevel@tonic-gate }
960Sstevel@tonic-gate case DAT_INVALID_HANDLE:
970Sstevel@tonic-gate {
980Sstevel@tonic-gate *message = "DAT_INVALID_HANDLE";
990Sstevel@tonic-gate return (DAT_SUCCESS);
1000Sstevel@tonic-gate }
1010Sstevel@tonic-gate case DAT_INVALID_PARAMETER:
1020Sstevel@tonic-gate {
1030Sstevel@tonic-gate *message = "DAT_INVALID_PARAMETER";
1040Sstevel@tonic-gate return (DAT_SUCCESS);
1050Sstevel@tonic-gate }
1060Sstevel@tonic-gate case DAT_INVALID_STATE:
1070Sstevel@tonic-gate {
1080Sstevel@tonic-gate *message = "DAT_INVALID_STATE";
1090Sstevel@tonic-gate return (DAT_SUCCESS);
1100Sstevel@tonic-gate }
1110Sstevel@tonic-gate case DAT_LENGTH_ERROR:
1120Sstevel@tonic-gate {
1130Sstevel@tonic-gate *message = "DAT_LENGTH_ERROR";
1140Sstevel@tonic-gate return (DAT_SUCCESS);
1150Sstevel@tonic-gate }
1160Sstevel@tonic-gate case DAT_MODEL_NOT_SUPPORTED:
1170Sstevel@tonic-gate {
1180Sstevel@tonic-gate *message = "DAT_MODEL_NOT_SUPPORTED";
1190Sstevel@tonic-gate return (DAT_SUCCESS);
1200Sstevel@tonic-gate }
1210Sstevel@tonic-gate case DAT_NAME_NOT_FOUND:
1220Sstevel@tonic-gate {
1230Sstevel@tonic-gate *message = "DAT_NAME_NOT_FOUND";
1240Sstevel@tonic-gate return (DAT_SUCCESS);
1250Sstevel@tonic-gate }
1260Sstevel@tonic-gate case DAT_PRIVILEGES_VIOLATION:
1270Sstevel@tonic-gate {
1280Sstevel@tonic-gate *message = "DAT_PRIVILEGES_VIOLATION";
1290Sstevel@tonic-gate return (DAT_SUCCESS);
1300Sstevel@tonic-gate }
1310Sstevel@tonic-gate case DAT_PROTECTION_VIOLATION:
1320Sstevel@tonic-gate {
1330Sstevel@tonic-gate *message = "DAT_PROTECTION_VIOLATION";
1340Sstevel@tonic-gate return (DAT_SUCCESS);
1350Sstevel@tonic-gate }
1360Sstevel@tonic-gate case DAT_QUEUE_EMPTY:
1370Sstevel@tonic-gate {
1380Sstevel@tonic-gate *message = "DAT_QUEUE_EMPTY";
1390Sstevel@tonic-gate return (DAT_SUCCESS);
1400Sstevel@tonic-gate }
1410Sstevel@tonic-gate case DAT_QUEUE_FULL:
1420Sstevel@tonic-gate {
1430Sstevel@tonic-gate *message = "DAT_QUEUE_FULL";
1440Sstevel@tonic-gate return (DAT_SUCCESS);
1450Sstevel@tonic-gate }
1460Sstevel@tonic-gate case DAT_TIMEOUT_EXPIRED:
1470Sstevel@tonic-gate {
1480Sstevel@tonic-gate *message = "DAT_TIMEOUT_EXPIRED";
1490Sstevel@tonic-gate return (DAT_SUCCESS);
1500Sstevel@tonic-gate }
1510Sstevel@tonic-gate case DAT_PROVIDER_ALREADY_REGISTERED:
1520Sstevel@tonic-gate {
1530Sstevel@tonic-gate *message = "DAT_PROVIDER_ALREADY_REGISTERED";
1540Sstevel@tonic-gate return (DAT_SUCCESS);
1550Sstevel@tonic-gate }
1560Sstevel@tonic-gate case DAT_PROVIDER_IN_USE:
1570Sstevel@tonic-gate {
1580Sstevel@tonic-gate *message = "DAT_PROVIDER_IN_USE";
1590Sstevel@tonic-gate return (DAT_SUCCESS);
1600Sstevel@tonic-gate }
1610Sstevel@tonic-gate case DAT_INVALID_ADDRESS:
1620Sstevel@tonic-gate {
1630Sstevel@tonic-gate *message = "DAT_INVALID_ADDRESS";
1640Sstevel@tonic-gate return (DAT_SUCCESS);
1650Sstevel@tonic-gate }
1660Sstevel@tonic-gate case DAT_INTERRUPTED_CALL:
1670Sstevel@tonic-gate {
1680Sstevel@tonic-gate *message = "DAT_INTERRUPTED_CALL";
1690Sstevel@tonic-gate return (DAT_SUCCESS);
1700Sstevel@tonic-gate }
1710Sstevel@tonic-gate case DAT_NOT_IMPLEMENTED:
1720Sstevel@tonic-gate {
1730Sstevel@tonic-gate *message = "DAT_NOT_IMPLEMENTED";
1740Sstevel@tonic-gate return (DAT_SUCCESS);
1750Sstevel@tonic-gate }
1760Sstevel@tonic-gate default:
1770Sstevel@tonic-gate {
1780Sstevel@tonic-gate return (DAT_INVALID_PARAMETER);
1790Sstevel@tonic-gate }
1800Sstevel@tonic-gate }
1810Sstevel@tonic-gate }
1820Sstevel@tonic-gate
1830Sstevel@tonic-gate
1840Sstevel@tonic-gate DAT_RETURN
dat_strerror_minor(IN DAT_RETURN value,OUT const char ** message)1850Sstevel@tonic-gate dat_strerror_minor(
1860Sstevel@tonic-gate IN DAT_RETURN value,
1870Sstevel@tonic-gate OUT const char **message)
1880Sstevel@tonic-gate {
1890Sstevel@tonic-gate switch (DAT_GET_SUBTYPE(value)) {
1900Sstevel@tonic-gate case DAT_NO_SUBTYPE:
1910Sstevel@tonic-gate {
1920Sstevel@tonic-gate *message = "";
1930Sstevel@tonic-gate return (DAT_SUCCESS);
1940Sstevel@tonic-gate }
1950Sstevel@tonic-gate case DAT_SUB_INTERRUPTED:
1960Sstevel@tonic-gate {
1970Sstevel@tonic-gate *message = "DAT_SUB_INTERRUPTED";
1980Sstevel@tonic-gate return (DAT_SUCCESS);
1990Sstevel@tonic-gate }
2000Sstevel@tonic-gate case DAT_RESOURCE_MEMORY:
2010Sstevel@tonic-gate {
2020Sstevel@tonic-gate *message = "DAT_RESOURCE_MEMORY";
2030Sstevel@tonic-gate return (DAT_SUCCESS);
2040Sstevel@tonic-gate }
2050Sstevel@tonic-gate case DAT_RESOURCE_DEVICE:
2060Sstevel@tonic-gate {
2070Sstevel@tonic-gate *message = "DAT_RESOURCE_DEVICE";
2080Sstevel@tonic-gate return (DAT_SUCCESS);
2090Sstevel@tonic-gate }
2100Sstevel@tonic-gate case DAT_RESOURCE_TEP:
2110Sstevel@tonic-gate {
2120Sstevel@tonic-gate *message = "DAT_RESOURCE_TEP";
2130Sstevel@tonic-gate return (DAT_SUCCESS);
2140Sstevel@tonic-gate }
2150Sstevel@tonic-gate case DAT_RESOURCE_TEVD:
2160Sstevel@tonic-gate {
2170Sstevel@tonic-gate *message = "DAT_RESOURCE_TEVD";
2180Sstevel@tonic-gate return (DAT_SUCCESS);
2190Sstevel@tonic-gate }
2200Sstevel@tonic-gate case DAT_RESOURCE_PROTECTION_DOMAIN:
2210Sstevel@tonic-gate {
2220Sstevel@tonic-gate *message = "DAT_RESOURCE_PROTECTION_DOMAIN";
2230Sstevel@tonic-gate return (DAT_SUCCESS);
2240Sstevel@tonic-gate }
2250Sstevel@tonic-gate case DAT_RESOURCE_MEMORY_REGION:
2260Sstevel@tonic-gate {
2270Sstevel@tonic-gate *message = "DAT_RESOURCE_MEMORY_REGION";
2280Sstevel@tonic-gate return (DAT_SUCCESS);
2290Sstevel@tonic-gate }
2300Sstevel@tonic-gate case DAT_RESOURCE_ERROR_HANDLER:
2310Sstevel@tonic-gate {
2320Sstevel@tonic-gate *message = "DAT_RESOURCE_ERROR_HANDLER";
2330Sstevel@tonic-gate return (DAT_SUCCESS);
2340Sstevel@tonic-gate }
2350Sstevel@tonic-gate case DAT_RESOURCE_CREDITS:
2360Sstevel@tonic-gate {
2370Sstevel@tonic-gate *message = "DAT_RESOURCE_CREDITS";
2380Sstevel@tonic-gate return (DAT_SUCCESS);
2390Sstevel@tonic-gate }
2400Sstevel@tonic-gate case DAT_INVALID_HANDLE_IA:
2410Sstevel@tonic-gate {
2420Sstevel@tonic-gate *message = "DAT_INVALID_HANDLE_IA";
2430Sstevel@tonic-gate return (DAT_SUCCESS);
2440Sstevel@tonic-gate }
2450Sstevel@tonic-gate case DAT_INVALID_HANDLE_EP:
2460Sstevel@tonic-gate {
2470Sstevel@tonic-gate *message = "DAT_INVALID_HANDLE_EP";
2480Sstevel@tonic-gate return (DAT_SUCCESS);
2490Sstevel@tonic-gate }
2500Sstevel@tonic-gate case DAT_INVALID_HANDLE_LMR:
2510Sstevel@tonic-gate {
2520Sstevel@tonic-gate *message = "DAT_INVALID_HANDLE_LMR";
2530Sstevel@tonic-gate return (DAT_SUCCESS);
2540Sstevel@tonic-gate }
2550Sstevel@tonic-gate case DAT_INVALID_HANDLE_RMR:
2560Sstevel@tonic-gate {
2570Sstevel@tonic-gate *message = "DAT_INVALID_HANDLE_RMR";
2580Sstevel@tonic-gate return (DAT_SUCCESS);
2590Sstevel@tonic-gate }
2600Sstevel@tonic-gate case DAT_INVALID_HANDLE_PZ:
2610Sstevel@tonic-gate {
2620Sstevel@tonic-gate *message = "DAT_INVALID_HANDLE_PZ";
2630Sstevel@tonic-gate return (DAT_SUCCESS);
2640Sstevel@tonic-gate }
2650Sstevel@tonic-gate case DAT_INVALID_HANDLE_PSP:
2660Sstevel@tonic-gate {
2670Sstevel@tonic-gate *message = "DAT_INVALID_HANDLE_PSP";
2680Sstevel@tonic-gate return (DAT_SUCCESS);
2690Sstevel@tonic-gate }
2700Sstevel@tonic-gate case DAT_INVALID_HANDLE_RSP:
2710Sstevel@tonic-gate {
2720Sstevel@tonic-gate *message = "DAT_INVALID_HANDLE_RSP";
2730Sstevel@tonic-gate return (DAT_SUCCESS);
2740Sstevel@tonic-gate }
2750Sstevel@tonic-gate case DAT_INVALID_HANDLE_CR:
2760Sstevel@tonic-gate {
2770Sstevel@tonic-gate *message = "DAT_INVALID_HANDLE_CR";
2780Sstevel@tonic-gate return (DAT_SUCCESS);
2790Sstevel@tonic-gate }
2800Sstevel@tonic-gate case DAT_INVALID_HANDLE_CNO:
2810Sstevel@tonic-gate {
2820Sstevel@tonic-gate *message = "DAT_INVALID_HANDLE_CNO";
2830Sstevel@tonic-gate return (DAT_SUCCESS);
2840Sstevel@tonic-gate }
2850Sstevel@tonic-gate case DAT_INVALID_HANDLE_EVD_CR:
2860Sstevel@tonic-gate {
2870Sstevel@tonic-gate *message = "DAT_INVALID_HANDLE_EVD_CR";
2880Sstevel@tonic-gate return (DAT_SUCCESS);
2890Sstevel@tonic-gate }
2900Sstevel@tonic-gate case DAT_INVALID_HANDLE_EVD_REQUEST:
2910Sstevel@tonic-gate {
2920Sstevel@tonic-gate *message = "DAT_INVALID_HANDLE_EVD_REQUEST";
2930Sstevel@tonic-gate return (DAT_SUCCESS);
2940Sstevel@tonic-gate }
2950Sstevel@tonic-gate case DAT_INVALID_HANDLE_EVD_RECV:
2960Sstevel@tonic-gate {
2970Sstevel@tonic-gate *message = "DAT_INVALID_HANDLE_EVD_RECV";
2980Sstevel@tonic-gate return (DAT_SUCCESS);
2990Sstevel@tonic-gate }
3000Sstevel@tonic-gate case DAT_INVALID_HANDLE_EVD_CONN:
3010Sstevel@tonic-gate {
3020Sstevel@tonic-gate *message = "DAT_INVALID_HANDLE_EVD_CONN";
3030Sstevel@tonic-gate return (DAT_SUCCESS);
3040Sstevel@tonic-gate }
3050Sstevel@tonic-gate case DAT_INVALID_HANDLE_EVD_ASYNC:
3060Sstevel@tonic-gate {
3070Sstevel@tonic-gate *message = "DAT_INVALID_HANDLE_EVD_ASYNC";
3080Sstevel@tonic-gate return (DAT_SUCCESS);
3090Sstevel@tonic-gate }
3100Sstevel@tonic-gate case DAT_INVALID_ARG1:
3110Sstevel@tonic-gate {
3120Sstevel@tonic-gate *message = "DAT_INVALID_ARG1";
3130Sstevel@tonic-gate return (DAT_SUCCESS);
3140Sstevel@tonic-gate }
3150Sstevel@tonic-gate case DAT_INVALID_ARG2:
3160Sstevel@tonic-gate {
3170Sstevel@tonic-gate *message = "DAT_INVALID_ARG2";
3180Sstevel@tonic-gate return (DAT_SUCCESS);
3190Sstevel@tonic-gate }
3200Sstevel@tonic-gate case DAT_INVALID_ARG3:
3210Sstevel@tonic-gate {
3220Sstevel@tonic-gate *message = "DAT_INVALID_ARG3";
3230Sstevel@tonic-gate return (DAT_SUCCESS);
3240Sstevel@tonic-gate }
3250Sstevel@tonic-gate case DAT_INVALID_ARG4:
3260Sstevel@tonic-gate {
3270Sstevel@tonic-gate *message = "DAT_INVALID_ARG4";
3280Sstevel@tonic-gate return (DAT_SUCCESS);
3290Sstevel@tonic-gate }
3300Sstevel@tonic-gate case DAT_INVALID_ARG5:
3310Sstevel@tonic-gate {
3320Sstevel@tonic-gate *message = "DAT_INVALID_ARG5";
3330Sstevel@tonic-gate return (DAT_SUCCESS);
3340Sstevel@tonic-gate }
3350Sstevel@tonic-gate case DAT_INVALID_ARG6:
3360Sstevel@tonic-gate {
3370Sstevel@tonic-gate *message = "DAT_INVALID_ARG6";
3380Sstevel@tonic-gate return (DAT_SUCCESS);
3390Sstevel@tonic-gate }
3400Sstevel@tonic-gate case DAT_INVALID_ARG7:
3410Sstevel@tonic-gate {
3420Sstevel@tonic-gate *message = "DAT_INVALID_ARG7";
3430Sstevel@tonic-gate return (DAT_SUCCESS);
3440Sstevel@tonic-gate }
3450Sstevel@tonic-gate case DAT_INVALID_ARG8:
3460Sstevel@tonic-gate {
3470Sstevel@tonic-gate *message = "DAT_INVALID_ARG8";
3480Sstevel@tonic-gate return (DAT_SUCCESS);
3490Sstevel@tonic-gate }
3500Sstevel@tonic-gate case DAT_INVALID_ARG9:
3510Sstevel@tonic-gate {
3520Sstevel@tonic-gate *message = "DAT_INVALID_ARG9";
3530Sstevel@tonic-gate return (DAT_SUCCESS);
3540Sstevel@tonic-gate }
3550Sstevel@tonic-gate case DAT_INVALID_ARG10:
3560Sstevel@tonic-gate {
3570Sstevel@tonic-gate *message = "DAT_INVALID_ARG10";
3580Sstevel@tonic-gate return (DAT_SUCCESS);
3590Sstevel@tonic-gate }
3600Sstevel@tonic-gate case DAT_INVALID_STATE_EP_UNCONNECTED:
3610Sstevel@tonic-gate {
3620Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EP_UNCONNECTED";
3630Sstevel@tonic-gate return (DAT_SUCCESS);
3640Sstevel@tonic-gate }
3650Sstevel@tonic-gate case DAT_INVALID_STATE_EP_ACTCONNPENDING:
3660Sstevel@tonic-gate {
3670Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EP_ACTCONNPENDING";
3680Sstevel@tonic-gate return (DAT_SUCCESS);
3690Sstevel@tonic-gate }
3700Sstevel@tonic-gate case DAT_INVALID_STATE_EP_PASSCONNPENDING:
3710Sstevel@tonic-gate {
3720Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EP_PASSCONNPENDING";
3730Sstevel@tonic-gate return (DAT_SUCCESS);
3740Sstevel@tonic-gate }
3750Sstevel@tonic-gate case DAT_INVALID_STATE_EP_TENTCONNPENDING:
3760Sstevel@tonic-gate {
3770Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EP_TENTCONNPENDING";
3780Sstevel@tonic-gate return (DAT_SUCCESS);
3790Sstevel@tonic-gate }
3800Sstevel@tonic-gate case DAT_INVALID_STATE_EP_CONNECTED:
3810Sstevel@tonic-gate {
3820Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EP_CONNECTED";
3830Sstevel@tonic-gate return (DAT_SUCCESS);
3840Sstevel@tonic-gate }
3850Sstevel@tonic-gate case DAT_INVALID_STATE_EP_DISCONNECTED:
3860Sstevel@tonic-gate {
3870Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EP_DISCONNECTED";
3880Sstevel@tonic-gate return (DAT_SUCCESS);
3890Sstevel@tonic-gate }
3900Sstevel@tonic-gate case DAT_INVALID_STATE_EP_RESERVED:
3910Sstevel@tonic-gate {
3920Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EP_RESERVED";
3930Sstevel@tonic-gate return (DAT_SUCCESS);
3940Sstevel@tonic-gate }
3950Sstevel@tonic-gate case DAT_INVALID_STATE_EP_COMPLPENDING:
3960Sstevel@tonic-gate {
3970Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EP_COMPLPENDING";
3980Sstevel@tonic-gate return (DAT_SUCCESS);
3990Sstevel@tonic-gate }
4000Sstevel@tonic-gate case DAT_INVALID_STATE_EP_DISCPENDING:
4010Sstevel@tonic-gate {
4020Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EP_DISCPENDING";
4030Sstevel@tonic-gate return (DAT_SUCCESS);
4040Sstevel@tonic-gate }
4050Sstevel@tonic-gate case DAT_INVALID_STATE_EP_PROVIDERCONTROL:
4060Sstevel@tonic-gate {
4070Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EP_PROVIDERCONTROL";
4080Sstevel@tonic-gate return (DAT_SUCCESS);
4090Sstevel@tonic-gate }
4100Sstevel@tonic-gate case DAT_INVALID_STATE_EP_NOTREADY:
4110Sstevel@tonic-gate {
4120Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EP_NOTREADY";
4130Sstevel@tonic-gate return (DAT_SUCCESS);
4140Sstevel@tonic-gate }
4150Sstevel@tonic-gate case DAT_INVALID_STATE_CNO_IN_USE:
4160Sstevel@tonic-gate {
4170Sstevel@tonic-gate *message = "DAT_INVALID_STATE_CNO_IN_USE";
4180Sstevel@tonic-gate return (DAT_SUCCESS);
4190Sstevel@tonic-gate }
4200Sstevel@tonic-gate case DAT_INVALID_STATE_CNO_DEAD:
4210Sstevel@tonic-gate {
4220Sstevel@tonic-gate *message = "DAT_INVALID_STATE_CNO_DEAD";
4230Sstevel@tonic-gate return (DAT_SUCCESS);
4240Sstevel@tonic-gate }
4250Sstevel@tonic-gate case DAT_INVALID_STATE_EVD_OPEN:
4260Sstevel@tonic-gate {
4270Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EVD_OPEN";
4280Sstevel@tonic-gate return (DAT_SUCCESS);
4290Sstevel@tonic-gate }
4300Sstevel@tonic-gate case DAT_INVALID_STATE_EVD_ENABLED:
4310Sstevel@tonic-gate {
4320Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EVD_ENABLED";
4330Sstevel@tonic-gate return (DAT_SUCCESS);
4340Sstevel@tonic-gate }
4350Sstevel@tonic-gate case DAT_INVALID_STATE_EVD_DISABLED:
4360Sstevel@tonic-gate {
4370Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EVD_DISABLED";
4380Sstevel@tonic-gate return (DAT_SUCCESS);
4390Sstevel@tonic-gate }
4400Sstevel@tonic-gate case DAT_INVALID_STATE_EVD_WAITABLE:
4410Sstevel@tonic-gate {
4420Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EVD_WAITABLE";
4430Sstevel@tonic-gate return (DAT_SUCCESS);
4440Sstevel@tonic-gate }
4450Sstevel@tonic-gate case DAT_INVALID_STATE_EVD_UNWAITABLE:
4460Sstevel@tonic-gate {
4470Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EVD_UNWAITABLE";
4480Sstevel@tonic-gate return (DAT_SUCCESS);
4490Sstevel@tonic-gate }
4500Sstevel@tonic-gate case DAT_INVALID_STATE_EVD_IN_USE:
4510Sstevel@tonic-gate {
4520Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EVD_IN_USE";
4530Sstevel@tonic-gate return (DAT_SUCCESS);
4540Sstevel@tonic-gate }
4550Sstevel@tonic-gate case DAT_INVALID_STATE_EVD_CONFIG_NOTIFY:
4560Sstevel@tonic-gate {
4570Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EVD_CONFIG_NOTIFY";
4580Sstevel@tonic-gate return (DAT_SUCCESS);
4590Sstevel@tonic-gate }
4600Sstevel@tonic-gate case DAT_INVALID_STATE_EVD_CONFIG_SOLICITED:
4610Sstevel@tonic-gate {
4620Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EVD_CONFIG_SOLICITED";
4630Sstevel@tonic-gate return (DAT_SUCCESS);
4640Sstevel@tonic-gate }
4650Sstevel@tonic-gate case DAT_INVALID_STATE_EVD_CONFIG_THRESHOLD:
4660Sstevel@tonic-gate {
4670Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EVD_CONFIG_THRESHOLD";
4680Sstevel@tonic-gate return (DAT_SUCCESS);
4690Sstevel@tonic-gate }
4700Sstevel@tonic-gate case DAT_INVALID_STATE_EVD_WAITER:
4710Sstevel@tonic-gate {
4720Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EVD_WAITER";
4730Sstevel@tonic-gate return (DAT_SUCCESS);
4740Sstevel@tonic-gate }
4750Sstevel@tonic-gate case DAT_INVALID_STATE_EVD_ASYNC:
4760Sstevel@tonic-gate {
4770Sstevel@tonic-gate *message = "DAT_INVALID_STATE_EVD_ASYNC";
4780Sstevel@tonic-gate return (DAT_SUCCESS);
4790Sstevel@tonic-gate }
4800Sstevel@tonic-gate case DAT_INVALID_STATE_IA_IN_USE:
4810Sstevel@tonic-gate {
4820Sstevel@tonic-gate *message = "DAT_INVALID_STATE_IA_IN_USE";
4830Sstevel@tonic-gate return (DAT_SUCCESS);
4840Sstevel@tonic-gate }
4850Sstevel@tonic-gate case DAT_INVALID_STATE_LMR_IN_USE:
4860Sstevel@tonic-gate {
4870Sstevel@tonic-gate *message = "DAT_INVALID_STATE_LMR_IN_USE";
4880Sstevel@tonic-gate return (DAT_SUCCESS);
4890Sstevel@tonic-gate }
4900Sstevel@tonic-gate case DAT_INVALID_STATE_LMR_FREE:
4910Sstevel@tonic-gate {
4920Sstevel@tonic-gate *message = "DAT_INVALID_STATE_LMR_FREE";
4930Sstevel@tonic-gate return (DAT_SUCCESS);
4940Sstevel@tonic-gate }
4950Sstevel@tonic-gate case DAT_INVALID_STATE_PZ_IN_USE:
4960Sstevel@tonic-gate {
4970Sstevel@tonic-gate *message = "DAT_INVALID_STATE_PZ_IN_USE";
4980Sstevel@tonic-gate return (DAT_SUCCESS);
4990Sstevel@tonic-gate }
5000Sstevel@tonic-gate case DAT_INVALID_STATE_PZ_FREE:
5010Sstevel@tonic-gate {
5020Sstevel@tonic-gate *message = "DAT_INVALID_STATE_PZ_FREE";
5030Sstevel@tonic-gate return (DAT_SUCCESS);
5040Sstevel@tonic-gate }
5050Sstevel@tonic-gate case DAT_PRIVILEGES_READ:
5060Sstevel@tonic-gate {
5070Sstevel@tonic-gate *message = "DAT_PRIVILEGES_READ";
5080Sstevel@tonic-gate return (DAT_SUCCESS);
5090Sstevel@tonic-gate }
5100Sstevel@tonic-gate case DAT_PRIVILEGES_WRITE:
5110Sstevel@tonic-gate {
5120Sstevel@tonic-gate *message = "DAT_PRIVILEGES_WRITE";
5130Sstevel@tonic-gate return (DAT_SUCCESS);
5140Sstevel@tonic-gate }
5150Sstevel@tonic-gate case DAT_PRIVILEGES_RDMA_READ:
5160Sstevel@tonic-gate {
5170Sstevel@tonic-gate *message = "DAT_PRIVILEGES_RDMA_READ";
5180Sstevel@tonic-gate return (DAT_SUCCESS);
5190Sstevel@tonic-gate }
5200Sstevel@tonic-gate case DAT_PRIVILEGES_RDMA_WRITE:
5210Sstevel@tonic-gate {
5220Sstevel@tonic-gate *message = "DAT_PRIVILEGES_RDMA_WRITE";
5230Sstevel@tonic-gate return (DAT_SUCCESS);
5240Sstevel@tonic-gate }
5250Sstevel@tonic-gate case DAT_PROTECTION_READ:
5260Sstevel@tonic-gate {
5270Sstevel@tonic-gate *message = "DAT_PROTECTION_READ";
5280Sstevel@tonic-gate return (DAT_SUCCESS);
5290Sstevel@tonic-gate }
5300Sstevel@tonic-gate case DAT_PROTECTION_WRITE:
5310Sstevel@tonic-gate {
5320Sstevel@tonic-gate *message = "DAT_PROTECTION_WRITE";
5330Sstevel@tonic-gate return (DAT_SUCCESS);
5340Sstevel@tonic-gate }
5350Sstevel@tonic-gate case DAT_PROTECTION_RDMA_READ:
5360Sstevel@tonic-gate {
5370Sstevel@tonic-gate *message = "DAT_PROTECTION_RDMA_READ";
5380Sstevel@tonic-gate return (DAT_SUCCESS);
5390Sstevel@tonic-gate }
5400Sstevel@tonic-gate case DAT_PROTECTION_RDMA_WRITE:
5410Sstevel@tonic-gate {
5420Sstevel@tonic-gate *message = "DAT_PROTECTION_RDMA_WRITE";
5430Sstevel@tonic-gate return (DAT_SUCCESS);
5440Sstevel@tonic-gate }
5450Sstevel@tonic-gate case DAT_INVALID_ADDRESS_UNSUPPORTED:
5460Sstevel@tonic-gate {
5470Sstevel@tonic-gate *message = "DAT_INVALID_ADDRESS_UNSUPPORTED";
5480Sstevel@tonic-gate return (DAT_SUCCESS);
5490Sstevel@tonic-gate }
5500Sstevel@tonic-gate case DAT_INVALID_ADDRESS_UNREACHABLE:
5510Sstevel@tonic-gate {
5520Sstevel@tonic-gate *message = "DAT_INVALID_ADDRESS_UNREACHABLE";
5530Sstevel@tonic-gate return (DAT_SUCCESS);
5540Sstevel@tonic-gate }
5550Sstevel@tonic-gate case DAT_INVALID_ADDRESS_MALFORMED:
5560Sstevel@tonic-gate {
5570Sstevel@tonic-gate *message = "DAT_INVALID_ADDRESS_MALFORMED";
5580Sstevel@tonic-gate return (DAT_SUCCESS);
5590Sstevel@tonic-gate }
560*8580SBill.Taylor@Sun.COM case DAT_INVALID_RO_COOKIE:
561*8580SBill.Taylor@Sun.COM *message = "DAT_INVALID_RO_COOKIE";
562*8580SBill.Taylor@Sun.COM return (DAT_SUCCESS);
5630Sstevel@tonic-gate default:
5640Sstevel@tonic-gate {
5650Sstevel@tonic-gate return (DAT_INVALID_PARAMETER);
5660Sstevel@tonic-gate }
5670Sstevel@tonic-gate }
5680Sstevel@tonic-gate }
5690Sstevel@tonic-gate
5700Sstevel@tonic-gate
5710Sstevel@tonic-gate /*
5720Sstevel@tonic-gate *
5730Sstevel@tonic-gate * External Function Definitions
5740Sstevel@tonic-gate *
5750Sstevel@tonic-gate */
5760Sstevel@tonic-gate
5770Sstevel@tonic-gate DAT_RETURN
dat_strerror(IN DAT_RETURN value,OUT const char ** major_message,OUT const char ** minor_message)5780Sstevel@tonic-gate dat_strerror(
5790Sstevel@tonic-gate IN DAT_RETURN value,
5800Sstevel@tonic-gate OUT const char **major_message,
5810Sstevel@tonic-gate OUT const char **minor_message)
5820Sstevel@tonic-gate {
5830Sstevel@tonic-gate /*
5840Sstevel@tonic-gate * The DAT specification contains a note to implementers
5850Sstevel@tonic-gate * suggesting that the consumer's DAT_RETURN value be used
5860Sstevel@tonic-gate * as an index into a table of text strings. However,
5870Sstevel@tonic-gate * the DAT_RETURN values are not consecutive. Therefore this
5880Sstevel@tonic-gate * implementation does not follow the suggested implementation.
5890Sstevel@tonic-gate */
5900Sstevel@tonic-gate
5910Sstevel@tonic-gate if (DAT_SUCCESS != dat_strerror_major(value, major_message)) {
5920Sstevel@tonic-gate return (DAT_INVALID_PARAMETER);
5930Sstevel@tonic-gate } else if (DAT_SUCCESS != dat_strerror_minor(value, minor_message)) {
5940Sstevel@tonic-gate return (DAT_INVALID_PARAMETER);
5950Sstevel@tonic-gate } else {
5960Sstevel@tonic-gate return (DAT_SUCCESS);
5970Sstevel@tonic-gate }
5980Sstevel@tonic-gate }
599