From patchwork Tue Dec 16 14:19:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 42335 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0C6CC26C54 for ; Tue, 16 Dec 2014 14:20:07 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id u10sf8704876lbd.2 for ; Tue, 16 Dec 2014 06:20:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=d40nD1HuWdbYl3Xw0qGZEtqdA+O8RYVOv2NSV3jvVF0=; b=KTJa1E2MAq+MhE8f7hfmc4wvv72xF2cxzJdjgq8PO1bpyPA9p73dD7uV3PBj0Qp+k2 kedutL4GFXxL44LlTB7Ai8MgrddF76MCPWOFQPndaBSj4stemC+rw/3p4YagPEkuOCl+ Yzwykc3IxlaqVKIAl1u/zVTtrazbk7Os5tyRsFSBZig/3kfGHg7aiRJv085FeRHgJsql 4OX8eNdWv+fK7AeD66dZ+GDYlat5wj/Y57tax2qSbJSB2bisEsub/qdehwcOWELunQCx OypMoYMX+v7OUVENNfmaQrEVR/vr2FKTSsqzXcYkwKm2WDWM4irL6Q6Yi0H9kxxGBbkV WgNw== X-Gm-Message-State: ALoCoQkxSEhRaQFfGpKwi95bEowgKLPSsARaCnZiZK0k4Q4meMUxL7naZbCRH//NhJe1L4Ld2xO/ X-Received: by 10.112.235.231 with SMTP id up7mr1546083lbc.0.1418739605828; Tue, 16 Dec 2014 06:20:05 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.178.195 with SMTP id da3ls1000264lac.32.gmail; Tue, 16 Dec 2014 06:20:05 -0800 (PST) X-Received: by 10.152.22.199 with SMTP id g7mr36114194laf.23.1418739605517; Tue, 16 Dec 2014 06:20:05 -0800 (PST) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id w2si884497laz.109.2014.12.16.06.20.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Dec 2014 06:20:05 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id s18so11411372lam.30 for ; Tue, 16 Dec 2014 06:20:05 -0800 (PST) X-Received: by 10.152.27.8 with SMTP id p8mr19156187lag.69.1418739605416; Tue, 16 Dec 2014 06:20:05 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.142.69 with SMTP id ru5csp1051170lbb; Tue, 16 Dec 2014 06:20:04 -0800 (PST) X-Received: by 10.224.103.74 with SMTP id j10mr66575628qao.101.1418739603804; Tue, 16 Dec 2014 06:20:03 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id e34si921346qge.99.2014.12.16.06.20.02 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 16 Dec 2014 06:20:03 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y0syn-0001g4-EB; Tue, 16 Dec 2014 14:20:01 +0000 Received: from mail-la0-f43.google.com ([209.85.215.43]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y0syX-0001fD-HQ for lng-odp@lists.linaro.org; Tue, 16 Dec 2014 14:19:45 +0000 Received: by mail-la0-f43.google.com with SMTP id s18so11410492lam.30 for ; Tue, 16 Dec 2014 06:19:40 -0800 (PST) X-Received: by 10.152.29.193 with SMTP id m1mr26337375lah.84.1418739579962; Tue, 16 Dec 2014 06:19:39 -0800 (PST) Received: from uglx0153363.synapse.com ([195.238.92.128]) by mx.google.com with ESMTPSA id l9sm240769lae.0.2014.12.16.06.19.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Dec 2014 06:19:39 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org, robking@cisco.com Date: Tue, 16 Dec 2014 16:19:29 +0200 Message-Id: <1418739571-656-3-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1418739571-656-1-git-send-email-taras.kondratiuk@linaro.org> References: <1418739571-656-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: crypto patch Subject: [lng-odp] [PATCHv2 2/4] linux-generic: crypto: implement completion event context X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: taras.kondratiuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Taras Kondratiuk --- .../linux-generic/include/odp_crypto_internal.h | 1 + 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 04db333..7ea1f5c 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 a2d4ab8..8bbca94 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -446,17 +446,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