SCMI transport driver operations.
More...
#include <zephyr/drivers/firmware/scmi/transport.h>
|
| int(* | init )(const struct device *transport) |
| | Initialize the transport driver.
|
| int(* | send_message )(const struct device *transport, struct scmi_channel *chan, struct scmi_message *msg, bool use_polling) |
| | Send a message to the platform.
|
| int(* | setup_chan )(const struct device *transport, struct scmi_channel *chan, bool tx) |
| | Prepare a channel for communication.
|
| int(* | read_message )(const struct device *transport, struct scmi_channel *chan, struct scmi_message *msg) |
| | Read a message from the platform.
|
| bool(* | channel_is_free )(const struct device *transport, struct scmi_channel *chan) |
| | Check if a TX channel is free.
|
| struct scmi_channel *(* | request_channel )(const struct device *transport, uint32_t proto, bool tx) |
| | Request a channel dynamically.
|
SCMI transport driver operations.
This structure contains the set of operations to be implemented by all transport drivers.
◆ channel_is_free
Check if a TX channel is free.
Used to check if a TX channel allows sending data to the platform. If a message was previously sent to the platform, it is assumed that this function will indicate the availability of the message's reply.
- Parameters
-
| transport | device |
| chan | TX channel to query |
- Return values
-
| 0 | if successful |
| <0 | negative errno code if failure |
◆ init
| int(* scmi_transport_api::init) (const struct device *transport) |
Initialize the transport driver.
This operation can be left unimplemented if the driver requires no initialization.
- Note
- this operation is optional.
- Parameters
-
| transport | transport device |
- Return values
-
| 0 | is successful |
| <0 | negative errno code if failure |
◆ read_message
Read a message from the platform.
Used to read/receive a message from the platform over a given RX channel.
- Parameters
-
| transport | transport device |
| chan | channel used to receive the message |
| msg | message to receive |
- Return values
-
| 0 | if successful |
| <0 | negative errno code if failure |
◆ request_channel
Request a channel dynamically.
If CONFIG_ARM_SCMI_TRANSPORT_HAS_STATIC_CHANNELS is enabled, this operation will be used to dynamically request a channel and bind it to a given protocol. Otherwise, operation can be left unimplemented.
- Note
- this operation is optional
- Parameters
-
| transport | transport device |
| proto | ID of the protocol for which the channel is requested |
| tx | true if channel is TX, false if channel is RX |
- Return values
-
| pointer | to the channel bound to given protocol if successful |
| NULL | if failure |
◆ send_message
Send a message to the platform.
Used to send a message to the platform over a given TX channel.
- Note
- the transport driver is in no way allowed to overwrite the value of the
use_polling parameter and must comply with it.
- Parameters
-
| transport | transport device |
| chan | channel used to send the message |
| msg | message to send |
| use_polling | true if polling should be enabled, false otherwise |
- Return values
-
| 0 | if successful |
| <0 | negative errno code if failure |
◆ setup_chan
Prepare a channel for communication.
Perform any sort of initialization required by a channel to be able to send or receive data.
- Parameters
-
| transport | transport device |
| chan | channel to prepare |
| tx | true if channel is TX, false if channel is RX |
- Return values
-
| 0 | if successful |
| <0 | negative errno code if failure |
The documentation for this struct was generated from the following file: