Lines Matching refs:larval
222 struct crypto_larval *larval; in __crypto_register_alg() local
253 larval = crypto_larval_alloc(alg->cra_name, in __crypto_register_alg()
255 if (IS_ERR(larval)) in __crypto_register_alg()
259 larval->adult = crypto_mod_get(alg); in __crypto_register_alg()
260 if (!larval->adult) in __crypto_register_alg()
263 refcount_set(&larval->alg.cra_refcnt, 1); in __crypto_register_alg()
264 memcpy(larval->alg.cra_driver_name, alg->cra_driver_name, in __crypto_register_alg()
266 larval->alg.cra_priority = alg->cra_priority; in __crypto_register_alg()
269 list_add(&larval->alg.cra_list, &crypto_alg_list); in __crypto_register_alg()
274 return larval; in __crypto_register_alg()
277 kfree(larval); in __crypto_register_alg()
279 larval = ERR_PTR(ret); in __crypto_register_alg()
336 struct crypto_larval *larval = (void *)q; in crypto_alg_tested() local
347 if (larval->adult) in crypto_alg_tested()
349 if ((q->cra_flags ^ alg->cra_flags) & larval->mask) in crypto_alg_tested()
353 larval->adult = alg; in crypto_alg_tested()
355 larval->adult = ERR_PTR(-EAGAIN); in crypto_alg_tested()
392 static void crypto_wait_for_test(struct crypto_larval *larval) in crypto_wait_for_test() argument
396 err = crypto_probing_notify(CRYPTO_MSG_ALG_REGISTER, larval->adult); in crypto_wait_for_test()
400 crypto_alg_tested(larval->alg.cra_driver_name, 0); in crypto_wait_for_test()
403 err = wait_for_completion_killable(&larval->completion); in crypto_wait_for_test()
406 crypto_notify(CRYPTO_MSG_ALG_LOADED, larval); in crypto_wait_for_test()
409 crypto_larval_kill(&larval->alg); in crypto_wait_for_test()
414 struct crypto_larval *larval; in crypto_register_alg() local
423 larval = __crypto_register_alg(alg); in crypto_register_alg()
426 if (IS_ERR(larval)) in crypto_register_alg()
427 return PTR_ERR(larval); in crypto_register_alg()
429 crypto_wait_for_test(larval); in crypto_register_alg()
603 struct crypto_larval *larval; in crypto_register_instance() local
616 larval = ERR_PTR(-EAGAIN); in crypto_register_instance()
632 larval = __crypto_register_alg(&inst->alg); in crypto_register_instance()
633 if (IS_ERR(larval)) in crypto_register_instance()
642 err = PTR_ERR(larval); in crypto_register_instance()
643 if (IS_ERR(larval)) in crypto_register_instance()
646 crypto_wait_for_test(larval); in crypto_register_instance()