1321936Shselasky/*
2321936Shselasky * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
3321936Shselasky * Copyright (c) 2002-2012 Mellanox Technologies LTD. All rights reserved.
4321936Shselasky * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
5321936Shselasky *
6321936Shselasky * This software is available to you under a choice of one of two
7321936Shselasky * licenses.  You may choose to be licensed under the terms of the GNU
8321936Shselasky * General Public License (GPL) Version 2, available from the file
9321936Shselasky * COPYING in the main directory of this source tree, or the
10321936Shselasky * OpenIB.org BSD license below:
11321936Shselasky *
12321936Shselasky *     Redistribution and use in source and binary forms, with or
13321936Shselasky *     without modification, are permitted provided that the following
14321936Shselasky *     conditions are met:
15321936Shselasky *
16321936Shselasky *      - Redistributions of source code must retain the above
17321936Shselasky *        copyright notice, this list of conditions and the following
18321936Shselasky *        disclaimer.
19321936Shselasky *
20321936Shselasky *      - Redistributions in binary form must reproduce the above
21321936Shselasky *        copyright notice, this list of conditions and the following
22321936Shselasky *        disclaimer in the documentation and/or other materials
23321936Shselasky *        provided with the distribution.
24321936Shselasky *
25321936Shselasky * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26321936Shselasky * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27321936Shselasky * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28321936Shselasky * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29321936Shselasky * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30321936Shselasky * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31321936Shselasky * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32321936Shselasky * SOFTWARE.
33321936Shselasky *
34321936Shselasky */
35321936Shselasky
36321936Shselasky/*
37321936Shselasky * Abstract:
38321936Shselasky * 	Declaration of osm_mcm_port_t.
39321936Shselasky *	This object represents the membership of a port in a multicast group.
40321936Shselasky *	This object is part of the OpenSM family of objects.
41321936Shselasky */
42321936Shselasky
43321936Shselasky#ifndef _OSM_MCM_PORT_H_
44321936Shselasky#define _OSM_MCM_PORT_H_
45321936Shselasky
46321936Shselasky#include <iba/ib_types.h>
47321936Shselasky#include <complib/cl_qmap.h>
48321936Shselasky#include <opensm/osm_base.h>
49321936Shselasky#include <opensm/osm_port.h>
50321936Shselasky
51321936Shselasky#ifdef __cplusplus
52321936Shselasky#  define BEGIN_C_DECLS extern "C" {
53321936Shselasky#  define END_C_DECLS   }
54321936Shselasky#else				/* !__cplusplus */
55321936Shselasky#  define BEGIN_C_DECLS
56321936Shselasky#  define END_C_DECLS
57321936Shselasky#endif				/* __cplusplus */
58321936Shselasky
59321936ShselaskyBEGIN_C_DECLS
60321936Shselasky
61321936Shselaskystruct osm_mgrp;
62321936Shselasky
63321936Shselasky/****s* OpenSM: MCM Port Object/osm_mcm_port_t
64321936Shselasky* NAME
65321936Shselasky* 	osm_mcm_port_t
66321936Shselasky*
67321936Shselasky* DESCRIPTION
68321936Shselasky* 	This object represents a particular port as a member of a
69321936Shselasky*	multicast group.
70321936Shselasky*
71321936Shselasky*	This object should be treated as opaque and should
72321936Shselasky*	be manipulated only through the provided functions.
73321936Shselasky*
74321936Shselasky* SYNOPSIS
75321936Shselasky*/
76321936Shselaskytypedef struct osm_mcm_port {
77321936Shselasky	cl_map_item_t map_item;
78321936Shselasky	cl_list_item_t list_item;
79321936Shselasky	osm_port_t *port;
80321936Shselasky	struct osm_mgrp *mgrp;
81321936Shselasky} osm_mcm_port_t;
82321936Shselasky/*
83321936Shselasky* FIELDS
84321936Shselasky*	map_item
85321936Shselasky*		Map Item for qmap linkage.  Must be first element!!
86321936Shselasky*
87321936Shselasky*	list_item
88321936Shselasky*		Linkage structure for cl_qlist.
89321936Shselasky*
90321936Shselasky*	port
91321936Shselasky*		Reference to the parent port
92321936Shselasky*
93321936Shselasky*	mgrp
94321936Shselasky*		The pointer to multicast group where this port is member of
95321936Shselasky*
96321936Shselasky* SEE ALSO
97321936Shselasky*	MCM Port Object
98321936Shselasky*********/
99321936Shselasky
100321936Shselasky/****f* OpenSM: MCM Port Object/osm_mcm_port_new
101321936Shselasky* NAME
102321936Shselasky*	osm_mcm_port_new
103321936Shselasky*
104321936Shselasky* DESCRIPTION
105321936Shselasky*	The osm_mcm_port_new function allocates and initializes a
106321936Shselasky*	MCM Port Object for use.
107321936Shselasky*
108321936Shselasky* SYNOPSIS
109321936Shselasky*/
110321936Shselaskyosm_mcm_port_t *osm_mcm_port_new(IN osm_port_t * port, IN struct osm_mgrp *mgrp);
111321936Shselasky/*
112321936Shselasky* PARAMETERS
113321936Shselasky*	port
114321936Shselasky*		[in] Pointer to the port object
115321936Shselasky*
116321936Shselasky*	mgrp
117321936Shselasky*		[in] Pointer to multicast group where this port is joined
118321936Shselasky*
119321936Shselasky* RETURN VALUES
120321936Shselasky*	Pointer to the allocated and initialized MCM Port object.
121321936Shselasky*
122321936Shselasky* NOTES
123321936Shselasky*
124321936Shselasky* SEE ALSO
125321936Shselasky*	MCM Port Object, osm_mcm_port_delete,
126321936Shselasky*********/
127321936Shselasky
128321936Shselasky/****f* OpenSM: MCM Port Object/osm_mcm_port_delete
129321936Shselasky* NAME
130321936Shselasky*	osm_mcm_port_delete
131321936Shselasky*
132321936Shselasky* DESCRIPTION
133321936Shselasky*	The osm_mcm_port_delete function destroys and dellallocates an
134321936Shselasky*	MCM Port Object, releasing all resources.
135321936Shselasky*
136321936Shselasky* SYNOPSIS
137321936Shselasky*/
138321936Shselaskyvoid osm_mcm_port_delete(IN osm_mcm_port_t * p_mcm);
139321936Shselasky/*
140321936Shselasky* PARAMETERS
141321936Shselasky*	p_mcm
142321936Shselasky*		[in] Pointer to a MCM Port Object to delete.
143321936Shselasky*
144321936Shselasky* RETURN VALUE
145321936Shselasky*	This function does not return a value.
146321936Shselasky*
147321936Shselasky* NOTES
148321936Shselasky*
149321936Shselasky* SEE ALSO
150321936Shselasky*	MCM Port Object, osm_mcm_port_new
151321936Shselasky*********/
152321936Shselasky
153321936Shselasky/****s* OpenSM: MCM Port Object/osm_mcm_alias_guid_t
154321936Shselasky* NAME
155321936Shselasky*	osm_mcm_alias_guid_t
156321936Shselasky*
157321936Shselasky* DESCRIPTION
158321936Shselasky*	This object represents an alias guid for a mcm port.
159321936Shselasky*
160321936Shselasky*	The osm_mcm_alias_guid_t object should be treated as opaque and should
161321936Shselasky*	be manipulated only through the provided functions.
162321936Shselasky*
163321936Shselasky* SYNOPSIS
164321936Shselasky*/
165321936Shselaskytypedef struct osm_mcm_alias_guid {
166321936Shselasky	cl_map_item_t map_item;
167321936Shselasky	ib_net64_t alias_guid;
168321936Shselasky	osm_mcm_port_t *p_base_mcm_port;
169321936Shselasky	ib_gid_t port_gid;
170321936Shselasky	uint8_t scope_state;
171321936Shselasky	boolean_t proxy_join;
172321936Shselasky} osm_mcm_alias_guid_t;
173321936Shselasky/*
174321936Shselasky* FIELDS
175321936Shselasky*	map_item
176321936Shselasky*		Linkage structure for cl_qmap.  MUST BE FIRST MEMBER!
177321936Shselasky*
178321936Shselasky*	alias_guid
179321936Shselasky*		Alias GUID for port obtained from SM GUIDInfo attribute
180321936Shselasky*
181321936Shselasky*	p_base_mcm_port
182321936Shselasky*		Pointer to osm_mcm_port_t for base port GUID
183321936Shselasky*
184321936Shselasky*	port_gid
185321936Shselasky*		GID of the member port
186321936Shselasky*
187321936Shselasky*	scope_state
188321936Shselasky*
189321936Shselasky*	proxy_join
190321936Shselasky*		If FALSE - Join was performed by the endport identified
191321936Shselasky*		by PortGID. If TRUE - Join was performed on behalf of
192321936Shselasky*		the endport identified by PortGID by another port within
193321936Shselasky*		the same partition.
194321936Shselasky*
195321936Shselasky* SEE ALSO
196321936Shselasky*	MCM Port, Physical Port, Physical Port Table
197321936Shselasky*/
198321936Shselasky
199321936Shselasky/****f* OpenSM: MCM Port Object/osm_mcm_alias_guid_new
200321936Shselasky* NAME
201321936Shselasky*	osm_mcm_alias_guid_new
202321936Shselasky*
203321936Shselasky* DESCRIPTION
204321936Shselasky*	This function allocates and initializes an mcm alias guid object.
205321936Shselasky*
206321936Shselasky* SYNOPSIS
207321936Shselasky*/
208321936Shselaskyosm_mcm_alias_guid_t *osm_mcm_alias_guid_new(IN osm_mcm_port_t *p_base_mcm_port,
209321936Shselasky					     IN ib_member_rec_t *mcmr,
210321936Shselasky					     IN boolean_t proxy);
211321936Shselasky/*
212321936Shselasky* PARAMETERS
213321936Shselasky*	p_base_mcm_port
214321936Shselasky*		[in] Pointer to the mcm port for this base GUID
215321936Shselasky*
216321936Shselasky*	mcmr
217321936Shselasky*		[in] Pointer to MCMember record of the join request
218321936Shselasky*
219321936Shselasky*	proxy
220321936Shselasky*		[in] proxy_join state analyzed from the request
221321936Shselasky*
222321936Shselasky* RETURN VALUE
223321936Shselasky*	Pointer to the initialized mcm alias guid object.
224321936Shselasky*
225321936Shselasky* NOTES
226321936Shselasky*	Allows calling other mcm alias guid methods.
227321936Shselasky*
228321936Shselasky* SEE ALSO
229321936Shselasky*       MCM Port Object
230321936Shselasky*********/
231321936Shselasky
232321936Shselasky/****f* OpenSM: MCM Port Object/osm_mcm_alias_guid_delete
233321936Shselasky* NAME
234321936Shselasky*	osm_mcm_alias_guid_delete
235321936Shselasky*
236321936Shselasky* DESCRIPTION
237321936Shselasky*	This function destroys and deallocates an mcm alias guid object.
238321936Shselasky*
239321936Shselasky* SYNOPSIS
240321936Shselasky*/
241321936Shselaskyvoid osm_mcm_alias_guid_delete(IN OUT osm_mcm_alias_guid_t ** pp_mcm_alias_guid);
242321936Shselasky/*
243321936Shselasky* PARAMETERS
244321936Shselasky*	pp_mcm_alias_guid
245321936Shselasky*		[in][out] Pointer to a pointer to an mcm alias guid object to
246321936Shselasky*		delete. On return, this pointer is NULL.
247321936Shselasky*
248321936Shselasky* RETURN VALUE
249321936Shselasky*	This function does not return a value.
250321936Shselasky*
251321936Shselasky* NOTES
252321936Shselasky*	Performs any necessary cleanup of the specified mcm alias guid object.
253321936Shselasky*
254321936Shselasky* SEE ALSO
255321936Shselasky*	MCM Port Object
256321936Shselasky*********/
257321936Shselasky
258321936ShselaskyEND_C_DECLS
259321936Shselasky#endif				/* _OSM_MCM_PORT_H_ */
260