bcm63xx: add support for linux 3.8
[openwrt/svn-archive/archive.git] / target / linux / brcm63xx / patches-3.8 / 411-bcm63xx_enet-implement-reset_autoneg-ethtool.patch
1 From accc558f334662c8b16c121b4819931c028e8eb0 Mon Sep 17 00:00:00 2001
2 From: Maxime Bizon <mbizon@freebox.fr>
3 Date: Mon, 8 Jun 2009 16:12:10 +0200
4 Subject: [PATCH 27/63] bcm63xx_enet: implement reset_autoneg ethtool.
5
6 ---
7 drivers/net/ethernet/broadcom/bcm63xx_enet.c | 15 +++++++++++++++
8 1 files changed, 15 insertions(+), 0 deletions(-)
9
10 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
11 +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
12 @@ -1290,6 +1290,20 @@ static void bcm_enet_get_ethtool_stats(s
13 mutex_unlock(&priv->mib_update_lock);
14 }
15
16 +static int bcm_enet_nway_reset(struct net_device *dev)
17 +{
18 + struct bcm_enet_priv *priv;
19 +
20 + priv = netdev_priv(dev);
21 + if (priv->has_phy) {
22 + if (!priv->phydev)
23 + return -ENODEV;
24 + return genphy_restart_aneg(priv->phydev);
25 + }
26 +
27 + return -EOPNOTSUPP;
28 +}
29 +
30 static int bcm_enet_get_settings(struct net_device *dev,
31 struct ethtool_cmd *cmd)
32 {
33 @@ -1432,6 +1446,7 @@ static const struct ethtool_ops bcm_enet
34 .get_strings = bcm_enet_get_strings,
35 .get_sset_count = bcm_enet_get_sset_count,
36 .get_ethtool_stats = bcm_enet_get_ethtool_stats,
37 + .nway_reset = bcm_enet_nway_reset,
38 .get_settings = bcm_enet_get_settings,
39 .set_settings = bcm_enet_set_settings,
40 .get_drvinfo = bcm_enet_get_drvinfo,