[parisc-linux-cvs] [PATCH] Fix the MAC addresses for the HSC-PCI tulip cards.

Ryan Bradetich rbradetich@uswest.net
Mon, 29 Sep 2003 20:45:41 -0600


--=-w06LsQl1qVjOzvpBj9Fq
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hello all,

This patch fixes the MAC address for the HSC-PCI tulip cards and bumps
the version to -test6-pa3.

Thanks,

- Ryan

--=-w06LsQl1qVjOzvpBj9Fq
Content-Disposition: attachment; filename=tulip.diff
Content-Type: text/x-patch; name=tulip.diff; charset=ANSI_X3.4-1968
Content-Transfer-Encoding: 7bit

Index: Makefile
===================================================================
RCS file: /var/cvs/linux-2.6/Makefile,v
retrieving revision 1.62
diff -u -p -r1.62 Makefile
--- Makefile	28 Sep 2003 23:27:03 -0000	1.62
+++ Makefile	30 Sep 2003 02:39:56 -0000
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 0
-EXTRAVERSION = -test6-pa2
+EXTRAVERSION = -test6-pa3
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
Index: drivers/net/tulip/tulip_core.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/net/tulip/tulip_core.c,v
retrieving revision 1.9
diff -u -p -r1.9 tulip_core.c
--- drivers/net/tulip/tulip_core.c	24 Sep 2003 01:02:47 -0000	1.9
+++ drivers/net/tulip/tulip_core.c	30 Sep 2003 02:39:56 -0000
@@ -1524,6 +1524,26 @@ static int __devinit tulip_init_one (str
                        tp->flags &= ~HAS_MEDIA_TABLE;
                }
 #endif
+#ifdef CONFIG_GSC
+               /* Check to see if we have a broken srom */
+               if(ee_data[0] == 0x61 && ee_data[1] == 0x10) {
+                       /* pci_vendor_id and subsystem_id are swapped */
+                       ee_data[0] = ee_data[2];
+                       ee_data[1] = ee_data[3];
+                       ee_data[2] = 0x61;
+                       ee_data[3] = 0x10;
+
+                       /* HSC-PCI boards need to be byte-swaped and shifted
+                       ** up 1 word.  This shift needs to happen at the end
+                       ** of the MAC first because of the 2 byte overlap.
+                       */
+                       for(i = 4; i >= 0; i -= 2) {
+                               ee_data[17 + i + 3] = ee_data[17 + i];
+                               ee_data[16 + i + 5] = ee_data[16 + i];
+                       }
+               }
+#endif
+
 		for (i = 0; i < 6; i ++) {
 			dev->dev_addr[i] = ee_data[i + sa_offset];
 			sum += ee_data[i + sa_offset];

--=-w06LsQl1qVjOzvpBj9Fq--