public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: alex@foogod.com
To: linux-kernel@vger.kernel.org
Subject: [PATCH] eepro100 and IFF_RUNNING under 2.4
Date: Fri, 20 Jul 2001 14:32:47 -0700	[thread overview]
Message-ID: <20010720143247.A6596@draco.foogod.com> (raw)

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

Hiho..  While working on some code which tries to monitor physical link status
for ethernet interfaces, I noticed that apparently under the 2.4 kernel, the
eepro100 driver does not reflect link status with the IFF_RUNNING flag as it
used to under 2.2.x.

It looks like a bit of the code in eepro100.c didn't get updated to reflect
some interface changes that happened somewhere in 2.3, so here is a patch which
should fix things (It also adds a bit of code to set things properly on startup as well, patch is against kernel 2.4.6).

(I'm not quite sure who to send this to, so I'm sending it to the list)

-alex

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

--- drivers/net/eepro100.c.orig	Mon Jul  2 14:03:04 2001
+++ drivers/net/eepro100.c	Fri Jul 20 13:28:20 2001
@@ -976,6 +976,11 @@
 	if ((sp->phy[0] & 0x8000) == 0)
 		sp->advertising = mdio_read(ioaddr, sp->phy[0] & 0x1f, 4);
 
+	if (mdio_read(ioaddr, sp->phy[0], 1) & 0x0004)
+		netif_carrier_on(dev);
+	else
+		netif_carrier_off(dev);
+
 	if (speedo_debug > 2) {
 		printk(KERN_DEBUG "%s: Done speedo_open(), status %8.8x.\n",
 			   dev->name, inw(ioaddr + SCBStatus));
@@ -1088,9 +1093,9 @@
 			mdio_read(ioaddr, phy_num, 1);
 			/* If link beat has returned... */
 			if (mdio_read(ioaddr, phy_num, 1) & 0x0004)
-				dev->flags |= IFF_RUNNING;
+				netif_carrier_on(dev);
 			else
-				dev->flags &= ~IFF_RUNNING;
+				netif_carrier_off(dev);
 		}
 	}
 	if (speedo_debug > 3) {

                 reply	other threads:[~2001-07-20 21:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20010720143247.A6596@draco.foogod.com \
    --to=alex@foogod.com \
    --cc=linux-kernel@vger.kernel.org \
    /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