1219820Sjeff/*
2219820Sjeff * Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved.
3219820Sjeff * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
4219820Sjeff * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
5219820Sjeff *
6219820Sjeff * This software is available to you under a choice of one of two
7219820Sjeff * licenses.  You may choose to be licensed under the terms of the GNU
8219820Sjeff * General Public License (GPL) Version 2, available from the file
9219820Sjeff * COPYING in the main directory of this source tree, or the
10219820Sjeff * OpenIB.org BSD license below:
11219820Sjeff *
12219820Sjeff *     Redistribution and use in source and binary forms, with or
13219820Sjeff *     without modification, are permitted provided that the following
14219820Sjeff *     conditions are met:
15219820Sjeff *
16219820Sjeff *      - Redistributions of source code must retain the above
17219820Sjeff *        copyright notice, this list of conditions and the following
18219820Sjeff *        disclaimer.
19219820Sjeff *
20219820Sjeff *      - Redistributions in binary form must reproduce the above
21219820Sjeff *        copyright notice, this list of conditions and the following
22219820Sjeff *        disclaimer in the documentation and/or other materials
23219820Sjeff *        provided with the distribution.
24219820Sjeff *
25219820Sjeff * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26219820Sjeff * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27219820Sjeff * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28219820Sjeff * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29219820Sjeff * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30219820Sjeff * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31219820Sjeff * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32219820Sjeff * SOFTWARE.
33219820Sjeff *
34219820Sjeff */
35219820Sjeff
36219820Sjeff/*
37219820Sjeff * Abstract:
38219820Sjeff *    Implementation of osm_sm_t.
39219820Sjeff * This object represents the remote SM object.
40219820Sjeff * This object is part of the opensm family of objects.
41219820Sjeff */
42219820Sjeff
43219820Sjeff#if HAVE_CONFIG_H
44219820Sjeff#  include <config.h>
45219820Sjeff#endif				/* HAVE_CONFIG_H */
46219820Sjeff
47219820Sjeff#include <string.h>
48219820Sjeff#include <opensm/osm_remote_sm.h>
49219820Sjeff
50219820Sjeff/**********************************************************************
51219820Sjeff **********************************************************************/
52219820Sjeffvoid osm_remote_sm_construct(IN osm_remote_sm_t * const p_sm)
53219820Sjeff{
54219820Sjeff	memset(p_sm, 0, sizeof(*p_sm));
55219820Sjeff}
56219820Sjeff
57219820Sjeff/**********************************************************************
58219820Sjeff **********************************************************************/
59219820Sjeffvoid osm_remote_sm_destroy(IN osm_remote_sm_t * const p_sm)
60219820Sjeff{
61219820Sjeff	memset(p_sm, 0, sizeof(*p_sm));
62219820Sjeff}
63219820Sjeff
64219820Sjeff/**********************************************************************
65219820Sjeff **********************************************************************/
66219820Sjeffvoid
67219820Sjeffosm_remote_sm_init(IN osm_remote_sm_t * const p_sm,
68219820Sjeff		   IN const osm_port_t * const p_port,
69219820Sjeff		   IN const ib_sm_info_t * const p_smi)
70219820Sjeff{
71219820Sjeff	CL_ASSERT(p_sm);
72219820Sjeff	CL_ASSERT(p_port);
73219820Sjeff
74219820Sjeff	osm_remote_sm_construct(p_sm);
75219820Sjeff
76219820Sjeff	p_sm->p_port = p_port;
77219820Sjeff	p_sm->smi = *p_smi;
78219820Sjeff	return;
79219820Sjeff}
80