get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/21195/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 21195,
    "url": "https://patches.dpdk.org/api/patches/21195/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1488545223-25739-17-git-send-email-hemant.agrawal@nxp.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1488545223-25739-17-git-send-email-hemant.agrawal@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1488545223-25739-17-git-send-email-hemant.agrawal@nxp.com",
    "date": "2017-03-03T12:46:33",
    "name": "[dpdk-dev,PATCHv8,16/46] net/dpaa2: add mc dpni object support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "472feaeb42311beec6c585997410993c5f6a794f",
    "submitter": {
        "id": 477,
        "url": "https://patches.dpdk.org/api/people/477/?format=api",
        "name": "Hemant Agrawal",
        "email": "hemant.agrawal@nxp.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1488545223-25739-17-git-send-email-hemant.agrawal@nxp.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/21195/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/21195/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 7DD8DFA3D;\n\tFri,  3 Mar 2017 08:14:32 +0100 (CET)",
            "from NAM03-DM3-obe.outbound.protection.outlook.com\n\t(mail-dm3nam03on0066.outbound.protection.outlook.com [104.47.41.66])\n\tby dpdk.org (Postfix) with ESMTP id 0D2ACF612\n\tfor <dev@dpdk.org>; Fri,  3 Mar 2017 08:14:00 +0100 (CET)",
            "from DM2PR03CA0025.namprd03.prod.outlook.com (10.141.96.24) by\n\tCY4PR03MB2950.namprd03.prod.outlook.com (10.175.116.140) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id\n\t15.1.933.12; Fri, 3 Mar 2017 07:13:58 +0000",
            "from BL2FFO11FD050.protection.gbl (2a01:111:f400:7c09::167) by\n\tDM2PR03CA0025.outlook.office365.com (2a01:111:e400:2428::24) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12 via\n\tFrontend Transport; Fri, 3 Mar 2017 07:13:58 +0000",
            "from tx30smr01.am.freescale.net (192.88.168.50) by\n\tBL2FFO11FD050.mail.protection.outlook.com (10.173.161.212) with\n\tMicrosoft\n\tSMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id\n\t15.1.933.11 via Frontend Transport; Fri, 3 Mar 2017 07:13:58 +0000",
            "from bf-netperf1.idc ([10.232.134.28])\n\tby tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id\n\tv237D50J005035; Fri, 3 Mar 2017 00:13:55 -0700"
        ],
        "Authentication-Results": "spf=fail (sender IP is 192.88.168.50)\n\tsmtp.mailfrom=nxp.com; caviumnetworks.com;\n\tdkim=none (message not signed)\n\theader.d=none; caviumnetworks.com;\n\tdmarc=fail action=none header.from=nxp.com; ",
        "Received-SPF": "Fail (protection.outlook.com: domain of nxp.com does not\n\tdesignate 192.88.168.50 as permitted sender)\n\treceiver=protection.outlook.com; \n\tclient-ip=192.88.168.50; helo=tx30smr01.am.freescale.net;",
        "From": "Hemant Agrawal <hemant.agrawal@nxp.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<thomas.monjalon@6wind.com>, <bruce.richardson@intel.com>,\n\t<shreyansh.jain@nxp.com>, <john.mcnamara@intel.com>,\n\t<ferruh.yigit@intel.com>, <jerin.jacob@caviumnetworks.com>",
        "Date": "Fri, 3 Mar 2017 18:16:33 +0530",
        "Message-ID": "<1488545223-25739-17-git-send-email-hemant.agrawal@nxp.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1488545223-25739-1-git-send-email-hemant.agrawal@nxp.com>",
        "References": "<1487205586-6785-1-git-send-email-hemant.agrawal@nxp.com>\n\t<1488545223-25739-1-git-send-email-hemant.agrawal@nxp.com>",
        "X-EOPAttributedMessage": "0",
        "X-Matching-Connectors": "131329988384579515;\n\t(91ab9b29-cfa4-454e-5278-08d120cd25b8); ()",
        "X-Forefront-Antispam-Report": "CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI;\n\tSFV:NSPM;\n\tSFS:(10009020)(6009001)(7916002)(336005)(39860400002)(39410400002)(39840400002)(39400400002)(39850400002)(39450400003)(39380400002)(2980300002)(1110001)(1109001)(339900001)(51234002)(189002)(199003)(9170700003)(356003)(8936002)(50466002)(77096006)(5890100001)(105606002)(54906002)(106466001)(86362001)(575784001)(53936002)(305945005)(8656002)(5660300001)(50226002)(33646002)(85426001)(5003940100001)(81166006)(2351001)(2906002)(6916009)(50986999)(6666003)(36756003)(76176999)(38730400002)(47776003)(110136004)(8676002)(2950100002)(16200700003)(189998001)(104016004)(4326008)(53946003)(48376002)(626004)(92566002)(2004002)(559001)(579004)(569005);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2950;\n\tH:tx30smr01.am.freescale.net; \n\tFPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent;\n\tLANG:en; ",
        "X-Microsoft-Exchange-Diagnostics": [
            "1; BL2FFO11FD050;\n\t1:YWUATIz341MVzLxTJ7cIP5uvNaiJDEC/0dtWwgHqHBqSY+QrQOFMH4y5qYQpTtNPqtCorV0JZZF3TCwUuF+8tzeMYh/VnG6qiJ09CDOHl8tvmniSSxMWHmGKfSpkMgdGedaKSUJU/4dbCa/6/2m9zy6qbVqKPsAjnAWl34+h6P3Pithoowj9ERSnDk/2GD8vq72Jpx/z+/BsfbC4BITdvjH7BYbQOTQQaRetfSMDVUnWKMMvtX9EZC2fuxvfcNEcRgSHxsmiFXu65WcscBE6jorQZx293VWQJmtbZxGXNHyHLBBE0jTQH1JLAkVMOEh9iHDU8yvvAlpRKo7y0p/Wa2Vb7ofZYcWgBsQtC2HE/Iw7GOh5BFiVHdsi5E/OKnPOu7PWoGCiffqfDfzXeuVwxRR9JnyxJy9JQezvsvTD9Z2zlylzPAL4X6TsyvqcxmDHQieSGNy/xUeR4xyzEpo0UiP/J4E2sv/QI6pl+aJ8sMXoHMkyhA7DnNJqEz+e0YaQsgItMTs1fNYPUGdnqcTbYK5/4tpzEef3yxQ0sW3pH/iNEfVcOK60n/aPlDxlpGea9XE/tZiC3VDXQsqnD9GkpwO6jJ45w9/1jpaKbwVzHRFP26815S/JC7VVa09iZQI8wp5j+Nm4s/uT6Yi0Xft4Hw==",
            "1; CY4PR03MB2950;\n\t3:bNZeoPh4WTs6xBQD0RHh0w0NKGlIUSbgz/Tk5pre4vVsbR6vf9uWY/h6tDbqcl+SRVJ/Te5O4UKxwRXiY1Of8vKJzKCx8gXGc1JEiIWkDcRQ//KFEBEFG6c+NkYb16XGMAGbr6dX+4TdL5y8ADnqaKGvJaw5ijmsqhLeoqq4d1j07Ah1wPb31ZS7cievth5XRpZRhDdm2XwNeFVhD7KReks8Maxs/GDNtHs9d34iYM8Az7xksGrJMuVLlzmJKelgAL+SjJyMjRZcF88qU+WYBWyiBPc3fCZFFxrw6/w1YVom5YeL/Hb9huu5fydV9Bx55LoIvgjvJlxygRycmV/YBn+LJBXfIEE/VerAOtRitTkaygEJrU8Q3cdcm1/SFpYj;\n\t25:D0MEbePUvgUOdlGQhE1bSKxTHiy3anu7W0lWzcaO8UCRufkTPgRI/OXJtQcqyDloIn6kAOImF/dZ0yTIkIt6DYB3h3W6F4LDy0OmPoLpMRh1E5H6BBYIrJ0bSxP0MLJsKAxAR8HP0xAUMRafbSHbOa/csqUulhsyCXLSOmtVWPStwI7sW7wrJ7zMeng500meQBaSMUVYTC/wM4KBWdkJ1Equ6cdN/ItltAClAkqdwO/zpQAOF6FE+UyFdVdO4DCm4104pGMeyfoc4TaVGeiXEPw4g9yHdiRRXtHtghncrGes4zH9wyhWM8UODW+cr6AwOMX9vMTg5VfzExqQafR7SeWbuffz8BiPeENldNZ9g4XcHevsWmAz3n9q9tf2P6Xdn+JH9ApIedSt+H63BHmsm2nhMQ5hqDlhy5skF5KNmyqRzy9pkVAHIKJmZAI8uAmG7cWmvg0+4r1YOgENeUeCbw==",
            "1; CY4PR03MB2950;\n\t31:qhBM3YG6elQGbUAmzIjSuE8aEa35AogTbke789DPc8jQI04mMBpG9p2QdX78cqnBfkcermYmRXX5hgS3beJ982Ov1Dns/yUNkh6cZCG26TostD6GRG8urheZEhEAG49+ngOt16jd+ZQMXjvA+A1k0mVBaHzHIMF90TRPq3Gdv35RcjpZvZ+UxrdVz8ooRNjj8x+uuLCXU+jE+BCnG1GN+W683ktDZJgpAe20gqGNVoLS830pA9yGXOabGl5ykKySY/omGFr0VEKe/pJv721v1plneBPb18yjEqoZEBXC4wA=",
            "1; CY4PR03MB2950;\n\t4:6TU/qPOo2GIcrys69CdkqmKgk2xJxXXrcC/s21Z/G3UHxxnIZx3tN9x2f8rJZdyHagjB/ecyBUz3Ary4RLOOx5A8/IoxH69XLXw67NM7nQFOHD08ZmfYBDuvxs0mGz769nnLMoVXaj2ue3sZpacCPAn1DCF0N4u+MCH3g1ZmjHjgexCT2+9uoaafDbJrZ0fuQov5llkKrVsnhKFcCITJNaFCzQ2D1Rg7SMIjuY7lujpVAOjxmlTko3cNAWSDad2ZDfCzw7E3s8raFmzuFZ0VvtelzW8/NtLN0Dt9ct/ncgUGQ8gfUBSys69LCu0WDTVDmKeM2uBEXBAo2tokwRfv8FoiyrtQtmr63kPO0CvjtQaxB4baI0sz2jghZQ6jsfFva77FeOk3Z5Ci92SAh0DCJuDgwe994CPb9NbAG3FumTZxFelbDdVY0KT8+RqieOCONP0B7LtZT4tqgTk+uEDenishqf42WQGEnazXtzrhtYcyCHX8EI8Ojumwp7N7r9+8BPHizE9YqZbbTWajPY/a1lp7ySGnJmIkJ45TSbrXcPQWrX5t2wiZYUEpNZikeFCdyPirVcbMvM1y0M0APzdHR06KyLRvIIIg0/5Ab8orkVDFagM0+v+ye9ntabS4z6OmhAvFTTTIzPOhIbDMr+On2LNv7NQDVhEA+7DDtpOdrUwew9QCSwQwrTP0HblgnYUv9T10S1LeCmXxtkg8KFlzsC1bBIZdJB74fFJhY9pVSEdOJCI5YbI7C/RyyZpz4EY3SYXJScJbd3ZudL83e9hCEImeHzP1yjGufAXoe9pEaqClWcb0RzFPRnD72DwP3CSV",
            "=?us-ascii?Q?1; CY4PR03MB2950;\n\t23:TB1iByQSrUd8xEK9UYwuya046gFQKXyC1N8MeK/kc?=\n\tQkIu3FZxPg1IBMpezjQ5+tTbfPyJ7aswAxhnffswOkWtcUqt5vjYujrONVtfFYL5L8fhN4Hc8FboIHSaexqmLLVuY8lrQUNbtsVz3ogDjWUIdo6qsudjXYlNC88PlBX9RFYJTlxyAc8yle/T2AeYeoD3ZRUuUxlH8aJZ5VgpA2XdQOkzoC80wWKUNJqnfuUsrJ9u/gL3yhTgUWGuHPskhcu6Mfw1GgEs9K5bSMjEIMOS6x19aJvW4QBun5Qtll5Q7AnxNwiO2RQI9NprbJmsUnh5GaO6Yu1Wjav4E7I8/RnijKT7DNpC8EKP7IjgIw6NJ+chMWrrREekS4h0C4gvbNekddRxgw4r5hqufSH1thfWifCaS77WD0c/drw41pMHZWQ0z52CgqcemGNZYe30r8rlhYfjuQRrz+rZR4rivcrs9r6ot8kjOgA7E+bZJx4Y4nNkgKZz7snof3o90TZDuKDJBxOC9sU2WMXoigzipJOVPBcQMb8HvkG4IweWTPbPEeDEWglwNOS27wt55IpMcotXBq3o0iMsnzg3LWIUIUD5FGKJTDb4HwDOwiHb5JiRQSBjp3nxfATn7hUtCZFMp7FLjlKrgvf8uhPMKeKln0j9VmT3ZQzPP9wqTXDCQHPT1NBb5OQJylhuIixYmpW0rGSX0Yw5HtKJMYPrgv5wIJssrVPTMIk6mn2e9pUVhCOddIs0VCL1tvfyH6nZ9EPiW/DTtCMs0R7VfS329Njh4iFZvfAgb0XJdC8k466SwmuV9T4XfTFg9GI/QVIDQd1jC+ryzzMveyun50DSVu+WVqGz4m6VfUxIcos0hVxM33EAuhDc9sExFGq3aDk7BgYHzSO5HPyzOkjXRHNSOBbevVYDx8Jk/YOBaY8Ai9PxtV+7d7dfZ9TY1/Oi1E6+Ni2bLHNSphhHV4nQcDS870iWD9Yw19PX6nQCWXLHFS1mv+/riiW4TLQU4mhgA1bRyXaVBpYxDSdfkjPATEY5uFDgweYunww8xQ+tMF8BPrnTXgcL07NRqi7qdtxEzYe8JEKPp4wNVKPya0glNII+FuGQ8UlkhTk3WC0xg8iKobykoAp4Jl7MmmcOC6eVXqKcgUmsBCDmnel932NuG9bUIcDpITDrxnmWqO0Qyl09Hxm7kfrbjdV2HfJUksJuInr4atnOGn9CJNVyKZkMbRHsREtbvHdfHJ35ALvKd/UVLF/zYF6BuDUZrIY1n7WpLXTpjE9VZfHECt247nkB9jQmnDV6orFlZSsq9IIlZNEj0msn3rbODU6uw22YsvhwHgDeGiHXuuR5IXSG6ZWPlQz6VuioPUrQ9H67PUJ9y7ULMfGtr+B5DOtEEL6PCiPAxtbY18IFaS1YYek02QXbY/SWWO0TCNX3phSZ9YuEJZgQPZDX73RvCNb0qoaExqNqaxp5V9F5I1o",
            "1; CY4PR03MB2950;\n\t6:ImJ9H3ads7HiughbLyJkxJ5hfTJSOyD9tTciuq+xukuDha3Yp6JKoq+Ifg4c3iIABxgIumcauN+Jc0Hab96q9nph83Fv/HfvvnURF7Ws8Kp12va8kT39xZGywVC9yYaVsbpRDIS3dpFXJy7l97U4D6AXm6I8zwbRCRWDY7wEvyG+qQlxK0RuPAn5ymT84SOdhCsbP6GHGksnDIBOC40wxSYEeiG8nUq/1Dn94/Y1vFAmlLWaCnveoZupC+fKBNokxghOUGXAhaG5ChAATohW4vD60YkEnmuHBlAdIPfBBAvZDc1eJa2jFBnXAucenndYZPF1RFs+s8/M9U11+c7en9vz4sycyGwxI9u2+CO95SlIhK+D8VMVSsZ3NzakSRIsvYvoRKGQrTh8v0G7NW8DS0clSfjr8k0gMJrPHrVL4jc=;\n\t5:SzxMC1XWwpZ+szVhcQnXdOTgPPFpmQPgbjoJoJxiibQE+KXBAOBdDChGIx2inJG4wsXAs2RFbO2pPTxdUHMJT/CzGm2bMcjCCcJZBKR/9N5S8DXzYKVeFpO7TyPmybWWcimkJSC9lzf9uf+usUO0JsxDx0MjpPNi/DqKtsSbMSffT/3k1v23q3zkepiTAf8H;\n\t24:cMaE4Cpl6VroylyP1RIk5U2Domxh7eR6CLu2HhJ4dfEPImUH/ymvRmRzytmwNZgyINibU7VMf4JD3TJ5gHqlzFKU/TvTpqeyq/3VJS3418E=",
            "1; CY4PR03MB2950;\n\t7:1UNEMFRQ2fGWCuDpR39rwSHC+hiXjpY/raWJNJTc77bImjpxF1KMsbpwF1ozEpncFkyW03KK551LEaiVW7aU4EyK5vq4wd31PRabF/B44nYShycrTXVoxU8O2X5dDycFdOlvkYyOt6PpHaG6J7UAZ9qrHHJSFNUqvt1wwL0dk9+5KmO3u07gmJzOLxUhVH8z1Qm61l/8f6fJMfBAgLR5sebPBf+srmJUHmLyL4GcuKZrB6SXB6P+QGSrQleTMYV/Bt/LCpPzTwjkdBeOwCVUJvK2y3/p4tUFksaZlwFr8rnkinVinZ8PsPTyWBd11fNq2vgoligy51IR5JhPcwVw/Q=="
        ],
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-MS-Office365-Filtering-Correlation-Id": "d86303ee-1741-4403-736d-08d46204dc66",
        "X-Microsoft-Antispam": "UriScan:; BCL:0; PCL:0; RULEID:(22001);\n\tSRVR:CY4PR03MB2950; ",
        "X-Microsoft-Antispam-PRVS": "<CY4PR03MB2950E756A91F07EB55FEF8C1892B0@CY4PR03MB2950.namprd03.prod.outlook.com>",
        "X-Exchange-Antispam-Report-Test": "UriScan:(278428928389397)(185117386973197)(275809806118684); ",
        "X-Exchange-Antispam-Report-CFA-Test": "BCL:0; PCL:0;\n\tRULEID:(6095060)(601004)(2401047)(8121501046)(5005006)(13015025)(13017025)(13023025)(13024025)(13018025)(10201501046)(3002001)(6055026)(6096035)(20161123556025)(20161123561025)(20161123565025)(20161123563025)(20161123559025);\n\tSRVR:CY4PR03MB2950; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2950;",
        "X-Forefront-PRVS": "0235CBE7D0",
        "SpamDiagnosticOutput": "1:99",
        "SpamDiagnosticMetadata": "NSPM",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "03 Mar 2017 07:13:58.1303\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-Id": "5afe0b00-7697-4969-b663-5eab37d5f47e",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;\n\tIp=[192.88.168.50]; \n\tHelo=[tx30smr01.am.freescale.net]",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "CY4PR03MB2950",
        "Subject": "[dpdk-dev] [PATCHv8 16/46] net/dpaa2: add mc dpni object support",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This patch add support for dpni object support in MC driver.\n\nDPNI represent a network interface object in DPAA2.\n\nSigned-off-by: Alex Marginean <alexandru.marginean@nxp.com>\nSigned-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>\n---\n drivers/net/dpaa2/Makefile          |    4 +\n drivers/net/dpaa2/mc/dpni.c         |  739 +++++++++++++++++++++\n drivers/net/dpaa2/mc/fsl_dpkg.h     |  184 ++++++\n drivers/net/dpaa2/mc/fsl_dpni.h     | 1217 +++++++++++++++++++++++++++++++++++\n drivers/net/dpaa2/mc/fsl_dpni_cmd.h |  334 ++++++++++\n drivers/net/dpaa2/mc/fsl_net.h      |  487 ++++++++++++++\n 6 files changed, 2965 insertions(+)\n create mode 100644 drivers/net/dpaa2/mc/dpni.c\n create mode 100644 drivers/net/dpaa2/mc/fsl_dpkg.h\n create mode 100644 drivers/net/dpaa2/mc/fsl_dpni.h\n create mode 100644 drivers/net/dpaa2/mc/fsl_dpni_cmd.h\n create mode 100644 drivers/net/dpaa2/mc/fsl_net.h",
    "diff": "diff --git a/drivers/net/dpaa2/Makefile b/drivers/net/dpaa2/Makefile\nindex 3e3c8d1..db94b45 100644\n--- a/drivers/net/dpaa2/Makefile\n+++ b/drivers/net/dpaa2/Makefile\n@@ -43,10 +43,13 @@ else\n CFLAGS += -O3\n CFLAGS += $(WERROR_FLAGS)\n endif\n+CFLAGS += \"-Wno-strict-aliasing\"\n \n CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2\n+CFLAGS += -I$(RTE_SDK)/drivers/net/dpaa2/mc\n CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc\n CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include\n+CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/mc\n CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal\n \n # versioning export map\n@@ -56,6 +59,7 @@ EXPORT_MAP := rte_pmd_dpaa2_version.map\n LIBABIVER := 1\n \n SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2_ethdev.c\n+SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += mc/dpni.c\n \n # library dependencies\n DEPDIRS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += lib/librte_eal lib/librte_ether\ndiff --git a/drivers/net/dpaa2/mc/dpni.c b/drivers/net/dpaa2/mc/dpni.c\nnew file mode 100644\nindex 0000000..3330614\n--- /dev/null\n+++ b/drivers/net/dpaa2/mc/dpni.c\n@@ -0,0 +1,739 @@\n+/*-\n+ * This file is provided under a dual BSD/GPLv2 license. When using or\n+ * redistributing this file, you may do so under either license.\n+ *\n+ *   BSD LICENSE\n+ *\n+ * Copyright 2013-2016 Freescale Semiconductor Inc.\n+ * Copyright (c) 2016 NXP.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in the\n+ * documentation and/or other materials provided with the distribution.\n+ * * Neither the name of the above-listed copyright holders nor the\n+ * names of any contributors may be used to endorse or promote products\n+ * derived from this software without specific prior written permission.\n+ *\n+ *   GPL LICENSE SUMMARY\n+ *\n+ * ALTERNATIVELY, this software may be distributed under the terms of the\n+ * GNU General Public License (\"GPL\") as published by the Free Software\n+ * Foundation, either version 2 of that License or (at your option) any\n+ * later version.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ */\n+#include <fsl_mc_sys.h>\n+#include <fsl_mc_cmd.h>\n+#include <fsl_dpni.h>\n+#include <fsl_dpni_cmd.h>\n+\n+int dpni_prepare_key_cfg(const struct dpkg_profile_cfg *cfg,\n+\t\t\t uint8_t *key_cfg_buf)\n+{\n+\tint i, j;\n+\tint offset = 0;\n+\tint param = 1;\n+\tuint64_t *params = (uint64_t *)key_cfg_buf;\n+\n+\tif (!key_cfg_buf || !cfg)\n+\t\treturn -EINVAL;\n+\n+\tparams[0] |= mc_enc(0, 8, cfg->num_extracts);\n+\tparams[0] = cpu_to_le64(params[0]);\n+\n+\tif (cfg->num_extracts >= DPKG_MAX_NUM_OF_EXTRACTS)\n+\t\treturn -EINVAL;\n+\n+\tfor (i = 0; i < cfg->num_extracts; i++) {\n+\t\tswitch (cfg->extracts[i].type) {\n+\t\tcase DPKG_EXTRACT_FROM_HDR:\n+\t\t\tparams[param] |= mc_enc(0, 8,\n+\t\t\t\t\tcfg->extracts[i].extract.from_hdr.prot);\n+\t\t\tparams[param] |= mc_enc(8, 4,\n+\t\t\t\t\tcfg->extracts[i].extract.from_hdr.type);\n+\t\t\tparams[param] |= mc_enc(16, 8,\n+\t\t\t\t\tcfg->extracts[i].extract.from_hdr.size);\n+\t\t\tparams[param] |= mc_enc(24, 8,\n+\t\t\t\t\tcfg->extracts[i].extract.\n+\t\t\t\t\tfrom_hdr.offset);\n+\t\t\tparams[param] |= mc_enc(32, 32,\n+\t\t\t\t\tcfg->extracts[i].extract.\n+\t\t\t\t\tfrom_hdr.field);\n+\t\t\tparams[param] = cpu_to_le64(params[param]);\n+\t\t\tparam++;\n+\t\t\tparams[param] |= mc_enc(0, 8,\n+\t\t\t\t\tcfg->extracts[i].extract.\n+\t\t\t\t\tfrom_hdr.hdr_index);\n+\t\t\tbreak;\n+\t\tcase DPKG_EXTRACT_FROM_DATA:\n+\t\t\tparams[param] |= mc_enc(16, 8,\n+\t\t\t\t\tcfg->extracts[i].extract.\n+\t\t\t\t\tfrom_data.size);\n+\t\t\tparams[param] |= mc_enc(24, 8,\n+\t\t\t\t\tcfg->extracts[i].extract.\n+\t\t\t\t\tfrom_data.offset);\n+\t\t\tparams[param] = cpu_to_le64(params[param]);\n+\t\t\tparam++;\n+\t\t\tbreak;\n+\t\tcase DPKG_EXTRACT_FROM_PARSE:\n+\t\t\tparams[param] |= mc_enc(16, 8,\n+\t\t\t\t\tcfg->extracts[i].extract.\n+\t\t\t\t\tfrom_parse.size);\n+\t\t\tparams[param] |= mc_enc(24, 8,\n+\t\t\t\t\tcfg->extracts[i].extract.\n+\t\t\t\t\tfrom_parse.offset);\n+\t\t\tparams[param] = cpu_to_le64(params[param]);\n+\t\t\tparam++;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t\tparams[param] |= mc_enc(\n+\t\t\t24, 8, cfg->extracts[i].num_of_byte_masks);\n+\t\tparams[param] |= mc_enc(32, 4, cfg->extracts[i].type);\n+\t\tparams[param] = cpu_to_le64(params[param]);\n+\t\tparam++;\n+\t\tfor (offset = 0, j = 0;\n+\t\t\tj < DPKG_NUM_OF_MASKS;\n+\t\t\toffset += 16, j++) {\n+\t\t\tparams[param] |= mc_enc(\n+\t\t\t\t(offset), 8, cfg->extracts[i].masks[j].mask);\n+\t\t\tparams[param] |= mc_enc(\n+\t\t\t\t(offset + 8), 8,\n+\t\t\t\tcfg->extracts[i].masks[j].offset);\n+\t\t}\n+\t\tparams[param] = cpu_to_le64(params[param]);\n+\t\tparam++;\n+\t}\n+\treturn 0;\n+}\n+\n+int dpni_open(struct fsl_mc_io *mc_io,\n+\t      uint32_t cmd_flags,\n+\t      int dpni_id,\n+\t      uint16_t *token)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\tint err;\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_OPEN,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  0);\n+\tDPNI_CMD_OPEN(cmd, dpni_id);\n+\n+\t/* send command to mc*/\n+\terr = mc_send_command(mc_io, &cmd);\n+\tif (err)\n+\t\treturn err;\n+\n+\t/* retrieve response parameters */\n+\t*token = MC_CMD_HDR_READ_TOKEN(cmd.header);\n+\n+\treturn 0;\n+}\n+\n+int dpni_close(struct fsl_mc_io *mc_io,\n+\t       uint32_t cmd_flags,\n+\t       uint16_t token)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_CLOSE,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\n+\t/* send command to mc*/\n+\treturn mc_send_command(mc_io, &cmd);\n+}\n+\n+int dpni_create(struct fsl_mc_io\t*mc_io,\n+\t\tuint16_t\tdprc_token,\n+\t\tuint32_t\tcmd_flags,\n+\t\tconst struct dpni_cfg\t*cfg,\n+\t\tuint32_t\t*obj_id)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\tint err;\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_CREATE,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  dprc_token);\n+\tDPNI_CMD_CREATE(cmd, cfg);\n+\n+\t/* send command to mc*/\n+\terr = mc_send_command(mc_io, &cmd);\n+\tif (err)\n+\t\treturn err;\n+\n+\t/* retrieve response parameters */\n+\tCMD_CREATE_RSP_GET_OBJ_ID_PARAM0(cmd, *obj_id);\n+\n+\treturn 0;\n+}\n+\n+int dpni_destroy(struct fsl_mc_io\t*mc_io,\n+\t\t uint16_t\tdprc_token,\n+\t\tuint32_t\tcmd_flags,\n+\t\tuint32_t\tobject_id)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_DESTROY,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  dprc_token);\n+\t/* set object id to destroy */\n+\tCMD_DESTROY_SET_OBJ_ID_PARAM0(cmd, object_id);\n+\t/* send command to mc*/\n+\treturn mc_send_command(mc_io, &cmd);\n+}\n+\n+int dpni_set_pools(struct fsl_mc_io *mc_io,\n+\t\t   uint32_t cmd_flags,\n+\t\t   uint16_t token,\n+\t\t   const struct dpni_pools_cfg *cfg)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_POOLS,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\tDPNI_CMD_SET_POOLS(cmd, cfg);\n+\n+\t/* send command to mc*/\n+\treturn mc_send_command(mc_io, &cmd);\n+}\n+\n+int dpni_enable(struct fsl_mc_io *mc_io,\n+\t\tuint32_t cmd_flags,\n+\t\tuint16_t token)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_ENABLE,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\n+\t/* send command to mc*/\n+\treturn mc_send_command(mc_io, &cmd);\n+}\n+\n+int dpni_disable(struct fsl_mc_io *mc_io,\n+\t\t uint32_t cmd_flags,\n+\t\t uint16_t token)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_DISABLE,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\n+\t/* send command to mc*/\n+\treturn mc_send_command(mc_io, &cmd);\n+}\n+\n+int dpni_is_enabled(struct fsl_mc_io *mc_io,\n+\t\t    uint32_t cmd_flags,\n+\t\t    uint16_t token,\n+\t\t    int *en)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\tint err;\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_IS_ENABLED, cmd_flags,\n+\t\t\t\t\t  token);\n+\n+\t/* send command to mc*/\n+\terr = mc_send_command(mc_io, &cmd);\n+\tif (err)\n+\t\treturn err;\n+\n+\t/* retrieve response parameters */\n+\tDPNI_RSP_IS_ENABLED(cmd, *en);\n+\n+\treturn 0;\n+}\n+\n+int dpni_reset(struct fsl_mc_io *mc_io,\n+\t       uint32_t cmd_flags,\n+\t       uint16_t token)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_RESET,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\n+\t/* send command to mc*/\n+\treturn mc_send_command(mc_io, &cmd);\n+}\n+\n+int dpni_get_attributes(struct fsl_mc_io *mc_io,\n+\t\t\tuint32_t cmd_flags,\n+\t\t\tuint16_t token,\n+\t\t\tstruct dpni_attr *attr)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\tint err;\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_ATTR,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\n+\t/* send command to mc*/\n+\terr = mc_send_command(mc_io, &cmd);\n+\tif (err)\n+\t\treturn err;\n+\n+\t/* retrieve response parameters */\n+\tDPNI_RSP_GET_ATTR(cmd, attr);\n+\n+\treturn 0;\n+}\n+\n+int dpni_set_errors_behavior(struct fsl_mc_io *mc_io,\n+\t\t\t     uint32_t cmd_flags,\n+\t\t\t     uint16_t token,\n+\t\t\t      struct dpni_error_cfg *cfg)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_ERRORS_BEHAVIOR,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\tDPNI_CMD_SET_ERRORS_BEHAVIOR(cmd, cfg);\n+\n+\t/* send command to mc*/\n+\treturn mc_send_command(mc_io, &cmd);\n+}\n+\n+int dpni_get_buffer_layout(struct fsl_mc_io *mc_io,\n+\t\t\t   uint32_t cmd_flags,\n+\t\t\t   uint16_t token,\n+\t\t\t   enum dpni_queue_type qtype,\n+\t\t\t   struct dpni_buffer_layout *layout)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\tint err;\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_BUFFER_LAYOUT,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\tDPNI_CMD_GET_BUFFER_LAYOUT(cmd, qtype);\n+\n+\t/* send command to mc*/\n+\terr = mc_send_command(mc_io, &cmd);\n+\tif (err)\n+\t\treturn err;\n+\n+\t/* retrieve response parameters */\n+\tDPNI_RSP_GET_BUFFER_LAYOUT(cmd, layout);\n+\n+\treturn 0;\n+}\n+\n+int dpni_set_buffer_layout(struct fsl_mc_io *mc_io,\n+\t\t\t   uint32_t cmd_flags,\n+\t\t\t      uint16_t token,\n+\t\t\t      enum dpni_queue_type qtype,\n+\t\t\t      const struct dpni_buffer_layout *layout)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_BUFFER_LAYOUT,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\tDPNI_CMD_SET_BUFFER_LAYOUT(cmd, qtype, layout);\n+\n+\t/* send command to mc*/\n+\treturn mc_send_command(mc_io, &cmd);\n+}\n+\n+int dpni_set_offload(struct fsl_mc_io *mc_io,\n+\t\t     uint32_t cmd_flags,\n+\t\t     uint16_t token,\n+\t\t     enum dpni_offload type,\n+\t\t     uint32_t config)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_OFFLOAD,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\tDPNI_CMD_SET_OFFLOAD(cmd, type, config);\n+\n+\t/* send command to mc*/\n+\treturn mc_send_command(mc_io, &cmd);\n+}\n+\n+int dpni_get_offload(struct fsl_mc_io *mc_io,\n+\t\t     uint32_t cmd_flags,\n+\t\t     uint16_t token,\n+\t\t     enum dpni_offload type,\n+\t\t     uint32_t *config)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\tint err;\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_OFFLOAD,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\tDPNI_CMD_GET_OFFLOAD(cmd, type);\n+\n+\t/* send command to mc*/\n+\terr = mc_send_command(mc_io, &cmd);\n+\tif (err)\n+\t\treturn err;\n+\n+\t/* retrieve response parameters */\n+\tDPNI_RSP_GET_OFFLOAD(cmd, *config);\n+\n+\treturn 0;\n+}\n+\n+int dpni_get_qdid(struct fsl_mc_io *mc_io,\n+\t\t  uint32_t cmd_flags,\n+\t\t  uint16_t token,\n+\t\t  enum dpni_queue_type qtype,\n+\t\t  uint16_t *qdid)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\tint err;\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_QDID,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\tDPNI_CMD_GET_QDID(cmd, qtype);\n+\n+\t/* send command to mc*/\n+\terr = mc_send_command(mc_io, &cmd);\n+\tif (err)\n+\t\treturn err;\n+\n+\t/* retrieve response parameters */\n+\tDPNI_RSP_GET_QDID(cmd, *qdid);\n+\n+\treturn 0;\n+}\n+int dpni_get_link_state(struct fsl_mc_io *mc_io,\n+\t\t\tuint32_t cmd_flags,\n+\t\t\tuint16_t token,\n+\t\t\tstruct dpni_link_state *state)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\tint err;\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_LINK_STATE,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\n+\t/* send command to mc*/\n+\terr = mc_send_command(mc_io, &cmd);\n+\tif (err)\n+\t\treturn err;\n+\n+\t/* retrieve response parameters */\n+\tDPNI_RSP_GET_LINK_STATE(cmd, state);\n+\n+\treturn 0;\n+}\n+\n+int dpni_set_max_frame_length(struct fsl_mc_io *mc_io,\n+\t\t\t      uint32_t cmd_flags,\n+\t\t\t      uint16_t token,\n+\t\t\t      uint16_t max_frame_length)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_MAX_FRAME_LENGTH,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\tDPNI_CMD_SET_MAX_FRAME_LENGTH(cmd, max_frame_length);\n+\n+\t/* send command to mc*/\n+\treturn mc_send_command(mc_io, &cmd);\n+}\n+\n+int dpni_get_max_frame_length(struct fsl_mc_io *mc_io,\n+\t\t\t      uint32_t cmd_flags,\n+\t\t\t      uint16_t token,\n+\t\t\t      uint16_t *max_frame_length)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\tint err;\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_MAX_FRAME_LENGTH,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\n+\t/* send command to mc*/\n+\terr = mc_send_command(mc_io, &cmd);\n+\tif (err)\n+\t\treturn err;\n+\n+\t/* retrieve response parameters */\n+\tDPNI_RSP_GET_MAX_FRAME_LENGTH(cmd, *max_frame_length);\n+\n+\treturn 0;\n+}\n+\n+int dpni_set_unicast_promisc(struct fsl_mc_io *mc_io,\n+\t\t\t     uint32_t cmd_flags,\n+\t\t\t     uint16_t token,\n+\t\t\t     int en)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_UNICAST_PROMISC,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\tDPNI_CMD_SET_UNICAST_PROMISC(cmd, en);\n+\n+\t/* send command to mc*/\n+\treturn mc_send_command(mc_io, &cmd);\n+}\n+\n+int dpni_get_unicast_promisc(struct fsl_mc_io *mc_io,\n+\t\t\t     uint32_t cmd_flags,\n+\t\t\t     uint16_t token,\n+\t\t\t     int *en)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\tint err;\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_UNICAST_PROMISC,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\n+\t/* send command to mc*/\n+\terr = mc_send_command(mc_io, &cmd);\n+\tif (err)\n+\t\treturn err;\n+\n+\t/* retrieve response parameters */\n+\tDPNI_RSP_GET_UNICAST_PROMISC(cmd, *en);\n+\n+\treturn 0;\n+}\n+\n+int dpni_set_primary_mac_addr(struct fsl_mc_io *mc_io,\n+\t\t\t      uint32_t cmd_flags,\n+\t\t\t      uint16_t token,\n+\t\t\t      const uint8_t mac_addr[6])\n+{\n+\tstruct mc_command cmd = { 0 };\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_PRIM_MAC,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\tDPNI_CMD_SET_PRIMARY_MAC_ADDR(cmd, mac_addr);\n+\n+\t/* send command to mc*/\n+\treturn mc_send_command(mc_io, &cmd);\n+}\n+\n+int dpni_get_primary_mac_addr(struct fsl_mc_io *mc_io,\n+\t\t\t      uint32_t cmd_flags,\n+\t\t\t      uint16_t token,\n+\t\t\t      uint8_t mac_addr[6])\n+{\n+\tstruct mc_command cmd = { 0 };\n+\tint err;\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_PRIM_MAC,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\n+\t/* send command to mc*/\n+\terr = mc_send_command(mc_io, &cmd);\n+\tif (err)\n+\t\treturn err;\n+\n+\t/* retrieve response parameters */\n+\tDPNI_RSP_GET_PRIMARY_MAC_ADDR(cmd, mac_addr);\n+\n+\treturn 0;\n+}\n+\n+int dpni_set_rx_tc_dist(struct fsl_mc_io *mc_io,\n+\t\t\tuint32_t cmd_flags,\n+\t\t\tuint16_t token,\n+\t\t\tuint8_t tc_id,\n+\t\t\tconst struct dpni_rx_tc_dist_cfg *cfg)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_RX_TC_DIST,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\tDPNI_CMD_SET_RX_TC_DIST(cmd, tc_id, cfg);\n+\n+\t/* send command to mc*/\n+\treturn mc_send_command(mc_io, &cmd);\n+}\n+\n+int dpni_set_tx_confirmation_mode(struct fsl_mc_io\t*mc_io,\n+\t\t\t\t  uint32_t\t\tcmd_flags,\n+\t\t\t    uint16_t\t\ttoken,\n+\t\t\t    enum dpni_confirmation_mode mode)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_TX_CONFIRMATION_MODE,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\tDPNI_CMD_SET_TX_CONFIRMATION_MODE(cmd, mode);\n+\n+\t/* send command to mc*/\n+\treturn mc_send_command(mc_io, &cmd);\n+}\n+\n+int dpni_get_api_version(struct fsl_mc_io *mc_io,\n+\t\t\t uint32_t cmd_flags,\n+\t\t\t   uint16_t *major_ver,\n+\t\t\t   uint16_t *minor_ver)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\tint err;\n+\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_API_VERSION,\n+\t\t\t\t\tcmd_flags,\n+\t\t\t\t\t0);\n+\n+\terr = mc_send_command(mc_io, &cmd);\n+\tif (err)\n+\t\treturn err;\n+\n+\tDPNI_RSP_GET_API_VERSION(cmd, *major_ver, *minor_ver);\n+\n+\treturn 0;\n+}\n+\n+int dpni_set_queue(struct fsl_mc_io *mc_io,\n+\t\t   uint32_t cmd_flags,\n+\t\t     uint16_t token,\n+\t\t   enum dpni_queue_type qtype,\n+\t\t\t uint8_t tc,\n+\t\t\t uint8_t index,\n+\t\t   uint8_t options,\n+\t\t     const struct dpni_queue *queue)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_QUEUE,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\tDPNI_CMD_SET_QUEUE(cmd, qtype, tc, index, options, queue);\n+\n+\t/* send command to mc*/\n+\treturn mc_send_command(mc_io, &cmd);\n+}\n+\n+int dpni_get_queue(struct fsl_mc_io *mc_io,\n+\t\t   uint32_t cmd_flags,\n+\t\t     uint16_t token,\n+\t\t   enum dpni_queue_type qtype,\n+\t\t\t uint8_t tc,\n+\t\t\t uint8_t index,\n+\t\t   struct dpni_queue *queue,\n+\t\t   struct dpni_queue_id *qid)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\tint err;\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_QUEUE,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\tDPNI_CMD_GET_QUEUE(cmd, qtype, tc, index);\n+\n+\t/* send command to mc*/\n+\terr = mc_send_command(mc_io, &cmd);\n+\tif (err)\n+\t\treturn err;\n+\n+\t/* retrieve response parameters */\n+\tDPNI_RSP_GET_QUEUE(cmd, queue, qid);\n+\n+\treturn 0;\n+}\n+\n+int dpni_get_statistics(struct fsl_mc_io *mc_io,\n+\t\t\tuint32_t cmd_flags,\n+\t\t\tuint16_t token,\n+\t\t\tuint8_t page,\n+\t\t\tunion dpni_statistics *stat)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\tint err;\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_STATISTICS,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\tDPNI_CMD_GET_STATISTICS(cmd, page);\n+\n+\t/* send command to mc*/\n+\terr = mc_send_command(mc_io, &cmd);\n+\tif (err)\n+\t\treturn err;\n+\n+\t/* retrieve response parameters */\n+\tDPNI_RSP_GET_STATISTICS(cmd, stat);\n+\n+\treturn 0;\n+}\n+\n+int dpni_reset_statistics(struct fsl_mc_io *mc_io,\n+\t\t\t  uint32_t cmd_flags,\n+\t\t     uint16_t token)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_RESET_STATISTICS,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\n+\t/* send command to mc*/\n+\treturn mc_send_command(mc_io, &cmd);\n+}\ndiff --git a/drivers/net/dpaa2/mc/fsl_dpkg.h b/drivers/net/dpaa2/mc/fsl_dpkg.h\nnew file mode 100644\nindex 0000000..3e0f4b0\n--- /dev/null\n+++ b/drivers/net/dpaa2/mc/fsl_dpkg.h\n@@ -0,0 +1,184 @@\n+/*-\n+ * This file is provided under a dual BSD/GPLv2 license. When using or\n+ * redistributing this file, you may do so under either license.\n+ *\n+ *   BSD LICENSE\n+ *\n+ * Copyright 2013-2015 Freescale Semiconductor Inc.\n+ * Copyright (c) 2016 NXP.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in the\n+ * documentation and/or other materials provided with the distribution.\n+ * * Neither the name of the above-listed copyright holders nor the\n+ * names of any contributors may be used to endorse or promote products\n+ * derived from this software without specific prior written permission.\n+ *\n+ *   GPL LICENSE SUMMARY\n+ *\n+ * ALTERNATIVELY, this software may be distributed under the terms of the\n+ * GNU General Public License (\"GPL\") as published by the Free Software\n+ * Foundation, either version 2 of that License or (at your option) any\n+ * later version.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ */\n+#ifndef __FSL_DPKG_H_\n+#define __FSL_DPKG_H_\n+\n+#include <fsl_net.h>\n+\n+/* Data Path Key Generator API\n+ * Contains initialization APIs and runtime APIs for the Key Generator\n+ */\n+\n+/** Key Generator properties */\n+\n+/**\n+ * Number of masks per key extraction\n+ */\n+#define DPKG_NUM_OF_MASKS\t\t4\n+/**\n+ * Number of extractions per key profile\n+ */\n+#define DPKG_MAX_NUM_OF_EXTRACTS\t10\n+\n+/**\n+ * enum dpkg_extract_from_hdr_type - Selecting extraction by header types\n+ * @DPKG_FROM_HDR: Extract selected bytes from header, by offset\n+ * @DPKG_FROM_FIELD: Extract selected bytes from header, by offset from field\n+ * @DPKG_FULL_FIELD: Extract a full field\n+ */\n+enum dpkg_extract_from_hdr_type {\n+\tDPKG_FROM_HDR = 0,\n+\tDPKG_FROM_FIELD = 1,\n+\tDPKG_FULL_FIELD = 2\n+};\n+\n+/**\n+ * enum dpkg_extract_type - Enumeration for selecting extraction type\n+ * @DPKG_EXTRACT_FROM_HDR: Extract from the header\n+ * @DPKG_EXTRACT_FROM_DATA: Extract from data not in specific header\n+ * @DPKG_EXTRACT_FROM_PARSE: Extract from parser-result;\n+ *\te.g. can be used to extract header existence;\n+ *\tplease refer to 'Parse Result definition' section in the parser BG\n+ */\n+enum dpkg_extract_type {\n+\tDPKG_EXTRACT_FROM_HDR = 0,\n+\tDPKG_EXTRACT_FROM_DATA = 1,\n+\tDPKG_EXTRACT_FROM_PARSE = 3\n+};\n+\n+/**\n+ * struct dpkg_mask - A structure for defining a single extraction mask\n+ * @mask: Byte mask for the extracted content\n+ * @offset: Offset within the extracted content\n+ */\n+struct dpkg_mask {\n+\tuint8_t mask;\n+\tuint8_t offset;\n+};\n+\n+/**\n+ * struct dpkg_extract - A structure for defining a single extraction\n+ * @type: Determines how the union below is interpreted:\n+ *\t\tDPKG_EXTRACT_FROM_HDR: selects 'from_hdr';\n+ *\t\tDPKG_EXTRACT_FROM_DATA: selects 'from_data';\n+ *\t\tDPKG_EXTRACT_FROM_PARSE: selects 'from_parse'\n+ * @extract: Selects extraction method\n+ * @num_of_byte_masks: Defines the number of valid entries in the array below;\n+ *\t\tThis is\talso the number of bytes to be used as masks\n+ * @masks: Masks parameters\n+ */\n+struct dpkg_extract {\n+\tenum dpkg_extract_type type;\n+\t/**\n+\t * union extract - Selects extraction method\n+\t * @from_hdr - Used when 'type = DPKG_EXTRACT_FROM_HDR'\n+\t * @from_data - Used when 'type = DPKG_EXTRACT_FROM_DATA'\n+\t * @from_parse - Used when 'type = DPKG_EXTRACT_FROM_PARSE'\n+\t */\n+\tunion {\n+\t\t/**\n+\t\t * struct from_hdr - Used when 'type = DPKG_EXTRACT_FROM_HDR'\n+\t\t * @prot: Any of the supported headers\n+\t\t * @type: Defines the type of header extraction:\n+\t\t *\tDPKG_FROM_HDR: use size & offset below;\n+\t\t *\tDPKG_FROM_FIELD: use field, size and offset below;\n+\t\t *\tDPKG_FULL_FIELD: use field below\n+\t\t * @field: One of the supported fields (NH_FLD_)\n+\t\t *\n+\t\t * @size: Size in bytes\n+\t\t * @offset: Byte offset\n+\t\t * @hdr_index: Clear for cases not listed below;\n+\t\t *\tUsed for protocols that may have more than a single\n+\t\t *\theader, 0 indicates an outer header;\n+\t\t *\tSupported protocols (possible values):\n+\t\t *\tNET_PROT_VLAN (0, HDR_INDEX_LAST);\n+\t\t *\tNET_PROT_MPLS (0, 1, HDR_INDEX_LAST);\n+\t\t *\tNET_PROT_IP(0, HDR_INDEX_LAST);\n+\t\t *\tNET_PROT_IPv4(0, HDR_INDEX_LAST);\n+\t\t *\tNET_PROT_IPv6(0, HDR_INDEX_LAST);\n+\t\t */\n+\n+\t\tstruct {\n+\t\t\tenum net_prot\t\t\tprot;\n+\t\t\tenum dpkg_extract_from_hdr_type type;\n+\t\t\tuint32_t\t\t\tfield;\n+\t\t\tuint8_t\t\t\t\tsize;\n+\t\t\tuint8_t\t\t\t\toffset;\n+\t\t\tuint8_t\t\t\t\thdr_index;\n+\t\t} from_hdr;\n+\t\t/**\n+\t\t * struct from_data\n+\t\t *\tUsed when 'type = DPKG_EXTRACT_FROM_DATA'\n+\t\t * @size: Size in bytes\n+\t\t * @offset: Byte offset\n+\t\t */\n+\t\tstruct {\n+\t\t\tuint8_t size;\n+\t\t\tuint8_t offset;\n+\t\t} from_data;\n+\n+\t\t/**\n+\t\t * struct from_parse\n+\t\t *\tUsed when 'type = DPKG_EXTRACT_FROM_PARSE'\n+\t\t * @size: Size in bytes\n+\t\t * @offset: Byte offset\n+\t\t */\n+\t\tstruct {\n+\t\t\tuint8_t size;\n+\t\t\tuint8_t offset;\n+\t\t} from_parse;\n+\t} extract;\n+\n+\tuint8_t\t\t\tnum_of_byte_masks;\n+\tstruct dpkg_mask\tmasks[DPKG_NUM_OF_MASKS];\n+};\n+\n+/**\n+ * struct dpkg_profile_cfg - A structure for defining a full Key Generation\n+ *\t\t\t\tprofile (rule)\n+ * @num_extracts: Defines the number of valid entries in the array below\n+ * @extracts: Array of required extractions\n+ */\n+struct dpkg_profile_cfg {\n+\tuint8_t num_extracts;\n+\tstruct dpkg_extract extracts[DPKG_MAX_NUM_OF_EXTRACTS];\n+};\n+\n+#endif /* __FSL_DPKG_H_ */\ndiff --git a/drivers/net/dpaa2/mc/fsl_dpni.h b/drivers/net/dpaa2/mc/fsl_dpni.h\nnew file mode 100644\nindex 0000000..ef14f85\n--- /dev/null\n+++ b/drivers/net/dpaa2/mc/fsl_dpni.h\n@@ -0,0 +1,1217 @@\n+/*-\n+ * This file is provided under a dual BSD/GPLv2 license. When using or\n+ * redistributing this file, you may do so under either license.\n+ *\n+ *   BSD LICENSE\n+ *\n+ * Copyright 2013-2016 Freescale Semiconductor Inc.\n+ * Copyright (c) 2016 NXP.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in the\n+ * documentation and/or other materials provided with the distribution.\n+ * * Neither the name of the above-listed copyright holders nor the\n+ * names of any contributors may be used to endorse or promote products\n+ * derived from this software without specific prior written permission.\n+ *\n+ *   GPL LICENSE SUMMARY\n+ *\n+ * ALTERNATIVELY, this software may be distributed under the terms of the\n+ * GNU General Public License (\"GPL\") as published by the Free Software\n+ * Foundation, either version 2 of that License or (at your option) any\n+ * later version.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ */\n+#ifndef __FSL_DPNI_H\n+#define __FSL_DPNI_H\n+\n+#include <fsl_dpkg.h>\n+\n+struct fsl_mc_io;\n+\n+/**\n+ * Data Path Network Interface API\n+ * Contains initialization APIs and runtime control APIs for DPNI\n+ */\n+\n+/** General DPNI macros */\n+\n+/**\n+ * Maximum number of traffic classes\n+ */\n+#define DPNI_MAX_TC\t\t\t\t8\n+/**\n+ * Maximum number of buffer pools per DPNI\n+ */\n+#define DPNI_MAX_DPBP\t\t\t\t8\n+/**\n+ * Maximum number of storage-profiles per DPNI\n+ */\n+#define DPNI_MAX_SP\t\t\t\t2\n+\n+/**\n+ * All traffic classes considered; see dpni_set_queue()\n+ */\n+#define DPNI_ALL_TCS\t\t\t\t(uint8_t)(-1)\n+/**\n+ * All flows within traffic class considered; see dpni_set_queue()\n+ */\n+#define DPNI_ALL_TC_FLOWS\t\t\t(uint16_t)(-1)\n+/**\n+ * Generate new flow ID; see dpni_set_queue()\n+ */\n+#define DPNI_NEW_FLOW_ID\t\t\t(uint16_t)(-1)\n+/**\n+ * Tx traffic is always released to a buffer pool on transmit, there are no\n+ * resources allocated to have the frames confirmed back to the source after\n+ * transmission.\n+ */\n+#define DPNI_OPT_TX_FRM_RELEASE\t\t\t0x000001\n+/**\n+ * Disables support for MAC address filtering for addresses other than primary\n+ * MAC address. This affects both unicast and multicast. Promiscuous mode can\n+ * still be enabled/disabled for both unicast and multicast. If promiscuous mode\n+ * is disabled, only traffic matching the primary MAC address will be accepted.\n+ */\n+#define DPNI_OPT_NO_MAC_FILTER\t\t\t0x000002\n+/**\n+ * Allocate policers for this DPNI. They can be used to rate-limit traffic per\n+ * traffic class (TC) basis.\n+ */\n+#define DPNI_OPT_HAS_POLICING\t\t\t0x000004\n+/**\n+ * Congestion can be managed in several ways, allowing the buffer pool to\n+ * deplete on ingress, taildrop on each queue or use congestion groups for sets\n+ * of queues. If set, it configures a single congestion groups across all TCs.\n+ * If reset, a congestion group is allocated for each TC. Only relevant if the\n+ * DPNI has multiple traffic classes.\n+ */\n+#define DPNI_OPT_SHARED_CONGESTION\t\t0x000008\n+/**\n+ * Enables TCAM for Flow Steering and QoS look-ups. If not specified, all\n+ * look-ups are exact match. Note that TCAM is not available on LS1088 and its\n+ * variants. Setting this bit on these SoCs will trigger an error.\n+ */\n+#define DPNI_OPT_HAS_KEY_MASKING\t\t0x000010\n+/**\n+ * Disables the flow steering table.\n+ */\n+#define DPNI_OPT_NO_FS\t\t\t\t0x000020\n+\n+/**\n+ * dpni_open() - Open a control session for the specified object\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @dpni_id:\tDPNI unique ID\n+ * @token:\tReturned token; use in subsequent API calls\n+ *\n+ * This function can be used to open a control session for an\n+ * already created object; an object may have been declared in\n+ * the DPL or by calling the dpni_create() function.\n+ * This function returns a unique authentication token,\n+ * associated with the specific object ID and the specific MC\n+ * portal; this token must be used in all subsequent commands for\n+ * this specific object.\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_open(struct fsl_mc_io\t*mc_io,\n+\t      uint32_t\t\tcmd_flags,\n+\t      int\t\tdpni_id,\n+\t      uint16_t\t\t*token);\n+\n+/**\n+ * dpni_close() - Close the control session of the object\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ *\n+ * After this function is called, no further operations are\n+ * allowed on the object without opening a new control session.\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_close(struct fsl_mc_io\t*mc_io,\n+\t       uint32_t\t\tcmd_flags,\n+\t       uint16_t\t\ttoken);\n+\n+/**\n+ * struct dpni_cfg - Structure representing DPNI configuration\n+ * @mac_addr: Primary MAC address\n+ * @adv: Advanced parameters; default is all zeros;\n+ *\t\tuse this structure to change default settings\n+ */\n+struct dpni_cfg {\n+\t/**\n+\t * @options: Any combination of the following options:\n+\t *\t\tDPNI_OPT_TX_FRM_RELEASE\n+\t *\t\tDPNI_OPT_NO_MAC_FILTER\n+\t *\t\tDPNI_OPT_HAS_POLICING\n+\t *\t\tDPNI_OPT_SHARED_CONGESTION\n+\t *\t\tDPNI_OPT_HAS_KEY_MASKING\n+\t *\t\tDPNI_OPT_NO_FS\n+\t * @fs_entries: Number of entries in the flow steering table.\n+\t *\t\tThis table is used to select the ingress queue for\n+\t *\t\tingress traffic, targeting a GPP core or another.\n+\t *\t\tIn addition it can be used to discard traffic that\n+\t *\t\tmatches the set rule. It is either an exact match table\n+\t *\t\tor a TCAM table, depending on DPNI_OPT_ HAS_KEY_MASKING\n+\t *\t\tbit in OPTIONS field. This field is ignored if\n+\t *\t\tDPNI_OPT_NO_FS bit is set in OPTIONS field. Otherwise,\n+\t *\t\tvalue 0 defaults to 64. Maximum supported value is 1024.\n+\t *\t\tNote that the total number of entries is limited on the\n+\t *\t\tSoC to as low as 512 entries if TCAM is used.\n+\t * @vlan_filter_entries: Number of entries in the VLAN address filtering\n+\t *\t\ttable. This is an exact match table used to filter\n+\t *\t\tingress traffic based on VLAN IDs. Value 0 disables VLAN\n+\t *\t\tfiltering. Maximum supported value is 16.\n+\t * @mac_filter_entries: Number of entries in the MAC address filtering\n+\t *\t\ttable. This is an exact match table and allows both\n+\t *\t\tunicast and multicast entries. The primary MAC address\n+\t *\t\tof the network interface is not part of this table,\n+\t *\t\tthis contains only entries in addition to it. This\n+\t *\t\tfield is ignored if DPNI_OPT_ NO_MAC_FILTER is set in\n+\t *\t\tOPTIONS field. Otherwise, value 0 defaults to 80.\n+\t *\t\tMaximum supported value is 80.\n+\t * @num_queues: Number of Tx and Rx queues used for traffic\n+\t *\t\tdistribution. This is orthogonal to QoS and is only\n+\t *\t\tused to distribute traffic to multiple GPP cores.\n+\t *\t\tThis configuration affects the number of Tx queues\n+\t *\t\t(logical FQs, all associated with a single CEETM queue),\n+\t *\t\tRx queues and Tx confirmation queues, if applicable.\n+\t *\t\tValue 0 defaults to one queue. Maximum supported value\n+\t *\t\tis 8.\n+\t * @num_tcs: Number of traffic classes (TCs), reserved for the DPNI.\n+\t *\t\tTCs can have different priority levels for the purpose\n+\t *\t\tof Tx scheduling (see DPNI_SET_TX_SELECTION), different\n+\t *\t\tBPs (DPNI_ SET_POOLS), policers. There are dedicated QM\n+\t *\t\tqueues for traffic classes (including class queues on\n+\t *\t\tTx). Value 0 defaults to one TC. Maximum supported value\n+\t *\t\tis 8.\n+\t * @qos_entries: Number of entries in the QoS classification table. This\n+\t *\t\ttable is used to select the TC for ingress traffic. It\n+\t *\t\tis either an exact match or a TCAM table, depending on\n+\t *\t\tDPNI_OPT_ HAS_KEY_MASKING bit in OPTIONS field. This\n+\t *\t\tfield is ignored if the DPNI has a single TC. Otherwise,\n+\t *\t\ta value of 0 defaults to 64. Maximum supported value\n+\t *\t\tis 64.\n+\t */\n+\tuint32_t options;\n+\tuint16_t fs_entries;\n+\tuint8_t  vlan_filter_entries;\n+\tuint8_t  mac_filter_entries;\n+\tuint8_t  num_queues;\n+\tuint8_t  num_tcs;\n+\tuint8_t  qos_entries;\n+};\n+\n+/**\n+ * dpni_create() - Create the DPNI object\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @dprc_token:\tParent container token; '0' for default container\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @cfg:\tConfiguration structure\n+ * @obj_id: returned object id\n+ *\n+ * Create the DPNI object, allocate required resources and\n+ * perform required initialization.\n+ *\n+ * The object can be created either by declaring it in the\n+ * DPL file, or by calling this function.\n+ *\n+ * The function accepts an authentication token of a parent\n+ * container that this object should be assigned to. The token\n+ * can be '0' so the object will be assigned to the default container.\n+ * The newly created object can be opened with the returned\n+ * object id and using the container's associated tokens and MC portals.\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_create(struct fsl_mc_io\t*mc_io,\n+\t\tuint16_t\t\tdprc_token,\n+\t\tuint32_t\t\tcmd_flags,\n+\t\tconst struct dpni_cfg\t*cfg,\n+\t\tuint32_t\t\t*obj_id);\n+\n+/**\n+ * dpni_destroy() - Destroy the DPNI object and release all its resources.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @dprc_token: Parent container token; '0' for default container\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @object_id:\tThe object id; it must be a valid id within the container that\n+ * created this object;\n+ *\n+ * The function accepts the authentication token of the parent container that\n+ * created the object (not the one that currently owns the object). The object\n+ * is searched within parent using the provided 'object_id'.\n+ * All tokens to the object must be closed before calling destroy.\n+ *\n+ * Return:\t'0' on Success; error code otherwise.\n+ */\n+int dpni_destroy(struct fsl_mc_io\t*mc_io,\n+\t\t uint16_t\t\tdprc_token,\n+\t\t uint32_t\t\tcmd_flags,\n+\t\t uint32_t\t\tobject_id);\n+\n+/**\n+ * struct dpni_pools_cfg - Structure representing buffer pools configuration\n+ * @num_dpbp: Number of DPBPs\n+ * @pools: Array of buffer pools parameters; The number of valid entries\n+ *\tmust match 'num_dpbp' value\n+ */\n+struct dpni_pools_cfg {\n+\tuint8_t\t\tnum_dpbp;\n+\t/**\n+\t * struct pools - Buffer pools parameters\n+\t * @dpbp_id: DPBP object ID\n+\t * @buffer_size: Buffer size\n+\t * @backup_pool: Backup pool\n+\t */\n+\tstruct {\n+\t\tint\t\tdpbp_id;\n+\t\tuint16_t\tbuffer_size;\n+\t\tint\t\tbackup_pool;\n+\t} pools[DPNI_MAX_DPBP];\n+};\n+\n+/**\n+ * dpni_set_pools() - Set buffer pools configuration\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @cfg:\tBuffer pools configuration\n+ *\n+ * mandatory for DPNI operation\n+ * warning:Allowed only when DPNI is disabled\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_set_pools(struct fsl_mc_io\t\t*mc_io,\n+\t\t   uint32_t\t\t\tcmd_flags,\n+\t\t   uint16_t\t\t\ttoken,\n+\t\t   const struct dpni_pools_cfg\t*cfg);\n+\n+/**\n+ * dpni_enable() - Enable the DPNI, allow sending and receiving frames.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\t\tToken of DPNI object\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_enable(struct fsl_mc_io\t*mc_io,\n+\t\tuint32_t\t\tcmd_flags,\n+\t\tuint16_t\t\ttoken);\n+\n+/**\n+ * dpni_disable() - Disable the DPNI, stop sending and receiving frames.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_disable(struct fsl_mc_io\t*mc_io,\n+\t\t uint32_t\t\tcmd_flags,\n+\t\t uint16_t\t\ttoken);\n+\n+/**\n+ * dpni_is_enabled() - Check if the DPNI is enabled.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @en:\t\tReturns '1' if object is enabled; '0' otherwise\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_is_enabled(struct fsl_mc_io\t*mc_io,\n+\t\t    uint32_t\t\tcmd_flags,\n+\t\t    uint16_t\t\ttoken,\n+\t\t    int\t\t\t*en);\n+\n+/**\n+ * dpni_reset() - Reset the DPNI, returns the object to initial state.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_reset(struct fsl_mc_io\t*mc_io,\n+\t       uint32_t\t\tcmd_flags,\n+\t       uint16_t\t\ttoken);\n+\n+/**\n+ * struct dpni_attr - Structure representing DPNI attributes\n+ * @options: Any combination of the following options:\n+ *\t\tDPNI_OPT_TX_FRM_RELEASE\n+ *\t\tDPNI_OPT_NO_MAC_FILTER\n+ *\t\tDPNI_OPT_HAS_POLICING\n+ *\t\tDPNI_OPT_SHARED_CONGESTION\n+ *\t\tDPNI_OPT_HAS_KEY_MASKING\n+ *\t\tDPNI_OPT_NO_FS\n+ * @num_queues: Number of Tx and Rx queues used for traffic distribution.\n+ * @num_tcs: Number of traffic classes (TCs), reserved for the DPNI.\n+ * @mac_filter_entries: Number of entries in the MAC address filtering\n+ *\t\ttable.\n+ * @vlan_filter_entries: Number of entries in the VLAN address filtering\n+ *\t\ttable.\n+ * @qos_entries: Number of entries in the QoS classification table.\n+ * @fs_entries: Number of entries in the flow steering table.\n+ * @qos_key_size: Size, in bytes, of the QoS look-up key. Defining a key larger\n+ *\t\t\tthan this when adding QoS entries will result\n+ *\t\t\tin an error.\n+ * @fs_key_size: Size, in bytes, of the flow steering look-up key. Defining a\n+ *\t\t\tkey larger than this when composing the hash + FS key\n+ *\t\t\twill result in an error.\n+ * @wriop_version: Version of WRIOP HW block.\n+ *\t\t\tThe 3 version values are stored on 6, 5, 5 bits\n+ *\t\t\trespectively.\n+ *\t\t\tValues returned:\n+ *\t\t\t- 0x400 - WRIOP version 1.0.0, used on LS2080 and\n+ *\t\t\tvariants,\n+ *\t\t\t- 0x421 - WRIOP version 1.1.1, used on LS2088 and\n+ *\t\t\tvariants,\n+ *\t\t\t- 0x422 - WRIOP version 1.1.2, used on LS1088 and\n+ *\t\t\tvariants.\n+ */\n+struct dpni_attr {\n+\tuint32_t options;\n+\tuint8_t  num_queues;\n+\tuint8_t  num_tcs;\n+\tuint8_t  mac_filter_entries;\n+\tuint8_t  vlan_filter_entries;\n+\tuint8_t  qos_entries;\n+\tuint16_t fs_entries;\n+\tuint8_t  qos_key_size;\n+\tuint8_t  fs_key_size;\n+\tuint16_t wriop_version;\n+};\n+\n+/**\n+ * dpni_get_attributes() - Retrieve DPNI attributes.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @attr:\tObject's attributes\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_get_attributes(struct fsl_mc_io\t*mc_io,\n+\t\t\tuint32_t\t\tcmd_flags,\n+\t\t\tuint16_t\t\ttoken,\n+\t\t\tstruct dpni_attr\t*attr);\n+\n+/**\n+ * DPNI errors\n+ */\n+\n+/**\n+ * Extract out of frame header error\n+ */\n+#define DPNI_ERROR_EOFHE\t0x00020000\n+/**\n+ * Frame length error\n+ */\n+#define DPNI_ERROR_FLE\t\t0x00002000\n+/**\n+ * Frame physical error\n+ */\n+#define DPNI_ERROR_FPE\t\t0x00001000\n+/**\n+ * Parsing header error\n+ */\n+#define DPNI_ERROR_PHE\t\t0x00000020\n+/**\n+ * Parser L3 checksum error\n+ */\n+#define DPNI_ERROR_L3CE\t\t0x00000004\n+/**\n+ * Parser L3 checksum error\n+ */\n+#define DPNI_ERROR_L4CE\t\t0x00000001\n+\n+/**\n+ * enum dpni_error_action - Defines DPNI behavior for errors\n+ * @DPNI_ERROR_ACTION_DISCARD: Discard the frame\n+ * @DPNI_ERROR_ACTION_CONTINUE: Continue with the normal flow\n+ * @DPNI_ERROR_ACTION_SEND_TO_ERROR_QUEUE: Send the frame to the error queue\n+ */\n+enum dpni_error_action {\n+\tDPNI_ERROR_ACTION_DISCARD = 0,\n+\tDPNI_ERROR_ACTION_CONTINUE = 1,\n+\tDPNI_ERROR_ACTION_SEND_TO_ERROR_QUEUE = 2\n+};\n+\n+/**\n+ * struct dpni_error_cfg - Structure representing DPNI errors treatment\n+ * @errors: Errors mask; use 'DPNI_ERROR__<X>\n+ * @error_action: The desired action for the errors mask\n+ * @set_frame_annotation: Set to '1' to mark the errors in frame annotation\n+ *\t\tstatus (FAS); relevant only for the non-discard action\n+ */\n+struct dpni_error_cfg {\n+\tuint32_t\t\terrors;\n+\tenum dpni_error_action\terror_action;\n+\tint\t\t\tset_frame_annotation;\n+};\n+\n+/**\n+ * dpni_set_errors_behavior() - Set errors behavior\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @cfg:\tErrors configuration\n+ *\n+ * this function may be called numerous times with different\n+ * error masks\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_set_errors_behavior(struct fsl_mc_io\t\t*mc_io,\n+\t\t\t     uint32_t\t\t\tcmd_flags,\n+\t\t\t     uint16_t\t\t\ttoken,\n+\t\t\t     struct dpni_error_cfg\t*cfg);\n+\n+/**\n+ * DPNI buffer layout modification options\n+ */\n+\n+/**\n+ * Select to modify the time-stamp setting\n+ */\n+#define DPNI_BUF_LAYOUT_OPT_TIMESTAMP\t\t0x00000001\n+/**\n+ * Select to modify the parser-result setting; not applicable for Tx\n+ */\n+#define DPNI_BUF_LAYOUT_OPT_PARSER_RESULT\t0x00000002\n+/**\n+ * Select to modify the frame-status setting\n+ */\n+#define DPNI_BUF_LAYOUT_OPT_FRAME_STATUS\t0x00000004\n+/**\n+ * Select to modify the private-data-size setting\n+ */\n+#define DPNI_BUF_LAYOUT_OPT_PRIVATE_DATA_SIZE\t0x00000008\n+/**\n+ * Select to modify the data-alignment setting\n+ */\n+#define DPNI_BUF_LAYOUT_OPT_DATA_ALIGN\t\t0x00000010\n+/**\n+ * Select to modify the data-head-room setting\n+ */\n+#define DPNI_BUF_LAYOUT_OPT_DATA_HEAD_ROOM\t0x00000020\n+/**\n+ * Select to modify the data-tail-room setting\n+ */\n+#define DPNI_BUF_LAYOUT_OPT_DATA_TAIL_ROOM\t0x00000040\n+\n+/**\n+ * struct dpni_buffer_layout - Structure representing DPNI buffer layout\n+ * @options: Flags representing the suggested modifications to the buffer\n+ *\t\tlayout; Use any combination of 'DPNI_BUF_LAYOUT_OPT_<X>' flags\n+ * @pass_timestamp: Pass timestamp value\n+ * @pass_parser_result: Pass parser results\n+ * @pass_frame_status: Pass frame status\n+ * @private_data_size: Size kept for private data (in bytes)\n+ * @data_align: Data alignment\n+ * @data_head_room: Data head room\n+ * @data_tail_room: Data tail room\n+ */\n+struct dpni_buffer_layout {\n+\tuint32_t\toptions;\n+\tint\t\tpass_timestamp;\n+\tint\t\tpass_parser_result;\n+\tint\t\tpass_frame_status;\n+\tuint16_t\tprivate_data_size;\n+\tuint16_t\tdata_align;\n+\tuint16_t\tdata_head_room;\n+\tuint16_t\tdata_tail_room;\n+};\n+\n+/**\n+ * enum dpni_queue_type - Identifies a type of queue targeted by the command\n+ * @DPNI_QUEUE_RX: Rx queue\n+ * @DPNI_QUEUE_TX: Tx queue\n+ * @DPNI_QUEUE_TX_CONFIRM: Tx confirmation queue\n+ * @DPNI_QUEUE_RX_ERR: Rx error queue\n+ */enum dpni_queue_type {\n+\tDPNI_QUEUE_RX,\n+\tDPNI_QUEUE_TX,\n+\tDPNI_QUEUE_TX_CONFIRM,\n+\tDPNI_QUEUE_RX_ERR,\n+};\n+\n+/**\n+ * dpni_get_buffer_layout() - Retrieve buffer layout attributes.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @qtype:\tType of queue to get the layout from\n+ * @layout:\tReturns buffer layout attributes\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_get_buffer_layout(struct fsl_mc_io\t\t*mc_io,\n+\t\t\t   uint32_t\t\t\tcmd_flags,\n+\t\t\t   uint16_t\t\t\ttoken,\n+\t\t\t   enum dpni_queue_type\t\tqtype,\n+\t\t\t   struct dpni_buffer_layout\t*layout);\n+\n+/**\n+ * dpni_set_buffer_layout() - Set buffer layout configuration.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @qtype:\tType of queue to set layout on\n+ * @layout:\tBuffer layout configuration\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ *\n+ * @warning\tAllowed only when DPNI is disabled\n+ */\n+int dpni_set_buffer_layout(struct fsl_mc_io\t\t   *mc_io,\n+\t\t\t   uint32_t\t\t\t   cmd_flags,\n+\t\t\t   uint16_t\t\t\t   token,\n+\t\t\t   enum dpni_queue_type\t\t   qtype,\n+\t\t\t   const struct dpni_buffer_layout *layout);\n+\n+/**\n+ * enum dpni_offload - Identifies a type of offload targeted by the command\n+ * @DPNI_OFF_RX_L3_CSUM: Rx L3 checksum validation\n+ * @DPNI_OFF_RX_L4_CSUM: Rx L4 checksum validation\n+ * @DPNI_OFF_TX_L3_CSUM: Tx L3 checksum generation\n+ * @DPNI_OFF_TX_L4_CSUM: Tx L4 checksum generation\n+ */\n+enum dpni_offload {\n+\tDPNI_OFF_RX_L3_CSUM,\n+\tDPNI_OFF_RX_L4_CSUM,\n+\tDPNI_OFF_TX_L3_CSUM,\n+\tDPNI_OFF_TX_L4_CSUM,\n+};\n+\n+/**\n+ * dpni_set_offload() - Set DPNI offload configuration.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @type:\tType of DPNI offload\n+ * @config:\tOffload configuration.\n+ *\t\t\tFor checksum offloads, non-zero value enables\n+ *\t\t\tthe offload.\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ *\n+ * @warning\tAllowed only when DPNI is disabled\n+ */\n+int dpni_set_offload(struct fsl_mc_io *mc_io,\n+\t\t     uint32_t cmd_flags,\n+\t\t     uint16_t token,\n+\t\t     enum dpni_offload type,\n+\t\t     uint32_t config);\n+\n+/**\n+ * dpni_get_offload() - Get DPNI offload configuration.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @type:\tType of DPNI offload\n+ * @config:\tOffload configuration.\n+ *\t\t\tFor checksum offloads, a value of 1 indicates that the\n+ *\t\t\toffload is enabled.\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ *\n+ * @warning\tAllowed only when DPNI is disabled\n+ */\n+int dpni_get_offload(struct fsl_mc_io *mc_io,\n+\t\t     uint32_t cmd_flags,\n+\t\t     uint16_t token,\n+\t\t     enum dpni_offload type,\n+\t\t     uint32_t *config);\n+\n+/**\n+ * dpni_get_qdid() - Get the Queuing Destination ID (QDID) that should be used\n+ *\t\t\tfor enqueue operations\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @qtype:\tType of queue to get QDID for.  For applications lookig to\n+ *\t\ttransmit traffic this should be set to DPNI_QUEUE_TX\n+ * @qdid:\tReturned virtual QDID value that should be used as an argument\n+ *\t\t\tin all enqueue operations\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_get_qdid(struct fsl_mc_io\t*mc_io,\n+\t\t  uint32_t\t\tcmd_flags,\n+\t\t  uint16_t\t\ttoken,\n+\t\t  enum dpni_queue_type\tqtype,\n+\t\t  uint16_t\t\t*qdid);\n+\n+#define DPNI_STATISTICS_CNT\t\t7\n+\n+union dpni_statistics {\n+\t/**\n+\t * struct page_0 - Page_0 statistics structure\n+\t * @ingress_all_frames: Ingress frame count\n+\t * @ingress_all_bytes: Ingress byte count\n+\t * @ingress_multicast_frames: Ingress multicast frame count\n+\t * @ingress_multicast_bytes: Ingress multicast byte count\n+\t * @ingress_broadcast_frames: Ingress broadcast frame count\n+\t * @ingress_broadcast_bytes: Ingress broadcast byte count\n+\t */\n+\tstruct {\n+\t\tuint64_t ingress_all_frames;\n+\t\tuint64_t ingress_all_bytes;\n+\t\tuint64_t ingress_multicast_frames;\n+\t\tuint64_t ingress_multicast_bytes;\n+\t\tuint64_t ingress_broadcast_frames;\n+\t\tuint64_t ingress_broadcast_bytes;\n+\t} page_0;\n+\t/**\n+\t * struct page_1 - Page_1 statistics structure\n+\t * @egress_all_frames: Egress frame count\n+\t * @egress_all_bytes: Egress byte count\n+\t * @egress_multicast_frames: Egress multicast frame count\n+\t * @egress_multicast_bytes: Egress multicast byte count\n+\t * @egress_broadcast_frames: Egress broadcast frame count\n+\t * @egress_broadcast_bytes: Egress broadcast byte count\n+\t */\n+\tstruct {\n+\t\tuint64_t egress_all_frames;\n+\t\tuint64_t egress_all_bytes;\n+\t\tuint64_t egress_multicast_frames;\n+\t\tuint64_t egress_multicast_bytes;\n+\t\tuint64_t egress_broadcast_frames;\n+\t\tuint64_t egress_broadcast_bytes;\n+\t} page_1;\n+\t/**\n+\t * struct page_2 - Page_2 statistics structure\n+\t * @ingress_filtered_frames: Ingress filtered frame count\n+\t * @ingress_discarded_frames: Ingress discarded frame count\n+\t * @ingress_nobuffer_discards: Ingress discarded frame count due to\n+\t *\t\t\t\t\tlack of buffers\n+\t * @egress_discarded_frames: Egress discarded frame count\n+\t * @egress_confirmed_frames: Egress confirmed frame count\n+\t */\n+\tstruct {\n+\t\tuint64_t ingress_filtered_frames;\n+\t\tuint64_t ingress_discarded_frames;\n+\t\tuint64_t ingress_nobuffer_discards;\n+\t\tuint64_t egress_discarded_frames;\n+\t\tuint64_t egress_confirmed_frames;\n+\t} page_2;\n+\t/**\n+\t * struct raw - raw statistics structure, used to index counters\n+\t */\n+\tstruct {\n+\t\tuint64_t counter[DPNI_STATISTICS_CNT];\n+\t} raw;\n+};\n+\n+/**\n+ * Enable auto-negotiation\n+ */\n+#define DPNI_LINK_OPT_AUTONEG\t\t0x0000000000000001ULL\n+/**\n+ * Enable half-duplex mode\n+ */\n+#define DPNI_LINK_OPT_HALF_DUPLEX\t0x0000000000000002ULL\n+/**\n+ * Enable pause frames\n+ */\n+#define DPNI_LINK_OPT_PAUSE\t\t0x0000000000000004ULL\n+/**\n+ * Enable a-symmetric pause frames\n+ */\n+#define DPNI_LINK_OPT_ASYM_PAUSE\t0x0000000000000008ULL\n+\n+/**\n+ * struct dpni_link_state - Structure representing DPNI link state\n+ * @rate: Rate\n+ * @options: Mask of available options; use 'DPNI_LINK_OPT_<X>' values\n+ * @up: Link state; '0' for down, '1' for up\n+ */\n+struct dpni_link_state {\n+\tuint32_t\trate;\n+\tuint64_t\toptions;\n+\tint\t\tup;\n+};\n+\n+/**\n+ * dpni_get_link_state() - Return the link state (either up or down)\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @state:\tReturned link state;\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_get_link_state(struct fsl_mc_io\t*mc_io,\n+\t\t\tuint32_t\t\tcmd_flags,\n+\t\t\tuint16_t\t\ttoken,\n+\t\t\tstruct dpni_link_state\t*state);\n+\n+/**\n+ * dpni_set_max_frame_length() - Set the maximum received frame length.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @max_frame_length:\tMaximum received frame length (in\n+ *\t\t\t\tbytes); frame is discarded if its\n+ *\t\t\t\tlength exceeds this value\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_set_max_frame_length(struct fsl_mc_io\t*mc_io,\n+\t\t\t      uint32_t\t\tcmd_flags,\n+\t\t\t      uint16_t\t\ttoken,\n+\t\t\t      uint16_t\t\tmax_frame_length);\n+\n+/**\n+ * dpni_get_max_frame_length() - Get the maximum received frame length.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @max_frame_length:\tMaximum received frame length (in\n+ *\t\t\t\tbytes); frame is discarded if its\n+ *\t\t\t\tlength exceeds this value\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_get_max_frame_length(struct fsl_mc_io\t*mc_io,\n+\t\t\t      uint32_t\t\tcmd_flags,\n+\t\t\t      uint16_t\t\ttoken,\n+\t\t\t      uint16_t\t\t*max_frame_length);\n+\n+\n+/**\n+ * dpni_set_unicast_promisc() - Enable/disable unicast promiscuous mode\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @en:\t\tSet to '1' to enable; '0' to disable\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_set_unicast_promisc(struct fsl_mc_io\t*mc_io,\n+\t\t\t     uint32_t\t\tcmd_flags,\n+\t\t\t     uint16_t\t\ttoken,\n+\t\t\t     int\t\ten);\n+\n+/**\n+ * dpni_get_unicast_promisc() - Get unicast promiscuous mode\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @en:\t\tReturns '1' if enabled; '0' otherwise\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_get_unicast_promisc(struct fsl_mc_io\t*mc_io,\n+\t\t\t     uint32_t\t\tcmd_flags,\n+\t\t\t     uint16_t\t\ttoken,\n+\t\t\t     int\t\t*en);\n+\n+/**\n+ * dpni_set_primary_mac_addr() - Set the primary MAC address\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @mac_addr:\tMAC address to set as primary address\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_set_primary_mac_addr(struct fsl_mc_io\t*mc_io,\n+\t\t\t      uint32_t\t\tcmd_flags,\n+\t\t\t      uint16_t\t\ttoken,\n+\t\t\t      const uint8_t\tmac_addr[6]);\n+\n+/**\n+ * dpni_get_primary_mac_addr() - Get the primary MAC address\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @mac_addr:\tReturned MAC address\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_get_primary_mac_addr(struct fsl_mc_io\t*mc_io,\n+\t\t\t      uint32_t\t\tcmd_flags,\n+\t\t\t      uint16_t\t\ttoken,\n+\t\t\t      uint8_t\t\tmac_addr[6]);\n+\n+\n+/**\n+ * dpni_get_port_mac_addr() - Retrieve MAC address associated to the physical\n+ *\t\tport the DPNI is attached to\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @mac_addr:\tMAC address of the physical port, if any, otherwise 0\n+ *\n+ * The primary MAC address is not modified by this operation.\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_get_port_mac_addr(struct fsl_mc_io\t*mc_io,\n+\t\t\t   uint32_t\t\tcmd_flags,\n+\t\t\t   uint16_t\t\ttoken,\n+\t\t\t   uint8_t\t\tmac_addr[6]);\n+\n+/**\n+ * enum dpni_dist_mode - DPNI distribution mode\n+ * @DPNI_DIST_MODE_NONE: No distribution\n+ * @DPNI_DIST_MODE_HASH: Use hash distribution; only relevant if\n+ *\t\tthe 'DPNI_OPT_DIST_HASH' option was set at DPNI creation\n+ * @DPNI_DIST_MODE_FS:  Use explicit flow steering; only relevant if\n+ *\t the 'DPNI_OPT_DIST_FS' option was set at DPNI creation\n+ */\n+enum dpni_dist_mode {\n+\tDPNI_DIST_MODE_NONE = 0,\n+\tDPNI_DIST_MODE_HASH = 1,\n+\tDPNI_DIST_MODE_FS = 2\n+};\n+\n+/**\n+ * enum dpni_fs_miss_action -   DPNI Flow Steering miss action\n+ * @DPNI_FS_MISS_DROP: In case of no-match, drop the frame\n+ * @DPNI_FS_MISS_EXPLICIT_FLOWID: In case of no-match, use explicit flow-id\n+ * @DPNI_FS_MISS_HASH: In case of no-match, distribute using hash\n+ */\n+enum dpni_fs_miss_action {\n+\tDPNI_FS_MISS_DROP = 0,\n+\tDPNI_FS_MISS_EXPLICIT_FLOWID = 1,\n+\tDPNI_FS_MISS_HASH = 2\n+};\n+\n+/**\n+ * struct dpni_fs_tbl_cfg - Flow Steering table configuration\n+ * @miss_action: Miss action selection\n+ * @default_flow_id: Used when 'miss_action = DPNI_FS_MISS_EXPLICIT_FLOWID'\n+ */\n+struct dpni_fs_tbl_cfg {\n+\tenum dpni_fs_miss_action\tmiss_action;\n+\tuint16_t\t\t\tdefault_flow_id;\n+};\n+\n+/**\n+ * dpni_prepare_key_cfg() - function prepare extract parameters\n+ * @cfg: defining a full Key Generation profile (rule)\n+ * @key_cfg_buf: Zeroed 256 bytes of memory before mapping it to DMA\n+ *\n+ * This function has to be called before the following functions:\n+ *\t- dpni_set_rx_tc_dist()\n+ *\t- dpni_set_qos_table()\n+ */\n+int dpni_prepare_key_cfg(const struct dpkg_profile_cfg\t*cfg,\n+\t\t\t uint8_t\t\t\t*key_cfg_buf);\n+\n+/**\n+ * struct dpni_rx_tc_dist_cfg - Rx traffic class distribution configuration\n+ * @dist_size: Set the distribution size;\n+ *\tsupported values: 1,2,3,4,6,7,8,12,14,16,24,28,32,48,56,64,96,\n+ *\t112,128,192,224,256,384,448,512,768,896,1024\n+ * @dist_mode: Distribution mode\n+ * @key_cfg_iova: I/O virtual address of 256 bytes DMA-able memory filled with\n+ *\t\tthe extractions to be used for the distribution key by calling\n+ *\t\tdpni_prepare_key_cfg() relevant only when\n+ *\t\t'dist_mode != DPNI_DIST_MODE_NONE', otherwise it can be '0'\n+ * @fs_cfg: Flow Steering table configuration; only relevant if\n+ *\t\t'dist_mode = DPNI_DIST_MODE_FS'\n+ */\n+struct dpni_rx_tc_dist_cfg {\n+\tuint16_t\t\tdist_size;\n+\tenum dpni_dist_mode\tdist_mode;\n+\tuint64_t\t\tkey_cfg_iova;\n+\tstruct dpni_fs_tbl_cfg\tfs_cfg;\n+};\n+\n+/**\n+ * dpni_set_rx_tc_dist() - Set Rx traffic class distribution configuration\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @tc_id:\tTraffic class selection (0-7)\n+ * @cfg:\tTraffic class distribution configuration\n+ *\n+ * warning: if 'dist_mode != DPNI_DIST_MODE_NONE', call dpni_prepare_key_cfg()\n+ *\t\t\tfirst to prepare the key_cfg_iova parameter\n+ *\n+ * Return:\t'0' on Success; error code otherwise.\n+ */\n+int dpni_set_rx_tc_dist(struct fsl_mc_io\t\t\t*mc_io,\n+\t\t\tuint32_t\t\t\t\tcmd_flags,\n+\t\t\tuint16_t\t\t\t\ttoken,\n+\t\t\tuint8_t\t\t\t\t\ttc_id,\n+\t\t\tconst struct dpni_rx_tc_dist_cfg\t*cfg);\n+\n+/**\n+ * enum dpni_dest - DPNI destination types\n+ * @DPNI_DEST_NONE: Unassigned destination; The queue is set in parked mode and\n+ *\t\tdoes not generate FQDAN notifications; user is expected to\n+ *\t\tdequeue from the queue based on polling or other user-defined\n+ *\t\tmethod\n+ * @DPNI_DEST_DPIO: The queue is set in schedule mode and generates FQDAN\n+ *\t\tnotifications to the specified DPIO; user is expected to dequeue\n+ *\t\tfrom the queue only after notification is received\n+ * @DPNI_DEST_DPCON: The queue is set in schedule mode and does not generate\n+ *\t\tFQDAN notifications, but is connected to the specified DPCON\n+ *\t\tobject; user is expected to dequeue from the DPCON channel\n+ */\n+enum dpni_dest {\n+\tDPNI_DEST_NONE = 0,\n+\tDPNI_DEST_DPIO = 1,\n+\tDPNI_DEST_DPCON = 2\n+};\n+\n+\n+/**\n+ * struct dpni_queue - Queue structure\n+ * @user_context:\tUser data, presented to the user along with any frames\n+ *\t\t\tfrom this queue. Not relevant for Tx queues.\n+ */\n+struct dpni_queue {\n+\t/**\n+\t * struct destination - Destination structure\n+\t * @id:\tID of the destination, only relevant if DEST_TYPE is > 0.\n+\t *\t\t\tIdentifies either a DPIO or a DPCON object.\n+\t *\t\t\tNot relevant for Tx queues.\n+\t * @type:\tMay be one of the following:\n+\t *\t\t\t0 - No destination, queue can be manually\n+\t *\t\t\t\tqueried, but will not push traffic or\n+\t *\t\t\t\tnotifications to a DPIO;\n+\t *\t\t\t1 - The destination is a DPIO. When traffic\n+\t *\t\t\t\tbecomes available in the queue a FQDAN\n+\t *\t\t\t\t(FQ data available notification) will be\n+\t *\t\t\t\tgenerated to selected DPIO;\n+\t *\t\t\t2 - The destination is a DPCON. The queue is\n+\t *\t\t\t\tassociated with a DPCON object for the\n+\t *\t\t\t\tpurpose of scheduling between multiple\n+\t *\t\t\t\tqueues. The DPCON may be independently\n+\t *\t\t\t\tconfigured to generate notifications.\n+\t *\t\t\t\tNot relevant for Tx queues.\n+\t * @hold_active: Hold active, maintains a queue scheduled for longer\n+\t *\t\tin a DPIO during dequeue to reduce spread of traffic.\n+\t *\t\tOnly relevant if queues are\n+\t *\t\tnot affined to a single DPIO.\n+\t */\n+\tstruct {\n+\t\tuint16_t id;\n+\t\tenum dpni_dest type;\n+\t\tchar hold_active;\n+\t\tuint8_t priority;\n+\t} destination;\n+\tuint64_t user_context;\n+\t/**\n+\t * struct flc - FD FLow Context structure\n+\t * @value:\t\tFLC value to set\n+\t * @stash_control:\tBoolean, indicates whether the 6 lowest\n+\t *\t\t\tsignificant bits are used for stash control.\n+\t */\n+\tstruct {\n+\t\tuint64_t value;\n+\t\tchar stash_control;\n+\t} flc;\n+};\n+\n+/**\n+ * struct dpni_queue_id - Queue identification, used for enqueue commands\n+ *\t\t\t\tor queue control\n+ * @fqid:\tFQID used for enqueueing to and/or configuration of this\n+ *\t\t\tspecific FQ\n+ * @qdbin:\tQueueing bin, used to enqueue using QDID, DQBIN, QPRI.\n+ *\t\t\tOnly relevant for Tx queues.\n+ */\n+struct dpni_queue_id {\n+\tuint32_t fqid;\n+\tuint16_t qdbin;\n+};\n+\n+/**\n+ * enum dpni_confirmation_mode - Defines DPNI options supported for Tx\n+ * confirmation\n+ * @DPNI_CONF_AFFINE: For each Tx queue set associated with a sender there is\n+ * an affine Tx Confirmation queue\n+ * @DPNI_CONF_SINGLE: All Tx queues are associated with a single Tx\n+ * confirmation queue\n+ * @DPNI_CONF_DISABLE: Tx frames are not confirmed.  This must be associated\n+ * with proper FD set-up to have buffers release to a Buffer Pool, otherwise\n+ * buffers will be leaked\n+ */\n+enum dpni_confirmation_mode {\n+\tDPNI_CONF_AFFINE,\n+\tDPNI_CONF_SINGLE,\n+\tDPNI_CONF_DISABLE,\n+};\n+\n+/**\n+ * dpni_set_tx_confirmation_mode() - Tx confirmation mode\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @mode:\tTx confirmation mode\n+ *\n+ * This function is useful only when 'DPNI_OPT_TX_CONF_DISABLED' is not\n+ * selected at DPNI creation.\n+ * Calling this function with 'mode' set to DPNI_CONF_DISABLE disables all\n+ * transmit confirmation (including the private confirmation queues), regardless\n+ * of previous settings; Note that in this case, Tx error frames are still\n+ * enqueued to the general transmit errors queue.\n+ * Calling this function with 'mode' set to DPNI_CONF_SINGLE switches all\n+ * Tx confirmations to a shared Tx conf queue.  The ID of the queue when\n+ * calling dpni_set/get_queue is -1.\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_set_tx_confirmation_mode(struct fsl_mc_io\t\t*mc_io,\n+\t\t\t\t  uint32_t\t\t\tcmd_flags,\n+\t\t\t\t  uint16_t\t\t\ttoken,\n+\t\t\t\t  enum dpni_confirmation_mode\tmode);\n+\n+/**\n+ * dpni_get_api_version() - Get Data Path Network Interface API version\n+ * @mc_io:  Pointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @major_ver:\tMajor version of data path network interface API\n+ * @minor_ver:\tMinor version of data path network interface API\n+ *\n+ * Return:  '0' on Success; Error code otherwise.\n+ */\n+int dpni_get_api_version(struct fsl_mc_io *mc_io,\n+\t\t\t uint32_t cmd_flags,\n+\t\t\t uint16_t *major_ver,\n+\t\t\t uint16_t *minor_ver);\n+\n+/**\n+ * Set User Context\n+ */\n+#define DPNI_QUEUE_OPT_USER_CTX\t\t0x00000001\n+\n+/**\n+ * Set queue destination configuration\n+ */\n+#define DPNI_QUEUE_OPT_DEST\t\t0x00000002\n+\n+/**\n+ * Set FD[FLC] configuration for traffic on this queue.  Note that FLC values\n+ * set with dpni_add_fs_entry, if any, take precedence over values per queue.\n+ */\n+#define DPNI_QUEUE_OPT_FLC\t\t0x00000004\n+\n+/**\n+ * Set the queue to hold active mode.  This prevents the queue from being\n+ * rescheduled between DPIOs while it carries traffic and is active on one\n+ * DPNI.  Can help reduce reordering when servicing one queue on multiple\n+ * CPUs, but the queue is also less likely to push data to multiple CPUs\n+ * especially when congested.\n+ */\n+#define DPNI_QUEUE_OPT_HOLD_ACTIVE\t0x00000008\n+\n+/**\n+ * dpni_set_queue() - Set queue parameters\n+ * @mc_io:\t\tPointer to MC portal's I/O object\n+ * @cmd_flags:\t\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\t\tToken of DPNI object\n+ * @qtype:\t\tType of queue - all queue types are supported, although\n+ *\t\t\t\tthe command is ignored for Tx\n+ * @tc:\t\t\tTraffic class, in range 0 to NUM_TCS - 1\n+ * @index:\t\tSelects the specific queue out of the set\n+ *\t\t\t\tallocated for the same TC.Value must be in\n+ *\t\t\t\trange 0 to NUM_QUEUES - 1\n+ * @options:\t\tA combination of DPNI_QUEUE_OPT_ values that control\n+ *\t\t\t\twhat configuration options are set on the queue\n+ * @queue:\t\tQueue configuration structure\n+ *\n+ * Return:  '0' on Success; Error code otherwise.\n+ */\n+int dpni_set_queue(struct fsl_mc_io *mc_io,\n+\t\t   uint32_t cmd_flags,\n+\t\t   uint16_t token,\n+\t\t   enum dpni_queue_type qtype,\n+\t\t   uint8_t tc,\n+\t\t   uint8_t index,\n+\t\t   uint8_t options,\n+\t\t   const struct dpni_queue *queue);\n+\n+/**\n+ * dpni_get_queue() - Get queue parameters\n+ * @mc_io:\t\tPointer to MC portal's I/O object\n+ * @cmd_flags:\t\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\t\tToken of DPNI object\n+ * @qtype:\t\tType of queue - all queue types are supported\n+ * @tc:\t\t\tTraffic class, in range 0 to NUM_TCS - 1\n+ * @index:\t\tSelects the specific queue out of the set allocated\n+ *\t\t\t\tfor the same TC. Value must be in range 0 to\n+ *\t\t\t\tNUM_QUEUES - 1\n+ * @queue:\t\tQueue configuration structure\n+ * @qid:\t\tQueue identification\n+ *\n+ * This function returns current queue configuration which can be changed by\n+ * calling dpni_set_queue, and queue identification information.\n+ * Returned qid.fqid and/or qid.qdbin values can be used to:\n+ * - enqueue traffic for Tx queues,\n+ * - perform volatile dequeue for Rx and, if applicable, Tx confirmation\n+ *   clean-up,\n+ * - retrieve queue state.\n+ *\n+ * All these operations are supported through the DPIO run-time API.\n+ *\n+ * Return:  '0' on Success; Error code otherwise.\n+ */\n+int dpni_get_queue(struct fsl_mc_io *mc_io,\n+\t\t   uint32_t cmd_flags,\n+\t\t   uint16_t token,\n+\t\t   enum dpni_queue_type qtype,\n+\t\t   uint8_t tc,\n+\t\t   uint8_t index,\n+\t\t   struct dpni_queue *queue,\n+\t\t   struct dpni_queue_id *qid);\n+\n+/**\n+ * dpni_get_statistics() - Get DPNI statistics\n+ * @mc_io:\t\tPointer to MC portal's I/O object\n+ * @cmd_flags:\t\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\t\tToken of DPNI object\n+ * @page:\t\tSelects the statistics page to retrieve, see\n+ *\t\t\t\tDPNI_GET_STATISTICS output.\n+ *\t\t\t\tPages are numbered 0 to 2.\n+ * @stat:\t\tStructure containing the statistics\n+ *\n+ * Return:  '0' on Success; Error code otherwise.\n+ */\n+int dpni_get_statistics(struct fsl_mc_io *mc_io,\n+\t\t\tuint32_t cmd_flags,\n+\t\t\tuint16_t token,\n+\t\t\tuint8_t page,\n+\t\t\tunion dpni_statistics *stat);\n+\n+/**\n+ * dpni_reset_statistics() - Clears DPNI statistics\n+ * @mc_io:\t\tPointer to MC portal's I/O object\n+ * @cmd_flags:\t\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\t\tToken of DPNI object\n+ *\n+ * Return:  '0' on Success; Error code otherwise.\n+ */\n+int dpni_reset_statistics(struct fsl_mc_io *mc_io,\n+\t\t\t  uint32_t cmd_flags,\n+\t\t\t  uint16_t token);\n+\n+#endif /* __FSL_DPNI_H */\ndiff --git a/drivers/net/dpaa2/mc/fsl_dpni_cmd.h b/drivers/net/dpaa2/mc/fsl_dpni_cmd.h\nnew file mode 100644\nindex 0000000..bb92ea8\n--- /dev/null\n+++ b/drivers/net/dpaa2/mc/fsl_dpni_cmd.h\n@@ -0,0 +1,334 @@\n+/*-\n+ * This file is provided under a dual BSD/GPLv2 license. When using or\n+ * redistributing this file, you may do so under either license.\n+ *\n+ *   BSD LICENSE\n+ *\n+ * Copyright 2013-2016 Freescale Semiconductor Inc.\n+ * Copyright (c) 2016 NXP.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in the\n+ * documentation and/or other materials provided with the distribution.\n+ * * Neither the name of the above-listed copyright holders nor the\n+ * names of any contributors may be used to endorse or promote products\n+ * derived from this software without specific prior written permission.\n+ *\n+ *   GPL LICENSE SUMMARY\n+ *\n+ * ALTERNATIVELY, this software may be distributed under the terms of the\n+ * GNU General Public License (\"GPL\") as published by the Free Software\n+ * Foundation, either version 2 of that License or (at your option) any\n+ * later version.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ */\n+#ifndef _FSL_DPNI_CMD_H\n+#define _FSL_DPNI_CMD_H\n+\n+/* DPNI Version */\n+#define DPNI_VER_MAJOR\t\t\t\t7\n+#define DPNI_VER_MINOR\t\t\t\t0\n+\n+/* Command IDs */\n+#define DPNI_CMDID_OPEN                                ((0x801 << 4) | (0x1))\n+#define DPNI_CMDID_CLOSE                               ((0x800 << 4) | (0x1))\n+#define DPNI_CMDID_CREATE                              ((0x901 << 4) | (0x1))\n+#define DPNI_CMDID_DESTROY                             ((0x981 << 4) | (0x1))\n+#define DPNI_CMDID_GET_API_VERSION                     ((0xa01 << 4) | (0x1))\n+\n+#define DPNI_CMDID_ENABLE                              ((0x002 << 4) | (0x1))\n+#define DPNI_CMDID_DISABLE                             ((0x003 << 4) | (0x1))\n+#define DPNI_CMDID_GET_ATTR                            ((0x004 << 4) | (0x1))\n+#define DPNI_CMDID_RESET                               ((0x005 << 4) | (0x1))\n+#define DPNI_CMDID_IS_ENABLED                          ((0x006 << 4) | (0x1))\n+\n+#define DPNI_CMDID_SET_POOLS                           ((0x200 << 4) | (0x1))\n+#define DPNI_CMDID_SET_ERRORS_BEHAVIOR                 ((0x20B << 4) | (0x1))\n+\n+#define DPNI_CMDID_GET_QDID                            ((0x210 << 4) | (0x1))\n+#define DPNI_CMDID_GET_LINK_STATE                      ((0x215 << 4) | (0x1))\n+#define DPNI_CMDID_SET_MAX_FRAME_LENGTH                ((0x216 << 4) | (0x1))\n+#define DPNI_CMDID_GET_MAX_FRAME_LENGTH                ((0x217 << 4) | (0x1))\n+\n+#define DPNI_CMDID_SET_UNICAST_PROMISC                 ((0x222 << 4) | (0x1))\n+#define DPNI_CMDID_GET_UNICAST_PROMISC                 ((0x223 << 4) | (0x1))\n+#define DPNI_CMDID_SET_PRIM_MAC                        ((0x224 << 4) | (0x1))\n+#define DPNI_CMDID_GET_PRIM_MAC                        ((0x225 << 4) | (0x1))\n+\n+#define DPNI_CMDID_SET_RX_TC_DIST                      ((0x235 << 4) | (0x1))\n+\n+#define DPNI_CMDID_GET_STATISTICS                      ((0x25D << 4) | (0x1))\n+#define DPNI_CMDID_RESET_STATISTICS                    ((0x25E << 4) | (0x1))\n+#define DPNI_CMDID_GET_QUEUE                           ((0x25F << 4) | (0x1))\n+#define DPNI_CMDID_SET_QUEUE                           ((0x260 << 4) | (0x1))\n+\n+#define DPNI_CMDID_GET_PORT_MAC_ADDR                   ((0x263 << 4) | (0x1))\n+\n+#define DPNI_CMDID_GET_BUFFER_LAYOUT                   ((0x264 << 4) | (0x1))\n+#define DPNI_CMDID_SET_BUFFER_LAYOUT                   ((0x265 << 4) | (0x1))\n+\n+#define DPNI_CMDID_GET_OFFLOAD                         ((0x26B << 4) | (0x1))\n+#define DPNI_CMDID_SET_OFFLOAD                         ((0x26C << 4) | (0x1))\n+#define DPNI_CMDID_SET_TX_CONFIRMATION_MODE            ((0x266 << 4) | (0x1))\n+#define DPNI_CMDID_GET_TX_CONFIRMATION_MODE            ((0x26D << 4) | (0x1))\n+\n+/*                cmd, param, offset, width, type, arg_name */\n+#define DPNI_CMD_OPEN(cmd, dpni_id) \\\n+\tMC_CMD_OP(cmd,\t 0,\t0,\t32,\tint,\tdpni_id)\n+\n+/*                cmd, param, offset, width, type, arg_name */\n+#define DPNI_CMD_CREATE(cmd, cfg) \\\n+do { \\\n+\tMC_CMD_OP(cmd, 0,  0, 32, uint32_t,  (cfg)->options); \\\n+\tMC_CMD_OP(cmd, 0, 32,  8,  uint8_t,  (cfg)->num_queues); \\\n+\tMC_CMD_OP(cmd, 0, 40,  8,  uint8_t,  (cfg)->num_tcs); \\\n+\tMC_CMD_OP(cmd, 0, 48,  8,  uint8_t,  (cfg)->mac_filter_entries); \\\n+\tMC_CMD_OP(cmd, 1,  0,  8,  uint8_t,  (cfg)->vlan_filter_entries); \\\n+\tMC_CMD_OP(cmd, 1, 16,  8,  uint8_t,  (cfg)->qos_entries); \\\n+\tMC_CMD_OP(cmd, 1, 32, 16, uint16_t,  (cfg)->fs_entries); \\\n+} while (0)\n+\n+/*                cmd, param, offset, width, type, arg_name */\n+#define DPNI_CMD_SET_POOLS(cmd, cfg) \\\n+do { \\\n+\tMC_CMD_OP(cmd, 0, 0,  8,  uint8_t,  cfg->num_dpbp); \\\n+\tMC_CMD_OP(cmd, 0, 8,  1,  int,      cfg->pools[0].backup_pool); \\\n+\tMC_CMD_OP(cmd, 0, 9,  1,  int,      cfg->pools[1].backup_pool); \\\n+\tMC_CMD_OP(cmd, 0, 10, 1,  int,      cfg->pools[2].backup_pool); \\\n+\tMC_CMD_OP(cmd, 0, 11, 1,  int,      cfg->pools[3].backup_pool); \\\n+\tMC_CMD_OP(cmd, 0, 12, 1,  int,      cfg->pools[4].backup_pool); \\\n+\tMC_CMD_OP(cmd, 0, 13, 1,  int,      cfg->pools[5].backup_pool); \\\n+\tMC_CMD_OP(cmd, 0, 14, 1,  int,      cfg->pools[6].backup_pool); \\\n+\tMC_CMD_OP(cmd, 0, 15, 1,  int,      cfg->pools[7].backup_pool); \\\n+\tMC_CMD_OP(cmd, 0, 32, 32, int,      cfg->pools[0].dpbp_id); \\\n+\tMC_CMD_OP(cmd, 4, 32, 16, uint16_t, cfg->pools[0].buffer_size);\\\n+\tMC_CMD_OP(cmd, 1, 0,  32, int,      cfg->pools[1].dpbp_id); \\\n+\tMC_CMD_OP(cmd, 4, 48, 16, uint16_t, cfg->pools[1].buffer_size);\\\n+\tMC_CMD_OP(cmd, 1, 32, 32, int,      cfg->pools[2].dpbp_id); \\\n+\tMC_CMD_OP(cmd, 5, 0,  16, uint16_t, cfg->pools[2].buffer_size);\\\n+\tMC_CMD_OP(cmd, 2, 0,  32, int,      cfg->pools[3].dpbp_id); \\\n+\tMC_CMD_OP(cmd, 5, 16, 16, uint16_t, cfg->pools[3].buffer_size);\\\n+\tMC_CMD_OP(cmd, 2, 32, 32, int,      cfg->pools[4].dpbp_id); \\\n+\tMC_CMD_OP(cmd, 5, 32, 16, uint16_t, cfg->pools[4].buffer_size);\\\n+\tMC_CMD_OP(cmd, 3, 0,  32, int,      cfg->pools[5].dpbp_id); \\\n+\tMC_CMD_OP(cmd, 5, 48, 16, uint16_t, cfg->pools[5].buffer_size);\\\n+\tMC_CMD_OP(cmd, 3, 32, 32, int,      cfg->pools[6].dpbp_id); \\\n+\tMC_CMD_OP(cmd, 6, 0,  16, uint16_t, cfg->pools[6].buffer_size);\\\n+\tMC_CMD_OP(cmd, 4, 0,  32, int,      cfg->pools[7].dpbp_id); \\\n+\tMC_CMD_OP(cmd, 6, 16, 16, uint16_t, cfg->pools[7].buffer_size);\\\n+} while (0)\n+\n+/*                cmd, param, offset, width, type, arg_name */\n+#define DPNI_RSP_IS_ENABLED(cmd, en) \\\n+\tMC_RSP_OP(cmd, 0, 0,  1,  int,\t    en)\n+\n+/* DPNI_CMD_GET_ATTR is not used, no input parameters */\n+\n+#define DPNI_RSP_GET_ATTR(cmd, attr) \\\n+do { \\\n+\tMC_RSP_OP(cmd, 0,  0, 32, uint32_t, (attr)->options); \\\n+\tMC_RSP_OP(cmd, 0, 32,  8, uint8_t,  (attr)->num_queues); \\\n+\tMC_RSP_OP(cmd, 0, 40,  8, uint8_t,  (attr)->num_tcs); \\\n+\tMC_RSP_OP(cmd, 0, 48,  8, uint8_t,  (attr)->mac_filter_entries); \\\n+\tMC_RSP_OP(cmd, 1,  0,  8, uint8_t, (attr)->vlan_filter_entries); \\\n+\tMC_RSP_OP(cmd, 1, 16,  8, uint8_t,  (attr)->qos_entries); \\\n+\tMC_RSP_OP(cmd, 1, 32, 16, uint16_t, (attr)->fs_entries); \\\n+\tMC_RSP_OP(cmd, 2,  0,  8, uint8_t,  (attr)->qos_key_size); \\\n+\tMC_RSP_OP(cmd, 2,  8,  8, uint8_t,  (attr)->fs_key_size); \\\n+\tMC_RSP_OP(cmd, 2, 16, 16, uint16_t, (attr)->wriop_version); \\\n+} while (0)\n+\n+/*                cmd, param, offset, width, type, arg_name */\n+#define DPNI_CMD_SET_ERRORS_BEHAVIOR(cmd, cfg) \\\n+do { \\\n+\tMC_CMD_OP(cmd, 0, 0,  32, uint32_t, cfg->errors); \\\n+\tMC_CMD_OP(cmd, 0, 32, 4,  enum dpni_error_action, cfg->error_action); \\\n+\tMC_CMD_OP(cmd, 0, 36, 1,  int,      cfg->set_frame_annotation); \\\n+} while (0)\n+\n+#define DPNI_CMD_GET_BUFFER_LAYOUT(cmd, qtype) \\\n+\tMC_CMD_OP(cmd, 0,  0,  8, enum dpni_queue_type, qtype)\n+\n+#define DPNI_RSP_GET_BUFFER_LAYOUT(cmd, layout) \\\n+do { \\\n+\tMC_RSP_OP(cmd, 0, 48,  1, char, (layout)->pass_timestamp); \\\n+\tMC_RSP_OP(cmd, 0, 49,  1, char, (layout)->pass_parser_result); \\\n+\tMC_RSP_OP(cmd, 0, 50,  1, char, (layout)->pass_frame_status); \\\n+\tMC_RSP_OP(cmd, 1,  0, 16, uint16_t, (layout)->private_data_size); \\\n+\tMC_RSP_OP(cmd, 1, 16, 16, uint16_t, (layout)->data_align); \\\n+\tMC_RSP_OP(cmd, 1, 32, 16, uint16_t, (layout)->data_head_room); \\\n+\tMC_RSP_OP(cmd, 1, 48, 16, uint16_t, (layout)->data_tail_room); \\\n+} while (0)\n+\n+#define DPNI_CMD_SET_BUFFER_LAYOUT(cmd, qtype, layout) \\\n+do { \\\n+\tMC_CMD_OP(cmd, 0,  0,  8, enum dpni_queue_type, qtype); \\\n+\tMC_CMD_OP(cmd, 0, 32, 16, uint16_t, (layout)->options); \\\n+\tMC_CMD_OP(cmd, 0, 48,  1, char, (layout)->pass_timestamp); \\\n+\tMC_CMD_OP(cmd, 0, 49,  1, char, (layout)->pass_parser_result); \\\n+\tMC_CMD_OP(cmd, 0, 50,  1, char, (layout)->pass_frame_status); \\\n+\tMC_CMD_OP(cmd, 1,  0, 16, uint16_t, (layout)->private_data_size); \\\n+\tMC_CMD_OP(cmd, 1, 16, 16, uint16_t, (layout)->data_align); \\\n+\tMC_CMD_OP(cmd, 1, 32, 16, uint16_t, (layout)->data_head_room); \\\n+\tMC_CMD_OP(cmd, 1, 48, 16, uint16_t, (layout)->data_tail_room); \\\n+} while (0)\n+\n+#define DPNI_CMD_SET_OFFLOAD(cmd, type, config) \\\n+do { \\\n+\tMC_CMD_OP(cmd, 0, 24,  8, enum dpni_offload, type); \\\n+\tMC_CMD_OP(cmd, 0, 32, 32, uint32_t, config); \\\n+} while (0)\n+\n+#define DPNI_CMD_GET_OFFLOAD(cmd, type) \\\n+\tMC_CMD_OP(cmd, 0, 24,  8, enum dpni_offload, type)\n+\n+#define DPNI_RSP_GET_OFFLOAD(cmd, config) \\\n+\tMC_RSP_OP(cmd, 0, 32, 32, uint32_t, config)\n+\n+#define DPNI_CMD_GET_QDID(cmd, qtype) \\\n+\tMC_CMD_OP(cmd, 0,  0,  8, enum dpni_queue_type, qtype)\n+\n+/*                cmd, param, offset, width, type, arg_name */\n+#define DPNI_RSP_GET_QDID(cmd, qdid) \\\n+\tMC_RSP_OP(cmd, 0, 0,  16, uint16_t, qdid)\n+\n+\n+/*                cmd, param, offset, width, type, arg_name */\n+#define DPNI_CMD_GET_STATISTICS(cmd, page) \\\n+\tMC_CMD_OP(cmd, 0, 0, 8, uint8_t, page)\n+\n+#define DPNI_RSP_GET_STATISTICS(cmd, stat) \\\n+do { \\\n+\tMC_RSP_OP(cmd, 0, 0, 64, uint64_t, (stat)->raw.counter[0]); \\\n+\tMC_RSP_OP(cmd, 1, 0, 64, uint64_t, (stat)->raw.counter[1]); \\\n+\tMC_RSP_OP(cmd, 2, 0, 64, uint64_t, (stat)->raw.counter[2]); \\\n+\tMC_RSP_OP(cmd, 3, 0, 64, uint64_t, (stat)->raw.counter[3]); \\\n+\tMC_RSP_OP(cmd, 4, 0, 64, uint64_t, (stat)->raw.counter[4]); \\\n+\tMC_RSP_OP(cmd, 5, 0, 64, uint64_t, (stat)->raw.counter[5]); \\\n+\tMC_RSP_OP(cmd, 6, 0, 64, uint64_t, (stat)->raw.counter[6]); \\\n+} while (0)\n+\n+/*                cmd, param, offset, width, type, arg_name */\n+#define DPNI_RSP_GET_LINK_STATE(cmd, state) \\\n+do { \\\n+\tMC_RSP_OP(cmd, 0, 32,  1, int,      state->up);\\\n+\tMC_RSP_OP(cmd, 1, 0,  32, uint32_t, state->rate);\\\n+\tMC_RSP_OP(cmd, 2, 0,  64, uint64_t, state->options);\\\n+} while (0)\n+\n+/*                cmd, param, offset, width, type, arg_name */\n+#define DPNI_CMD_SET_MAX_FRAME_LENGTH(cmd, max_frame_length) \\\n+\tMC_CMD_OP(cmd, 0, 0,  16, uint16_t, max_frame_length)\n+\n+/*                cmd, param, offset, width, type, arg_name */\n+#define DPNI_RSP_GET_MAX_FRAME_LENGTH(cmd, max_frame_length) \\\n+\tMC_RSP_OP(cmd, 0, 0,  16, uint16_t, max_frame_length)\n+\n+/*                cmd, param, offset, width, type, arg_name */\n+#define DPNI_CMD_SET_UNICAST_PROMISC(cmd, en) \\\n+\tMC_CMD_OP(cmd, 0, 0,  1,  int,      en)\n+\n+/*                cmd, param, offset, width, type, arg_name */\n+#define DPNI_RSP_GET_UNICAST_PROMISC(cmd, en) \\\n+\tMC_RSP_OP(cmd, 0, 0,  1,  int,\t    en)\n+\n+/*                cmd, param, offset, width, type, arg_name */\n+#define DPNI_CMD_SET_PRIMARY_MAC_ADDR(cmd, mac_addr) \\\n+do { \\\n+\tMC_CMD_OP(cmd, 0, 16, 8,  uint8_t,  mac_addr[5]); \\\n+\tMC_CMD_OP(cmd, 0, 24, 8,  uint8_t,  mac_addr[4]); \\\n+\tMC_CMD_OP(cmd, 0, 32, 8,  uint8_t,  mac_addr[3]); \\\n+\tMC_CMD_OP(cmd, 0, 40, 8,  uint8_t,  mac_addr[2]); \\\n+\tMC_CMD_OP(cmd, 0, 48, 8,  uint8_t,  mac_addr[1]); \\\n+\tMC_CMD_OP(cmd, 0, 56, 8,  uint8_t,  mac_addr[0]); \\\n+} while (0)\n+\n+/*                cmd, param, offset, width, type, arg_name */\n+#define DPNI_RSP_GET_PRIMARY_MAC_ADDR(cmd, mac_addr) \\\n+do { \\\n+\tMC_RSP_OP(cmd, 0, 16, 8,  uint8_t,  mac_addr[5]); \\\n+\tMC_RSP_OP(cmd, 0, 24, 8,  uint8_t,  mac_addr[4]); \\\n+\tMC_RSP_OP(cmd, 0, 32, 8,  uint8_t,  mac_addr[3]); \\\n+\tMC_RSP_OP(cmd, 0, 40, 8,  uint8_t,  mac_addr[2]); \\\n+\tMC_RSP_OP(cmd, 0, 48, 8,  uint8_t,  mac_addr[1]); \\\n+\tMC_RSP_OP(cmd, 0, 56, 8,  uint8_t,  mac_addr[0]); \\\n+} while (0)\n+\n+\n+/*                cmd, param, offset, width, type, arg_name */\n+#define DPNI_CMD_SET_RX_TC_DIST(cmd, tc_id, cfg) \\\n+do { \\\n+\tMC_CMD_OP(cmd, 0, 0,  16, uint16_t,  cfg->dist_size); \\\n+\tMC_CMD_OP(cmd, 0, 16, 8,  uint8_t,  tc_id); \\\n+\tMC_CMD_OP(cmd, 0, 24, 4,  enum dpni_dist_mode, cfg->dist_mode); \\\n+\tMC_CMD_OP(cmd, 0, 28, 4,  enum dpni_fs_miss_action, \\\n+\t\t\t\t\t\t  cfg->fs_cfg.miss_action); \\\n+\tMC_CMD_OP(cmd, 0, 48, 16, uint16_t, cfg->fs_cfg.default_flow_id); \\\n+\tMC_CMD_OP(cmd, 6, 0,  64, uint64_t, cfg->key_cfg_iova); \\\n+} while (0)\n+\n+#define DPNI_CMD_GET_QUEUE(cmd, qtype, tc, index) \\\n+do { \\\n+\tMC_CMD_OP(cmd, 0,  0,  8, enum dpni_queue_type, qtype); \\\n+\tMC_CMD_OP(cmd, 0,  8,  8,  uint8_t, tc); \\\n+\tMC_CMD_OP(cmd, 0, 16,  8,  uint8_t, index); \\\n+} while (0)\n+\n+#define DPNI_RSP_GET_QUEUE(cmd, queue, queue_id) \\\n+do { \\\n+\tMC_RSP_OP(cmd, 1,  0, 32, uint32_t, (queue)->destination.id); \\\n+\tMC_RSP_OP(cmd, 1, 48,  8, uint8_t, (queue)->destination.priority); \\\n+\tMC_RSP_OP(cmd, 1, 56,  4, enum dpni_dest, (queue)->destination.type); \\\n+\tMC_RSP_OP(cmd, 1, 62,  1, char, (queue)->flc.stash_control); \\\n+\tMC_RSP_OP(cmd, 1, 63,  1, char, (queue)->destination.hold_active); \\\n+\tMC_RSP_OP(cmd, 2,  0, 64, uint64_t, (queue)->flc.value); \\\n+\tMC_RSP_OP(cmd, 3,  0, 64, uint64_t, (queue)->user_context); \\\n+\tMC_RSP_OP(cmd, 4,  0, 32, uint32_t, (queue_id)->fqid); \\\n+\tMC_RSP_OP(cmd, 4, 32, 16, uint16_t, (queue_id)->qdbin); \\\n+} while (0)\n+\n+#define DPNI_CMD_SET_QUEUE(cmd, qtype, tc, index, options, queue) \\\n+do { \\\n+\tMC_CMD_OP(cmd, 0,  0,  8, enum dpni_queue_type, qtype); \\\n+\tMC_CMD_OP(cmd, 0,  8,  8,  uint8_t, tc); \\\n+\tMC_CMD_OP(cmd, 0, 16,  8,  uint8_t, index); \\\n+\tMC_CMD_OP(cmd, 0, 24,  8,  uint8_t, options); \\\n+\tMC_CMD_OP(cmd, 1,  0, 32, uint32_t, (queue)->destination.id); \\\n+\tMC_CMD_OP(cmd, 1, 48,  8, uint8_t, (queue)->destination.priority); \\\n+\tMC_CMD_OP(cmd, 1, 56,  4, enum dpni_dest, (queue)->destination.type); \\\n+\tMC_CMD_OP(cmd, 1, 62,  1, char, (queue)->flc.stash_control); \\\n+\tMC_CMD_OP(cmd, 1, 63,  1, char, (queue)->destination.hold_active); \\\n+\tMC_CMD_OP(cmd, 2,  0, 64, uint64_t, (queue)->flc.value); \\\n+\tMC_CMD_OP(cmd, 3,  0, 64, uint64_t, (queue)->user_context); \\\n+} while (0)\n+\n+/*                cmd, param, offset, width, type,      arg_name */\n+#define DPNI_RSP_GET_API_VERSION(cmd, major, minor) \\\n+do { \\\n+\tMC_RSP_OP(cmd, 0, 0,  16, uint16_t, major);\\\n+\tMC_RSP_OP(cmd, 0, 16, 16, uint16_t, minor);\\\n+} while (0)\n+\n+\n+#define DPNI_CMD_SET_TX_CONFIRMATION_MODE(cmd, mode) \\\n+\tMC_CMD_OP(cmd, 0, 32, 8, enum dpni_confirmation_mode, mode)\n+\n+#define DPNI_RSP_GET_TX_CONFIRMATION_MODE(cmd, mode) \\\n+\tMC_RSP_OP(cmd, 0, 32, 8, enum dpni_confirmation_mode, mode)\n+\n+#endif /* _FSL_DPNI_CMD_H */\ndiff --git a/drivers/net/dpaa2/mc/fsl_net.h b/drivers/net/dpaa2/mc/fsl_net.h\nnew file mode 100644\nindex 0000000..ef7e4da\n--- /dev/null\n+++ b/drivers/net/dpaa2/mc/fsl_net.h\n@@ -0,0 +1,487 @@\n+/*-\n+ * This file is provided under a dual BSD/GPLv2 license. When using or\n+ * redistributing this file, you may do so under either license.\n+ *\n+ *   BSD LICENSE\n+ *\n+ * Copyright 2013-2015 Freescale Semiconductor Inc.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in the\n+ * documentation and/or other materials provided with the distribution.\n+ * * Neither the name of the above-listed copyright holders nor the\n+ * names of any contributors may be used to endorse or promote products\n+ * derived from this software without specific prior written permission.\n+ *\n+ *   GPL LICENSE SUMMARY\n+ *\n+ * ALTERNATIVELY, this software may be distributed under the terms of the\n+ * GNU General Public License (\"GPL\") as published by the Free Software\n+ * Foundation, either version 2 of that License or (at your option) any\n+ * later version.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ */\n+#ifndef __FSL_NET_H\n+#define __FSL_NET_H\n+\n+#define LAST_HDR_INDEX 0xFFFFFFFF\n+\n+/*****************************************************************************/\n+/*                Protocol fields                                            */\n+/*****************************************************************************/\n+\n+/*************************  Ethernet fields  *********************************/\n+#define NH_FLD_ETH_DA                         (1)\n+#define NH_FLD_ETH_SA                         (NH_FLD_ETH_DA << 1)\n+#define NH_FLD_ETH_LENGTH                     (NH_FLD_ETH_DA << 2)\n+#define NH_FLD_ETH_TYPE                       (NH_FLD_ETH_DA << 3)\n+#define NH_FLD_ETH_FINAL_CKSUM                (NH_FLD_ETH_DA << 4)\n+#define NH_FLD_ETH_PADDING                    (NH_FLD_ETH_DA << 5)\n+#define NH_FLD_ETH_ALL_FIELDS                 ((NH_FLD_ETH_DA << 6) - 1)\n+\n+#define NH_FLD_ETH_ADDR_SIZE                 6\n+\n+/***************************  VLAN fields  ***********************************/\n+#define NH_FLD_VLAN_VPRI                      (1)\n+#define NH_FLD_VLAN_CFI                       (NH_FLD_VLAN_VPRI << 1)\n+#define NH_FLD_VLAN_VID                       (NH_FLD_VLAN_VPRI << 2)\n+#define NH_FLD_VLAN_LENGTH                    (NH_FLD_VLAN_VPRI << 3)\n+#define NH_FLD_VLAN_TYPE                      (NH_FLD_VLAN_VPRI << 4)\n+#define NH_FLD_VLAN_ALL_FIELDS                ((NH_FLD_VLAN_VPRI << 5) - 1)\n+\n+#define NH_FLD_VLAN_TCI                       (NH_FLD_VLAN_VPRI | \\\n+\t\t\t\t\t       NH_FLD_VLAN_CFI | \\\n+\t\t\t\t\t       NH_FLD_VLAN_VID)\n+\n+/************************  IP (generic) fields  ******************************/\n+#define NH_FLD_IP_VER                         (1)\n+#define NH_FLD_IP_DSCP                        (NH_FLD_IP_VER << 2)\n+#define NH_FLD_IP_ECN                         (NH_FLD_IP_VER << 3)\n+#define NH_FLD_IP_PROTO                       (NH_FLD_IP_VER << 4)\n+#define NH_FLD_IP_SRC                         (NH_FLD_IP_VER << 5)\n+#define NH_FLD_IP_DST                         (NH_FLD_IP_VER << 6)\n+#define NH_FLD_IP_TOS_TC                      (NH_FLD_IP_VER << 7)\n+#define NH_FLD_IP_ID                          (NH_FLD_IP_VER << 8)\n+#define NH_FLD_IP_ALL_FIELDS                  ((NH_FLD_IP_VER << 9) - 1)\n+\n+#define NH_FLD_IP_PROTO_SIZE                  1\n+\n+/*****************************  IPV4 fields  *********************************/\n+#define NH_FLD_IPV4_VER                       (1)\n+#define NH_FLD_IPV4_HDR_LEN                   (NH_FLD_IPV4_VER << 1)\n+#define NH_FLD_IPV4_TOS                       (NH_FLD_IPV4_VER << 2)\n+#define NH_FLD_IPV4_TOTAL_LEN                 (NH_FLD_IPV4_VER << 3)\n+#define NH_FLD_IPV4_ID                        (NH_FLD_IPV4_VER << 4)\n+#define NH_FLD_IPV4_FLAG_D                    (NH_FLD_IPV4_VER << 5)\n+#define NH_FLD_IPV4_FLAG_M                    (NH_FLD_IPV4_VER << 6)\n+#define NH_FLD_IPV4_OFFSET                    (NH_FLD_IPV4_VER << 7)\n+#define NH_FLD_IPV4_TTL                       (NH_FLD_IPV4_VER << 8)\n+#define NH_FLD_IPV4_PROTO                     (NH_FLD_IPV4_VER << 9)\n+#define NH_FLD_IPV4_CKSUM                     (NH_FLD_IPV4_VER << 10)\n+#define NH_FLD_IPV4_SRC_IP                    (NH_FLD_IPV4_VER << 11)\n+#define NH_FLD_IPV4_DST_IP                    (NH_FLD_IPV4_VER << 12)\n+#define NH_FLD_IPV4_OPTS                      (NH_FLD_IPV4_VER << 13)\n+#define NH_FLD_IPV4_OPTS_COUNT                (NH_FLD_IPV4_VER << 14)\n+#define NH_FLD_IPV4_ALL_FIELDS                ((NH_FLD_IPV4_VER << 15) - 1)\n+\n+#define NH_FLD_IPV4_ADDR_SIZE                 4\n+#define NH_FLD_IPV4_PROTO_SIZE                1\n+\n+/*****************************  IPV6 fields  *********************************/\n+#define NH_FLD_IPV6_VER                       (1)\n+#define NH_FLD_IPV6_TC                        (NH_FLD_IPV6_VER << 1)\n+#define NH_FLD_IPV6_SRC_IP                    (NH_FLD_IPV6_VER << 2)\n+#define NH_FLD_IPV6_DST_IP                    (NH_FLD_IPV6_VER << 3)\n+#define NH_FLD_IPV6_NEXT_HDR                  (NH_FLD_IPV6_VER << 4)\n+#define NH_FLD_IPV6_FL                        (NH_FLD_IPV6_VER << 5)\n+#define NH_FLD_IPV6_HOP_LIMIT                 (NH_FLD_IPV6_VER << 6)\n+#define NH_FLD_IPV6_ID\t\t\t      (NH_FLD_IPV6_VER << 7)\n+#define NH_FLD_IPV6_ALL_FIELDS                ((NH_FLD_IPV6_VER << 8) - 1)\n+\n+#define NH_FLD_IPV6_ADDR_SIZE                 16\n+#define NH_FLD_IPV6_NEXT_HDR_SIZE             1\n+\n+/*****************************  ICMP fields  *********************************/\n+#define NH_FLD_ICMP_TYPE                      (1)\n+#define NH_FLD_ICMP_CODE                      (NH_FLD_ICMP_TYPE << 1)\n+#define NH_FLD_ICMP_CKSUM                     (NH_FLD_ICMP_TYPE << 2)\n+#define NH_FLD_ICMP_ID                        (NH_FLD_ICMP_TYPE << 3)\n+#define NH_FLD_ICMP_SQ_NUM                    (NH_FLD_ICMP_TYPE << 4)\n+#define NH_FLD_ICMP_ALL_FIELDS                ((NH_FLD_ICMP_TYPE << 5) - 1)\n+\n+#define NH_FLD_ICMP_CODE_SIZE                 1\n+#define NH_FLD_ICMP_TYPE_SIZE                 1\n+\n+/*****************************  IGMP fields  *********************************/\n+#define NH_FLD_IGMP_VERSION                   (1)\n+#define NH_FLD_IGMP_TYPE                      (NH_FLD_IGMP_VERSION << 1)\n+#define NH_FLD_IGMP_CKSUM                     (NH_FLD_IGMP_VERSION << 2)\n+#define NH_FLD_IGMP_DATA                      (NH_FLD_IGMP_VERSION << 3)\n+#define NH_FLD_IGMP_ALL_FIELDS                ((NH_FLD_IGMP_VERSION << 4) - 1)\n+\n+/*****************************  TCP fields  **********************************/\n+#define NH_FLD_TCP_PORT_SRC                   (1)\n+#define NH_FLD_TCP_PORT_DST                   (NH_FLD_TCP_PORT_SRC << 1)\n+#define NH_FLD_TCP_SEQ                        (NH_FLD_TCP_PORT_SRC << 2)\n+#define NH_FLD_TCP_ACK                        (NH_FLD_TCP_PORT_SRC << 3)\n+#define NH_FLD_TCP_OFFSET                     (NH_FLD_TCP_PORT_SRC << 4)\n+#define NH_FLD_TCP_FLAGS                      (NH_FLD_TCP_PORT_SRC << 5)\n+#define NH_FLD_TCP_WINDOW                     (NH_FLD_TCP_PORT_SRC << 6)\n+#define NH_FLD_TCP_CKSUM                      (NH_FLD_TCP_PORT_SRC << 7)\n+#define NH_FLD_TCP_URGPTR                     (NH_FLD_TCP_PORT_SRC << 8)\n+#define NH_FLD_TCP_OPTS                       (NH_FLD_TCP_PORT_SRC << 9)\n+#define NH_FLD_TCP_OPTS_COUNT                 (NH_FLD_TCP_PORT_SRC << 10)\n+#define NH_FLD_TCP_ALL_FIELDS                 ((NH_FLD_TCP_PORT_SRC << 11) - 1)\n+\n+#define NH_FLD_TCP_PORT_SIZE                  2\n+\n+/*****************************  UDP fields  **********************************/\n+#define NH_FLD_UDP_PORT_SRC                   (1)\n+#define NH_FLD_UDP_PORT_DST                   (NH_FLD_UDP_PORT_SRC << 1)\n+#define NH_FLD_UDP_LEN                        (NH_FLD_UDP_PORT_SRC << 2)\n+#define NH_FLD_UDP_CKSUM                      (NH_FLD_UDP_PORT_SRC << 3)\n+#define NH_FLD_UDP_ALL_FIELDS                 ((NH_FLD_UDP_PORT_SRC << 4) - 1)\n+\n+#define NH_FLD_UDP_PORT_SIZE                  2\n+\n+/***************************  UDP-lite fields  *******************************/\n+#define NH_FLD_UDP_LITE_PORT_SRC              (1)\n+#define NH_FLD_UDP_LITE_PORT_DST              (NH_FLD_UDP_LITE_PORT_SRC << 1)\n+#define NH_FLD_UDP_LITE_ALL_FIELDS \\\n+\t((NH_FLD_UDP_LITE_PORT_SRC << 2) - 1)\n+\n+#define NH_FLD_UDP_LITE_PORT_SIZE             2\n+\n+/***************************  UDP-encap-ESP fields  **************************/\n+#define NH_FLD_UDP_ENC_ESP_PORT_SRC         (1)\n+#define NH_FLD_UDP_ENC_ESP_PORT_DST         (NH_FLD_UDP_ENC_ESP_PORT_SRC << 1)\n+#define NH_FLD_UDP_ENC_ESP_LEN              (NH_FLD_UDP_ENC_ESP_PORT_SRC << 2)\n+#define NH_FLD_UDP_ENC_ESP_CKSUM            (NH_FLD_UDP_ENC_ESP_PORT_SRC << 3)\n+#define NH_FLD_UDP_ENC_ESP_SPI              (NH_FLD_UDP_ENC_ESP_PORT_SRC << 4)\n+#define NH_FLD_UDP_ENC_ESP_SEQUENCE_NUM     (NH_FLD_UDP_ENC_ESP_PORT_SRC << 5)\n+#define NH_FLD_UDP_ENC_ESP_ALL_FIELDS \\\n+\t((NH_FLD_UDP_ENC_ESP_PORT_SRC << 6) - 1)\n+\n+#define NH_FLD_UDP_ENC_ESP_PORT_SIZE        2\n+#define NH_FLD_UDP_ENC_ESP_SPI_SIZE         4\n+\n+/*****************************  SCTP fields  *********************************/\n+#define NH_FLD_SCTP_PORT_SRC                  (1)\n+#define NH_FLD_SCTP_PORT_DST                  (NH_FLD_SCTP_PORT_SRC << 1)\n+#define NH_FLD_SCTP_VER_TAG                   (NH_FLD_SCTP_PORT_SRC << 2)\n+#define NH_FLD_SCTP_CKSUM                     (NH_FLD_SCTP_PORT_SRC << 3)\n+#define NH_FLD_SCTP_ALL_FIELDS                ((NH_FLD_SCTP_PORT_SRC << 4) - 1)\n+\n+#define NH_FLD_SCTP_PORT_SIZE                 2\n+\n+/*****************************  DCCP fields  *********************************/\n+#define NH_FLD_DCCP_PORT_SRC                  (1)\n+#define NH_FLD_DCCP_PORT_DST                  (NH_FLD_DCCP_PORT_SRC << 1)\n+#define NH_FLD_DCCP_ALL_FIELDS                ((NH_FLD_DCCP_PORT_SRC << 2) - 1)\n+\n+#define NH_FLD_DCCP_PORT_SIZE                 2\n+\n+/*****************************  IPHC fields  *********************************/\n+#define NH_FLD_IPHC_CID                       (1)\n+#define NH_FLD_IPHC_CID_TYPE                  (NH_FLD_IPHC_CID << 1)\n+#define NH_FLD_IPHC_HCINDEX                   (NH_FLD_IPHC_CID << 2)\n+#define NH_FLD_IPHC_GEN                       (NH_FLD_IPHC_CID << 3)\n+#define NH_FLD_IPHC_D_BIT                     (NH_FLD_IPHC_CID << 4)\n+#define NH_FLD_IPHC_ALL_FIELDS                ((NH_FLD_IPHC_CID << 5) - 1)\n+\n+/*****************************  SCTP fields  *********************************/\n+#define NH_FLD_SCTP_CHUNK_DATA_TYPE           (1)\n+#define NH_FLD_SCTP_CHUNK_DATA_FLAGS          (NH_FLD_SCTP_CHUNK_DATA_TYPE << 1)\n+#define NH_FLD_SCTP_CHUNK_DATA_LENGTH         (NH_FLD_SCTP_CHUNK_DATA_TYPE << 2)\n+#define NH_FLD_SCTP_CHUNK_DATA_TSN            (NH_FLD_SCTP_CHUNK_DATA_TYPE << 3)\n+#define NH_FLD_SCTP_CHUNK_DATA_STREAM_ID      (NH_FLD_SCTP_CHUNK_DATA_TYPE << 4)\n+#define NH_FLD_SCTP_CHUNK_DATA_STREAM_SQN     (NH_FLD_SCTP_CHUNK_DATA_TYPE << 5)\n+#define NH_FLD_SCTP_CHUNK_DATA_PAYLOAD_PID    (NH_FLD_SCTP_CHUNK_DATA_TYPE << 6)\n+#define NH_FLD_SCTP_CHUNK_DATA_UNORDERED      (NH_FLD_SCTP_CHUNK_DATA_TYPE << 7)\n+#define NH_FLD_SCTP_CHUNK_DATA_BEGINNING      (NH_FLD_SCTP_CHUNK_DATA_TYPE << 8)\n+#define NH_FLD_SCTP_CHUNK_DATA_END            (NH_FLD_SCTP_CHUNK_DATA_TYPE << 9)\n+#define NH_FLD_SCTP_CHUNK_DATA_ALL_FIELDS \\\n+\t((NH_FLD_SCTP_CHUNK_DATA_TYPE << 10) - 1)\n+\n+/***************************  L2TPV2 fields  *********************************/\n+#define NH_FLD_L2TPV2_TYPE_BIT                (1)\n+#define NH_FLD_L2TPV2_LENGTH_BIT              (NH_FLD_L2TPV2_TYPE_BIT << 1)\n+#define NH_FLD_L2TPV2_SEQUENCE_BIT            (NH_FLD_L2TPV2_TYPE_BIT << 2)\n+#define NH_FLD_L2TPV2_OFFSET_BIT              (NH_FLD_L2TPV2_TYPE_BIT << 3)\n+#define NH_FLD_L2TPV2_PRIORITY_BIT            (NH_FLD_L2TPV2_TYPE_BIT << 4)\n+#define NH_FLD_L2TPV2_VERSION                 (NH_FLD_L2TPV2_TYPE_BIT << 5)\n+#define NH_FLD_L2TPV2_LEN                     (NH_FLD_L2TPV2_TYPE_BIT << 6)\n+#define NH_FLD_L2TPV2_TUNNEL_ID               (NH_FLD_L2TPV2_TYPE_BIT << 7)\n+#define NH_FLD_L2TPV2_SESSION_ID              (NH_FLD_L2TPV2_TYPE_BIT << 8)\n+#define NH_FLD_L2TPV2_NS                      (NH_FLD_L2TPV2_TYPE_BIT << 9)\n+#define NH_FLD_L2TPV2_NR                      (NH_FLD_L2TPV2_TYPE_BIT << 10)\n+#define NH_FLD_L2TPV2_OFFSET_SIZE             (NH_FLD_L2TPV2_TYPE_BIT << 11)\n+#define NH_FLD_L2TPV2_FIRST_BYTE              (NH_FLD_L2TPV2_TYPE_BIT << 12)\n+#define NH_FLD_L2TPV2_ALL_FIELDS \\\n+\t((NH_FLD_L2TPV2_TYPE_BIT << 13) - 1)\n+\n+/***************************  L2TPV3 fields  *********************************/\n+#define NH_FLD_L2TPV3_CTRL_TYPE_BIT           (1)\n+#define NH_FLD_L2TPV3_CTRL_LENGTH_BIT         (NH_FLD_L2TPV3_CTRL_TYPE_BIT << 1)\n+#define NH_FLD_L2TPV3_CTRL_SEQUENCE_BIT       (NH_FLD_L2TPV3_CTRL_TYPE_BIT << 2)\n+#define NH_FLD_L2TPV3_CTRL_VERSION            (NH_FLD_L2TPV3_CTRL_TYPE_BIT << 3)\n+#define NH_FLD_L2TPV3_CTRL_LENGTH             (NH_FLD_L2TPV3_CTRL_TYPE_BIT << 4)\n+#define NH_FLD_L2TPV3_CTRL_CONTROL            (NH_FLD_L2TPV3_CTRL_TYPE_BIT << 5)\n+#define NH_FLD_L2TPV3_CTRL_SENT               (NH_FLD_L2TPV3_CTRL_TYPE_BIT << 6)\n+#define NH_FLD_L2TPV3_CTRL_RECV               (NH_FLD_L2TPV3_CTRL_TYPE_BIT << 7)\n+#define NH_FLD_L2TPV3_CTRL_FIRST_BYTE         (NH_FLD_L2TPV3_CTRL_TYPE_BIT << 8)\n+#define NH_FLD_L2TPV3_CTRL_ALL_FIELDS \\\n+\t((NH_FLD_L2TPV3_CTRL_TYPE_BIT << 9) - 1)\n+\n+#define NH_FLD_L2TPV3_SESS_TYPE_BIT           (1)\n+#define NH_FLD_L2TPV3_SESS_VERSION            (NH_FLD_L2TPV3_SESS_TYPE_BIT << 1)\n+#define NH_FLD_L2TPV3_SESS_ID                 (NH_FLD_L2TPV3_SESS_TYPE_BIT << 2)\n+#define NH_FLD_L2TPV3_SESS_COOKIE             (NH_FLD_L2TPV3_SESS_TYPE_BIT << 3)\n+#define NH_FLD_L2TPV3_SESS_ALL_FIELDS \\\n+\t((NH_FLD_L2TPV3_SESS_TYPE_BIT << 4) - 1)\n+\n+/****************************  PPP fields  ***********************************/\n+#define NH_FLD_PPP_PID                        (1)\n+#define NH_FLD_PPP_COMPRESSED                 (NH_FLD_PPP_PID << 1)\n+#define NH_FLD_PPP_ALL_FIELDS                 ((NH_FLD_PPP_PID << 2) - 1)\n+\n+/**************************  PPPoE fields  ***********************************/\n+#define NH_FLD_PPPOE_VER                      (1)\n+#define NH_FLD_PPPOE_TYPE                     (NH_FLD_PPPOE_VER << 1)\n+#define NH_FLD_PPPOE_CODE                     (NH_FLD_PPPOE_VER << 2)\n+#define NH_FLD_PPPOE_SID                      (NH_FLD_PPPOE_VER << 3)\n+#define NH_FLD_PPPOE_LEN                      (NH_FLD_PPPOE_VER << 4)\n+#define NH_FLD_PPPOE_SESSION                  (NH_FLD_PPPOE_VER << 5)\n+#define NH_FLD_PPPOE_PID                      (NH_FLD_PPPOE_VER << 6)\n+#define NH_FLD_PPPOE_ALL_FIELDS               ((NH_FLD_PPPOE_VER << 7) - 1)\n+\n+/*************************  PPP-Mux fields  **********************************/\n+#define NH_FLD_PPPMUX_PID                     (1)\n+#define NH_FLD_PPPMUX_CKSUM                   (NH_FLD_PPPMUX_PID << 1)\n+#define NH_FLD_PPPMUX_COMPRESSED              (NH_FLD_PPPMUX_PID << 2)\n+#define NH_FLD_PPPMUX_ALL_FIELDS              ((NH_FLD_PPPMUX_PID << 3) - 1)\n+\n+/***********************  PPP-Mux sub-frame fields  **************************/\n+#define NH_FLD_PPPMUX_SUBFRM_PFF            (1)\n+#define NH_FLD_PPPMUX_SUBFRM_LXT            (NH_FLD_PPPMUX_SUBFRM_PFF << 1)\n+#define NH_FLD_PPPMUX_SUBFRM_LEN            (NH_FLD_PPPMUX_SUBFRM_PFF << 2)\n+#define NH_FLD_PPPMUX_SUBFRM_PID            (NH_FLD_PPPMUX_SUBFRM_PFF << 3)\n+#define NH_FLD_PPPMUX_SUBFRM_USE_PID        (NH_FLD_PPPMUX_SUBFRM_PFF << 4)\n+#define NH_FLD_PPPMUX_SUBFRM_ALL_FIELDS \\\n+\t((NH_FLD_PPPMUX_SUBFRM_PFF << 5) - 1)\n+\n+/***************************  LLC fields  ************************************/\n+#define NH_FLD_LLC_DSAP                       (1)\n+#define NH_FLD_LLC_SSAP                       (NH_FLD_LLC_DSAP << 1)\n+#define NH_FLD_LLC_CTRL                       (NH_FLD_LLC_DSAP << 2)\n+#define NH_FLD_LLC_ALL_FIELDS                 ((NH_FLD_LLC_DSAP << 3) - 1)\n+\n+/***************************  NLPID fields  **********************************/\n+#define NH_FLD_NLPID_NLPID                    (1)\n+#define NH_FLD_NLPID_ALL_FIELDS               ((NH_FLD_NLPID_NLPID << 1) - 1)\n+\n+/***************************  SNAP fields  ***********************************/\n+#define NH_FLD_SNAP_OUI                       (1)\n+#define NH_FLD_SNAP_PID                       (NH_FLD_SNAP_OUI << 1)\n+#define NH_FLD_SNAP_ALL_FIELDS                ((NH_FLD_SNAP_OUI << 2) - 1)\n+\n+/***************************  LLC SNAP fields  *******************************/\n+#define NH_FLD_LLC_SNAP_TYPE                  (1)\n+#define NH_FLD_LLC_SNAP_ALL_FIELDS            ((NH_FLD_LLC_SNAP_TYPE << 1) - 1)\n+\n+#define NH_FLD_ARP_HTYPE                      (1)\n+#define NH_FLD_ARP_PTYPE                      (NH_FLD_ARP_HTYPE << 1)\n+#define NH_FLD_ARP_HLEN                       (NH_FLD_ARP_HTYPE << 2)\n+#define NH_FLD_ARP_PLEN                       (NH_FLD_ARP_HTYPE << 3)\n+#define NH_FLD_ARP_OPER                       (NH_FLD_ARP_HTYPE << 4)\n+#define NH_FLD_ARP_SHA                        (NH_FLD_ARP_HTYPE << 5)\n+#define NH_FLD_ARP_SPA                        (NH_FLD_ARP_HTYPE << 6)\n+#define NH_FLD_ARP_THA                        (NH_FLD_ARP_HTYPE << 7)\n+#define NH_FLD_ARP_TPA                        (NH_FLD_ARP_HTYPE << 8)\n+#define NH_FLD_ARP_ALL_FIELDS                 ((NH_FLD_ARP_HTYPE << 9) - 1)\n+\n+/***************************  RFC2684 fields  ********************************/\n+#define NH_FLD_RFC2684_LLC                    (1)\n+#define NH_FLD_RFC2684_NLPID                  (NH_FLD_RFC2684_LLC << 1)\n+#define NH_FLD_RFC2684_OUI                    (NH_FLD_RFC2684_LLC << 2)\n+#define NH_FLD_RFC2684_PID                    (NH_FLD_RFC2684_LLC << 3)\n+#define NH_FLD_RFC2684_VPN_OUI                (NH_FLD_RFC2684_LLC << 4)\n+#define NH_FLD_RFC2684_VPN_IDX                (NH_FLD_RFC2684_LLC << 5)\n+#define NH_FLD_RFC2684_ALL_FIELDS             ((NH_FLD_RFC2684_LLC << 6) - 1)\n+\n+/***************************  User defined fields  ***************************/\n+#define NH_FLD_USER_DEFINED_SRCPORT           (1)\n+#define NH_FLD_USER_DEFINED_PCDID             (NH_FLD_USER_DEFINED_SRCPORT << 1)\n+#define NH_FLD_USER_DEFINED_ALL_FIELDS \\\n+\t((NH_FLD_USER_DEFINED_SRCPORT << 2) - 1)\n+\n+/***************************  Payload fields  ********************************/\n+#define NH_FLD_PAYLOAD_BUFFER                 (1)\n+#define NH_FLD_PAYLOAD_SIZE                   (NH_FLD_PAYLOAD_BUFFER << 1)\n+#define NH_FLD_MAX_FRM_SIZE                   (NH_FLD_PAYLOAD_BUFFER << 2)\n+#define NH_FLD_MIN_FRM_SIZE                   (NH_FLD_PAYLOAD_BUFFER << 3)\n+#define NH_FLD_PAYLOAD_TYPE                   (NH_FLD_PAYLOAD_BUFFER << 4)\n+#define NH_FLD_FRAME_SIZE                     (NH_FLD_PAYLOAD_BUFFER << 5)\n+#define NH_FLD_PAYLOAD_ALL_FIELDS             ((NH_FLD_PAYLOAD_BUFFER << 6) - 1)\n+\n+/***************************  GRE fields  ************************************/\n+#define NH_FLD_GRE_TYPE                       (1)\n+#define NH_FLD_GRE_ALL_FIELDS                 ((NH_FLD_GRE_TYPE << 1) - 1)\n+\n+/***************************  MINENCAP fields  *******************************/\n+#define NH_FLD_MINENCAP_SRC_IP                (1)\n+#define NH_FLD_MINENCAP_DST_IP                (NH_FLD_MINENCAP_SRC_IP << 1)\n+#define NH_FLD_MINENCAP_TYPE                  (NH_FLD_MINENCAP_SRC_IP << 2)\n+#define NH_FLD_MINENCAP_ALL_FIELDS \\\n+\t((NH_FLD_MINENCAP_SRC_IP << 3) - 1)\n+\n+/***************************  IPSEC AH fields  *******************************/\n+#define NH_FLD_IPSEC_AH_SPI                   (1)\n+#define NH_FLD_IPSEC_AH_NH                    (NH_FLD_IPSEC_AH_SPI << 1)\n+#define NH_FLD_IPSEC_AH_ALL_FIELDS            ((NH_FLD_IPSEC_AH_SPI << 2) - 1)\n+\n+/***************************  IPSEC ESP fields  ******************************/\n+#define NH_FLD_IPSEC_ESP_SPI                  (1)\n+#define NH_FLD_IPSEC_ESP_SEQUENCE_NUM         (NH_FLD_IPSEC_ESP_SPI << 1)\n+#define NH_FLD_IPSEC_ESP_ALL_FIELDS           ((NH_FLD_IPSEC_ESP_SPI << 2) - 1)\n+\n+#define NH_FLD_IPSEC_ESP_SPI_SIZE             4\n+\n+/***************************  MPLS fields  ***********************************/\n+#define NH_FLD_MPLS_LABEL_STACK               (1)\n+#define NH_FLD_MPLS_LABEL_STACK_ALL_FIELDS \\\n+\t((NH_FLD_MPLS_LABEL_STACK << 1) - 1)\n+\n+/***************************  MACSEC fields  *********************************/\n+#define NH_FLD_MACSEC_SECTAG                  (1)\n+#define NH_FLD_MACSEC_ALL_FIELDS              ((NH_FLD_MACSEC_SECTAG << 1) - 1)\n+\n+/***************************  GTP fields  ************************************/\n+#define NH_FLD_GTP_TEID                       (1)\n+\n+/* Protocol options */\n+\n+/* Ethernet options */\n+#define\tNH_OPT_ETH_BROADCAST\t\t\t1\n+#define\tNH_OPT_ETH_MULTICAST\t\t\t2\n+#define\tNH_OPT_ETH_UNICAST\t\t\t3\n+#define\tNH_OPT_ETH_BPDU\t\t\t\t4\n+\n+#define NH_ETH_IS_MULTICAST_ADDR(addr) (addr[0] & 0x01)\n+/* also applicable for broadcast */\n+\n+/* VLAN options */\n+#define\tNH_OPT_VLAN_CFI\t\t\t\t1\n+\n+/* IPV4 options */\n+#define\tNH_OPT_IPV4_UNICAST\t\t\t1\n+#define\tNH_OPT_IPV4_MULTICAST\t\t\t2\n+#define\tNH_OPT_IPV4_BROADCAST\t\t\t3\n+#define\tNH_OPT_IPV4_OPTION\t\t\t4\n+#define\tNH_OPT_IPV4_FRAG\t\t\t5\n+#define\tNH_OPT_IPV4_INITIAL_FRAG\t\t6\n+\n+/* IPV6 options */\n+#define\tNH_OPT_IPV6_UNICAST\t\t\t1\n+#define\tNH_OPT_IPV6_MULTICAST\t\t\t2\n+#define\tNH_OPT_IPV6_OPTION\t\t\t3\n+#define\tNH_OPT_IPV6_FRAG\t\t\t4\n+#define\tNH_OPT_IPV6_INITIAL_FRAG\t\t5\n+\n+/* General IP options (may be used for any version) */\n+#define\tNH_OPT_IP_FRAG\t\t\t\t1\n+#define\tNH_OPT_IP_INITIAL_FRAG\t\t\t2\n+#define\tNH_OPT_IP_OPTION\t\t\t3\n+\n+/* Minenc. options */\n+#define\tNH_OPT_MINENCAP_SRC_ADDR_PRESENT\t1\n+\n+/* GRE. options */\n+#define\tNH_OPT_GRE_ROUTING_PRESENT\t\t1\n+\n+/* TCP options */\n+#define\tNH_OPT_TCP_OPTIONS\t\t\t1\n+#define\tNH_OPT_TCP_CONTROL_HIGH_BITS\t\t2\n+#define\tNH_OPT_TCP_CONTROL_LOW_BITS\t\t3\n+\n+/* CAPWAP options */\n+#define\tNH_OPT_CAPWAP_DTLS\t\t\t1\n+\n+enum net_prot {\n+\tNET_PROT_NONE = 0,\n+\tNET_PROT_PAYLOAD,\n+\tNET_PROT_ETH,\n+\tNET_PROT_VLAN,\n+\tNET_PROT_IPV4,\n+\tNET_PROT_IPV6,\n+\tNET_PROT_IP,\n+\tNET_PROT_TCP,\n+\tNET_PROT_UDP,\n+\tNET_PROT_UDP_LITE,\n+\tNET_PROT_IPHC,\n+\tNET_PROT_SCTP,\n+\tNET_PROT_SCTP_CHUNK_DATA,\n+\tNET_PROT_PPPOE,\n+\tNET_PROT_PPP,\n+\tNET_PROT_PPPMUX,\n+\tNET_PROT_PPPMUX_SUBFRM,\n+\tNET_PROT_L2TPV2,\n+\tNET_PROT_L2TPV3_CTRL,\n+\tNET_PROT_L2TPV3_SESS,\n+\tNET_PROT_LLC,\n+\tNET_PROT_LLC_SNAP,\n+\tNET_PROT_NLPID,\n+\tNET_PROT_SNAP,\n+\tNET_PROT_MPLS,\n+\tNET_PROT_IPSEC_AH,\n+\tNET_PROT_IPSEC_ESP,\n+\tNET_PROT_UDP_ENC_ESP, /* RFC 3948 */\n+\tNET_PROT_MACSEC,\n+\tNET_PROT_GRE,\n+\tNET_PROT_MINENCAP,\n+\tNET_PROT_DCCP,\n+\tNET_PROT_ICMP,\n+\tNET_PROT_IGMP,\n+\tNET_PROT_ARP,\n+\tNET_PROT_CAPWAP_DATA,\n+\tNET_PROT_CAPWAP_CTRL,\n+\tNET_PROT_RFC2684,\n+\tNET_PROT_ICMPV6,\n+\tNET_PROT_FCOE,\n+\tNET_PROT_FIP,\n+\tNET_PROT_ISCSI,\n+\tNET_PROT_GTP,\n+\tNET_PROT_USER_DEFINED_L2,\n+\tNET_PROT_USER_DEFINED_L3,\n+\tNET_PROT_USER_DEFINED_L4,\n+\tNET_PROT_USER_DEFINED_L5,\n+\tNET_PROT_USER_DEFINED_SHIM1,\n+\tNET_PROT_USER_DEFINED_SHIM2,\n+\n+\tNET_PROT_DUMMY_LAST\n+};\n+\n+/*! IEEE8021.Q */\n+#define NH_IEEE8021Q_ETYPE  0x8100\n+#define NH_IEEE8021Q_HDR(etype, pcp, dei, vlan_id)      \\\n+\t    ((((uint32_t)(etype & 0xFFFF)) << 16) |       \\\n+\t    (((uint32_t)(pcp & 0x07)) << 13) |          \\\n+\t    (((uint32_t)(dei & 0x01)) << 12) |          \\\n+\t    (((uint32_t)(vlan_id & 0xFFF))))\n+\n+#endif /* __FSL_NET_H */\n",
    "prefixes": [
        "dpdk-dev",
        "PATCHv8",
        "16/46"
    ]
}