Lines Matching refs:msg
71 static void report_version(struct scmi_msg *msg) in report_version() argument
78 if (msg->in_size) { in report_version()
79 scmi_status_response(msg, SCMI_PROTOCOL_ERROR); in report_version()
83 scmi_write_response(msg, &return_values, sizeof(return_values)); in report_version()
86 static void report_attributes(struct scmi_msg *msg) in report_attributes() argument
88 size_t clk_count = plat_scmi_clock_count(msg->channel_id); in report_attributes()
94 if (msg->in_size) { in report_attributes()
95 scmi_status_response(msg, SCMI_PROTOCOL_ERROR); in report_attributes()
99 scmi_write_response(msg, &return_values, sizeof(return_values)); in report_attributes()
102 static void report_message_attributes(struct scmi_msg *msg) in report_message_attributes() argument
104 struct scmi_protocol_message_attributes_a2p *in_args = (void *)msg->in; in report_message_attributes()
111 if (msg->in_size != sizeof(*in_args)) { in report_message_attributes()
112 scmi_status_response(msg, SCMI_PROTOCOL_ERROR); in report_message_attributes()
117 scmi_status_response(msg, SCMI_NOT_FOUND); in report_message_attributes()
121 scmi_write_response(msg, &return_values, sizeof(return_values)); in report_message_attributes()
124 static void scmi_clock_attributes(struct scmi_msg *msg) in scmi_clock_attributes() argument
126 const struct scmi_clock_attributes_a2p *in_args = (void *)msg->in; in scmi_clock_attributes()
133 if (msg->in_size != sizeof(*in_args)) { in scmi_clock_attributes()
134 scmi_status_response(msg, SCMI_PROTOCOL_ERROR); in scmi_clock_attributes()
138 if (in_args->clock_id >= plat_scmi_clock_count(msg->channel_id)) { in scmi_clock_attributes()
139 scmi_status_response(msg, SCMI_INVALID_PARAMETERS); in scmi_clock_attributes()
144 plat_scmi_clock_count(msg->channel_id)); in scmi_clock_attributes()
146 name = plat_scmi_clock_get_name(msg->channel_id, clock_id); in scmi_clock_attributes()
148 scmi_status_response(msg, SCMI_NOT_FOUND); in scmi_clock_attributes()
154 return_values.attributes = plat_scmi_clock_get_state(msg->channel_id, in scmi_clock_attributes()
157 scmi_write_response(msg, &return_values, sizeof(return_values)); in scmi_clock_attributes()
160 static void scmi_clock_rate_get(struct scmi_msg *msg) in scmi_clock_rate_get() argument
162 const struct scmi_clock_rate_get_a2p *in_args = (void *)msg->in; in scmi_clock_rate_get()
167 if (msg->in_size != sizeof(*in_args)) { in scmi_clock_rate_get()
168 scmi_status_response(msg, SCMI_PROTOCOL_ERROR); in scmi_clock_rate_get()
172 if (in_args->clock_id >= plat_scmi_clock_count(msg->channel_id)) { in scmi_clock_rate_get()
173 scmi_status_response(msg, SCMI_INVALID_PARAMETERS); in scmi_clock_rate_get()
178 plat_scmi_clock_count(msg->channel_id)); in scmi_clock_rate_get()
180 rate = plat_scmi_clock_get_rate(msg->channel_id, clock_id); in scmi_clock_rate_get()
184 scmi_write_response(msg, &return_values, sizeof(return_values)); in scmi_clock_rate_get()
187 static void scmi_clock_rate_set(struct scmi_msg *msg) in scmi_clock_rate_set() argument
189 const struct scmi_clock_rate_set_a2p *in_args = (void *)msg->in; in scmi_clock_rate_set()
195 if (msg->in_size != sizeof(*in_args)) { in scmi_clock_rate_set()
196 scmi_status_response(msg, SCMI_PROTOCOL_ERROR); in scmi_clock_rate_set()
200 if (in_args->clock_id >= plat_scmi_clock_count(msg->channel_id)) { in scmi_clock_rate_set()
201 scmi_status_response(msg, SCMI_INVALID_PARAMETERS); in scmi_clock_rate_set()
206 plat_scmi_clock_count(msg->channel_id)); in scmi_clock_rate_set()
211 status = plat_scmi_clock_set_rate(msg->channel_id, clock_id, rate); in scmi_clock_rate_set()
213 scmi_status_response(msg, status); in scmi_clock_rate_set()
216 static void scmi_clock_config_set(struct scmi_msg *msg) in scmi_clock_config_set() argument
218 const struct scmi_clock_config_set_a2p *in_args = (void *)msg->in; in scmi_clock_config_set()
223 if (msg->in_size != sizeof(*in_args)) { in scmi_clock_config_set()
224 scmi_status_response(msg, SCMI_PROTOCOL_ERROR); in scmi_clock_config_set()
228 if (in_args->clock_id >= plat_scmi_clock_count(msg->channel_id)) { in scmi_clock_config_set()
229 scmi_status_response(msg, SCMI_INVALID_PARAMETERS); in scmi_clock_config_set()
234 plat_scmi_clock_count(msg->channel_id)); in scmi_clock_config_set()
238 status = plat_scmi_clock_set_state(msg->channel_id, clock_id, enable); in scmi_clock_config_set()
240 scmi_status_response(msg, status); in scmi_clock_config_set()
273 static void scmi_clock_describe_rates(struct scmi_msg *msg) in scmi_clock_describe_rates() argument
275 const struct scmi_clock_describe_rates_a2p *in_args = (void *)msg->in; in scmi_clock_describe_rates()
281 if (msg->in_size != sizeof(*in_args)) { in scmi_clock_describe_rates()
282 scmi_status_response(msg, SCMI_PROTOCOL_ERROR); in scmi_clock_describe_rates()
286 if (in_args->clock_id >= plat_scmi_clock_count(msg->channel_id)) { in scmi_clock_describe_rates()
287 scmi_status_response(msg, SCMI_INVALID_PARAMETERS); in scmi_clock_describe_rates()
292 plat_scmi_clock_count(msg->channel_id)); in scmi_clock_describe_rates()
295 status = plat_scmi_clock_rates_array(msg->channel_id, clock_id, 0, NULL, in scmi_clock_describe_rates()
304 status = plat_scmi_clock_rates_array(msg->channel_id, clock_id, in scmi_clock_describe_rates()
308 write_rate_desc_array_in_buffer(msg->out + sizeof(p2a), in scmi_clock_describe_rates()
315 memcpy(msg->out, &p2a, sizeof(p2a)); in scmi_clock_describe_rates()
316 msg->out_size_out = sizeof(p2a) + in scmi_clock_describe_rates()
323 status = plat_scmi_clock_rates_by_step(msg->channel_id, in scmi_clock_describe_rates()
326 write_rate_desc_array_in_buffer(msg->out + sizeof(p2a), in scmi_clock_describe_rates()
332 memcpy(msg->out, &p2a, sizeof(p2a)); in scmi_clock_describe_rates()
333 msg->out_size_out = sizeof(p2a) + (3 * RATE_DESC_SIZE); in scmi_clock_describe_rates()
340 scmi_status_response(msg, status); in scmi_clock_describe_rates()
366 scmi_msg_handler_t scmi_msg_get_clock_handler(struct scmi_msg *msg) in scmi_msg_get_clock_handler() argument
371 if (msg->message_id >= array_size) { in scmi_msg_get_clock_handler()
372 DMSG("Clock handle not found %u", msg->message_id); in scmi_msg_get_clock_handler()
376 message_id = confine_array_index(msg->message_id, array_size); in scmi_msg_get_clock_handler()