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@xxxxxxx>.
--- 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@xxxxxxxxxx
|