diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-10-10 00:19:36 +0100 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-02 00:11:56 -0500 |
commit | 6c3561b0c1b64c8f0d1419f3909ab29f0eb98906 (patch) | |
tree | b39e7aa75e9a9a9a6e7c394451a3ad52eb0d2444 /drivers/net/8390.h | |
parent | 865f3b2b6ac578a061c823bec5baf00ad04cbd8c (diff) | |
download | linux-6c3561b0c1b64c8f0d1419f3909ab29f0eb98906.tar.gz linux-6c3561b0c1b64c8f0d1419f3909ab29f0eb98906.tar.bz2 linux-6c3561b0c1b64c8f0d1419f3909ab29f0eb98906.zip |
[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 <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/8390.h')
-rw-r--r-- | drivers/net/8390.h | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/drivers/net/8390.h b/drivers/net/8390.h index f44f1220b3a5..fae4aa92c4b7 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 |