After adapting to uadk's heterogeneous scheduling framework, all uadk algorithms have completed functional adaptation. After the adaptation is completed, the old functions need to be deleted.
Signed-off-by: Longfang Liu liulongfang@huawei.com --- include/wd_util.h | 15 +++------------ wd_aead.c | 8 ++++---- wd_agg.c | 6 +++--- wd_cipher.c | 8 ++++---- wd_comp.c | 8 ++++---- wd_dh.c | 8 ++++---- wd_digest.c | 8 ++++---- wd_ecc.c | 8 ++++---- wd_rsa.c | 8 ++++---- wd_util.c | 23 ++--------------------- 10 files changed, 36 insertions(+), 64 deletions(-)
diff --git a/include/wd_util.h b/include/wd_util.h index ff9aa02..2850341 100644 --- a/include/wd_util.h +++ b/include/wd_util.h @@ -131,7 +131,6 @@ struct wd_init_attrs { struct wd_ctx_config *ctx_config; wd_alg_init alg_init; wd_alg_poll_ctx alg_poll_ctx; - struct wd_alg_driver *driver; //stub for old code };
/* @@ -454,14 +453,10 @@ static inline void wd_alg_clear_init(enum wd_status *status) * * Return 0 if succeed and other error number if fail. */ -int wd_ctx_param_init_nw(struct wd_ctx_params *ctx_params, +int wd_ctx_param_init(struct wd_ctx_params *ctx_params, struct wd_ctx_params *user_ctx_params, char *alg, int task_type, enum wd_type type, int max_op_type); -int wd_ctx_param_init(struct wd_ctx_params *ctx_params, - struct wd_ctx_params *user_ctx_params, - struct wd_alg_driver *driver, - enum wd_type type, int max_op_type);
void wd_ctx_param_uninit(struct wd_ctx_params *ctx_params);
@@ -495,12 +490,8 @@ void wd_alg_drv_unbind(struct wd_alg_driver *drv); * * Return 0 if succeed and other error number if fail. */ -int wd_alg_init_driver_nw(struct wd_ctx_config_internal *config); -void wd_alg_uninit_driver_nw(struct wd_ctx_config_internal *config); -int wd_alg_init_driver(struct wd_ctx_config_internal *config, - struct wd_alg_driver *driver, void **drv_priv); -void wd_alg_uninit_driver(struct wd_ctx_config_internal *config, - struct wd_alg_driver *driver, void **drv_priv); +int wd_alg_init_driver(struct wd_ctx_config_internal *config); +void wd_alg_uninit_driver(struct wd_ctx_config_internal *config);
/** * wd_dlopen_drv() - Open the dynamic library file of the device driver. diff --git a/wd_aead.c b/wd_aead.c index 3448144..5525e72 100644 --- a/wd_aead.c +++ b/wd_aead.c @@ -496,7 +496,7 @@ int wd_aead_init(struct wd_ctx_config *config, struct wd_sched *sched) if (ret) goto out_uninit_nolock;
- ret = wd_alg_init_driver_nw(&wd_aead_setting.config); + ret = wd_alg_init_driver(&wd_aead_setting.config); if (ret) goto out_drv_deconfig; wd_alg_set_init(&wd_aead_setting.status); @@ -519,7 +519,7 @@ void wd_aead_uninit(void) if (!wd_aead_setting.priv) return;
- wd_alg_uninit_driver_nw(&wd_aead_setting.config); + wd_alg_uninit_driver(&wd_aead_setting.config); wd_ctx_drv_deconfig(&wd_aead_setting.config);
wd_aead_uninit_nolock(); @@ -573,7 +573,7 @@ int wd_aead_init2_(char *alg, __u32 sched_type, int task_type, memset(&wd_aead_setting.config, 0, sizeof(struct wd_ctx_config_internal)); /* Init ctx param and prepare for ctx request */ aead_ctx_params.ctx_set_num = aead_ctx_num; - ret = wd_ctx_param_init_nw(&aead_ctx_params, ctx_params, + ret = wd_ctx_param_init(&aead_ctx_params, ctx_params, alg, task_type, WD_AEAD_TYPE, WD_DIGEST_CIPHER_DECRYPTION + 1); if (ret) { if (ret == -WD_EAGAIN) { @@ -602,7 +602,7 @@ int wd_aead_init2_(char *alg, __u32 sched_type, int task_type, if (ret) goto out_uninit_nolock;
- ret = wd_alg_init_driver_nw(&wd_aead_setting.config); + ret = wd_alg_init_driver(&wd_aead_setting.config); if (ret) goto out_drv_deconfig;
diff --git a/wd_agg.c b/wd_agg.c index 5cf21d3..26613ef 100644 --- a/wd_agg.c +++ b/wd_agg.c @@ -673,7 +673,7 @@ int wd_agg_init(char *alg, __u32 sched_type, int task_type, struct wd_ctx_params
/* Init ctx param and prepare for ctx request */ agg_ctx_params.ctx_set_num = &agg_ctx_num; - ret = wd_ctx_param_init_nw(&agg_ctx_params, ctx_params, alg, task_type, + ret = wd_ctx_param_init(&agg_ctx_params, ctx_params, alg, task_type, WD_AGG_TYPE, 1); if (ret) { if (ret == -WD_EAGAIN) { @@ -702,7 +702,7 @@ int wd_agg_init(char *alg, __u32 sched_type, int task_type, struct wd_ctx_params if (ret) goto out_uninit_nolock;
- ret = wd_alg_init_driver_nw(&wd_agg_setting.config); + ret = wd_alg_init_driver(&wd_agg_setting.config); if (ret) goto out_drv_deconfig;
@@ -733,7 +733,7 @@ void wd_agg_uninit(void) if (ret) return;
- wd_alg_uninit_driver_nw(&wd_agg_setting.config); + wd_alg_uninit_driver(&wd_agg_setting.config); wd_ctx_drv_deconfig(&wd_agg_setting.config);
wd_agg_close_driver(); diff --git a/wd_cipher.c b/wd_cipher.c index 69bc63f..8c34985 100644 --- a/wd_cipher.c +++ b/wd_cipher.c @@ -386,7 +386,7 @@ int wd_cipher_init(struct wd_ctx_config *config, struct wd_sched *sched) if (ret) goto out_uninit_nolock;
- ret = wd_alg_init_driver_nw(&wd_cipher_setting.config); + ret = wd_alg_init_driver(&wd_cipher_setting.config); if (ret) goto out_drv_deconfig;
@@ -409,7 +409,7 @@ void wd_cipher_uninit(void) { int ret;
- wd_alg_uninit_driver_nw(&wd_cipher_setting.config); + wd_alg_uninit_driver(&wd_cipher_setting.config); wd_ctx_drv_deconfig(&wd_cipher_setting.config);
ret = wd_cipher_common_uninit(); @@ -454,7 +454,7 @@ int wd_cipher_init2_(char *alg, __u32 sched_type, int task_type, struct wd_ctx_p
/* Init ctx param and prepare for ctx request */ cipher_ctx_params.ctx_set_num = cipher_ctx_num; - ret = wd_ctx_param_init_nw(&cipher_ctx_params, ctx_params, + ret = wd_ctx_param_init(&cipher_ctx_params, ctx_params, alg, task_type, WD_CIPHER_TYPE, WD_CIPHER_DECRYPTION + 1); if (ret) { if (ret == -WD_EAGAIN) { @@ -485,7 +485,7 @@ int wd_cipher_init2_(char *alg, __u32 sched_type, int task_type, struct wd_ctx_p if (ret) goto out_uninit_nolock;
- ret = wd_alg_init_driver_nw(&wd_cipher_setting.config); + ret = wd_alg_init_driver(&wd_cipher_setting.config); if (ret) goto out_drv_deconfig;
diff --git a/wd_comp.c b/wd_comp.c index 52c711c..0e1be5f 100644 --- a/wd_comp.c +++ b/wd_comp.c @@ -208,7 +208,7 @@ int wd_comp_init(struct wd_ctx_config *config, struct wd_sched *sched) if (ret) goto out_uninit_nolock;
- ret = wd_alg_init_driver_nw(&wd_comp_setting.config); + ret = wd_alg_init_driver(&wd_comp_setting.config); if (ret) goto out_drv_deconfig;
@@ -231,7 +231,7 @@ void wd_comp_uninit(void) { int ret;
- wd_alg_uninit_driver_nw(&wd_comp_setting.config); + wd_alg_uninit_driver(&wd_comp_setting.config); wd_ctx_drv_deconfig(&wd_comp_setting.config);
ret = wd_comp_uninit_nolock(); @@ -276,7 +276,7 @@ int wd_comp_init2_(char *alg, __u32 sched_type, int task_type, struct wd_ctx_par
/* Init ctx param and prepare for ctx request */ comp_ctx_params.ctx_set_num = comp_ctx_num; - ret = wd_ctx_param_init_nw(&comp_ctx_params, ctx_params, + ret = wd_ctx_param_init(&comp_ctx_params, ctx_params, alg, task_type, WD_COMP_TYPE, WD_DIR_MAX); if (ret) { if (ret == -WD_EAGAIN) { @@ -306,7 +306,7 @@ int wd_comp_init2_(char *alg, __u32 sched_type, int task_type, struct wd_ctx_par if (ret) goto out_uninit_nolock;
- ret = wd_alg_init_driver_nw(&wd_comp_setting.config); + ret = wd_alg_init_driver(&wd_comp_setting.config); if (ret) goto out_drv_deconfig;
diff --git a/wd_dh.c b/wd_dh.c index 55cced7..907876d 100644 --- a/wd_dh.c +++ b/wd_dh.c @@ -181,7 +181,7 @@ int wd_dh_init(struct wd_ctx_config *config, struct wd_sched *sched) if (ret) goto out_uninit_nolock;
- ret = wd_alg_init_driver_nw(&wd_dh_setting.config); + ret = wd_alg_init_driver(&wd_dh_setting.config); if (ret) goto out_drv_deconfig;
@@ -208,7 +208,7 @@ void wd_dh_uninit(void) if (ret) return;
- wd_alg_uninit_driver_nw(&wd_dh_setting.config); + wd_alg_uninit_driver(&wd_dh_setting.config); wd_ctx_drv_deconfig(&wd_dh_setting.config);
wd_dh_close_driver(WD_TYPE_V1); @@ -247,7 +247,7 @@ int wd_dh_init2_(char *alg, __u32 sched_type, int task_type, struct wd_ctx_param
/* Init ctx param and prepare for ctx request */ dh_ctx_params.ctx_set_num = dh_ctx_num; - ret = wd_ctx_param_init_nw(&dh_ctx_params, ctx_params, + ret = wd_ctx_param_init(&dh_ctx_params, ctx_params, alg, task_type, WD_DH_TYPE, WD_DH_PHASE2); if (ret) { if (ret == -WD_EAGAIN) @@ -276,7 +276,7 @@ int wd_dh_init2_(char *alg, __u32 sched_type, int task_type, struct wd_ctx_param if (ret) goto out_uninit_nolock;
- ret = wd_alg_init_driver_nw(&wd_dh_setting.config); + ret = wd_alg_init_driver(&wd_dh_setting.config); if (ret) goto out_drv_deconfig;
diff --git a/wd_digest.c b/wd_digest.c index e8113a7..10d075d 100644 --- a/wd_digest.c +++ b/wd_digest.c @@ -309,7 +309,7 @@ int wd_digest_init(struct wd_ctx_config *config, struct wd_sched *sched) if (ret) goto out_uninit_nolock;
- ret = wd_alg_init_driver_nw(&wd_digest_setting.config); + ret = wd_alg_init_driver(&wd_digest_setting.config); if (ret) goto out_drv_deconfig;
@@ -333,7 +333,7 @@ void wd_digest_uninit(void) if (!wd_digest_setting.priv) return;
- wd_alg_uninit_driver_nw(&wd_digest_setting.config); + wd_alg_uninit_driver(&wd_digest_setting.config); wd_ctx_drv_deconfig(&wd_digest_setting.config);
wd_digest_uninit_nolock(); @@ -385,7 +385,7 @@ int wd_digest_init2_(char *alg, __u32 sched_type, int task_type,
/* Init ctx param and prepare for ctx request */ digest_ctx_params.ctx_set_num = &digest_ctx_num; - ret = wd_ctx_param_init_nw(&digest_ctx_params, ctx_params, + ret = wd_ctx_param_init(&digest_ctx_params, ctx_params, alg, task_type, WD_DIGEST_TYPE, 1); if (ret) { if (ret == -WD_EAGAIN) { @@ -414,7 +414,7 @@ int wd_digest_init2_(char *alg, __u32 sched_type, int task_type, if (ret) goto out_uninit_nolock;
- ret = wd_alg_init_driver_nw(&wd_digest_setting.config); + ret = wd_alg_init_driver(&wd_digest_setting.config); if (ret) goto out_drv_deconfig;
diff --git a/wd_ecc.c b/wd_ecc.c index e63d66d..146f3ac 100644 --- a/wd_ecc.c +++ b/wd_ecc.c @@ -244,7 +244,7 @@ int wd_ecc_init(struct wd_ctx_config *config, struct wd_sched *sched) if (ret) goto out_uninit_nolock;
- ret = wd_alg_init_driver_nw(&wd_ecc_setting.config); + ret = wd_alg_init_driver(&wd_ecc_setting.config); if (ret) goto out_drv_deconfig;
@@ -267,7 +267,7 @@ void wd_ecc_uninit(void) { int ret;
- wd_alg_uninit_driver_nw(&wd_ecc_setting.config); + wd_alg_uninit_driver(&wd_ecc_setting.config); wd_ctx_drv_deconfig(&wd_ecc_setting.config); ret = wd_ecc_common_uninit(); if (ret) @@ -311,7 +311,7 @@ int wd_ecc_init2_(char *alg, __u32 sched_type, int task_type, struct wd_ctx_para
/* Init ctx param and prepare for ctx request */ ecc_ctx_params.ctx_set_num = ecc_ctx_num; - ret = wd_ctx_param_init_nw(&ecc_ctx_params, ctx_params, + ret = wd_ctx_param_init(&ecc_ctx_params, ctx_params, alg, task_type, WD_ECC_TYPE, WD_EC_OP_MAX); if (ret) { if (ret == -WD_EAGAIN) @@ -341,7 +341,7 @@ int wd_ecc_init2_(char *alg, __u32 sched_type, int task_type, struct wd_ctx_para if (ret) goto out_uninit_nolock;
- ret = wd_alg_init_driver_nw(&wd_ecc_setting.config); + ret = wd_alg_init_driver(&wd_ecc_setting.config); if (ret) goto out_drv_deconfig;
diff --git a/wd_rsa.c b/wd_rsa.c index 80acf58..5f012c9 100644 --- a/wd_rsa.c +++ b/wd_rsa.c @@ -221,7 +221,7 @@ int wd_rsa_init(struct wd_ctx_config *config, struct wd_sched *sched) if (ret) goto out_uninit_nolock;
- ret = wd_alg_init_driver_nw(&wd_rsa_setting.config); + ret = wd_alg_init_driver(&wd_rsa_setting.config); if (ret) goto out_drv_deconfig;
@@ -244,7 +244,7 @@ void wd_rsa_uninit(void) { int ret;
- wd_alg_uninit_driver_nw(&wd_rsa_setting.config); + wd_alg_uninit_driver(&wd_rsa_setting.config); wd_ctx_drv_deconfig(&wd_rsa_setting.config); ret = wd_rsa_common_uninit(); if (ret) @@ -286,7 +286,7 @@ int wd_rsa_init2_(char *alg, __u32 sched_type, int task_type, struct wd_ctx_para
/* Init ctx param and prepare for ctx request */ rsa_ctx_params.ctx_set_num = rsa_ctx_num; - ret = wd_ctx_param_init_nw(&rsa_ctx_params, ctx_params, + ret = wd_ctx_param_init(&rsa_ctx_params, ctx_params, alg, task_type, WD_RSA_TYPE, WD_RSA_GENKEY); if (ret) { if (ret == -WD_EAGAIN) @@ -316,7 +316,7 @@ int wd_rsa_init2_(char *alg, __u32 sched_type, int task_type, struct wd_ctx_para if (ret) goto out_uninit_nolock;
- ret = wd_alg_init_driver_nw(&wd_rsa_setting.config); + ret = wd_alg_init_driver(&wd_rsa_setting.config); if (ret) goto out_drv_deconfig;
diff --git a/wd_util.c b/wd_util.c index bf6894b..b3c155d 100644 --- a/wd_util.c +++ b/wd_util.c @@ -2066,13 +2066,7 @@ static void wd_ctx_uninit_driver(struct wd_ctx_config_internal *config, } }
-int wd_alg_init_driver(struct wd_ctx_config_internal *config, - struct wd_alg_driver *driver, void **drv_priv) -{ - return 0; -} - -int wd_alg_init_driver_nw(struct wd_ctx_config_internal *config) +int wd_alg_init_driver(struct wd_ctx_config_internal *config) { __u32 i, j; int ret; @@ -2095,12 +2089,7 @@ init_err: return ret; }
-void wd_alg_uninit_driver(struct wd_ctx_config_internal *config, - struct wd_alg_driver *driver, void **drv_priv) -{ -} - -void wd_alg_uninit_driver_nw(struct wd_ctx_config_internal *config) +void wd_alg_uninit_driver(struct wd_ctx_config_internal *config) { __u32 i;
@@ -2231,14 +2220,6 @@ void wd_ctx_param_uninit(struct wd_ctx_params *ctx_params) }
int wd_ctx_param_init(struct wd_ctx_params *ctx_params, - struct wd_ctx_params *user_ctx_params, - struct wd_alg_driver *driver, - enum wd_type type, int max_op_type) -{ - return 0; -} - -int wd_ctx_param_init_nw(struct wd_ctx_params *ctx_params, struct wd_ctx_params *user_ctx_params, char *alg, int task_type, enum wd_type type, int max_op_type)