* [patch 2.4.25 15/15] pcnet32 non-mii link state fix
@ 2004-02-25 20:10 Don Fry
2004-02-26 5:49 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Don Fry @ 2004-02-25 20:10 UTC (permalink / raw)
To: tsbogend, jgarzik, netdev
This patch correctly returns the link state of an adapter which does not
have an MII. Tested by myself and the patch author Thomas Munck Steenholdt
<tmus@tmus.dk>.
--- linux-2.4.25/drivers/net/debug.pcnet32.c Wed Feb 25 11:55:25 2004
+++ linux-2.4.25/drivers/net/pcnet32.c Wed Feb 25 11:56:44 2004
@@ -521,13 +521,17 @@
{
struct pcnet32_private *lp = dev->priv;
unsigned long flags;
- int r = 1;
+ int r;
+ spin_lock_irqsave(&lp->lock, flags);
if (lp->mii) {
- spin_lock_irqsave(&lp->lock, flags);
r = mii_link_ok(&lp->mii_if);
- spin_unlock_irqrestore(&lp->lock, flags);
+ } else {
+ ulong ioaddr = dev->base_addr; /* card base I/O address */
+ r = (lp->a.read_bcr(ioaddr, 4) != 0xc0);
}
+ spin_unlock_irqrestore(&lp->lock, flags);
+
return r;
}
--
Don Fry
brazilnut@us.ibm.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch 2.4.25 15/15] pcnet32 non-mii link state fix
2004-02-25 20:10 [patch 2.4.25 15/15] pcnet32 non-mii link state fix Don Fry
@ 2004-02-26 5:49 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2004-02-26 5:49 UTC (permalink / raw)
To: Don Fry; +Cc: tsbogend, netdev
applied
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-02-26 5:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-25 20:10 [patch 2.4.25 15/15] pcnet32 non-mii link state fix Don Fry
2004-02-26 5:49 ` 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).