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
36 #ifndef _OSMV_RMPP_SENDER_H_
37 #define _OSMV_RMPP_SENDER_H_
39 #include <vendor/osm_vendor_mlx.h>
40 #include <vendor/osm_vendor_mlx_txn.h>
41 #include <opensm/osm_madw.h>
44 # define BEGIN_C_DECLS extern "C" {
45 # define END_C_DECLS }
46 #else /* !__cplusplus */
47 # define BEGIN_C_DECLS
49 #endif /* __cplusplus */
52 /****d* OSM Vendor/osmv_simple_send_madw
54 * osmv_simple_send_madw
57 * Send a single MAD (256 bytes).
59 * If this MAD requires a response, set the timeout event.
60 * The function call returns when the MAD's send completion is received.
64 osmv_simple_send_madw(IN osm_bind_handle_t h_bind,
65 IN osm_madw_t * const p_madw,
66 IN osmv_txn_ctx_t * p_txn, IN boolean_t is_retry);
68 /****d* OSM Vendor/osmv_rmpp_send_madw
73 * Send a single MAD wrapper (of arbitrary length).
74 * Follow the RMPP semantics
75 * (segmentation, send window, timeouts etc).
77 * The function call returns either when the whole MAD
78 * has been acknowledged, or upon error.
81 osmv_rmpp_send_madw(IN osm_bind_handle_t h_bind,
82 IN osm_madw_t * const p_madw,
83 IN osmv_txn_ctx_t * p_txn, IN boolean_t is_rmpp_ds);
86 * NAME osmv_rmpp_send_ack
92 osmv_rmpp_send_ack(IN osm_bind_handle_t h_bind,
93 IN const ib_mad_t * p_req_mad,
95 IN uint32_t nwl, IN const osm_mad_addr_t * p_mad_addr);
98 * NAME osmv_rmpp_send_nak
100 * DESCRIPTION Send the RMPP ABORT or STOP packet
104 osmv_rmpp_send_nak(IN osm_bind_handle_t h_bind,
105 IN const ib_mad_t * p_req_mad,
106 IN const osm_mad_addr_t * p_mad_addr,
107 IN uint8_t nak_type, IN uint8_t status);
110 * NAME osmv_rmpp_snd_error
112 * DESCRIPTION Mark an error status and signal the sender thread to handle it
116 osmv_rmpp_snd_error(IN osmv_rmpp_send_ctx_t * p_send_ctx,
117 IN ib_api_status_t status)
119 p_send_ctx->status = status;
121 /* Release the thread waiting on send()
122 * It will release the transaction's context
124 cl_event_signal(&p_send_ctx->event);
128 #endif /* _OSMV_RMPP_SENDER_H_ */