netdev
[Top] [All Lists]

Re: [PATCH] 2.6.3 pcnet32.c fix link reporting for non-mii devices

Subject: Re: [PATCH] 2.6.3 pcnet32.c fix link reporting for non-mii devices
From: Thomas Munck Steenholdt <tmus@xxxxxxx>
Date: Tue, 24 Feb 2004 06:31:40 +0100
Cc: Don Fry <brazilnut@xxxxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <4037D42C.4030909@xxxxxxx>
References: <200402202232.i1KMWqD07369@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <4037D42C.4030909@xxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113
Thomas Munck Steenholdt wrote:
 > Hi again!

Decided to do some research and get this thing implemented right!
I've created a new patch against the 2.6.3-bk3 version of pcnet32.c

What this patch does is that in the event that mii is not supported, link status is read directly from device's lnktst bcr register.

Works without any problem with the virtual nic under vmware. So if all the other non-mii pcnet32 devices have the link status register in the same place, things should be just fine!

Could you please test this and let me know what you think?

Best regards

Thomas


------------------------------------------------------------------------

--- drivers/net/pcnet32.c.tmus  2004-02-19 15:24:31.238513096 +0100
+++ drivers/net/pcnet32.c       2004-02-19 15:27:28.265600888 +0100
@@ -1644,7 +1644,9 @@
        case ETHTOOL_GLINK: {
                struct ethtool_value edata = {ETHTOOL_GLINK};
                spin_lock_irq(&lp->lock);
-               edata.data = mii_link_ok(&lp->mii_if);
+               if(lp->mii) edata.data = mii_link_ok(&lp->mii_if);
+                /* read the LNKTST BCR register for link status on non-mii 
capable devices */
+                else edata.data = (lp->a.read_bcr(ioaddr,4) != 0xc0);
                spin_unlock_irq(&lp->lock);
                if (copy_to_user(useraddr, &edata, sizeof(edata)))
                        return -EFAULT;

Hi there

If this is a repost, then i'm sorry! I didn't get it myself!

I'd like to make sure we get this patched in the pcnet32 driver!

If you'll need me to do the patch for another version of the pcnet32.c file, let me know!

Best regards

Thomas

<Prev in Thread] Current Thread [Next in Thread>