netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Rompf <srompf@isg.de>
To: jgarzik@mandrakesoft.com
Cc: netdev@oss.sgi.com
Subject: Patch: link state detection for 8139too against 2.5.41
Date: Sat, 12 Oct 2002 01:55:04 +0200	[thread overview]
Message-ID: <3DA764D8.FCDF34F8@isg.de> (raw)

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

Hi Jeff,

attached you find a patch that enables link state detection for the
8139too driver. It applies cleanly against 2.5.41 and with some line
offset against 2.4.19.

I've written this stuff on a friends' computer using 2.4.18, so it is
only slightly tested.

Cheers, Stefan

[-- Attachment #2: patch-linkstate-8139too-2.5.41 --]
[-- Type: text/plain, Size: 709 bytes --]

--- linux/drivers/net/8139too.c.orig	Tue Oct  1 09:05:46 2002
+++ linux/drivers/net/8139too.c	Thu Oct 10 00:37:37 2002
@@ -1534,9 +1534,16 @@
 				 struct rtl8139_private *tp,
 				 void *ioaddr)
 {
-	int mii_lpa;
+	int mii_lpa, mii_bmsr;
 
 	mii_lpa = mdio_read (dev, tp->phys[0], MII_LPA);
+	mii_bmsr = mdio_read(dev, tp->phys[0], MII_BMSR);
+
+	if (mii_bmsr & BMSR_LSTATUS && !netif_carrier_ok(dev)) {
+		netif_carrier_on(dev);
+	} else if (netif_carrier_ok(dev)) {
+		netif_carrier_off(dev);
+	}
 
 	if (!tp->mii.force_media && mii_lpa != 0xffff) {
 		int duplex = (mii_lpa & LPA_100FULL)
@@ -1563,7 +1570,7 @@
 		}
 	}
 
-	next_tick = HZ * 60;
+	next_tick = HZ * 3;
 
 	rtl8139_tune_twister (dev, tp);
 

             reply	other threads:[~2002-10-11 23:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-11 23:55 Stefan Rompf [this message]
2002-10-12  4:14 ` Patch: link state detection for 8139too against 2.5.41 Donald Becker
2002-10-13 12:49   ` Stefan Rompf
2002-10-14 17:42     ` Jeff Garzik
2002-11-24 12:47     ` Patch: link state detection for 8139too against 2.4.20rc2 / 2.5 Stefan Rompf
2002-12-09 22:36       ` 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=3DA764D8.FCDF34F8@isg.de \
    --to=srompf@isg.de \
    --cc=jgarzik@mandrakesoft.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).