From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0053.outbound.protection.outlook.com [104.47.41.53]) by dpdk.org (Postfix) with ESMTP id 47546325D for ; Mon, 15 May 2017 14:38:25 +0200 (CEST) Received: from BN3PR03CA0114.namprd03.prod.outlook.com (10.174.66.32) by BN1PR03MB169.namprd03.prod.outlook.com (10.255.200.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16; Mon, 15 May 2017 12:38:23 +0000 Received: from BL2FFO11FD037.protection.gbl (2a01:111:f400:7c09::161) by BN3PR03CA0114.outlook.office365.com (2603:10b6:400:4::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16 via Frontend Transport; Mon, 15 May 2017 12:38:23 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD037.mail.protection.outlook.com (10.173.161.133) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1075.5 via Frontend Transport; Mon, 15 May 2017 12:38:23 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v4FCbxO1003970; Mon, 15 May 2017 05:38:21 -0700 From: Hemant Agrawal To: CC: , Date: Mon, 15 May 2017 18:07:36 +0530 Message-ID: <1494851864-26029-14-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1494851864-26029-1-git-send-email-hemant.agrawal@nxp.com> References: <1492607395-5922-1-git-send-email-hemant.agrawal@nxp.com> <1494851864-26029-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131393255036034610; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39840400002)(39380400002)(39850400002)(39410400002)(39400400002)(39860400002)(39450400003)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(9170700003)(5660300001)(498600001)(85426001)(305945005)(81166006)(2906002)(189998001)(8936002)(2351001)(5003940100001)(33646002)(6916009)(86362001)(6666003)(36756003)(4326008)(575784001)(2950100002)(8676002)(104016004)(50226002)(106466001)(77096006)(68736007)(110136004)(48376002)(50466002)(105606002)(47776003)(356003)(54906002)(76176999)(38730400002)(8656002)(50986999)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR03MB169; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD037; 1:k3Nxvzxlji/UOCIuO7lVOZzWhOxXVuLpkoB7K85NW8UZhfijho/0sZWGbTFPjgecSB8ioCdQyFY0UPemPUTnbv6bBqx8epIKqdsS/hpTPIQclnnQt+ITin4BZiqYo4AWAz3VrCmBVpttyZHll/ujuUFBuL75Ksli0eLPUqZCUcPbxCnwUfMaadGbN1U6u7N192zFgr/2cM30F1n/gQz4hUNK+FamAvPxuPCZ7exZaePSMU1epqoWb3mSWKe+EhIdNroQqgbhw3Z02Kn5JpCwPD/9rxEEQXLbSmo4Wkavo3Qr3BZhBS4AVYu7AMsyki+3c579liMWxVNFbDGjIZS7sOSJ2OrRRNR5ivx58xrZ0EnAkqmxZ8ixMtvAKmJti+Tpkrb6ju8hvL/+lwhiagc7UeXIQlNG5lPEecqRmGcANwCrzYQfUSu2J2HY18vtYgjhpujIkYFZlyfA5bcvxIKf/k5U1PcQsCHu6MsjaeTcYJpkZJuxDR6mVwuEvgu75DSxIAXjC9+chTf7Ikh1AeGZ76Plo5FcmzKzL36Xw5qVdgKPI2oDOXlg6jxrlON2xnSTKLt2G4EqSmSPjs7+P2QpVvZr2q2nWQbZkII54uwh8thRwlRvqMVoArdFtdMeXAFe1WpcVNohfpmrPdf/7BaBV+TUG0dJ5gbWHZsPNNE4gG9G6uOuNPmwOROVYTXA252ILC0eZ7xC4uY8F+mKXVoD7wB6QScw0QGcNFQnWs4n8NIsYss93jn830N7lBsULrEiE50et8s1b7rInMiv1LR0TQ== MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f8cc8df3-1c82-4f5b-1e32-08d49b8f46c5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BN1PR03MB169; X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB169; 3:XR1ZRPn+nj6StVUA6uh6m2ZoVO6f/7PAk6GYCniKZkJJ2h1Eo9fhZCbNTN8kpq4n+UA9zxLGqXM23Nu7aUPSJ+3sqLoeSARvva29FOfE9N9xGlXnNjPoyVmGHKrMGO933Aw7nQ/rm/cr2vJpexnfKCqAXiMsVyF5xb2xkZ9y8bugWKenaxkwn4Fwszw1iz+CjFoyCKuB9bFosgRUbE+Uh6oVJrgxugQFvZD5IYD8GHHdBJ9eXt2PEAI+T02durjW3rlSNd8MvamARz6/TW/BwWF3ofcC9bqCuTeM7z2MTJmyC9bobHmi+s9dwNljrEGfh8/VVQazpwrZyYB40BgaOFQLlbb6E9rE+9MH46xECIgEaB2GWxoyTJiX1jM6fY9VJ47qN0VM9IPByOIuURlYfDPpQkA0N7+BqQn5gxl9d26gRSLEMUk08fU/FMmpDzj9; 25:X5Bzt+LaOW/8VsVyqxLv/qzOHMxls4l19buHLFbgnc//Tg8Krxpy3dvV4Tuy9vN5803ZFR/NYHS3XELIwgXIzyUyrdYRM8mgs4G9yWp1dnuD+HA9g56BAhzLZzLMD9shMcI/KX5aEY//Wf9PplhffLg56XcIT717FV04qTIoeMm+5ry/uP355QKHpct2AoQdgx7aXZDAs9W1cgRqbgG0xB1nBHbTt+URyoB2u5n0Oop4evY1PZY/5YQ6kzQ/MekXjwwwyA2DKeA5riCGb2+BOa+Drh11iJr87UAgKu/A1XgXje1GH8g7eZ+a+fmFWKaknnsNaf1nigFmshkVrUhWZoJYgo2zCH/7iwv2Xs53ni1VQm8dzF7hPrPa8SIR7qz+g/dZN22h2lVAUNW+io1agL5OnPsw2vMP/xYMJ97A4HvWK2SALxGGNk9MGB+NVROWMibh1KRq8rO2KbwlURizUA== X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB169; 31:CNr2v7b0XhsLGPUFqoLlMzeg2/AkPrC32qB2FS9g062wsg+P1/7FTWBv0rRs8GZYaxf1sxVc4nH96y7SxnhGZWoF7AoA3YrMWgMIVyNILeYxaSYCJJ1YB8a8pGx2mwyg1S1PRv+sKptDLuc8f9a9Xjj1epcBEzFyYlsnrgnDIlzexn/XbCK4a5947VStaE5rq0JjWFF50YF7PoMc6b7T0gJ1yXl/da9v7w9zVL4BrHZXv3l8Ap5KZY78WnH7j7X3yxvcLDvWT26bng7qSgVXYg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(13023025)(13024025)(13018025)(13015025)(5005006)(8121501046)(13017025)(3002001)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123561025)(20161123565025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123556025)(20161123559100)(20161123563025); SRVR:BN1PR03MB169; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR03MB169; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR03MB169; 4:mFi2FsO9QdS8dbaojmo1hOmUR0nUCKUM83/eCbe2/sI?= =?us-ascii?Q?gKWfyAmkKKvP6Zk3wIabyUJEiWwEhnb18c3Xv+g0kyBgWmnaHAYrXnUYID74?= =?us-ascii?Q?RvHd5oT/Fzl3yraCvSNqwicnXHAubo0F87CUFvXDJhRLYd5nVno9rxBAN9mC?= =?us-ascii?Q?EFJojaN01c/GnIrLXDyrArvWL0k6r9qfdCHeuC5XMyE+lCUAvb5kpIhhdxxh?= =?us-ascii?Q?dUBzsOvyKkxnYMZn4ZPaF7eBzqtkcqg2G7JQoxsTHvLkoDCqBVaXKlFlUZmI?= =?us-ascii?Q?rA5+U2WDH0wS+LwWd/b09BtpnTKBnE7WQOYcPuIj8HjSFH44lBr++cpJPZUU?= =?us-ascii?Q?1jJTn+sxd3swlQW2BqoIjQ9f3LyDpbPqxejGlb2NfsLnYxDbxbJiqSVPMBF/?= =?us-ascii?Q?QuS9jY8oKT8D+IlX+Nd/r34VZ97qy+PG/DXTuOFBqls/T/9JGDnWX4JAu50j?= =?us-ascii?Q?m2Xra7dlRpT2xH4Wj4PoqnJcE38Chokb0TST63rN1XOBG+t/6wnBOhskE5lA?= =?us-ascii?Q?5x+gwnC8A8392LkxEQTdWEDCe+JaczS+P74OBpF3eyWlLfpqXdGlBLFxVJ87?= =?us-ascii?Q?xrG/lAH6+GyeSKEP8V6dLXut2INb8ceANyR4YwXaMR7tRF6TqmlTZ62IWUSm?= =?us-ascii?Q?ZkFY8RqdGn7YUOHdYZvqGrBjZnALTFTTxxch4YuIbZDN1eKlVo90oe4YHZNt?= =?us-ascii?Q?sZsNdSuGubMG9X7R5Hdk0jSiaupWs6SIP1VYUnlD7+4nL7rsf6vMy4MUEd/r?= =?us-ascii?Q?++JJstTiNBFPlDowEfdF6XpBQBd0n9iWdD50U8MXSPnKPcnT5Jd9NiZsakRK?= =?us-ascii?Q?YKszx9h3PrsNrllyf3DGEiFIVk2FkQF6zfS7tQhfvcSiP3wkE/uz+j+VItXW?= =?us-ascii?Q?Q1E2JBhHyNU+maMJzJ+cY6tlZpSg2g4W09Hx9mlqONkjUj+Ki/Li035oS1d6?= =?us-ascii?Q?L2/9uIclMWUMcFpvOVfebn/AtZw5nL/iNoiGBYdQiprMIsliBRZEwQz5tKGA?= =?us-ascii?Q?=3D?= X-Forefront-PRVS: 0308EE423E X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR03MB169; 23:wNLLFg6biqa+TlysXB71u8RG3yWTNUiYzd0cchrYf3?= =?us-ascii?Q?sWX7GNURTUF65Jp7m0EJKt1exh3i/4TIaDlzt35WP4Z2kfv0KtUNxK9Vf3Xa?= =?us-ascii?Q?2s9tMJJ1oGdxqABsXJVeEfSqliEkxWzKF1biJzqAWH86sHIr4SzgLDZxlJuE?= =?us-ascii?Q?vTK7ZhqirsQ1oG4NdDc+RNywhgVU/rOUJmlNC+/SI8yZMvPyJAICj2FakF1W?= =?us-ascii?Q?gOeyCx3VmggPp6LxNEURlwhtJ6LPiW7gAHHflDKfh4YuRr22Z8haxQZ8pdZP?= =?us-ascii?Q?y6WEMFUqTMaIEycA3qDDEKFJYFOz02BKvNq53UxLFaUKU6ywZftVh7TgCkGq?= =?us-ascii?Q?vPdKRnr2whgxlUBV7RQ1jttKmE7Fs3c9lzCV2CUnlr+0S1ESliLKQI6DqmDO?= =?us-ascii?Q?txFSmoDaZPXhXOHMtCojbW21XhwK0V7RVipf3KOWLrh7KDeLht69Y+WgMdIJ?= =?us-ascii?Q?jyw0EHu247LVEF00SyzBnCspbr9bahZ6JgSJMWT3gVKUjGC5kdmY7MFS3rUU?= =?us-ascii?Q?yeMDPowf3R6aSvBULjHydAoJS7ru06RBUvEAxWF3JCvhkNo6oZsED6K83QWy?= =?us-ascii?Q?G5nZdXklUJiW/zu3kEhB31tyuDZxvps+PhPbwc1ny0TU1H1dMJ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-OriginalArrivalTime: 15 May 2017 12:38:23.4474 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR03MB169 Subject: [dpdk-dev] [PATCH v2 12/20] net/dpaa2: add support for multicast promiscuous mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 May 2017 12:38:26 -0000 Signed-off-by: Hemant Agrawal --- doc/guides/nics/features/dpaa2.ini | 1 + drivers/net/dpaa2/dpaa2_ethdev.c | 61 +++++++++++++++++++++++++++++++++++-- drivers/net/dpaa2/mc/dpni.c | 41 +++++++++++++++++++++++++ drivers/net/dpaa2/mc/fsl_dpni.h | 27 ++++++++++++++++ drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 10 ++++++ 5 files changed, 138 insertions(+), 2 deletions(-) diff --git a/doc/guides/nics/features/dpaa2.ini b/doc/guides/nics/features/dpaa2.ini index 470853c..dddf0e0 100644 --- a/doc/guides/nics/features/dpaa2.ini +++ b/doc/guides/nics/features/dpaa2.ini @@ -8,6 +8,7 @@ Link status = Y Queue start/stop = Y MTU update = Y Promiscuous mode = Y +Allmulticast mode = Y Unicast MAC filter = Y RSS hash = Y L3 checksum offload = Y diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 5180871..22e0474 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -617,7 +617,11 @@ ret = dpni_set_unicast_promisc(dpni, CMD_PRI_LOW, priv->token, true); if (ret < 0) - RTE_LOG(ERR, PMD, "Unable to enable promiscuous mode %d", ret); + RTE_LOG(ERR, PMD, "Unable to enable U promisc mode %d", ret); + + ret = dpni_set_multicast_promisc(dpni, CMD_PRI_LOW, priv->token, true); + if (ret < 0) + RTE_LOG(ERR, PMD, "Unable to enable M promisc mode %d", ret); } static void @@ -637,7 +641,58 @@ ret = dpni_set_unicast_promisc(dpni, CMD_PRI_LOW, priv->token, false); if (ret < 0) - RTE_LOG(ERR, PMD, "Unable to disable promiscuous mode %d", ret); + RTE_LOG(ERR, PMD, "Unable to disable U promisc mode %d", ret); + + if (dev->data->all_multicast == 0) { + ret = dpni_set_multicast_promisc(dpni, CMD_PRI_LOW, + priv->token, false); + if (ret < 0) + RTE_LOG(ERR, PMD, "Unable to disable M promisc mode %d", + ret); + } +} + +static void +dpaa2_dev_allmulticast_enable( + struct rte_eth_dev *dev) +{ + int ret; + struct dpaa2_dev_priv *priv = dev->data->dev_private; + struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; + + PMD_INIT_FUNC_TRACE(); + + if (dpni == NULL) { + RTE_LOG(ERR, PMD, "dpni is NULL"); + return; + } + + ret = dpni_set_multicast_promisc(dpni, CMD_PRI_LOW, priv->token, true); + if (ret < 0) + RTE_LOG(ERR, PMD, "Unable to enable multicast mode %d", ret); +} + +static void +dpaa2_dev_allmulticast_disable(struct rte_eth_dev *dev) +{ + int ret; + struct dpaa2_dev_priv *priv = dev->data->dev_private; + struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; + + PMD_INIT_FUNC_TRACE(); + + if (dpni == NULL) { + RTE_LOG(ERR, PMD, "dpni is NULL"); + return; + } + + /* must remain on for all promiscuous */ + if (dev->data->promiscuous == 1) + return; + + ret = dpni_set_multicast_promisc(dpni, CMD_PRI_LOW, priv->token, false); + if (ret < 0) + RTE_LOG(ERR, PMD, "Unable to disable multicast mode %d", ret); } static int @@ -888,6 +943,8 @@ void dpaa2_dev_stats_reset(struct rte_eth_dev *dev) .dev_close = dpaa2_dev_close, .promiscuous_enable = dpaa2_dev_promiscuous_enable, .promiscuous_disable = dpaa2_dev_promiscuous_disable, + .allmulticast_enable = dpaa2_dev_allmulticast_enable, + .allmulticast_disable = dpaa2_dev_allmulticast_disable, .link_update = dpaa2_dev_link_update, .stats_get = dpaa2_dev_stats_get, .stats_reset = dpaa2_dev_stats_reset, diff --git a/drivers/net/dpaa2/mc/dpni.c b/drivers/net/dpaa2/mc/dpni.c index 38c5f3f..54a1568 100644 --- a/drivers/net/dpaa2/mc/dpni.c +++ b/drivers/net/dpaa2/mc/dpni.c @@ -509,6 +509,47 @@ int dpni_get_max_frame_length(struct fsl_mc_io *mc_io, return 0; } +int dpni_set_multicast_promisc(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int en) +{ + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_MCAST_PROMISC, + cmd_flags, + token); + DPNI_CMD_SET_MULTICAST_PROMISC(cmd, en); + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +int dpni_get_multicast_promisc(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int *en) +{ + struct mc_command cmd = { 0 }; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_MCAST_PROMISC, + cmd_flags, + token); + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + DPNI_RSP_GET_MULTICAST_PROMISC(cmd, *en); + + return 0; +} + int dpni_set_unicast_promisc(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, diff --git a/drivers/net/dpaa2/mc/fsl_dpni.h b/drivers/net/dpaa2/mc/fsl_dpni.h index ae18b5a..03519fa 100644 --- a/drivers/net/dpaa2/mc/fsl_dpni.h +++ b/drivers/net/dpaa2/mc/fsl_dpni.h @@ -797,6 +797,33 @@ int dpni_get_max_frame_length(struct fsl_mc_io *mc_io, uint16_t token, uint16_t *max_frame_length); +/** + * dpni_set_multicast_promisc() - Enable/disable multicast promiscuous mode + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @en: Set to '1' to enable; '0' to disable + * + * Return: '0' on Success; Error code otherwise. + */ +int dpni_set_multicast_promisc(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int en); + +/** + * dpni_get_multicast_promisc() - Get multicast promiscuous mode + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @en: Returns '1' if enabled; '0' otherwise + * + * Return: '0' on Success; Error code otherwise. + */ +int dpni_get_multicast_promisc(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + int *en); /** * dpni_set_unicast_promisc() - Enable/disable unicast promiscuous mode diff --git a/drivers/net/dpaa2/mc/fsl_dpni_cmd.h b/drivers/net/dpaa2/mc/fsl_dpni_cmd.h index 1ae734a..bd2bb3f 100644 --- a/drivers/net/dpaa2/mc/fsl_dpni_cmd.h +++ b/drivers/net/dpaa2/mc/fsl_dpni_cmd.h @@ -65,6 +65,8 @@ #define DPNI_CMDID_SET_MAX_FRAME_LENGTH ((0x216 << 4) | (0x1)) #define DPNI_CMDID_GET_MAX_FRAME_LENGTH ((0x217 << 4) | (0x1)) +#define DPNI_CMDID_SET_MCAST_PROMISC ((0x220 << 4) | (0x1)) +#define DPNI_CMDID_GET_MCAST_PROMISC ((0x221 << 4) | (0x1)) #define DPNI_CMDID_SET_UNICAST_PROMISC ((0x222 << 4) | (0x1)) #define DPNI_CMDID_GET_UNICAST_PROMISC ((0x223 << 4) | (0x1)) #define DPNI_CMDID_SET_PRIM_MAC ((0x224 << 4) | (0x1)) @@ -247,6 +249,14 @@ MC_RSP_OP(cmd, 0, 0, 16, uint16_t, max_frame_length) /* cmd, param, offset, width, type, arg_name */ +#define DPNI_CMD_SET_MULTICAST_PROMISC(cmd, en) \ + MC_CMD_OP(cmd, 0, 0, 1, int, en) + +/* cmd, param, offset, width, type, arg_name */ +#define DPNI_RSP_GET_MULTICAST_PROMISC(cmd, en) \ + MC_RSP_OP(cmd, 0, 0, 1, int, en) + +/* cmd, param, offset, width, type, arg_name */ #define DPNI_CMD_SET_UNICAST_PROMISC(cmd, en) \ MC_CMD_OP(cmd, 0, 0, 1, int, en) -- 1.9.1