Lines Matching refs:pvt_data

73 static size_t get_optee_rng_data(struct optee_rng_private *pvt_data,  in get_optee_rng_data()  argument
87 inv_arg.session = pvt_data->session_id; in get_optee_rng_data()
92 param[0].u.memref.shm = pvt_data->entropy_shm_pool; in get_optee_rng_data()
96 ret = tee_client_invoke_func(pvt_data->ctx, &inv_arg, param); in get_optee_rng_data()
98 dev_err(pvt_data->dev, "TA_CMD_GET_ENTROPY invoke err: %x\n", in get_optee_rng_data()
103 rng_data = tee_shm_get_va(pvt_data->entropy_shm_pool, 0); in get_optee_rng_data()
105 dev_err(pvt_data->dev, "tee_shm_get_va failed\n"); in get_optee_rng_data()
117 struct optee_rng_private *pvt_data = to_optee_rng_private(rng); in optee_rng_read() local
126 rng_size = get_optee_rng_data(pvt_data, data, (max - read)); in optee_rng_read()
131 if (wait && pvt_data->data_rate) { in optee_rng_read()
134 msleep((1000 * (max - read)) / pvt_data->data_rate); in optee_rng_read()
145 struct optee_rng_private *pvt_data = to_optee_rng_private(rng); in optee_rng_init() local
148 entropy_shm_pool = tee_shm_alloc_kernel_buf(pvt_data->ctx, in optee_rng_init()
151 dev_err(pvt_data->dev, "tee_shm_alloc_kernel_buf failed\n"); in optee_rng_init()
155 pvt_data->entropy_shm_pool = entropy_shm_pool; in optee_rng_init()
162 struct optee_rng_private *pvt_data = to_optee_rng_private(rng); in optee_rng_cleanup() local
164 tee_shm_free(pvt_data->entropy_shm_pool); in optee_rng_cleanup()
167 static struct optee_rng_private pvt_data = { variable
187 inv_arg.session = pvt_data.session_id; in get_optee_rng_info()
193 ret = tee_client_invoke_func(pvt_data.ctx, &inv_arg, param); in get_optee_rng_info()
200 pvt_data.data_rate = param[0].u.value.a; in get_optee_rng_info()
201 pvt_data.optee_rng.quality = param[0].u.value.b; in get_optee_rng_info()
223 pvt_data.ctx = tee_client_open_context(NULL, optee_ctx_match, NULL, in optee_rng_probe()
225 if (IS_ERR(pvt_data.ctx)) in optee_rng_probe()
233 ret = tee_client_open_session(pvt_data.ctx, &sess_arg, NULL); in optee_rng_probe()
240 pvt_data.session_id = sess_arg.session; in optee_rng_probe()
246 err = devm_hwrng_register(dev, &pvt_data.optee_rng); in optee_rng_probe()
252 pvt_data.dev = dev; in optee_rng_probe()
257 tee_client_close_session(pvt_data.ctx, pvt_data.session_id); in optee_rng_probe()
259 tee_client_close_context(pvt_data.ctx); in optee_rng_probe()
266 tee_client_close_session(pvt_data.ctx, pvt_data.session_id); in optee_rng_remove()
267 tee_client_close_context(pvt_data.ctx); in optee_rng_remove()