Lines Matching refs:proto
90 static int scmi_send_message_pre_kernel(struct scmi_protocol *proto, in scmi_send_message_pre_kernel() argument
96 ret = scmi_transport_send_message(proto->transport, proto->tx, msg); in scmi_send_message_pre_kernel()
108 while (!scmi_transport_channel_is_free(proto->transport, proto->tx)) { in scmi_send_message_pre_kernel()
111 ret = scmi_transport_read_message(proto->transport, proto->tx, reply); in scmi_send_message_pre_kernel()
119 static int scmi_send_message_post_kernel(struct scmi_protocol *proto, in scmi_send_message_post_kernel() argument
125 if (!proto->tx) { in scmi_send_message_post_kernel()
130 ret = k_mutex_lock(&proto->tx->lock, K_USEC(SCMI_CHAN_LOCK_TIMEOUT_USEC)); in scmi_send_message_post_kernel()
136 ret = scmi_transport_send_message(proto->transport, proto->tx, msg); in scmi_send_message_post_kernel()
143 ret = k_sem_take(&proto->tx->sem, K_USEC(SCMI_CHAN_SEM_TIMEOUT_USEC)); in scmi_send_message_post_kernel()
149 ret = scmi_transport_read_message(proto->transport, proto->tx, reply); in scmi_send_message_post_kernel()
156 k_mutex_unlock(&proto->tx->lock); in scmi_send_message_post_kernel()
161 int scmi_send_message(struct scmi_protocol *proto, struct scmi_message *msg, in scmi_send_message() argument
164 if (!proto->tx) { in scmi_send_message()
168 if (!proto->tx->ready) { in scmi_send_message()
173 return scmi_send_message_pre_kernel(proto, msg, reply); in scmi_send_message()
175 return scmi_send_message_post_kernel(proto, msg, reply); in scmi_send_message()