diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-10-09 19:19:36 -0400 |
---|---|---|
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) |
[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 { | |||
116 | #undef outb | 116 | #undef outb |
117 | #undef outb_p | 117 | #undef outb_p |
118 | 118 | ||
119 | #define inb(port) in_8(port) | 119 | #define ei_inb(port) in_8(port) |
120 | #define outb(val,port) out_8(port,val) | 120 | #define ei_outb(val,port) out_8(port,val) |
121 | #define inb_p(port) in_8(port) | 121 | #define ei_inb_p(port) in_8(port) |
122 | #define outb_p(val,port) out_8(port,val) | 122 | #define ei_outb_p(val,port) out_8(port,val) |
123 | 123 | ||
124 | #elif defined(CONFIG_ARM_ETHERH) || defined(CONFIG_ARM_ETHERH_MODULE) | 124 | #elif defined(CONFIG_NE_H8300) || defined(CONFIG_NE_H8300_MODULE) |
125 | #define EI_SHIFT(x) (ei_local->reg_offset[x]) | 125 | #define EI_SHIFT(x) (ei_local->reg_offset[x]) |
126 | #undef inb | 126 | #endif |
127 | #undef inb_p | ||
128 | #undef outb | ||
129 | #undef outb_p | ||
130 | 127 | ||
131 | #define inb(_p) readb(_p) | 128 | #ifndef ei_inb |
132 | #define outb(_v,_p) writeb(_v,_p) | 129 | #define ei_inb(_p) inb(_p) |
133 | #define inb_p(_p) inb(_p) | 130 | #define ei_outb(_v,_p) outb(_v,_p) |
134 | #define outb_p(_v,_p) outb(_v,_p) | 131 | #define ei_inb_p(_p) inb_p(_p) |
132 | #define ei_outb_p(_v,_p) outb_p(_v,_p) | ||
133 | #endif | ||
135 | 134 | ||
136 | #elif defined(CONFIG_NE_H8300) || defined(CONFIG_NE_H8300_MODULE) | 135 | #ifndef EI_SHIFT |
137 | #define EI_SHIFT(x) (ei_local->reg_offset[x]) | ||
138 | #else | ||
139 | #define EI_SHIFT(x) (x) | 136 | #define EI_SHIFT(x) (x) |
140 | #endif | 137 | #endif |
141 | 138 | ||