Blame include/opensm/osm_port.h

Packit 13e616
/*
Packit 13e616
 * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
Packit 13e616
 * Copyright (c) 2002-2011 Mellanox Technologies LTD. All rights reserved.
Packit 13e616
 * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
Packit 13e616
 * Copyright (C) 2012-2017 Tokyo Institute of Technology. All rights reserved.
Packit 13e616
 *
Packit 13e616
 * This software is available to you under a choice of one of two
Packit 13e616
 * licenses.  You may choose to be licensed under the terms of the GNU
Packit 13e616
 * General Public License (GPL) Version 2, available from the file
Packit 13e616
 * COPYING in the main directory of this source tree, or the
Packit 13e616
 * OpenIB.org BSD license below:
Packit 13e616
 *
Packit 13e616
 *     Redistribution and use in source and binary forms, with or
Packit 13e616
 *     without modification, are permitted provided that the following
Packit 13e616
 *     conditions are met:
Packit 13e616
 *
Packit 13e616
 *      - Redistributions of source code must retain the above
Packit 13e616
 *        copyright notice, this list of conditions and the following
Packit 13e616
 *        disclaimer.
Packit 13e616
 *
Packit 13e616
 *      - Redistributions in binary form must reproduce the above
Packit 13e616
 *        copyright notice, this list of conditions and the following
Packit 13e616
 *        disclaimer in the documentation and/or other materials
Packit 13e616
 *        provided with the distribution.
Packit 13e616
 *
Packit 13e616
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
Packit 13e616
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Packit 13e616
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Packit 13e616
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
Packit 13e616
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
Packit 13e616
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
Packit 13e616
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
Packit 13e616
 * SOFTWARE.
Packit 13e616
 *
Packit 13e616
 */
Packit 13e616
Packit 13e616
/*
Packit 13e616
 * Abstract:
Packit 13e616
 * 	Declaration of port related objects.
Packit 13e616
 *	These objects comprise an IBA port.
Packit 13e616
 *	These objects are part of the OpenSM family of objects.
Packit 13e616
 */
Packit 13e616
Packit 13e616
#ifndef _OSM_PORT_H_
Packit 13e616
#define _OSM_PORT_H_
Packit 13e616
Packit 13e616
#include <complib/cl_qmap.h>
Packit 13e616
#include <iba/ib_types.h>
Packit 13e616
#include <opensm/osm_base.h>
Packit 13e616
#include <opensm/osm_subnet.h>
Packit 13e616
#include <opensm/osm_madw.h>
Packit 13e616
#include <opensm/osm_path.h>
Packit 13e616
#include <opensm/osm_pkey.h>
Packit 13e616
Packit 13e616
#ifdef __cplusplus
Packit 13e616
#  define BEGIN_C_DECLS extern "C" {
Packit 13e616
#  define END_C_DECLS   }
Packit 13e616
#else				/* !__cplusplus */
Packit 13e616
#  define BEGIN_C_DECLS
Packit 13e616
#  define END_C_DECLS
Packit 13e616
#endif				/* __cplusplus */
Packit 13e616
Packit 13e616
BEGIN_C_DECLS
Packit 13e616
/*
Packit 13e616
	Forward references.
Packit 13e616
*/
Packit 13e616
struct osm_port;
Packit 13e616
struct osm_node;
Packit 13e616
struct osm_mgrp;
Packit 13e616
struct osm_sm;
Packit 13e616
Packit 13e616
/****h* OpenSM/Physical Port
Packit 13e616
* NAME
Packit 13e616
*	Physical Port
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	The Physical Port object encapsulates the information needed by the
Packit 13e616
*	OpenSM to manage physical ports.  The OpenSM allocates one Physical Port
Packit 13e616
*	per physical port in the IBA subnet.
Packit 13e616
*
Packit 13e616
*	In a switch, one multiple Physical Port objects share the same port GUID.
Packit 13e616
*	In an end-point, Physical Ports do not share GUID values.
Packit 13e616
*
Packit 13e616
*	The Physical Port is not thread safe, thus callers must provide
Packit 13e616
*	serialization.
Packit 13e616
*
Packit 13e616
*	These objects should be treated as opaque and should be
Packit 13e616
*	manipulated only through the provided functions.
Packit 13e616
*
Packit 13e616
* AUTHOR
Packit 13e616
*	Steve King, Intel
Packit 13e616
*
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****s* OpenSM: Physical Port/osm_physp_t
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_t
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This object represents a physical port on a switch, router or end-point.
Packit 13e616
*
Packit 13e616
*	The osm_physp_t object should be treated as opaque and should
Packit 13e616
*	be manipulated only through the provided functions.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
typedef struct osm_physp {
Packit 13e616
	ib_port_info_t port_info;
Packit 13e616
	ib_mlnx_ext_port_info_t ext_port_info;
Packit 13e616
	ib_net64_t port_guid;
Packit 13e616
	ib_net64_t (*p_guids)[];
Packit 13e616
	uint8_t port_num;
Packit 13e616
	struct osm_node *p_node;
Packit 13e616
	struct osm_physp *p_remote_physp;
Packit 13e616
	boolean_t healthy;
Packit 13e616
	uint8_t vl_high_limit;
Packit 13e616
	unsigned need_update;
Packit 13e616
	unsigned is_prof_ignored;
Packit 13e616
	osm_dr_path_t dr_path;
Packit 13e616
	osm_pkey_tbl_t pkeys;
Packit 13e616
	ib_vl_arb_table_t vl_arb[4];
Packit 13e616
	cl_ptr_vector_t slvl_by_port;
Packit 13e616
	uint8_t hop_wf;
Packit 13e616
	union {
Packit 13e616
		struct {
Packit 13e616
			ib_sw_cong_setting_t sw_cong_setting;
Packit 13e616
		} sw;
Packit 13e616
		struct {
Packit 13e616
			ib_ca_cong_setting_t ca_cong_setting;
Packit 13e616
			ib_cc_tbl_t cc_tbl[OSM_CCT_ENTRY_MAD_BLOCKS];
Packit 13e616
		} ca;
Packit 13e616
	} cc;
Packit 13e616
} osm_physp_t;
Packit 13e616
/*
Packit 13e616
* FIELDS
Packit 13e616
*	port_info
Packit 13e616
*		The IBA defined PortInfo data for this port.
Packit 13e616
*
Packit 13e616
*	ext_port_info
Packit 13e616
*		Mellanox vendor specific ExtendedPortInfo data for this port.
Packit 13e616
*
Packit 13e616
*	port_guid
Packit 13e616
*		Port GUID value of this port.  For switches,
Packit 13e616
*		all ports share the same GUID value.
Packit 13e616
*
Packit 13e616
*	p_guids
Packit 13e616
*		Pointer to array of GUIDs obtained from GUIDInfo.
Packit 13e616
*		This pointer is null for switch physical/external ports
Packit 13e616
*		(used for endports only).
Packit 13e616
*
Packit 13e616
*	port_num
Packit 13e616
*		The port number of this port.  The PortInfo also
Packit 13e616
*		contains a port_number, but that number is not
Packit 13e616
*		the port number of this port, but rather the number
Packit 13e616
*		of the port that received the SMP during discovery.
Packit 13e616
*		Therefore, we must keep a separate record for this
Packit 13e616
*		port's port number.
Packit 13e616
*
Packit 13e616
*	p_node
Packit 13e616
*		Pointer to the parent Node object of this Physical Port.
Packit 13e616
*
Packit 13e616
*	p_remote_physp
Packit 13e616
*		Pointer to the Physical Port on the other side of the wire.
Packit 13e616
*		If this pointer is NULL no link exists at this port.
Packit 13e616
*
Packit 13e616
*	healthy
Packit 13e616
*		Tracks the health of the port. Normally should be TRUE but
Packit 13e616
*		might change as a result of incoming traps indicating the port
Packit 13e616
*		healthy is questionable.
Packit 13e616
*
Packit 13e616
*	vl_high_limit
Packit 13e616
*		PortInfo:VLHighLimit value which installed by QoS manager
Packit 13e616
*		and should be uploaded to port's PortInfo
Packit 13e616
*
Packit 13e616
*	need_update
Packit 13e616
*		When set indicates that port was probably reset and port
Packit 13e616
*		related tables (PKey, SL2VL, VLArb) require refreshing.
Packit 13e616
*
Packit 13e616
*	is_prof_ignored
Packit 13e616
*		When set indicates that switch port will be ignored by
Packit 13e616
*		the link load equalization algorithm.
Packit 13e616
*
Packit 13e616
*	dr_path
Packit 13e616
*		The directed route path to this port.
Packit 13e616
*
Packit 13e616
*	pkeys
Packit 13e616
*		osm_pkey_tbl_t object holding the port PKeys.
Packit 13e616
*
Packit 13e616
*	vl_arb[]
Packit 13e616
*		Each Physical Port has 4 sections of VL Arbitration table.
Packit 13e616
*
Packit 13e616
*	slvl_by_port
Packit 13e616
*		A vector of pointers to the sl2vl tables (ordered by input port).
Packit 13e616
*		Switches have an entry for every other input port (inc SMA=0).
Packit 13e616
*		On CAs only one per port.
Packit 13e616
*
Packit 13e616
*	hop_wf
Packit 13e616
*		Hop weighting factor to be used in the routing.
Packit 13e616
*
Packit 13e616
*	sw_cong_setting
Packit 13e616
*		Physical port switch congestion settings (switches only)
Packit 13e616
*
Packit 13e616
*	ca_cong_setting
Packit 13e616
*		Physical port ca congestion settings (cas only)
Packit 13e616
*
Packit 13e616
*	cc_tbl
Packit 13e616
*		Physical port ca congestion control table (cas only)
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_construct
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_construct
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Constructs a Physical Port.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void osm_physp_construct(IN osm_physp_t * p_physp);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object to initialize.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	This function does not return a value.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_init
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_init
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Initializes a Physical Port for use.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void osm_physp_init(IN osm_physp_t * p_physp, IN ib_net64_t port_guid,
Packit 13e616
		    IN uint8_t port_num, IN const struct osm_node *p_node,
Packit 13e616
		    IN osm_bind_handle_t h_bind, IN uint8_t hop_count,
Packit 13e616
		    IN const uint8_t * p_initial_path);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object to initialize.
Packit 13e616
*
Packit 13e616
*	port_guid
Packit 13e616
*		[in] GUID value of this port.  Switch ports all share
Packit 13e616
*		the same value.
Packit 13e616
*		Caller should use 0 if the guid is unknown.
Packit 13e616
*
Packit 13e616
*	port_num
Packit 13e616
*		[in] The port number of this port.
Packit 13e616
*
Packit 13e616
*	p_node
Packit 13e616
*		[in] Pointer to the parent Node object of this Physical Port.
Packit 13e616
*
Packit 13e616
*	h_bind
Packit 13e616
*		[in] Bind handle on which this port is accessed.
Packit 13e616
*		Caller should use OSM_BIND_INVALID_HANDLE if the bind
Packit 13e616
*		handle to this port is unknown.
Packit 13e616
*
Packit 13e616
*	hop_count
Packit 13e616
*		[in] Directed route hop count to reach this port.
Packit 13e616
*		Caller should use 0 if the hop count is unknown.
Packit 13e616
*
Packit 13e616
*	p_initial_path
Packit 13e616
*		[in] Pointer to the directed route path to reach this node.
Packit 13e616
*		Caller should use NULL if the path is unknown.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	This function does not return a value.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Port/void osm_physp_destroy
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_destroy
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This function destroys a Port object.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void osm_physp_destroy(IN osm_physp_t * p_physp);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_port
Packit 13e616
*		[in] Pointer to a PhysPort object to destroy.
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*	This function does not return a value.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*	Performs any necessary cleanup of the specified PhysPort object.
Packit 13e616
*	Further operations should not be attempted on the destroyed object.
Packit 13e616
*	This function should only be called after a call to osm_physp_construct or
Packit 13e616
*	osm_physp_init.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_is_valid
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_is_valid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns TRUE if the Physical Port has been successfully initialized.
Packit 13e616
*	FALSE otherwise.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline boolean_t osm_physp_is_valid(IN const osm_physp_t * p_physp)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_physp);
Packit 13e616
	return (p_physp->port_guid != 0);
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns TRUE if the Physical Port has been successfully initialized.
Packit 13e616
*	FALSE otherwise.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_is_healthy
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_is_healthy
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns TRUE if the Physical Port has been maked as healthy
Packit 13e616
*	FALSE otherwise.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline boolean_t osm_physp_is_healthy(IN const osm_physp_t * p_physp)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_physp);
Packit 13e616
	return p_physp->healthy;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns TRUE if the Physical Port has been maked as healthy
Packit 13e616
*	FALSE otherwise.
Packit 13e616
*  All physical ports are initialized as "healthy" but may be marked
Packit 13e616
*  otherwise if a received trap claims otherwise.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_link_is_healthy
Packit 13e616
* NAME
Packit 13e616
*	osm_link_is_healthy
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns TRUE if the link given by the physical port is health,
Packit 13e616
*  and FALSE otherwise. Link is healthy if both its physical ports are
Packit 13e616
*  healthy
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
boolean_t osm_link_is_healthy(IN const osm_physp_t * p_physp);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	TRUE if both physical ports on the link are healthy, and FALSE otherwise.
Packit 13e616
*  All physical ports are initialized as "healthy" but may be marked
Packit 13e616
*  otherwise if a received trap claiming otherwise.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_set_health
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_set_health
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Sets the port health flag. TRUE means the port is healthy and
Packit 13e616
*  should be used for packet routing. FALSE means it should be avoided.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline void osm_physp_set_health(IN osm_physp_t * p_physp,
Packit 13e616
					IN boolean_t is_healthy)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_physp);
Packit 13e616
	p_physp->healthy = is_healthy;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
*	is_healthy
Packit 13e616
*		[in] The health value to be assigned to the port.
Packit 13e616
*		     TRUE if the Physical Port should been maked as healthy
Packit 13e616
*		     FALSE otherwise.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*  NONE
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_link_is_throttled
Packit 13e616
* NAME
Packit 13e616
*	osm_link_is_throttled
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns TRUE if the link speed/width given by the physical port is
Packit 13e616
*	below the theoretical maximum enabled by both ports, and FALSE
Packit 13e616
*	otherwise.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
boolean_t osm_link_is_throttled(IN osm_physp_t * p_physp,
Packit 13e616
				IN const boolean_t subn_has_fdr10_enabled);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
*	subn_has_fdr10_enabled
Packit 13e616
*		[in] TRUE if FDR10 is enabled for subnet, or FALSE otherwise.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	FALSE if both directions of the link have active link speed/width equal
Packit 13e616
*	to the common maximum which both sides have enabled, and TRUE otherwise.
Packit 13e616
*	The return value is independent of whether or not the link was
Packit 13e616
*	throttled intentionally by the admin or throttled automatically by the
Packit 13e616
*	link auto-negotiation.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_set_port_info
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_set_port_info
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Copies the PortInfo attribute into the Physical Port object
Packit 13e616
*	based on the PortState.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void osm_physp_set_port_info(IN osm_physp_t * p_physp,
Packit 13e616
					   IN const ib_port_info_t * p_pi,
Packit 13e616
					   IN const struct osm_sm * p_sm);
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
*	p_pi
Packit 13e616
*		[in] Pointer to the IBA defined PortInfo at this port number.
Packit 13e616
*
Packit 13e616
*	p_sm
Packit 13e616
*		[in] Pointer to an osm_sm_t object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	This function does not return a value.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_set_base_lid
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_set_base_lid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Sets the base lid for this Physical Port.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline void osm_physp_set_base_lid(IN osm_physp_t * p_physp,
Packit 13e616
					  IN ib_net16_t base_lid)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_physp);
Packit 13e616
	CL_ASSERT(osm_physp_is_valid(p_physp));
Packit 13e616
	p_physp->port_info.base_lid = base_lid;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
*	base_lid
Packit 13e616
*		[in] Lid to set.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_set_pkey_tbl
Packit 13e616
* NAME
Packit 13e616
*  osm_physp_set_pkey_tbl
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*  Copies the P_Key table into the Physical Port object.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void osm_physp_set_pkey_tbl(IN osm_log_t * p_log, IN const osm_subn_t * p_subn,
Packit 13e616
			    IN osm_physp_t * p_physp,
Packit 13e616
			    IN ib_pkey_table_t * p_pkey_tbl,
Packit 13e616
			    IN uint16_t block_num,
Packit 13e616
			    IN boolean_t is_set);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_log
Packit 13e616
*		[in] Pointer to a log object.
Packit 13e616
*
Packit 13e616
*	p_subn
Packit 13e616
*		[in] Pointer to the subnet data structure.
Packit 13e616
*
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
*	p_pkey_tbl
Packit 13e616
*		[in] Pointer to the IBA defined P_Key table for this port
Packit 13e616
*		     number.
Packit 13e616
*
Packit 13e616
*	block_num
Packit 13e616
*		[in] The part of the P_Key table as defined in the IBA
Packit 13e616
*		     (valid values 0-2047, and is further limited by the
Packit 13e616
*		     partitionCap).
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*  This function does not return a value.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*  Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_get_pkey_tbl
Packit 13e616
* NAME
Packit 13e616
*  osm_physp_get_pkey_tbl
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*  Returns a pointer to the P_Key table object of the Physical Port object.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline const osm_pkey_tbl_t *osm_physp_get_pkey_tbl(IN const osm_physp_t
Packit 13e616
							   * p_physp)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(osm_physp_is_valid(p_physp));
Packit 13e616
	/*
Packit 13e616
	   (14.2.5.7) - the block number valid values are 0-2047, and are
Packit 13e616
	   further limited by the size of the P_Key table specified by the
Packit 13e616
	   PartitionCap on the node.
Packit 13e616
	 */
Packit 13e616
	return &p_physp->pkeys;
Packit 13e616
};
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*  The pointer to the P_Key table object.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*  Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_set_slvl_tbl
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_set_slvl_tbl
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Copies the SLtoVL attribute into the Physical Port object.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline void osm_physp_set_slvl_tbl(IN osm_physp_t * p_physp,
Packit 13e616
					  IN ib_slvl_table_t * p_slvl_tbl,
Packit 13e616
					  IN uint8_t in_port_num)
Packit 13e616
{
Packit 13e616
	ib_slvl_table_t *p_tbl;
Packit 13e616
Packit 13e616
	CL_ASSERT(p_slvl_tbl);
Packit 13e616
	CL_ASSERT(osm_physp_is_valid(p_physp));
Packit 13e616
	p_tbl = (ib_slvl_table_t *)cl_ptr_vector_get(&p_physp->slvl_by_port, in_port_num);
Packit 13e616
	*p_tbl = *p_slvl_tbl;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
*	p_slvl_tbl
Packit 13e616
*		[in] Pointer to the IBA defined SLtoVL map table for this
Packit 13e616
*		     port number.
Packit 13e616
*
Packit 13e616
*	in_port_num
Packit 13e616
*		[in] Input Port Number for this SLtoVL.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	This function does not return a value.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_get_slvl_tbl
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_get_slvl_tbl
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns a pointer to the SLtoVL attribute of the Physical Port object.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline ib_slvl_table_t *osm_physp_get_slvl_tbl(IN const osm_physp_t *
Packit 13e616
						      p_physp,
Packit 13e616
						      IN uint8_t in_port_num)
Packit 13e616
{
Packit 13e616
	ib_slvl_table_t *p_tbl;
Packit 13e616
Packit 13e616
	CL_ASSERT(osm_physp_is_valid(p_physp));
Packit 13e616
	p_tbl = (ib_slvl_table_t *)cl_ptr_vector_get(&p_physp->slvl_by_port, in_port_num);
Packit 13e616
	return p_tbl;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
*	in_port_num
Packit 13e616
*		[in] Input Port Number for this SLtoVL.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	The pointer to the slvl table
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_set_vla_tbl
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_set_vla_tbl
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Copies the VL Arbitration attribute into the Physical Port object.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline void osm_physp_set_vla_tbl(IN osm_physp_t * p_physp,
Packit 13e616
					 IN ib_vl_arb_table_t * p_vla_tbl,
Packit 13e616
					 IN uint8_t block_num)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_vla_tbl);
Packit 13e616
	CL_ASSERT(osm_physp_is_valid(p_physp));
Packit 13e616
	CL_ASSERT((1 <= block_num) && (block_num <= 4));
Packit 13e616
	p_physp->vl_arb[block_num - 1] = *p_vla_tbl;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
*	p_vla_tbl
Packit 13e616
*		[in] Pointer to the IBA defined VL Arbitration table for this
Packit 13e616
*		     port number.
Packit 13e616
*
Packit 13e616
*	block_num
Packit 13e616
*		[in] The part of the VL arbitration as defined in the IBA
Packit 13e616
*		     (valid values 1-4)
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	This function does not return a value.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_get_vla_tbl
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_get_vla_tbl
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns a pointer to the VL Arbitration table of the Physical Port object.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline ib_vl_arb_table_t *osm_physp_get_vla_tbl(IN osm_physp_t * p_physp,
Packit 13e616
						       IN uint8_t block_num)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(osm_physp_is_valid(p_physp));
Packit 13e616
	CL_ASSERT((1 <= block_num) && (block_num <= 4));
Packit 13e616
	return &(p_physp->vl_arb[block_num - 1]);
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
*	block_num
Packit 13e616
*		[in] The part of the VL arbitration as defined in the IBA
Packit 13e616
*		     (valid values 1-4)
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*  The pointer to the VL Arbitration table
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_get_remote
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_get_remote
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns a pointer to the Physical Port on the other side the wire.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline osm_physp_t *osm_physp_get_remote(IN const osm_physp_t * p_physp)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(osm_physp_is_valid(p_physp));
Packit 13e616
	return p_physp->p_remote_physp;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns a pointer to the Physical Port on the other side of
Packit 13e616
*	the wire.  A return value of NULL means there is no link at this port.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_get_port_guid
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_get_port_guid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns the port guid of this physical port.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline ib_net64_t osm_physp_get_port_guid(IN const osm_physp_t * p_physp)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(osm_physp_is_valid(p_physp));
Packit 13e616
	return p_physp->port_guid;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns the port guid of this physical port.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_get_subnet_prefix
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_get_subnet_prefix
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns the subnet prefix for this physical port.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline ib_net64_t
Packit 13e616
osm_physp_get_subnet_prefix(IN const osm_physp_t * p_physp)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(osm_physp_is_valid(p_physp));
Packit 13e616
	return p_physp->port_info.subnet_prefix;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns the subnet prefix for this physical port.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_link_exists
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_link_exists
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns TRUE if the Physical Port has a link to the specified port.
Packit 13e616
*	FALSE otherwise.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline boolean_t osm_physp_link_exists(IN const osm_physp_t * p_physp,
Packit 13e616
					      IN const osm_physp_t * p_remote_physp)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_physp);
Packit 13e616
	CL_ASSERT(osm_physp_is_valid(p_physp));
Packit 13e616
	CL_ASSERT(p_remote_physp);
Packit 13e616
	CL_ASSERT(osm_physp_is_valid(p_remote_physp));
Packit 13e616
	return ((p_physp->p_remote_physp == p_remote_physp) &&
Packit 13e616
		(p_remote_physp->p_remote_physp == p_physp));
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
*	p_remote_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns TRUE if the Physical Port has a link to another port.
Packit 13e616
*	FALSE otherwise.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_link
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_link
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Sets the pointers to the Physical Ports on the other side the wire.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline void osm_physp_link(IN osm_physp_t * p_physp,
Packit 13e616
				  IN osm_physp_t * p_remote_physp)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_physp);
Packit 13e616
	CL_ASSERT(p_remote_physp);
Packit 13e616
	p_physp->p_remote_physp = p_remote_physp;
Packit 13e616
	p_remote_physp->p_remote_physp = p_physp;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object to link.
Packit 13e616
*
Packit 13e616
*	p_remote_physp
Packit 13e616
*		[in] Pointer to the adjacent osm_physp_t object to link.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	None.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_unlink
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_unlink
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Clears the pointers to the Physical Port on the other side the wire.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline void osm_physp_unlink(IN osm_physp_t * p_physp,
Packit 13e616
				    IN osm_physp_t * p_remote_physp)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_physp);
Packit 13e616
	CL_ASSERT(p_remote_physp);
Packit 13e616
	CL_ASSERT(osm_physp_link_exists(p_physp, p_remote_physp));
Packit 13e616
	p_physp->p_remote_physp = NULL;
Packit 13e616
	p_remote_physp->p_remote_physp = NULL;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object to link.
Packit 13e616
*
Packit 13e616
*	p_remote_physp
Packit 13e616
*		[in] Pointer to the adjacent osm_physp_t object to link.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	None.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_has_any_link
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_has_any_link
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns TRUE if the Physical Port has a link to another port.
Packit 13e616
*	FALSE otherwise.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline boolean_t osm_physp_has_any_link(IN const osm_physp_t * p_physp)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_physp);
Packit 13e616
	if (osm_physp_is_valid(p_physp))
Packit 13e616
		return (p_physp->p_remote_physp != NULL);
Packit 13e616
	else
Packit 13e616
		return FALSE;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns TRUE if the Physical Port has a link to another port.
Packit 13e616
*	FALSE otherwise.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_get_port_num
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_get_port_num
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns the local port number of this Physical Port.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline uint8_t osm_physp_get_port_num(IN const osm_physp_t * p_physp)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_physp);
Packit 13e616
	CL_ASSERT(osm_physp_is_valid(p_physp));
Packit 13e616
	return p_physp->port_num;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns the local port number of this Physical Port.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_get_node_ptr
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_get_node_ptr
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns a pointer to the parent Node object for this port.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline struct osm_node *osm_physp_get_node_ptr(IN const osm_physp_t *
Packit 13e616
						       p_physp)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_physp);
Packit 13e616
	CL_ASSERT(osm_physp_is_valid(p_physp));
Packit 13e616
	return p_physp->p_node;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns a pointer to the parent Node object for this port.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_get_port_state
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_get_port_state
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns the port state of this Physical Port.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline uint8_t osm_physp_get_port_state(IN const osm_physp_t * p_physp)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_physp);
Packit 13e616
	CL_ASSERT(osm_physp_is_valid(p_physp));
Packit 13e616
	return ib_port_info_get_port_state(&p_physp->port_info);
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns the local port number of this Physical Port.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_get_base_lid
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_get_base_lid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns the base lid of this Physical Port.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline ib_net16_t osm_physp_get_base_lid(IN const osm_physp_t * p_physp)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_physp);
Packit 13e616
	CL_ASSERT(osm_physp_is_valid(p_physp));
Packit 13e616
	return p_physp->port_info.base_lid;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns the base lid of this Physical Port.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_get_lmc
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_get_lmc
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns the LMC value of this Physical Port.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline uint8_t osm_physp_get_lmc(IN const osm_physp_t * p_physp)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_physp);
Packit 13e616
	CL_ASSERT(osm_physp_is_valid(p_physp));
Packit 13e616
	return ib_port_info_get_lmc(&p_physp->port_info);
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns the LMC value of this Physical Port.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_get_dr_path_ptr
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_get_dr_path_ptr
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns a pointer to the directed route path for this port.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline osm_dr_path_t *osm_physp_get_dr_path_ptr(IN const osm_physp_t *
Packit 13e616
							p_physp)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_physp);
Packit 13e616
	CL_ASSERT(osm_physp_is_valid(p_physp));
Packit 13e616
	return (osm_dr_path_t *) & p_physp->dr_path;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to a Physical Port object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns a pointer to the directed route path for this port.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Physical Port object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****h* OpenSM/Port
Packit 13e616
* NAME
Packit 13e616
*	Port
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	The Port object encapsulates the information needed by the
Packit 13e616
*	OpenSM to manage ports.  The OpenSM allocates one Port object
Packit 13e616
*	per port in the IBA subnet.
Packit 13e616
*
Packit 13e616
*	Each Port object is associated with a single port GUID.  A Port object
Packit 13e616
*	contains 1 or more Physical Port objects.  An end point node has
Packit 13e616
*	one Physical Port per Port.  A switch node has more than
Packit 13e616
*	one Physical Port per Port.
Packit 13e616
*
Packit 13e616
*	The Port object is not thread safe, thus callers must provide
Packit 13e616
*	serialization.
Packit 13e616
*
Packit 13e616
*	These objects should be treated as opaque and should be
Packit 13e616
*	manipulated only through the provided functions.
Packit 13e616
*
Packit 13e616
* AUTHOR
Packit 13e616
*	Steve King, Intel
Packit 13e616
*
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****s* OpenSM: Port/osm_port_t
Packit 13e616
* NAME
Packit 13e616
*	osm_port_t
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This object represents a logical port on a switch, router, or CA.
Packit 13e616
*
Packit 13e616
*	The osm_port_t object should be treated as opaque and should
Packit 13e616
*	be manipulated only through the provided functions.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
typedef struct osm_port {
Packit 13e616
	cl_map_item_t map_item;
Packit 13e616
	cl_list_item_t list_item;
Packit 13e616
	struct osm_node *p_node;
Packit 13e616
	ib_net64_t guid;
Packit 13e616
	uint32_t discovery_count;
Packit 13e616
	unsigned is_new;
Packit 13e616
	osm_physp_t *p_physp;
Packit 13e616
	cl_qlist_t mcm_list;
Packit 13e616
	int flag;
Packit 13e616
	int use_scatter;
Packit 13e616
	unsigned int cc_timeout_count;
Packit 13e616
	int cc_unavailable_flag;
Packit 13e616
	void *priv;
Packit 13e616
	ib_net16_t lid;
Packit 13e616
} osm_port_t;
Packit 13e616
/*
Packit 13e616
* FIELDS
Packit 13e616
*	map_item
Packit 13e616
*		Linkage structure for cl_qmap.  MUST BE FIRST MEMBER!
Packit 13e616
*
Packit 13e616
*	list_item
Packit 13e616
*		Linkage structure for cl_qlist. Used by ucast mgr during
Packit 13e616
*		LFT calculation.
Packit 13e616
*
Packit 13e616
*	p_node
Packit 13e616
*		Points to the Node object that owns this port.
Packit 13e616
*
Packit 13e616
*	guid
Packit 13e616
*		Manufacturer assigned GUID for this port.
Packit 13e616
*
Packit 13e616
*	discovery_count
Packit 13e616
*		The number of times this port has been discovered
Packit 13e616
*		during the current fabric sweep.  This number is reset
Packit 13e616
*		to zero at the start of a sweep.
Packit 13e616
*
Packit 13e616
*	p_physp
Packit 13e616
*		The pointer to physical port used when physical
Packit 13e616
*		characteristics contained in the Physical Port are needed.
Packit 13e616
*
Packit 13e616
*	mcm_list
Packit 13e616
*		Multicast member list
Packit 13e616
*
Packit 13e616
*	flag
Packit 13e616
*		Utility flag for port management
Packit 13e616
*
Packit 13e616
*	cc_timeout_count
Packit 13e616
*		Count number of times congestion control config times out.
Packit 13e616
*
Packit 13e616
*	cc_unavailable_flag
Packit 13e616
*		Flag indicating if congestion control is not supported.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port, Physical Port Table
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Port/osm_port_delete
Packit 13e616
* NAME
Packit 13e616
*	osm_port_delete
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This function destroys and deallocates a Port object.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void osm_port_delete(IN OUT osm_port_t ** pp_port);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	pp_port
Packit 13e616
*		[in][out] Pointer to a pointer to a Port object to delete.
Packit 13e616
*		On return, this pointer is NULL.
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*	This function does not return a value.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*	Performs any necessary cleanup of the specified Port object.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Port/osm_port_new
Packit 13e616
* NAME
Packit 13e616
*	osm_port_new
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This function allocates and initializes a Port object.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
osm_port_t *osm_port_new(IN const ib_node_info_t * p_ni,
Packit 13e616
			 IN struct osm_node *p_parent_node);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_ni
Packit 13e616
*		[in] Pointer to the NodeInfo attribute relevant for this port.
Packit 13e616
*
Packit 13e616
*	p_parent_node
Packit 13e616
*		[in] Pointer to the initialized parent osm_node_t object
Packit 13e616
*		that owns this port.
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*	Pointer to the initialize Port object.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*	Allows calling other port methods.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Port/osm_port_get_base_lid
Packit 13e616
* NAME
Packit 13e616
*	osm_port_get_base_lid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Gets the base LID of a port.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline ib_net16_t osm_port_get_base_lid(IN const osm_port_t * p_port)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_port->p_physp && osm_physp_is_valid(p_port->p_physp));
Packit 13e616
	return osm_physp_get_base_lid(p_port->p_physp);
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_port
Packit 13e616
*		[in] Pointer to a Port object.
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*	Base LID of the port.
Packit 13e616
*	If the return value is 0, then this port has no assigned LID.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Port/osm_port_get_lmc
Packit 13e616
* NAME
Packit 13e616
*	osm_port_get_lmc
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Gets the LMC value of a port.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline uint8_t osm_port_get_lmc(IN const osm_port_t * p_port)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_port->p_physp && osm_physp_is_valid(p_port->p_physp));
Packit 13e616
	return osm_physp_get_lmc(p_port->p_physp);
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_port
Packit 13e616
*		[in] Pointer to a Port object.
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*	Gets the LMC value of a port.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Port/osm_port_get_guid
Packit 13e616
* NAME
Packit 13e616
*	osm_port_get_guid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Gets the GUID of a port.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline ib_net64_t osm_port_get_guid(IN const osm_port_t * p_port)
Packit 13e616
{
Packit 13e616
	return p_port->guid;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_port
Packit 13e616
*		[in] Pointer to a Port object.
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*	Manufacturer assigned GUID of the port.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Port/osm_port_get_lid_range_ho
Packit 13e616
* NAME
Packit 13e616
*	osm_port_get_lid_range_ho
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns the HOST ORDER lid min and max values for this port,
Packit 13e616
*	based on the lmc value.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void osm_port_get_lid_range_ho(IN const osm_port_t * p_port,
Packit 13e616
			       OUT uint16_t * p_min_lid,
Packit 13e616
			       OUT uint16_t * p_max_lid);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_port
Packit 13e616
*		[in] Pointer to a Port object.
Packit 13e616
*
Packit 13e616
*	p_min_lid
Packit 13e616
*		[out] Pointer to the minimum LID value occupied by this port.
Packit 13e616
*
Packit 13e616
*	p_max_lid
Packit 13e616
*		[out] Pointer to the maximum LID value occupied by this port.
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*	None.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_calc_link_mtu
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_calc_link_mtu
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Calculate the Port MTU based on current and remote
Packit 13e616
*  physical ports MTU CAP values.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
uint8_t osm_physp_calc_link_mtu(IN osm_log_t * p_log,
Packit 13e616
				IN const osm_physp_t * p_physp,
Packit 13e616
				IN uint8_t current_mtu);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_log
Packit 13e616
*		[in] Pointer to a log object.
Packit 13e616
*
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
*	current_mtu
Packit 13e616
*		[in] Current neighbor mtu on this port
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	The MTU of the link to be used.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	PhysPort object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_calc_link_op_vls
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_calc_link_op_vls
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Calculate the Port OP_VLS based on current and remote
Packit 13e616
*  physical ports VL CAP values. Allowing user option for a max limit.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
uint8_t osm_physp_calc_link_op_vls(IN osm_log_t * p_log,
Packit 13e616
				   IN const osm_subn_t * p_subn,
Packit 13e616
				   IN const osm_physp_t * p_physp,
Packit 13e616
				   IN uint8_t current_op_vls);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_log
Packit 13e616
*		[in] Pointer to a log object.
Packit 13e616
*
Packit 13e616
*	p_subn
Packit 13e616
*		[in] Pointer to the subnet object for accessing of the options.
Packit 13e616
*
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
*	current_op_vls
Packit 13e616
*		[in] Current operational VL on the port
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	The OP_VLS of the link to be used.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*  PhysPort object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Physical Port/osm_physp_replace_dr_path_with_alternate_dr_path
Packit 13e616
* NAME
Packit 13e616
*	osm_physp_replace_dr_path_with_alternate_dr_path
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Replace the direct route path for the given phys port with an
Packit 13e616
*  alternate path going through forien set of phys port.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void
Packit 13e616
osm_physp_replace_dr_path_with_alternate_dr_path(IN osm_log_t * p_log,
Packit 13e616
						 IN osm_subn_t const *p_subn,
Packit 13e616
						 IN osm_physp_t const *p_physp,
Packit 13e616
						 IN osm_bind_handle_t * h_bind);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_log
Packit 13e616
*		[in] Pointer to a log object.
Packit 13e616
*
Packit 13e616
*	p_subn
Packit 13e616
*		[in] Pointer to the subnet object for accessing of the options.
Packit 13e616
*
Packit 13e616
*	p_physp
Packit 13e616
*		[in] Pointer to an osm_physp_t object.
Packit 13e616
*
Packit 13e616
*	h_bind
Packit 13e616
*		[in] Pointer to osm_bind_handle_t object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	NONE
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	PhysPort object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****s* OpenSM: Port/osm_alias_guid_t
Packit 13e616
* NAME
Packit 13e616
*	osm_alias_guid_t
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This object represents an alias guid for an endport.
Packit 13e616
*
Packit 13e616
*	The osm_alias_guid_t object should be treated as opaque and should
Packit 13e616
*	be manipulated only through the provided functions.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
typedef struct osm_alias_guid {
Packit 13e616
	cl_map_item_t map_item;
Packit 13e616
	ib_net64_t alias_guid;
Packit 13e616
	osm_port_t *p_base_port;
Packit 13e616
} osm_alias_guid_t;
Packit 13e616
/*
Packit 13e616
* FIELDS
Packit 13e616
*	map_item
Packit 13e616
*		Linkage structure for cl_qmap.  MUST BE FIRST MEMBER!
Packit 13e616
*
Packit 13e616
*	alias_guid
Packit 13e616
*		Alias GUID for port obtained from SM GUIDInfo attribute
Packit 13e616
*
Packit 13e616
*	p_base_port
Packit 13e616
*		Pointer to osm_port_t for base port GUID
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port, Physical Port, Physical Port Table
Packit 13e616
*/
Packit 13e616
Packit 13e616
/****f* OpenSM: Port/osm_alias_guid_new
Packit 13e616
* NAME
Packit 13e616
*	osm_alias_guid_new
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This function allocates and initializes an alias guid object.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
osm_alias_guid_t *osm_alias_guid_new(IN const ib_net64_t alias_guid,
Packit 13e616
				     IN osm_port_t *p_base_port);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	alias_guid
Packit 13e616
*		[in] Alias GUID in network order
Packit 13e616
*
Packit 13e616
*	p_base_port
Packit 13e616
*		[in] Pointer to the port for this base GUID
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*	Pointer to the initialized alias guid object.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*	Allows calling other alias guid methods.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Port/osm_alias_guid_delete
Packit 13e616
* NAME
Packit 13e616
*	osm_alias_guid_delete
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This function destroys and deallocates an alias guid object.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void osm_alias_guid_delete(IN OUT osm_alias_guid_t ** pp_alias_guid);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	pp_alias_guid
Packit 13e616
*		[in][out] Pointer to a pointer to an alias guid object to delete.
Packit 13e616
*		On return, this pointer is NULL.
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*	This function does not return a value.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*	Performs any necessary cleanup of the specified alias guid object.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Port/osm_alias_guid_get_alias_guid
Packit 13e616
* NAME
Packit 13e616
*	osm_alias_guid_get_alias_guid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This function retrieves alias guid from alias guid object.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline ib_net64_t osm_alias_guid_get_alias_guid(IN osm_alias_guid_t *p_alias_guid)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_alias_guid);
Packit 13e616
	return p_alias_guid->alias_guid;
Packit 13e616
}
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_alias_guid
Packit 13e616
*		[in] Pointer to a pointer to an alias guid object.
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*	This function returns the alias guid or NULL if fails.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Port/osm_alias_guid_get_base_guid
Packit 13e616
* NAME
Packit 13e616
*	osm_alias_guid_get_base_guid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This function retrieves base guid from alias guid object.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline ib_net64_t osm_alias_guid_get_base_guid(IN osm_alias_guid_t *p_alias_guid)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_alias_guid);
Packit 13e616
	return osm_port_get_guid(p_alias_guid->p_base_port);
Packit 13e616
}
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_alias_guid
Packit 13e616
*		[in] Pointer to a pointer to an alias guid object.
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*	This function returns the base guid or NULL if fails.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Port/osm_port_clear_base_lid
Packit 13e616
* NAME
Packit 13e616
*	osm_port_clear_base_lid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Clear the base lid of a given port.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline void osm_port_clear_base_lid(OUT osm_port_t * p_port)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(p_port);
Packit 13e616
	p_port->lid = 0;
Packit 13e616
	osm_physp_set_base_lid(p_port->p_physp, 0);
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_port
Packit 13e616
*		[out] Pointer to a Port object.
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*	None
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Port
Packit 13e616
*********/
Packit 13e616
Packit 13e616
END_C_DECLS
Packit 13e616
#endif				/* _OSM_PORT_H_ */