aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/fujitsu/at1700.c
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2012-05-16 19:48:42 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2012-05-17 16:37:41 -0400
commita5e371f61ad33c07b28e7c9b60c78d71fdd34e2a (patch)
tree8306d4f347a91d39f01a87d5c44d8c3b1c10bc69 /drivers/net/ethernet/fujitsu/at1700.c
parentbc6a4744b827c5a78ca591acca81809bddb8b2db (diff)
drivers/net: delete all code/drivers depending on CONFIG_MCA
The support for CONFIG_MCA is being removed, since the 20 year old hardware simply isn't capable of meeting today's software demands on CPU and memory resources. This commit removes any MCA specific net drivers, and removes any MCA specific probe/support code from drivers that were doing a dual ISA/MCA role. Cc: "David S. Miller" <davem@davemloft.net> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: netdev@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'drivers/net/ethernet/fujitsu/at1700.c')
-rw-r--r--drivers/net/ethernet/fujitsu/at1700.c120
1 files changed, 6 insertions, 114 deletions
diff --git a/drivers/net/ethernet/fujitsu/at1700.c b/drivers/net/ethernet/fujitsu/at1700.c
index 3d94797c8f9b..4b80dc4531ad 100644
--- a/drivers/net/ethernet/fujitsu/at1700.c
+++ b/drivers/net/ethernet/fujitsu/at1700.c
@@ -27,7 +27,7 @@
27 ATI provided their EEPROM configuration code header file. 27 ATI provided their EEPROM configuration code header file.
28 Thanks to NIIBE Yutaka <gniibe@mri.co.jp> for bug fixes. 28 Thanks to NIIBE Yutaka <gniibe@mri.co.jp> for bug fixes.
29 29
30 MCA bus (AT1720) support by Rene Schmit <rene@bss.lu> 30 MCA bus (AT1720) support (now deleted) by Rene Schmit <rene@bss.lu>
31 31
32 Bugs: 32 Bugs:
33 The MB86965 has a design flaw that makes all probes unreliable. Not 33 The MB86965 has a design flaw that makes all probes unreliable. Not
@@ -38,7 +38,6 @@
38#include <linux/errno.h> 38#include <linux/errno.h>
39#include <linux/netdevice.h> 39#include <linux/netdevice.h>
40#include <linux/etherdevice.h> 40#include <linux/etherdevice.h>
41#include <linux/mca-legacy.h>
42#include <linux/module.h> 41#include <linux/module.h>
43#include <linux/kernel.h> 42#include <linux/kernel.h>
44#include <linux/types.h> 43#include <linux/types.h>
@@ -79,24 +78,6 @@ static unsigned at1700_probe_list[] __initdata = {
79 0x260, 0x280, 0x2a0, 0x240, 0x340, 0x320, 0x380, 0x300, 0 78 0x260, 0x280, 0x2a0, 0x240, 0x340, 0x320, 0x380, 0x300, 0
80}; 79};
81 80
82/*
83 * MCA
84 */
85#ifdef CONFIG_MCA_LEGACY
86static int at1700_ioaddr_pattern[] __initdata = {
87 0x00, 0x04, 0x01, 0x05, 0x02, 0x06, 0x03, 0x07
88};
89
90static int at1700_mca_probe_list[] __initdata = {
91 0x400, 0x1400, 0x2400, 0x3400, 0x4400, 0x5400, 0x6400, 0x7400, 0
92};
93
94static int at1700_irq_pattern[] __initdata = {
95 0x00, 0x00, 0x00, 0x30, 0x70, 0xb0, 0x00, 0x00,
96 0x00, 0xf0, 0x34, 0x74, 0xb4, 0x00, 0x00, 0xf4, 0x00
97};
98#endif
99
100/* use 0 for production, 1 for verification, >2 for debug */ 81/* use 0 for production, 1 for verification, >2 for debug */
101#ifndef NET_DEBUG 82#ifndef NET_DEBUG
102#define NET_DEBUG 1 83#define NET_DEBUG 1
@@ -114,7 +95,6 @@ struct net_local {
114 uint tx_queue_ready:1; /* Tx queue is ready to be sent. */ 95 uint tx_queue_ready:1; /* Tx queue is ready to be sent. */
115 uint rx_started:1; /* Packets are Rxing. */ 96 uint rx_started:1; /* Packets are Rxing. */
116 uchar tx_queue; /* Number of packet on the Tx queue. */ 97 uchar tx_queue; /* Number of packet on the Tx queue. */
117 char mca_slot; /* -1 means ISA */
118 ushort tx_queue_len; /* Current length of the Tx queue. */ 98 ushort tx_queue_len; /* Current length of the Tx queue. */
119}; 99};
120 100
@@ -166,21 +146,6 @@ static void set_rx_mode(struct net_device *dev);
166static void net_tx_timeout (struct net_device *dev); 146static void net_tx_timeout (struct net_device *dev);
167 147
168 148
169#ifdef CONFIG_MCA_LEGACY
170struct at1720_mca_adapters_struct {
171 char* name;
172 int id;
173};
174/* rEnE : maybe there are others I don't know off... */
175
176static struct at1720_mca_adapters_struct at1720_mca_adapters[] __initdata = {
177 { "Allied Telesys AT1720AT", 0x6410 },
178 { "Allied Telesys AT1720BT", 0x6413 },
179 { "Allied Telesys AT1720T", 0x6416 },
180 { NULL, 0 },
181};
182#endif
183
184/* Check for a network adaptor of this type, and return '0' iff one exists. 149/* Check for a network adaptor of this type, and return '0' iff one exists.
185 If dev->base_addr == 0, probe all likely locations. 150 If dev->base_addr == 0, probe all likely locations.
186 If dev->base_addr == 1, always return failure. 151 If dev->base_addr == 1, always return failure.
@@ -194,11 +159,6 @@ static int irq;
194 159
195static void cleanup_card(struct net_device *dev) 160static void cleanup_card(struct net_device *dev)
196{ 161{
197#ifdef CONFIG_MCA_LEGACY
198 struct net_local *lp = netdev_priv(dev);
199 if (lp->mca_slot >= 0)
200 mca_mark_as_unused(lp->mca_slot);
201#endif
202 free_irq(dev->irq, NULL); 162 free_irq(dev->irq, NULL);
203 release_region(dev->base_addr, AT1700_IO_EXTENT); 163 release_region(dev->base_addr, AT1700_IO_EXTENT);
204} 164}
@@ -273,7 +233,7 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
273 static const char fmv_irqmap_pnp[8] = {3, 4, 5, 7, 9, 10, 11, 15}; 233 static const char fmv_irqmap_pnp[8] = {3, 4, 5, 7, 9, 10, 11, 15};
274 static const char at1700_irqmap[8] = {3, 4, 5, 9, 10, 11, 14, 15}; 234 static const char at1700_irqmap[8] = {3, 4, 5, 9, 10, 11, 14, 15};
275 unsigned int i, irq, is_fmv18x = 0, is_at1700 = 0; 235 unsigned int i, irq, is_fmv18x = 0, is_at1700 = 0;
276 int slot, ret = -ENODEV; 236 int ret = -ENODEV;
277 struct net_local *lp = netdev_priv(dev); 237 struct net_local *lp = netdev_priv(dev);
278 238
279 if (!request_region(ioaddr, AT1700_IO_EXTENT, DRV_NAME)) 239 if (!request_region(ioaddr, AT1700_IO_EXTENT, DRV_NAME))
@@ -288,64 +248,6 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
288 ioaddr, read_eeprom(ioaddr, 4), read_eeprom(ioaddr, 5), 248 ioaddr, read_eeprom(ioaddr, 4), read_eeprom(ioaddr, 5),
289 read_eeprom(ioaddr, 6), inw(ioaddr + EEPROM_Ctrl)); 249 read_eeprom(ioaddr, 6), inw(ioaddr + EEPROM_Ctrl));
290#endif 250#endif
291
292#ifdef CONFIG_MCA_LEGACY
293 /* rEnE (rene@bss.lu): got this from 3c509 driver source , adapted for AT1720 */
294
295 /* Based on Erik Nygren's (nygren@mit.edu) 3c529 patch, heavily
296 modified by Chris Beauregard (cpbeaure@csclub.uwaterloo.ca)
297 to support standard MCA probing. */
298
299 /* redone for multi-card detection by ZP Gu (zpg@castle.net) */
300 /* now works as a module */
301
302 if (MCA_bus) {
303 int j;
304 int l_i;
305 u_char pos3, pos4;
306
307 for (j = 0; at1720_mca_adapters[j].name != NULL; j ++) {
308 slot = 0;
309 while (slot != MCA_NOTFOUND) {
310
311 slot = mca_find_unused_adapter( at1720_mca_adapters[j].id, slot );
312 if (slot == MCA_NOTFOUND) break;
313
314 /* if we get this far, an adapter has been detected and is
315 enabled */
316
317 pos3 = mca_read_stored_pos( slot, 3 );
318 pos4 = mca_read_stored_pos( slot, 4 );
319
320 for (l_i = 0; l_i < 8; l_i++)
321 if (( pos3 & 0x07) == at1700_ioaddr_pattern[l_i])
322 break;
323 ioaddr = at1700_mca_probe_list[l_i];
324
325 for (irq = 0; irq < 0x10; irq++)
326 if (((((pos4>>4) & 0x0f) | (pos3 & 0xf0)) & 0xff) == at1700_irq_pattern[irq])
327 break;
328
329 /* probing for a card at a particular IO/IRQ */
330 if ((dev->irq && dev->irq != irq) ||
331 (dev->base_addr && dev->base_addr != ioaddr)) {
332 slot++; /* probing next slot */
333 continue;
334 }
335
336 dev->irq = irq;
337
338 /* claim the slot */
339 mca_set_adapter_name( slot, at1720_mca_adapters[j].name );
340 mca_mark_as_used(slot);
341
342 goto found;
343 }
344 }
345 /* if we get here, we didn't find an MCA adapter - try ISA */
346 }
347#endif
348 slot = -1;
349 /* We must check for the EEPROM-config boards first, else accessing 251 /* We must check for the EEPROM-config boards first, else accessing
350 IOCONFIG0 will move the board! */ 252 IOCONFIG0 will move the board! */
351 if (at1700_probe_list[inb(ioaddr + IOCONFIG1) & 0x07] == ioaddr && 253 if (at1700_probe_list[inb(ioaddr + IOCONFIG1) & 0x07] == ioaddr &&
@@ -360,11 +262,7 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
360 goto err_out; 262 goto err_out;
361 } 263 }
362 264
363#ifdef CONFIG_MCA_LEGACY 265 /* Reset the internal state machines. */
364found:
365#endif
366
367 /* Reset the internal state machines. */
368 outb(0, ioaddr + RESET); 266 outb(0, ioaddr + RESET);
369 267
370 if (is_at1700) { 268 if (is_at1700) {
@@ -380,11 +278,11 @@ found:
380 break; 278 break;
381 } 279 }
382 if (i == 8) { 280 if (i == 8) {
383 goto err_mca; 281 goto err_out;
384 } 282 }
385 } else { 283 } else {
386 if (fmv18x_probe_list[inb(ioaddr + IOCONFIG) & 0x07] != ioaddr) 284 if (fmv18x_probe_list[inb(ioaddr + IOCONFIG) & 0x07] != ioaddr)
387 goto err_mca; 285 goto err_out;
388 irq = fmv_irqmap[(inb(ioaddr + IOCONFIG)>>6) & 0x03]; 286 irq = fmv_irqmap[(inb(ioaddr + IOCONFIG)>>6) & 0x03];
389 } 287 }
390 } 288 }
@@ -464,23 +362,17 @@ found:
464 spin_lock_init(&lp->lock); 362 spin_lock_init(&lp->lock);
465 363
466 lp->jumpered = is_fmv18x; 364 lp->jumpered = is_fmv18x;
467 lp->mca_slot = slot;
468 /* Snarf the interrupt vector now. */ 365 /* Snarf the interrupt vector now. */
469 ret = request_irq(irq, net_interrupt, 0, DRV_NAME, dev); 366 ret = request_irq(irq, net_interrupt, 0, DRV_NAME, dev);
470 if (ret) { 367 if (ret) {
471 printk(KERN_ERR "AT1700 at %#3x is unusable due to a " 368 printk(KERN_ERR "AT1700 at %#3x is unusable due to a "
472 "conflict on IRQ %d.\n", 369 "conflict on IRQ %d.\n",
473 ioaddr, irq); 370 ioaddr, irq);
474 goto err_mca; 371 goto err_out;
475 } 372 }
476 373
477 return 0; 374 return 0;
478 375
479err_mca:
480#ifdef CONFIG_MCA_LEGACY
481 if (slot >= 0)
482 mca_mark_as_unused(slot);
483#endif
484err_out: 376err_out:
485 release_region(ioaddr, AT1700_IO_EXTENT); 377 release_region(ioaddr, AT1700_IO_EXTENT);
486 return ret; 378 return ret;