From patchwork Sun Feb 1 00:16:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 44107 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 360862359E for ; Sun, 1 Feb 2015 00:17:26 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id k14sf13561327wgh.3 for ; Sat, 31 Jan 2015 16:17:25 -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=OqDN9IQncClKkieBzAg7Vdvl2NxGFJ9dhkBTlrmPnMM=; b=M16VACS9ggAIzslaZXZAvkG07D/SfTwVNQPIAKn7OK+kHWhyFUTkBTdMGdjEcNJBL9 IQCCPWQaYn1AYdqdQWZKgHjyaTEAshXzHSKtZCqoQ7jpoYJ7znz0egdlxQ1Xd8WyVpUd 362VGoMJGb2FggICDfCorkqfh4HrqgkmxmhSmw4ENZTTa9/LOCBQ4Z6V710Vrm2gFXwq aifRpnM2v2I15lMdOn359ltD5XoWoGER8CdZr+K9n6nBzIf1NjOabR21MfadPpAIKQUj iHA0bIhsMvcSO/Yzp6SpzfDi1Ubq5GNs2ZdOydCTwnojXwOWGXpxX8YxnblPhLRDpINa UWUw== X-Gm-Message-State: ALoCoQnlX7EzukELRV5grRqFJSHiHCyCMpR3AUNNYf+9PbyW49FPJAmdyTMXYQ5XqsnbJ3cVqs6r X-Received: by 10.112.140.65 with SMTP id re1mr1637014lbb.4.1422749845527; Sat, 31 Jan 2015 16:17:25 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.7.162 with SMTP id dd2ls185871lad.81.gmail; Sat, 31 Jan 2015 16:17:25 -0800 (PST) X-Received: by 10.152.88.44 with SMTP id bd12mr12752141lab.86.1422749845386; Sat, 31 Jan 2015 16:17:25 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id zd4si13389525lbb.75.2015.01.31.16.17.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 31 Jan 2015 16:17:25 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id gq15so31218819lab.12 for ; Sat, 31 Jan 2015 16:17:25 -0800 (PST) X-Received: by 10.112.98.99 with SMTP id eh3mr12698484lbb.32.1422749845285; Sat, 31 Jan 2015 16:17:25 -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.35.133 with SMTP id h5csp507678lbj; Sat, 31 Jan 2015 16:17:24 -0800 (PST) X-Received: by 10.224.112.137 with SMTP id w9mr28056871qap.8.1422749843995; Sat, 31 Jan 2015 16:17:23 -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 j10si19921154qga.33.2015.01.31.16.17.22 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 31 Jan 2015 16:17:23 -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 1YHiE5-0002KN-BB; Sun, 01 Feb 2015 00:17:21 +0000 Received: from mail-oi0-f41.google.com ([209.85.218.41]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YHiDo-0002II-72 for lng-odp@lists.linaro.org; Sun, 01 Feb 2015 00:17:04 +0000 Received: by mail-oi0-f41.google.com with SMTP id z81so39792170oif.0 for ; Sat, 31 Jan 2015 16:16:58 -0800 (PST) X-Received: by 10.182.22.198 with SMTP id g6mr8027532obf.16.1422749818897; Sat, 31 Jan 2015 16:16:58 -0800 (PST) Received: from localhost.localdomain (cpe-24-28-70-239.austin.res.rr.com. [24.28.70.239]) by mx.google.com with ESMTPSA id xr17sm5945905oeb.12.2015.01.31.16.16.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 31 Jan 2015 16:16:58 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Sat, 31 Jan 2015 18:16:35 -0600 Message-Id: <1422749807-20228-5-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1422749807-20228-1-git-send-email-bill.fischofer@linaro.org> References: <1422749807-20228-1-git-send-email-bill.fischofer@linaro.org> X-Topics: crypto patch Subject: [lng-odp] [PATCHv4 04/10] linux-generic: crypto: add strong typing support 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: bill.fischofer@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.53 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: Bill Fischofer --- include/odp/api/crypto.h | 26 ++++++++++++++++++++++ .../linux-generic/include/odp/plat/crypto_types.h | 13 ++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/include/odp/api/crypto.h b/include/odp/api/crypto.h index 545c1a5..8f0a486 100644 --- a/include/odp/api/crypto.h +++ b/include/odp/api/crypto.h @@ -344,6 +344,32 @@ int odp_hw_random_get(uint8_t *buf, size_t *len, odp_bool_t use_entropy); /** + * Get printable value for an odp_crypto_session_t + * + * @param hdl odp_crypto_session_t handle to be printed + * @return uint64_t value that can be used to print/display this + * handle + * + * @note This routine is intended to be used for diagnostic purposes + * to enable applications to generate a printable value that represents + * an odp_crypto_session_t handle. + */ +uint64_t odp_crypto_session_t_print(odp_crypto_session_t hdl); + +/** + * Get printable value for an odp_crypto_compl_t + * + * @param hdl odp_crypto_compl_t handle to be printed + * @return uint64_t value that can be used to print/display this + * handle + * + * @note This routine is intended to be used for diagnostic purposes + * to enable applications to generate a printable value that represents + * an odp_crypto_compl_t handle. + */ +uint64_t odp_crypto_compl_t_print(odp_crypto_compl_t hdl); + +/** * @} */ diff --git a/platform/linux-generic/include/odp/plat/crypto_types.h b/platform/linux-generic/include/odp/plat/crypto_types.h index d0c61b0..0d74584 100644 --- a/platform/linux-generic/include/odp/plat/crypto_types.h +++ b/platform/linux-generic/include/odp/plat/crypto_types.h @@ -25,7 +25,7 @@ extern "C" { #define ODP_CRYPTO_SESSION_INVALID (0xffffffffffffffffULL) typedef uint64_t odp_crypto_session_t; -typedef odp_packet_t odp_crypto_compl_t; +typedef odp_handle_t odp_crypto_compl_t; enum odp_crypto_op_mode { ODP_CRYPTO_SYNC, @@ -68,6 +68,17 @@ enum crypto_hw_err { ODP_CRYPTO_HW_ERR_BP_DEPLETED, }; +/** Get printable format of odp_crypto_session_t */ +static inline uint64_t odp_crypto_session_t_print(odp_crypto_session_t hdl) +{ + return (uint64_t)hdl; +} + +/** Get printable format of odp_crypto_compl_t_t */ +static inline uint64_t odp_crypto_compl_t_print(odp_crypto_compl_t hdl) +{ + return _odp_pri(hdl); +} /** * @}