aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2008-07-04 02:43:12 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-07-04 08:47:51 -0400
commit055e5110ae0c0c1176a75b78d789294f2ff2f7af (patch)
treec17450678079c1cf2e1affc2789d2742dbb10c64 /drivers/net
parent141766cf9755e773b980238da52f5f5da5c69abe (diff)
8390: Split 8390 support into a pausing and a non pausing driver core
Only a few ISA controllers need the pausing version of the 8390 core while PCMCIA, later ISA and PCI do not. More importantly the ISA delays can break non ISA boxes so we must use a different build of 8390.c for the two sets of controllers. No changes since last time as all the points of concerns raised proved to be invalid Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/3c503.c14
-rw-r--r--drivers/net/8390.h18
-rw-r--r--drivers/net/8390p.c66
-rw-r--r--drivers/net/Makefile10
-rw-r--r--drivers/net/hp.c14
-rw-r--r--drivers/net/ne.c14
-rw-r--r--drivers/net/ne2.c16
7 files changed, 116 insertions, 36 deletions
diff --git a/drivers/net/3c503.c b/drivers/net/3c503.c
index 9c23336750e2..900b0ffdcc68 100644
--- a/drivers/net/3c503.c
+++ b/drivers/net/3c503.c
@@ -149,7 +149,7 @@ el2_pio_probe(struct net_device *dev)
149#ifndef MODULE 149#ifndef MODULE
150struct net_device * __init el2_probe(int unit) 150struct net_device * __init el2_probe(int unit)
151{ 151{
152 struct net_device *dev = alloc_ei_netdev(); 152 struct net_device *dev = alloc_eip_netdev();
153 int err; 153 int err;
154 154
155 if (!dev) 155 if (!dev)
@@ -340,7 +340,7 @@ el2_probe1(struct net_device *dev, int ioaddr)
340 dev->stop = &el2_close; 340 dev->stop = &el2_close;
341 dev->ethtool_ops = &netdev_ethtool_ops; 341 dev->ethtool_ops = &netdev_ethtool_ops;
342#ifdef CONFIG_NET_POLL_CONTROLLER 342#ifdef CONFIG_NET_POLL_CONTROLLER
343 dev->poll_controller = ei_poll; 343 dev->poll_controller = eip_poll;
344#endif 344#endif
345 345
346 retval = register_netdev(dev); 346 retval = register_netdev(dev);
@@ -386,7 +386,7 @@ el2_open(struct net_device *dev)
386 outb_p(0x00, E33G_IDCFR); 386 outb_p(0x00, E33G_IDCFR);
387 if (*irqp == probe_irq_off(cookie) /* It's a good IRQ line! */ 387 if (*irqp == probe_irq_off(cookie) /* It's a good IRQ line! */
388 && ((retval = request_irq(dev->irq = *irqp, 388 && ((retval = request_irq(dev->irq = *irqp,
389 ei_interrupt, 0, dev->name, dev)) == 0)) 389 eip_interrupt, 0, dev->name, dev)) == 0))
390 break; 390 break;
391 } 391 }
392 } while (*++irqp); 392 } while (*++irqp);
@@ -395,13 +395,13 @@ el2_open(struct net_device *dev)
395 return retval; 395 return retval;
396 } 396 }
397 } else { 397 } else {
398 if ((retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev))) { 398 if ((retval = request_irq(dev->irq, eip_interrupt, 0, dev->name, dev))) {
399 return retval; 399 return retval;
400 } 400 }
401 } 401 }
402 402
403 el2_init_card(dev); 403 el2_init_card(dev);
404 ei_open(dev); 404 eip_open(dev);
405 return 0; 405 return 0;
406} 406}
407 407
@@ -412,7 +412,7 @@ el2_close(struct net_device *dev)
412 dev->irq = ei_status.saved_irq; 412 dev->irq = ei_status.saved_irq;
413 outb(EGACFR_IRQOFF, E33G_GACFR); /* disable interrupts. */ 413 outb(EGACFR_IRQOFF, E33G_GACFR); /* disable interrupts. */
414 414
415 ei_close(dev); 415 eip_close(dev);
416 return 0; 416 return 0;
417} 417}
418 418
@@ -698,7 +698,7 @@ init_module(void)
698 if (this_dev != 0) break; /* only autoprobe 1st one */ 698 if (this_dev != 0) break; /* only autoprobe 1st one */
699 printk(KERN_NOTICE "3c503.c: Presently autoprobing (not recommended) for a single card.\n"); 699 printk(KERN_NOTICE "3c503.c: Presently autoprobing (not recommended) for a single card.\n");
700 } 700 }
701 dev = alloc_ei_netdev(); 701 dev = alloc_eip_netdev();
702 if (!dev) 702 if (!dev)
703 break; 703 break;
704 dev->irq = irq[this_dev]; 704 dev->irq = irq[this_dev];
diff --git a/drivers/net/8390.h b/drivers/net/8390.h
index cf020d45aea6..8e209f5e7c11 100644
--- a/drivers/net/8390.h
+++ b/drivers/net/8390.h
@@ -30,8 +30,10 @@ extern int ei_debug;
30 30
31#ifdef CONFIG_NET_POLL_CONTROLLER 31#ifdef CONFIG_NET_POLL_CONTROLLER
32extern void ei_poll(struct net_device *dev); 32extern void ei_poll(struct net_device *dev);
33extern void eip_poll(struct net_device *dev);
33#endif 34#endif
34 35
36/* Without I/O delay - non ISA or later chips */
35extern void NS8390_init(struct net_device *dev, int startp); 37extern void NS8390_init(struct net_device *dev, int startp);
36extern int ei_open(struct net_device *dev); 38extern int ei_open(struct net_device *dev);
37extern int ei_close(struct net_device *dev); 39extern int ei_close(struct net_device *dev);
@@ -42,6 +44,17 @@ static inline struct net_device *alloc_ei_netdev(void)
42 return __alloc_ei_netdev(0); 44 return __alloc_ei_netdev(0);
43} 45}
44 46
47/* With I/O delay form */
48extern void NS8390p_init(struct net_device *dev, int startp);
49extern int eip_open(struct net_device *dev);
50extern int eip_close(struct net_device *dev);
51extern irqreturn_t eip_interrupt(int irq, void *dev_id);
52extern struct net_device *__alloc_eip_netdev(int size);
53static inline struct net_device *alloc_eip_netdev(void)
54{
55 return __alloc_eip_netdev(0);
56}
57
45/* You have one of these per-board */ 58/* You have one of these per-board */
46struct ei_device { 59struct ei_device {
47 const char *name; 60 const char *name;
@@ -115,13 +128,14 @@ struct ei_device {
115/* 128/*
116 * Only generate indirect loads given a machine that needs them. 129 * Only generate indirect loads given a machine that needs them.
117 * - removed AMIGA_PCMCIA from this list, handled as ISA io now 130 * - removed AMIGA_PCMCIA from this list, handled as ISA io now
131 * - the _p for generates no delay by default 8390p.c overrides this.
118 */ 132 */
119 133
120#ifndef ei_inb 134#ifndef ei_inb
121#define ei_inb(_p) inb(_p) 135#define ei_inb(_p) inb(_p)
122#define ei_outb(_v,_p) outb(_v,_p) 136#define ei_outb(_v,_p) outb(_v,_p)
123#define ei_inb_p(_p) inb_p(_p) 137#define ei_inb_p(_p) inb(_p)
124#define ei_outb_p(_v,_p) outb_p(_v,_p) 138#define ei_outb_p(_v,_p) outb(_v,_p)
125#endif 139#endif
126 140
127#ifndef EI_SHIFT 141#ifndef EI_SHIFT
diff --git a/drivers/net/8390p.c b/drivers/net/8390p.c
new file mode 100644
index 000000000000..71f19884c4b1
--- /dev/null
+++ b/drivers/net/8390p.c
@@ -0,0 +1,66 @@
1/* 8390 core for ISA devices needing bus delays */
2
3static const char version[] =
4 "8390p.c:v1.10cvs 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
5
6#define ei_inb(_p) inb(_p)
7#define ei_outb(_v,_p) outb(_v,_p)
8#define ei_inb_p(_p) inb_p(_p)
9#define ei_outb_p(_v,_p) outb_p(_v,_p)
10
11#include "lib8390.c"
12
13int eip_open(struct net_device *dev)
14{
15 return __ei_open(dev);
16}
17
18int eip_close(struct net_device *dev)
19{
20 return __ei_close(dev);
21}
22
23irqreturn_t eip_interrupt(int irq, void *dev_id)
24{
25 return __ei_interrupt(irq, dev_id);
26}
27
28#ifdef CONFIG_NET_POLL_CONTROLLER
29void eip_poll(struct net_device *dev)
30{
31 __ei_poll(dev);
32}
33#endif
34
35struct net_device *__alloc_eip_netdev(int size)
36{
37 return ____alloc_ei_netdev(size);
38}
39
40void NS8390p_init(struct net_device *dev, int startp)
41{
42 return __NS8390_init(dev, startp);
43}
44
45EXPORT_SYMBOL(eip_open);
46EXPORT_SYMBOL(eip_close);
47EXPORT_SYMBOL(eip_interrupt);
48#ifdef CONFIG_NET_POLL_CONTROLLER
49EXPORT_SYMBOL(eip_poll);
50#endif
51EXPORT_SYMBOL(NS8390p_init);
52EXPORT_SYMBOL(__alloc_eip_netdev);
53
54#if defined(MODULE)
55
56int init_module(void)
57{
58 return 0;
59}
60
61void cleanup_module(void)
62{
63}
64
65#endif /* MODULE */
66MODULE_LICENSE("GPL");
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 87703ffd4c1e..4beb043e09e6 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -106,11 +106,11 @@ ifeq ($(CONFIG_FEC_MPC52xx_MDIO),y)
106endif 106endif
107obj-$(CONFIG_68360_ENET) += 68360enet.o 107obj-$(CONFIG_68360_ENET) += 68360enet.o
108obj-$(CONFIG_WD80x3) += wd.o 8390.o 108obj-$(CONFIG_WD80x3) += wd.o 8390.o
109obj-$(CONFIG_EL2) += 3c503.o 8390.o 109obj-$(CONFIG_EL2) += 3c503.o 8390p.o
110obj-$(CONFIG_NE2000) += ne.o 8390.o 110obj-$(CONFIG_NE2000) += ne.o 8390p.o
111obj-$(CONFIG_NE2_MCA) += ne2.o 8390.o 111obj-$(CONFIG_NE2_MCA) += ne2.o 8390p.o
112obj-$(CONFIG_HPLAN) += hp.o 8390.o 112obj-$(CONFIG_HPLAN) += hp.o 8390p.o
113obj-$(CONFIG_HPLAN_PLUS) += hp-plus.o 8390.o 113obj-$(CONFIG_HPLAN_PLUS) += hp-plus.o 8390p.o
114obj-$(CONFIG_ULTRA) += smc-ultra.o 8390.o 114obj-$(CONFIG_ULTRA) += smc-ultra.o 8390.o
115obj-$(CONFIG_ULTRAMCA) += smc-mca.o 8390.o 115obj-$(CONFIG_ULTRAMCA) += smc-mca.o 8390.o
116obj-$(CONFIG_ULTRA32) += smc-ultra32.o 8390.o 116obj-$(CONFIG_ULTRA32) += smc-ultra32.o 8390.o
diff --git a/drivers/net/hp.c b/drivers/net/hp.c
index c649a8019beb..8281209ededf 100644
--- a/drivers/net/hp.c
+++ b/drivers/net/hp.c
@@ -103,7 +103,7 @@ static int __init do_hp_probe(struct net_device *dev)
103#ifndef MODULE 103#ifndef MODULE
104struct net_device * __init hp_probe(int unit) 104struct net_device * __init hp_probe(int unit)
105{ 105{
106 struct net_device *dev = alloc_ei_netdev(); 106 struct net_device *dev = alloc_eip_netdev();
107 int err; 107 int err;
108 108
109 if (!dev) 109 if (!dev)
@@ -176,7 +176,7 @@ static int __init hp_probe1(struct net_device *dev, int ioaddr)
176 outb_p(irqmap[irq] | HP_RUN, ioaddr + HP_CONFIGURE); 176 outb_p(irqmap[irq] | HP_RUN, ioaddr + HP_CONFIGURE);
177 outb_p( 0x00 | HP_RUN, ioaddr + HP_CONFIGURE); 177 outb_p( 0x00 | HP_RUN, ioaddr + HP_CONFIGURE);
178 if (irq == probe_irq_off(cookie) /* It's a good IRQ line! */ 178 if (irq == probe_irq_off(cookie) /* It's a good IRQ line! */
179 && request_irq (irq, ei_interrupt, 0, DRV_NAME, dev) == 0) { 179 && request_irq (irq, eip_interrupt, 0, DRV_NAME, dev) == 0) {
180 printk(" selecting IRQ %d.\n", irq); 180 printk(" selecting IRQ %d.\n", irq);
181 dev->irq = *irqp; 181 dev->irq = *irqp;
182 break; 182 break;
@@ -191,7 +191,7 @@ static int __init hp_probe1(struct net_device *dev, int ioaddr)
191 } else { 191 } else {
192 if (dev->irq == 2) 192 if (dev->irq == 2)
193 dev->irq = 9; 193 dev->irq = 9;
194 if ((retval = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev))) { 194 if ((retval = request_irq(dev->irq, eip_interrupt, 0, DRV_NAME, dev))) {
195 printk (" unable to get IRQ %d.\n", dev->irq); 195 printk (" unable to get IRQ %d.\n", dev->irq);
196 goto out; 196 goto out;
197 } 197 }
@@ -202,7 +202,7 @@ static int __init hp_probe1(struct net_device *dev, int ioaddr)
202 dev->open = &hp_open; 202 dev->open = &hp_open;
203 dev->stop = &hp_close; 203 dev->stop = &hp_close;
204#ifdef CONFIG_NET_POLL_CONTROLLER 204#ifdef CONFIG_NET_POLL_CONTROLLER
205 dev->poll_controller = ei_poll; 205 dev->poll_controller = eip_poll;
206#endif 206#endif
207 207
208 ei_status.name = name; 208 ei_status.name = name;
@@ -231,14 +231,14 @@ out:
231static int 231static int
232hp_open(struct net_device *dev) 232hp_open(struct net_device *dev)
233{ 233{
234 ei_open(dev); 234 eip_open(dev);
235 return 0; 235 return 0;
236} 236}
237 237
238static int 238static int
239hp_close(struct net_device *dev) 239hp_close(struct net_device *dev)
240{ 240{
241 ei_close(dev); 241 eip_close(dev);
242 return 0; 242 return 0;
243} 243}
244 244
@@ -421,7 +421,7 @@ init_module(void)
421 if (this_dev != 0) break; /* only autoprobe 1st one */ 421 if (this_dev != 0) break; /* only autoprobe 1st one */
422 printk(KERN_NOTICE "hp.c: Presently autoprobing (not recommended) for a single card.\n"); 422 printk(KERN_NOTICE "hp.c: Presently autoprobing (not recommended) for a single card.\n");
423 } 423 }
424 dev = alloc_ei_netdev(); 424 dev = alloc_eip_netdev();
425 if (!dev) 425 if (!dev)
426 break; 426 break;
427 dev->irq = irq[this_dev]; 427 dev->irq = irq[this_dev];
diff --git a/drivers/net/ne.c b/drivers/net/ne.c
index 874d291cbaed..14126973bd12 100644
--- a/drivers/net/ne.c
+++ b/drivers/net/ne.c
@@ -217,7 +217,7 @@ static int __init do_ne_probe(struct net_device *dev)
217#ifndef MODULE 217#ifndef MODULE
218struct net_device * __init ne_probe(int unit) 218struct net_device * __init ne_probe(int unit)
219{ 219{
220 struct net_device *dev = alloc_ei_netdev(); 220 struct net_device *dev = alloc_eip_netdev();
221 int err; 221 int err;
222 222
223 if (!dev) 223 if (!dev)
@@ -490,7 +490,7 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
490 490
491 /* Snarf the interrupt now. There's no point in waiting since we cannot 491 /* Snarf the interrupt now. There's no point in waiting since we cannot
492 share and the board will usually be enabled. */ 492 share and the board will usually be enabled. */
493 ret = request_irq(dev->irq, ei_interrupt, 0, name, dev); 493 ret = request_irq(dev->irq, eip_interrupt, 0, name, dev);
494 if (ret) { 494 if (ret) {
495 printk (" unable to get IRQ %d (errno=%d).\n", dev->irq, ret); 495 printk (" unable to get IRQ %d (errno=%d).\n", dev->irq, ret);
496 goto err_out; 496 goto err_out;
@@ -534,7 +534,7 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
534 dev->open = &ne_open; 534 dev->open = &ne_open;
535 dev->stop = &ne_close; 535 dev->stop = &ne_close;
536#ifdef CONFIG_NET_POLL_CONTROLLER 536#ifdef CONFIG_NET_POLL_CONTROLLER
537 dev->poll_controller = ei_poll; 537 dev->poll_controller = eip_poll;
538#endif 538#endif
539 NS8390_init(dev, 0); 539 NS8390_init(dev, 0);
540 540
@@ -554,7 +554,7 @@ err_out:
554 554
555static int ne_open(struct net_device *dev) 555static int ne_open(struct net_device *dev)
556{ 556{
557 ei_open(dev); 557 eip_open(dev);
558 return 0; 558 return 0;
559} 559}
560 560
@@ -562,7 +562,7 @@ static int ne_close(struct net_device *dev)
562{ 562{
563 if (ei_debug > 1) 563 if (ei_debug > 1)
564 printk(KERN_DEBUG "%s: Shutting down ethercard.\n", dev->name); 564 printk(KERN_DEBUG "%s: Shutting down ethercard.\n", dev->name);
565 ei_close(dev); 565 eip_close(dev);
566 return 0; 566 return 0;
567} 567}
568 568
@@ -814,7 +814,7 @@ static int __init ne_drv_probe(struct platform_device *pdev)
814 if (!res || irq < 0) 814 if (!res || irq < 0)
815 return -ENODEV; 815 return -ENODEV;
816 816
817 dev = alloc_ei_netdev(); 817 dev = alloc_eip_netdev();
818 if (!dev) 818 if (!dev)
819 return -ENOMEM; 819 return -ENOMEM;
820 dev->irq = irq; 820 dev->irq = irq;
@@ -912,7 +912,7 @@ int __init init_module(void)
912 int plat_found = !ne_init(); 912 int plat_found = !ne_init();
913 913
914 for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) { 914 for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
915 struct net_device *dev = alloc_ei_netdev(); 915 struct net_device *dev = alloc_eip_netdev();
916 if (!dev) 916 if (!dev)
917 break; 917 break;
918 dev->irq = irq[this_dev]; 918 dev->irq = irq[this_dev];
diff --git a/drivers/net/ne2.c b/drivers/net/ne2.c
index f4cd8c7e81ba..8f7256346922 100644
--- a/drivers/net/ne2.c
+++ b/drivers/net/ne2.c
@@ -280,7 +280,7 @@ static int __init do_ne2_probe(struct net_device *dev)
280#ifndef MODULE 280#ifndef MODULE
281struct net_device * __init ne2_probe(int unit) 281struct net_device * __init ne2_probe(int unit)
282{ 282{
283 struct net_device *dev = alloc_ei_netdev(); 283 struct net_device *dev = alloc_eip_netdev();
284 int err; 284 int err;
285 285
286 if (!dev) 286 if (!dev)
@@ -457,7 +457,7 @@ static int __init ne2_probe1(struct net_device *dev, int slot)
457 457
458 /* Snarf the interrupt now. There's no point in waiting since we cannot 458 /* Snarf the interrupt now. There's no point in waiting since we cannot
459 share and the board will usually be enabled. */ 459 share and the board will usually be enabled. */
460 retval = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev); 460 retval = request_irq(dev->irq, eip_interrupt, 0, DRV_NAME, dev);
461 if (retval) { 461 if (retval) {
462 printk (" unable to get IRQ %d (irqval=%d).\n", 462 printk (" unable to get IRQ %d (irqval=%d).\n",
463 dev->irq, retval); 463 dev->irq, retval);
@@ -497,9 +497,9 @@ static int __init ne2_probe1(struct net_device *dev, int slot)
497 dev->open = &ne_open; 497 dev->open = &ne_open;
498 dev->stop = &ne_close; 498 dev->stop = &ne_close;
499#ifdef CONFIG_NET_POLL_CONTROLLER 499#ifdef CONFIG_NET_POLL_CONTROLLER
500 dev->poll_controller = ei_poll; 500 dev->poll_controller = eip_poll;
501#endif 501#endif
502 NS8390_init(dev, 0); 502 NS8390p_init(dev, 0);
503 503
504 retval = register_netdev(dev); 504 retval = register_netdev(dev);
505 if (retval) 505 if (retval)
@@ -515,7 +515,7 @@ out:
515 515
516static int ne_open(struct net_device *dev) 516static int ne_open(struct net_device *dev)
517{ 517{
518 ei_open(dev); 518 eip_open(dev);
519 return 0; 519 return 0;
520} 520}
521 521
@@ -523,7 +523,7 @@ static int ne_close(struct net_device *dev)
523{ 523{
524 if (ei_debug > 1) 524 if (ei_debug > 1)
525 printk("%s: Shutting down ethercard.\n", dev->name); 525 printk("%s: Shutting down ethercard.\n", dev->name);
526 ei_close(dev); 526 eip_close(dev);
527 return 0; 527 return 0;
528} 528}
529 529
@@ -748,7 +748,7 @@ retry:
748 if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */ 748 if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */
749 printk("%s: timeout waiting for Tx RDC.\n", dev->name); 749 printk("%s: timeout waiting for Tx RDC.\n", dev->name);
750 ne_reset_8390(dev); 750 ne_reset_8390(dev);
751 NS8390_init(dev,1); 751 NS8390p_init(dev, 1);
752 break; 752 break;
753 } 753 }
754 754
@@ -781,7 +781,7 @@ int __init init_module(void)
781 int this_dev, found = 0; 781 int this_dev, found = 0;
782 782
783 for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) { 783 for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
784 dev = alloc_ei_netdev(); 784 dev = alloc_eip_netdev();
785 if (!dev) 785 if (!dev)
786 break; 786 break;
787 dev->irq = irq[this_dev]; 787 dev->irq = irq[this_dev];