aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fealnx.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2008-06-27 02:18:50 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-06-28 10:23:37 -0400
commit28cd4289abc2c8db90344ee4ff064a9bdf086fdf (patch)
tree7a990af041d904b990d62b112876a103a6e62d43 /drivers/net/fealnx.c
parent445854f4c46ff1fa8f4605334914ecd1a1ae574d (diff)
[netdrvr] fealnx: clean up nasty mess of arch ifdefs
Clean up config/burst value arch-specific setup. * bcrvalue only varied by its big-endian bit * crvalue only varied for certain types of x86-32 chips This should make fealnx quite a bit more portable, without any behavior change. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/fealnx.c')
-rw-r--r--drivers/net/fealnx.c43
1 files changed, 12 insertions, 31 deletions
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c
index 7bb9c728a1d3..3c1364de2b66 100644
--- a/drivers/net/fealnx.c
+++ b/drivers/net/fealnx.c
@@ -90,6 +90,7 @@ static int full_duplex[MAX_UNITS] = { -1, -1, -1, -1, -1, -1, -1, -1 };
90#include <asm/processor.h> /* Processor type for cache alignment. */ 90#include <asm/processor.h> /* Processor type for cache alignment. */
91#include <asm/io.h> 91#include <asm/io.h>
92#include <asm/uaccess.h> 92#include <asm/uaccess.h>
93#include <asm/byteorder.h>
93 94
94/* These identify the driver base version and may not be removed. */ 95/* These identify the driver base version and may not be removed. */
95static char version[] = 96static char version[] =
@@ -861,40 +862,20 @@ static int netdev_open(struct net_device *dev)
861 Wait the specified 50 PCI cycles after a reset by initializing 862 Wait the specified 50 PCI cycles after a reset by initializing
862 Tx and Rx queues and the address filter list. 863 Tx and Rx queues and the address filter list.
863 FIXME (Ueimor): optimistic for alpha + posted writes ? */ 864 FIXME (Ueimor): optimistic for alpha + posted writes ? */
864#if defined(__powerpc__) || defined(__sparc__) 865
865// 89/9/1 modify,
866// np->bcrvalue=0x04 | 0x0x38; /* big-endian, 256 burst length */
867 np->bcrvalue = 0x04 | 0x10; /* big-endian, tx 8 burst length */
868 np->crvalue = 0xe00; /* rx 128 burst length */
869#elif defined(__alpha__) || defined(__x86_64__)
870// 89/9/1 modify,
871// np->bcrvalue=0x38; /* little-endian, 256 burst length */
872 np->bcrvalue = 0x10; /* little-endian, 8 burst length */
873 np->crvalue = 0xe00; /* rx 128 burst length */
874#elif defined(__i386__)
875#if defined(MODULE)
876// 89/9/1 modify,
877// np->bcrvalue=0x38; /* little-endian, 256 burst length */
878 np->bcrvalue = 0x10; /* little-endian, 8 burst length */ 866 np->bcrvalue = 0x10; /* little-endian, 8 burst length */
879 np->crvalue = 0xe00; /* rx 128 burst length */ 867#ifdef __BIG_ENDIAN
880#else 868 np->bcrvalue |= 0x04; /* big-endian */
881 /* When not a module we can work around broken '486 PCI boards. */
882#define x86 boot_cpu_data.x86
883// 89/9/1 modify,
884// np->bcrvalue=(x86 <= 4 ? 0x10 : 0x38);
885 np->bcrvalue = 0x10;
886 np->crvalue = (x86 <= 4 ? 0xa00 : 0xe00);
887 if (x86 <= 4)
888 printk(KERN_INFO "%s: This is a 386/486 PCI system, setting burst "
889 "length to %x.\n", dev->name, (x86 <= 4 ? 0x10 : 0x38));
890#endif 869#endif
891#else 870
892// 89/9/1 modify, 871#if defined(__i386__) && !defined(MODULE)
893// np->bcrvalue=0x38; 872 if (boot_cpu_data.x86 <= 4)
894 np->bcrvalue = 0x10; 873 np->crvalue = 0xa00;
895 np->crvalue = 0xe00; /* rx 128 burst length */ 874 else
896#warning Processor architecture undefined!
897#endif 875#endif
876 np->crvalue = 0xe00; /* rx 128 burst length */
877
878
898// 89/12/29 add, 879// 89/12/29 add,
899// 90/1/16 modify, 880// 90/1/16 modify,
900// np->imrvalue=FBE|TUNF|CNTOVF|RBU|TI|RI; 881// np->imrvalue=FBE|TUNF|CNTOVF|RBU|TI|RI;