Lines Matching refs:msg
78 static void report_version(struct scmi_msg *msg) in report_version() argument
85 if (msg->in_size != 0) { in report_version()
86 scmi_status_response(msg, SCMI_PROTOCOL_ERROR); in report_version()
90 scmi_write_response(msg, &return_values, sizeof(return_values)); in report_version()
93 static void report_attributes(struct scmi_msg *msg) in report_attributes() argument
95 size_t agent_count = plat_scmi_clock_count(msg->agent_id); in report_attributes()
101 if (msg->in_size != 0) { in report_attributes()
102 scmi_status_response(msg, SCMI_PROTOCOL_ERROR); in report_attributes()
106 scmi_write_response(msg, &return_values, sizeof(return_values)); in report_attributes()
109 static void report_message_attributes(struct scmi_msg *msg) in report_message_attributes() argument
111 struct scmi_protocol_message_attributes_a2p *in_args = (void *)msg->in; in report_message_attributes()
118 if (msg->in_size != sizeof(*in_args)) { in report_message_attributes()
119 scmi_status_response(msg, SCMI_PROTOCOL_ERROR); in report_message_attributes()
124 scmi_status_response(msg, SCMI_NOT_FOUND); in report_message_attributes()
128 scmi_write_response(msg, &return_values, sizeof(return_values)); in report_message_attributes()
131 static void scmi_clock_attributes(struct scmi_msg *msg) in scmi_clock_attributes() argument
133 const struct scmi_clock_attributes_a2p *in_args = (void *)msg->in; in scmi_clock_attributes()
140 if (msg->in_size != sizeof(*in_args)) { in scmi_clock_attributes()
141 scmi_status_response(msg, SCMI_PROTOCOL_ERROR); in scmi_clock_attributes()
147 if (clock_id >= plat_scmi_clock_count(msg->agent_id)) { in scmi_clock_attributes()
148 scmi_status_response(msg, SCMI_INVALID_PARAMETERS); in scmi_clock_attributes()
153 name = plat_scmi_clock_get_name(msg->agent_id, clock_id); in scmi_clock_attributes()
155 scmi_status_response(msg, SCMI_NOT_FOUND); in scmi_clock_attributes()
161 return_values.attributes = plat_scmi_clock_get_state(msg->agent_id, in scmi_clock_attributes()
164 scmi_write_response(msg, &return_values, sizeof(return_values)); in scmi_clock_attributes()
167 static void scmi_clock_rate_get(struct scmi_msg *msg) in scmi_clock_rate_get() argument
169 const struct scmi_clock_rate_get_a2p *in_args = (void *)msg->in; in scmi_clock_rate_get()
176 if (msg->in_size != sizeof(*in_args)) { in scmi_clock_rate_get()
177 scmi_status_response(msg, SCMI_PROTOCOL_ERROR); in scmi_clock_rate_get()
183 if (clock_id >= plat_scmi_clock_count(msg->agent_id)) { in scmi_clock_rate_get()
184 scmi_status_response(msg, SCMI_INVALID_PARAMETERS); in scmi_clock_rate_get()
188 rate = plat_scmi_clock_get_rate(msg->agent_id, clock_id); in scmi_clock_rate_get()
193 scmi_write_response(msg, &return_values, sizeof(return_values)); in scmi_clock_rate_get()
196 static void scmi_clock_rate_set(struct scmi_msg *msg) in scmi_clock_rate_set() argument
198 const struct scmi_clock_rate_set_a2p *in_args = (void *)msg->in; in scmi_clock_rate_set()
203 if (msg->in_size != sizeof(*in_args)) { in scmi_clock_rate_set()
204 scmi_status_response(msg, SCMI_PROTOCOL_ERROR); in scmi_clock_rate_set()
210 if (clock_id >= plat_scmi_clock_count(msg->agent_id)) { in scmi_clock_rate_set()
211 scmi_status_response(msg, SCMI_INVALID_PARAMETERS); in scmi_clock_rate_set()
218 status = plat_scmi_clock_set_rate(msg->agent_id, clock_id, rate); in scmi_clock_rate_set()
220 scmi_status_response(msg, status); in scmi_clock_rate_set()
223 static void scmi_clock_config_set(struct scmi_msg *msg) in scmi_clock_config_set() argument
225 const struct scmi_clock_config_set_a2p *in_args = (void *)msg->in; in scmi_clock_config_set()
230 if (msg->in_size != sizeof(*in_args)) { in scmi_clock_config_set()
231 scmi_status_response(msg, SCMI_PROTOCOL_ERROR); in scmi_clock_config_set()
237 if (clock_id >= plat_scmi_clock_count(msg->agent_id)) { in scmi_clock_config_set()
238 scmi_status_response(msg, SCMI_INVALID_PARAMETERS); in scmi_clock_config_set()
244 status = plat_scmi_clock_set_state(msg->agent_id, clock_id, enable); in scmi_clock_config_set()
246 scmi_status_response(msg, status); in scmi_clock_config_set()
277 static void scmi_clock_describe_rates(struct scmi_msg *msg) in scmi_clock_describe_rates() argument
279 const struct scmi_clock_describe_rates_a2p *in_args = (void *)msg->in; in scmi_clock_describe_rates()
287 if (msg->in_size != sizeof(*in_args)) { in scmi_clock_describe_rates()
288 scmi_status_response(msg, SCMI_PROTOCOL_ERROR); in scmi_clock_describe_rates()
294 if (clock_id >= plat_scmi_clock_count(msg->agent_id)) { in scmi_clock_describe_rates()
295 scmi_status_response(msg, SCMI_INVALID_PARAMETERS); in scmi_clock_describe_rates()
300 status = plat_scmi_clock_rates_array(msg->agent_id, clock_id, NULL, in scmi_clock_describe_rates()
309 status = plat_scmi_clock_rates_array(msg->agent_id, clock_id, in scmi_clock_describe_rates()
312 write_rate_desc_array_in_buffer(msg->out + sizeof(p2a), in scmi_clock_describe_rates()
319 memcpy(msg->out, &p2a, sizeof(p2a)); in scmi_clock_describe_rates()
320 msg->out_size_out = sizeof(p2a) + in scmi_clock_describe_rates()
327 status = plat_scmi_clock_rates_by_step(msg->agent_id, clock_id, in scmi_clock_describe_rates()
330 write_rate_desc_array_in_buffer(msg->out + sizeof(p2a), in scmi_clock_describe_rates()
336 memcpy(msg->out, &p2a, sizeof(p2a)); in scmi_clock_describe_rates()
337 msg->out_size_out = sizeof(p2a) + (3U * RATE_DESC_SIZE); in scmi_clock_describe_rates()
344 scmi_status_response(msg, status); in scmi_clock_describe_rates()
370 scmi_msg_handler_t scmi_msg_get_clock_handler(struct scmi_msg *msg) in scmi_msg_get_clock_handler() argument
373 unsigned int message_id = SPECULATION_SAFE_VALUE(msg->message_id); in scmi_msg_get_clock_handler()
376 VERBOSE("Clock handle not found %u", msg->message_id); in scmi_msg_get_clock_handler()