aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cs89x0.c
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2006-01-08 04:01:11 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-08 23:12:45 -0500
commit3b68d70dffe255e7681d5725d96bc2b92a24bb9d (patch)
tree0f311381f9d39e10360431cb57c94b7bcae62727 /drivers/net/cs89x0.c
parent3eaa5e7dcce0653d2bfd2ab85a623687da49f8d5 (diff)
[PATCH] cs89x0: cleanly implement ixdp2x01 and pnx0501 support
Implement suitable versions of the readword/writeword macros for ixdp2x01 and pnx0501. Handle the 32-bit spacing of the registers in these functions instead of in the header file. Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org> Cc: dmitry pervushin <dpervushin@ru.mvista.com> Cc: <dsaxena@plexity.net> Cc: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/net/cs89x0.c')
-rw-r--r--drivers/net/cs89x0.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
index 756d80adc47b..7abc9f858f98 100644
--- a/drivers/net/cs89x0.c
+++ b/drivers/net/cs89x0.c
@@ -338,6 +338,32 @@ out:
338} 338}
339#endif 339#endif
340 340
341#if defined(CONFIG_ARCH_IXDP2X01)
342static int
343readword(unsigned long base_addr, int portno)
344{
345 return (u16)__raw_readl(base_addr + (portno << 1));
346}
347
348static void
349writeword(unsigned long base_addr, int portno, int value)
350{
351 __raw_writel((u16)value, base_addr + (portno << 1));
352}
353#else
354#if defined(CONFIG_ARCH_PNX0501)
355static int
356readword(unsigned long base_addr, int portno)
357{
358 return inw(base_addr + (portno << 1));
359}
360
361static void
362writeword(unsigned long base_addr, int portno, int value)
363{
364 outw(value, base_addr + (portno << 1));
365}
366#else
341static int 367static int
342readword(unsigned long base_addr, int portno) 368readword(unsigned long base_addr, int portno)
343{ 369{
@@ -349,6 +375,8 @@ writeword(unsigned long base_addr, int portno, int value)
349{ 375{
350 outw(value, base_addr + portno); 376 outw(value, base_addr + portno);
351} 377}
378#endif
379#endif
352 380
353static int 381static int
354readreg(struct net_device *dev, int regno) 382readreg(struct net_device *dev, int regno)