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.
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:
12 * Redistribution and use in source and binary forms, with or
13 * without modification, are permitted provided that the following
16 * - Redistributions of source code must retain the above
17 * copyright notice, this list of conditions and the following
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.
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
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.
43 #ifndef _OSM_REMOTE_SM_H_
44 #define _OSM_REMOTE_SM_H_
46 #include <iba/ib_types.h>
47 #include <opensm/osm_base.h>
48 #include <opensm/osm_port.h>
51 # define BEGIN_C_DECLS extern "C" {
52 # define END_C_DECLS }
53 #else /* !__cplusplus */
54 # define BEGIN_C_DECLS
56 #endif /* __cplusplus */
59 /****h* OpenSM/Remote SM
64 * The Remote SM object encapsulates the information tracked for
65 * other SM ports on the subnet.
67 * The Remote SM object is thread safe.
69 * This object should be treated as opaque and should
70 * be manipulated only through the provided functions.
76 /****s* OpenSM: Remote SM/osm_remote_sm_t
81 * Remote Subnet Manager structure.
83 * This object should be treated as opaque and should
84 * be manipulated only through the provided functions.
88 typedef struct osm_remote_sm {
89 cl_map_item_t map_item;
90 const osm_port_t *p_port;
96 * Linkage for the cl_qmap container. MUST BE FIRST ELEMENT!!
98 * Pointer to the port object for this SM.
101 * The SMInfo attribute for this SM.
106 /****f* OpenSM: SM/osm_remote_sm_construct
108 * osm_remote_sm_construct
111 * This function constructs an Remote SM object.
115 void osm_remote_sm_construct(IN osm_remote_sm_t * const p_sm);
119 * [in] Pointer to an Remote SM object to construct.
122 * This function does not return a value.
125 * Allows calling osm_remote_sm_init, osm_remote_sm_destroy
127 * Calling osm_remote_sm_construct is a prerequisite to calling any other
128 * method except osm_remote_sm_init.
131 * SM object, osm_remote_sm_init, osm_remote_sm_destroy
134 /****f* OpenSM: SM/osm_remote_sm_destroy
136 * osm_remote_sm_destroy
139 * The osm_remote_sm_destroy function destroys an SM, releasing
144 void osm_remote_sm_destroy(IN osm_remote_sm_t * const p_sm);
148 * [in] Pointer to an Remote SM object to destroy.
151 * This function does not return a value.
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.
160 * Remote SM object, osm_remote_sm_construct, osm_remote_sm_init
163 /****f* OpenSM: SM/osm_remote_sm_init
168 * The osm_remote_sm_init function initializes an Remote SM object for use.
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);
179 * [in] Pointer to an osm_remote_sm_t object to initialize.
182 * [in] Pointer to the Remote SM's port object.
185 * [in] Pointer to the SMInfo attribute for this SM.
188 * This function does not return a value.
191 * Allows calling other Remote SM methods.
194 * Remote SM object, osm_remote_sm_construct, osm_remote_sm_destroy
198 #endif /* _OSM_REMOTE_SM_H_ */