Lines Matching +full:protocol +full:- +full:id

1 /* SPDX-License-Identifier: GPL-2.0 */
3 * System Control and Management Interface (SCMI) Message Protocol
7 * Copyright (C) 2018-2021 ARM Ltd.
43 * struct scmi_msg_resp_prot_version - Response for a message
75 * maximum number of in-flight messages on a specific platform, but such value
83 * struct scmi_msg_hdr - Message(Tx/Rx) header
85 * @id: The identifier of the message being sent
86 * @protocol_id: The identifier of the protocol used to send @id message
96 u8 id; member
105 * pack_scmi_header() - packs and returns 32-bit header
107 * @hdr: pointer to header containing all the information on message id,
108 * protocol id, sequence id and type.
110 * Return: 32-bit packed message header to be sent to the platform.
114 return FIELD_PREP(MSG_ID_MASK, hdr->id) | in pack_scmi_header()
115 FIELD_PREP(MSG_TYPE_MASK, hdr->type) | in pack_scmi_header()
116 FIELD_PREP(MSG_TOKEN_ID_MASK, hdr->seq) | in pack_scmi_header()
117 FIELD_PREP(MSG_PROTOCOL_ID_MASK, hdr->protocol_id); in pack_scmi_header()
121 * unpack_scmi_header() - unpacks and records message and protocol id
123 * @msg_hdr: 32-bit packed message header sent from the platform
124 * @hdr: pointer to header to fetch message and protocol id.
128 hdr->id = MSG_XTRACT_ID(msg_hdr); in unpack_scmi_header()
129 hdr->protocol_id = MSG_XTRACT_PROT_ID(msg_hdr); in unpack_scmi_header()
130 hdr->type = MSG_XTRACT_TYPE(msg_hdr); in unpack_scmi_header()
134 * struct scmi_msg - Message(Tx/Rx) structure
145 * struct scmi_xfer - Structure representing a message flow
147 * @transfer_id: Unique ID for debug & profiling purpose
150 * @rx: Receive message, the buffer should be pre-allocated to store
151 * message. If request-ACK protocol is used, we can reuse the same
164 * though the timed-out transaction will anyway cause the command
165 * request to be reported as failed by time-out, the underlying xfer
171 * - SCMI_XFER_SENT_OK -> SCMI_XFER_RESP_OK [ -> SCMI_XFER_DRESP_OK ]
172 * - SCMI_XFER_SENT_OK -> SCMI_XFER_DRESP_OK
209 if (xfer_->hdr.seq == k_) \
217 * struct scmi_protocol_handle - Reference to an initialized protocol instance
219 * @dev: A reference to the associated SCMI instance device (handle->dev).
221 * can be used by the protocol implementation to generate SCMI messages.
222 * @set_priv: A method to set protocol private data for this instance.
223 * @get_priv: A method to get protocol private data previously set.
225 * This structure represents a protocol initialized against specific SCMI
227 * - as a parameter fed from the core to the protocol initialization code so
229 * messages exclusively for the specific underlying protocol instance.
230 * - as an opaque handle fed by an SCMI driver user when it tries to access
231 * this protocol through its own protocol operations.
233 * with the related protocol operations when the SCMI driver tries to access
234 * the protocol.
244 * struct scmi_xfer_ops - References to the core SCMI xfer operations.
245 * @version_get: Get this version protocol.
252 * Note that all this operations expect a protocol handle as first parameter;
253 * they then internally use it to infer the underlying protocol number: this
254 * way is not possible for a protocol implementation to forge messages for
255 * another protocol.
283 * struct scmi_protocol - Protocol descriptor
284 * @id: Protocol ID.
286 * @instance_init: Mandatory protocol initialization function.
287 * @instance_deinit: Optional protocol de-initialization function.
288 * @ops: Optional reference to the operations provided by the protocol and
290 * @events: An optional reference to the events supported by this protocol.
293 const u8 id; member
337 * struct scmi_chan_info - Structure representing a SCMI channel information
351 * struct scmi_transport_ops - Structure representing a SCMI transport ops
372 int (*chan_free)(int id, void *p, void *data);
391 * struct scmi_desc - Description of SoC integration
394 * initialize some transport-specific setup during SCMI core
397 * de-initialize some transport-specific setup during SCMI core
398 * de-initialization, so after SCMI core removal.
426 void scmi_free_channel(struct scmi_chan_info *cinfo, struct idr *idr, int id);