diff options
author | Ricardo <ricardo.ribalda@gmail.com> | 2011-10-18 17:35:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-10-20 17:10:55 -0400 |
commit | 9eac2d4d5312d2ea05c0dbba8051b868fe9961a4 (patch) | |
tree | 606ad5646a0a150bc368fee1ea478e80f04439ee /drivers/net | |
parent | 46a016985a442b499faa52dff7e74a79f6a22cef (diff) |
ll_temac: Add support for ethtool
This patch enables the ethtool interface. The implementation is done
using the libphy helper functions.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/xilinx/ll_temac_main.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c index 85ba4d9ac170..4d1658e78dee 100644 --- a/drivers/net/ethernet/xilinx/ll_temac_main.c +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c | |||
@@ -955,6 +955,32 @@ static const struct attribute_group temac_attr_group = { | |||
955 | .attrs = temac_device_attrs, | 955 | .attrs = temac_device_attrs, |
956 | }; | 956 | }; |
957 | 957 | ||
958 | /* ethtool support */ | ||
959 | static int temac_get_settings(struct net_device *ndev, struct ethtool_cmd *cmd) | ||
960 | { | ||
961 | struct temac_local *lp = netdev_priv(ndev); | ||
962 | return phy_ethtool_gset(lp->phy_dev, cmd); | ||
963 | } | ||
964 | |||
965 | static int temac_set_settings(struct net_device *ndev, struct ethtool_cmd *cmd) | ||
966 | { | ||
967 | struct temac_local *lp = netdev_priv(ndev); | ||
968 | return phy_ethtool_sset(lp->phy_dev, cmd); | ||
969 | } | ||
970 | |||
971 | static int temac_nway_reset(struct net_device *ndev) | ||
972 | { | ||
973 | struct temac_local *lp = netdev_priv(ndev); | ||
974 | return phy_start_aneg(lp->phy_dev); | ||
975 | } | ||
976 | |||
977 | static const struct ethtool_ops temac_ethtool_ops = { | ||
978 | .get_settings = temac_get_settings, | ||
979 | .set_settings = temac_set_settings, | ||
980 | .nway_reset = temac_nway_reset, | ||
981 | .get_link = ethtool_op_get_link, | ||
982 | }; | ||
983 | |||
958 | static int __devinit temac_of_probe(struct platform_device *op) | 984 | static int __devinit temac_of_probe(struct platform_device *op) |
959 | { | 985 | { |
960 | struct device_node *np; | 986 | struct device_node *np; |
@@ -976,6 +1002,7 @@ static int __devinit temac_of_probe(struct platform_device *op) | |||
976 | ndev->flags &= ~IFF_MULTICAST; /* clear multicast */ | 1002 | ndev->flags &= ~IFF_MULTICAST; /* clear multicast */ |
977 | ndev->features = NETIF_F_SG | NETIF_F_FRAGLIST; | 1003 | ndev->features = NETIF_F_SG | NETIF_F_FRAGLIST; |
978 | ndev->netdev_ops = &temac_netdev_ops; | 1004 | ndev->netdev_ops = &temac_netdev_ops; |
1005 | ndev->ethtool_ops = &temac_ethtool_ops; | ||
979 | #if 0 | 1006 | #if 0 |
980 | ndev->features |= NETIF_F_IP_CSUM; /* Can checksum TCP/UDP over IPv4. */ | 1007 | ndev->features |= NETIF_F_IP_CSUM; /* Can checksum TCP/UDP over IPv4. */ |
981 | ndev->features |= NETIF_F_HW_CSUM; /* Can checksum all the packets. */ | 1008 | ndev->features |= NETIF_F_HW_CSUM; /* Can checksum all the packets. */ |