All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Rompf <srompf@isg.de>
To: jgarzik@pobox.com
Cc: netdev@oss.sgi.com
Subject: Re: Patch: link state detection for 8139too against 2.4.20rc2 / 2.5
Date: Sun, 24 Nov 2002 13:47:08 +0100	[thread overview]
Message-ID: <3DE0CA4C.730699FC@isg.de> (raw)
In-Reply-To: 3DA96BCC.B2589AC0@isg.de

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

Hi,

> > Uhmmm, you don't need to poll with the rtl8139.  There is a link change
> > interrupt.  Here is the recently added from rtl8139.c
> 
> ok, I'll try this next time I have access to the card.

...that was some days ago. I've seen that Jeff is enhancing the MII
interface library, so I used the functions provided there. Patch is
against 2.4.20rc2 and 2.5 with some offset. Please apply if it looks
good.

Cheers, Stefan

[-- Attachment #2: patch-ls-8139too --]
[-- Type: text/plain, Size: 1326 bytes --]

--- linux/drivers/net/8139too.c.old	2002-11-19 00:32:04.000000000 +0100
+++ linux/drivers/net/8139too.c	2002-11-21 22:32:39.000000000 +0100
@@ -1335,18 +1335,7 @@
 	struct rtl8139_private *tp = dev->priv;
 
 	if (tp->phys[0] >= 0) {
-		u16 mii_lpa = mdio_read(dev, tp->phys[0], MII_LPA);
-		if (mii_lpa == 0xffff)
-			;					/* Not there */
-		else if ((mii_lpa & LPA_100FULL) == LPA_100FULL
-				 || (mii_lpa & 0x00C0) == LPA_10FULL)
-			tp->mii.full_duplex = 1;
-
-		printk (KERN_INFO"%s: Setting %s%s-duplex based on"
-				" auto-negotiated partner ability %4.4x.\n",
-		        dev->name, mii_lpa == 0 ? "" :
-				(mii_lpa & 0x0180) ? "100mbps " : "10mbps ",
-			tp->mii.full_duplex ? "full" : "half", mii_lpa);
+		mii_check_media(&tp->mii, 1, 1);
 	}
 }
 
@@ -1994,18 +1983,7 @@
 
 	if ((status & RxUnderrun) && link_changed &&
 	    (tp->drv_flags & HAS_LNK_CHNG)) {
-		/* Really link-change on new chips. */
-		int lpar = RTL_R16 (NWayLPAR);
-		int duplex = (lpar & LPA_100FULL) || (lpar & 0x01C0) == 0x0040
-				|| tp->mii.force_media;
-		if (tp->mii.full_duplex != duplex) {
-			tp->mii.full_duplex = duplex;
-#if 0
-			RTL_W8 (Cfg9346, Cfg9346_Unlock);
-			RTL_W8 (Config1, tp->mii.full_duplex ? 0x60 : 0x20);
-			RTL_W8 (Cfg9346, Cfg9346_Lock);
-#endif
-		}
+		rtl_check_media(dev);
 		status &= ~RxUnderrun;
 	}
 


  parent reply	other threads:[~2002-11-24 12:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-11 23:55 Patch: link state detection for 8139too against 2.5.41 Stefan Rompf
2002-10-12  4:14 ` Donald Becker
2002-10-13 12:49   ` Stefan Rompf
2002-10-14 17:42     ` Jeff Garzik
2002-11-24 12:47     ` Stefan Rompf [this message]
2002-12-09 22:36       ` Patch: link state detection for 8139too against 2.4.20rc2 / 2.5 Stefan Rompf
2002-12-09 23:25         ` Jeff Garzik
2002-11-28  4:58   ` 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=3DE0CA4C.730699FC@isg.de \
    --to=srompf@isg.de \
    --cc=jgarzik@pobox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.