aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDavid Decotigny <decot@google.com>2011-05-12 20:28:04 +0000
committerDavid S. Miller <davem@davemloft.net>2011-05-13 16:12:07 -0400
commit1334cb60826377de8f75adb9902c25302222f4fe (patch)
tree8e4e206a62b19ed2aa0f9c3a1e2370a46f6b1c7f /drivers
parent5310cbce900094dce5df4a671b411e15319a75d4 (diff)
stmmac: don't go through ethtool to start auto-negotiation
The driver used to call phy's ethtool configuration routine to start auto-negotiation. This change has it call directly phy's routine to start auto-negotiation. The initial version was hiding phy_start_aneg() return value, this patch returns it (<0 upon error). Tested: module compiles, tested on STM HDK7108 STB. Signed-off-by: David Decotigny <decot@google.com> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/stmmac/stmmac_ethtool.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/net/stmmac/stmmac_ethtool.c b/drivers/net/stmmac/stmmac_ethtool.c
index 6f5aaeb986f..9c05cf07a43 100644
--- a/drivers/net/stmmac/stmmac_ethtool.c
+++ b/drivers/net/stmmac/stmmac_ethtool.c
@@ -236,17 +236,8 @@ stmmac_set_pauseparam(struct net_device *netdev,
priv->flow_ctrl = new_pause;
if (phy->autoneg) {
- if (netif_running(netdev)) {
- struct ethtool_cmd cmd = { .cmd = ETHTOOL_SSET };
- /* auto-negotiation automatically restarted */
- cmd.supported = phy->supported;
- cmd.advertising = phy->advertising;
- cmd.autoneg = phy->autoneg;
- ethtool_cmd_speed_set(&cmd, phy->speed);
- cmd.duplex = phy->duplex;
- cmd.phy_address = phy->addr;
- ret = phy_ethtool_sset(phy, &cmd);
- }
+ if (netif_running(netdev))
+ ret = phy_start_aneg(phy);
} else
priv->hw->mac->flow_ctrl(priv->ioaddr, phy->duplex,
priv->flow_ctrl, priv->pause);