Commit a2c0a16a authored by Jeff Garzik's avatar Jeff Garzik

Update tulip net driver to indicate link beat to system,

via netif_carrier_{on,off}.  Some placeholders to do this were
already in the code, making this an even easier and more obvious patch.

Also, decrease time until next link beat check, if link beat
is not present.  (previously the code would wait 60 seconds until
next check, regardless of current link state)

Contributor: Stefan Rompf, with changes from me
parent 3828fa25
...@@ -39,8 +39,13 @@ void t21142_timer(unsigned long data) ...@@ -39,8 +39,13 @@ void t21142_timer(unsigned long data)
printk(KERN_INFO"%s: 21143 negotiation status %8.8x, %s.\n", printk(KERN_INFO"%s: 21143 negotiation status %8.8x, %s.\n",
dev->name, csr12, medianame[dev->if_port]); dev->name, csr12, medianame[dev->if_port]);
if (tulip_media_cap[dev->if_port] & MediaIsMII) { if (tulip_media_cap[dev->if_port] & MediaIsMII) {
tulip_check_duplex(dev); if (tulip_check_duplex(dev) < 0) {
next_tick = 60*HZ; netif_carrier_off(dev);
next_tick = 3*HZ;
} else {
netif_carrier_on(dev);
next_tick = 60*HZ;
}
} else if (tp->nwayset) { } else if (tp->nwayset) {
/* Don't screw up a negotiated session! */ /* Don't screw up a negotiated session! */
if (tulip_debug > 1) if (tulip_debug > 1)
......
2002-01-28 Stefan Rompf <srompf@isg.de>,
Jeff Garzik <jgarzik@mandrakesoft.com>
* 21142.c (t21142_timer): Use return value of
tulip_check_duplex() to indicate to system whether or not
carrier is present. Use carrier presence/absence to determine
when next the 21142 media timer should check for link beat.
* timer (tulip_timer): Un-comment-out calls to
netif_carrier_{on,off}, as there is now value in
reporting link beta information to userspace.
2002-01-28 Pavel Roskin <proski@gnu.org> 2002-01-28 Pavel Roskin <proski@gnu.org>
* tulip_core.c (tulip_init_one): Use tp->eeprom instead of * tulip_core.c (tulip_init_one): Use tp->eeprom instead of
......
...@@ -83,10 +83,10 @@ void tulip_timer(unsigned long data) ...@@ -83,10 +83,10 @@ void tulip_timer(unsigned long data)
medianame[mleaf->media & MEDIA_MASK]); medianame[mleaf->media & MEDIA_MASK]);
if ((p[2] & 0x61) == 0x01) /* Bogus Znyx board. */ if ((p[2] & 0x61) == 0x01) /* Bogus Znyx board. */
goto actually_mii; goto actually_mii;
/* netif_carrier_on(dev); */ netif_carrier_on(dev);
break; break;
} }
/* netif_carrier_off(dev); */ netif_carrier_off(dev);
if (tp->medialock) if (tp->medialock)
break; break;
select_next_media: select_next_media:
...@@ -110,11 +110,13 @@ void tulip_timer(unsigned long data) ...@@ -110,11 +110,13 @@ void tulip_timer(unsigned long data)
} }
case 1: case 3: /* 21140, 21142 MII */ case 1: case 3: /* 21140, 21142 MII */
actually_mii: actually_mii:
if (tulip_check_duplex(dev) < 0) if (tulip_check_duplex(dev) < 0) {
{ /* netif_carrier_off(dev); */ } netif_carrier_off(dev);
else next_tick = 3*HZ;
{ /* netif_carrier_on(dev); */ } } else {
next_tick = 60*HZ; netif_carrier_on(dev);
next_tick = 60*HZ;
}
break; break;
case 2: /* 21142 serial block has no link beat. */ case 2: /* 21142 serial block has no link beat. */
default: default:
......
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