diff options
author | Taras Kondratiuk <taras.kondratiuk@linaro.org> | 2014-12-16 16:19:29 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2014-12-18 16:45:10 +0300 |
commit | 6dfafd8aeabd74dbb1546dcd991d84a66fed3f23 (patch) | |
tree | 1c8d49030ac45eb6fd19345c6c12604ac903fe73 /platform/linux-generic | |
parent | 5d01546306787a92e695b4828206a6b8b9c422bc (diff) |
linux-generic: crypto: implement completion event context
Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
Reviewed-by: Robbie King <robking@cisco.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic')
-rw-r--r-- | platform/linux-generic/include/odp_crypto_internal.h | 1 | ||||
-rw-r--r-- | platform/linux-generic/odp_crypto.c | 24 |
2 files changed, 19 insertions, 6 deletions
diff --git a/platform/linux-generic/include/odp_crypto_internal.h b/platform/linux-generic/include/odp_crypto_internal.h index 04db333ab..7ea1f5c8c 100644 --- a/platform/linux-generic/include/odp_crypto_internal.h +++ b/platform/linux-generic/include/odp_crypto_internal.h @@ -69,6 +69,7 @@ typedef struct odp_crypto_generic_op_result { uint32_t magic; odp_crypto_compl_status_t cipher; odp_crypto_compl_status_t auth; + void *op_context; } odp_crypto_generic_op_result_t; /** diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 27d68197c..881ddc251 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -447,17 +447,29 @@ odp_crypto_get_operation_compl_status(odp_buffer_t completion_event, void -odp_crypto_set_operation_compl_ctx(odp_buffer_t completion_event ODP_UNUSED, - void *ctx ODP_UNUSED) +odp_crypto_set_operation_compl_ctx(odp_buffer_t completion_event, + void *ctx) { - ODP_UNIMPLEMENTED(); + odp_crypto_generic_op_result_t *result; + + result = get_op_result_from_buffer(completion_event); + /* + * Completion event magic can't be checked here, because it is filled + * later in odp_crypto_operation() function. + */ + + result->op_context = ctx; } void -*odp_crypto_get_operation_compl_ctx(odp_buffer_t completion_event ODP_UNUSED) +*odp_crypto_get_operation_compl_ctx(odp_buffer_t completion_event) { - ODP_UNIMPLEMENTED(); - return NULL; + 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"); + + return result->op_context; } odp_packet_t |