Lines Matching refs:channel_ctx

94     struct transport_channel_ctx *channel_ctx;  in transport_get_secure()  local
101 channel_ctx = in transport_get_secure()
105 ((channel_ctx->config->policies & MOD_TRANSPORT_POLICY_SECURE) != in transport_get_secure()
113 struct transport_channel_ctx *channel_ctx; in transport_get_max_payload_size() local
120 channel_ctx = in transport_get_max_payload_size()
123 *size = channel_ctx->max_payload_size; in transport_get_max_payload_size()
130 struct transport_channel_ctx *channel_ctx; in transport_get_message_header() local
137 channel_ctx = in transport_get_message_header()
141 channel_ctx->config->transport_type != in transport_get_message_header()
144 if (!channel_ctx->locked) { in transport_get_message_header()
148 *header = channel_ctx->in->message_header; in transport_get_message_header()
158 struct transport_channel_ctx *channel_ctx; in transport_get_payload() local
165 channel_ctx = in transport_get_payload()
169 channel_ctx->config->transport_type != in transport_get_payload()
172 if (!channel_ctx->locked) { in transport_get_payload()
176 *payload = channel_ctx->in->payload; in transport_get_payload()
178 *size = channel_ctx->in->length - sizeof(channel_ctx->in->message_header); in transport_get_payload()
189 struct transport_channel_ctx *channel_ctx; in transport_write_payload() local
191 channel_ctx = in transport_write_payload()
195 channel_ctx->config->transport_type != in transport_write_payload()
199 ((offset + size) > channel_ctx->max_payload_size)) { in transport_write_payload()
204 if (!channel_ctx->locked) { in transport_write_payload()
209 ((uint8_t *)channel_ctx->out->payload) + offset, payload, size); in transport_write_payload()
219 struct transport_channel_ctx *channel_ctx; in transport_respond() local
225 channel_ctx = in transport_respond()
228 transport_type = channel_ctx->config->transport_type; in transport_respond()
235 channel_ctx->config->out_band_mailbox_address); in transport_respond()
239 buffer, channel_ctx->out, sizeof(struct mod_transport_buffer)); in transport_respond()
247 (payload == NULL ? channel_ctx->out->payload : payload), in transport_respond()
252 buffer = channel_ctx->out; in transport_respond()
273 channel_ctx->locked = false; in transport_respond()
283 status = channel_ctx->driver_api->send_message( in transport_respond()
284 buffer, channel_ctx->config->driver_id); in transport_respond()
293 status = channel_ctx->driver_api->trigger_event( in transport_respond()
294 channel_ctx->config->driver_id); in transport_respond()
307 struct transport_channel_ctx *channel_ctx; in transport_transmit() local
314 channel_ctx = in transport_transmit()
317 transport_type = channel_ctx->config->transport_type; in transport_transmit()
324 channel_ctx->config->out_band_mailbox_address); in transport_transmit()
338 buffer = channel_ctx->out; in transport_transmit()
368 status = channel_ctx->driver_api->send_message( in transport_transmit()
369 channel_ctx->out, channel_ctx->config->driver_id); in transport_transmit()
378 return channel_ctx->driver_api->trigger_event( in transport_transmit()
379 channel_ctx->config->driver_id); in transport_transmit()
384 struct transport_channel_ctx *channel_ctx; in transport_release_channel_lock() local
386 channel_ctx = in transport_release_channel_lock()
398 channel_ctx->locked = false; in transport_release_channel_lock()
404 struct transport_channel_ctx *channel_ctx; in transport_trigger_interrupt() local
406 channel_ctx = in transport_trigger_interrupt()
410 channel_ctx->config->transport_type == in transport_trigger_interrupt()
413 return channel_ctx->driver_api->trigger_event( in transport_trigger_interrupt()
414 channel_ctx->config->driver_id); in transport_trigger_interrupt()
446 struct transport_channel_ctx *channel_ctx; in transport_get_fch() local
452 channel_ctx = in transport_get_fch()
456 channel_ctx->config->transport_type == in transport_get_fch()
460 return channel_ctx->driver_api->get_fch( in transport_get_fch()
461 channel_ctx->config->driver_id, fch); in transport_get_fch()
469 struct transport_channel_ctx *channel_ctx; in transport_fch_register_callback() local
475 channel_ctx = in transport_fch_register_callback()
479 channel_ctx->config->transport_type == in transport_fch_register_callback()
483 return channel_ctx->driver_api->fch_register_callback( in transport_fch_register_callback()
484 channel_ctx->config->driver_id, param, fch_callback); in transport_fch_register_callback()
494 static int transport_message_handler(struct transport_channel_ctx *channel_ctx) in transport_message_handler() argument
501 transport_type = channel_ctx->config->transport_type; in transport_message_handler()
504 if (channel_ctx->locked) { in transport_message_handler()
508 in = channel_ctx->in; in transport_message_handler()
509 out = channel_ctx->out; in transport_message_handler()
513 channel_ctx->config->out_band_mailbox_address); in transport_message_handler()
515 if (channel_ctx->config->channel_type == in transport_message_handler()
528 fwk_id_get_element_idx(channel_ctx->id)); in transport_message_handler()
533 channel_ctx->config->channel_type == in transport_message_handler()
546 fwk_id_get_element_idx(channel_ctx->id)); in transport_message_handler()
561 channel_ctx->locked = true; in transport_message_handler()
566 channel_ctx->driver_api->get_message( in transport_message_handler()
567 in, channel_ctx->config->driver_id); in transport_message_handler()
586 channel_ctx->max_payload_size)) { in transport_message_handler()
589 if (channel_ctx->is_scmi) { in transport_message_handler()
592 channel_ctx->transport_signal.scmi_signal_api->signal_error( in transport_message_handler()
593 channel_ctx->service_id); in transport_message_handler()
601 channel_ctx->transport_signal.firmware_signal_api->signal_error( in transport_message_handler()
602 channel_ctx->service_id); in transport_message_handler()
608 channel_ctx->config->out_band_mailbox_address); in transport_message_handler()
618 if (channel_ctx->is_scmi) { in transport_message_handler()
621 status = channel_ctx->transport_signal.scmi_signal_api->signal_message( in transport_message_handler()
622 channel_ctx->service_id); in transport_message_handler()
631 channel_ctx->transport_signal.firmware_signal_api->signal_message( in transport_message_handler()
632 channel_ctx->service_id); in transport_message_handler()
648 struct transport_channel_ctx *channel_ctx; in transport_signal_message() local
650 channel_ctx = in transport_signal_message()
657 if (channel_ctx->config->transport_type == in transport_signal_message()
661 channel_ctx->transport_signal.firmware_signal_api->signal_message( in transport_signal_message()
662 channel_ctx->service_id); in transport_signal_message()
667 if (channel_ctx->config->transport_type == in transport_signal_message()
669 if (!channel_ctx->out_band_mailbox_ready) { in transport_signal_message()
676 return transport_message_handler(channel_ctx); in transport_signal_message()
683 static int transport_mailbox_init(struct transport_channel_ctx *channel_ctx) in transport_mailbox_init() argument
687 if ((channel_ctx->config->policies & MOD_TRANSPORT_POLICY_INIT_MAILBOX) != in transport_mailbox_init()
692 if (channel_ctx->config->channel_type == in transport_mailbox_init()
696 channel_ctx->config->out_band_mailbox_address) = in transport_mailbox_init()
704 .source_id = channel_ctx->id, in transport_mailbox_init()
707 channel_ctx->out_band_mailbox_ready = true; in transport_mailbox_init()
735 struct transport_channel_ctx *channel_ctx; in transport_channel_init() local
737 channel_ctx = in transport_channel_init()
739 channel_ctx->config = (struct mod_transport_channel_config *)data; in transport_channel_init()
742 if ((channel_ctx->config->channel_type >= in transport_channel_init()
744 (channel_ctx->config->transport_type >= in transport_channel_init()
751 if ((channel_ctx->config->transport_type == in transport_channel_init()
753 ((channel_ctx->config->out_band_mailbox_address == 0) || in transport_channel_init()
754 (channel_ctx->config->out_band_mailbox_size == 0))) { in transport_channel_init()
761 if ((channel_ctx->config->transport_type == in transport_channel_init()
763 (channel_ctx->config->in_band_mailbox_size == 0)) { in transport_channel_init()
768 channel_ctx->id = channel_id; in transport_channel_init()
770 switch (channel_ctx->config->transport_type) { in transport_channel_init()
772 channel_ctx->in = in transport_channel_init()
773 fwk_mm_alloc(1, channel_ctx->config->out_band_mailbox_size); in transport_channel_init()
774 channel_ctx->out = in transport_channel_init()
775 fwk_mm_alloc(1, channel_ctx->config->out_band_mailbox_size); in transport_channel_init()
776 channel_ctx->max_payload_size = in transport_channel_init()
777 channel_ctx->config->out_band_mailbox_size - in transport_channel_init()
783 channel_ctx->in = in transport_channel_init()
784 fwk_mm_alloc(1, channel_ctx->config->in_band_mailbox_size); in transport_channel_init()
785 channel_ctx->out = in transport_channel_init()
786 fwk_mm_alloc(1, channel_ctx->config->in_band_mailbox_size); in transport_channel_init()
787 channel_ctx->max_payload_size = in transport_channel_init()
788 channel_ctx->config->in_band_mailbox_size - in transport_channel_init()
795 channel_ctx->in = NULL; in transport_channel_init()
796 channel_ctx->out = NULL; in transport_channel_init()
797 channel_ctx->max_payload_size = 0; in transport_channel_init()
803 channel_ctx->in = NULL; in transport_channel_init()
804 channel_ctx->out = NULL; in transport_channel_init()
805 channel_ctx->max_payload_size = 0; in transport_channel_init()
818 struct transport_channel_ctx *channel_ctx; in transport_bind() local
826 channel_ctx = in transport_bind()
829 channel_ctx->config->driver_id, in transport_bind()
830 channel_ctx->config->driver_api_id, in transport_bind()
831 &channel_ctx->driver_api); in transport_bind()
843 channel_ctx = in transport_bind()
847 if (channel_ctx->config->transport_type == in transport_bind()
859 fwk_id_build_module_id(channel_ctx->service_id), in transport_bind()
862 channel_ctx->service_id, in transport_bind()
864 &channel_ctx->transport_signal.scmi_signal_api); in transport_bind()
866 channel_ctx->is_scmi = true; in transport_bind()
871 channel_ctx->service_id, in transport_bind()
872 channel_ctx->config->signal_api_id, in transport_bind()
873 &channel_ctx->transport_signal.firmware_signal_api); in transport_bind()
875 channel_ctx->is_scmi = false; in transport_bind()
888 struct transport_channel_ctx *channel_ctx; in transport_process_bind_request() local
899 channel_ctx = in transport_process_bind_request()
917 if (fwk_id_get_module_idx(channel_ctx->config->driver_id) == in transport_process_bind_request()
919 fwk_id_get_element_idx(channel_ctx->config->driver_id) == in transport_process_bind_request()
933 channel_ctx->service_id = source_id; in transport_process_bind_request()
940 channel_ctx->service_id = source_id; in transport_process_bind_request()
947 channel_ctx->service_id = source_id; in transport_process_bind_request()
963 struct transport_channel_ctx *channel_ctx; in transport_start() local
969 channel_ctx = &transport_ctx.channel_ctx_table[fwk_id_get_element_idx(id)]; in transport_start()
971 if (channel_ctx->config->transport_type == in transport_start()
977 channel_ctx->config->pd_source_id, in transport_start()
984 return transport_mailbox_init(channel_ctx); in transport_start()
995 struct transport_channel_ctx *channel_ctx; in transport_process_notification() local
998 channel_ctx = in transport_process_notification()
1013 channel_ctx->out_band_mailbox_ready = false; in transport_process_notification()
1016 status = transport_mailbox_init(channel_ctx); in transport_process_notification()