netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next 1/2 (V2)] stmmac: don't go through ethtool to start auto-negotiation
@ 2011-05-13  6:28 Giuseppe CAVALLARO
  2011-05-13  6:28 ` [net-next 2/2] stmmac: fix autoneg in set_pauseparam Giuseppe CAVALLARO
  2011-05-13 20:12 ` [net-next 1/2 (V2)] stmmac: don't go through ethtool to start auto-negotiation David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Giuseppe CAVALLARO @ 2011-05-13  6:28 UTC (permalink / raw)
  To: netdev; +Cc: David Decotigny, Giuseppe Cavallaro

From: David Decotigny <decot@google.com>

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>
---
 drivers/net/stmmac/stmmac_ethtool.c |   13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/net/stmmac/stmmac_ethtool.c b/drivers/net/stmmac/stmmac_ethtool.c
index 6f5aaeb..9c05cf0 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);
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [net-next 2/2] stmmac: fix autoneg in set_pauseparam
  2011-05-13  6:28 [net-next 1/2 (V2)] stmmac: don't go through ethtool to start auto-negotiation Giuseppe CAVALLARO
@ 2011-05-13  6:28 ` Giuseppe CAVALLARO
  2011-05-13 20:12   ` David Miller
  2011-05-13 20:12 ` [net-next 1/2 (V2)] stmmac: don't go through ethtool to start auto-negotiation David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Giuseppe CAVALLARO @ 2011-05-13  6:28 UTC (permalink / raw)
  To: netdev; +Cc: Giuseppe Cavallaro

This patch fixes a bug in the set_pauseparam
function that didn't well manage the ANE
field and returned broken values when use
ethtool -A|-a.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 drivers/net/stmmac/stmmac_ethtool.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/stmmac/stmmac_ethtool.c b/drivers/net/stmmac/stmmac_ethtool.c
index 9c05cf0..ae5213a 100644
--- a/drivers/net/stmmac/stmmac_ethtool.c
+++ b/drivers/net/stmmac/stmmac_ethtool.c
@@ -234,6 +234,7 @@ stmmac_set_pauseparam(struct net_device *netdev,
 		new_pause |= FLOW_TX;
 
 	priv->flow_ctrl = new_pause;
+	phy->autoneg = pause->autoneg;
 
 	if (phy->autoneg) {
 		if (netif_running(netdev))
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [net-next 1/2 (V2)] stmmac: don't go through ethtool to start auto-negotiation
  2011-05-13  6:28 [net-next 1/2 (V2)] stmmac: don't go through ethtool to start auto-negotiation Giuseppe CAVALLARO
  2011-05-13  6:28 ` [net-next 2/2] stmmac: fix autoneg in set_pauseparam Giuseppe CAVALLARO
@ 2011-05-13 20:12 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2011-05-13 20:12 UTC (permalink / raw)
  To: peppe.cavallaro; +Cc: netdev, decot

From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Date: Fri, 13 May 2011 08:28:04 +0200

> From: David Decotigny <decot@google.com>
> 
> 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>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [net-next 2/2] stmmac: fix autoneg in set_pauseparam
  2011-05-13  6:28 ` [net-next 2/2] stmmac: fix autoneg in set_pauseparam Giuseppe CAVALLARO
@ 2011-05-13 20:12   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2011-05-13 20:12 UTC (permalink / raw)
  To: peppe.cavallaro; +Cc: netdev

From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Date: Fri, 13 May 2011 08:28:05 +0200

> This patch fixes a bug in the set_pauseparam
> function that didn't well manage the ANE
> field and returned broken values when use
> ethtool -A|-a.
> 
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-13 20:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-13  6:28 [net-next 1/2 (V2)] stmmac: don't go through ethtool to start auto-negotiation Giuseppe CAVALLARO
2011-05-13  6:28 ` [net-next 2/2] stmmac: fix autoneg in set_pauseparam Giuseppe CAVALLARO
2011-05-13 20:12   ` David Miller
2011-05-13 20:12 ` [net-next 1/2 (V2)] stmmac: don't go through ethtool to start auto-negotiation David Miller

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).