aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanne Peltonen <janne.peltonen@nokia.com>2023-02-20 19:29:38 +0200
committerMatias Elo <matias.elo@nokia.com>2023-04-12 15:52:37 +0300
commit495704e419eaa82aa4cac77c5d29d664032da461 (patch)
treee228fdc7ec3624eec4d15e603d98327e31670e4f
parent8fbdef844009f78aff372a6022e125da15bdd064 (diff)
linux-gen: crypto: set hw_err status only if deprecated API enabled
Prepare for the deprecation of the hw_err operation status field by setting it only when compiled with deprecated API enabled. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Anoob Joseph <anoobj@marvell.com>
-rw-r--r--platform/linux-generic/arch/aarch64/odp_crypto_armv8.c4
-rw-r--r--platform/linux-generic/odp_crypto_ipsecmb.c4
-rw-r--r--platform/linux-generic/odp_crypto_null.c4
-rw-r--r--platform/linux-generic/odp_crypto_openssl.c4
4 files changed, 12 insertions, 4 deletions
diff --git a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c
index ee0307371..1fadec154 100644
--- a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c
+++ b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c
@@ -181,9 +181,11 @@ static inline void set_crypto_op_result(odp_packet_t pkt,
op_result = &packet_hdr(pkt)->crypto_op_result;
op_result->cipher_status.alg_err = cipher_err;
- op_result->cipher_status.hw_err = ODP_CRYPTO_HW_ERR_NONE;
op_result->auth_status.alg_err = auth_err;
+#if ODP_DEPRECATED_API
+ op_result->cipher_status.hw_err = ODP_CRYPTO_HW_ERR_NONE;
op_result->auth_status.hw_err = ODP_CRYPTO_HW_ERR_NONE;
+#endif
op_result->ok = (cipher_err == ODP_CRYPTO_ALG_ERR_NONE &&
auth_err == ODP_CRYPTO_ALG_ERR_NONE);
}
diff --git a/platform/linux-generic/odp_crypto_ipsecmb.c b/platform/linux-generic/odp_crypto_ipsecmb.c
index 6c59957cb..1454bef4f 100644
--- a/platform/linux-generic/odp_crypto_ipsecmb.c
+++ b/platform/linux-generic/odp_crypto_ipsecmb.c
@@ -913,9 +913,11 @@ int crypto_int(odp_packet_t pkt_in,
packet_subtype_set(out_pkt, ODP_EVENT_PACKET_CRYPTO);
op_result = &packet_hdr(out_pkt)->crypto_op_result;
op_result->cipher_status.alg_err = rc_cipher;
- op_result->cipher_status.hw_err = ODP_CRYPTO_HW_ERR_NONE;
op_result->auth_status.alg_err = rc_auth;
+#if ODP_DEPRECATED_API
+ op_result->cipher_status.hw_err = ODP_CRYPTO_HW_ERR_NONE;
op_result->auth_status.hw_err = ODP_CRYPTO_HW_ERR_NONE;
+#endif
op_result->ok =
(rc_cipher == ODP_CRYPTO_ALG_ERR_NONE) &&
(rc_auth == ODP_CRYPTO_ALG_ERR_NONE);
diff --git a/platform/linux-generic/odp_crypto_null.c b/platform/linux-generic/odp_crypto_null.c
index 8f84a1e1e..5faaaeb27 100644
--- a/platform/linux-generic/odp_crypto_null.c
+++ b/platform/linux-generic/odp_crypto_null.c
@@ -534,9 +534,11 @@ int crypto_int(odp_packet_t pkt_in,
packet_subtype_set(out_pkt, ODP_EVENT_PACKET_CRYPTO);
op_result = &packet_hdr(out_pkt)->crypto_op_result;
op_result->cipher_status.alg_err = ODP_CRYPTO_ALG_ERR_NONE;
- op_result->cipher_status.hw_err = ODP_CRYPTO_HW_ERR_NONE;
op_result->auth_status.alg_err = ODP_CRYPTO_ALG_ERR_NONE;
+#if ODP_DEPRECATED_API
+ op_result->cipher_status.hw_err = ODP_CRYPTO_HW_ERR_NONE;
op_result->auth_status.hw_err = ODP_CRYPTO_HW_ERR_NONE;
+#endif
op_result->ok = true;
/* Synchronous, simply return results */
diff --git a/platform/linux-generic/odp_crypto_openssl.c b/platform/linux-generic/odp_crypto_openssl.c
index 3912b37ec..2d9b69f5a 100644
--- a/platform/linux-generic/odp_crypto_openssl.c
+++ b/platform/linux-generic/odp_crypto_openssl.c
@@ -2712,9 +2712,11 @@ out:
packet_subtype_set(out_pkt, ODP_EVENT_PACKET_CRYPTO);
op_result = &packet_hdr(out_pkt)->crypto_op_result;
op_result->cipher_status.alg_err = rc_cipher;
- op_result->cipher_status.hw_err = ODP_CRYPTO_HW_ERR_NONE;
op_result->auth_status.alg_err = rc_auth;
+#if ODP_DEPRECATED_API
+ op_result->cipher_status.hw_err = ODP_CRYPTO_HW_ERR_NONE;
op_result->auth_status.hw_err = ODP_CRYPTO_HW_ERR_NONE;
+#endif
op_result->ok =
(rc_cipher == ODP_CRYPTO_ALG_ERR_NONE) &&
(rc_auth == ODP_CRYPTO_ALG_ERR_NONE);