netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Munck Steenholdt <tmus@tmus.dk>
To: Don Fry <brazilnut@us.ibm.com>, netdev@oss.sgi.com
Subject: Re: [PATCH] 2.6.3 pcnet32.c fix link reporting for non-mii devices
Date: Sat, 21 Feb 2004 22:57:00 +0100	[thread overview]
Message-ID: <4037D42C.4030909@tmus.dk> (raw)
In-Reply-To: <200402202232.i1KMWqD07369@DYN318364BLD.beaverton.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 858 bytes --]

Don Fry wrote:
> Thomas,
> 
> Thanks for the input.  I am the unofficial maintainer, sort of.  I don't
> have a card without an mii, so I can't test some of the changes.  Do
> you know of a way to determine the link state so I can correctly return
> the state?
> 
> By the way, are you running 2.4 or 2.6?
> 

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


[-- Attachment #2: pcnet32_real_link_detect_fix.patch --]
[-- Type: text/plain, Size: 620 bytes --]

--- 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;

       reply	other threads:[~2004-02-21 21:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200402202232.i1KMWqD07369@DYN318364BLD.beaverton.ibm.com>
2004-02-21 21:57 ` Thomas Munck Steenholdt [this message]
2004-02-24  5:31   ` [PATCH] 2.6.3 pcnet32.c fix link reporting for non-mii devices Thomas Munck Steenholdt
2004-02-24  5:34     ` Thomas Munck Steenholdt
2004-02-21  7:27 Thomas Munck Steenholdt
  -- strict thread matches above, loose matches on Subject: below --
2004-02-20 19:55 Thomas Munck Steenholdt

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=4037D42C.4030909@tmus.dk \
    --to=tmus@tmus.dk \
    --cc=brazilnut@us.ibm.com \
    --cc=netdev@oss.sgi.com \
    /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).