Commit 6c48acb3 authored by Don Fry's avatar Don Fry Committed by Christoph Hellwig

[PATCH] pcnet32 non-mii link state fix

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)
parent 29d55497
...@@ -526,13 +526,17 @@ static u32 pcnet32_get_link(struct net_device *dev) ...@@ -526,13 +526,17 @@ static u32 pcnet32_get_link(struct net_device *dev)
{ {
struct pcnet32_private *lp = dev->priv; struct pcnet32_private *lp = dev->priv;
unsigned long flags; unsigned long flags;
int r = 1; int r;
if (lp->mii) {
spin_lock_irqsave(&lp->lock, flags); spin_lock_irqsave(&lp->lock, flags);
if (lp->mii) {
r = mii_link_ok(&lp->mii_if); 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; return r;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment