Zephyr API 3.6.99
Loading...
Searching...
No Matches
ipc_service_backend Struct Reference

IPC backend configuration structure. More...

#include <ipc_service_backend.h>

Data Fields

int(* open_instance )(const struct device *instance)
 Pointer to the function that will be used to open an instance.
 
int(* close_instance )(const struct device *instance)
 Pointer to the function that will be used to close an instance.
 
int(* send )(const struct device *instance, void *token, const void *data, size_t len)
 Pointer to the function that will be used to send data to the endpoint.
 
int(* register_endpoint )(const struct device *instance, void **token, const struct ipc_ept_cfg *cfg)
 Pointer to the function that will be used to register endpoints.
 
int(* deregister_endpoint )(const struct device *instance, void *token)
 Pointer to the function that will be used to deregister endpoints.
 
int(* get_tx_buffer_size )(const struct device *instance, void *token)
 Pointer to the function that will return the TX buffer size.
 
int(* get_tx_buffer )(const struct device *instance, void *token, void **data, uint32_t *len, k_timeout_t wait)
 Pointer to the function that will return an empty TX buffer.
 
int(* drop_tx_buffer )(const struct device *instance, void *token, const void *data)
 Pointer to the function that will drop a TX buffer.
 
int(* send_nocopy )(const struct device *instance, void *token, const void *data, size_t len)
 Pointer to the function that will be used to send data to the endpoint when the TX buffer has been obtained using ipc_service_get_tx_buffer.
 
int(* hold_rx_buffer )(const struct device *instance, void *token, void *data)
 Pointer to the function that will hold the RX buffer.
 
int(* release_rx_buffer )(const struct device *instance, void *token, void *data)
 Pointer to the function that will release the RX buffer.
 

Detailed Description

IPC backend configuration structure.

This structure is used for configuration backend during registration.

Field Documentation

◆ close_instance

int(* ipc_service_backend::close_instance) (const struct device *instance)

Pointer to the function that will be used to close an instance.

Parameters
[in]instanceInstance pointer.
Return values
-EALREADYwhen the instance is not already inited.
0on success
othererrno codes depending on the implementation of the backend.

◆ deregister_endpoint

int(* ipc_service_backend::deregister_endpoint) (const struct device *instance, void *token)

Pointer to the function that will be used to deregister endpoints.

Parameters
[in]instanceInstance from which to deregister the endpoint.
[in]tokenBackend-specific token.
Return values
-EINVALwhen the endpoint configuration or instance is invalid.
-ENOENTwhen the endpoint is not registered with the instance.
-EBUSYwhen the instance is busy or not ready.
0on success
othererrno codes depending on the implementation of the backend.

◆ drop_tx_buffer

int(* ipc_service_backend::drop_tx_buffer) (const struct device *instance, void *token, const void *data)

Pointer to the function that will drop a TX buffer.

Parameters
[in]instanceInstance pointer.
[in]tokenBackend-specific token.
[in]dataPointer to the TX buffer.
Return values
-EINVALwhen instance is invalid.
-ENOENTwhen the endpoint is not registered with the instance.
-ENOTSUPwhen this function is not supported.
-EALREADYwhen the buffer was already dropped.
0on success
othererrno codes depending on the implementation of the backend.

◆ get_tx_buffer

int(* ipc_service_backend::get_tx_buffer) (const struct device *instance, void *token, void **data, uint32_t *len, k_timeout_t wait)

Pointer to the function that will return an empty TX buffer.

Parameters
[in]instanceInstance pointer.
[in]tokenBackend-specific token.
[out]dataPointer to the empty TX buffer.
[in,out]lenPointer to store the TX buffer size.
[in]waitTimeout waiting for an available TX buffer.
Return values
-EINVALwhen instance is invalid.
-ENOENTwhen the endpoint is not registered with the instance.
-ENOTSUPwhen the operation or the timeout is not supported.
-ENOBUFSwhen there are no TX buffers available.
-EALREADYwhen a buffer was already claimed and not yet released.
-ENOMEMwhen the requested size is too big (and the size parameter contains the maximum allowed size).
0on success
othererrno codes depending on the implementation of the backend.

◆ get_tx_buffer_size

int(* ipc_service_backend::get_tx_buffer_size) (const struct device *instance, void *token)

Pointer to the function that will return the TX buffer size.

Parameters
[in]instanceInstance pointer.
[in]tokenBackend-specific token.
Return values
-EINVALwhen instance is invalid.
-ENOENTwhen the endpoint is not registered with the instance.
-ENOTSUPwhen the operation is not supported.
sizeTX buffer size on success.
othererrno codes depending on the implementation of the backend.

◆ hold_rx_buffer

int(* ipc_service_backend::hold_rx_buffer) (const struct device *instance, void *token, void *data)

Pointer to the function that will hold the RX buffer.

Parameters
[in]instanceInstance pointer.
[in]tokenBackend-specific token.
[in]dataPointer to the RX buffer to hold.
Return values
-EINVALwhen instance is invalid.
-ENOENTwhen the endpoint is not registered with the instance.
-EALREADYwhen the buffer data has been already hold.
-ENOTSUPwhen this function is not supported.
0on success
othererrno codes depending on the implementation of the backend.

◆ open_instance

int(* ipc_service_backend::open_instance) (const struct device *instance)

Pointer to the function that will be used to open an instance.

Parameters
[in]instanceInstance pointer.
Return values
-EALREADYwhen the instance is already opened.
0on success
othererrno codes depending on the implementation of the backend.

◆ register_endpoint

int(* ipc_service_backend::register_endpoint) (const struct device *instance, void **token, const struct ipc_ept_cfg *cfg)

Pointer to the function that will be used to register endpoints.

Parameters
[in]instanceInstance to register the endpoint onto.
[out]tokenBackend-specific token.
[in]cfgEndpoint configuration.
Return values
-EINVALwhen the endpoint configuration or instance is invalid.
-EBUSYwhen the instance is busy or not ready.
0on success
othererrno codes depending on the implementation of the backend.

◆ release_rx_buffer

int(* ipc_service_backend::release_rx_buffer) (const struct device *instance, void *token, void *data)

Pointer to the function that will release the RX buffer.

Parameters
[in]instanceInstance pointer.
[in]tokenBackend-specific token.
[in]dataPointer to the RX buffer to release.
Return values
-EINVALwhen instance is invalid.
-ENOENTwhen the endpoint is not registered with the instance.
-EALREADYwhen the buffer data has been already released.
-ENOTSUPwhen this function is not supported.
0on success
othererrno codes depending on the implementation of the backend.

◆ send

int(* ipc_service_backend::send) (const struct device *instance, void *token, const void *data, size_t len)

Pointer to the function that will be used to send data to the endpoint.

Parameters
[in]instanceInstance pointer.
[in]tokenBackend-specific token.
[in]dataPointer to the buffer to send.
[in]lenNumber of bytes to send.
Return values
-EINVALwhen instance is invalid.
-ENOENTwhen the endpoint is not registered with the instance.
-EBADMSGwhen the message is invalid.
-EBUSYwhen the instance is busy or not ready.
-ENOMEMwhen no memory / buffers are available.
bytesnumber of bytes sent.
othererrno codes depending on the implementation of the backend.

◆ send_nocopy

int(* ipc_service_backend::send_nocopy) (const struct device *instance, void *token, const void *data, size_t len)

Pointer to the function that will be used to send data to the endpoint when the TX buffer has been obtained using ipc_service_get_tx_buffer.

Parameters
[in]instanceInstance pointer.
[in]tokenBackend-specific token.
[in]dataPointer to the buffer to send.
[in]lenNumber of bytes to send.
Return values
-EINVALwhen instance is invalid.
-ENOENTwhen the endpoint is not registered with the instance.
-EBADMSGwhen the data is invalid (i.e. invalid data format, invalid length, ...)
-EBUSYwhen the instance is busy or not ready.
bytesnumber of bytes sent.
othererrno codes depending on the implementation of the backend.

The documentation for this struct was generated from the following file: