1219820Sjeff/*
2219820Sjeff * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved.
3219820Sjeff * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
4219820Sjeff * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
5219820Sjeff *
6219820Sjeff * This software is available to you under a choice of one of two
7219820Sjeff * licenses.  You may choose to be licensed under the terms of the GNU
8219820Sjeff * General Public License (GPL) Version 2, available from the file
9219820Sjeff * COPYING in the main directory of this source tree, or the
10219820Sjeff * OpenIB.org BSD license below:
11219820Sjeff *
12219820Sjeff *     Redistribution and use in source and binary forms, with or
13219820Sjeff *     without modification, are permitted provided that the following
14219820Sjeff *     conditions are met:
15219820Sjeff *
16219820Sjeff *      - Redistributions of source code must retain the above
17219820Sjeff *        copyright notice, this list of conditions and the following
18219820Sjeff *        disclaimer.
19219820Sjeff *
20219820Sjeff *      - Redistributions in binary form must reproduce the above
21219820Sjeff *        copyright notice, this list of conditions and the following
22219820Sjeff *        disclaimer in the documentation and/or other materials
23219820Sjeff *        provided with the distribution.
24219820Sjeff *
25219820Sjeff * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26219820Sjeff * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27219820Sjeff * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28219820Sjeff * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29219820Sjeff * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30219820Sjeff * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31219820Sjeff * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32219820Sjeff * SOFTWARE.
33219820Sjeff *
34219820Sjeff */
35219820Sjeff
36219820Sjeff#ifndef _OSMV_DEFS_H_
37219820Sjeff#define _OSMV_DEFS_H_
38219820Sjeff
39219820Sjeff#include <vendor/osm_vendor_mlx_inout.h>
40219820Sjeff#include <opensm/osm_log.h>
41219820Sjeff#include <vendor/osm_vendor_api.h>
42219820Sjeff#include <vendor/osm_vendor_mlx_txn.h>
43219820Sjeff
44219820Sjeff#ifdef __cplusplus
45219820Sjeff#  define BEGIN_C_DECLS extern "C" {
46219820Sjeff#  define END_C_DECLS   }
47219820Sjeff#else				/* !__cplusplus */
48219820Sjeff#  define BEGIN_C_DECLS
49219820Sjeff#  define END_C_DECLS
50219820Sjeff#endif				/* __cplusplus */
51219820Sjeff
52219820SjeffBEGIN_C_DECLS
53219820Sjeff/* The maximum number of outstanding MADs an RMPP sender can transmit */
54219820Sjeff#define OSMV_RMPP_RECV_WIN       16
55219820Sjeff/* The maximum number of retransmissions of the same MAD */
56219820Sjeff#define OSMV_MAX_RETRANSMIT      3
57219820Sjeff/* Transaction Timeout = OSMV_TXN_TIMEOUT_FACTOR * Response Timeout */
58219820Sjeff#define OSMV_TXN_TIMEOUT_FACTOR  128
59219820Sjeff/************/
60219820Sjeff/****s* OSM Vendor: Types/osmv_bind_obj_t
61219820Sjeff* NAME
62219820Sjeff*	osmv_bind_obj_t
63219820Sjeff*
64219820Sjeff* DESCRIPTION
65219820Sjeff*	The object managing a single bind context.
66219820Sjeff*       The bind handle is a direct pointer to it.
67219820Sjeff*
68219820Sjeff* SYNOPSIS
69219820Sjeff*/
70219820Sjefftypedef struct _osmv_bind_obj {
71219820Sjeff	/* Used to signal when the struct is being destroyed */
72219820Sjeff	struct _osmv_bind_obj *magic_ptr;
73219820Sjeff
74219820Sjeff	 osm_vendor_t /*const */  * p_vendor;
75219820Sjeff
76219820Sjeff	uint32_t hca_hndl;
77219820Sjeff	uint32_t port_num;
78219820Sjeff
79219820Sjeff	/* Atomic access protector */
80219820Sjeff	cl_spinlock_t lock;
81219820Sjeff
82219820Sjeff	/* is_closing == TRUE --> the handle is being unbound */
83219820Sjeff	boolean_t is_closing;
84219820Sjeff
85219820Sjeff	/* Event callbacks */
86219820Sjeff	osm_vend_mad_recv_callback_t recv_cb;
87219820Sjeff	osm_vend_mad_send_err_callback_t send_err_cb;
88219820Sjeff	/* ... and their context */
89219820Sjeff	void *cb_context;
90219820Sjeff
91219820Sjeff	/* A pool to manage MAD wrappers */
92219820Sjeff	osm_mad_pool_t *p_osm_pool;
93219820Sjeff
94219820Sjeff	/* each subvendor implements its own transport mgr */
95219820Sjeff	void *p_transp_mgr;
96219820Sjeff
97219820Sjeff	/* The transaction DB */
98219820Sjeff	osmv_txn_mgr_t txn_mgr;
99219820Sjeff
100219820Sjeff} osmv_bind_obj_t;
101219820Sjeff
102219820SjeffEND_C_DECLS
103219820Sjeff#endif				/* _OSMV_DEFS_H_ */
104