Lines Matching refs:larval
96 struct crypto_larval *larval = (void *)alg; in crypto_larval_destroy() local
99 if (!IS_ERR_OR_NULL(larval->adult)) in crypto_larval_destroy()
100 crypto_mod_put(larval->adult); in crypto_larval_destroy()
101 kfree(larval); in crypto_larval_destroy()
106 struct crypto_larval *larval; in crypto_larval_alloc() local
108 larval = kzalloc(sizeof(*larval), GFP_KERNEL); in crypto_larval_alloc()
109 if (!larval) in crypto_larval_alloc()
112 larval->mask = mask; in crypto_larval_alloc()
113 larval->alg.cra_flags = CRYPTO_ALG_LARVAL | type; in crypto_larval_alloc()
114 larval->alg.cra_priority = -1; in crypto_larval_alloc()
115 larval->alg.cra_destroy = crypto_larval_destroy; in crypto_larval_alloc()
117 strlcpy(larval->alg.cra_name, name, CRYPTO_MAX_ALG_NAME); in crypto_larval_alloc()
118 init_completion(&larval->completion); in crypto_larval_alloc()
120 return larval; in crypto_larval_alloc()
128 struct crypto_larval *larval; in crypto_larval_add() local
130 larval = crypto_larval_alloc(name, type, mask); in crypto_larval_add()
131 if (IS_ERR(larval)) in crypto_larval_add()
132 return ERR_CAST(larval); in crypto_larval_add()
134 refcount_set(&larval->alg.cra_refcnt, 2); in crypto_larval_add()
139 alg = &larval->alg; in crypto_larval_add()
144 if (alg != &larval->alg) { in crypto_larval_add()
145 kfree(larval); in crypto_larval_add()
155 struct crypto_larval *larval = (void *)alg; in crypto_larval_kill() local
160 complete_all(&larval->completion); in crypto_larval_kill()
165 void crypto_wait_for_test(struct crypto_larval *larval) in crypto_wait_for_test() argument
169 err = crypto_probing_notify(CRYPTO_MSG_ALG_REGISTER, larval->adult); in crypto_wait_for_test()
173 err = wait_for_completion_killable(&larval->completion); in crypto_wait_for_test()
176 crypto_notify(CRYPTO_MSG_ALG_LOADED, larval); in crypto_wait_for_test()
179 crypto_larval_kill(&larval->alg); in crypto_wait_for_test()
183 static void crypto_start_test(struct crypto_larval *larval) in crypto_start_test() argument
185 if (!crypto_is_test_larval(larval)) in crypto_start_test()
188 if (larval->test_started) in crypto_start_test()
192 if (larval->test_started) { in crypto_start_test()
197 larval->test_started = true; in crypto_start_test()
200 crypto_wait_for_test(larval); in crypto_start_test()
205 struct crypto_larval *larval = (void *)alg; in crypto_larval_wait() local
209 crypto_start_test(larval); in crypto_larval_wait()
212 &larval->completion, 60 * HZ); in crypto_larval_wait()
214 alg = larval->adult; in crypto_larval_wait()
223 else if (crypto_is_test_larval(larval) && in crypto_larval_wait()
230 crypto_mod_put(&larval->alg); in crypto_larval_wait()
319 struct crypto_alg *larval; in crypto_alg_mod_lookup() local
332 larval = crypto_larval_lookup(name, type, mask); in crypto_alg_mod_lookup()
333 if (IS_ERR(larval) || !crypto_is_larval(larval)) in crypto_alg_mod_lookup()
334 return larval; in crypto_alg_mod_lookup()
336 ok = crypto_probing_notify(CRYPTO_MSG_ALG_REQUEST, larval); in crypto_alg_mod_lookup()
339 alg = crypto_larval_wait(larval); in crypto_alg_mod_lookup()
341 crypto_mod_put(larval); in crypto_alg_mod_lookup()
344 crypto_larval_kill(larval); in crypto_alg_mod_lookup()