From: Ioana Radulescu <ruxandra.radulescu@nxp.com>
To: gregkh@linuxfoundation.org
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH 6/9] staging: fsl-dpaa2/eth: Change link settings on the fly
Date: Fri, 23 Mar 2018 08:44:10 -0500 [thread overview]
Message-ID: <20180323134413.1532-7-ruxandra.radulescu@nxp.com> (raw)
In-Reply-To: <20180323134413.1532-1-ruxandra.radulescu@nxp.com>
Newer MC versions allow us to change link settings while the
interface is up. Only check interface status if we are using
an old version.
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
---
drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
index dfbfa94..bfc8b64 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
@@ -119,6 +119,8 @@ dpaa2_eth_get_link_ksettings(struct net_device *net_dev,
return err;
}
+#define DPNI_DYNAMIC_LINK_SET_VER_MAJOR 7
+#define DPNI_DYNAMIC_LINK_SET_VER_MINOR 1
static int
dpaa2_eth_set_link_ksettings(struct net_device *net_dev,
const struct ethtool_link_ksettings *link_settings)
@@ -127,15 +129,16 @@ dpaa2_eth_set_link_ksettings(struct net_device *net_dev,
struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
int err = 0;
- netdev_dbg(net_dev, "Setting link parameters...");
-
- /* Due to a temporary MC limitation, the DPNI must be down
+ /* If using an older MC version, the DPNI must be down
* in order to be able to change link settings. Taking steps to let
* the user know that.
*/
- if (netif_running(net_dev)) {
- netdev_info(net_dev, "Sorry, interface must be brought down first.\n");
- return -EACCES;
+ if (dpaa2_eth_cmp_dpni_ver(priv, DPNI_DYNAMIC_LINK_SET_VER_MAJOR,
+ DPNI_DYNAMIC_LINK_SET_VER_MINOR) < 0) {
+ if (netif_running(net_dev)) {
+ netdev_info(net_dev, "Interface must be brought down first.\n");
+ return -EACCES;
+ }
}
cfg.rate = link_settings->base.speed;
--
2.7.4
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
next prev parent reply other threads:[~2018-03-23 13:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-23 13:44 [PATCH 0/9] staging: fsl-dpaa2/eth: Cleanup Ioana Radulescu
2018-03-23 13:44 ` [PATCH 1/9] staging: fsl-dpaa2/eth: Use generic irq handler Ioana Radulescu
2018-03-23 13:44 ` [PATCH 2/9] staging: fsl-dpaa2/eth: Move print message Ioana Radulescu
2018-03-23 15:01 ` Greg KH
2018-03-23 15:03 ` Ruxandra Ioana Ciocoi Radulescu
2018-03-23 15:06 ` Greg KH
2018-03-23 13:44 ` [PATCH 3/9] staging: fsl-dpaa2/eth: Remove unused field Ioana Radulescu
2018-03-23 13:44 ` [PATCH 4/9] staging: fsl-dpaa2/eth: Remove packed attribute Ioana Radulescu
2018-03-23 13:44 ` [PATCH 5/9] staging: fsl-dpaa2/eth: Add DPNI version check Ioana Radulescu
2018-03-23 13:44 ` Ioana Radulescu [this message]
2018-03-23 13:44 ` [PATCH 7/9] staging: fsl-dpaa2/eth: Cleanup TX frame freeing code Ioana Radulescu
2018-03-23 13:44 ` [PATCH 8/9] staging: fsl-dpaa2/eth: Fix SGT allocation Ioana Radulescu
2018-03-23 13:44 ` [PATCH 9/9] staging: fsl-dpaa2/eth: Change max number of Tx queues Ioana Radulescu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180323134413.1532-7-ruxandra.radulescu@nxp.com \
--to=ruxandra.radulescu@nxp.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).