• Home
  • Raw
  • Download

Lines Matching refs:arg

34 static void handle_rpc_func_cmd_get_time(struct optee_msg_arg *arg)  in handle_rpc_func_cmd_get_time()  argument
38 if (arg->num_params != 1) in handle_rpc_func_cmd_get_time()
40 if ((arg->params[0].attr & OPTEE_MSG_ATTR_TYPE_MASK) != in handle_rpc_func_cmd_get_time()
45 arg->params[0].u.value.a = ts.tv_sec; in handle_rpc_func_cmd_get_time()
46 arg->params[0].u.value.b = ts.tv_nsec; in handle_rpc_func_cmd_get_time()
48 arg->ret = TEEC_SUCCESS; in handle_rpc_func_cmd_get_time()
51 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_get_time()
56 struct optee_msg_arg *arg) in handle_rpc_func_cmd_i2c_transfer() argument
70 if (arg->num_params != ARRAY_SIZE(attr)) { in handle_rpc_func_cmd_i2c_transfer()
71 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_i2c_transfer()
75 params = kmalloc_array(arg->num_params, sizeof(struct tee_param), in handle_rpc_func_cmd_i2c_transfer()
78 arg->ret = TEEC_ERROR_OUT_OF_MEMORY; in handle_rpc_func_cmd_i2c_transfer()
82 if (optee_from_msg_param(params, arg->num_params, 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_to_msg_param(arg->params, arg->num_params, params)) in handle_rpc_func_cmd_i2c_transfer()
126 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_i2c_transfer()
128 arg->ret = TEEC_SUCCESS; in handle_rpc_func_cmd_i2c_transfer()
136 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_i2c_transfer()
140 struct optee_msg_arg *arg) in handle_rpc_func_cmd_i2c_transfer() argument
142 arg->ret = TEEC_ERROR_NOT_SUPPORTED; in handle_rpc_func_cmd_i2c_transfer()
189 struct optee_msg_arg *arg) in handle_rpc_func_cmd_wq() argument
191 if (arg->num_params != 1) in handle_rpc_func_cmd_wq()
194 if ((arg->params[0].attr & OPTEE_MSG_ATTR_TYPE_MASK) != in handle_rpc_func_cmd_wq()
198 switch (arg->params[0].u.value.a) { in handle_rpc_func_cmd_wq()
200 wq_sleep(&optee->wait_queue, arg->params[0].u.value.b); in handle_rpc_func_cmd_wq()
203 wq_wakeup(&optee->wait_queue, arg->params[0].u.value.b); in handle_rpc_func_cmd_wq()
209 arg->ret = TEEC_SUCCESS; in handle_rpc_func_cmd_wq()
212 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_wq()
215 static void handle_rpc_func_cmd_wait(struct optee_msg_arg *arg) in handle_rpc_func_cmd_wait() argument
219 if (arg->num_params != 1) in handle_rpc_func_cmd_wait()
222 if ((arg->params[0].attr & OPTEE_MSG_ATTR_TYPE_MASK) != in handle_rpc_func_cmd_wait()
226 msec_to_wait = arg->params[0].u.value.a; in handle_rpc_func_cmd_wait()
231 arg->ret = TEEC_SUCCESS; in handle_rpc_func_cmd_wait()
234 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_wait()
238 struct optee_msg_arg *arg) in handle_rpc_supp_cmd() argument
242 arg->ret_origin = TEEC_ORIGIN_COMMS; in handle_rpc_supp_cmd()
244 params = kmalloc_array(arg->num_params, sizeof(struct tee_param), in handle_rpc_supp_cmd()
247 arg->ret = TEEC_ERROR_OUT_OF_MEMORY; in handle_rpc_supp_cmd()
251 if (optee_from_msg_param(params, arg->num_params, arg->params)) { in handle_rpc_supp_cmd()
252 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_supp_cmd()
256 arg->ret = optee_supp_thrd_req(ctx, arg->cmd, arg->num_params, params); in handle_rpc_supp_cmd()
258 if (optee_to_msg_param(arg->params, arg->num_params, params)) in handle_rpc_supp_cmd()
259 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_supp_cmd()
289 struct optee_msg_arg *arg, in handle_rpc_func_cmd_shm_alloc() argument
297 arg->ret_origin = TEEC_ORIGIN_COMMS; in handle_rpc_func_cmd_shm_alloc()
299 if (!arg->num_params || in handle_rpc_func_cmd_shm_alloc()
300 arg->params[0].attr != OPTEE_MSG_ATTR_TYPE_VALUE_INPUT) { in handle_rpc_func_cmd_shm_alloc()
301 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_shm_alloc()
305 for (n = 1; n < arg->num_params; n++) { in handle_rpc_func_cmd_shm_alloc()
306 if (arg->params[n].attr != OPTEE_MSG_ATTR_TYPE_NONE) { in handle_rpc_func_cmd_shm_alloc()
307 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_shm_alloc()
312 sz = arg->params[0].u.value.b; in handle_rpc_func_cmd_shm_alloc()
313 switch (arg->params[0].u.value.a) { in handle_rpc_func_cmd_shm_alloc()
322 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_shm_alloc()
327 arg->ret = TEEC_ERROR_OUT_OF_MEMORY; in handle_rpc_func_cmd_shm_alloc()
332 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_shm_alloc()
345 arg->ret = TEEC_ERROR_OUT_OF_MEMORY; in handle_rpc_func_cmd_shm_alloc()
351 arg->ret = TEEC_ERROR_OUT_OF_MEMORY; in handle_rpc_func_cmd_shm_alloc()
358 arg->params[0].attr = OPTEE_MSG_ATTR_TYPE_TMEM_OUTPUT | in handle_rpc_func_cmd_shm_alloc()
364 arg->params[0].u.tmem.buf_ptr = virt_to_phys(pages_list) | in handle_rpc_func_cmd_shm_alloc()
367 arg->params[0].u.tmem.size = tee_shm_get_size(shm); in handle_rpc_func_cmd_shm_alloc()
368 arg->params[0].u.tmem.shm_ref = (unsigned long)shm; in handle_rpc_func_cmd_shm_alloc()
373 arg->params[0].attr = OPTEE_MSG_ATTR_TYPE_TMEM_OUTPUT; in handle_rpc_func_cmd_shm_alloc()
374 arg->params[0].u.tmem.buf_ptr = pa; in handle_rpc_func_cmd_shm_alloc()
375 arg->params[0].u.tmem.size = sz; in handle_rpc_func_cmd_shm_alloc()
376 arg->params[0].u.tmem.shm_ref = (unsigned long)shm; in handle_rpc_func_cmd_shm_alloc()
379 arg->ret = TEEC_SUCCESS; in handle_rpc_func_cmd_shm_alloc()
411 struct optee_msg_arg *arg) in handle_rpc_func_cmd_shm_free() argument
415 arg->ret_origin = TEEC_ORIGIN_COMMS; in handle_rpc_func_cmd_shm_free()
417 if (arg->num_params != 1 || in handle_rpc_func_cmd_shm_free()
418 arg->params[0].attr != OPTEE_MSG_ATTR_TYPE_VALUE_INPUT) { in handle_rpc_func_cmd_shm_free()
419 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_shm_free()
423 shm = (struct tee_shm *)(unsigned long)arg->params[0].u.value.b; in handle_rpc_func_cmd_shm_free()
424 switch (arg->params[0].u.value.a) { in handle_rpc_func_cmd_shm_free()
432 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_rpc_func_cmd_shm_free()
434 arg->ret = TEEC_SUCCESS; in handle_rpc_func_cmd_shm_free()
456 struct optee_msg_arg *arg; in handle_rpc_func_cmd() local
458 arg = tee_shm_get_va(shm, 0); in handle_rpc_func_cmd()
459 if (IS_ERR(arg)) { in handle_rpc_func_cmd()
464 switch (arg->cmd) { in handle_rpc_func_cmd()
466 handle_rpc_func_cmd_get_time(arg); in handle_rpc_func_cmd()
469 handle_rpc_func_cmd_wq(optee, arg); in handle_rpc_func_cmd()
472 handle_rpc_func_cmd_wait(arg); in handle_rpc_func_cmd()
476 handle_rpc_func_cmd_shm_alloc(ctx, optee, arg, call_ctx); in handle_rpc_func_cmd()
479 handle_rpc_func_cmd_shm_free(ctx, arg); in handle_rpc_func_cmd()
482 handle_rpc_func_cmd_i2c_transfer(ctx, arg); in handle_rpc_func_cmd()
485 handle_rpc_supp_cmd(ctx, arg); in handle_rpc_func_cmd()