Lines Matching refs:arg

240 int handle_invoke_cmd(struct tee_ioctl_invoke_arg *arg, u32 sinfo,  in handle_invoke_cmd()  argument
246 if (!arg || (!p && arg->num_params)) in handle_invoke_cmd()
249 arg->ret_origin = TEEC_ORIGIN_COMMS; in handle_invoke_cmd()
251 if (arg->session == 0) { in handle_invoke_cmd()
252 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_invoke_cmd()
256 ret = tee_params_to_amd_params(p, arg->num_params, &cmd.op); in handle_invoke_cmd()
259 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_invoke_cmd()
263 cmd.ta_handle = get_ta_handle(arg->session); in handle_invoke_cmd()
264 cmd.cmd_id = arg->func; in handle_invoke_cmd()
268 sizeof(cmd), &arg->ret); in handle_invoke_cmd()
270 arg->ret = TEEC_ERROR_COMMUNICATION; in handle_invoke_cmd()
272 ret = amd_params_to_tee_params(p, arg->num_params, &cmd.op); in handle_invoke_cmd()
275 arg->ret = TEEC_ERROR_GENERIC; in handle_invoke_cmd()
278 arg->ret_origin = cmd.return_origin; in handle_invoke_cmd()
280 arg->ret_origin, arg->ret); in handle_invoke_cmd()
351 int handle_open_session(struct tee_ioctl_open_session_arg *arg, u32 *info, in handle_open_session() argument
357 if (!arg || !info || (!p && arg->num_params)) in handle_open_session()
360 arg->ret_origin = TEEC_ORIGIN_COMMS; in handle_open_session()
362 if (arg->session == 0) { in handle_open_session()
363 arg->ret = TEEC_ERROR_GENERIC; in handle_open_session()
367 ret = tee_params_to_amd_params(p, arg->num_params, &cmd.op); in handle_open_session()
370 arg->ret = TEEC_ERROR_BAD_PARAMETERS; in handle_open_session()
374 cmd.ta_handle = get_ta_handle(arg->session); in handle_open_session()
378 sizeof(cmd), &arg->ret); in handle_open_session()
380 arg->ret = TEEC_ERROR_COMMUNICATION; in handle_open_session()
382 ret = amd_params_to_tee_params(p, arg->num_params, &cmd.op); in handle_open_session()
385 arg->ret = TEEC_ERROR_GENERIC; in handle_open_session()
388 arg->ret_origin = cmd.return_origin; in handle_open_session()
393 pr_debug("open session: ret = 0x%x RO = 0x%x\n", arg->ret, in handle_open_session()
394 arg->ret_origin); in handle_open_session()
399 int handle_load_ta(void *data, u32 size, struct tee_ioctl_open_session_arg *arg) in handle_load_ta() argument
406 if (size == 0 || !data || !arg) in handle_load_ta()
422 sizeof(load_cmd), &arg->ret); in handle_load_ta()
424 arg->ret_origin = TEEC_ORIGIN_COMMS; in handle_load_ta()
425 arg->ret = TEEC_ERROR_COMMUNICATION; in handle_load_ta()
426 } else if (arg->ret == TEEC_SUCCESS) { in handle_load_ta()
429 arg->ret_origin = TEEC_ORIGIN_COMMS; in handle_load_ta()
430 arg->ret = TEEC_ERROR_OUT_OF_MEMORY; in handle_load_ta()
438 set_session_id(load_cmd.ta_handle, 0, &arg->session); in handle_load_ta()
444 load_cmd.ta_handle, arg->ret_origin, arg->ret); in handle_load_ta()