2 * Copyright (c) 2004-2007 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
36 #ifndef _OSM_VENDOR_UMAD_H_
37 #define _OSM_VENDOR_UMAD_H_
39 #include <iba/ib_types.h>
40 #include <complib/cl_qlist.h>
41 #include <opensm/osm_base.h>
42 #include <opensm/osm_log.h>
44 #include <infiniband/common.h>
45 #include <infiniband/umad.h>
48 # define BEGIN_C_DECLS extern "C" {
49 # define END_C_DECLS }
50 #else /* !__cplusplus */
51 # define BEGIN_C_DECLS
53 #endif /* __cplusplus */
56 /****h* OpenSM/Vendor Access Layer (UMAD)
61 * This file is the vendor specific file for the UMAD Infiniband API.
67 #define OSM_DEFAULT_RETRY_COUNT 3
68 #define OSM_UMAD_MAX_CAS 32
69 #define OSM_UMAD_MAX_PORTS_PER_CA 2
70 /****s* OpenSM: Vendor UMAD/osm_ca_info_t
75 * Structure containing information about local Channle Adapters.
79 typedef struct _osm_ca_info {
87 * Node GUID of the local CA.
90 * Size of the CA attributes for this CA.
93 * Pointer to dynamicly allocated CA Attribute structure.
98 /****f* OpenSM: CA Info/osm_ca_info_get_num_ports
100 * osm_ca_info_get_num_ports
103 * Returns the number of ports owned by this CA.
107 static inline uint8_t
108 osm_ca_info_get_num_ports(IN const osm_ca_info_t * const p_ca_info)
110 return (p_ca_info->p_attr->num_ports);
116 * [in] Pointer to a CA Info object.
119 * Returns the number of ports owned by this CA.
126 /****s* OpenSM: Vendor UMAD/osm_bind_handle_t
131 * handle returned by the vendor transport bind call.
135 typedef void *osm_bind_handle_t;
138 typedef struct _umad_match {
144 #define DEFAULT_OSM_UMAD_MAX_PENDING 1000
146 typedef struct vendor_match_tbl {
147 uint32_t last_version;
150 } vendor_match_tbl_t;
152 typedef struct _osm_vendor {
155 osm_ca_info_t *p_ca_info;
158 osm_bind_handle_t agents[UMAD_CA_MAX_AGENTS];
159 char ca_names[OSM_UMAD_MAX_CAS][UMAD_CA_NAME_LEN];
160 vendor_match_tbl_t mtbl;
161 umad_port_t umad_port;
162 pthread_mutex_t cb_mutex;
163 pthread_mutex_t match_tbl_mutex;
170 #define OSM_BIND_INVALID_HANDLE 0
172 typedef struct _osm_vend_wrap {
177 osm_bind_handle_t h_bind;
181 #endif /* _OSM_VENDOR_UMAD_H_ */