Commit 773ee447 authored by Jeff Garzik's avatar Jeff Garzik

Update eepro100 net driver link state tracking:

* Initialize interface carrier state in speedo_open.
* Update previous netif_carrier_{on,off} change to use
  linux/mii.h constants.

Contributor: Andrew Morton, with modifications from me
parent 282af720
......@@ -991,6 +991,11 @@ speedo_open(struct net_device *dev)
if ((sp->phy[0] & 0x8000) == 0)
sp->advertising = mdio_read(ioaddr, sp->phy[0] & 0x1f, 4);
if (mdio_read(ioaddr, sp->phy[0] & 0x1f, MII_BMSR) & BMSR_LSTATUS)
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));
......@@ -1102,7 +1107,7 @@ static void speedo_timer(unsigned long data)
/* Clear sticky bit. */
mdio_read(ioaddr, phy_num, 1);
/* If link beat has returned... */
if (mdio_read(ioaddr, phy_num, 1) & 0x0004)
if (mdio_read(ioaddr, phy_num, MII_BMSR) & BMSR_LSTATUS)
netif_carrier_on(dev);
else
netif_carrier_off(dev);
......
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