see [rk] inline, I think one of your assert checks needs some more parentheses.
-----Original Message----- From: Taras Kondratiuk [mailto:[email protected]] Sent: Friday, December 12, 2014 5:40 PM To: [email protected]; Robbie King (robking) Cc: Taras Kondratiuk Subject: [PATCH 3/3] linux-generic: crypto: implement odp_crypto_get_operation_compl_packet() Signed-off-by: Taras Kondratiuk <[email protected]> --- platform/linux-generic/include/odp_crypto_internal.h | 1 + platform/linux-generic/odp_crypto.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/platform/linux-generic/include/odp_crypto_internal.h b/platform/linux-generic/include/odp_crypto_internal.h index 6ecfe80..8a50d60 100644 --- a/platform/linux-generic/include/odp_crypto_internal.h +++ b/platform/linux-generic/include/odp_crypto_internal.h @@ -70,6 +70,7 @@ typedef struct odp_crypto_generic_op_result { odp_crypto_compl_status_t cipher; odp_crypto_compl_status_t auth; void* op_context; + odp_packet_t out_pkt; } odp_crypto_generic_op_result_t; /** diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index e605d59..d611cc6 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -386,6 +386,7 @@ odp_crypto_operation(odp_crypto_op_params_t *params, result->cipher.hw_err = ODP_CRYPTO_HW_ERR_NONE; result->auth.alg_err = rc_auth; result->auth.hw_err = ODP_CRYPTO_HW_ERR_NONE; + result->out_pkt = params->out_pkt; /* If specified during creation post event to completion queue */ if (ODP_QUEUE_INVALID != session->compl_queue) { @@ -476,8 +477,14 @@ void } odp_packet_t -odp_crypto_get_operation_compl_packet(odp_buffer_t completion_event ODP_UNUSED) +odp_crypto_get_operation_compl_packet(odp_buffer_t completion_event) { - ODP_UNIMPLEMENTED(); - return ODP_PACKET_INVALID; + odp_crypto_generic_op_result_t *result; + + result = get_op_result_from_buffer(completion_event); + ODP_ASSERT(OP_RESULT_MAGIC == result->magic, "Bad completion magic"); + ODP_ASSERT(odp_buffer_type(completion_event == ODP_BUFFER_TYPE_PACKET), + "Completion is not a packet"); [rk] Should this be: ODP_ASSERT((odp_buffer_type(completion_event) == ODP_BUFFER_TYPE_PACKET), "Completion is not a packet"); + + return result->out_pkt; } -- 1.9.1 _______________________________________________ lng-odp mailing list [email protected] http://lists.linaro.org/mailman/listinfo/lng-odp
