Skip to contentSkip to conversation

linux-2.6 jejb

parisc-linux James Bottomley 1 participant 1 message Sep 3, 2003 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 11 lines · James Bottomley

CVSROOT: /var/cvs
Module name: linux-2.6
Changes by: jejb 03/09/03 10:51:13

Modified files:
. : Makefile
drivers/net/tulip: eeprom.c tulip.h tulip_core.c drivers/parisc : dino.c

Log message:
Fix card mode dino support and make HSC FX (tulip) card work

Patch is in two parts: dino bit just corrects some thinkos in the card mode dino code and adds the actual dino device to the prints (useful for debugging if you have more than one dino).

The tulip fix simply adds the card to the tulip card table and makes it all work.

I've tested this on my C360...however, I had to hack the ccio window to get that to work...I need more time to make this code better.

James

===== drivers/net/tulip/eeprom.c 1.9 vs edited =====

drivers/net/tulip/eeprom.c +7 -2
@@ -93,8 +93,13 @@
 #ifdef __hppa__
 	unsigned char *ee_data = tp->eeprom;
 
-	if (ee_data[0] == 0x3c && ee_data[1] == 0x10 && 
-		(ee_data[2] == 0x63 || ee_data[2] == 0x61) && ee_data[3] == 0x10) {
+	/* NOTE: The 3x5 FF cards the ee_data is trying to recognise
+	 * need to be brought properly under the tulip initialisation
+	 * structure */
+
+	if ((tp->flags & NEEDS_FAKE_MEDIA_TABLE) 
+	    || (ee_data[0] == 0x3c && ee_data[1] == 0x10 && 
+		(ee_data[2] == 0x63 || ee_data[2] == 0x61) && ee_data[3] == 0x10)) {
 
 		static unsigned char leafdata[] =
 			{ 0x01,       /* phy number */

===== drivers/net/tulip/tulip.h 1.15 vs edited =====

drivers/net/tulip/tulip.h +3 -0
@@ -64,6 +64,8 @@
 	COMET_MAC_ADDR		= 0x0800,
 	HAS_PCI_MWI		= 0x1000,
 	HAS_PHY_IRQ		= 0x2000,
+	HAS_SWAPPED_SEEPROM	= 0x4000,
+	NEEDS_FAKE_MEDIA_TABLE	= 0x8000,
 };
 
 
@@ -86,6 +88,7 @@
 	I21145,
 	DM910X,
 	CONEXANT,
+	HP_D21140,
 };
 
 

===== drivers/net/tulip/tulip_core.c 1.48 vs edited =====

drivers/net/tulip/tulip_core.c +11 -3
@@ -191,10 +191,17 @@
   /* RS7112 */
   { "Conexant LANfinity", 256, 0x0001ebef,
 	HAS_MII | HAS_ACPI, tulip_timer },
+
+  /* HP_D21140 */
+  { "HSC 100BaseTX Workstation single port (Digital DS21140 Tulip)", 128,
+    0x0001ebef,	HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM | HAS_PCI_MWI 
+    | HAS_SWAPPED_SEEPROM | NEEDS_FAKE_MEDIA_TABLE, tulip_timer },
+
 };
 
 
 static struct pci_device_id tulip_pci_tbl[] = {
+	{ 0x1011, 0x0009, 0x103c, 0x1062, 0, 0, HP_D21140 },
 	{ 0x1011, 0x0009, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DC21140 },
 	{ 0x1011, 0x0019, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DC21143 },
 	{ 0x11AD, 0x0002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, LC82C168 },
@@ -1459,9 +1466,10 @@
 		int sa_offset = 0;
 		int ee_addr_size = tulip_read_eeprom(ioaddr, 0xff, 8) & 0x40000 ? 8 : 6;
 
-		for (i = 0; i < sizeof(tp->eeprom)/2; i++)
-			((u16 *)ee_data)[i] =
-				le16_to_cpu(tulip_read_eeprom(ioaddr, i, ee_addr_size));
+		for (i = 0; i < sizeof(tp->eeprom)/2; i++) {
+			u16 data = tulip_read_eeprom(ioaddr, i, ee_addr_size);
+			((u16 *)ee_data)[i] = (tp->flags & HAS_SWAPPED_SEEPROM) ? data : le16_to_cpu(data);
+		}
 
 		/* DEC now has a specification (see Notes) but early board makers
 		   just put the address in the first EEPROM locations. */

===== drivers/parisc/dino.c 1.10 vs edited =====

drivers/parisc/dino.c +22 -21

82 lines not on this page · raw message