Lines Matching refs:channel_ctx

92     struct smt_channel_ctx *channel_ctx;  in smt_get_max_payload_size()  local
99 channel_ctx = in smt_get_max_payload_size()
102 *size = channel_ctx->max_payload_size; in smt_get_max_payload_size()
109 struct smt_channel_ctx *channel_ctx; in smt_get_message_header() local
116 channel_ctx = in smt_get_message_header()
119 if (!channel_ctx->locked) { in smt_get_message_header()
123 *header = channel_ctx->in->message_header; in smt_get_message_header()
132 struct smt_channel_ctx *channel_ctx; in smt_get_payload() local
139 channel_ctx = in smt_get_payload()
142 if (!channel_ctx->locked) in smt_get_payload()
145 *payload = channel_ctx->in->payload; in smt_get_payload()
148 *size = channel_ctx->in_len - in smt_get_payload()
149 sizeof(channel_ctx->in->message_header); in smt_get_payload()
160 struct smt_channel_ctx *channel_ctx; in smt_write_payload() local
162 channel_ctx = in smt_write_payload()
166 (offset > channel_ctx->max_payload_size) || in smt_write_payload()
167 (size > channel_ctx->max_payload_size) || in smt_write_payload()
168 ((offset + size) > channel_ctx->max_payload_size)) { in smt_write_payload()
174 if (!channel_ctx->locked) in smt_write_payload()
177 memcpy(((uint8_t*)channel_ctx->out->payload) + offset, payload, size); in smt_write_payload()
184 struct smt_channel_ctx *channel_ctx; in smt_respond() local
187 channel_ctx = &smt_ctx.channel_ctx_table[fwk_id_get_element_idx(channel_id)]; in smt_respond()
188 memory = ((struct mod_msg_smt_memory *) channel_ctx->out); in smt_respond()
195 channel_ctx->locked = false; in smt_respond()
197 channel_ctx->out_len = sizeof(memory->message_header) + size; in smt_respond()
199 channel_ctx->driver_api->raise_notification(channel_ctx->driver_id, channel_ctx->out_len); in smt_respond()
207 struct smt_channel_ctx *channel_ctx; in smt_transmit() local
214 channel_ctx = &smt_ctx.channel_ctx_table[fwk_id_get_element_idx(channel_id)]; in smt_transmit()
215 memory = ((struct mod_msg_smt_memory *) channel_ctx->out); in smt_transmit()
217 if (!channel_ctx->locked) { in smt_transmit()
226 channel_ctx->out_len = sizeof(memory->message_header) + size; in smt_transmit()
229 channel_ctx->locked = false; in smt_transmit()
232 channel_ctx->driver_api->raise_notification(channel_ctx->driver_id, channel_ctx->out_len); in smt_transmit()
250 static int smt_requester_handler(struct smt_channel_ctx *channel_ctx) in smt_requester_handler() argument
255 channel_ctx->locked = true; in smt_requester_handler()
258 channel_ctx->out->message_header = channel_ctx->in->message_header; in smt_requester_handler()
262 channel_ctx->scmi_api->signal_message(channel_ctx->scmi_service_id); in smt_requester_handler()
270 static int smt_completer_handler(struct smt_channel_ctx *channel_ctx) in smt_completer_handler() argument
273 channel_ctx->locked = true; in smt_completer_handler()
280 struct smt_channel_ctx *channel_ctx; in msg_signal_message() local
282 channel_ctx = in msg_signal_message()
285 if (!channel_ctx->msg_smt_mailbox_ready) { in msg_signal_message()
293 if (channel_ctx->locked) { in msg_signal_message()
298 channel_ctx->in = (struct mod_msg_smt_memory *)msg_in ; in msg_signal_message()
299 channel_ctx->in_len = in_len; in msg_signal_message()
300 channel_ctx->out = (struct mod_msg_smt_memory *)msg_out; in msg_signal_message()
301 channel_ctx->out_len = out_len; in msg_signal_message()
303 switch (channel_ctx->config->type) { in msg_signal_message()
305 return smt_requester_handler(channel_ctx); in msg_signal_message()
307 return smt_completer_handler(channel_ctx); in msg_signal_message()
347 struct smt_channel_ctx *channel_ctx = &smt_ctx.channel_ctx_table[elt_idx]; in msg_channel_init() local
349 channel_ctx->config = (struct mod_msg_smt_channel_config*)data; in msg_channel_init()
352 if (channel_ctx->config->type >= MOD_MSG_SMT_CHANNEL_TYPE_COUNT) { in msg_channel_init()
357 channel_ctx->in = NULL; in msg_channel_init()
358 channel_ctx->in_len = 0; in msg_channel_init()
359 channel_ctx->out = NULL; in msg_channel_init()
360 channel_ctx->out_len = 0; in msg_channel_init()
362 channel_ctx->max_payload_size = channel_ctx->config->mailbox_size - in msg_channel_init()
365 channel_ctx->msg_smt_mailbox_ready = true; in msg_channel_init()
373 struct smt_channel_ctx *channel_ctx; in msg_bind() local
379 channel_ctx = &smt_ctx.channel_ctx_table[fwk_id_get_element_idx(id)]; in msg_bind()
383 status = fwk_module_bind(channel_ctx->config->driver_id, in msg_bind()
384 channel_ctx->config->driver_api_id, in msg_bind()
385 &channel_ctx->driver_api); in msg_bind()
390 channel_ctx->driver_id = channel_ctx->config->driver_id; in msg_bind()
394 status = fwk_module_bind(channel_ctx->scmi_service_id, in msg_bind()
396 &channel_ctx->scmi_api); in msg_bind()
410 struct smt_channel_ctx *channel_ctx = NULL; in msg_process_bind_request() local
423 channel_ctx = &smt_ctx.channel_ctx_table[elt_idx]; in msg_process_bind_request()
438 if (fwk_id_get_module_idx(channel_ctx->driver_id) == in msg_process_bind_request()
440 fwk_id_get_element_idx(channel_ctx->driver_id) == in msg_process_bind_request()
453 channel_ctx->scmi_service_id = source_id; in msg_process_bind_request()