diff options
author | Jay Cliburn <jacliburn@bellsouth.net> | 2006-07-20 17:23:57 -0400 |
---|---|---|
committer | Francois Romieu <romieu@electric-eye.fr.zoreil.com> | 2006-07-20 17:28:23 -0400 |
commit | 59b693fbbec37765426ba0916920ff93d2e26eb3 (patch) | |
tree | cf8ac68c86c6ecb1b426d790bea95f6431c71ce8 | |
parent | 82d6897fefca6206bca7153805b4c5359ce97fc4 (diff) |
via-velocity: fix speed and link status reported by ethtool
The via-velocity driver reports incorrect speed and link detected status
as viewed by ethtool (and probably other tools). This patch fixes those
incorrect reports and prettifies a long line.
Signed-off-by: Jay Cliburn <jacliburn@bellsouth.net>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
-rw-r--r-- | drivers/net/via-velocity.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index f5b0078eb4ad..aa9cd92f46b2 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -2742,7 +2742,7 @@ static u32 check_connection_type(struct mac_regs __iomem * regs) | |||
2742 | 2742 | ||
2743 | if (PHYSR0 & PHYSR0_SPDG) | 2743 | if (PHYSR0 & PHYSR0_SPDG) |
2744 | status |= VELOCITY_SPEED_1000; | 2744 | status |= VELOCITY_SPEED_1000; |
2745 | if (PHYSR0 & PHYSR0_SPD10) | 2745 | else if (PHYSR0 & PHYSR0_SPD10) |
2746 | status |= VELOCITY_SPEED_10; | 2746 | status |= VELOCITY_SPEED_10; |
2747 | else | 2747 | else |
2748 | status |= VELOCITY_SPEED_100; | 2748 | status |= VELOCITY_SPEED_100; |
@@ -2851,8 +2851,17 @@ static int velocity_get_settings(struct net_device *dev, struct ethtool_cmd *cmd | |||
2851 | u32 status; | 2851 | u32 status; |
2852 | status = check_connection_type(vptr->mac_regs); | 2852 | status = check_connection_type(vptr->mac_regs); |
2853 | 2853 | ||
2854 | cmd->supported = SUPPORTED_TP | SUPPORTED_Autoneg | SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full | SUPPORTED_1000baseT_Half | SUPPORTED_1000baseT_Full; | 2854 | cmd->supported = SUPPORTED_TP | |
2855 | if (status & VELOCITY_SPEED_100) | 2855 | SUPPORTED_Autoneg | |
2856 | SUPPORTED_10baseT_Half | | ||
2857 | SUPPORTED_10baseT_Full | | ||
2858 | SUPPORTED_100baseT_Half | | ||
2859 | SUPPORTED_100baseT_Full | | ||
2860 | SUPPORTED_1000baseT_Half | | ||
2861 | SUPPORTED_1000baseT_Full; | ||
2862 | if (status & VELOCITY_SPEED_1000) | ||
2863 | cmd->speed = SPEED_1000; | ||
2864 | else if (status & VELOCITY_SPEED_100) | ||
2856 | cmd->speed = SPEED_100; | 2865 | cmd->speed = SPEED_100; |
2857 | else | 2866 | else |
2858 | cmd->speed = SPEED_10; | 2867 | cmd->speed = SPEED_10; |
@@ -2896,7 +2905,7 @@ static u32 velocity_get_link(struct net_device *dev) | |||
2896 | { | 2905 | { |
2897 | struct velocity_info *vptr = netdev_priv(dev); | 2906 | struct velocity_info *vptr = netdev_priv(dev); |
2898 | struct mac_regs __iomem * regs = vptr->mac_regs; | 2907 | struct mac_regs __iomem * regs = vptr->mac_regs; |
2899 | return BYTE_REG_BITS_IS_ON(PHYSR0_LINKGD, ®s->PHYSR0) ? 0 : 1; | 2908 | return BYTE_REG_BITS_IS_ON(PHYSR0_LINKGD, ®s->PHYSR0) ? 1 : 0; |
2900 | } | 2909 | } |
2901 | 2910 | ||
2902 | static void velocity_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) | 2911 | static void velocity_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) |