[PATCH] GMAC ethernet controller (Apple PowerPC)

From: Roberto Gordo Saez (rgs@linalco.com)
Date: Thu Aug 08 2002 - 05:04:02 EST


Small fix for the link status (carrier) on PowerPC GMAC net driver.

Now ifconfig reports correctly the "RUNNING" flag, the same way that it is reported with other network cards i've tested (intel eepro100 on i386).

--- linux-2.4.19.orig/drivers/net/gmac.c 2002-08-08 08:38:10.000000000 +0200
+++ linux-2.4.19/drivers/net/gmac.c 2002-08-08 09:26:07.000000000 +0200
@@ -246,6 +246,7 @@
 #endif
                             full_duplex = ((aux_stat & MII_BCM5201_AUXCTLSTATUS_DUPLEX) != 0);
                             link_100 = ((aux_stat & MII_BCM5201_AUXCTLSTATUS_SPEED) != 0);
+ netif_carrier_on(gm->dev);
                         break;
                       case PHY_B5400:
                       case PHY_B5401:
@@ -260,6 +261,7 @@
                             full_duplex = phy_BCM5400_link_table[link][0];
                             link_100 = phy_BCM5400_link_table[link][1];
                             gigabit = phy_BCM5400_link_table[link][2];
+ netif_carrier_on(gm->dev);
                             break;
                       case PHY_LXT971:
                             aux_stat = mii_read(gm, gm->phy_addr, MII_LXT971_STATUS2);
@@ -269,6 +271,7 @@
 #endif
                             full_duplex = ((aux_stat & MII_LXT971_STATUS2_FULLDUPLEX) != 0);
                             link_100 = ((aux_stat & MII_LXT971_STATUS2_SPEED) != 0);
+ netif_carrier_on(gm->dev);
                             break;
                       default:
                             full_duplex = (lpar_ability & MII_ANLPA_FDAM) != 0;
@@ -296,6 +299,7 @@
 #ifdef DEBUG_PHY
                     printk(KERN_INFO "%s: Link down !\n", gm->dev->name);
 #endif
+ netif_carrier_off(gm->dev);
                 }
         }
 }
@@ -1101,7 +1105,10 @@
         
         /* Initialize the multicast tables & promisc mode if any */
         gmac_set_multicast(dev);
-
+
+ /* Initialize the carrier status */
+ netif_carrier_off(dev);
+
         /*
          * Check out PHY status and start auto-poll
          *
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Aug 15 2002 - 22:00:16 EST