* [patch 2.6.3] pcnet32 non-mii link state fix
@ 2004-02-25 1:02 Don Fry
2004-02-26 5:44 ` Jeff Garzik
0 siblings, 1 reply; 3+ messages in thread
From: Don Fry @ 2004-02-25 1:02 UTC (permalink / raw)
To: tsbogend, jgarzik, netdev
s 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>. (This version has the correct file name)
--- linux-2.6.3/drivers/net/x.pcnet32.c Tue Feb 24 16:39:18 2004
+++ linux-2.6.3/drivers/net/pcnet32.c Tue Feb 24 16:41:49 2004
@@ -526,13 +526,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] 3+ messages in thread* [patch 2.6.3] pcnet32 non-mii link state fix
@ 2004-02-25 0:59 Don Fry
0 siblings, 0 replies; 3+ messages in thread
From: Don Fry @ 2004-02-25 0:59 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.6.3/drivers/net/pcnet32.c Tue Feb 24 16:39:18 2004
+++ linux-2.6.3/drivers/net/tomorrow.pcnet32.c Tue Feb 24 16:41:49 2004
@@ -526,13 +526,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] 3+ messages in thread
end of thread, other threads:[~2004-02-26 5:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-25 1:02 [patch 2.6.3] pcnet32 non-mii link state fix Don Fry
2004-02-26 5:44 ` Jeff Garzik
-- strict thread matches above, loose matches on Subject: below --
2004-02-25 0:59 Don Fry
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).