From 6c3561b0c1b64c8f0d1419f3909ab29f0eb98906 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 00:19:36 +0100 Subject: [PATCH] beginning of 8390 fixes - generic and arm/etherh etherh and a handful of other odd drivers use different macros when building 8390.c. Since we generate a single 8390.o and then link with it, in any config with both oddball and normal 8390-based driver we will end up with breakage in at least one of them. Solution: take most of 8390.c into lib8390.c and have 8390.c, etherh.c and the rest of oddballs #include it. Helper macros are taken from 8390.h to whoever includes lib8390.c. That way odd drivers get separate instances of compiled 8390 stuff and stop stepping on each other's toes. 8390.h gets cleaned up - we don't have the cascade of ifdefs in there and are left with the stuff that can be used by any 8390-based driver. Current problems are exactly because of that cascade - we attempt to choose the set of helpers by looking at config and that, of course, doesn't work well when we have several sets needed by various drivers in our config. Signed-off-by: Al Viro Signed-off-by: Jeff Garzik --- drivers/net/8390.h | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'drivers/net/8390.h') diff --git a/drivers/net/8390.h b/drivers/net/8390.h index f44f1220b3a..fae4aa92c4b 100644 --- a/drivers/net/8390.h +++ b/drivers/net/8390.h @@ -116,26 +116,23 @@ struct ei_device { #undef outb #undef outb_p -#define inb(port) in_8(port) -#define outb(val,port) out_8(port,val) -#define inb_p(port) in_8(port) -#define outb_p(val,port) out_8(port,val) +#define ei_inb(port) in_8(port) +#define ei_outb(val,port) out_8(port,val) +#define ei_inb_p(port) in_8(port) +#define ei_outb_p(val,port) out_8(port,val) -#elif defined(CONFIG_ARM_ETHERH) || defined(CONFIG_ARM_ETHERH_MODULE) +#elif defined(CONFIG_NE_H8300) || defined(CONFIG_NE_H8300_MODULE) #define EI_SHIFT(x) (ei_local->reg_offset[x]) -#undef inb -#undef inb_p -#undef outb -#undef outb_p +#endif -#define inb(_p) readb(_p) -#define outb(_v,_p) writeb(_v,_p) -#define inb_p(_p) inb(_p) -#define outb_p(_v,_p) outb(_v,_p) +#ifndef ei_inb +#define ei_inb(_p) inb(_p) +#define ei_outb(_v,_p) outb(_v,_p) +#define ei_inb_p(_p) inb_p(_p) +#define ei_outb_p(_v,_p) outb_p(_v,_p) +#endif -#elif defined(CONFIG_NE_H8300) || defined(CONFIG_NE_H8300_MODULE) -#define EI_SHIFT(x) (ei_local->reg_offset[x]) -#else +#ifndef EI_SHIFT #define EI_SHIFT(x) (x) #endif -- cgit v1.2.3 From 8c6270f957f0eaa343e4a609159c4b85038468d6 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 00:19:36 +0100 Subject: [PATCH] 8390 fixes - m68k oddballs more 8390 conversions - mac8390, zorro8390 and hydra got the same treatment as arm etherh; one more case in 8390.h ifdef cascade is gone. Signed-off-by: Al Viro Signed-off-by: Jeff Garzik --- drivers/net/8390.h | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'drivers/net/8390.h') diff --git a/drivers/net/8390.h b/drivers/net/8390.h index fae4aa92c4b..b8991fc7923 100644 --- a/drivers/net/8390.h +++ b/drivers/net/8390.h @@ -107,21 +107,7 @@ struct ei_device { * - removed AMIGA_PCMCIA from this list, handled as ISA io now */ -#if defined(CONFIG_MAC) || \ - defined(CONFIG_ZORRO8390) || defined(CONFIG_ZORRO8390_MODULE) || \ - defined(CONFIG_HYDRA) || defined(CONFIG_HYDRA_MODULE) -#define EI_SHIFT(x) (ei_local->reg_offset[x]) -#undef inb -#undef inb_p -#undef outb -#undef outb_p - -#define ei_inb(port) in_8(port) -#define ei_outb(val,port) out_8(port,val) -#define ei_inb_p(port) in_8(port) -#define ei_outb_p(val,port) out_8(port,val) - -#elif defined(CONFIG_NE_H8300) || defined(CONFIG_NE_H8300_MODULE) +#if defined(CONFIG_NE_H8300) || defined(CONFIG_NE_H8300_MODULE) #define EI_SHIFT(x) (ei_local->reg_offset[x]) #endif -- cgit v1.2.3 From 3470cb1d4fb27572273079e7095734ac4f9caa43 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 00:19:36 +0100 Subject: [PATCH] 8390 fixes - the final chunk (h8300) The rest of 8390 conversions; ifdef cascade in 8390.h is gone now. Signed-off-by: Al Viro Signed-off-by: Jeff Garzik --- drivers/net/8390.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'drivers/net/8390.h') diff --git a/drivers/net/8390.h b/drivers/net/8390.h index b8991fc7923..414de5bd228 100644 --- a/drivers/net/8390.h +++ b/drivers/net/8390.h @@ -107,10 +107,6 @@ struct ei_device { * - removed AMIGA_PCMCIA from this list, handled as ISA io now */ -#if defined(CONFIG_NE_H8300) || defined(CONFIG_NE_H8300_MODULE) -#define EI_SHIFT(x) (ei_local->reg_offset[x]) -#endif - #ifndef ei_inb #define ei_inb(_p) inb(_p) #define ei_outb(_v,_p) outb(_v,_p) -- cgit v1.2.3