]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/ofed/management/opensm/include/opensm/osm_remote_sm.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / ofed / management / opensm / include / opensm / osm_remote_sm.h
1 /*
2  * Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved.
3  * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
4  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
5  *
6  * This software is available to you under a choice of one of two
7  * licenses.  You may choose to be licensed under the terms of the GNU
8  * General Public License (GPL) Version 2, available from the file
9  * COPYING in the main directory of this source tree, or the
10  * OpenIB.org BSD license below:
11  *
12  *     Redistribution and use in source and binary forms, with or
13  *     without modification, are permitted provided that the following
14  *     conditions are met:
15  *
16  *      - Redistributions of source code must retain the above
17  *        copyright notice, this list of conditions and the following
18  *        disclaimer.
19  *
20  *      - Redistributions in binary form must reproduce the above
21  *        copyright notice, this list of conditions and the following
22  *        disclaimer in the documentation and/or other materials
23  *        provided with the distribution.
24  *
25  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32  * SOFTWARE.
33  *
34  */
35
36 /*
37  * Abstract:
38  *      Declaration of osm_sm_t, osm_remote_sm_t.
39  *      This object represents an IBA subnet.
40  *      This object is part of the OpenSM family of objects.
41  */
42
43 #ifndef _OSM_REMOTE_SM_H_
44 #define _OSM_REMOTE_SM_H_
45
46 #include <iba/ib_types.h>
47 #include <opensm/osm_base.h>
48 #include <opensm/osm_port.h>
49
50 #ifdef __cplusplus
51 #  define BEGIN_C_DECLS extern "C" {
52 #  define END_C_DECLS   }
53 #else                           /* !__cplusplus */
54 #  define BEGIN_C_DECLS
55 #  define END_C_DECLS
56 #endif                          /* __cplusplus */
57
58 BEGIN_C_DECLS
59 /****h* OpenSM/Remote SM
60 * NAME
61 *       Remote SM
62 *
63 * DESCRIPTION
64 *       The Remote SM object encapsulates the information tracked for
65 *       other SM ports on the subnet.
66 *
67 *       The Remote SM object is thread safe.
68 *
69 *       This object should be treated as opaque and should
70 *       be manipulated only through the provided functions.
71 *
72 * AUTHOR
73 *       Steve King, Intel
74 *
75 *********/
76 /****s* OpenSM: Remote SM/osm_remote_sm_t
77 * NAME
78 *       osm_remote_sm_t
79 *
80 * DESCRIPTION
81 *       Remote Subnet Manager structure.
82 *
83 *       This object should be treated as opaque and should
84 *       be manipulated only through the provided functions.
85 *
86 * SYNOPSIS
87 */
88 typedef struct osm_remote_sm {
89         cl_map_item_t map_item;
90         const osm_port_t *p_port;
91         ib_sm_info_t smi;
92 } osm_remote_sm_t;
93 /*
94 * FIELDS
95 *       map_item
96 *               Linkage for the cl_qmap container.  MUST BE FIRST ELEMENT!!
97 *       p_port
98 *               Pointer to the port object for this SM.
99 *
100 *       smi
101 *               The SMInfo attribute for this SM.
102 *
103 * SEE ALSO
104 *********/
105
106 /****f* OpenSM: SM/osm_remote_sm_construct
107 * NAME
108 *       osm_remote_sm_construct
109 *
110 * DESCRIPTION
111 *       This function constructs an Remote SM object.
112 *
113 * SYNOPSIS
114 */
115 void osm_remote_sm_construct(IN osm_remote_sm_t * const p_sm);
116 /*
117 * PARAMETERS
118 *       p_sm
119 *               [in] Pointer to an Remote SM object to construct.
120 *
121 * RETURN VALUE
122 *       This function does not return a value.
123 *
124 * NOTES
125 *       Allows calling osm_remote_sm_init, osm_remote_sm_destroy
126 *
127 *       Calling osm_remote_sm_construct is a prerequisite to calling any other
128 *       method except osm_remote_sm_init.
129 *
130 * SEE ALSO
131 *       SM object, osm_remote_sm_init, osm_remote_sm_destroy
132 *********/
133
134 /****f* OpenSM: SM/osm_remote_sm_destroy
135 * NAME
136 *       osm_remote_sm_destroy
137 *
138 * DESCRIPTION
139 *       The osm_remote_sm_destroy function destroys an SM, releasing
140 *       all resources.
141 *
142 * SYNOPSIS
143 */
144 void osm_remote_sm_destroy(IN osm_remote_sm_t * const p_sm);
145 /*
146 * PARAMETERS
147 *       p_sm
148 *               [in] Pointer to an Remote SM object to destroy.
149 *
150 * RETURN VALUE
151 *       This function does not return a value.
152 *
153 * NOTES
154 *       Performs any necessary cleanup of the specified Remote SM object.
155 *       Further operations should not be attempted on the destroyed object.
156 *       This function should only be called after a call to
157 *       osm_remote_sm_construct or osm_remote_sm_init.
158 *
159 * SEE ALSO
160 *       Remote SM object, osm_remote_sm_construct, osm_remote_sm_init
161 *********/
162
163 /****f* OpenSM: SM/osm_remote_sm_init
164 * NAME
165 *       osm_remote_sm_init
166 *
167 * DESCRIPTION
168 *       The osm_remote_sm_init function initializes an Remote SM object for use.
169 *
170 * SYNOPSIS
171 */
172 void
173 osm_remote_sm_init(IN osm_remote_sm_t * const p_sm,
174                    IN const osm_port_t * const p_port,
175                    IN const ib_sm_info_t * const p_smi);
176 /*
177 * PARAMETERS
178 *       p_sm
179 *               [in] Pointer to an osm_remote_sm_t object to initialize.
180 *
181 *       p_port
182 *               [in] Pointer to the Remote SM's port object.
183 *
184 *       p_smi
185 *               [in] Pointer to the SMInfo attribute for this SM.
186 *
187 * RETURN VALUES
188 *       This function does not return a value.
189 *
190 * NOTES
191 *       Allows calling other Remote SM methods.
192 *
193 * SEE ALSO
194 *       Remote SM object, osm_remote_sm_construct, osm_remote_sm_destroy
195 *********/
196
197 END_C_DECLS
198 #endif                          /* _OSM_REMOTE_SM_H_ */