20#define RESPONSE_TIMEOUT 20000
40 if (EFI_ERROR (Status)) {
46 if (EFI_ERROR (Status)) {
78 IN OUT UINT32 *PayloadLength,
79 OUT UINT32 **ReturnValues OPTIONAL
85 UINT32 ResponseHeader;
88 ASSERT (PayloadLength !=
NULL);
91 if (EFI_ERROR (Status)) {
98 ScmiMessageTypeCommand,
108 if (EFI_ERROR (Status)) {
114 if (EFI_ERROR (Status)) {
119 if (MessageHeader != ResponseHeader) {
121 return EFI_DEVICE_ERROR;
126 if (Response->Status != ScmiSuccess) {
129 "SCMI error: ProtocolId = 0x%x, MessageId = 0x%x, error = %d\n",
136 return EFI_DEVICE_ERROR;
139 if (ReturnValues !=
NULL) {
140 *ReturnValues = Response->ReturnValues;
160 IN SCMI_PROTOCOL_ID ProtocolId,
161 IN SCMI_MESSAGE_ID MessageId,
162 OUT UINT32 **ReturnValues
166 UINT32 PayloadLength;
169 Command.ProtocolId = ProtocolId;
170 Command.MessageId = MessageId;
191 IN SCMI_PROTOCOL_ID ProtocolId,
196 UINT32 *ProtocolVersion;
200 ScmiMessageIdProtocolVersion,
201 (UINT32 **)&ProtocolVersion
203 if (EFI_ERROR (Status)) {
207 *Version = *ProtocolVersion;
223 IN SCMI_PROTOCOL_ID ProtocolId,
224 OUT UINT32 **ReturnValues
229 ScmiMessageIdProtocolAttributes,
245 IN SCMI_PROTOCOL_ID ProtocolId,
246 OUT UINT32 **ReturnValues
251 ScmiMessageIdProtocolMessageAttributes,
EFI_STATUS MtlGetChannel(IN MTL_CHANNEL_TYPE ChannelType, OUT MTL_CHANNEL **Channel)
EFI_STATUS MtlReceiveMessage(IN MTL_CHANNEL *Channel, OUT UINT32 *MessageHeader, OUT UINT32 *PayloadLength)
EFI_STATUS MtlWaitUntilChannelFree(IN MTL_CHANNEL *Channel, IN UINTN TimeOutInMicroSeconds)
EFI_STATUS MtlSendMessage(IN MTL_CHANNEL *Channel, IN UINT32 MessageHeader, OUT UINT32 PayloadLength)
UINT32 * MtlGetChannelPayload(IN MTL_CHANNEL *Channel)
#define DEBUG(Expression)
EFI_STATUS ScmiGetProtocolVersion(IN SCMI_PROTOCOL_ID ProtocolId, OUT UINT32 *Version)
EFI_STATUS ScmiGetProtocolMessageAttributes(IN SCMI_PROTOCOL_ID ProtocolId, OUT UINT32 **ReturnValues)
EFI_STATUS ScmiCommandExecute(IN SCMI_COMMAND *Command, IN OUT UINT32 *PayloadLength, OUT UINT32 **ReturnValues OPTIONAL)
EFI_STATUS ScmiCommandGetPayload(OUT UINT32 **Payload)
EFI_STATUS ScmiGetProtocolAttributes(IN SCMI_PROTOCOL_ID ProtocolId, OUT UINT32 **ReturnValues)
STATIC EFI_STATUS ScmiProtocolDiscoveryCommon(IN SCMI_PROTOCOL_ID ProtocolId, IN SCMI_MESSAGE_ID MessageId, OUT UINT32 **ReturnValues)