Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1520698 > unrolled thread
| Started by | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| First post | 2016-11-13 22:30 +0100 |
| Last post | 2016-11-13 23:20 +0100 |
| Articles | 4 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] net: stmmac: Add support for ethtool::nway_reset Florian Fainelli <f.fainelli@gmail.com> - 2016-11-13 22:30 +0100
Re: [PATCH] net: stmmac: Add support for ethtool::nway_reset Florian Fainelli <f.fainelli@gmail.com> - 2016-11-13 22:40 +0100
Re: [PATCH] net: stmmac: Add support for ethtool::nway_reset David Miller <davem@davemloft.net> - 2016-11-14 22:40 +0100
Re: [PATCH] net: stmmac: Add support for ethtool::nway_reset kbuild test robot <lkp@intel.com> - 2016-11-13 23:20 +0100
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Date | 2016-11-13 22:30 +0100 |
| Subject | [PATCH] net: stmmac: Add support for ethtool::nway_reset |
| Message-ID | <sDavE-5Ow-75@gated-at.bofh.it> |
If we have a PHY device, just invoke genphy_restart_aneg() to restart
auto-negotiation.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
index 3fe9340b748f..7a487c9ccdea 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
@@ -862,6 +862,16 @@ static int stmmac_set_tunable(struct net_device *dev,
return ret;
}
+static int stmmac_nway_reset(struct net_device *dev)
+{
+ struct stmmac_priv *priv = netdev_priv(dev);
+
+ if (!dev->phydev)
+ return -ENODEV;
+
+ return genphy_restart_aneg(dev->phydev);
+}
+
static const struct ethtool_ops stmmac_ethtool_ops = {
.begin = stmmac_check_if_running,
.get_drvinfo = stmmac_ethtool_getdrvinfo,
@@ -886,6 +896,7 @@ static const struct ethtool_ops stmmac_ethtool_ops = {
.set_tunable = stmmac_set_tunable,
.get_link_ksettings = stmmac_ethtool_get_link_ksettings,
.set_link_ksettings = stmmac_ethtool_set_link_ksettings,
+ .nway_reset = stmmac_nway_reset,
};
void stmmac_set_ethtool_ops(struct net_device *netdev)
--
2.9.3
[toc] | [next] | [standalone]
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Date | 2016-11-13 22:40 +0100 |
| Message-ID | <sDaFj-5Sc-15@gated-at.bofh.it> |
| In reply to | #1520698 |
Le 13/11/2016 à 13:24, Florian Fainelli a écrit : > If we have a PHY device, just invoke genphy_restart_aneg() to restart > auto-negotiation. > > Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> David, please drop this patch for now, since I have another one pending which is going to touch the net_device/phydev interaction, this one also causes a build warning since priv is not used. Thank you! -- Florian
[toc] | [prev] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2016-11-14 22:40 +0100 |
| Message-ID | <sDx8S-3Zy-15@gated-at.bofh.it> |
| In reply to | #1520699 |
From: Florian Fainelli <f.fainelli@gmail.com> Date: Sun, 13 Nov 2016 13:35:04 -0800 > Le 13/11/2016 à 13:24, Florian Fainelli a écrit : >> If we have a PHY device, just invoke genphy_restart_aneg() to restart >> auto-negotiation. >> >> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> > > David, please drop this patch for now, since I have another one pending > which is going to touch the net_device/phydev interaction, this one also > causes a build warning since priv is not used. Ok, thanks for letting me know.
[toc] | [prev] | [next] | [standalone]
| From | kbuild test robot <lkp@intel.com> |
|---|---|
| Date | 2016-11-13 23:20 +0100 |
| Message-ID | <sDbi2-6pp-9@gated-at.bofh.it> |
| In reply to | #1520698 |
[Multipart message — attachments visible in raw view] — view raw
Hi Florian,
[auto build test WARNING on net-next/master]
[also build test WARNING on next-20161111]
[cannot apply to v4.9-rc5]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Florian-Fainelli/net-stmmac-Add-support-for-ethtool-nway_reset/20161114-053015
config: x86_64-kexec (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All warnings (new ones prefixed by >>):
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c: In function 'stmmac_nway_reset':
>> drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c:867:22: warning: unused variable 'priv' [-Wunused-variable]
struct stmmac_priv *priv = netdev_priv(dev);
^~~~
vim +/priv +867 drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
851 int ret = 0;
852
853 switch (tuna->id) {
854 case ETHTOOL_RX_COPYBREAK:
855 priv->rx_copybreak = *(u32 *)data;
856 break;
857 default:
858 ret = -EINVAL;
859 break;
860 }
861
862 return ret;
863 }
864
865 static int stmmac_nway_reset(struct net_device *dev)
866 {
> 867 struct stmmac_priv *priv = netdev_priv(dev);
868
869 if (!dev->phydev)
870 return -ENODEV;
871
872 return genphy_restart_aneg(dev->phydev);
873 }
874
875 static const struct ethtool_ops stmmac_ethtool_ops = {
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web