1321936Shselasky/*
2321936Shselasky * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved.
3321936Shselasky * Copyright (c) 2002-2005,2009 Mellanox Technologies LTD. All rights reserved.
4321936Shselasky * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
5321936Shselasky *
6321936Shselasky * This software is available to you under a choice of one of two
7321936Shselasky * licenses.  You may choose to be licensed under the terms of the GNU
8321936Shselasky * General Public License (GPL) Version 2, available from the file
9321936Shselasky * COPYING in the main directory of this source tree, or the
10321936Shselasky * OpenIB.org BSD license below:
11321936Shselasky *
12321936Shselasky *     Redistribution and use in source and binary forms, with or
13321936Shselasky *     without modification, are permitted provided that the following
14321936Shselasky *     conditions are met:
15321936Shselasky *
16321936Shselasky *      - Redistributions of source code must retain the above
17321936Shselasky *        copyright notice, this list of conditions and the following
18321936Shselasky *        disclaimer.
19321936Shselasky *
20321936Shselasky *      - Redistributions in binary form must reproduce the above
21321936Shselasky *        copyright notice, this list of conditions and the following
22321936Shselasky *        disclaimer in the documentation and/or other materials
23321936Shselasky *        provided with the distribution.
24321936Shselasky *
25321936Shselasky * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26321936Shselasky * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27321936Shselasky * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28321936Shselasky * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29321936Shselasky * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30321936Shselasky * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31321936Shselasky * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32321936Shselasky * SOFTWARE.
33321936Shselasky *
34321936Shselasky */
35321936Shselasky
36321936Shselasky#ifndef _OSMV_DEFS_H_
37321936Shselasky#define _OSMV_DEFS_H_
38321936Shselasky
39321936Shselasky#include <vendor/osm_vendor_mlx_inout.h>
40321936Shselasky#include <opensm/osm_log.h>
41321936Shselasky#include <vendor/osm_vendor_api.h>
42321936Shselasky#include <vendor/osm_vendor_mlx_txn.h>
43321936Shselasky
44321936Shselasky#ifdef __cplusplus
45321936Shselasky#  define BEGIN_C_DECLS extern "C" {
46321936Shselasky#  define END_C_DECLS   }
47321936Shselasky#else				/* !__cplusplus */
48321936Shselasky#  define BEGIN_C_DECLS
49321936Shselasky#  define END_C_DECLS
50321936Shselasky#endif				/* __cplusplus */
51321936Shselasky
52321936ShselaskyBEGIN_C_DECLS
53321936Shselasky/* The maximum number of outstanding MADs an RMPP sender can transmit */
54321936Shselasky#define OSMV_RMPP_RECV_WIN       16
55321936Shselasky/* Transaction Timeout = OSMV_TXN_TIMEOUT_FACTOR * Response Timeout */
56321936Shselasky#define OSMV_TXN_TIMEOUT_FACTOR  128
57321936Shselasky/************/
58321936Shselasky/****s* OSM Vendor: Types/osmv_bind_obj_t
59321936Shselasky* NAME
60321936Shselasky*	osmv_bind_obj_t
61321936Shselasky*
62321936Shselasky* DESCRIPTION
63321936Shselasky*	The object managing a single bind context.
64321936Shselasky*       The bind handle is a direct pointer to it.
65321936Shselasky*
66321936Shselasky* SYNOPSIS
67321936Shselasky*/
68321936Shselaskytypedef struct _osmv_bind_obj {
69321936Shselasky	/* Used to signal when the struct is being destroyed */
70321936Shselasky	struct _osmv_bind_obj *magic_ptr;
71321936Shselasky
72321936Shselasky	 osm_vendor_t /*const */  * p_vendor;
73321936Shselasky
74321936Shselasky	uint32_t hca_hndl;
75321936Shselasky	uint32_t port_num;
76321936Shselasky
77321936Shselasky	/* Atomic access protector */
78321936Shselasky	cl_spinlock_t lock;
79321936Shselasky
80321936Shselasky	/* is_closing == TRUE --> the handle is being unbound */
81321936Shselasky	boolean_t is_closing;
82321936Shselasky
83321936Shselasky	/* Event callbacks */
84321936Shselasky	osm_vend_mad_recv_callback_t recv_cb;
85321936Shselasky	osm_vend_mad_send_err_callback_t send_err_cb;
86321936Shselasky	/* ... and their context */
87321936Shselasky	void *cb_context;
88321936Shselasky
89321936Shselasky	/* A pool to manage MAD wrappers */
90321936Shselasky	osm_mad_pool_t *p_osm_pool;
91321936Shselasky
92321936Shselasky	/* each subvendor implements its own transport mgr */
93321936Shselasky	void *p_transp_mgr;
94321936Shselasky
95321936Shselasky	/* The transaction DB */
96321936Shselasky	osmv_txn_mgr_t txn_mgr;
97321936Shselasky
98321936Shselasky} osmv_bind_obj_t;
99321936Shselasky
100321936ShselaskyEND_C_DECLS
101321936Shselasky#endif				/* _OSMV_DEFS_H_ */
102