]> git.neil.brown.name Git - history.git/commitdiff
Update tulip net driver to indicate link beat to system,
authorJeff Garzik <jgarzik@rum.normnet.org>
Fri, 8 Feb 2002 13:35:21 +0000 (08:35 -0500)
committerJeff Garzik <jgarzik@rum.normnet.org>
Fri, 8 Feb 2002 13:35:21 +0000 (08:35 -0500)
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

drivers/net/tulip/21142.c
drivers/net/tulip/ChangeLog
drivers/net/tulip/timer.c

index 3a88c44120fe7f38a4bc6e55c6acae9df347a4c4..7e66f90349a03b5b2ad5b88c90920d7566704a3a 100644 (file)
@@ -39,8 +39,13 @@ void t21142_timer(unsigned long data)
                printk(KERN_INFO"%s: 21143 negotiation status %8.8x, %s.\n",
                           dev->name, csr12, medianame[dev->if_port]);
        if (tulip_media_cap[dev->if_port] & MediaIsMII) {
-               tulip_check_duplex(dev);
-               next_tick = 60*HZ;
+               if (tulip_check_duplex(dev) < 0) {
+                       netif_carrier_off(dev);
+                       next_tick = 3*HZ;
+               } else {
+                       netif_carrier_on(dev);
+                       next_tick = 60*HZ;
+               }
        } else if (tp->nwayset) {
                /* Don't screw up a negotiated session! */
                if (tulip_debug > 1)
index fc513785150a2d6dcab66f9134b09d72b39e1d00..3111685c2da476caffe22da4e009b56d5d664b65 100644 (file)
@@ -1,3 +1,15 @@
+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>
 
        * tulip_core.c (tulip_init_one): Use tp->eeprom instead of
index 53c43912bad71b4728424b202e8f19ea3764e337..c67dd8531b59927512423bb43d9d417e49c9e863 100644 (file)
@@ -83,10 +83,10 @@ void tulip_timer(unsigned long data)
                                               medianame[mleaf->media & MEDIA_MASK]);
                                if ((p[2] & 0x61) == 0x01)      /* Bogus Znyx board. */
                                        goto actually_mii;
-                               /* netif_carrier_on(dev); */
+                               netif_carrier_on(dev);
                                break;
                        }
-                       /* netif_carrier_off(dev); */
+                       netif_carrier_off(dev);
                        if (tp->medialock)
                                break;
          select_next_media:
@@ -110,11 +110,13 @@ void tulip_timer(unsigned long data)
                }
                case 1:  case 3:                /* 21140, 21142 MII */
                actually_mii:
-                       if (tulip_check_duplex(dev) < 0)
-                               { /* netif_carrier_off(dev); */ }
-                       else
-                               { /* netif_carrier_on(dev); */ }
-                       next_tick = 60*HZ;
+                       if (tulip_check_duplex(dev) < 0) {
+                               netif_carrier_off(dev);
+                               next_tick = 3*HZ;
+                       } else {
+                               netif_carrier_on(dev);
+                               next_tick = 60*HZ;
+                       }
                        break;
                case 2:                                 /* 21142 serial block has no link beat. */
                default: