xref: /illumos-gate/usr/src/lib/udapl/udapl_tavor/common/dapl_rsp_query.c (revision e44e85a7f9935f0428e188393e3da61b17e83884)
1 /*
2  * CDDL HEADER START
3  *
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.
7  *
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.
12  *
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]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved.
24  */
25 
26 /*
27  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
28  * Use is subject to license terms.
29  */
30 
31 /*
32  *
33  * MODULE: dapl_rsp_query.c
34  *
35  * PURPOSE: Connection management
36  * Description: Interfaces in this file are completely described in
37  *		the DAPL 1.1 API, Chapter 6, section 4
38  *
39  * $Id: dapl_rsp_query.c,v 1.6 2003/06/16 17:53:34 sjs2 Exp $
40  */
41 
42 #include "dapl.h"
43 
44 /*
45  * dapl_rsp_query
46  *
47  * uDAPL: User Direct Access Program Library Version 1.1, 6.4.1.6
48  *
49  * Provide arguments of the reserved service points
50  *
51  * Input:
52  *	rsp_handle
53  *	rsp_args_mask
54  *
55  * Output:
56  *	rsp_args
57  *
58  * Returns:
59  *	DAT_SUCCESS
60  *	DAT_INVALID_PARAMETER
61  */
62 DAT_RETURN
63 dapl_rsp_query(
64 	IN DAT_RSP_HANDLE rsp_handle,
65 	IN DAT_RSP_PARAM_MASK rsp_mask,
66 	OUT DAT_RSP_PARAM *rsp_param)
67 {
68 	DAPL_SP *sp_ptr;
69 	DAT_RETURN dat_status;
70 
71 	dat_status = DAT_SUCCESS;
72 
73 	if (DAPL_BAD_HANDLE(rsp_handle, DAPL_MAGIC_RSP)) {
74 		dat_status = DAT_ERROR(DAT_INVALID_HANDLE,
75 		    DAT_INVALID_HANDLE_RSP);
76 		goto bail;
77 	}
78 
79 	if (rsp_mask & ~DAT_RSP_FIELD_ALL) {
80 		dat_status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2);
81 		goto bail;
82 	}
83 
84 	if (NULL == rsp_param) {
85 		dat_status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG3);
86 		goto bail;
87 	}
88 
89 	sp_ptr = (DAPL_SP *)rsp_handle;
90 
91 	/*
92 	 * Fill in the RSP params
93 	 */
94 	rsp_param->ia_handle   = sp_ptr->ia_handle;
95 	rsp_param->conn_qual   = sp_ptr->conn_qual;
96 	rsp_param->evd_handle  = sp_ptr->evd_handle;
97 	rsp_param->ep_handle   = sp_ptr->ep_handle;
98 
99 bail:
100 	return (dat_status);
101 }
102