After the dynamic loading framework separates the priority attribute and the driver type attribute. An update is required in the device driver.
Signed-off-by: Longfang Liu liulongfang@huawei.com --- drv/hisi_comp.c | 5 +++-- drv/hisi_hpre.c | 21 ++++++++++++++++----- drv/hisi_sec.c | 10 +++++----- 3 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/drv/hisi_comp.c b/drv/hisi_comp.c index 01e2ad8..4def014 100644 --- a/drv/hisi_comp.c +++ b/drv/hisi_comp.c @@ -1059,8 +1059,9 @@ static int hisi_zip_comp_recv(handle_t ctx, void *comp_msg) #define GEN_ZIP_ALG_DRIVER(zip_alg_name) \ {\ .drv_name = "hisi_zip",\ - .alg_name = zip_alg_name,\ - .priority = UADK_ALG_HW,\ + .alg_name = (zip_alg_name),\ + .calc_type = UADK_ALG_HW,\ + .priority = 100,\ .priv_size = sizeof(struct hisi_zip_ctx),\ .queue_num = ZIP_CTX_Q_NUM_DEF,\ .op_type_num = 2,\ diff --git a/drv/hisi_hpre.c b/drv/hisi_hpre.c index 4d21788..0dad26b 100644 --- a/drv/hisi_hpre.c +++ b/drv/hisi_hpre.c @@ -2437,11 +2437,17 @@ static int ecc_recv(handle_t ctx, void *ecc_msg) return ecc_sqe_parse((struct hisi_qp *)h_qp, msg, &hw_msg); }
+static int hpre_get_usage(void *param) +{ + return 0; +} + #define GEN_HPRE_ALG_DRIVER(hpre_alg_name) \ {\ .drv_name = "hisi_hpre",\ - .alg_name = hpre_alg_name,\ - .priority = UADK_ALG_HW,\ + .alg_name = (hpre_alg_name),\ + .calc_type = UADK_ALG_HW,\ + .priority = 100,\ .priv_size = sizeof(struct hisi_hpre_ctx),\ .queue_num = HPRE_CTX_Q_NUM_DEF,\ .op_type_num = 1,\ @@ -2450,9 +2456,10 @@ static int ecc_recv(handle_t ctx, void *ecc_msg) .exit = hpre_exit,\ .send = ecc_send,\ .recv = ecc_recv,\ + .get_usage = hpre_get_usage,\ }
-static struct wd_alg_driver hpre_alg_driver[] = { +static struct wd_alg_driver hpre_ecc_driver[] = { GEN_HPRE_ALG_DRIVER("sm2"), GEN_HPRE_ALG_DRIVER("ecdh"), GEN_HPRE_ALG_DRIVER("ecdsa"), @@ -2463,7 +2470,8 @@ static struct wd_alg_driver hpre_alg_driver[] = { static struct wd_alg_driver hpre_rsa_driver = { .drv_name = "hisi_hpre", .alg_name = "rsa", - .priority = UADK_ALG_HW, + .calc_type = UADK_ALG_HW, + .priority = 100, .priv_size = sizeof(struct hisi_hpre_ctx), .queue_num = HPRE_CTX_Q_NUM_DEF, .op_type_num = 1, @@ -2472,12 +2480,14 @@ static struct wd_alg_driver hpre_rsa_driver = { .exit = hpre_exit, .send = rsa_send, .recv = rsa_recv, + .get_usage = hpre_get_usage, };
static struct wd_alg_driver hpre_dh_driver = { .drv_name = "hisi_hpre", .alg_name = "dh", - .priority = UADK_ALG_HW, + .calc_type = UADK_ALG_HW, + .priority = 100, .priv_size = sizeof(struct hisi_hpre_ctx), .queue_num = HPRE_CTX_Q_NUM_DEF, .op_type_num = 1, @@ -2486,6 +2496,7 @@ static struct wd_alg_driver hpre_dh_driver = { .exit = hpre_exit, .send = dh_send, .recv = dh_recv, + .get_usage = hpre_get_usage, }; static void __attribute__((constructor)) hisi_hpre_probe(void) { diff --git a/drv/hisi_sec.c b/drv/hisi_sec.c index bf05e05..1f5682c 100644 --- a/drv/hisi_sec.c +++ b/drv/hisi_sec.c @@ -517,8 +517,8 @@ static __u32 g_sec_hmac_full_len[WD_DIGEST_TYPE_MAX] = { SEC_HMAC_SHA512_MAC_LEN, SEC_HMAC_SHA512_224_MAC_LEN, SEC_HMAC_SHA512_256_MAC_LEN };
-int hisi_sec_init(void *conf, void *priv); -void hisi_sec_exit(void *priv); +static int hisi_sec_init(void *conf, void *priv); +static void hisi_sec_exit(void *priv);
static int hisi_sec_get_usage(void *param) { @@ -528,8 +528,9 @@ static int hisi_sec_get_usage(void *param) #define GEN_SEC_ALG_DRIVER(sec_alg_name) \ {\ .drv_name = "hisi_sec2",\ - .alg_name = sec_alg_name,\ - .priority = UADK_ALG_HW,\ + .alg_name = (sec_alg_name),\ + .calc_type = UADK_ALG_HW,\ + .priority = 100,\ .priv_size = sizeof(struct hisi_sec_ctx),\ .queue_num = SEC_CTX_Q_NUM_DEF,\ .op_type_num = 1,\ @@ -587,7 +588,6 @@ static struct wd_alg_driver aead_alg_driver[] = { GEN_SEC_ALG_DRIVER("authenc(hmac(sha256),cbc(aes))"), GEN_SEC_ALG_DRIVER("ccm(sm4)"), GEN_SEC_ALG_DRIVER("gcm(sm4)"), - GEN_SEC_ALG_DRIVER("authenc(hmac(sha256),cbc(sm4))"), };
static void dump_sec_msg(void *msg, const char *alg)