Blame include/vendor/osm_vendor_mtl_hca_guid.h

Packit 13e616
/*
Packit 13e616
 * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved.
Packit 13e616
 * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
Packit 13e616
 * Copyright (c) 1996-2003 Intel Corporation. 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
 * 	Provides interface over VAPI for obtaining the local ports guids or from guid
Packit 13e616
 *    obtaining the HCA and port number.
Packit 13e616
 */
Packit 13e616
Packit 13e616
#ifndef _OSM_VENDOR_HCA_GUID_H_
Packit 13e616
#define _OSM_VENDOR_HCA_GUID_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
/****s* OpenSM: Vendor AL/osm_ca_info_t
Packit 13e616
* NAME
Packit 13e616
*   osm_ca_info_t
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
* 	Structure containing information about local Channle Adapters.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
typedef struct _osm_ca_info {
Packit 13e616
	ib_net64_t guid;
Packit 13e616
	size_t attr_size;
Packit 13e616
	ib_ca_attr_t *p_attr;
Packit 13e616
Packit 13e616
} osm_ca_info_t;
Packit 13e616
Packit 13e616
/*
Packit 13e616
* FIELDS
Packit 13e616
*	guid
Packit 13e616
*		Node GUID of the local CA.
Packit 13e616
*
Packit 13e616
*	attr_size
Packit 13e616
*		Size of the CA attributes for this CA.
Packit 13e616
*
Packit 13e616
*	p_attr
Packit 13e616
*		Pointer to dynamicly allocated CA Attribute structure.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: CA Info/osm_ca_info_get_port_guid
Packit 13e616
* NAME
Packit 13e616
*	osm_ca_info_get_port_guid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns the port GUID of the specified port owned by this CA.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline ib_net64_t
Packit 13e616
osm_ca_info_get_port_guid(IN const osm_ca_info_t * const p_ca_info,
Packit 13e616
			  IN const uint8_t index)
Packit 13e616
{
Packit 13e616
	return (p_ca_info->p_attr->p_port_attr[index].port_guid);
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_ca_info
Packit 13e616
*		[in] Pointer to a CA Info object.
Packit 13e616
*
Packit 13e616
*	index
Packit 13e616
*		[in] Port "index" for which to retrieve the port GUID.
Packit 13e616
*		The index is the offset into the ca's internal array
Packit 13e616
*		of port attributes.
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*	Returns the port GUID of the specified port owned by this CA.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: SM Vendor/osm_vendor_get_guid_ca_and_port
Packit 13e616
 * NAME
Packit 13e616
 *	osm_vendor_get_guid_ca_and_port
Packit 13e616
 *
Packit 13e616
 * DESCRIPTION
Packit 13e616
 * Given the vendor obj and a guid
Packit 13e616
 * return the ca id and port number that have that guid
Packit 13e616
 *
Packit 13e616
 * SYNOPSIS
Packit 13e616
 */
Packit 13e616
ib_api_status_t
Packit 13e616
osm_vendor_get_guid_ca_and_port(IN osm_vendor_t * const p_vend,
Packit 13e616
				IN ib_net64_t const guid,
Packit 13e616
				OUT VAPI_hca_id_t * p_hca_id,
Packit 13e616
				OUT uint32_t * p_port_num);
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_vend
Packit 13e616
*		[in] Pointer to an osm_vendor_t object.
Packit 13e616
*
Packit 13e616
*	guid
Packit 13e616
*		[in] The guid to search for.
Packit 13e616
*
Packit 13e616
*	p_hca_id
Packit 13e616
*		[out] The HCA Id (VAPI_hca_id_t *) that the port is found on.
Packit 13e616
*
Packit 13e616
*	p_port_num
Packit 13e616
*		[out] Pointer to a port number arg to be filled with the port number with the given guid.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	IB_SUCCESS on SUCCESS
Packit 13e616
*  IB_INVALID_GUID if the guid is notfound on any Local HCA Port
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: SM Vendor/osm_vendor_get_all_port_attr
Packit 13e616
 * NAME
Packit 13e616
 *	osm_vendor_get_all_port_attr
Packit 13e616
 *
Packit 13e616
 * DESCRIPTION
Packit 13e616
 * Fill in the array of port_attr with all available ports on ALL the
Packit 13e616
 * avilable CAs on this machine.
Packit 13e616
 * ALSO -
Packit 13e616
 * UPDATE THE VENDOR OBJECT LIST OF CA_INFO STRUCTS
Packit 13e616
 *
Packit 13e616
 * SYNOPSIS
Packit 13e616
 */
Packit 13e616
ib_api_status_t osm_vendor_get_all_port_attr(IN osm_vendor_t * const p_vend,
Packit 13e616
					     IN ib_port_attr_t *
Packit 13e616
					     const p_attr_array,
Packit 13e616
					     IN uint32_t * const p_num_ports);
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_vend
Packit 13e616
*		[in] Pointer to an osm_vendor_t object.
Packit 13e616
*
Packit 13e616
*	p_attr_array
Packit 13e616
*		[out] Pre-allocated array of port attributes to be filled in
Packit 13e616
*
Packit 13e616
*	p_num_ports
Packit 13e616
*		[out] The size of the given array. Filled in by the actual numberof ports found.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	IB_SUCCESS if OK
Packit 13e616
*  IB_INSUFFICIENT_MEMORY if not enough place for all ports was provided.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*********/
Packit 13e616
Packit 13e616
END_C_DECLS
Packit 13e616
#endif				/*  _OSM_VENDOR_HCA_GUID_H_ */