The "increment MAC address by port number" hack applies only to EF1.
authorMichael Brown <mcb30@etherboot.org>
Mon, 18 Dec 2006 15:28:34 +0000 (15:28 +0000)
committerMichael Brown <mcb30@etherboot.org>
Mon, 18 Dec 2006 15:28:34 +0000 (15:28 +0000)
src/drivers/net/etherfabric.c

index 9040f0c..e760b12 100644 (file)
@@ -1218,8 +1218,13 @@ static int ef1002_read_eeprom ( struct efab_nic *efab ) {
        struct i2c_interface *i2c = &efab->ef1002_i2c.i2c;
        struct i2c_device *i2cdev = &efab->ef1002_eeprom;
 
-       return ( i2c->read ( i2c, i2cdev, EF1_EEPROM_HWADDR_OFFSET,
-                            efab->mac_addr, sizeof ( efab->mac_addr ) ) == 0);
+       if ( i2c->read ( i2c, i2cdev, EF1_EEPROM_HWADDR_OFFSET,
+                        efab->mac_addr, sizeof ( efab->mac_addr ) ) != 0 )
+               return 0;
+
+       efab->mac_addr[ETH_ALEN-1] += efab->port;
+
+       return 1;
 }
 
 /** RX descriptor */
@@ -3194,7 +3199,6 @@ static int efab_init_nic ( struct efab_nic *efab ) {
        /* Read MAC address from EEPROM */
        if ( ! efab->op->read_eeprom ( efab ) )
                return 0;
-       efab->mac_addr[ETH_ALEN-1] += efab->port;
 
        /* Initialise MAC and wait for link up */
        if ( ! efab_init_mac ( efab ) )