From patchwork Wed Jul 13 02:27:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 71899 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp772605qga; Tue, 12 Jul 2016 19:27:18 -0700 (PDT) X-Received: by 10.237.55.65 with SMTP id i59mr8824825qtb.62.1468376838124; Tue, 12 Jul 2016 19:27:18 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id u26si2103625qkl.134.2016.07.12.19.27.17; Tue, 12 Jul 2016 19:27:18 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 7E9296180C; Wed, 13 Jul 2016 02:27:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 782C7615EB; Wed, 13 Jul 2016 02:27:12 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A7BB76844E; Wed, 13 Jul 2016 02:27:09 +0000 (UTC) Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com [209.85.218.42]) by lists.linaro.org (Postfix) with ESMTPS id A3C4D68401 for ; Wed, 13 Jul 2016 02:27:08 +0000 (UTC) Received: by mail-oi0-f42.google.com with SMTP id w18so50686762oiw.3 for ; Tue, 12 Jul 2016 19:27:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Og8/c7A3rLC8GEsB9jEfWGJjKwClQVJYXKj+jXFogwc=; b=WLxykUtbU+15iCN6W99gPM6XCoo6HG0eW204p1xPPwhFAQ8CmtzEOd3MhIwVBSmzLW Wa5xDW37ptNvZ6ITz/DU7HFPjRdONifaFaVvtln4tC1g3zgCyrmxN/B16/OLnHNzwAZ2 iPze4BHLqP+ay9InB6mqjaNV5Aiu28B+WKMBxgdg/zlN5ZrQRYrcMbdF0kF8+M3j5DnT NPMWFtv7dcKc0vrUmw5qQXFYjc8brHzx1yK9lsRItUm/xaLu2fWILzqLx65abvS8UoC1 cB4AgOuVAUdz/qkhlxuuZrcdgzgOS2k0hIEjgziM+vhXunBuyIaumwcNvhR9uGqqEZcy ptXQ== X-Gm-Message-State: ALyK8tKy0m8ZHjaXnKTTuNAiQl/9PJdfkxkWjVa1GHtP+soX4uweDEhQmyjZqBogG9Xh0S7iHHE= X-Received: by 10.202.180.5 with SMTP id d5mr15519362oif.30.1468376828065; Tue, 12 Jul 2016 19:27:08 -0700 (PDT) Received: from localhost.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id p34sm374503ota.39.2016.07.12.19.27.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Jul 2016 19:27:07 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 12 Jul 2016 21:27:05 -0500 Message-Id: <1468376825-25906-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.7.4 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv2] api: byteorder: avoid bitfield order doxygen omissions X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Resolve Bug https://bugs.linaro.org/show_bug.cgi?id=2402 by assigning explicit values to ODP_LITTLE_ENDIAN_BITFIELD and ODP_BIT_ENDIAN_BITFIELD to avoid Doxygen warnings. This makes these consistent with the usage for ODP_BIG_ENDIAN and ODP_LITTLE_ENDIAN. Also define the summary variable ODP_BITFIELD_ORDER which can be used similar to ODP_BYTE_ORDER for an explicit test of bitfield endianness. Note that this requires tests of these fields to change from #ifdef to #if. Signed-off-by: Bill Fischofer --- helper/include/odp/helper/tcp.h | 4 ++-- include/odp/api/spec/byteorder.h | 3 +++ platform/linux-generic/include/odp/api/plat/byteorder_types.h | 8 ++++++-- platform/linux-generic/include/protocols/tcp.h | 4 ++-- 4 files changed, 13 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/helper/include/odp/helper/tcp.h b/helper/include/odp/helper/tcp.h index cabef90..fd234e5 100644 --- a/helper/include/odp/helper/tcp.h +++ b/helper/include/odp/helper/tcp.h @@ -34,7 +34,7 @@ typedef struct ODP_PACKED { odp_u32be_t ack_no; /**< Acknowledgment number */ union { odp_u16be_t doffset_flags; -#if defined(ODP_BIG_ENDIAN_BITFIELD) +#if ODP_BIG_ENDIAN_BITFIELD struct { odp_u16be_t rsvd1:8; odp_u16be_t flags:8; /**< TCP flags as a byte */ @@ -51,7 +51,7 @@ typedef struct ODP_PACKED { odp_u16be_t syn:1; odp_u16be_t fin:1; }; -#elif defined(ODP_LITTLE_ENDIAN_BITFIELD) +#elif ODP_LITTLE_ENDIAN_BITFIELD struct { odp_u16be_t flags:8; odp_u16be_t rsvd1:8; /**< TCP flags as a byte */ diff --git a/include/odp/api/spec/byteorder.h b/include/odp/api/spec/byteorder.h index 1018997..e16a0d5 100644 --- a/include/odp/api/spec/byteorder.h +++ b/include/odp/api/spec/byteorder.h @@ -39,6 +39,9 @@ extern "C" { * * @def ODP_BYTE_ORDER * Selected byte order + * + * @def ODP_BITFIELD_ORDER + * Selected bitfield order */ /** diff --git a/platform/linux-generic/include/odp/api/plat/byteorder_types.h b/platform/linux-generic/include/odp/api/plat/byteorder_types.h index 679d4cf..09235b5 100644 --- a/platform/linux-generic/include/odp/api/plat/byteorder_types.h +++ b/platform/linux-generic/include/odp/api/plat/byteorder_types.h @@ -52,12 +52,16 @@ extern "C" { #define ODP_LITTLE_ENDIAN 1 #define ODP_BIG_ENDIAN 0 #define ODP_BYTE_ORDER ODP_LITTLE_ENDIAN - #define ODP_LITTLE_ENDIAN_BITFIELD + #define ODP_LITTLE_ENDIAN_BITFIELD 1 + #define ODP_BIG_ENDIAN_BITFIELD 0 + #define ODP_BITFIELD_ORDER ODP_LITTLE_ENDIAN_BITFIELD #else #define ODP_LITTLE_ENDIAN 0 #define ODP_BIG_ENDIAN 1 #define ODP_BYTE_ORDER ODP_BIG_ENDIAN - #define ODP_BIG_ENDIAN_BITFIELD + #define ODP_LITTLE_ENDIAN_BITFIELD 0 + #define ODP_BIG_ENDIAN_BITFIELD 1 + #define ODP_BITFIELD_ORDER ODP_BIG_ENDIAN_BITFIELD #endif typedef uint16_t __odp_bitwise odp_u16le_t; diff --git a/platform/linux-generic/include/protocols/tcp.h b/platform/linux-generic/include/protocols/tcp.h index 4e92e4b..114262e 100644 --- a/platform/linux-generic/include/protocols/tcp.h +++ b/platform/linux-generic/include/protocols/tcp.h @@ -34,7 +34,7 @@ typedef struct ODP_PACKED { odp_u32be_t ack_no; /**< Acknowledgment number */ union { odp_u16be_t doffset_flags; -#if defined(ODP_BIG_ENDIAN_BITFIELD) +#if ODP_BIG_ENDIAN_BITFIELD struct { odp_u16be_t rsvd1:8; odp_u16be_t flags:8; /**< TCP flags as a byte */ @@ -51,7 +51,7 @@ typedef struct ODP_PACKED { odp_u16be_t syn:1; odp_u16be_t fin:1; }; -#elif defined(ODP_LITTLE_ENDIAN_BITFIELD) +#elif ODP_LITTLE_ENDIAN_BITFIELD struct { odp_u16be_t flags:8; odp_u16be_t rsvd1:8; /**< TCP flags as a byte */