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