Lines Matching defs:arg

16 static void handle_rpc_func_cmd_get_time(struct optee_msg_arg *arg)
20 if (arg->num_params != 1)
22 if ((arg->params[0].attr & OPTEE_MSG_ATTR_TYPE_MASK) !=
27 arg->params[0].u.value.a = ts.tv_sec;
28 arg->params[0].u.value.b = ts.tv_nsec;
30 arg->ret = TEEC_SUCCESS;
33 arg->ret = TEEC_ERROR_BAD_PARAMETERS;
38 struct optee_msg_arg *arg)
53 if (arg->num_params != ARRAY_SIZE(attr)) {
54 arg->ret = TEEC_ERROR_BAD_PARAMETERS;
58 params = kmalloc_array(arg->num_params, sizeof(struct tee_param),
61 arg->ret = TEEC_ERROR_OUT_OF_MEMORY;
65 if (optee->ops->from_msg_param(optee, params, arg->num_params,
66 arg->params))
69 for (i = 0; i < arg->num_params; i++) {
106 arg->ret = TEEC_ERROR_COMMUNICATION;
109 if (optee->ops->to_msg_param(optee, arg->params,
110 arg->num_params, params))
111 arg->ret = TEEC_ERROR_BAD_PARAMETERS;
113 arg->ret = TEEC_SUCCESS;
121 arg->ret = TEEC_ERROR_BAD_PARAMETERS;
125 struct optee_msg_arg *arg)
127 arg->ret = TEEC_ERROR_NOT_SUPPORTED;
132 struct optee_msg_arg *arg)
136 if (arg->num_params != 1)
139 if ((arg->params[0].attr & OPTEE_MSG_ATTR_TYPE_MASK) !=
143 switch (arg->params[0].u.value.a) {
145 rc = optee_notif_wait(optee, arg->params[0].u.value.b, arg->params[0].u.value.c);
150 if (optee_notif_send(optee, arg->params[0].u.value.b))
157 arg->ret = TEEC_SUCCESS;
161 arg->ret = TEE_ERROR_TIMEOUT;
163 arg->ret = TEEC_ERROR_BAD_PARAMETERS;
166 static void handle_rpc_func_cmd_wait(struct optee_msg_arg *arg)
170 if (arg->num_params != 1)
173 if ((arg->params[0].attr & OPTEE_MSG_ATTR_TYPE_MASK) !=
177 msec_to_wait = arg->params[0].u.value.a;
182 arg->ret = TEEC_SUCCESS;
185 arg->ret = TEEC_ERROR_BAD_PARAMETERS;
189 struct optee_msg_arg *arg)
193 arg->ret_origin = TEEC_ORIGIN_COMMS;
195 params = kmalloc_array(arg->num_params, sizeof(struct tee_param),
198 arg->ret = TEEC_ERROR_OUT_OF_MEMORY;
202 if (optee->ops->from_msg_param(optee, params, arg->num_params,
203 arg->params)) {
204 arg->ret = TEEC_ERROR_BAD_PARAMETERS;
208 arg->ret = optee_supp_thrd_req(ctx, arg->cmd, arg->num_params, params);
210 if (optee->ops->to_msg_param(optee, arg->params, arg->num_params,
212 arg->ret = TEEC_ERROR_BAD_PARAMETERS;
267 struct optee_msg_arg *arg)
271 if (arg->num_params != ARRAY_SIZE(params) ||
272 optee->ops->from_msg_param(optee, params, arg->num_params,
273 arg->params) ||
275 arg->ret = TEEC_ERROR_BAD_PARAMETERS;
282 if (optee->ops->to_msg_param(optee, arg->params,
283 arg->num_params, params)) {
284 arg->ret = TEEC_ERROR_BAD_PARAMETERS;
293 arg->ret = TEEC_SUCCESS;
319 struct optee_msg_arg *arg)
325 if (arg->num_params != ARRAY_SIZE(params) ||
326 optee->ops->from_msg_param(optee, params, arg->num_params,
327 arg->params) ||
330 arg->ret = TEEC_ERROR_BAD_PARAMETERS;
336 arg->ret = TEEC_ERROR_BAD_PARAMETERS;
347 arg->ret = TEEC_ERROR_ITEM_NOT_FOUND;
352 arg->ret = TEEC_ERROR_SHORT_BUFFER;
360 if (optee->ops->to_msg_param(optee, arg->params,
361 arg->num_params, params)) {
362 arg->ret = TEEC_ERROR_BAD_PARAMETERS;
366 arg->ret = TEEC_SUCCESS;
371 struct optee_msg_arg *arg)
381 arg->ret = TEEC_ERROR_ITEM_NOT_FOUND;
385 if (arg->num_params != ARRAY_SIZE(params) ||
386 optee->ops->from_msg_param(optee, params, arg->num_params,
387 arg->params) ||
390 arg->ret = TEEC_ERROR_BAD_PARAMETERS;
400 arg->ret = TEEC_ERROR_BAD_PARAMETERS;
403 if (optee->ops->to_msg_param(optee, arg->params,
404 arg->num_params, params)) {
405 arg->ret = TEEC_ERROR_BAD_PARAMETERS;
408 arg->ret = TEEC_SUCCESS;
414 struct optee_msg_arg *arg)
416 switch (arg->cmd) {
418 handle_rpc_func_cmd_get_time(arg);
421 handle_rpc_func_cmd_wq(optee, arg);
424 handle_rpc_func_cmd_wait(arg);
427 handle_rpc_func_cmd_i2c_transfer(ctx, arg);
441 handle_rpc_func_rpmb_probe_reset(ctx, optee, arg);
443 handle_rpc_supp_cmd(ctx, optee, arg);
447 handle_rpc_func_rpmb_probe_next(ctx, optee, arg);
449 handle_rpc_supp_cmd(ctx, optee, arg);
453 handle_rpc_func_rpmb_frames(ctx, optee, arg);
455 handle_rpc_supp_cmd(ctx, optee, arg);
458 handle_rpc_supp_cmd(ctx, optee, arg);