Zephyr Project API 4.0.0
A Scalable Open Source RTOS
|
Public APIs for the SCMI transport layer drivers. More...
Go to the source code of this file.
Data Structures | |
struct | scmi_channel |
SCMI channel structure. More... | |
struct | scmi_transport_api |
Typedefs | |
typedef void(* | scmi_channel_cb) (struct scmi_channel *chan) |
Callback function for message replies. | |
Functions | |
static struct scmi_channel * | scmi_transport_request_channel (const struct device *transport, uint32_t proto, bool tx) |
Request an SCMI channel dynamically. | |
static int | scmi_transport_init (const struct device *transport) |
Perform initialization for the transport layer driver. | |
static int | scmi_transport_setup_chan (const struct device *transport, struct scmi_channel *chan, bool tx) |
Setup an SCMI channel. | |
static int | scmi_transport_send_message (const struct device *transport, struct scmi_channel *chan, struct scmi_message *msg) |
Send an SCMI channel. | |
static int | scmi_transport_read_message (const struct device *transport, struct scmi_channel *chan, struct scmi_message *msg) |
Read an SCMI message. | |
static bool | scmi_transport_channel_is_free (const struct device *transport, struct scmi_channel *chan) |
Check if an SCMI channel is free. | |
int | scmi_core_transport_init (const struct device *transport) |
Perfrom SCMI core initialization. | |
Public APIs for the SCMI transport layer drivers.
scmi_channel_cb |
Callback function for message replies.
This function should be called by the transport layer driver whenever a reply to a previously sent message has been received. Its purpose is to notifying the SCMI core of the reply's arrival so that proper action can be taken.
chan | pointer to SCMI channel on which the reply arrived |
int scmi_core_transport_init | ( | const struct device * | transport | ) |
Perfrom SCMI core initialization.
transport | pointer to the device structure for the transport layer |
0 | if successful |
negative | errno code if failure |
|
inlinestatic |
Check if an SCMI channel is free.
transport | pointer to the device structure for the transport layer |
chan | pointer to SCMI channel the query is to be performed on |
0 | if successful |
negative | errno code if failure |
|
inlinestatic |
Perform initialization for the transport layer driver.
The transport layer driver can't be initialized directly (i.e via a call to its init() function) during system initialization. This is because the macro used to define an SCMI transport places scmi_core_transport_init()
in the init section instead of the driver's init() function. As such, scmi_core_transport_init()
needs to call this function to perfrom transport layer driver initialization if required.
This operation is optional.
transport | pointer to the device structure for the transport layer |
0 | if successful |
negative | errno code if failure |
|
inlinestatic |
Read an SCMI message.
transport | pointer to the device structure for the transport layer |
chan | pointer to SCMI channel on which the message is to be read |
msg | pointer to message the caller wishes to read |
0 | if successful |
negative | errno code if failure |
|
inlinestatic |
Request an SCMI channel dynamically.
Whenever the SCMI transport layer driver doesn't support static channel allocation, the SCMI core will try to bind a channel to a protocol dynamically using this function. Note that no setup needs to be performed on the channel in this function as the core will also call the channel setup() function.
transport | pointer to the device structure for the transport layer |
proto | ID of the protocol for which the core is requesting the channel |
tx | true if the channel is TX, false if RX |
pointer | to SCMI channel that's to be bound to the protocol |
NULL | if operation was not successful |
|
inlinestatic |
Send an SCMI channel.
Send an SCMI message using given SCMI channel. This function is not allowed to block.
transport | pointer to the device structure for the transport layer |
chan | pointer to SCMI channel on which the message is to be sent |
msg | pointer to message the caller wishes to send |
0 | if successful |
negative | errno code if failure |
|
inlinestatic |
Setup an SCMI channel.
Before being able to send/receive messages, an SCMI channel needs to be prepared, which is what this function does. If it returns successfully, an SCMI protocol will be able to use this channel to send/receive messages.
transport | pointer to the device structure for the transport layer |
chan | pointer to SCMI channel to be prepared |
tx | true if the channel is TX, false if RX |
0 | if successful |
negative | errno code if failure |