aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/arm/etherh.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2006-10-09 19:19:36 -0400
committerJeff Garzik <jeff@garzik.org>2006-12-02 00:11:56 -0500
commit6c3561b0c1b64c8f0d1419f3909ab29f0eb98906 (patch)
treeb39e7aa75e9a9a9a6e7c394451a3ad52eb0d2444 /drivers/net/arm/etherh.c
parent865f3b2b6ac578a061c823bec5baf00ad04cbd8c (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/arm/etherh.c')
-rw-r--r--drivers/net/arm/etherh.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/net/arm/etherh.c b/drivers/net/arm/etherh.c
index 4ae98970b282..747a71f5dd0e 100644
--- a/drivers/net/arm/etherh.c
+++ b/drivers/net/arm/etherh.c
@@ -52,7 +52,12 @@
52#include <asm/ecard.h> 52#include <asm/ecard.h>
53#include <asm/io.h> 53#include <asm/io.h>
54 54
55#include "../8390.h" 55#define EI_SHIFT(x) (ei_local->reg_offset[x])
56
57#define ei_inb(_p) readb(_p)
58#define ei_outb(_v,_p) writeb(_v,_p)
59#define ei_inb_p(_p) readb(_p)
60#define ei_outb_p(_v,_p) writeb(_v,_p)
56 61
57#define NET_DEBUG 0 62#define NET_DEBUG 0
58#define DEBUG_INIT 2 63#define DEBUG_INIT 2
@@ -60,6 +65,11 @@
60#define DRV_NAME "etherh" 65#define DRV_NAME "etherh"
61#define DRV_VERSION "1.11" 66#define DRV_VERSION "1.11"
62 67
68static char version[] __initdata =
69 "EtherH/EtherM Driver (c) 2002-2004 Russell King " DRV_VERSION "\n";
70
71#include "../lib8390.c"
72
63static unsigned int net_debug = NET_DEBUG; 73static unsigned int net_debug = NET_DEBUG;
64 74
65struct etherh_priv { 75struct etherh_priv {
@@ -87,9 +97,6 @@ MODULE_AUTHOR("Russell King");
87MODULE_DESCRIPTION("EtherH/EtherM driver"); 97MODULE_DESCRIPTION("EtherH/EtherM driver");
88MODULE_LICENSE("GPL"); 98MODULE_LICENSE("GPL");
89 99
90static char version[] __initdata =
91 "EtherH/EtherM Driver (c) 2002-2004 Russell King " DRV_VERSION "\n";
92
93#define ETHERH500_DATAPORT 0x800 /* MEMC */ 100#define ETHERH500_DATAPORT 0x800 /* MEMC */
94#define ETHERH500_NS8390 0x000 /* MEMC */ 101#define ETHERH500_NS8390 0x000 /* MEMC */
95#define ETHERH500_CTRLPORT 0x800 /* IOC */ 102#define ETHERH500_CTRLPORT 0x800 /* IOC */
@@ -360,7 +367,7 @@ etherh_block_output (struct net_device *dev, int count, const unsigned char *buf
360 printk(KERN_ERR "%s: timeout waiting for TX RDC\n", 367 printk(KERN_ERR "%s: timeout waiting for TX RDC\n",
361 dev->name); 368 dev->name);
362 etherh_reset (dev); 369 etherh_reset (dev);
363 NS8390_init (dev, 1); 370 __NS8390_init (dev, 1);
364 break; 371 break;
365 } 372 }
366 373
@@ -465,7 +472,7 @@ etherh_open(struct net_device *dev)
465 return -EINVAL; 472 return -EINVAL;
466 } 473 }
467 474
468 if (request_irq(dev->irq, ei_interrupt, 0, dev->name, dev)) 475 if (request_irq(dev->irq, __ei_interrupt, 0, dev->name, dev))
469 return -EAGAIN; 476 return -EAGAIN;
470 477
471 /* 478 /*
@@ -491,7 +498,7 @@ etherh_open(struct net_device *dev)
491 etherh_setif(dev); 498 etherh_setif(dev);
492 499
493 etherh_reset(dev); 500 etherh_reset(dev);
494 ei_open(dev); 501 __ei_open(dev);
495 502
496 return 0; 503 return 0;
497} 504}
@@ -502,7 +509,7 @@ etherh_open(struct net_device *dev)
502static int 509static int
503etherh_close(struct net_device *dev) 510etherh_close(struct net_device *dev)
504{ 511{
505 ei_close (dev); 512 __ei_close (dev);
506 free_irq (dev->irq, dev); 513 free_irq (dev->irq, dev);
507 return 0; 514 return 0;
508} 515}
@@ -650,7 +657,7 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
650 if (ret) 657 if (ret)
651 goto out; 658 goto out;
652 659
653 dev = __alloc_ei_netdev(sizeof(struct etherh_priv)); 660 dev = ____alloc_ei_netdev(sizeof(struct etherh_priv));
654 if (!dev) { 661 if (!dev) {
655 ret = -ENOMEM; 662 ret = -ENOMEM;
656 goto release; 663 goto release;
@@ -736,7 +743,7 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
736 ei_local->interface_num = 0; 743 ei_local->interface_num = 0;
737 744
738 etherh_reset(dev); 745 etherh_reset(dev);
739 NS8390_init(dev, 0); 746 __NS8390_init(dev, 0);
740 747
741 ret = register_netdev(dev); 748 ret = register_netdev(dev);
742 if (ret) 749 if (ret)