|
Packit |
13e616 |
/*
|
|
Packit |
13e616 |
* Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved.
|
|
Packit |
13e616 |
* Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
|
|
Packit |
13e616 |
* Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
|
|
Packit |
13e616 |
*
|
|
Packit |
13e616 |
* This software is available to you under a choice of one of two
|
|
Packit |
13e616 |
* licenses. You may choose to be licensed under the terms of the GNU
|
|
Packit |
13e616 |
* General Public License (GPL) Version 2, available from the file
|
|
Packit |
13e616 |
* COPYING in the main directory of this source tree, or the
|
|
Packit |
13e616 |
* OpenIB.org BSD license below:
|
|
Packit |
13e616 |
*
|
|
Packit |
13e616 |
* Redistribution and use in source and binary forms, with or
|
|
Packit |
13e616 |
* without modification, are permitted provided that the following
|
|
Packit |
13e616 |
* conditions are met:
|
|
Packit |
13e616 |
*
|
|
Packit |
13e616 |
* - Redistributions of source code must retain the above
|
|
Packit |
13e616 |
* copyright notice, this list of conditions and the following
|
|
Packit |
13e616 |
* disclaimer.
|
|
Packit |
13e616 |
*
|
|
Packit |
13e616 |
* - Redistributions in binary form must reproduce the above
|
|
Packit |
13e616 |
* copyright notice, this list of conditions and the following
|
|
Packit |
13e616 |
* disclaimer in the documentation and/or other materials
|
|
Packit |
13e616 |
* provided with the distribution.
|
|
Packit |
13e616 |
*
|
|
Packit |
13e616 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
Packit |
13e616 |
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
Packit |
13e616 |
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
Packit |
13e616 |
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
Packit |
13e616 |
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
Packit |
13e616 |
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
Packit |
13e616 |
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
Packit |
13e616 |
* SOFTWARE.
|
|
Packit |
13e616 |
*
|
|
Packit |
13e616 |
*/
|
|
Packit |
13e616 |
|
|
Packit |
13e616 |
#ifndef _OSMV_RMPP_SENDER_H_
|
|
Packit |
13e616 |
#define _OSMV_RMPP_SENDER_H_
|
|
Packit |
13e616 |
|
|
Packit |
13e616 |
#include <vendor/osm_vendor_mlx.h>
|
|
Packit |
13e616 |
#include <vendor/osm_vendor_mlx_txn.h>
|
|
Packit |
13e616 |
#include <opensm/osm_madw.h>
|
|
Packit |
13e616 |
|
|
Packit |
13e616 |
#ifdef __cplusplus
|
|
Packit |
13e616 |
# define BEGIN_C_DECLS extern "C" {
|
|
Packit |
13e616 |
# define END_C_DECLS }
|
|
Packit |
13e616 |
#else /* !__cplusplus */
|
|
Packit |
13e616 |
# define BEGIN_C_DECLS
|
|
Packit |
13e616 |
# define END_C_DECLS
|
|
Packit |
13e616 |
#endif /* __cplusplus */
|
|
Packit |
13e616 |
|
|
Packit |
13e616 |
BEGIN_C_DECLS
|
|
Packit |
13e616 |
/****d* OSM Vendor/osmv_simple_send_madw
|
|
Packit |
13e616 |
* NAME
|
|
Packit |
13e616 |
* osmv_simple_send_madw
|
|
Packit |
13e616 |
*
|
|
Packit |
13e616 |
* DESCRIPTION
|
|
Packit |
13e616 |
* Send a single MAD (256 bytes).
|
|
Packit |
13e616 |
*
|
|
Packit |
13e616 |
* If this MAD requires a response, set the timeout event.
|
|
Packit |
13e616 |
* The function call returns when the MAD's send completion is received.
|
|
Packit |
13e616 |
*
|
|
Packit |
13e616 |
*/
|
|
Packit |
13e616 |
ib_api_status_t
|
|
Packit |
13e616 |
osmv_simple_send_madw(IN osm_bind_handle_t h_bind,
|
|
Packit |
13e616 |
IN osm_madw_t * const p_madw,
|
|
Packit |
13e616 |
IN osmv_txn_ctx_t * p_txn, IN boolean_t is_retry);
|
|
Packit |
13e616 |
|
|
Packit |
13e616 |
/****d* OSM Vendor/osmv_rmpp_send_madw
|
|
Packit |
13e616 |
* NAME
|
|
Packit |
13e616 |
* osmv_rmpp_send_madw
|
|
Packit |
13e616 |
*
|
|
Packit |
13e616 |
* DESCRIPTION
|
|
Packit |
13e616 |
* Send a single MAD wrapper (of arbitrary length).
|
|
Packit |
13e616 |
* Follow the RMPP semantics
|
|
Packit |
13e616 |
* (segmentation, send window, timeouts etc).
|
|
Packit |
13e616 |
*
|
|
Packit |
13e616 |
* The function call returns either when the whole MAD
|
|
Packit |
13e616 |
* has been acknowledged, or upon error.
|
|
Packit |
13e616 |
*/
|
|
Packit |
13e616 |
ib_api_status_t
|
|
Packit |
13e616 |
osmv_rmpp_send_madw(IN osm_bind_handle_t h_bind,
|
|
Packit |
13e616 |
IN osm_madw_t * const p_madw,
|
|
Packit |
13e616 |
IN osmv_txn_ctx_t * p_txn, IN boolean_t is_rmpp_ds);
|
|
Packit |
13e616 |
|
|
Packit |
13e616 |
/*
|
|
Packit |
13e616 |
* NAME osmv_rmpp_send_ack
|
|
Packit |
13e616 |
*
|
|
Packit |
13e616 |
* DESCRIPTION
|
|
Packit |
13e616 |
*/
|
|
Packit |
13e616 |
|
|
Packit |
13e616 |
ib_api_status_t
|
|
Packit |
13e616 |
osmv_rmpp_send_ack(IN osm_bind_handle_t h_bind,
|
|
Packit |
13e616 |
IN const ib_mad_t * p_req_mad,
|
|
Packit |
13e616 |
IN uint32_t seg_num,
|
|
Packit |
13e616 |
IN uint32_t nwl, IN const osm_mad_addr_t * p_mad_addr);
|
|
Packit |
13e616 |
|
|
Packit |
13e616 |
/*
|
|
Packit |
13e616 |
* NAME osmv_rmpp_send_nak
|
|
Packit |
13e616 |
*
|
|
Packit |
13e616 |
* DESCRIPTION Send the RMPP ABORT or STOP packet
|
|
Packit |
13e616 |
*/
|
|
Packit |
13e616 |
|
|
Packit |
13e616 |
ib_api_status_t
|
|
Packit |
13e616 |
osmv_rmpp_send_nak(IN osm_bind_handle_t h_bind,
|
|
Packit |
13e616 |
IN const ib_mad_t * p_req_mad,
|
|
Packit |
13e616 |
IN const osm_mad_addr_t * p_mad_addr,
|
|
Packit |
13e616 |
IN uint8_t nak_type, IN uint8_t status);
|
|
Packit |
13e616 |
|
|
Packit |
13e616 |
/*
|
|
Packit |
13e616 |
* NAME osmv_rmpp_snd_error
|
|
Packit |
13e616 |
*
|
|
Packit |
13e616 |
* DESCRIPTION Mark an error status and signal the sender thread to handle it
|
|
Packit |
13e616 |
*/
|
|
Packit |
13e616 |
|
|
Packit |
13e616 |
static inline void
|
|
Packit |
13e616 |
osmv_rmpp_snd_error(IN osmv_rmpp_send_ctx_t * p_send_ctx,
|
|
Packit |
13e616 |
IN ib_api_status_t status)
|
|
Packit |
13e616 |
{
|
|
Packit |
13e616 |
p_send_ctx->status = status;
|
|
Packit |
13e616 |
|
|
Packit |
13e616 |
/* Release the thread waiting on send()
|
|
Packit |
13e616 |
* It will release the transaction's context
|
|
Packit |
13e616 |
*/
|
|
Packit |
13e616 |
cl_event_signal(&p_send_ctx->event);
|
|
Packit |
13e616 |
}
|
|
Packit |
13e616 |
|
|
Packit |
13e616 |
END_C_DECLS
|
|
Packit |
13e616 |
#endif /* _OSMV_RMPP_SENDER_H_ */
|