netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch: link state detection for 8139too against 2.5.41
@ 2002-10-11 23:55 Stefan Rompf
  2002-10-12  4:14 ` Donald Becker
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Rompf @ 2002-10-11 23:55 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-12-09 23:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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     ` 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

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).