brcm63xx: Add profile and build image for Sagemcom F@ST2704V2 ADSL router
[openwrt/openwrt.git] / target / linux / brcm63xx / patches-3.10 / 045-bcm63xx_enet-implement-reset-autoneg-ethtool-callbac.patch
1 From a15c33450df64f183c8ab5de8ef113091081679d Mon Sep 17 00:00:00 2001
2 From: Maxime Bizon <mbizon@freebox.fr>
3 Date: Tue, 4 Jun 2013 20:53:33 +0000
4 Subject: [PATCH 1/3] bcm63xx_enet: implement reset autoneg ethtool callback
5
6 Implement the rset_nway ethtool callback which uses libphy generic
7 autonegotiation restart function.
8
9 Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
10 ---
11 drivers/net/ethernet/broadcom/bcm63xx_enet.c | 15 +++++++++++++++
12 1 file changed, 15 insertions(+)
13
14 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
15 +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
16 @@ -1328,6 +1328,20 @@ static void bcm_enet_get_ethtool_stats(s
17 mutex_unlock(&priv->mib_update_lock);
18 }
19
20 +static int bcm_enet_nway_reset(struct net_device *dev)
21 +{
22 + struct bcm_enet_priv *priv;
23 +
24 + priv = netdev_priv(dev);
25 + if (priv->has_phy) {
26 + if (!priv->phydev)
27 + return -ENODEV;
28 + return genphy_restart_aneg(priv->phydev);
29 + }
30 +
31 + return -EOPNOTSUPP;
32 +}
33 +
34 static int bcm_enet_get_settings(struct net_device *dev,
35 struct ethtool_cmd *cmd)
36 {
37 @@ -1470,6 +1484,7 @@ static const struct ethtool_ops bcm_enet
38 .get_strings = bcm_enet_get_strings,
39 .get_sset_count = bcm_enet_get_sset_count,
40 .get_ethtool_stats = bcm_enet_get_ethtool_stats,
41 + .nway_reset = bcm_enet_nway_reset,
42 .get_settings = bcm_enet_get_settings,
43 .set_settings = bcm_enet_set_settings,
44 .get_drvinfo = bcm_enet_get_drvinfo,