changeset 1474:4c1154a92c9d

* Backed out the previous partial fix. * src/if_i82559.c: support for large EEPROMs
author asl
date Sun, 18 Jan 2004 15:32:14 +0000
parents d3d4aa4d1e40
children c9e09b1c18cb
files packages/devs/eth/intel/i82559/current/ChangeLog packages/devs/eth/intel/i82559/current/src/if_i82559.c
diffstat 2 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/packages/devs/eth/intel/i82559/current/ChangeLog
+++ b/packages/devs/eth/intel/i82559/current/ChangeLog
@@ -1,6 +1,6 @@
-2004-01-17  Jeffrey Daly  <jeffrey.daly@intel.com>
+2004-01-15  Jeff Daly  <jeffrey.daly@intel.com>
 
-	* src/if_i82559.c (read_eeprom_esa): Allow bigger EEPROMs to work.
+	* src/if_i82559.c: support for large EEPROMs
 
 2004-01-05  Gary Thomas  <gary@mlbassoc.com>
 
--- a/packages/devs/eth/intel/i82559/current/src/if_i82559.c
+++ b/packages/devs/eth/intel/i82559/current/src/if_i82559.c
@@ -1342,8 +1342,7 @@ read_eeprom_esa(struct i82559 *p_i82559,
 		  p_i82559->index);
 #endif
     } else {
-	for (checksum = 0, i = 0, count = 0; 
-             count < (1 << addr_length); count++) {
+	for (checksum = 0, i = 0, count = 0; count < (1 << addr_length); count++) {
 	    cyg_uint16 value;
 	    // read word from eeprom
 	    value = read_eeprom(ioaddr, count, addr_length);
@@ -3460,7 +3459,7 @@ eth_set_mac_address(struct i82559* p_i82
 
         addr_length = get_eeprom_size( ioaddr );
 
-        for (i = 0; i < 63; i++)
+        for (i = 0; i < (1 << addr_length); i++)
             eeprom_burn[i] = read_eeprom( ioaddr, i, addr_length );
 
         // now set this address in the device eeprom ....
@@ -3478,7 +3477,7 @@ eth_set_mac_address(struct i82559* p_i82
         udelay( 100000 );
 
         // by reading EEPROM to get the mac address back
-        for (checksum = 0, i = 0, count = 0; count < 64; count++) {
+        for (checksum = 0, i = 0, count = 0; count < (1 << addr_length); count++) {
             cyg_uint16 value;
             // read word from eeprom
             value = read_eeprom(ioaddr, count, addr_length);
@@ -3630,7 +3629,7 @@ program_eeprom(cyg_uint32 ioaddr, cyg_ui
   // This is done through the EWEN instruction.
   write_enable_eeprom( ioaddr, eeprom_size );
 
-  for (i=0 ; i< 63 ; i++) {
+  for (i=0 ; i< (1 << eeprom_size) ; i++) {
     value = ((unsigned short *)data)[i];
     checksum += value;
 #ifdef DEBUG_82559