[FIX] SMC 9194 support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, 

Here's a patch to support SMC 9194 in our target (SuperH architecture,
which uses 16-bit I/O).  This patch are made by Takeshi Yaegashi
<t@keshi.org>, I'm sending this to you on behalf of him, as SuperH
arch maintainer.

This patch consists three parts:
    (1) Undef USE_32_BIT when __sh__ (SuperH) is defined.
	Maybe this should be config option.
    (2) Don't assume IRQ2 means IRQ9, this is PC only semantics.
    (3) Bug fix of !USE_32_BIT.  It seems it's paren-mismatch typo.

diff -ruNp v2.4.7/drivers/net/smc9194.c linux/drivers/net/smc9194.c
--- v2.4.7/drivers/net/smc9194.c	Wed Jul 18 10:53:55 2001
+++ linux/drivers/net/smc9194.c	Wed Jul 18 11:47:22 2001
@@ -88,7 +88,11 @@ static const char version[] =
  . Do you want to use 32 bit xfers?  This should work on all chips, as
  . the chipset is designed to accommodate them.
 */
+#ifdef __sh__
+#undef USE_32_BIT
+#else
 #define USE_32_BIT 1
+#endif
 
 /*
  .the SMC9194 can be at any of the following port addresses.  To change,
@@ -983,12 +987,15 @@ static int __init smc_probe(struct net_d
 		retval = -ENODEV;
 		goto err_out;
 	}
+
+#ifdef __i386__
 	if (dev->irq == 2) {
 		/* Fixup for users that don't know that IRQ 2 is really IRQ 9,
 		 * or don't know which one to set.
 		 */
 		dev->irq = 9;
 	}
+#endif
 
 	/* now, print out the card info, in a short format.. */
 
@@ -1369,13 +1376,11 @@ static void smc_rcv(struct net_device *d
 			packet_length & 0x3  );
 #else
 		PRINTK3((" Reading %d words and %d byte(s) \n",
-			(packet_length >> 1 ), packet_length & 1 );
-		if ( packet_length & 1 )
-			*(data++) = inb( ioaddr + DATA_1 );
-		insw(ioaddr + DATA_1 , data, (packet_length + 1 ) >> 1);
+			(packet_length >> 1 ), packet_length & 1 ));
+		insw(ioaddr + DATA_1 , data, packet_length >> 1);
 		if ( packet_length & 1 ) {
 			data += packet_length & ~1;
-			*((data++) = inb( ioaddr + DATA_1 );
+			*(data++) = inb( ioaddr + DATA_1 );
 		}
 #endif
 #if	SMC_DEBUG > 2
-- 
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux