mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-23 07:23:12 +02:00
crypto: algapi - Add driver template support to crypto_inst_setname
Add support to crypto_inst_setname for having a driver template name that differs from the algorithm template name. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
32a9fd8f49
commit
91b6ff579d
|
@ -923,20 +923,20 @@ const char *crypto_attr_alg_name(struct rtattr *rta)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(crypto_attr_alg_name);
|
EXPORT_SYMBOL_GPL(crypto_attr_alg_name);
|
||||||
|
|
||||||
int crypto_inst_setname(struct crypto_instance *inst, const char *name,
|
int __crypto_inst_setname(struct crypto_instance *inst, const char *name,
|
||||||
struct crypto_alg *alg)
|
const char *driver, struct crypto_alg *alg)
|
||||||
{
|
{
|
||||||
if (snprintf(inst->alg.cra_name, CRYPTO_MAX_ALG_NAME, "%s(%s)", name,
|
if (snprintf(inst->alg.cra_name, CRYPTO_MAX_ALG_NAME, "%s(%s)", name,
|
||||||
alg->cra_name) >= CRYPTO_MAX_ALG_NAME)
|
alg->cra_name) >= CRYPTO_MAX_ALG_NAME)
|
||||||
return -ENAMETOOLONG;
|
return -ENAMETOOLONG;
|
||||||
|
|
||||||
if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s(%s)",
|
if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s(%s)",
|
||||||
name, alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME)
|
driver, alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME)
|
||||||
return -ENAMETOOLONG;
|
return -ENAMETOOLONG;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(crypto_inst_setname);
|
EXPORT_SYMBOL_GPL(__crypto_inst_setname);
|
||||||
|
|
||||||
void crypto_init_queue(struct crypto_queue *queue, unsigned int max_qlen)
|
void crypto_init_queue(struct crypto_queue *queue, unsigned int max_qlen)
|
||||||
{
|
{
|
||||||
|
|
|
@ -146,8 +146,16 @@ void *crypto_spawn_tfm2(struct crypto_spawn *spawn);
|
||||||
struct crypto_attr_type *crypto_get_attr_type(struct rtattr **tb);
|
struct crypto_attr_type *crypto_get_attr_type(struct rtattr **tb);
|
||||||
int crypto_check_attr_type(struct rtattr **tb, u32 type, u32 *mask_ret);
|
int crypto_check_attr_type(struct rtattr **tb, u32 type, u32 *mask_ret);
|
||||||
const char *crypto_attr_alg_name(struct rtattr *rta);
|
const char *crypto_attr_alg_name(struct rtattr *rta);
|
||||||
int crypto_inst_setname(struct crypto_instance *inst, const char *name,
|
int __crypto_inst_setname(struct crypto_instance *inst, const char *name,
|
||||||
struct crypto_alg *alg);
|
const char *driver, struct crypto_alg *alg);
|
||||||
|
|
||||||
|
#define crypto_inst_setname(inst, name, ...) \
|
||||||
|
CONCATENATE(crypto_inst_setname_, COUNT_ARGS(__VA_ARGS__))( \
|
||||||
|
inst, name, ##__VA_ARGS__)
|
||||||
|
#define crypto_inst_setname_1(inst, name, alg) \
|
||||||
|
__crypto_inst_setname(inst, name, name, alg)
|
||||||
|
#define crypto_inst_setname_2(inst, name, driver, alg) \
|
||||||
|
__crypto_inst_setname(inst, name, driver, alg)
|
||||||
|
|
||||||
void crypto_init_queue(struct crypto_queue *queue, unsigned int max_qlen);
|
void crypto_init_queue(struct crypto_queue *queue, unsigned int max_qlen);
|
||||||
int crypto_enqueue_request(struct crypto_queue *queue,
|
int crypto_enqueue_request(struct crypto_queue *queue,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user