Lines Matching refs:arg

15 static void handle_rpc_func_cmd_get_time(struct optee_msg_arg *arg)  in handle_rpc_func_cmd_get_time()  argument
19 if (arg->num_params != 1) in handle_rpc_func_cmd_get_time()
21 if ((arg->params[0].attr & OPTEE_MSG_ATTR_TYPE_MASK) != in handle_rpc_func_cmd_get_time()
26 arg->params[0].u.value.a = ts.tv_sec; in handle_rpc_func_cmd_get_time()
27 arg->params[0].u.value.b = ts.tv_nsec; in handle_rpc_func_cmd_get_time()
29 arg->ret = TEEC_SUCCESS; in handle_rpc_func_cmd_get_time()
32 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_get_time()
37 struct optee_msg_arg *arg) in handle_rpc_func_cmd_i2c_transfer() argument
52 if (arg->num_params != ARRAY_SIZE(attr)) { in handle_rpc_func_cmd_i2c_transfer()
53 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_i2c_transfer()
57 params = kmalloc_array(arg->num_params, sizeof(struct tee_param), in handle_rpc_func_cmd_i2c_transfer()
60 arg->ret = TEEC_ERROR_OUT_OF_MEMORY; in handle_rpc_func_cmd_i2c_transfer()
64 if (optee->ops->from_msg_param(optee, params, arg->num_params, in handle_rpc_func_cmd_i2c_transfer()
65 arg->params)) in handle_rpc_func_cmd_i2c_transfer()
68 for (i = 0; i < arg->num_params; i++) { in handle_rpc_func_cmd_i2c_transfer()
105 arg->ret = TEEC_ERROR_COMMUNICATION; in handle_rpc_func_cmd_i2c_transfer()
108 if (optee->ops->to_msg_param(optee, arg->params, in handle_rpc_func_cmd_i2c_transfer()
109 arg->num_params, params)) in handle_rpc_func_cmd_i2c_transfer()
110 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_i2c_transfer()
112 arg->ret = TEEC_SUCCESS; in handle_rpc_func_cmd_i2c_transfer()
120 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_i2c_transfer()
124 struct optee_msg_arg *arg) in handle_rpc_func_cmd_i2c_transfer() argument
126 arg->ret = TEEC_ERROR_NOT_SUPPORTED; in handle_rpc_func_cmd_i2c_transfer()
131 struct optee_msg_arg *arg) in handle_rpc_func_cmd_wq() argument
133 if (arg->num_params != 1) in handle_rpc_func_cmd_wq()
136 if ((arg->params[0].attr & OPTEE_MSG_ATTR_TYPE_MASK) != in handle_rpc_func_cmd_wq()
140 switch (arg->params[0].u.value.a) { in handle_rpc_func_cmd_wq()
142 if (optee_notif_wait(optee, arg->params[0].u.value.b)) in handle_rpc_func_cmd_wq()
146 if (optee_notif_send(optee, arg->params[0].u.value.b)) in handle_rpc_func_cmd_wq()
153 arg->ret = TEEC_SUCCESS; in handle_rpc_func_cmd_wq()
156 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_wq()
159 static void handle_rpc_func_cmd_wait(struct optee_msg_arg *arg) in handle_rpc_func_cmd_wait() argument
163 if (arg->num_params != 1) in handle_rpc_func_cmd_wait()
166 if ((arg->params[0].attr & OPTEE_MSG_ATTR_TYPE_MASK) != in handle_rpc_func_cmd_wait()
170 msec_to_wait = arg->params[0].u.value.a; in handle_rpc_func_cmd_wait()
175 arg->ret = TEEC_SUCCESS; in handle_rpc_func_cmd_wait()
178 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_wait()
182 struct optee_msg_arg *arg) in handle_rpc_supp_cmd() argument
186 arg->ret_origin = TEEC_ORIGIN_COMMS; in handle_rpc_supp_cmd()
188 params = kmalloc_array(arg->num_params, sizeof(struct tee_param), in handle_rpc_supp_cmd()
191 arg->ret = TEEC_ERROR_OUT_OF_MEMORY; in handle_rpc_supp_cmd()
195 if (optee->ops->from_msg_param(optee, params, arg->num_params, in handle_rpc_supp_cmd()
196 arg->params)) { in handle_rpc_supp_cmd()
197 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_supp_cmd()
201 arg->ret = optee_supp_thrd_req(ctx, arg->cmd, arg->num_params, params); in handle_rpc_supp_cmd()
203 if (optee->ops->to_msg_param(optee, arg->params, arg->num_params, in handle_rpc_supp_cmd()
205 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_supp_cmd()
259 struct optee_msg_arg *arg) in optee_rpc_cmd() argument
261 switch (arg->cmd) { in optee_rpc_cmd()
263 handle_rpc_func_cmd_get_time(arg); in optee_rpc_cmd()
266 handle_rpc_func_cmd_wq(optee, arg); in optee_rpc_cmd()
269 handle_rpc_func_cmd_wait(arg); in optee_rpc_cmd()
272 handle_rpc_func_cmd_i2c_transfer(ctx, arg); in optee_rpc_cmd()
275 handle_rpc_supp_cmd(ctx, optee, arg); in optee_rpc_cmd()