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 * Declaration of osm_mad_wrapper_t.
39 * This object represents the context wrapper for OpenSM MAD processing.
40 * This object is part of the OpenSM family of objects.
46 #include "iba/ib_types.h"
47 #include <vendor/osm_vendor_api.h>
48 #include <opensm/osm_log.h>
53 # define BEGIN_C_DECLS extern "C" {
54 # define END_C_DECLS }
55 #else /* !__cplusplus */
56 # define BEGIN_C_DECLS
58 #endif /* __cplusplus */
62 typedef struct _umadt_obj_t {
64 UMADT_INTERFACE uMadtInterface;
65 IBT_INTERFACE IbtInterface;
67 cl_spinlock_t register_lock;
68 cl_qlist_t register_list;
75 /****s* OpenSM: Umadt MAD Wrapper/osm_bind_info
80 * Context needed for processing individual MADs
85 typedef struct _mad_bind_info_t {
86 cl_list_item_t list_item;
87 umadt_obj_t *p_umadt_obj;
88 osm_mad_pool_t *p_mad_pool;
89 osm_vend_mad_recv_callback_t mad_recv_callback;
91 cl_thread_t recv_processor_thread;
92 cl_spinlock_t trans_ctxt_lock;
93 cl_qlist_t trans_ctxt_list;
94 cl_timer_t timeout_timer;
95 cl_spinlock_t timeout_list_lock;
96 cl_qlist_t timeout_list;
97 RegisterClassStruct umadt_reg_class;
98 MADT_HANDLE umadt_handle; /* Umadt type */
102 typedef struct _trans_context_t {
103 cl_list_item_t list_item;
105 uint64_t sent_time; /* micro secs */
112 * List linkage for pools and lists. MUST BE FIRST MEMBER!
115 * Pointer to the MAD pool to be used by mads with this bind handle.
118 * Callback function called by the mad receive processor.
121 * context to be passed to the receive callback.
123 * recv_processor_thread
124 * Thread structure for the receive processor thread.
127 * Umadt register class struct used to register with Umadt.
130 * Umadt returns this handle from a registration call. The transport layer
131 * uses this handle to talk to Umadt.
137 #endif /*_OSM_UMADT_h_ */