Lines Matching defs:supp

22 void optee_supp_init(struct optee_supp *supp)
24 memset(supp, 0, sizeof(*supp));
25 mutex_init(&supp->mutex);
26 init_completion(&supp->reqs_c);
27 idr_init(&supp->idr);
28 INIT_LIST_HEAD(&supp->reqs);
29 supp->req_id = -1;
32 void optee_supp_uninit(struct optee_supp *supp)
34 mutex_destroy(&supp->mutex);
35 idr_destroy(&supp->idr);
38 void optee_supp_release(struct optee_supp *supp)
44 mutex_lock(&supp->mutex);
47 idr_for_each_entry(&supp->idr, req, id) {
48 idr_remove(&supp->idr, id);
54 list_for_each_entry_safe(req, req_tmp, &supp->reqs, link) {
61 supp->ctx = NULL;
62 supp->req_id = -1;
64 mutex_unlock(&supp->mutex);
81 struct optee_supp *supp = &optee->supp;
89 if (!supp->ctx && ctx->supp_nowait)
102 mutex_lock(&supp->mutex);
103 list_add_tail(&req->link, &supp->reqs);
105 mutex_unlock(&supp->mutex);
108 complete(&supp->reqs_c);
118 mutex_lock(&supp->mutex);
123 mutex_unlock(&supp->mutex);
133 static struct optee_supp_req *supp_pop_entry(struct optee_supp *supp,
138 if (supp->req_id != -1) {
146 if (list_empty(&supp->reqs))
149 req = list_first_entry(&supp->reqs, struct optee_supp_req, link);
156 *id = idr_alloc(&supp->idr, req, 1, 0, GFP_KERNEL);
215 struct optee_supp *supp = &optee->supp;
226 mutex_lock(&supp->mutex);
227 req = supp_pop_entry(supp, *num_params - num_meta, &id);
228 mutex_unlock(&supp->mutex);
244 if (wait_for_completion_interruptible(&supp->reqs_c))
259 mutex_lock(&supp->mutex);
260 supp->req_id = id;
261 mutex_unlock(&supp->mutex);
272 static struct optee_supp_req *supp_pop_req(struct optee_supp *supp,
286 if (supp->req_id == -1) {
292 id = supp->req_id;
296 req = idr_find(&supp->idr, id);
303 idr_remove(&supp->idr, id);
304 supp->req_id = -1;
324 struct optee_supp *supp = &optee->supp;
329 mutex_lock(&supp->mutex);
330 req = supp_pop_req(supp, num_params, param, &num_meta);
331 mutex_unlock(&supp->mutex);