CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
|
This file contains internal definitions and implementation used with the SDK that is not part of the API. More...
#include "internal_tx.h"
#include <string.h>
#include "cdi_queue_api.h"
#include "endpoint_manager.h"
#include "internal.h"
#include "payload.h"
#include "private.h"
#include "statistics.h"
This file contains internal definitions and implementation used with the SDK that is not part of the API.
|
static |
Flush a payload that did not complete transferring. This will set the payload's status and queue a payload message to the application.
endpoint_ptr | Pointer to endpoint state data. |
payload_state_ptr | Pointer to payload state data. The pointer is not longer valid after function returns. |
|
static |
Return the next payload number to use for the specified connection. This is an incrementing value.
endpoint_ptr | Pointer to endpoint state data. |
|
static |
Payload transfer has completed either successfully or in error. Update stats and queue payload message to application.
endpoint_ptr | Pointer to endpoint state data. |
payload_state_ptr | Pointer to payload state data. The pointer is no longer valid after function returns. |
|
static |
Pop all items in the work request completion queue freeing resources associated with each one.
con_state_ptr | Pointer to connection state data. |
|
static |
Return work request to pool.
con_state_ptr | Pointer to connection state structure. |
work_request_ptr | Pointer to work request structure. |
void TxConnectionDestroyInternal | ( | CdiConnectionHandle | con_handle | ) |
CdiReturnStatus TxConnectionThreadJoin | ( | CdiConnectionHandle | con_handle | ) |
Join Tx connection threads as part of shutting down a connection. This function waits for them to stop.
con_handle | Connection handle. |
|
static |
Create an instance of a connection.
protocol_type | Connection protocol type. |
config_data_ptr | Pointer to transmitter configuration data. |
tx_cb_ptr | Address of the user function to call whenever a payload being transmitted has been received by the receiver. |
ret_handle_ptr | Pointer to returned connection handle. |
CdiReturnStatus TxCreateInternal | ( | CdiConnectionProtocolType | protocol_type, |
CdiTxConfigData * | config_data_ptr, | ||
CdiCallback | tx_cb_ptr, | ||
CdiConnectionHandle * | ret_handle_ptr ) |
void TxEndpointDestroy | ( | CdiEndpointHandle | handle | ) |
Destroy resources associated with the specified endpoint.
handle | Handle of endpoint to destroy. |
void TxInvokeAppPayloadCallback | ( | CdiConnectionState * | con_state_ptr, |
AppPayloadCallbackData * | app_cb_data_ptr ) |
Invoke the user registered Tx callback function for a payload.
con_state_ptr | Pointer to connection state data. |
app_cb_data_ptr | Pointer to application callback data. |
void TxPacketWorkRequestComplete | ( | void * | param_ptr, |
Packet * | packet_ptr, | ||
EndpointMessageType | message_type ) |
A packet has been acknowledged as being received by the receiver. The SGL needs to be freed and we need to determine when the entire payload has been freed and then tell the application.
param_ptr | Pointer to connection that the packet was transmitted on as a void*. |
packet_ptr | Pointer to packet state data. |
message_type | Endpoint message type. |
|
static |
Free function for Tx packet work request pool item.
context_ptr | Unused, reserve for future use. |
item_ptr | Pointer to item being initialized. |
CdiReturnStatus TxPayloadInternal | ( | CdiEndpointState * | endpoint_ptr, |
const CdiCoreTxPayloadConfig * | core_payload_config_ptr, | ||
const CdiSgList * | sgl_ptr, | ||
int | max_latency_microsecs, | ||
int | extra_data_size, | ||
uint8_t * | extra_data_ptr ) |
|
static |
Payload thread used to transmit a payload.
ptr | Pointer to thread specific data. In this case, a pointer to CdiConnectionState. |
void TxPayloadThreadFlushResources | ( | CdiEndpointState * | endpoint_ptr | ) |
Flush resources associate with TxPayloadThread(). NOTE: This function should only be called after the thread has been paused using EndpointManagerThreadWait().
endpoint_ptr | Pointer to endpoint to flush resources. |
CdiReturnStatus TxStreamConnectionCreateInternal | ( | CdiTxConfigData * | config_data_ptr, |
CdiCallback | tx_cb_ptr, | ||
CdiConnectionHandle * | ret_handle_ptr ) |
CdiReturnStatus TxStreamEndpointCreateInternal | ( | CdiConnectionHandle | handle, |
CdiTxConfigDataStream * | stream_config_ptr, | ||
CdiEndpointHandle * | ret_handle_ptr ) |