Lines Matching refs:arg
32 static void handle_rpc_func_cmd_get_time(struct optee_msg_arg *arg) in handle_rpc_func_cmd_get_time() argument
36 if (arg->num_params != 1) in handle_rpc_func_cmd_get_time()
38 if ((arg->params[0].attr & OPTEE_MSG_ATTR_TYPE_MASK) != in handle_rpc_func_cmd_get_time()
43 arg->params[0].u.value.a = ts.tv_sec; in handle_rpc_func_cmd_get_time()
44 arg->params[0].u.value.b = ts.tv_nsec; in handle_rpc_func_cmd_get_time()
46 arg->ret = TEEC_SUCCESS; in handle_rpc_func_cmd_get_time()
49 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_get_time()
54 struct optee_msg_arg *arg) in handle_rpc_func_cmd_i2c_transfer() argument
69 if (arg->num_params != ARRAY_SIZE(attr)) { in handle_rpc_func_cmd_i2c_transfer()
70 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_i2c_transfer()
74 params = kmalloc_array(arg->num_params, sizeof(struct tee_param), in handle_rpc_func_cmd_i2c_transfer()
77 arg->ret = TEEC_ERROR_OUT_OF_MEMORY; in handle_rpc_func_cmd_i2c_transfer()
81 if (optee->ops->from_msg_param(optee, params, arg->num_params, in handle_rpc_func_cmd_i2c_transfer()
82 arg->params)) in handle_rpc_func_cmd_i2c_transfer()
85 for (i = 0; i < arg->num_params; i++) { in handle_rpc_func_cmd_i2c_transfer()
122 arg->ret = TEEC_ERROR_COMMUNICATION; in handle_rpc_func_cmd_i2c_transfer()
125 if (optee->ops->to_msg_param(optee, arg->params, in handle_rpc_func_cmd_i2c_transfer()
126 arg->num_params, params)) in handle_rpc_func_cmd_i2c_transfer()
127 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_i2c_transfer()
129 arg->ret = TEEC_SUCCESS; in handle_rpc_func_cmd_i2c_transfer()
137 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_i2c_transfer()
141 struct optee_msg_arg *arg) in handle_rpc_func_cmd_i2c_transfer() argument
143 arg->ret = TEEC_ERROR_NOT_SUPPORTED; in handle_rpc_func_cmd_i2c_transfer()
190 struct optee_msg_arg *arg) in handle_rpc_func_cmd_wq() argument
192 if (arg->num_params != 1) in handle_rpc_func_cmd_wq()
195 if ((arg->params[0].attr & OPTEE_MSG_ATTR_TYPE_MASK) != in handle_rpc_func_cmd_wq()
199 switch (arg->params[0].u.value.a) { in handle_rpc_func_cmd_wq()
201 wq_sleep(&optee->wait_queue, arg->params[0].u.value.b); in handle_rpc_func_cmd_wq()
204 wq_wakeup(&optee->wait_queue, arg->params[0].u.value.b); in handle_rpc_func_cmd_wq()
210 arg->ret = TEEC_SUCCESS; in handle_rpc_func_cmd_wq()
213 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_wq()
216 static void handle_rpc_func_cmd_wait(struct optee_msg_arg *arg) in handle_rpc_func_cmd_wait() argument
220 if (arg->num_params != 1) in handle_rpc_func_cmd_wait()
223 if ((arg->params[0].attr & OPTEE_MSG_ATTR_TYPE_MASK) != in handle_rpc_func_cmd_wait()
227 msec_to_wait = arg->params[0].u.value.a; in handle_rpc_func_cmd_wait()
232 arg->ret = TEEC_SUCCESS; in handle_rpc_func_cmd_wait()
235 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_wait()
239 struct optee_msg_arg *arg) in handle_rpc_supp_cmd() argument
243 arg->ret_origin = TEEC_ORIGIN_COMMS; in handle_rpc_supp_cmd()
245 params = kmalloc_array(arg->num_params, sizeof(struct tee_param), in handle_rpc_supp_cmd()
248 arg->ret = TEEC_ERROR_OUT_OF_MEMORY; in handle_rpc_supp_cmd()
252 if (optee->ops->from_msg_param(optee, params, arg->num_params, in handle_rpc_supp_cmd()
253 arg->params)) { in handle_rpc_supp_cmd()
254 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_supp_cmd()
258 arg->ret = optee_supp_thrd_req(ctx, arg->cmd, arg->num_params, params); in handle_rpc_supp_cmd()
260 if (optee->ops->to_msg_param(optee, arg->params, arg->num_params, in handle_rpc_supp_cmd()
262 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_supp_cmd()
316 struct optee_msg_arg *arg) in optee_rpc_cmd() argument
318 switch (arg->cmd) { in optee_rpc_cmd()
320 handle_rpc_func_cmd_get_time(arg); in optee_rpc_cmd()
323 handle_rpc_func_cmd_wq(optee, arg); in optee_rpc_cmd()
326 handle_rpc_func_cmd_wait(arg); in optee_rpc_cmd()
329 handle_rpc_func_cmd_i2c_transfer(ctx, arg); in optee_rpc_cmd()
332 handle_rpc_supp_cmd(ctx, optee, arg); in optee_rpc_cmd()