This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
i82559 eeprom writing fix
- From: Mark Salter <msalter at redhat dot com>
- To: ecos-patches at sources dot redhat dot com
- Date: Thu, 27 Feb 2003 10:08:02 -0500 (EST)
- Subject: i82559 eeprom writing fix
This fixes a problem with my last patch. The wrong address was
being written back to eeprom.
--Mark
Index: devs/eth/intel/i82559/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/eth/intel/i82559/current/ChangeLog,v
retrieving revision 1.20
diff -u -p -5 -r1.20 ChangeLog
--- devs/eth/intel/i82559/current/ChangeLog 22 Feb 2003 16:42:41 -0000 1.20
+++ devs/eth/intel/i82559/current/ChangeLog 27 Feb 2003 15:03:04 -0000
@@ -1,5 +1,10 @@
+2003-02-27 Mark Salter <msalter at redhat dot com>
+
+ * src/if_i82559.c (eth_set_mac_address): Correct writing
+ of wrong address to EEPROM.
+
2003-02-22 Mark Salter <msalter at redhat dot com>
* src/if_i82559.c: Fix endian issues with EEPROM writing.
Use read-modify-write to set EEPROM mac address. Support
writing to EEPROM the mac address obtained from
Index: devs/eth/intel/i82559/current/src/if_i82559.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/eth/intel/i82559/current/src/if_i82559.c,v
retrieving revision 1.21
diff -u -p -5 -r1.21 if_i82559.c
--- devs/eth/intel/i82559/current/src/if_i82559.c 22 Feb 2003 16:42:42 -0000 1.21
+++ devs/eth/intel/i82559/current/src/if_i82559.c 27 Feb 2003 15:03:08 -0000
@@ -3354,13 +3354,13 @@ eth_set_mac_address(struct i82559* p_i82
for (i = 0; i < 63; i++)
eeprom_burn[i] = read_eeprom( ioaddr, i, addr_length );
// now set this address in the device eeprom ....
- eeprom_burn[0] = p_i82559->mac_address[0] | (p_i82559->mac_address[1] << 8);
- eeprom_burn[1] = p_i82559->mac_address[2] | (p_i82559->mac_address[3] << 8);
- eeprom_burn[2] = p_i82559->mac_address[4] | (p_i82559->mac_address[5] << 8);
+ eeprom_burn[0] = addr[0] | (addr[1] << 8);
+ eeprom_burn[1] = addr[2] | (addr[3] << 8);
+ eeprom_burn[2] = addr[4] | (addr[5] << 8);
// No idea what these were for...
// eeprom_burn[20] &= 0xfe;
// eeprom_burn[20] |= p_i82559->index;