Lines Matching refs:type

30 	const struct af_alg_type *type;  member
45 const struct af_alg_type *type = ERR_PTR(-ENOENT); in alg_get_type() local
50 if (strcmp(node->type->name, name)) in alg_get_type()
53 if (try_module_get(node->type->owner)) in alg_get_type()
54 type = node->type; in alg_get_type()
59 return type; in alg_get_type()
62 int af_alg_register_type(const struct af_alg_type *type) in af_alg_register_type() argument
69 if (!strcmp(node->type->name, type->name)) in af_alg_register_type()
78 type->ops->owner = THIS_MODULE; in af_alg_register_type()
79 if (type->ops_nokey) in af_alg_register_type()
80 type->ops_nokey->owner = THIS_MODULE; in af_alg_register_type()
81 node->type = type; in af_alg_register_type()
92 int af_alg_unregister_type(const struct af_alg_type *type) in af_alg_unregister_type() argument
99 if (strcmp(node->type->name, type->name)) in af_alg_unregister_type()
113 static void alg_do_release(const struct af_alg_type *type, void *private) in alg_do_release() argument
115 if (!type) in alg_do_release()
118 type->release(private); in alg_do_release()
119 module_put(type->owner); in alg_do_release()
154 const struct af_alg_type *type; in alg_bind() local
175 type = alg_get_type(sa->salg_type); in alg_bind()
176 if (PTR_ERR(type) == -ENOENT) { in alg_bind()
178 type = alg_get_type(sa->salg_type); in alg_bind()
181 if (IS_ERR(type)) in alg_bind()
182 return PTR_ERR(type); in alg_bind()
184 private = type->bind(sa->salg_name, sa->salg_feat, sa->salg_mask); in alg_bind()
186 module_put(type->owner); in alg_bind()
195 swap(ask->type, type); in alg_bind()
203 alg_do_release(type, private); in alg_bind()
211 const struct af_alg_type *type = ask->type; in alg_setkey() local
223 err = type->setkey(ask->private, key, keylen); in alg_setkey()
289 const struct af_alg_type *type = ask->type; in alg_setkey_by_key_serial() local
310 if (!strcmp(key->type->name, "user") || in alg_setkey_by_key_serial()
311 !strcmp(key->type->name, "logon")) { in alg_setkey_by_key_serial()
314 !strcmp(key->type->name, "encrypted")) { in alg_setkey_by_key_serial()
317 !strcmp(key->type->name, "trusted")) { in alg_setkey_by_key_serial()
339 err = type->setkey(ask->private, key_data, key_datalen); in alg_setkey_by_key_serial()
362 const struct af_alg_type *type; in alg_setsockopt() local
369 type = ask->type; in alg_setsockopt()
372 if (level != SOL_ALG || !type) in alg_setsockopt()
380 if (!type->setkey) in alg_setsockopt()
391 if (!type->setauthsize) in alg_setsockopt()
393 err = type->setauthsize(ask->private, optlen); in alg_setsockopt()
398 if (!type->setentropy) in alg_setsockopt()
401 err = type->setentropy(ask->private, optval, optlen); in alg_setsockopt()
414 const struct af_alg_type *type; in af_alg_accept() local
420 type = ask->type; in af_alg_accept()
423 if (!type) in af_alg_accept()
439 newsock->ops = type->ops; in af_alg_accept()
440 err = type->accept(ask->private, sk2); in af_alg_accept()
443 if (nokey && type->accept_nokey) in af_alg_accept()
444 err = type->accept_nokey(ask->private, sk2); in af_alg_accept()
456 alg_sk(sk2)->type = type; in af_alg_accept()
461 newsock->ops = type->ops_nokey; in af_alg_accept()
502 alg_do_release(ask->type, ask->private); in alg_sock_destruct()
511 if (sock->type != SOCK_SEQPACKET) in alg_create()