CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
Loading...
Searching...
No Matches
internal_rx.h File Reference

The declarations in this header file correspond to the definitions in internal_rx.c. More...

#include "adapter_api.h"
#include "cdi_core_api.h"
#include "cdi_raw_api.h"

Go to the source code of this file.

Typedefs

typedef struct RxPayloadWorkRequestStateRxPayloadWorkRequestHandle
 Type used as the handle (pointer to an opaque structure) for a Rx work request. Each handle represents a instance of a Rx work request structure. FIFO.
 

Functions

CdiReturnStatus RxCreateInternal (CdiConnectionProtocolType protocol_type, CdiRxConfigData *config_data_ptr, CdiCallback rx_cb_ptr, CdiConnectionHandle *ret_handle_ptr)
 
void RxConnectionDestroyInternal (CdiConnectionHandle con_handle)
 
CdiReturnStatus RxEndpointCreateDynamicPools (CdiEndpointHandle handle)
 Create dynamically allocated memory pools for the specified endpoint.
 
void RxEndpointDestroy (CdiEndpointHandle handle)
 
void RxPacketReceive (void *param_ptr, Packet *packet_ptr, EndpointMessageType message_type)
 
void RxSendPayload (CdiEndpointState *endpoint_ptr, RxPayloadState *send_payload_state_ptr)
 
void RxFreePayloadResources (CdiEndpointState *endpoint_ptr, RxPayloadState *payload_state_ptr, bool free_memory_state)
 
void RxInvokeAppPayloadCallback (CdiConnectionState *con_state_ptr, AppPayloadCallbackData *app_cb_data_ptr)
 
CdiReturnStatus RxEnqueueFreeBuffer (const CdiSgList *sgl_ptr)
 
bool RxPollFreeBuffer (void *param_ptr, CdiSgList *ret_packet_buffer_sgl_ptr)
 
void RxEndpointFlushResources (CdiEndpointState *endpoint_ptr)
 

Detailed Description

The declarations in this header file correspond to the definitions in internal_rx.c.

Function Documentation

◆ RxConnectionDestroyInternal()

void RxConnectionDestroyInternal ( CdiConnectionHandle con_handle)

◆ RxCreateInternal()

CdiReturnStatus RxCreateInternal ( CdiConnectionProtocolType protocol_type,
CdiRxConfigData * config_data_ptr,
CdiCallback rx_cb_ptr,
CdiConnectionHandle * ret_handle_ptr )

Create a raw receiver connection.

Parameters
protocol_typeSpecifies the protocol for payload (E.g. RAW or AVM)
config_data_ptrAddress of a structure with all of the parameters to use for setting up the connection.
rx_cb_ptrThe address of a function which will be called whenever a payload is received from the remote host.
ret_handle_ptrAn address which will receive the handle of the newly created connection.
Returns
kCdiStatusOk if the connection was successfully created, otherwise a value indicating why it failed.

◆ RxEndpointCreateDynamicPools()

CdiReturnStatus RxEndpointCreateDynamicPools ( CdiEndpointHandle handle)

Create dynamically allocated memory pools for the specified endpoint.

Parameters
handleHandle of endpoint to create dynamic memory pools.
Returns
kCdiStatusOk if the connection was successfully created, otherwise a value indicating why it failed.

◆ RxEndpointDestroy()

void RxEndpointDestroy ( CdiEndpointHandle handle)

Destroy resources associated with the specified endpoint.

Parameters
handleHandle of endpoint to destroy.

◆ RxEndpointFlushResources()

void RxEndpointFlushResources ( CdiEndpointState * endpoint_ptr)

Flush resources associated with Rx. NOTE: This function should only be called after the thread has been paused using EndpointManagerThreadWait().

Parameters
endpoint_ptrPointer to endpoint to free resources.

◆ RxEnqueueFreeBuffer()

CdiReturnStatus RxEnqueueFreeBuffer ( const CdiSgList * sgl_ptr)

Enqueue to free the receive buffer.

Parameters
sgl_ptrThe scatter-gather list containing the memory to be freed.
Returns
kCdiStatusOk if the connection was successfully created, otherwise a value indicating why it failed.

◆ RxFreePayloadResources()

void RxFreePayloadResources ( CdiEndpointState * endpoint_ptr,
RxPayloadState * payload_state_ptr,
bool free_memory_state )

Free payload resources.

Parameters
endpoint_ptrPointer to connection state structure.
payload_state_ptrPointer to payload structure being updated.
free_memory_state

◆ RxInvokeAppPayloadCallback()

void RxInvokeAppPayloadCallback ( CdiConnectionState * con_state_ptr,
AppPayloadCallbackData * app_cb_data_ptr )

Invoke the user registered Rx callback function for a payload.

Parameters
con_state_ptrPointer to connection state data.
app_cb_data_ptrPointer to application callback data.

◆ RxPacketReceive()

void RxPacketReceive ( void * param_ptr,
Packet * packet_ptr,
EndpointMessageType message_type )

A packet has been received by the receiver. Need to reassemble it into a payload and send the payload SGL to the application.

Parameters
param_ptrPointer to connection that the packet was received on as a void*.
packet_ptrPointer to the received packet.
message_typeEndpoint message type.

◆ RxPollFreeBuffer()

bool RxPollFreeBuffer ( void * param_ptr,
CdiSgList * ret_packet_buffer_sgl_ptr )

Called from PollThread() in the adapter to poll if any Rx buffers need to be freed. If there are any, this function will free payload level resources and then return a list of adapter packet buffer SGLs that need to be freed by the caller.

Parameters
param_ptrA pointer to data used by the function.
ret_packet_buffer_sgl_ptrPointer to address where to write the returned packet buffer SGL that needs to be freed by the caller.
Returns
Returns true if an adapter buffer SGL is being returned.

◆ RxSendPayload()

void RxSendPayload ( CdiEndpointState * endpoint_ptr,
RxPayloadState * send_payload_state_ptr )

Send the payload on to the next stage because it is complete or determined to be in error.

Parameters
endpoint_ptrPointer to endpoint state structure.
send_payload_state_ptrPointer to the payload state for the completed payload.