Zephyr API 3.6.99
|
SCMI protocol generic functions and structures. More...
#include <zephyr/device.h>
#include <zephyr/drivers/firmware/scmi/util.h>
#include <stdint.h>
#include <errno.h>
Go to the source code of this file.
Data Structures | |
struct | scmi_protocol |
SCMI protocol structure. More... | |
struct | scmi_message |
SCMI message structure. More... | |
Macros | |
#define | SCMI_MESSAGE_HDR_MAKE(id, type, proto, token) |
Build an SCMI message header. | |
Enumerations | |
enum | scmi_message_type { SCMI_COMMAND = 0x0 , SCMI_DELAYED_REPLY = 0x2 , SCMI_NOTIFICATION = 0x3 } |
SCMI message type. More... | |
enum | scmi_status_code { SCMI_SUCCESS = 0 , SCMI_NOT_SUPPORTED = -1 , SCMI_INVALID_PARAMETERS = -2 , SCMI_DENIED = -3 , SCMI_NOT_FOUND = -4 , SCMI_OUT_OF_RANGE = -5 , SCMI_BUSY = -6 , SCMI_COMMS_ERROR = -7 , SCMI_GENERIC_ERROR = -8 , SCMI_HARDWARE_ERROR = -9 , SCMI_PROTOCOL_ERROR = -10 , SCMI_IN_USE = -11 } |
SCMI status codes. More... | |
Functions | |
int | scmi_status_to_errno (int scmi_status) |
Convert an SCMI status code to its Linux equivalent (if possible) | |
int | scmi_send_message (struct scmi_protocol *proto, struct scmi_message *msg, struct scmi_message *reply) |
Send an SCMI message and wait for its reply. | |
SCMI protocol generic functions and structures.
#define SCMI_MESSAGE_HDR_MAKE | ( | id, | |
type, | |||
proto, | |||
token ) |
Build an SCMI message header.
Builds an SCMI message header based on the fields that make it up.
id | message ID |
type | message type |
proto | protocol ID |
token | message token |
enum scmi_message_type |
enum scmi_status_code |
int scmi_send_message | ( | struct scmi_protocol * | proto, |
struct scmi_message * | msg, | ||
struct scmi_message * | reply ) |
Send an SCMI message and wait for its reply.
Blocking function used to send an SCMI message over a given channel and wait for its reply
proto | pointer to SCMI protocol |
msg | pointer to SCMI message to send |
reply | pointer to SCMI message in which the reply is to be written |
0 | if successful |
negative | errno if failure |
int scmi_status_to_errno | ( | int | scmi_status | ) |
Convert an SCMI status code to its Linux equivalent (if possible)
scmi_status | SCMI status code as shown in enum scmi_status_code |
Linux | equivalent status code |