Browse Source

The "increment MAC address by port number" hack applies only to EF1.

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
a497e16767
1 changed files with 7 additions and 3 deletions
  1. 7
    3
      src/drivers/net/etherfabric.c

+ 7
- 3
src/drivers/net/etherfabric.c View File

@@ -1218,8 +1218,13 @@ static int ef1002_read_eeprom ( struct efab_nic *efab ) {
1218 1218
 	struct i2c_interface *i2c = &efab->ef1002_i2c.i2c;
1219 1219
 	struct i2c_device *i2cdev = &efab->ef1002_eeprom;
1220 1220
 
1221
-	return ( i2c->read ( i2c, i2cdev, EF1_EEPROM_HWADDR_OFFSET,
1222
-			     efab->mac_addr, sizeof ( efab->mac_addr ) ) == 0);
1221
+	if ( i2c->read ( i2c, i2cdev, EF1_EEPROM_HWADDR_OFFSET,
1222
+			 efab->mac_addr, sizeof ( efab->mac_addr ) ) != 0 )
1223
+		return 0;
1224
+
1225
+	efab->mac_addr[ETH_ALEN-1] += efab->port;
1226
+
1227
+	return 1;
1223 1228
 }
1224 1229
 
1225 1230
 /** RX descriptor */
@@ -3194,7 +3199,6 @@ static int efab_init_nic ( struct efab_nic *efab ) {
3194 3199
 	/* Read MAC address from EEPROM */
3195 3200
 	if ( ! efab->op->read_eeprom ( efab ) )
3196 3201
 		return 0;
3197
-	efab->mac_addr[ETH_ALEN-1] += efab->port;
3198 3202
 
3199 3203
 	/* Initialise MAC and wait for link up */
3200 3204
 	if ( ! efab_init_mac ( efab ) )

Loading…
Cancel
Save