SCMI Transport Layer abstraction and definitions.
More...
|
| file | transport.h |
| | Header file for the SCMI Transport Layer.
|
SCMI Transport Layer abstraction and definitions.
◆ scmi_channel_cb
#include <zephyr/drivers/firmware/scmi/transport.h>
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.
- Parameters
-
| chan | pointer to SCMI channel on which the reply arrived |
◆ scmi_core_transport_init()
| int scmi_core_transport_init |
( |
const struct device * | transport | ) |
|
#include <zephyr/drivers/firmware/scmi/transport.h>
Perfrom SCMI core initialization.
- Parameters
-
| transport | pointer to the device structure for the transport layer |
- Return values
-
| 0 | if successful |
| negative | errno code if failure |
◆ scmi_transport_channel_is_free()
#include <zephyr/drivers/firmware/scmi/transport.h>
Check if an SCMI channel is free.
- Parameters
-
| transport | pointer to the device structure for the transport layer |
| chan | pointer to SCMI channel the query is to be performed on |
- Return values
-
| 0 | if successful |
| negative | errno code if failure |
◆ scmi_transport_init()
| int scmi_transport_init |
( |
const struct device * | transport | ) |
|
|
inlinestatic |
#include <zephyr/drivers/firmware/scmi/transport.h>
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.
- Parameters
-
| transport | pointer to the device structure for the transport layer |
- Return values
-
| 0 | if successful |
| negative | errno code if failure |
◆ scmi_transport_read_message()
#include <zephyr/drivers/firmware/scmi/transport.h>
Read an SCMI message.
- Parameters
-
| 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 |
- Return values
-
| 0 | if successful |
| negative | errno code if failure |
◆ scmi_transport_request_channel()
#include <zephyr/drivers/firmware/scmi/transport.h>
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.
- Parameters
-
| 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 |
- Return values
-
| pointer | to SCMI channel that's to be bound to the protocol |
| NULL | if operation was not successful |
◆ scmi_transport_send_message()
#include <zephyr/drivers/firmware/scmi/transport.h>
Send an SCMI channel.
Send an SCMI message using given SCMI channel. This function is not allowed to block.
- Parameters
-
| 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 |
- Return values
-
| 0 | if successful |
| negative | errno code if failure |
◆ scmi_transport_setup_chan()
#include <zephyr/drivers/firmware/scmi/transport.h>
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.
- Parameters
-
| 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 |
- Return values
-
| 0 | if successful |
| negative | errno code if failure |