Skip to contentSkip to conversation

GMAC ethernet controller (Apple PowerPC)

PATCH In review Roberto Gordo Saez 2 participants 2 messages Aug 8, 2002 – Aug 9, 2002 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 GMAC ethernet controller (Apple PowerPC)

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).

drivers/net/gmac.c +8 -1
@@ -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
 	 * 
#1 lore raw
Quoted 4 lines

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).

Thanks. However, the gmac driver is obsolete now (and will be removed from 2.5), you should really use sungem instead.

Ben.