Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935530AbcLPQjV (ORCPT ); Fri, 16 Dec 2016 11:39:21 -0500 Received: from mail-sn1nam01on0076.outbound.protection.outlook.com ([104.47.32.76]:6679 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1161159AbcLPQjD (ORCPT ); Fri, 16 Dec 2016 11:39:03 -0500 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; X-IncomingTopHeaderMarker: OriginalChecksum:;UpperCasedChecksum:;SizeAsReceived:964;Count:10 From: Stuart Yoder To: CC: , , , , , , , , , , Roy Pledge , Stuart Yoder Subject: [PATCH v5 4/8] bus: fsl-mc: dpio: add global dpaa2 definitions Date: Fri, 16 Dec 2016 10:31:02 -0600 Message-ID: <1481905866-10816-5-git-send-email-stuart.yoder@nxp.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1481905866-10816-1-git-send-email-stuart.yoder@nxp.com> References: <1481905866-10816-1-git-send-email-stuart.yoder@nxp.com> X-IncomingHeaderCount: 10 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131263799399331587;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(7916002)(336005)(39450400003)(39410400002)(39400400002)(39840400002)(39850400002)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(50986999)(81166006)(81156014)(8936002)(48376002)(8676002)(5003940100001)(92566002)(305945005)(8666005)(33646002)(189998001)(50226002)(356003)(77096006)(85426001)(104016004)(47776003)(2906002)(76176999)(2351001)(110136003)(86362001)(68736007)(38730400001)(4326007)(6666003)(105606002)(106466001)(2950100002)(36756003)(97736004)(50466002)(5660300001)(6916009)(626004)(7416002)(7059030)(2004002);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR0301MB0744;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD046;1:y+Sb4oTaNOtJKkOYZUeauB1vczmdXhLc+e1GAR/Z+CKgJ0mErbQNT781ZVIg5h+dOMlEV9T43EONYd/ieqCRSh99JIr13YPLY9GI2k1WupIFJmaCkdeynMRiK3uzXLdvqMbpROZJsF8pYEOsUrFi9yqMiABlVF6mNQEqH+Qhz+2XXBZ44kxn51f+TJaAAdtvP8WCmXhFaF6bPzjdr3FGM5aSxEZKHReeFTuhZuJVcayh7QjuFqjxBwPL0uO6uXoQmJ5PApJiwf1HVhj0b/JG+tsyS+N4D0dmOYi8dQ1152IeuNYJreIuXiAqXJigkHxf0wYblTLsMCloPhlOgWhBbwCNG9XbZZoox6tMaPI2pu2VoY+zyKbciDWL60xcJLAsk4xzGPuoqW5UlXY5UY3SDK8H25JBIQPBOEda0JjVGFAwZZHYcqjihGqIR2iZHMYPdyuNZ5vmdYjQW1PcvqcS5jul9s1FmOcSajWExVJthR6i4sIj2ZOlfThjr+IgM0mL0V5P1KC/EnHYS3ZVrZyGT8ZJkxPe4M3fmP0iwtxPyZOl5l3qeqY9dOrZnCq9UO5NsfohJ+QZS7g2yx8mnStkHZT/ljxHrRrEpMjnZnaPmYSEXsbmV0XyRNPmUCTZqeaZFgrL//akx+M8et34EHn8YVK3FuWSKN8GpI3JZwmxrP27ut/4xCmdQgwIqNld7oNE4cnRfj5Kai/jlDBHRq8aDg/j9fbMX8yJyz1LTMeXRYY= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 787517d3-350d-4388-f447-08d425d20982 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BY2PR0301MB0744; X-Microsoft-Exchange-Diagnostics: 1;BY2PR0301MB0744;3:lZiztMUw/WCRaczWaRuR/dXUVt3xSNsEZ9bGgQOz5nW2cMd0kcTM2l/14A3Tor6w0WnAwKwPQYKfxMgAumKl1fiEbTZIvvM+fIDIlmUFUbXcoxBtpAYcXStZrNCfHb1c6bbMPA/KKinrL11Cv8YfaixsG9clGGH4TeQafzAf/ii2baNR45j0bT6hF2GJr4Vz4yXU7PtSYY+p/WkaFvRd7s4gac/fxdgYIbwtmCSIj4OiAWFgkzK+ocY6XqqB+HnLK0gYqB4J+qOQkW8N25Uu6RbaAfzgoD5LJ2tTbUDmKfRENz+Ez1DIompE5BRJci72mbIwu1ywB2Cqvo2U7+D8c1vWgYyWWk5CoRSQhwYcmEI61z20BQqvB75TRcuNw7FY;25:ceG71y60bTZmPbONddApht/VsfVtFN1VdbtKNZFdYrOtJbZBFK3v+FQSAu+sIQcgd+RenzKndWXfAn+Pth5SFgOThMIJPIVTdCkB6WMKTVUP0mPvp6FWo/mblHM15piiYTxxXx2KT1e6/PnuAiGlM+ysu2NB2gSvuSpGWAIyYmzwT04d40sLTP9yqjrrAHllDW+sPWOa4U3ezzOVliB42MbqIDw5SkcIayda4VCbIOvxcyPUdVg1g0jWYWQ09U2gL7DzuOBJjClPiRD8UeVc9iQl4L40vQNC30bMTfh8GGBkzlYzwjg+5VJGiB+OXruSRlvWPs3t6pabt5emF7etPjM6AXKQs714u3HHWjTxwI+YgKASutFoUmEhVfjSxXKcnlDC3Wn8T8v9zDB66P7q6F8o5GDAVIzkm875lKA30kwBuyacp3HpVdGccBjFQ4C2mre6cARGcXTfWxzpoaHkNw== X-Microsoft-Exchange-Diagnostics: 1;BY2PR0301MB0744;31:NQLbMj03lktrpaKu/izKcuM0psqaLhdVEnE5ECGsGEqCPRJc9UTQakY04h8WhDRULK0D4IVwuvKJjCvG7PeNj9pEp7MG98uyokj2FJpKNH882IvJzp7YoIa3XSg8MeOUcmPg6O40dRRU9/M7s6K2CNOFm4ryBa/suCRY+3waedZD/+cUWcelg2aAUPUvQaQJyweH1EytQgDJaxQHJNMrSbVCLD0OTRTSVmRe/l9o/hwCXzVC7sKKKk63zM8o1wQ4C6PeDjIXfZ26L8VLlN7MVA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6095060)(601004)(2401047)(5005006)(13024025)(13023025)(13017025)(13015025)(8121501046)(13018025)(10201501046)(3002001)(6055026)(6096035)(20161123559025)(20161123561025)(20161123556025)(20161123563025)(20161123565025);SRVR:BY2PR0301MB0744;BCL:0;PCL:0;RULEID:(400006);SRVR:BY2PR0301MB0744; X-Microsoft-Exchange-Diagnostics: 1;BY2PR0301MB0744;4:ttnsOzWsfFNKvCiD6JIs5hErnu+VYZqG72MEQR1otaV2FTYJLoKiQOUrUIqWrt/B+qyqg/BP440stvr6uTlDd59hJ8RblQa2WLiq7CIbEaeUB+GD0DkoixRKjwHIwq7c884PDpKgNaeHBghkd73zJqJ5TwcUiek2m/ndHemY9H4IbFTva/P80vzMby4Hr5n9muOu1aUaVVAq3MpCElcexIx5hVRt0BV4AfsTOQalfYV9R7vCfpLhuaZzfiZQxg6RaG+3JZKnDKmwI4lmiiRfhOrA2DbNOLbo61bHERCm56TY9qxfZ4s9NeqSbD6f52jh96fvyUIGAW0ijADaKlbJTwABi3fi9kNw4+QLHhrWZlMu9EriE6xdonsHuzEDPpYM7CrhvSpOeTcRYwDQfB/GxcKCKuEQsw6k7eG0E2oyXL7E9d1iXZKyxC6G4wfWDQYkJp5MeW3+if3malAP5W9btf19KP3fzymAugEGh6PwHzjswKW+yV9uHwTlhJtEyTcIXStB8kLkD3oFIPJdd4S3OHBVVH2iSoqA/f/f3cRfy1ziKlBedCTuAmnm248GL5aaFl7pAFyEaOWt93tRBSGnsX5JszA6h+mJh7qJ/VCHncYscMT7PSW+5fctulZT3d7ofC2exAsApnYgq7NkKuUETb2jpGEZ0JUambRedjXoQVuAmyQfT6B+tG+0TNLQW5/Moinz2+pmOt/cwOZ0bI/pQ301a/s5rjj8extU7iLUCKLfxmWlsgGQYbrO/bVdEwcp X-Forefront-PRVS: 01583E185C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR0301MB0744;23:/tnoWpKg9MAPpIKitI/MqjyeW/nqPnGzxeD8Uak?= =?us-ascii?Q?s0fmx7U5atmoek/8hAC7WepA+gLD5udocBjEsKBJqZcWjV9xYjOp4pA8gAaC?= =?us-ascii?Q?qYuTBtrKd65JN1y4KDsUuhb/GHrMPJ96Q4ad6AMC7hAdpZo4VdabmX9UUxfh?= =?us-ascii?Q?7TRoblIi1fyBHgvnbp3ttNhWuwOH2Tw3ja6O/VL2jlXarkTBzkgLfyJrTmIt?= =?us-ascii?Q?96zbsMb512dPLMWpbTsvSkU+LmmQKgrnXWlgmSffyMZTT0Gkg0e3e0VkNbwK?= =?us-ascii?Q?2aUk0zXV0RiePOvkx5HpGE9LXrGJPycjpnEiqDTO7miTEwYz/ZyP0BY3bSpL?= =?us-ascii?Q?eWZw85ejeVWElFsHqonJ8KivPRO/sx9a5QXy5AB8jszoCuogwboP9Svq0RmB?= =?us-ascii?Q?DEZhfdC64zFiT0FaqBNc08ogpddglXLbaeSeCWtAZg460HAMZKFJmpX1XQmL?= =?us-ascii?Q?gMjFadfhEA9dG0tsa64OrOIrcb3UQLaOcUBVaFmWBiMIVJlP95qegxqCMuUo?= =?us-ascii?Q?MRuXXgZ9iu4EoKYWT4Nx8O10L46jBK3MsPOrZI+ddXFbmNoHYImpCEBoSjju?= =?us-ascii?Q?kIgM4g6VnTn9aKQbwMr5QNXKbEbsm5iK63nYDC667Zxi9T4zf6OtOuJymtHC?= =?us-ascii?Q?5ZMQdn3G6ksJT6BjKJqli8eo+KZxZBr1+T2DOOucnbisKBLArqct6bDa2P34?= =?us-ascii?Q?9aY1y/848XyCNthHHucBU6GKSFhKTfkWuXUlwl2GO197Mqh5kjH/11+AHozM?= =?us-ascii?Q?VF4YgWNoQ9uO20WsovNVIumT1KkPBrHxoOsq3Rg0JDm/+uJXTQPmVls/7HkK?= =?us-ascii?Q?MnX+5Ea9n/6SYuscCzwBiXUByEilSNG4aTBnHipeNCFKN2UXOPQBOG65wC7a?= =?us-ascii?Q?4CeldimHnFjxySAUOknOrQ6C1PB9nzcmLD6yJrt54VQsSObppxr9Y6lxywJf?= =?us-ascii?Q?c/oBMY8WdM7hX3egy91KjYtqocLIakNpoIEIY+6NpZPXBPQq0E0GI6dkj+EV?= =?us-ascii?Q?sXwWns5J+NE+ZGf+ek/izGfWHoYE11f0nNgr+LtllhTYzOrDTP/PW1x1FQIx?= =?us-ascii?Q?fhEwBfflVl5Qbk/FBoiYmtC6e8p1imAlPcyifcJ73vca36OrAykE5V3HKnCt?= =?us-ascii?Q?12gLUOxYjQi0scBi6/MmmxvVqElC4+QQRuaQAP/RNW4+HA24T5FOZmbevQdU?= =?us-ascii?Q?+rcrphnuBYYvOqwHif1WIl52totTcZvlsDqtQPdsC1ZXGJjrawUF9LPZavq2?= =?us-ascii?Q?a0vt+s1ZHtJ2KrqtLuI2j1M/S8X1WnSh57hk0k0rSA9IN2OnQWP3BbVxAvle?= =?us-ascii?Q?t4503o/sVdm/vrRZT7Nr27S4=3D?= X-Microsoft-Exchange-Diagnostics: 1;BY2PR0301MB0744;6:Hr/tGwHw8M+u0d0klN6X8mrX8HgIjoSQvP2+RdZEjhu+GwSKW3pMJcdst+PqaFW976vOsriI1gbTU5r6SY6fnpYWfgsSRxJINGFhvle7q64zvITyItbH6oY79seuERt33L0Z2ywecJqgIFjqyPo7a3oi+kY88lGm92jQf3LR+5g4Ay9lEelnlIPRbOB+uoJF9oGTO2qaH4Mybk92vZUbC3cF0n4BEjAc4t7NijxyarUdPdWkrvQs6xdLYZ2FM7WDA4gUn0T6KZskW+MAKmZaooUU1YF+iH77yt1YuGi0xuVOzta+qKrz5SC3ClSAxv4uPhMfKVTd4jY4EtmUGXkXPpPcog5eM2dpmiquyEDftHEqIzAtPUbKOVDzeWZo8YQ2MUg2BCL6dHzQSTuc/VaM+fijCe0xT4L2WGi8QEpGSL1chJKvivtZYI9fWwgs2n4m;5:tO1uGFD2yg+DWJA6tcAjLUzw5t/2F5y15RLkuaTjeyzhPgbltMm5Z9sgPMp6Xf5OS0TA6wguvb6Ja/pV6cpXWM9s5e6FEkg8UdiwrkOOpBiV2og9TYTwCi92PO0MO9+WGEel7YYSfaZQu7kO82Zq+Q8G+hReEGYhkhzbNKtKlYKH3Ts5H0F4azYD8kmoemAW;24:Gmekel7rmyxPbaTR5olAMeGPNJNZ+y8YKUAqFlaOkMARq0/8e6m23QYfZTdtA0fubXOtXU8iZlwMtZkdDQ7VOUIahs8o3QTYydauPiAqaQs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BY2PR0301MB0744;7:iGmTyi9Iznr/EcUYAB9O/d/gBC9va3mkt9hnSR9H9tcmSVW69yJd0dGpu1o7xQkbvKhmlUIYu2BFVGtH9NRcI2ca9RMxvSfoDnDw6U0cNkrP8Hzqn9uERLKl2EJKCvfC71DJwW8rZD1aD1tL5UNAEnTIoJS9NBrWZm9pkRlu1fRNnssQZPDEs+pbPGMrNLvyQzXQ1FWL7o6ZwPoTCeG4SF5iLWP4ABxV9yWsaXO047BJkAUqrZm0033ArRSviL13FR34EIVsfYw0uJXeYJc4SfsRkzH/k/sHtA/OK2oli3SVBIuUsRvfIyys2+DtGfNz8xkpNr4vQJdEN7/o8li9PIdFsHNUhU+1Uh26CXMj7TG6UwaLTlHaFvfLnePa0KuuFSYUsWMIUjAWfKFcKyIlrP1xSBdxZek8YqpyLJb778iXjTtvmf6HS1oIrmppjbVbA7tZk+0m6aO4e/v6Dm1RPA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2016 16:38:54.6604 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0744 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6646 Lines: 230 From: Roy Pledge Create header for global dpaa2 definitions. Add definitions for dequeue results. Signed-off-by: Roy Pledge Signed-off-by: Stuart Yoder --- Notes: -v4 -adjust file location to be in drivers/staging -whitespace/alignment cleanup, make dpaa2_dq_is_pull_complete() return bool, fix spelling typo -updated copyright drivers/staging/fsl-mc/include/dpaa2-global.h | 202 ++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 drivers/staging/fsl-mc/include/dpaa2-global.h diff --git a/drivers/staging/fsl-mc/include/dpaa2-global.h b/drivers/staging/fsl-mc/include/dpaa2-global.h new file mode 100644 index 0000000..0326447 --- /dev/null +++ b/drivers/staging/fsl-mc/include/dpaa2-global.h @@ -0,0 +1,202 @@ +/* + * Copyright 2014-2016 Freescale Semiconductor Inc. + * Copyright 2016 NXP + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef __FSL_DPAA2_GLOBAL_H +#define __FSL_DPAA2_GLOBAL_H + +#include +#include +#include "dpaa2-fd.h" + +struct dpaa2_dq { + union { + struct common { + u8 verb; + u8 reserved[63]; + } common; + struct dq { + u8 verb; + u8 stat; + __le16 seqnum; + __le16 oprid; + u8 reserved; + u8 tok; + __le32 fqid; + u32 reserved2; + __le32 fq_byte_cnt; + __le32 fq_frm_cnt; + __le64 fqd_ctx; + u8 fd[32]; + } dq; + struct scn { + u8 verb; + u8 stat; + u8 state; + u8 reserved; + __le32 rid_tok; + __le64 ctx; + } scn; + }; +}; + +/* Parsing frame dequeue results */ +/* FQ empty */ +#define DPAA2_DQ_STAT_FQEMPTY 0x80 +/* FQ held active */ +#define DPAA2_DQ_STAT_HELDACTIVE 0x40 +/* FQ force eligible */ +#define DPAA2_DQ_STAT_FORCEELIGIBLE 0x20 +/* valid frame */ +#define DPAA2_DQ_STAT_VALIDFRAME 0x10 +/* FQ ODP enable */ +#define DPAA2_DQ_STAT_ODPVALID 0x04 +/* volatile dequeue */ +#define DPAA2_DQ_STAT_VOLATILE 0x02 +/* volatile dequeue command is expired */ +#define DPAA2_DQ_STAT_EXPIRED 0x01 + +#define DQ_FQID_MASK 0x00FFFFFF +#define DQ_FRAME_COUNT_MASK 0x00FFFFFF + +/** + * dpaa2_dq_flags() - Get the stat field of dequeue response + * @dq: the dequeue result. + */ +static inline u32 dpaa2_dq_flags(const struct dpaa2_dq *dq) +{ + return dq->dq.stat; +} + +/** + * dpaa2_dq_is_pull() - Check whether the dq response is from a pull + * command. + * @dq: the dequeue result + * + * Return 1 for volatile(pull) dequeue, 0 for static dequeue. + */ +static inline int dpaa2_dq_is_pull(const struct dpaa2_dq *dq) +{ + return (int)(dpaa2_dq_flags(dq) & DPAA2_DQ_STAT_VOLATILE); +} + +/** + * dpaa2_dq_is_pull_complete() - Check whether the pull command is completed. + * @dq: the dequeue result + * + * Return boolean. + */ +static inline bool dpaa2_dq_is_pull_complete(const struct dpaa2_dq *dq) +{ + return !!(dpaa2_dq_flags(dq) & DPAA2_DQ_STAT_EXPIRED); +} + +/** + * dpaa2_dq_seqnum() - Get the seqnum field in dequeue response + * @dq: the dequeue result + * + * seqnum is valid only if VALIDFRAME flag is TRUE + * + * Return seqnum. + */ +static inline u16 dpaa2_dq_seqnum(const struct dpaa2_dq *dq) +{ + return le16_to_cpu(dq->dq.seqnum); +} + +/** + * dpaa2_dq_odpid() - Get the odpid field in dequeue response + * @dq: the dequeue result + * + * odpid is valid only if ODPVALID flag is TRUE. + * + * Return odpid. + */ +static inline u16 dpaa2_dq_odpid(const struct dpaa2_dq *dq) +{ + return le16_to_cpu(dq->dq.oprid); +} + +/** + * dpaa2_dq_fqid() - Get the fqid in dequeue response + * @dq: the dequeue result + * + * Return fqid. + */ +static inline u32 dpaa2_dq_fqid(const struct dpaa2_dq *dq) +{ + return le32_to_cpu(dq->dq.fqid) & DQ_FQID_MASK; +} + +/** + * dpaa2_dq_byte_count() - Get the byte count in dequeue response + * @dq: the dequeue result + * + * Return the byte count remaining in the FQ. + */ +static inline u32 dpaa2_dq_byte_count(const struct dpaa2_dq *dq) +{ + return le32_to_cpu(dq->dq.fq_byte_cnt); +} + +/** + * dpaa2_dq_frame_count() - Get the frame count in dequeue response + * @dq: the dequeue result + * + * Return the frame count remaining in the FQ. + */ +static inline u32 dpaa2_dq_frame_count(const struct dpaa2_dq *dq) +{ + return le32_to_cpu(dq->dq.fq_frm_cnt) & DQ_FRAME_COUNT_MASK; +} + +/** + * dpaa2_dq_fd_ctx() - Get the frame queue context in dequeue response + * @dq: the dequeue result + * + * Return the frame queue context. + */ +static inline u64 dpaa2_dq_fqd_ctx(const struct dpaa2_dq *dq) +{ + return le64_to_cpu(dq->dq.fqd_ctx); +} + +/** + * dpaa2_dq_fd() - Get the frame descriptor in dequeue response + * @dq: the dequeue result + * + * Return the frame descriptor. + */ +static inline const struct dpaa2_fd *dpaa2_dq_fd(const struct dpaa2_dq *dq) +{ + return (const struct dpaa2_fd *)&dq->dq.fd[0]; +} + +#endif /* __FSL_DPAA2_GLOBAL_H */ -- 1.9.0