Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1334cb60 authored by David Decotigny's avatar David Decotigny Committed by David S. Miller
Browse files

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: default avatarDavid Decotigny <decot@google.com>
Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5310cbce
Loading
Loading
Loading
Loading
+2 −11
Original line number Original line Diff line number Diff line
@@ -236,17 +236,8 @@ stmmac_set_pauseparam(struct net_device *netdev,
	priv->flow_ctrl = new_pause;
	priv->flow_ctrl = new_pause;


	if (phy->autoneg) {
	if (phy->autoneg) {
		if (netif_running(netdev)) {
		if (netif_running(netdev))
			struct ethtool_cmd cmd = { .cmd = ETHTOOL_SSET };
			ret = phy_start_aneg(phy);
			/* 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);
		}
	} else
	} else
		priv->hw->mac->flow_ctrl(priv->ioaddr, phy->duplex,
		priv->hw->mac->flow_ctrl(priv->ioaddr, phy->duplex,
					 priv->flow_ctrl, priv->pause);
					 priv->flow_ctrl, priv->pause);