netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Cliburn <jacliburn@bellsouth.net>
To: netdev@vger.kernel.org
Cc: jgarzik@pobox.com
Subject: [PATCH] via-velocity: fix reported speed and link detected status
Date: Wed, 19 Jul 2006 22:28:54 -0500	[thread overview]
Message-ID: <20060720032854.GA4520@osprey.hogchain.net> (raw)

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>

--- linux-2.6.17.x86_64/drivers/net/via-velocity.c.orig 2006-07-19 18:34:15.000000000 -0500
+++ linux-2.6.17.x86_64/drivers/net/via-velocity.c      2006-07-19 18:55:05.000000000 -0500
@@ -2742,7 +2742,7 @@ static u32 check_connection_type(struct 
 
        if (PHYSR0 & PHYSR0_SPDG)
                status |= VELOCITY_SPEED_1000;
-       if (PHYSR0 & PHYSR0_SPD10)
+       else if (PHYSR0 & PHYSR0_SPD10)
                status |= VELOCITY_SPEED_10;
        else
                status |= VELOCITY_SPEED_100;
@@ -2851,8 +2851,17 @@ static int velocity_get_settings(struct 
        u32 status;
        status = check_connection_type(vptr->mac_regs);
 
-       cmd->supported = SUPPORTED_TP | SUPPORTED_Autoneg | SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full | SUPPORTED_1000baseT_Half | SUPPORTED_1000baseT_Full;
-       if (status & VELOCITY_SPEED_100)
+       cmd->supported = SUPPORTED_TP |
+                        SUPPORTED_Autoneg |
+                        SUPPORTED_10baseT_Half |
+                        SUPPORTED_10baseT_Full |
+                        SUPPORTED_100baseT_Half |
+                        SUPPORTED_100baseT_Full |
+                        SUPPORTED_1000baseT_Half |
+                        SUPPORTED_1000baseT_Full;
+       if (status & VELOCITY_SPEED_1000)
+               cmd->speed = SPEED_1000;
+       else if (status & VELOCITY_SPEED_100)
                cmd->speed = SPEED_100;
        else
                cmd->speed = SPEED_10;
@@ -2896,7 +2905,7 @@ static u32 velocity_get_link(struct net_
 {
        struct velocity_info *vptr = netdev_priv(dev);
        struct mac_regs __iomem * regs = vptr->mac_regs;
-       return BYTE_REG_BITS_IS_ON(PHYSR0_LINKGD, &regs->PHYSR0)  ? 0 : 1;
+       return BYTE_REG_BITS_IS_ON(PHYSR0_LINKGD, &regs->PHYSR0) ? 1 : 0;
 }
 
 static void velocity_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)


             reply	other threads:[~2006-07-20  3:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-20  3:28 Jay Cliburn [this message]
2006-07-20 21:57 ` [PATCH] via-velocity: fix reported speed and link detected status Francois Romieu
2006-07-29  5:26   ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060720032854.GA4520@osprey.hogchain.net \
    --to=jacliburn@bellsouth.net \
    --cc=jgarzik@pobox.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).