Patchwork [v2,3/3] net: stmmac: add gmac autonego set for ethtool support

login
register
mail settings
Submitter Byungho An
Date Jan. 10, 2013, 11:54 p.m.
Message ID <003d01cdef8d$d25b2bf0$771183d0$@samsung.com>
Download mbox | patch
Permalink /patch/211165/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Byungho An - Jan. 10, 2013, 11:54 p.m.
This patch adds gmac auto-negotiation setting for ethtool.
If interface is SGMII, TBI or RTBI, gmac's auto-negotiation
enable bit is need to set.

Signed-off-by: Byungho An <bh74.an@samsung.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c |    5 +++++
 1 file changed, 5 insertions(+)
David Miller - Jan. 10, 2013, 11:57 p.m.
From: Byungho An <bh74.an@samsung.com>
Date: Thu, 10 Jan 2013 15:54:24 -0800

> @@ -348,6 +349,10 @@ stmmac_set_pauseparam(struct net_device *netdev,
>  
>  	if (phy->autoneg) {
>  		if (netif_running(netdev))
> +			if((interface == PHY_INTERFACE_MODE_SGMII) ||
> +			   (interface == PHY_INTERFACE_MODE_TBI) ||
> +			   (interface == PHY_INTERFACE_MODE_RTBI)) 
> +				priv->hw->mac->set_autoneg(priv->ioaddr);

This is still not properly formatted.

You also didn't submit this properly.  Never use email thread replies
to submit new versions of patches.

Always use fresh, new, mailing list postings to submit new versions
of patches.

Also, when one patch has to change in a series, you must reubmit
the entire set of patches even if some of them have no changes
at all.  I do not see patch #2 here at all.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
index 1372ce2..457c1a4 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
@@ -335,6 +335,7 @@  stmmac_set_pauseparam(struct net_device *netdev,
 	struct phy_device *phy = priv->phydev;
 	int new_pause = FLOW_OFF;
 	int ret = 0;
+	int interface = priv->plat->interface;
 
 	spin_lock(&priv->lock);
 
@@ -348,6 +349,10 @@  stmmac_set_pauseparam(struct net_device *netdev,
 
 	if (phy->autoneg) {
 		if (netif_running(netdev))
+			if((interface == PHY_INTERFACE_MODE_SGMII) ||
+			   (interface == PHY_INTERFACE_MODE_TBI) ||
+			   (interface == PHY_INTERFACE_MODE_RTBI)) 
+				priv->hw->mac->set_autoneg(priv->ioaddr);
 			ret = phy_start_aneg(phy);
 	} else
 		priv->hw->mac->flow_ctrl(priv->ioaddr, phy->duplex,