patch-2.1.97 linux/drivers/net/sunlance.c

Next file: linux/drivers/pci/pci.c
Previous file: linux/drivers/net/sunhme.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.96/linux/drivers/net/sunlance.c linux/drivers/net/sunlance.c
@@ -1,4 +1,4 @@
-/* $Id: sunlance.c,v 1.69 1998/01/09 16:42:52 jj Exp $
+/* $Id: sunlance.c,v 1.74 1998/02/12 07:37:25 davem Exp $
  * lance.c: Linux/Sparc/Lance driver
  *
  *	Written 1995, 1996 by Miguel de Icaza
@@ -103,6 +103,9 @@
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
 
+#include <asm/idprom.h>
+#include <asm/machines.h>
+
 /* Define: 2^4 Tx buffers and 2^4 Rx buffers */
 #ifndef LANCE_LOG_TX_BUFFERS
 #define LANCE_LOG_TX_BUFFERS 4
@@ -1037,7 +1040,7 @@
 						  "busmaster-regval",
 						  (LE_C3_BSWP | LE_C3_ACON |
 						   LE_C3_BCON));
-    
+
 	lp->ll = ll;
 	lp->name = lancestr;
 	lp->ledma = ledma;
@@ -1119,8 +1122,9 @@
 	dev->hard_start_xmit = &lance_start_xmit;
 	dev->get_stats = &lance_get_stats;
 	dev->set_multicast_list = &lance_set_multicast;
-    
+
 	dev->irq = (unsigned char) sdev->irqs [0].pri;
+
 	dev->dma = 0;
 	ether_setup (dev);
 
@@ -1144,6 +1148,31 @@
 	return 0;
 }
 
+#ifdef CONFIG_SUN4
+
+#include <asm/sun4paddr.h>
+
+/* Find all the lance cards on the system and initialize them */
+__initfunc(int sparc_lance_probe (struct device *dev))
+{
+	static struct linux_sbus_device sdev;
+	static int called = 0;
+
+	if(called)
+		return ENODEV;
+	called++;
+
+	if (idprom->id_machtype == (SM_SUN4|SM_4_330)) {
+		memset (&sdev, 0, sizeof(sdev));
+		sdev.reg_addrs[0].phys_addr = SUN4_300_ETH_PHYSADDR;
+		sdev.irqs[0].pri = 6;
+		return sparc_lance_init(dev, &sdev, 0, 0);
+	}
+	return ENODEV;
+}
+
+#else /* !CONFIG_SUN4 */
+
 /* Find all the lance cards on the system and initialize them */
 __initfunc(int sparc_lance_probe (struct device *dev))
 {
@@ -1152,10 +1181,11 @@
 	struct Linux_SBus_DMA *ledma = 0;
 	static int called = 0;
 	int cards = 0, v;
-    
+
 	if(called)
 		return ENODEV;
 	called++;
+
 	for_each_sbus (bus) {
 		for_each_sbusdev (sdev, bus) {
 			if (cards) dev = NULL;
@@ -1186,6 +1216,7 @@
 		return ENODEV;
 	return 0;
 }
+#endif /* !CONFIG_SUN4 */
 
 #ifdef MODULE
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov