lkml.org 
[lkml]   [2011]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 1/2] net/stmmac: don't go through ethtool to start autonegociation
On 5/10/2011 3:47 PM, Giuseppe CAVALLARO wrote:
> On 5/10/2011 2:19 AM, David Decotigny wrote:
>> The driver used to call phy's ethtool configuration routine to start
>> autonegociation. This change has it call directly phy's routine to
>> start autonegociation.
>>
>> IMPORTANT: initial version was hiding phy_start_aneg() return value,
>> this patch returns it (<0 upon error).
>>
>> Tested: module compiles, NOT tested on real hardware.
>> Signed-off-by: David Decotigny <decot@google.com>
>
> Sorry for the delay, I'm doing some tests with the stmmac on a "real"
> HW. I'll come back asap.


Hello.

I've tested the patch and, as discussed with David, I have sent it again
plus a new fix in the stmmac_set_pauseparam I have done while testing
ethtool -A|-a on my ST box.

Best Regards,
Peppe

>
> Regards
> Peppe
>
>> ---
>> 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);
>
> --
> 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
>



\
 
 \ /
  Last update: 2011-05-13 08:33    [W:0.267 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site