2 * Copyright (c) 2004, 2005 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 * Provides interface over VAPI for obtaining the local ports guids or from guid
39 * obtaining the HCA and port number.
42 #ifndef _OSM_VENDOR_HCA_GUID_H_
43 #define _OSM_VENDOR_HCA_GUID_H_
46 # define BEGIN_C_DECLS extern "C" {
47 # define END_C_DECLS }
48 #else /* !__cplusplus */
49 # define BEGIN_C_DECLS
51 #endif /* __cplusplus */
54 /****s* OpenSM: Vendor AL/osm_ca_info_t
59 * Structure containing information about local Channle Adapters.
63 typedef struct _osm_ca_info {
73 * Node GUID of the local CA.
76 * Size of the CA attributes for this CA.
79 * Pointer to dynamicly allocated CA Attribute structure.
84 /****f* OpenSM: CA Info/osm_ca_info_get_port_guid
86 * osm_ca_info_get_port_guid
89 * Returns the port GUID of the specified port owned by this CA.
93 static inline ib_net64_t
94 osm_ca_info_get_port_guid(IN const osm_ca_info_t * const p_ca_info,
95 IN const uint8_t index)
97 return (p_ca_info->p_attr->p_port_attr[index].port_guid);
103 * [in] Pointer to a CA Info object.
106 * [in] Port "index" for which to retrieve the port GUID.
107 * The index is the offset into the ca's internal array
108 * of port attributes.
111 * Returns the port GUID of the specified port owned by this CA.
118 /****f* OpenSM: SM Vendor/osm_vendor_get_guid_ca_and_port
120 * osm_vendor_get_guid_ca_and_port
123 * Given the vendor obj and a guid
124 * return the ca id and port number that have that guid
129 osm_vendor_get_guid_ca_and_port(IN osm_vendor_t * const p_vend,
130 IN ib_net64_t const guid,
131 OUT VAPI_hca_id_t * p_hca_id,
132 OUT uint32_t * p_port_num);
137 * [in] Pointer to an osm_vendor_t object.
140 * [in] The guid to search for.
143 * [out] The HCA Id (VAPI_hca_id_t *) that the port is found on.
146 * [out] Pointer to a port number arg to be filled with the port number with the given guid.
149 * IB_SUCCESS on SUCCESS
150 * IB_INVALID_GUID if the guid is notfound on any Local HCA Port
157 /****f* OpenSM: SM Vendor/osm_vendor_get_all_port_attr
159 * osm_vendor_get_all_port_attr
162 * Fill in the array of port_attr with all available ports on ALL the
163 * avilable CAs on this machine.
165 * UPDATE THE VENDOR OBJECT LIST OF CA_INFO STRUCTS
169 ib_api_status_t osm_vendor_get_all_port_attr(IN osm_vendor_t * const p_vend,
172 IN uint32_t * const p_num_ports);
177 * [in] Pointer to an osm_vendor_t object.
180 * [out] Pre-allocated array of port attributes to be filled in
183 * [out] The size of the given array. Filled in by the actual numberof ports found.
187 * IB_INSUFFICIENT_MEMORY if not enough place for all ports was provided.
195 #endif /* _OSM_VENDOR_HCA_GUID_H_ */