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>
This commit is contained in:
Paul Gortmaker 2012-05-16 19:48:42 -04:00
parent bc6a4744b8
commit a5e371f61a
19 changed files with 18 additions and 5369 deletions

View file

@ -25,7 +25,6 @@ models:
3c509B (later revision of the ISA card; supports full-duplex)
3c589 (PCMCIA)
3c589B (later revision of the 3c589; supports full-duplex)
3c529 (MCA)
3c579 (EISA)
Large portions of this documentation were heavily borrowed from the guide

View file

@ -11,12 +11,10 @@ i386, alpha (untested), powerpc, sparc and sparc64 archs.
The intent is to enable the use of different models of FORE adapters at the
same time, by hosts that have several bus interfaces (such as PCI+SBUS,
PCI+MCA or PCI+EISA).
or PCI+EISA).
Only PCI and SBUS devices are currently supported by the driver, but support
for other bus interfaces such as EISA should not be too hard to add (this may
be more tricky for the MCA bus, though, as FORE made some MCA-specific
modifications to the adapter's AALI interface).
for other bus interfaces such as EISA should not be too hard to add.
Firmware Copyright Notice

View file

@ -133,22 +133,9 @@ static struct devprobe2 eisa_probes[] __initdata = {
{NULL, 0},
};
static struct devprobe2 mca_probes[] __initdata = {
#ifdef CONFIG_NE2_MCA
{ne2_probe, 0},
#endif
#ifdef CONFIG_ELMC /* 3c523 */
{elmc_probe, 0},
#endif
#ifdef CONFIG_ELMC_II /* 3c527 */
{mc32_probe, 0},
#endif
{NULL, 0},
};
/*
* ISA probes that touch addresses < 0x400 (including those that also
* look for EISA/PCI/MCA cards in addition to ISA cards).
* look for EISA/PCI cards in addition to ISA cards).
*/
static struct devprobe2 isa_probes[] __initdata = {
#if defined(CONFIG_HP100) && defined(CONFIG_ISA) /* ISA, EISA */
@ -278,7 +265,6 @@ static void __init ethif_probe2(int unit)
(void)( probe_list2(unit, m68k_probes, base_addr == 0) &&
probe_list2(unit, eisa_probes, base_addr == 0) &&
probe_list2(unit, mca_probes, base_addr == 0) &&
probe_list2(unit, isa_probes, base_addr == 0) &&
probe_list2(unit, parport_probes, base_addr == 0));
}

View file

@ -69,7 +69,6 @@
#define TX_TIMEOUT (400*HZ/1000)
#include <linux/module.h>
#include <linux/mca.h>
#include <linux/isa.h>
#include <linux/pnp.h>
#include <linux/string.h>
@ -102,7 +101,7 @@ static int el3_debug = 2;
#endif
/* Used to do a global count of all the cards in the system. Must be
* a global variable so that the mca/eisa probe routines can increment
* a global variable so that the eisa probe routines can increment
* it */
static int el3_cards = 0;
#define EL3_MAX_CARDS 8
@ -163,7 +162,7 @@ enum RxFilter {
*/
#define SKB_QUEUE_SIZE 64
enum el3_cardtype { EL3_ISA, EL3_PNP, EL3_MCA, EL3_EISA };
enum el3_cardtype { EL3_ISA, EL3_PNP, EL3_EISA };
struct el3_private {
spinlock_t lock;
@ -505,41 +504,6 @@ static struct eisa_driver el3_eisa_driver = {
static int eisa_registered;
#endif
#ifdef CONFIG_MCA
static int el3_mca_probe(struct device *dev);
static short el3_mca_adapter_ids[] __initdata = {
0x627c,
0x627d,
0x62db,
0x62f6,
0x62f7,
0x0000
};
static char *el3_mca_adapter_names[] __initdata = {
"3Com 3c529 EtherLink III (10base2)",
"3Com 3c529 EtherLink III (10baseT)",
"3Com 3c529 EtherLink III (test mode)",
"3Com 3c529 EtherLink III (TP or coax)",
"3Com 3c529 EtherLink III (TP)",
NULL
};
static struct mca_driver el3_mca_driver = {
.id_table = el3_mca_adapter_ids,
.driver = {
.name = "3c529",
.bus = &mca_bus_type,
.probe = el3_mca_probe,
.remove = __devexit_p(el3_device_remove),
.suspend = el3_suspend,
.resume = el3_resume,
},
};
static int mca_registered;
#endif /* CONFIG_MCA */
static const struct net_device_ops netdev_ops = {
.ndo_open = el3_open,
.ndo_stop = el3_close,
@ -600,76 +564,6 @@ static void el3_common_remove (struct net_device *dev)
free_netdev (dev);
}
#ifdef CONFIG_MCA
static int __init el3_mca_probe(struct device *device)
{
/* Based on Erik Nygren's (nygren@mit.edu) 3c529 patch,
* heavily modified by Chris Beauregard
* (cpbeaure@csclub.uwaterloo.ca) to support standard MCA
* probing.
*
* redone for multi-card detection by ZP Gu (zpg@castle.net)
* now works as a module */
short i;
int ioaddr, irq, if_port;
__be16 phys_addr[3];
struct net_device *dev = NULL;
u_char pos4, pos5;
struct mca_device *mdev = to_mca_device(device);
int slot = mdev->slot;
int err;
pos4 = mca_device_read_stored_pos(mdev, 4);
pos5 = mca_device_read_stored_pos(mdev, 5);
ioaddr = ((short)((pos4&0xfc)|0x02)) << 8;
irq = pos5 & 0x0f;
pr_info("3c529: found %s at slot %d\n",
el3_mca_adapter_names[mdev->index], slot + 1);
/* claim the slot */
strncpy(mdev->name, el3_mca_adapter_names[mdev->index],
sizeof(mdev->name));
mca_device_set_claim(mdev, 1);
if_port = pos4 & 0x03;
irq = mca_device_transform_irq(mdev, irq);
ioaddr = mca_device_transform_ioport(mdev, ioaddr);
if (el3_debug > 2) {
pr_debug("3c529: irq %d ioaddr 0x%x ifport %d\n", irq, ioaddr, if_port);
}
EL3WINDOW(0);
for (i = 0; i < 3; i++)
phys_addr[i] = htons(read_eeprom(ioaddr, i));
dev = alloc_etherdev(sizeof (struct el3_private));
if (dev == NULL) {
release_region(ioaddr, EL3_IO_EXTENT);
return -ENOMEM;
}
netdev_boot_setup_check(dev);
el3_dev_fill(dev, phys_addr, ioaddr, irq, if_port, EL3_MCA);
dev_set_drvdata(device, dev);
err = el3_common_init(dev);
if (err) {
dev_set_drvdata(device, NULL);
free_netdev(dev);
return -ENOMEM;
}
el3_devs[el3_cards++] = dev;
return 0;
}
#endif /* CONFIG_MCA */
#ifdef CONFIG_EISA
static int __init el3_eisa_probe (struct device *device)
{
@ -1547,11 +1441,6 @@ static int __init el3_init_module(void)
if (!ret)
eisa_registered = 1;
#endif
#ifdef CONFIG_MCA
ret = mca_register_driver(&el3_mca_driver);
if (!ret)
mca_registered = 1;
#endif
#ifdef CONFIG_PNP
if (pnp_registered)
@ -1562,10 +1451,6 @@ static int __init el3_init_module(void)
#ifdef CONFIG_EISA
if (eisa_registered)
ret = 0;
#endif
#ifdef CONFIG_MCA
if (mca_registered)
ret = 0;
#endif
return ret;
}
@ -1584,10 +1469,6 @@ static void __exit el3_cleanup_module(void)
if (eisa_registered)
eisa_driver_unregister(&el3_eisa_driver);
#endif
#ifdef CONFIG_MCA
if (mca_registered)
mca_unregister_driver(&el3_mca_driver);
#endif
}
module_init (el3_init_module);

View file

@ -182,18 +182,6 @@ config NE2000
To compile this driver as a module, choose M here. The module
will be called ne.
config NE2_MCA
tristate "NE/2 (ne2000 MCA version) support"
depends on MCA_LEGACY
select CRC32
---help---
If you have a network (Ethernet) card of this type, say Y and read
the Ethernet-HOWTO, available from
<http://www.tldp.org/docs.html#howto>.
To compile this driver as a module, choose M here. The module
will be called ne2.
config NE2K_PCI
tristate "PCI NE2000 and clones support (see help)"
depends on PCI
@ -267,18 +255,6 @@ config STNIC
If unsure, say N.
config ULTRAMCA
tristate "SMC Ultra MCA support"
depends on MCA
select CRC32
---help---
If you have a network (Ethernet) card of this type and are running
an MCA based system (PS/2), say Y and read the Ethernet-HOWTO,
available from <http://www.tldp.org/docs.html#howto>.
To compile this driver as a module, choose M here. The module
will be called smc-mca.
config ULTRA
tristate "SMC Ultra support"
depends on ISA

View file

@ -24,6 +24,5 @@ obj-$(CONFIG_PCMCIA_PCNET) += pcnet_cs.o 8390.o
obj-$(CONFIG_STNIC) += stnic.o 8390.o
obj-$(CONFIG_ULTRA) += smc-ultra.o 8390.o
obj-$(CONFIG_ULTRA32) += smc-ultra32.o 8390.o
obj-$(CONFIG_ULTRAMCA) += smc-mca.o 8390.o
obj-$(CONFIG_WD80x3) += wd.o 8390.o
obj-$(CONFIG_ZORRO8390) += zorro8390.o 8390.o

View file

@ -1,798 +0,0 @@
/* ne2.c: A NE/2 Ethernet Driver for Linux. */
/*
Based on the NE2000 driver written by Donald Becker (1992-94).
modified by Wim Dumon (Apr 1996)
This software may be used and distributed according to the terms
of the GNU General Public License, incorporated herein by reference.
The author may be reached as wimpie@linux.cc.kuleuven.ac.be
Currently supported: NE/2
This patch was never tested on other MCA-ethernet adapters, but it
might work. Just give it a try and let me know if you have problems.
Also mail me if it really works, please!
Changelog:
Mon Feb 3 16:26:02 MET 1997
- adapted the driver to work with the 2.1.25 kernel
- multiple ne2 support (untested)
- module support (untested)
Fri Aug 28 00:18:36 CET 1998 (David Weinehall)
- fixed a few minor typos
- made the MODULE_PARM conditional (it only works with the v2.1.x kernels)
- fixed the module support (Now it's working...)
Mon Sep 7 19:01:44 CET 1998 (David Weinehall)
- added support for Arco Electronics AE/2-card (experimental)
Mon Sep 14 09:53:42 CET 1998 (David Weinehall)
- added support for Compex ENET-16MC/P (experimental)
Tue Sep 15 16:21:12 CET 1998 (David Weinehall, Magnus Jonsson, Tomas Ogren)
- Miscellaneous bugfixes
Tue Sep 19 16:21:12 CET 1998 (Magnus Jonsson)
- Cleanup
Wed Sep 23 14:33:34 CET 1998 (David Weinehall)
- Restructuring and rewriting for v2.1.x compliance
Wed Oct 14 17:19:21 CET 1998 (David Weinehall)
- Added code that unregisters irq and proc-info
- Version# bump
Mon Nov 16 15:28:23 CET 1998 (Wim Dumon)
- pass 'dev' as last parameter of request_irq in stead of 'NULL'
Wed Feb 7 21:24:00 CET 2001 (Alfred Arnold)
- added support for the D-Link DE-320CT
* WARNING
-------
This is alpha-test software. It is not guaranteed to work. As a
matter of fact, I'm quite sure there are *LOTS* of bugs in here. I
would like to hear from you if you use this driver, even if it works.
If it doesn't work, be sure to send me a mail with the problems !
*/
static const char *version = "ne2.c:v0.91 Nov 16 1998 Wim Dumon <wimpie@kotnet.org>\n";
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/in.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/mca-legacy.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/bitops.h>
#include <linux/jiffies.h>
#include <asm/io.h>
#include <asm/dma.h>
#include "8390.h"
#define DRV_NAME "ne2"
/* Some defines that people can play with if so inclined. */
/* Do we perform extra sanity checks on stuff ? */
/* #define NE_SANITY_CHECK */
/* Do we implement the read before write bugfix ? */
/* #define NE_RW_BUGFIX */
/* Do we have a non std. amount of memory? (in units of 256 byte pages) */
/* #define PACKETBUF_MEMSIZE 0x40 */
/* ---- No user-serviceable parts below ---- */
#define NE_BASE (dev->base_addr)
#define NE_CMD 0x00
#define NE_DATAPORT 0x10 /* NatSemi-defined port window offset. */
#define NE_RESET 0x20 /* Issue a read to reset, a write to clear. */
#define NE_IO_EXTENT 0x30
#define NE1SM_START_PG 0x20 /* First page of TX buffer */
#define NE1SM_STOP_PG 0x40 /* Last page +1 of RX ring */
#define NESM_START_PG 0x40 /* First page of TX buffer */
#define NESM_STOP_PG 0x80 /* Last page +1 of RX ring */
/* From the .ADF file: */
static unsigned int addresses[7] __initdata =
{0x1000, 0x2020, 0x8020, 0xa0a0, 0xb0b0, 0xc0c0, 0xc3d0};
static int irqs[4] __initdata = {3, 4, 5, 9};
/* From the D-Link ADF file: */
static unsigned int dlink_addresses[4] __initdata =
{0x300, 0x320, 0x340, 0x360};
static int dlink_irqs[8] __initdata = {3, 4, 5, 9, 10, 11, 14, 15};
struct ne2_adapters_t {
unsigned int id;
char *name;
};
static struct ne2_adapters_t ne2_adapters[] __initdata = {
{ 0x6354, "Arco Ethernet Adapter AE/2" },
{ 0x70DE, "Compex ENET-16 MC/P" },
{ 0x7154, "Novell Ethernet Adapter NE/2" },
{ 0x56ea, "D-Link DE-320CT" },
{ 0x0000, NULL }
};
extern int netcard_probe(struct net_device *dev);
static int ne2_probe1(struct net_device *dev, int slot);
static void ne_reset_8390(struct net_device *dev);
static void ne_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
int ring_page);
static void ne_block_input(struct net_device *dev, int count,
struct sk_buff *skb, int ring_offset);
static void ne_block_output(struct net_device *dev, const int count,
const unsigned char *buf, const int start_page);
/*
* special code to read the DE-320's MAC address EEPROM. In contrast to a
* standard NE design, this is a serial EEPROM (93C46) that has to be read
* bit by bit. The EEPROM cotrol port at base + 0x1e has the following
* layout:
*
* Bit 0 = Data out (read from EEPROM)
* Bit 1 = Data in (write to EEPROM)
* Bit 2 = Clock
* Bit 3 = Chip Select
* Bit 7 = ~50 kHz clock for defined delays
*
*/
static void __init dlink_put_eeprom(unsigned char value, unsigned int addr)
{
int z;
unsigned char v1, v2;
/* write the value to the NIC EEPROM register */
outb(value, addr + 0x1e);
/* now wait the clock line to toggle twice. Effectively, we are
waiting (at least) for one clock cycle */
for (z = 0; z < 2; z++) {
do {
v1 = inb(addr + 0x1e);
v2 = inb(addr + 0x1e);
}
while (!((v1 ^ v2) & 0x80));
}
}
static void __init dlink_send_eeprom_bit(unsigned int bit, unsigned int addr)
{
/* shift data bit into correct position */
bit = bit << 1;
/* write value, keep clock line high for two cycles */
dlink_put_eeprom(0x09 | bit, addr);
dlink_put_eeprom(0x0d | bit, addr);
dlink_put_eeprom(0x0d | bit, addr);
dlink_put_eeprom(0x09 | bit, addr);
}
static void __init dlink_send_eeprom_word(unsigned int value, unsigned int len, unsigned int addr)
{
int z;
/* adjust bits so that they are left-aligned in a 16-bit-word */
value = value << (16 - len);
/* shift bits out to the EEPROM */
for (z = 0; z < len; z++) {
dlink_send_eeprom_bit((value & 0x8000) >> 15, addr);
value = value << 1;
}
}
static unsigned int __init dlink_get_eeprom(unsigned int eeaddr, unsigned int addr)
{
int z;
unsigned int value = 0;
/* pull the CS line low for a moment. This resets the EEPROM-
internal logic, and makes it ready for a new command. */
dlink_put_eeprom(0x01, addr);
dlink_put_eeprom(0x09, addr);
/* send one start bit, read command (1 - 0), plus the address to
the EEPROM */
dlink_send_eeprom_word(0x0180 | (eeaddr & 0x3f), 9, addr);
/* get the data word. We clock by sending 0s to the EEPROM, which
get ignored during the read process */
for (z = 0; z < 16; z++) {
dlink_send_eeprom_bit(0, addr);
value = (value << 1) | (inb(addr + 0x1e) & 0x01);
}
return value;
}
/*
* Note that at boot, this probe only picks up one card at a time.
*/
static int __init do_ne2_probe(struct net_device *dev)
{
static int current_mca_slot = -1;
int i;
int adapter_found = 0;
/* Do not check any supplied i/o locations.
POS registers usually don't fail :) */
/* MCA cards have POS registers.
Autodetecting MCA cards is extremely simple.
Just search for the card. */
for(i = 0; (ne2_adapters[i].name != NULL) && !adapter_found; i++) {
current_mca_slot =
mca_find_unused_adapter(ne2_adapters[i].id, 0);
if((current_mca_slot != MCA_NOTFOUND) && !adapter_found) {
int res;
mca_set_adapter_name(current_mca_slot,
ne2_adapters[i].name);
mca_mark_as_used(current_mca_slot);
res = ne2_probe1(dev, current_mca_slot);
if (res)
mca_mark_as_unused(current_mca_slot);
return res;
}
}
return -ENODEV;
}
#ifndef MODULE
struct net_device * __init ne2_probe(int unit)
{
struct net_device *dev = alloc_eip_netdev();
int err;
if (!dev)
return ERR_PTR(-ENOMEM);
sprintf(dev->name, "eth%d", unit);
netdev_boot_setup_check(dev);
err = do_ne2_probe(dev);
if (err)
goto out;
return dev;
out:
free_netdev(dev);
return ERR_PTR(err);
}
#endif
static int ne2_procinfo(char *buf, int slot, struct net_device *dev)
{
int len=0;
len += sprintf(buf+len, "The NE/2 Ethernet Adapter\n" );
len += sprintf(buf+len, "Driver written by Wim Dumon ");
len += sprintf(buf+len, "<wimpie@kotnet.org>\n");
len += sprintf(buf+len, "Modified by ");
len += sprintf(buf+len, "David Weinehall <tao@acc.umu.se>\n");
len += sprintf(buf+len, "and by Magnus Jonsson <bigfoot@acc.umu.se>\n");
len += sprintf(buf+len, "Based on the original NE2000 drivers\n" );
len += sprintf(buf+len, "Base IO: %#x\n", (unsigned int)dev->base_addr);
len += sprintf(buf+len, "IRQ : %d\n", dev->irq);
len += sprintf(buf+len, "HW addr : %pM\n", dev->dev_addr);
return len;
}
static int __init ne2_probe1(struct net_device *dev, int slot)
{
int i, base_addr, irq, retval;
unsigned char POS;
unsigned char SA_prom[32];
const char *name = "NE/2";
int start_page, stop_page;
static unsigned version_printed;
if (ei_debug && version_printed++ == 0)
printk(version);
printk("NE/2 ethercard found in slot %d:", slot);
/* Read base IO and IRQ from the POS-registers */
POS = mca_read_stored_pos(slot, 2);
if(!(POS % 2)) {
printk(" disabled.\n");
return -ENODEV;
}
/* handle different POS register structure for D-Link card */
if (mca_read_stored_pos(slot, 0) == 0xea) {
base_addr = dlink_addresses[(POS >> 5) & 0x03];
irq = dlink_irqs[(POS >> 2) & 0x07];
}
else {
i = (POS & 0xE)>>1;
/* printk("Halleluja sdog, als er na de pijl een 1 staat is 1 - 1 == 0"
" en zou het moeten werken -> %d\n", i);
The above line was for remote testing, thanx to sdog ... */
base_addr = addresses[i - 1];
irq = irqs[(POS & 0x60)>>5];
}
if (!request_region(base_addr, NE_IO_EXTENT, DRV_NAME))
return -EBUSY;
#ifdef DEBUG
printk("POS info : pos 2 = %#x ; base = %#x ; irq = %ld\n", POS,
base_addr, irq);
#endif
#ifndef CRYNWR_WAY
/* Reset the card the way they do it in the Crynwr packet driver */
for (i=0; i<8; i++)
outb(0x0, base_addr + NE_RESET);
inb(base_addr + NE_RESET);
outb(0x21, base_addr + NE_CMD);
if (inb(base_addr + NE_CMD) != 0x21) {
printk("NE/2 adapter not responding\n");
retval = -ENODEV;
goto out;
}
/* In the crynwr sources they do a RAM-test here. I skip it. I suppose
my RAM is okay. Suppose your memory is broken. Then this test
should fail and you won't be able to use your card. But if I do not
test, you won't be able to use your card, neither. So this test
won't help you. */
#else /* _I_ never tested it this way .. Go ahead and try ...*/
/* Reset card. Who knows what dain-bramaged state it was left in. */
{
unsigned long reset_start_time = jiffies;
/* DON'T change these to inb_p/outb_p or reset will fail on
clones.. */
outb(inb(base_addr + NE_RESET), base_addr + NE_RESET);
while ((inb_p(base_addr + EN0_ISR) & ENISR_RESET) == 0)
if (time_after(jiffies, reset_start_time + 2*HZ/100)) {
printk(" not found (no reset ack).\n");
retval = -ENODEV;
goto out;
}
outb_p(0xff, base_addr + EN0_ISR); /* Ack all intr. */
}
#endif
/* Read the 16 bytes of station address PROM.
We must first initialize registers, similar to
NS8390p_init(eifdev, 0).
We can't reliably read the SAPROM address without this.
(I learned the hard way!). */
{
struct {
unsigned char value, offset;
} program_seq[] = {
/* Select page 0 */
{E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD},
{0x49, EN0_DCFG}, /* Set WORD-wide (0x49) access. */
{0x00, EN0_RCNTLO}, /* Clear the count regs. */
{0x00, EN0_RCNTHI},
{0x00, EN0_IMR}, /* Mask completion irq. */
{0xFF, EN0_ISR},
{E8390_RXOFF, EN0_RXCR}, /* 0x20 Set to monitor */
{E8390_TXOFF, EN0_TXCR}, /* 0x02 and loopback mode. */
{32, EN0_RCNTLO},
{0x00, EN0_RCNTHI},
{0x00, EN0_RSARLO}, /* DMA starting at 0x0000. */
{0x00, EN0_RSARHI},
{E8390_RREAD+E8390_START, E8390_CMD},
};
for (i = 0; i < ARRAY_SIZE(program_seq); i++)
outb_p(program_seq[i].value, base_addr +
program_seq[i].offset);
}
for(i = 0; i < 6 /*sizeof(SA_prom)*/; i+=1) {
SA_prom[i] = inb(base_addr + NE_DATAPORT);
}
/* I don't know whether the previous sequence includes the general
board reset procedure, so better don't omit it and just overwrite
the garbage read from a DE-320 with correct stuff. */
if (mca_read_stored_pos(slot, 0) == 0xea) {
unsigned int v;
for (i = 0; i < 3; i++) {
v = dlink_get_eeprom(i, base_addr);
SA_prom[(i << 1) ] = v & 0xff;
SA_prom[(i << 1) + 1] = (v >> 8) & 0xff;
}
}
start_page = NESM_START_PG;
stop_page = NESM_STOP_PG;
dev->irq=irq;
/* Snarf the interrupt now. There's no point in waiting since we cannot
share and the board will usually be enabled. */
retval = request_irq(dev->irq, eip_interrupt, 0, DRV_NAME, dev);
if (retval) {
printk (" unable to get IRQ %d (irqval=%d).\n",
dev->irq, retval);
goto out;
}
dev->base_addr = base_addr;
for (i = 0; i < ETH_ALEN; i++)
dev->dev_addr[i] = SA_prom[i];
printk(" %pM\n", dev->dev_addr);
printk("%s: %s found at %#x, using IRQ %d.\n",
dev->name, name, base_addr, dev->irq);
mca_set_adapter_procfn(slot, (MCA_ProcFn) ne2_procinfo, dev);
ei_status.name = name;
ei_status.tx_start_page = start_page;
ei_status.stop_page = stop_page;
ei_status.word16 = (2 == 2);
ei_status.rx_start_page = start_page + TX_PAGES;
#ifdef PACKETBUF_MEMSIZE
/* Allow the packet buffer size to be overridden by know-it-alls. */
ei_status.stop_page = ei_status.tx_start_page + PACKETBUF_MEMSIZE;
#endif
ei_status.reset_8390 = &ne_reset_8390;
ei_status.block_input = &ne_block_input;
ei_status.block_output = &ne_block_output;
ei_status.get_8390_hdr = &ne_get_8390_hdr;
ei_status.priv = slot;
dev->netdev_ops = &eip_netdev_ops;
NS8390p_init(dev, 0);
retval = register_netdev(dev);
if (retval)
goto out1;
return 0;
out1:
mca_set_adapter_procfn( ei_status.priv, NULL, NULL);
free_irq(dev->irq, dev);
out:
release_region(base_addr, NE_IO_EXTENT);
return retval;
}
/* Hard reset the card. This used to pause for the same period that a
8390 reset command required, but that shouldn't be necessary. */
static void ne_reset_8390(struct net_device *dev)
{
unsigned long reset_start_time = jiffies;
if (ei_debug > 1)
printk("resetting the 8390 t=%ld...", jiffies);
/* DON'T change these to inb_p/outb_p or reset will fail on clones. */
outb(inb(NE_BASE + NE_RESET), NE_BASE + NE_RESET);
ei_status.txing = 0;
ei_status.dmaing = 0;
/* This check _should_not_ be necessary, omit eventually. */
while ((inb_p(NE_BASE+EN0_ISR) & ENISR_RESET) == 0)
if (time_after(jiffies, reset_start_time + 2*HZ/100)) {
printk("%s: ne_reset_8390() did not complete.\n",
dev->name);
break;
}
outb_p(ENISR_RESET, NE_BASE + EN0_ISR); /* Ack intr. */
}
/* Grab the 8390 specific header. Similar to the block_input routine, but
we don't need to be concerned with ring wrap as the header will be at
the start of a page, so we optimize accordingly. */
static void ne_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
int ring_page)
{
int nic_base = dev->base_addr;
/* This *shouldn't* happen.
If it does, it's the last thing you'll see */
if (ei_status.dmaing) {
printk("%s: DMAing conflict in ne_get_8390_hdr "
"[DMAstat:%d][irqlock:%d].\n",
dev->name, ei_status.dmaing, ei_status.irqlock);
return;
}
ei_status.dmaing |= 0x01;
outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, nic_base+ NE_CMD);
outb_p(sizeof(struct e8390_pkt_hdr), nic_base + EN0_RCNTLO);
outb_p(0, nic_base + EN0_RCNTHI);
outb_p(0, nic_base + EN0_RSARLO); /* On page boundary */
outb_p(ring_page, nic_base + EN0_RSARHI);
outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD);
if (ei_status.word16)
insw(NE_BASE + NE_DATAPORT, hdr,
sizeof(struct e8390_pkt_hdr)>>1);
else
insb(NE_BASE + NE_DATAPORT, hdr,
sizeof(struct e8390_pkt_hdr));
outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
ei_status.dmaing &= ~0x01;
}
/* Block input and output, similar to the Crynwr packet driver. If you
are porting to a new ethercard, look at the packet driver source for
hints. The NEx000 doesn't share the on-board packet memory -- you have
to put the packet out through the "remote DMA" dataport using outb. */
static void ne_block_input(struct net_device *dev, int count, struct sk_buff *skb,
int ring_offset)
{
#ifdef NE_SANITY_CHECK
int xfer_count = count;
#endif
int nic_base = dev->base_addr;
char *buf = skb->data;
/* This *shouldn't* happen.
If it does, it's the last thing you'll see */
if (ei_status.dmaing) {
printk("%s: DMAing conflict in ne_block_input "
"[DMAstat:%d][irqlock:%d].\n",
dev->name, ei_status.dmaing, ei_status.irqlock);
return;
}
ei_status.dmaing |= 0x01;
outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, nic_base+ NE_CMD);
outb_p(count & 0xff, nic_base + EN0_RCNTLO);
outb_p(count >> 8, nic_base + EN0_RCNTHI);
outb_p(ring_offset & 0xff, nic_base + EN0_RSARLO);
outb_p(ring_offset >> 8, nic_base + EN0_RSARHI);
outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD);
if (ei_status.word16) {
insw(NE_BASE + NE_DATAPORT,buf,count>>1);
if (count & 0x01) {
buf[count-1] = inb(NE_BASE + NE_DATAPORT);
#ifdef NE_SANITY_CHECK
xfer_count++;
#endif
}
} else {
insb(NE_BASE + NE_DATAPORT, buf, count);
}
#ifdef NE_SANITY_CHECK
/* This was for the ALPHA version only, but enough people have
been encountering problems so it is still here. If you see
this message you either 1) have a slightly incompatible clone
or 2) have noise/speed problems with your bus. */
if (ei_debug > 1) { /* DMA termination address check... */
int addr, tries = 20;
do {
/* DON'T check for 'inb_p(EN0_ISR) & ENISR_RDC' here
-- it's broken for Rx on some cards! */
int high = inb_p(nic_base + EN0_RSARHI);
int low = inb_p(nic_base + EN0_RSARLO);
addr = (high << 8) + low;
if (((ring_offset + xfer_count) & 0xff) == low)
break;
} while (--tries > 0);
if (tries <= 0)
printk("%s: RX transfer address mismatch,"
"%#4.4x (expected) vs. %#4.4x (actual).\n",
dev->name, ring_offset + xfer_count, addr);
}
#endif
outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
ei_status.dmaing &= ~0x01;
}
static void ne_block_output(struct net_device *dev, int count,
const unsigned char *buf, const int start_page)
{
int nic_base = NE_BASE;
unsigned long dma_start;
#ifdef NE_SANITY_CHECK
int retries = 0;
#endif
/* Round the count up for word writes. Do we need to do this?
What effect will an odd byte count have on the 8390?
I should check someday. */
if (ei_status.word16 && (count & 0x01))
count++;
/* This *shouldn't* happen.
If it does, it's the last thing you'll see */
if (ei_status.dmaing) {
printk("%s: DMAing conflict in ne_block_output."
"[DMAstat:%d][irqlock:%d]\n",
dev->name, ei_status.dmaing, ei_status.irqlock);
return;
}
ei_status.dmaing |= 0x01;
/* We should already be in page 0, but to be safe... */
outb_p(E8390_PAGE0+E8390_START+E8390_NODMA, nic_base + NE_CMD);
#ifdef NE_SANITY_CHECK
retry:
#endif
#ifdef NE8390_RW_BUGFIX
/* Handle the read-before-write bug the same way as the
Crynwr packet driver -- the NatSemi method doesn't work.
Actually this doesn't always work either, but if you have
problems with your NEx000 this is better than nothing! */
outb_p(0x42, nic_base + EN0_RCNTLO);
outb_p(0x00, nic_base + EN0_RCNTHI);
outb_p(0x42, nic_base + EN0_RSARLO);
outb_p(0x00, nic_base + EN0_RSARHI);
outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD);
/* Make certain that the dummy read has occurred. */
SLOW_DOWN_IO;
SLOW_DOWN_IO;
SLOW_DOWN_IO;
#endif
outb_p(ENISR_RDC, nic_base + EN0_ISR);
/* Now the normal output. */
outb_p(count & 0xff, nic_base + EN0_RCNTLO);
outb_p(count >> 8, nic_base + EN0_RCNTHI);
outb_p(0x00, nic_base + EN0_RSARLO);
outb_p(start_page, nic_base + EN0_RSARHI);
outb_p(E8390_RWRITE+E8390_START, nic_base + NE_CMD);
if (ei_status.word16) {
outsw(NE_BASE + NE_DATAPORT, buf, count>>1);
} else {
outsb(NE_BASE + NE_DATAPORT, buf, count);
}
dma_start = jiffies;
#ifdef NE_SANITY_CHECK
/* This was for the ALPHA version only, but enough people have
been encountering problems so it is still here. */
if (ei_debug > 1) { /* DMA termination address check... */
int addr, tries = 20;
do {
int high = inb_p(nic_base + EN0_RSARHI);
int low = inb_p(nic_base + EN0_RSARLO);
addr = (high << 8) + low;
if ((start_page << 8) + count == addr)
break;
} while (--tries > 0);
if (tries <= 0) {
printk("%s: Tx packet transfer address mismatch,"
"%#4.4x (expected) vs. %#4.4x (actual).\n",
dev->name, (start_page << 8) + count, addr);
if (retries++ == 0)
goto retry;
}
}
#endif
while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0)
if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */
printk("%s: timeout waiting for Tx RDC.\n", dev->name);
ne_reset_8390(dev);
NS8390p_init(dev, 1);
break;
}
outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
ei_status.dmaing &= ~0x01;
}
#ifdef MODULE
#define MAX_NE_CARDS 4 /* Max number of NE cards per module */
static struct net_device *dev_ne[MAX_NE_CARDS];
static int io[MAX_NE_CARDS];
static int irq[MAX_NE_CARDS];
static int bad[MAX_NE_CARDS]; /* 0xbad = bad sig or no reset ack */
MODULE_LICENSE("GPL");
module_param_array(io, int, NULL, 0);
module_param_array(irq, int, NULL, 0);
module_param_array(bad, int, NULL, 0);
MODULE_PARM_DESC(io, "(ignored)");
MODULE_PARM_DESC(irq, "(ignored)");
MODULE_PARM_DESC(bad, "(ignored)");
/* Module code fixed by David Weinehall */
int __init init_module(void)
{
struct net_device *dev;
int this_dev, found = 0;
for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
dev = alloc_eip_netdev();
if (!dev)
break;
dev->irq = irq[this_dev];
dev->mem_end = bad[this_dev];
dev->base_addr = io[this_dev];
if (do_ne2_probe(dev) == 0) {
dev_ne[found++] = dev;
continue;
}
free_netdev(dev);
break;
}
if (found)
return 0;
printk(KERN_WARNING "ne2.c: No NE/2 card found\n");
return -ENXIO;
}
static void cleanup_card(struct net_device *dev)
{
mca_mark_as_unused(ei_status.priv);
mca_set_adapter_procfn( ei_status.priv, NULL, NULL);
free_irq(dev->irq, dev);
release_region(dev->base_addr, NE_IO_EXTENT);
}
void __exit cleanup_module(void)
{
int this_dev;
for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
struct net_device *dev = dev_ne[this_dev];
if (dev) {
unregister_netdev(dev);
cleanup_card(dev);
free_netdev(dev);
}
}
}
#endif /* MODULE */

View file

@ -1,575 +0,0 @@
/* smc-mca.c: A SMC Ultra ethernet driver for linux. */
/*
Most of this driver, except for ultramca_probe is nearly
verbatim from smc-ultra.c by Donald Becker. The rest is
written and copyright 1996 by David Weis, weisd3458@uni.edu
This is a driver for the SMC Ultra and SMC EtherEZ ethercards.
This driver uses the cards in the 8390-compatible, shared memory mode.
Most of the run-time complexity is handled by the generic code in
8390.c.
This driver enables the shared memory only when doing the actual data
transfers to avoid a bug in early version of the card that corrupted
data transferred by a AHA1542.
This driver does not support the programmed-I/O data transfer mode of
the EtherEZ. That support (if available) is smc-ez.c. Nor does it
use the non-8390-compatible "Altego" mode. (No support currently planned.)
Changelog:
Paul Gortmaker : multiple card support for module users.
David Weis : Micro Channel-ized it.
Tom Sightler : Added support for IBM PS/2 Ethernet Adapter/A
Christopher Turcksin : Changed MCA-probe so that multiple adapters are
found correctly (Jul 16, 1997)
Chris Beauregard : Tried to merge the two changes above (Dec 15, 1997)
Tom Sightler : Fixed minor detection bug caused by above merge
Tom Sightler : Added support for three more Western Digital
MCA-adapters
Tom Sightler : Added support for 2.2.x mca_find_unused_adapter
Hartmut Schmidt : - Modified parameter detection to handle each
card differently depending on a switch-list
- 'card_ver' removed from the adapter list
- Some minor bug fixes
*/
#include <linux/mca.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <asm/io.h>
#include "8390.h"
#define DRV_NAME "smc-mca"
static int ultramca_open(struct net_device *dev);
static void ultramca_reset_8390(struct net_device *dev);
static void ultramca_get_8390_hdr(struct net_device *dev,
struct e8390_pkt_hdr *hdr,
int ring_page);
static void ultramca_block_input(struct net_device *dev, int count,
struct sk_buff *skb,
int ring_offset);
static void ultramca_block_output(struct net_device *dev, int count,
const unsigned char *buf,
const int start_page);
static int ultramca_close_card(struct net_device *dev);
#define START_PG 0x00 /* First page of TX buffer */
#define ULTRA_CMDREG 0 /* Offset to ASIC command register. */
#define ULTRA_RESET 0x80 /* Board reset, in ULTRA_CMDREG. */
#define ULTRA_MEMENB 0x40 /* Enable the shared memory. */
#define ULTRA_NIC_OFFSET 16 /* NIC register offset from the base_addr. */
#define ULTRA_IO_EXTENT 32
#define EN0_ERWCNT 0x08 /* Early receive warning count. */
#define _61c8_SMC_Ethercard_PLUS_Elite_A_BNC_AUI_WD8013EP_A 0
#define _61c9_SMC_Ethercard_PLUS_Elite_A_UTP_AUI_WD8013EP_A 1
#define _6fc0_WD_Ethercard_PLUS_A_WD8003E_A_OR_WD8003ET_A 2
#define _6fc1_WD_Starcard_PLUS_A_WD8003ST_A 3
#define _6fc2_WD_Ethercard_PLUS_10T_A_WD8003W_A 4
#define _efd4_IBM_PS2_Adapter_A_for_Ethernet_UTP_AUI_WD8013WP_A 5
#define _efd5_IBM_PS2_Adapter_A_for_Ethernet_BNC_AUI_WD8013WP_A 6
#define _efe5_IBM_PS2_Adapter_A_for_Ethernet 7
struct smc_mca_adapters_t {
unsigned int id;
char *name;
};
#define MAX_ULTRAMCA_CARDS 4 /* Max number of Ultra cards per module */
static int ultra_io[MAX_ULTRAMCA_CARDS];
static int ultra_irq[MAX_ULTRAMCA_CARDS];
MODULE_LICENSE("GPL");
module_param_array(ultra_io, int, NULL, 0);
module_param_array(ultra_irq, int, NULL, 0);
MODULE_PARM_DESC(ultra_io, "SMC Ultra/EtherEZ MCA I/O base address(es)");
MODULE_PARM_DESC(ultra_irq, "SMC Ultra/EtherEZ MCA IRQ number(s)");
static const struct {
unsigned int base_addr;
} addr_table[] = {
{ 0x0800 },
{ 0x1800 },
{ 0x2800 },
{ 0x3800 },
{ 0x4800 },
{ 0x5800 },
{ 0x6800 },
{ 0x7800 },
{ 0x8800 },
{ 0x9800 },
{ 0xa800 },
{ 0xb800 },
{ 0xc800 },
{ 0xd800 },
{ 0xe800 },
{ 0xf800 }
};
#define MEM_MASK 64
static const struct {
unsigned char mem_index;
unsigned long mem_start;
unsigned char num_pages;
} mem_table[] = {
{ 16, 0x0c0000, 40 },
{ 18, 0x0c4000, 40 },
{ 20, 0x0c8000, 40 },
{ 22, 0x0cc000, 40 },
{ 24, 0x0d0000, 40 },
{ 26, 0x0d4000, 40 },
{ 28, 0x0d8000, 40 },
{ 30, 0x0dc000, 40 },
{144, 0xfc0000, 40 },
{148, 0xfc8000, 40 },
{154, 0xfd0000, 40 },
{156, 0xfd8000, 40 },
{ 0, 0x0c0000, 20 },
{ 1, 0x0c2000, 20 },
{ 2, 0x0c4000, 20 },
{ 3, 0x0c6000, 20 }
};
#define IRQ_MASK 243
static const struct {
unsigned char new_irq;
unsigned char old_irq;
} irq_table[] = {
{ 3, 3 },
{ 4, 4 },
{ 10, 10 },
{ 14, 15 }
};
static short smc_mca_adapter_ids[] __initdata = {
0x61c8,
0x61c9,
0x6fc0,
0x6fc1,
0x6fc2,
0xefd4,
0xefd5,
0xefe5,
0x0000
};
static char *smc_mca_adapter_names[] __initdata = {
"SMC Ethercard PLUS Elite/A BNC/AUI (WD8013EP/A)",
"SMC Ethercard PLUS Elite/A UTP/AUI (WD8013WP/A)",
"WD Ethercard PLUS/A (WD8003E/A or WD8003ET/A)",
"WD Starcard PLUS/A (WD8003ST/A)",
"WD Ethercard PLUS 10T/A (WD8003W/A)",
"IBM PS/2 Adapter/A for Ethernet UTP/AUI (WD8013WP/A)",
"IBM PS/2 Adapter/A for Ethernet BNC/AUI (WD8013EP/A)",
"IBM PS/2 Adapter/A for Ethernet",
NULL
};
static int ultra_found = 0;
static const struct net_device_ops ultramca_netdev_ops = {
.ndo_open = ultramca_open,
.ndo_stop = ultramca_close_card,
.ndo_start_xmit = ei_start_xmit,
.ndo_tx_timeout = ei_tx_timeout,
.ndo_get_stats = ei_get_stats,
.ndo_set_rx_mode = ei_set_multicast_list,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
.ndo_change_mtu = eth_change_mtu,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = ei_poll,
#endif
};
static int __init ultramca_probe(struct device *gen_dev)
{
unsigned short ioaddr;
struct net_device *dev;
unsigned char reg4, num_pages;
struct mca_device *mca_dev = to_mca_device(gen_dev);
char slot = mca_dev->slot;
unsigned char pos2 = 0xff, pos3 = 0xff, pos4 = 0xff, pos5 = 0xff;
int i, rc;
int adapter = mca_dev->index;
int tbase = 0;
int tirq = 0;
int base_addr = ultra_io[ultra_found];
int irq = ultra_irq[ultra_found];
if (base_addr || irq) {
printk(KERN_INFO "Probing for SMC MCA adapter");
if (base_addr) {
printk(KERN_INFO " at I/O address 0x%04x%c",
base_addr, irq ? ' ' : '\n');
}
if (irq) {
printk(KERN_INFO "using irq %d\n", irq);
}
}
tirq = 0;
tbase = 0;
/* If we're trying to match a specificied irq or io address,
* we'll reject the adapter found unless it's the one we're
* looking for */
pos2 = mca_device_read_stored_pos(mca_dev, 2); /* io_addr */
pos3 = mca_device_read_stored_pos(mca_dev, 3); /* shared mem */
pos4 = mca_device_read_stored_pos(mca_dev, 4); /* ROM bios addr range */
pos5 = mca_device_read_stored_pos(mca_dev, 5); /* irq, media and RIPL */
/* Test the following conditions:
* - If an irq parameter is supplied, compare it
* with the irq of the adapter we found
* - If a base_addr paramater is given, compare it
* with the base_addr of the adapter we found
* - Check that the irq and the base_addr of the
* adapter we found is not already in use by
* this driver
*/
switch (mca_dev->index) {
case _61c8_SMC_Ethercard_PLUS_Elite_A_BNC_AUI_WD8013EP_A:
case _61c9_SMC_Ethercard_PLUS_Elite_A_UTP_AUI_WD8013EP_A:
case _efd4_IBM_PS2_Adapter_A_for_Ethernet_UTP_AUI_WD8013WP_A:
case _efd5_IBM_PS2_Adapter_A_for_Ethernet_BNC_AUI_WD8013WP_A:
{
tbase = addr_table[(pos2 & 0xf0) >> 4].base_addr;
tirq = irq_table[(pos5 & 0xc) >> 2].new_irq;
break;
}
case _6fc0_WD_Ethercard_PLUS_A_WD8003E_A_OR_WD8003ET_A:
case _6fc1_WD_Starcard_PLUS_A_WD8003ST_A:
case _6fc2_WD_Ethercard_PLUS_10T_A_WD8003W_A:
case _efe5_IBM_PS2_Adapter_A_for_Ethernet:
{
tbase = ((pos2 & 0x0fe) * 0x10);
tirq = irq_table[(pos5 & 3)].old_irq;
break;
}
}
if(!tirq || !tbase ||
(irq && irq != tirq) ||
(base_addr && tbase != base_addr))
/* FIXME: we're trying to force the ordering of the
* devices here, there should be a way of getting this
* to happen */
return -ENXIO;
/* Adapter found. */
dev = alloc_ei_netdev();
if(!dev)
return -ENODEV;
SET_NETDEV_DEV(dev, gen_dev);
mca_device_set_name(mca_dev, smc_mca_adapter_names[adapter]);
mca_device_set_claim(mca_dev, 1);
printk(KERN_INFO "smc_mca: %s found in slot %d\n",
smc_mca_adapter_names[adapter], slot + 1);
ultra_found++;
dev->base_addr = ioaddr = mca_device_transform_ioport(mca_dev, tbase);
dev->irq = mca_device_transform_irq(mca_dev, tirq);
dev->mem_start = 0;
num_pages = 40;
switch (adapter) { /* card-# in const array above [hs] */
case _61c8_SMC_Ethercard_PLUS_Elite_A_BNC_AUI_WD8013EP_A:
case _61c9_SMC_Ethercard_PLUS_Elite_A_UTP_AUI_WD8013EP_A:
{
for (i = 0; i < 16; i++) { /* taking 16 counts
* up to 15 [hs] */
if (mem_table[i].mem_index == (pos3 & ~MEM_MASK)) {
dev->mem_start = (unsigned long)
mca_device_transform_memory(mca_dev, (void *)mem_table[i].mem_start);
num_pages = mem_table[i].num_pages;
}
}
break;
}
case _6fc0_WD_Ethercard_PLUS_A_WD8003E_A_OR_WD8003ET_A:
case _6fc1_WD_Starcard_PLUS_A_WD8003ST_A:
case _6fc2_WD_Ethercard_PLUS_10T_A_WD8003W_A:
case _efe5_IBM_PS2_Adapter_A_for_Ethernet:
{
dev->mem_start = (unsigned long)
mca_device_transform_memory(mca_dev, (void *)((pos3 & 0xfc) * 0x1000));
num_pages = 0x40;
break;
}
case _efd4_IBM_PS2_Adapter_A_for_Ethernet_UTP_AUI_WD8013WP_A:
case _efd5_IBM_PS2_Adapter_A_for_Ethernet_BNC_AUI_WD8013WP_A:
{
/* courtesy of gamera@quartz.ocn.ne.jp, pos3 indicates
* the index of the 0x2000 step.
* beware different number of pages [hs]
*/
dev->mem_start = (unsigned long)
mca_device_transform_memory(mca_dev, (void *)(0xc0000 + (0x2000 * (pos3 & 0xf))));
num_pages = 0x20 + (2 * (pos3 & 0x10));
break;
}
}
/* sanity check, shouldn't happen */
if (dev->mem_start == 0) {
rc = -ENODEV;
goto err_unclaim;
}
if (!request_region(ioaddr, ULTRA_IO_EXTENT, DRV_NAME)) {
rc = -ENODEV;
goto err_unclaim;
}
reg4 = inb(ioaddr + 4) & 0x7f;
outb(reg4, ioaddr + 4);
for (i = 0; i < 6; i++)
dev->dev_addr[i] = inb(ioaddr + 8 + i);
printk(KERN_INFO "smc_mca[%d]: Parameters: %#3x, %pM",
slot + 1, ioaddr, dev->dev_addr);
/* Switch from the station address to the alternate register set
* and read the useful registers there.
*/
outb(0x80 | reg4, ioaddr + 4);
/* Enable FINE16 mode to avoid BIOS ROM width mismatches @ reboot.
*/
outb(0x80 | inb(ioaddr + 0x0c), ioaddr + 0x0c);
/* Switch back to the station address register set so that
* the MS-DOS driver can find the card after a warm boot.
*/
outb(reg4, ioaddr + 4);
dev_set_drvdata(gen_dev, dev);
/* The 8390 isn't at the base address, so fake the offset
*/
dev->base_addr = ioaddr + ULTRA_NIC_OFFSET;
ei_status.name = "SMC Ultra MCA";
ei_status.word16 = 1;
ei_status.tx_start_page = START_PG;
ei_status.rx_start_page = START_PG + TX_PAGES;
ei_status.stop_page = num_pages;
ei_status.mem = ioremap(dev->mem_start, (ei_status.stop_page - START_PG) * 256);
if (!ei_status.mem) {
rc = -ENOMEM;
goto err_release_region;
}
dev->mem_end = dev->mem_start + (ei_status.stop_page - START_PG) * 256;
printk(", IRQ %d memory %#lx-%#lx.\n",
dev->irq, dev->mem_start, dev->mem_end - 1);
ei_status.reset_8390 = &ultramca_reset_8390;
ei_status.block_input = &ultramca_block_input;
ei_status.block_output = &ultramca_block_output;
ei_status.get_8390_hdr = &ultramca_get_8390_hdr;
ei_status.priv = slot;
dev->netdev_ops = &ultramca_netdev_ops;
NS8390_init(dev, 0);
rc = register_netdev(dev);
if (rc)
goto err_unmap;
return 0;
err_unmap:
iounmap(ei_status.mem);
err_release_region:
release_region(ioaddr, ULTRA_IO_EXTENT);
err_unclaim:
mca_device_set_claim(mca_dev, 0);
free_netdev(dev);
return rc;
}
static int ultramca_open(struct net_device *dev)
{
int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET; /* ASIC addr */
int retval;
if ((retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev)))
return retval;
outb(ULTRA_MEMENB, ioaddr); /* Enable memory */
outb(0x80, ioaddr + 5); /* ??? */
outb(0x01, ioaddr + 6); /* Enable interrupts and memory. */
outb(0x04, ioaddr + 5); /* ??? */
/* Set the early receive warning level in window 0 high enough not
* to receive ERW interrupts.
*/
/* outb_p(E8390_NODMA + E8390_PAGE0, dev->base_addr);
* outb(0xff, dev->base_addr + EN0_ERWCNT);
*/
ei_open(dev);
return 0;
}
static void ultramca_reset_8390(struct net_device *dev)
{
int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET; /* ASIC addr */
outb(ULTRA_RESET, ioaddr);
if (ei_debug > 1)
printk("resetting Ultra, t=%ld...", jiffies);
ei_status.txing = 0;
outb(0x80, ioaddr + 5); /* ??? */
outb(0x01, ioaddr + 6); /* Enable interrupts and memory. */
if (ei_debug > 1)
printk("reset done\n");
}
/* Grab the 8390 specific header. Similar to the block_input routine, but
* we don't need to be concerned with ring wrap as the header will be at
* the start of a page, so we optimize accordingly.
*/
static void ultramca_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page)
{
void __iomem *hdr_start = ei_status.mem + ((ring_page - START_PG) << 8);
#ifdef notdef
/* Officially this is what we are doing, but the readl() is faster */
memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr));
#else
((unsigned int*)hdr)[0] = readl(hdr_start);
#endif
}
/* Block input and output are easy on shared memory ethercards, the only
* complication is when the ring buffer wraps.
*/
static void ultramca_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_offset)
{
void __iomem *xfer_start = ei_status.mem + ring_offset - START_PG * 256;
if (ring_offset + count > ei_status.stop_page * 256) {
/* We must wrap the input move. */
int semi_count = ei_status.stop_page * 256 - ring_offset;
memcpy_fromio(skb->data, xfer_start, semi_count);
count -= semi_count;
memcpy_fromio(skb->data + semi_count, ei_status.mem + TX_PAGES * 256, count);
} else {
memcpy_fromio(skb->data, xfer_start, count);
}
}
static void ultramca_block_output(struct net_device *dev, int count, const unsigned char *buf,
int start_page)
{
void __iomem *shmem = ei_status.mem + ((start_page - START_PG) << 8);
memcpy_toio(shmem, buf, count);
}
static int ultramca_close_card(struct net_device *dev)
{
int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET; /* ASIC addr */
netif_stop_queue(dev);
if (ei_debug > 1)
printk("%s: Shutting down ethercard.\n", dev->name);
outb(0x00, ioaddr + 6); /* Disable interrupts. */
free_irq(dev->irq, dev);
NS8390_init(dev, 0);
/* We should someday disable shared memory and change to 8-bit mode
* "just in case"...
*/
return 0;
}
static int ultramca_remove(struct device *gen_dev)
{
struct mca_device *mca_dev = to_mca_device(gen_dev);
struct net_device *dev = dev_get_drvdata(gen_dev);
if (dev) {
/* NB: ultra_close_card() does free_irq */
int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET;
unregister_netdev(dev);
mca_device_set_claim(mca_dev, 0);
release_region(ioaddr, ULTRA_IO_EXTENT);
iounmap(ei_status.mem);
free_netdev(dev);
}
return 0;
}
static struct mca_driver ultra_driver = {
.id_table = smc_mca_adapter_ids,
.driver = {
.name = "smc-mca",
.bus = &mca_bus_type,
.probe = ultramca_probe,
.remove = ultramca_remove,
}
};
static int __init ultramca_init_module(void)
{
if(!MCA_bus)
return -ENXIO;
mca_register_driver(&ultra_driver);
return ultra_found ? 0 : -ENXIO;
}
static void __exit ultramca_cleanup_module(void)
{
mca_unregister_driver(&ultra_driver);
}
module_init(ultramca_init_module);
module_exit(ultramca_cleanup_module);

View file

@ -155,23 +155,10 @@
2 depca's in a PC).
************************************************************************
Support for MCA EtherWORKS cards added 11-3-98.
Support for MCA EtherWORKS cards added 11-3-98. (MCA since deleted)
Verified to work with up to 2 DE212 cards in a system (although not
fully stress-tested).
Currently known bugs/limitations:
Note: with the MCA stuff as a module, it trusts the MCA configuration,
not the command line for IRQ and memory address. You can
specify them if you want, but it will throw your values out.
You still have to pass the IO address it was configured as
though.
************************************************************************
TO DO:
------
Revision History
----------------
@ -261,10 +248,6 @@
#include <asm/io.h>
#include <asm/dma.h>
#ifdef CONFIG_MCA
#include <linux/mca.h>
#endif
#ifdef CONFIG_EISA
#include <linux/eisa.h>
#endif
@ -360,44 +343,6 @@ static struct eisa_driver depca_eisa_driver = {
};
#endif
#ifdef CONFIG_MCA
/*
** Adapter ID for the MCA EtherWORKS DE210/212 adapter
*/
#define DE210_ID 0x628d
#define DE212_ID 0x6def
static short depca_mca_adapter_ids[] = {
DE210_ID,
DE212_ID,
0x0000
};
static char *depca_mca_adapter_name[] = {
"DEC EtherWORKS MC Adapter (DE210)",
"DEC EtherWORKS MC Adapter (DE212)",
NULL
};
static enum depca_type depca_mca_adapter_type[] = {
de210,
de212,
0
};
static int depca_mca_probe (struct device *);
static struct mca_driver depca_mca_driver = {
.id_table = depca_mca_adapter_ids,
.driver = {
.name = depca_string,
.bus = &mca_bus_type,
.probe = depca_mca_probe,
.remove = __devexit_p(depca_device_remove),
},
};
#endif
static int depca_isa_probe (struct platform_device *);
static int __devexit depca_isa_remove(struct platform_device *pdev)
@ -464,8 +409,7 @@ struct depca_private {
char adapter_name[DEPCA_STRLEN]; /* /proc/ioports string */
enum depca_type adapter; /* Adapter type */
enum {
DEPCA_BUS_MCA = 1,
DEPCA_BUS_ISA,
DEPCA_BUS_ISA = 1,
DEPCA_BUS_EISA,
} depca_bus; /* type of bus */
struct depca_init init_block; /* Shadow Initialization block */
@ -624,12 +568,6 @@ static int __init depca_hw_init (struct net_device *dev, struct device *device)
dev_name(device), depca_signature[lp->adapter], ioaddr);
switch (lp->depca_bus) {
#ifdef CONFIG_MCA
case DEPCA_BUS_MCA:
printk(" (MCA slot %d)", to_mca_device(device)->slot + 1);
break;
#endif
#ifdef CONFIG_EISA
case DEPCA_BUS_EISA:
printk(" (EISA slot %d)", to_eisa_device(device)->slot);
@ -661,10 +599,7 @@ static int __init depca_hw_init (struct net_device *dev, struct device *device)
if (nicsr & BUF) {
nicsr &= ~BS; /* DEPCA RAM in top 32k */
netRAM -= 32;
/* Only EISA/ISA needs start address to be re-computed */
if (lp->depca_bus != DEPCA_BUS_MCA)
mem_start += 0x8000;
mem_start += 0x8000;
}
if ((mem_len = (NUM_RX_DESC * (sizeof(struct depca_rx_desc) + RX_BUFF_SZ) + NUM_TX_DESC * (sizeof(struct depca_tx_desc) + TX_BUFF_SZ) + sizeof(struct depca_init)))
@ -1325,130 +1260,6 @@ static int __init depca_common_init (u_long ioaddr, struct net_device **devp)
return status;
}
#ifdef CONFIG_MCA
/*
** Microchannel bus I/O device probe
*/
static int __init depca_mca_probe(struct device *device)
{
unsigned char pos[2];
unsigned char where;
unsigned long iobase, mem_start;
int irq, err;
struct mca_device *mdev = to_mca_device (device);
struct net_device *dev;
struct depca_private *lp;
/*
** Search for the adapter. If an address has been given, search
** specifically for the card at that address. Otherwise find the
** first card in the system.
*/
pos[0] = mca_device_read_stored_pos(mdev, 2);
pos[1] = mca_device_read_stored_pos(mdev, 3);
/*
** IO of card is handled by bits 1 and 2 of pos0.
**
** bit2 bit1 IO
** 0 0 0x2c00
** 0 1 0x2c10
** 1 0 0x2c20
** 1 1 0x2c30
*/
where = (pos[0] & 6) >> 1;
iobase = 0x2c00 + (0x10 * where);
/*
** Found the adapter we were looking for. Now start setting it up.
**
** First work on decoding the IRQ. It's stored in the lower 4 bits
** of pos1. Bits are as follows (from the ADF file):
**
** Bits
** 3 2 1 0 IRQ
** --------------------
** 0 0 1 0 5
** 0 0 0 1 9
** 0 1 0 0 10
** 1 0 0 0 11
*/
where = pos[1] & 0x0f;
switch (where) {
case 1:
irq = 9;
break;
case 2:
irq = 5;
break;
case 4:
irq = 10;
break;
case 8:
irq = 11;
break;
default:
printk("%s: mca_probe IRQ error. You should never get here (%d).\n", mdev->name, where);
return -EINVAL;
}
/*
** Shared memory address of adapter is stored in bits 3-5 of pos0.
** They are mapped as follows:
**
** Bit
** 5 4 3 Memory Addresses
** 0 0 0 C0000-CFFFF (64K)
** 1 0 0 C8000-CFFFF (32K)
** 0 0 1 D0000-DFFFF (64K)
** 1 0 1 D8000-DFFFF (32K)
** 0 1 0 E0000-EFFFF (64K)
** 1 1 0 E8000-EFFFF (32K)
*/
where = (pos[0] & 0x18) >> 3;
mem_start = 0xc0000 + (where * 0x10000);
if (pos[0] & 0x20) {
mem_start += 0x8000;
}
/* claim the slot */
strncpy(mdev->name, depca_mca_adapter_name[mdev->index],
sizeof(mdev->name));
mca_device_set_claim(mdev, 1);
/*
** Get everything allocated and initialized... (almost just
** like the ISA and EISA probes)
*/
irq = mca_device_transform_irq(mdev, irq);
iobase = mca_device_transform_ioport(mdev, iobase);
if ((err = depca_common_init (iobase, &dev)))
goto out_unclaim;
dev->irq = irq;
dev->base_addr = iobase;
lp = netdev_priv(dev);
lp->depca_bus = DEPCA_BUS_MCA;
lp->adapter = depca_mca_adapter_type[mdev->index];
lp->mem_start = mem_start;
if ((err = depca_hw_init(dev, device)))
goto out_free;
return 0;
out_free:
free_netdev (dev);
release_region (iobase, DEPCA_TOTAL_SIZE);
out_unclaim:
mca_device_set_claim(mdev, 0);
return err;
}
#endif
/*
** ISA bus I/O device probe
*/
@ -2059,15 +1870,10 @@ static int __init depca_module_init (void)
{
int err = 0;
#ifdef CONFIG_MCA
err = mca_register_driver(&depca_mca_driver);
if (err)
goto err;
#endif
#ifdef CONFIG_EISA
err = eisa_driver_register(&depca_eisa_driver);
if (err)
goto err_mca;
goto err_eisa;
#endif
err = platform_driver_register(&depca_isa_driver);
if (err)
@ -2079,11 +1885,6 @@ static int __init depca_module_init (void)
err_eisa:
#ifdef CONFIG_EISA
eisa_driver_unregister(&depca_eisa_driver);
err_mca:
#endif
#ifdef CONFIG_MCA
mca_unregister_driver(&depca_mca_driver);
err:
#endif
return err;
}
@ -2091,9 +1892,6 @@ static int __init depca_module_init (void)
static void __exit depca_module_exit (void)
{
int i;
#ifdef CONFIG_MCA
mca_unregister_driver (&depca_mca_driver);
#endif
#ifdef CONFIG_EISA
eisa_driver_unregister (&depca_eisa_driver);
#endif

View file

@ -27,7 +27,7 @@
ATI provided their EEPROM configuration code header file.
Thanks to NIIBE Yutaka <gniibe@mri.co.jp> for bug fixes.
MCA bus (AT1720) support by Rene Schmit <rene@bss.lu>
MCA bus (AT1720) support (now deleted) by Rene Schmit <rene@bss.lu>
Bugs:
The MB86965 has a design flaw that makes all probes unreliable. Not
@ -38,7 +38,6 @@
#include <linux/errno.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/mca-legacy.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
@ -79,24 +78,6 @@ static unsigned at1700_probe_list[] __initdata = {
0x260, 0x280, 0x2a0, 0x240, 0x340, 0x320, 0x380, 0x300, 0
};
/*
* MCA
*/
#ifdef CONFIG_MCA_LEGACY
static int at1700_ioaddr_pattern[] __initdata = {
0x00, 0x04, 0x01, 0x05, 0x02, 0x06, 0x03, 0x07
};
static int at1700_mca_probe_list[] __initdata = {
0x400, 0x1400, 0x2400, 0x3400, 0x4400, 0x5400, 0x6400, 0x7400, 0
};
static int at1700_irq_pattern[] __initdata = {
0x00, 0x00, 0x00, 0x30, 0x70, 0xb0, 0x00, 0x00,
0x00, 0xf0, 0x34, 0x74, 0xb4, 0x00, 0x00, 0xf4, 0x00
};
#endif
/* use 0 for production, 1 for verification, >2 for debug */
#ifndef NET_DEBUG
#define NET_DEBUG 1
@ -114,7 +95,6 @@ struct net_local {
uint tx_queue_ready:1; /* Tx queue is ready to be sent. */
uint rx_started:1; /* Packets are Rxing. */
uchar tx_queue; /* Number of packet on the Tx queue. */
char mca_slot; /* -1 means ISA */
ushort tx_queue_len; /* Current length of the Tx queue. */
};
@ -166,21 +146,6 @@ static void set_rx_mode(struct net_device *dev);
static void net_tx_timeout (struct net_device *dev);
#ifdef CONFIG_MCA_LEGACY
struct at1720_mca_adapters_struct {
char* name;
int id;
};
/* rEnE : maybe there are others I don't know off... */
static struct at1720_mca_adapters_struct at1720_mca_adapters[] __initdata = {
{ "Allied Telesys AT1720AT", 0x6410 },
{ "Allied Telesys AT1720BT", 0x6413 },
{ "Allied Telesys AT1720T", 0x6416 },
{ NULL, 0 },
};
#endif
/* Check for a network adaptor of this type, and return '0' iff one exists.
If dev->base_addr == 0, probe all likely locations.
If dev->base_addr == 1, always return failure.
@ -194,11 +159,6 @@ static int irq;
static void cleanup_card(struct net_device *dev)
{
#ifdef CONFIG_MCA_LEGACY
struct net_local *lp = netdev_priv(dev);
if (lp->mca_slot >= 0)
mca_mark_as_unused(lp->mca_slot);
#endif
free_irq(dev->irq, NULL);
release_region(dev->base_addr, AT1700_IO_EXTENT);
}
@ -273,7 +233,7 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
static const char fmv_irqmap_pnp[8] = {3, 4, 5, 7, 9, 10, 11, 15};
static const char at1700_irqmap[8] = {3, 4, 5, 9, 10, 11, 14, 15};
unsigned int i, irq, is_fmv18x = 0, is_at1700 = 0;
int slot, ret = -ENODEV;
int ret = -ENODEV;
struct net_local *lp = netdev_priv(dev);
if (!request_region(ioaddr, AT1700_IO_EXTENT, DRV_NAME))
@ -288,64 +248,6 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
ioaddr, read_eeprom(ioaddr, 4), read_eeprom(ioaddr, 5),
read_eeprom(ioaddr, 6), inw(ioaddr + EEPROM_Ctrl));
#endif
#ifdef CONFIG_MCA_LEGACY
/* rEnE (rene@bss.lu): got this from 3c509 driver source , adapted for AT1720 */
/* Based on Erik Nygren's (nygren@mit.edu) 3c529 patch, heavily
modified by Chris Beauregard (cpbeaure@csclub.uwaterloo.ca)
to support standard MCA probing. */
/* redone for multi-card detection by ZP Gu (zpg@castle.net) */
/* now works as a module */
if (MCA_bus) {
int j;
int l_i;
u_char pos3, pos4;
for (j = 0; at1720_mca_adapters[j].name != NULL; j ++) {
slot = 0;
while (slot != MCA_NOTFOUND) {
slot = mca_find_unused_adapter( at1720_mca_adapters[j].id, slot );
if (slot == MCA_NOTFOUND) break;
/* if we get this far, an adapter has been detected and is
enabled */
pos3 = mca_read_stored_pos( slot, 3 );
pos4 = mca_read_stored_pos( slot, 4 );
for (l_i = 0; l_i < 8; l_i++)
if (( pos3 & 0x07) == at1700_ioaddr_pattern[l_i])
break;
ioaddr = at1700_mca_probe_list[l_i];
for (irq = 0; irq < 0x10; irq++)
if (((((pos4>>4) & 0x0f) | (pos3 & 0xf0)) & 0xff) == at1700_irq_pattern[irq])
break;
/* probing for a card at a particular IO/IRQ */
if ((dev->irq && dev->irq != irq) ||
(dev->base_addr && dev->base_addr != ioaddr)) {
slot++; /* probing next slot */
continue;
}
dev->irq = irq;
/* claim the slot */
mca_set_adapter_name( slot, at1720_mca_adapters[j].name );
mca_mark_as_used(slot);
goto found;
}
}
/* if we get here, we didn't find an MCA adapter - try ISA */
}
#endif
slot = -1;
/* We must check for the EEPROM-config boards first, else accessing
IOCONFIG0 will move the board! */
if (at1700_probe_list[inb(ioaddr + IOCONFIG1) & 0x07] == ioaddr &&
@ -360,11 +262,7 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
goto err_out;
}
#ifdef CONFIG_MCA_LEGACY
found:
#endif
/* Reset the internal state machines. */
/* Reset the internal state machines. */
outb(0, ioaddr + RESET);
if (is_at1700) {
@ -380,11 +278,11 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
break;
}
if (i == 8) {
goto err_mca;
goto err_out;
}
} else {
if (fmv18x_probe_list[inb(ioaddr + IOCONFIG) & 0x07] != ioaddr)
goto err_mca;
goto err_out;
irq = fmv_irqmap[(inb(ioaddr + IOCONFIG)>>6) & 0x03];
}
}
@ -464,23 +362,17 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
spin_lock_init(&lp->lock);
lp->jumpered = is_fmv18x;
lp->mca_slot = slot;
/* Snarf the interrupt vector now. */
ret = request_irq(irq, net_interrupt, 0, DRV_NAME, dev);
if (ret) {
printk(KERN_ERR "AT1700 at %#3x is unusable due to a "
"conflict on IRQ %d.\n",
ioaddr, irq);
goto err_mca;
goto err_out;
}
return 0;
err_mca:
#ifdef CONFIG_MCA_LEGACY
if (slot >= 0)
mca_mark_as_unused(slot);
#endif
err_out:
release_region(ioaddr, AT1700_IO_EXTENT);
return ret;

File diff suppressed because it is too large Load diff

View file

@ -1,355 +0,0 @@
#ifndef _3c523_INCLUDE_
#define _3c523_INCLUDE_
/*
This is basically a hacked version of ni52.h, for the 3c523
Etherlink/MC.
*/
/*
* Intel i82586 Ethernet definitions
*
* This is an extension to the Linux operating system, and is covered by the
* same GNU General Public License that covers that work.
*
* Copyright 1995 by Chris Beauregard (cpbeaure@undergrad.math.uwaterloo.ca)
*
* See 3c523.c for details.
*
* $Header: /home/chrisb/linux-1.2.13-3c523/drivers/net/RCS/3c523.h,v 1.6 1996/01/20 05:09:00 chrisb Exp chrisb $
*/
/*
* where to find the System Configuration Pointer (SCP)
*/
#define SCP_DEFAULT_ADDRESS 0xfffff4
/*
* System Configuration Pointer Struct
*/
struct scp_struct
{
unsigned short zero_dum0; /* has to be zero */
unsigned char sysbus; /* 0=16Bit,1=8Bit */
unsigned char zero_dum1; /* has to be zero for 586 */
unsigned short zero_dum2;
unsigned short zero_dum3;
char *iscp; /* pointer to the iscp-block */
};
/*
* Intermediate System Configuration Pointer (ISCP)
*/
struct iscp_struct
{
unsigned char busy; /* 586 clears after successful init */
unsigned char zero_dummy; /* hast to be zero */
unsigned short scb_offset; /* pointeroffset to the scb_base */
char *scb_base; /* base-address of all 16-bit offsets */
};
/*
* System Control Block (SCB)
*/
struct scb_struct
{
unsigned short status; /* status word */
unsigned short cmd; /* command word */
unsigned short cbl_offset; /* pointeroffset, command block list */
unsigned short rfa_offset; /* pointeroffset, receive frame area */
unsigned short crc_errs; /* CRC-Error counter */
unsigned short aln_errs; /* alignmenterror counter */
unsigned short rsc_errs; /* Resourceerror counter */
unsigned short ovrn_errs; /* OVerrunerror counter */
};
/*
* possible command values for the command word
*/
#define RUC_MASK 0x0070 /* mask for RU commands */
#define RUC_NOP 0x0000 /* NOP-command */
#define RUC_START 0x0010 /* start RU */
#define RUC_RESUME 0x0020 /* resume RU after suspend */
#define RUC_SUSPEND 0x0030 /* suspend RU */
#define RUC_ABORT 0x0040 /* abort receiver operation immediately */
#define CUC_MASK 0x0700 /* mask for CU command */
#define CUC_NOP 0x0000 /* NOP-command */
#define CUC_START 0x0100 /* start execution of 1. cmd on the CBL */
#define CUC_RESUME 0x0200 /* resume after suspend */
#define CUC_SUSPEND 0x0300 /* Suspend CU */
#define CUC_ABORT 0x0400 /* abort command operation immediately */
#define ACK_MASK 0xf000 /* mask for ACK command */
#define ACK_CX 0x8000 /* acknowledges STAT_CX */
#define ACK_FR 0x4000 /* ack. STAT_FR */
#define ACK_CNA 0x2000 /* ack. STAT_CNA */
#define ACK_RNR 0x1000 /* ack. STAT_RNR */
/*
* possible status values for the status word
*/
#define STAT_MASK 0xf000 /* mask for cause of interrupt */
#define STAT_CX 0x8000 /* CU finished cmd with its I bit set */
#define STAT_FR 0x4000 /* RU finished receiving a frame */
#define STAT_CNA 0x2000 /* CU left active state */
#define STAT_RNR 0x1000 /* RU left ready state */
#define CU_STATUS 0x700 /* CU status, 0=idle */
#define CU_SUSPEND 0x100 /* CU is suspended */
#define CU_ACTIVE 0x200 /* CU is active */
#define RU_STATUS 0x70 /* RU status, 0=idle */
#define RU_SUSPEND 0x10 /* RU suspended */
#define RU_NOSPACE 0x20 /* RU no resources */
#define RU_READY 0x40 /* RU is ready */
/*
* Receive Frame Descriptor (RFD)
*/
struct rfd_struct
{
unsigned short status; /* status word */
unsigned short last; /* Bit15,Last Frame on List / Bit14,suspend */
unsigned short next; /* linkoffset to next RFD */
unsigned short rbd_offset; /* pointeroffset to RBD-buffer */
unsigned char dest[6]; /* ethernet-address, destination */
unsigned char source[6]; /* ethernet-address, source */
unsigned short length; /* 802.3 frame-length */
unsigned short zero_dummy; /* dummy */
};
#define RFD_LAST 0x8000 /* last: last rfd in the list */
#define RFD_SUSP 0x4000 /* last: suspend RU after */
#define RFD_ERRMASK 0x0fe1 /* status: errormask */
#define RFD_MATCHADD 0x0002 /* status: Destinationaddress !matches IA */
#define RFD_RNR 0x0200 /* status: receiver out of resources */
/*
* Receive Buffer Descriptor (RBD)
*/
struct rbd_struct
{
unsigned short status; /* status word,number of used bytes in buff */
unsigned short next; /* pointeroffset to next RBD */
char *buffer; /* receive buffer address pointer */
unsigned short size; /* size of this buffer */
unsigned short zero_dummy; /* dummy */
};
#define RBD_LAST 0x8000 /* last buffer */
#define RBD_USED 0x4000 /* this buffer has data */
#define RBD_MASK 0x3fff /* size-mask for length */
/*
* Statusvalues for Commands/RFD
*/
#define STAT_COMPL 0x8000 /* status: frame/command is complete */
#define STAT_BUSY 0x4000 /* status: frame/command is busy */
#define STAT_OK 0x2000 /* status: frame/command is ok */
/*
* Action-Commands
*/
#define CMD_NOP 0x0000 /* NOP */
#define CMD_IASETUP 0x0001 /* initial address setup command */
#define CMD_CONFIGURE 0x0002 /* configure command */
#define CMD_MCSETUP 0x0003 /* MC setup command */
#define CMD_XMIT 0x0004 /* transmit command */
#define CMD_TDR 0x0005 /* time domain reflectometer (TDR) command */
#define CMD_DUMP 0x0006 /* dump command */
#define CMD_DIAGNOSE 0x0007 /* diagnose command */
/*
* Action command bits
*/
#define CMD_LAST 0x8000 /* indicates last command in the CBL */
#define CMD_SUSPEND 0x4000 /* suspend CU after this CB */
#define CMD_INT 0x2000 /* generate interrupt after execution */
/*
* NOP - command
*/
struct nop_cmd_struct
{
unsigned short cmd_status; /* status of this command */
unsigned short cmd_cmd; /* the command itself (+bits) */
unsigned short cmd_link; /* offsetpointer to next command */
};
/*
* IA Setup command
*/
struct iasetup_cmd_struct
{
unsigned short cmd_status;
unsigned short cmd_cmd;
unsigned short cmd_link;
unsigned char iaddr[6];
};
/*
* Configure command
*/
struct configure_cmd_struct
{
unsigned short cmd_status;
unsigned short cmd_cmd;
unsigned short cmd_link;
unsigned char byte_cnt; /* size of the config-cmd */
unsigned char fifo; /* fifo/recv monitor */
unsigned char sav_bf; /* save bad frames (bit7=1)*/
unsigned char adr_len; /* adr_len(0-2),al_loc(3),pream(4-5),loopbak(6-7)*/
unsigned char priority; /* lin_prio(0-2),exp_prio(4-6),bof_metd(7) */
unsigned char ifs; /* inter frame spacing */
unsigned char time_low; /* slot time low */
unsigned char time_high; /* slot time high(0-2) and max. retries(4-7) */
unsigned char promisc; /* promisc-mode(0) , et al (1-7) */
unsigned char carr_coll; /* carrier(0-3)/collision(4-7) stuff */
unsigned char fram_len; /* minimal frame len */
unsigned char dummy; /* dummy */
};
/*
* Multicast Setup command
*/
struct mcsetup_cmd_struct
{
unsigned short cmd_status;
unsigned short cmd_cmd;
unsigned short cmd_link;
unsigned short mc_cnt; /* number of bytes in the MC-List */
unsigned char mc_list[0][6]; /* pointer to 6 bytes entries */
};
/*
* transmit command
*/
struct transmit_cmd_struct
{
unsigned short cmd_status;
unsigned short cmd_cmd;
unsigned short cmd_link;
unsigned short tbd_offset; /* pointeroffset to TBD */
unsigned char dest[6]; /* destination address of the frame */
unsigned short length; /* user defined: 802.3 length / Ether type */
};
#define TCMD_ERRMASK 0x0fa0
#define TCMD_MAXCOLLMASK 0x000f
#define TCMD_MAXCOLL 0x0020
#define TCMD_HEARTBEAT 0x0040
#define TCMD_DEFERRED 0x0080
#define TCMD_UNDERRUN 0x0100
#define TCMD_LOSTCTS 0x0200
#define TCMD_NOCARRIER 0x0400
#define TCMD_LATECOLL 0x0800
struct tdr_cmd_struct
{
unsigned short cmd_status;
unsigned short cmd_cmd;
unsigned short cmd_link;
unsigned short status;
};
#define TDR_LNK_OK 0x8000 /* No link problem identified */
#define TDR_XCVR_PRB 0x4000 /* indicates a transceiver problem */
#define TDR_ET_OPN 0x2000 /* open, no correct termination */
#define TDR_ET_SRT 0x1000 /* TDR detected a short circuit */
#define TDR_TIMEMASK 0x07ff /* mask for the time field */
/*
* Transmit Buffer Descriptor (TBD)
*/
struct tbd_struct
{
unsigned short size; /* size + EOF-Flag(15) */
unsigned short next; /* pointeroffset to next TBD */
char *buffer; /* pointer to buffer */
};
#define TBD_LAST 0x8000 /* EOF-Flag, indicates last buffer in list */
/*************************************************************************/
/*
Verbatim from the Crynwyr stuff:
The 3c523 responds with adapter code 0x6042 at slot
registers xxx0 and xxx1. The setup register is at xxx2 and
contains the following bits:
0: card enable
2,1: csr address select
00 = 0300
01 = 1300
10 = 2300
11 = 3300
4,3: shared memory address select
00 = 0c0000
01 = 0c8000
10 = 0d0000
11 = 0d8000
5: set to disable on-board thinnet
7,6: (read-only) shows selected irq
00 = 12
01 = 7
10 = 3
11 = 9
The interrupt-select register is at xxx3 and uses one bit per irq.
0: int 12
1: int 7
2: int 3
3: int 9
Again, the documentation stresses that the setup register
should never be written. The interrupt-select register may be
written with the value corresponding to bits 7.6 in
the setup register to insure corret setup.
*/
/* Offsets from the base I/O address. */
#define ELMC_SA 0 /* first 6 bytes are IEEE network address */
#define ELMC_CTRL 6 /* control & status register */
#define ELMC_REVISION 7 /* revision register, first 4 bits only */
#define ELMC_IO_EXTENT 8
/* these are the bit selects for the port register 2 */
#define ELMC_STATUS_ENABLED 0x01
#define ELMC_STATUS_CSR_SELECT 0x06
#define ELMC_STATUS_MEMORY_SELECT 0x18
#define ELMC_STATUS_DISABLE_THIN 0x20
#define ELMC_STATUS_IRQ_SELECT 0xc0
/* this is the card id used in the detection code. You might recognize
it from @6042.adf */
#define ELMC_MCA_ID 0x6042
/*
The following define the bits for the control & status register
The bank select registers can be used if more than 16K of memory is
on the card. For some stupid reason, bank 3 is the one for the
bottom 16K, and the card defaults to bank 0. So we have to set the
bank to 3 before the card will even think of operating. To get bank
3, set BS0 and BS1 to high (of course...)
*/
#define ELMC_CTRL_BS0 0x01 /* RW bank select */
#define ELMC_CTRL_BS1 0x02 /* RW bank select */
#define ELMC_CTRL_INTE 0x04 /* RW interrupt enable, assert high */
#define ELMC_CTRL_INT 0x08 /* R interrupt active, assert high */
/*#define ELMC_CTRL_* 0x10*/ /* reserved */
#define ELMC_CTRL_LBK 0x20 /* RW loopback enable, assert high */
#define ELMC_CTRL_CA 0x40 /* RW channel attention, assert high */
#define ELMC_CTRL_RST 0x80 /* RW 82586 reset, assert low */
/* some handy compound bits */
/* normal operation should have bank 3 and RST high, ints enabled */
#define ELMC_NORMAL (ELMC_CTRL_INTE|ELMC_CTRL_RST|0x3)
#endif /* _3c523_INCLUDE_ */

File diff suppressed because it is too large Load diff

View file

@ -1,81 +0,0 @@
/*
* 3COM "EtherLink MC/32" Descriptions
*/
/*
* Registers
*/
#define HOST_CMD 0
#define HOST_CMD_START_RX (1<<3)
#define HOST_CMD_SUSPND_RX (3<<3)
#define HOST_CMD_RESTRT_RX (5<<3)
#define HOST_CMD_SUSPND_TX 3
#define HOST_CMD_RESTRT_TX 5
#define HOST_STATUS 2
#define HOST_STATUS_CRR (1<<6)
#define HOST_STATUS_CWR (1<<5)
#define HOST_CTRL 6
#define HOST_CTRL_ATTN (1<<7)
#define HOST_CTRL_RESET (1<<6)
#define HOST_CTRL_INTE (1<<2)
#define HOST_RAMPAGE 8
#define HALTED 0
#define RUNNING 1
struct mc32_mailbox
{
u16 mbox;
u16 data[1];
} __packed;
struct skb_header
{
u8 status;
u8 control;
u16 next; /* Do not change! */
u16 length;
u32 data;
} __packed;
struct mc32_stats
{
/* RX Errors */
u32 rx_crc_errors;
u32 rx_alignment_errors;
u32 rx_overrun_errors;
u32 rx_tooshort_errors;
u32 rx_toolong_errors;
u32 rx_outofresource_errors;
u32 rx_discarded; /* via card pattern match filter */
/* TX Errors */
u32 tx_max_collisions;
u32 tx_carrier_errors;
u32 tx_underrun_errors;
u32 tx_cts_errors;
u32 tx_timeout_errors;
/* various cruft */
u32 dataA[6];
u16 dataB[5];
u32 dataC[14];
} __packed;
#define STATUS_MASK 0x0F
#define COMPLETED (1<<7)
#define COMPLETED_OK (1<<6)
#define BUFFER_BUSY (1<<5)
#define CONTROL_EOP (1<<7) /* End Of Packet */
#define CONTROL_EOL (1<<6) /* End of List */
#define MCA_MC32_ID 0x0041 /* Our MCA ident */

View file

@ -43,28 +43,6 @@ config EL16
To compile this driver as a module, choose M here. The module
will be called 3c507.
config ELMC
tristate "3c523 \"EtherLink/MC\" support"
depends on MCA_LEGACY
---help---
If you have a network (Ethernet) card of this type, say Y and read
the Ethernet-HOWTO, available from
<http://www.tldp.org/docs.html#howto>.
To compile this driver as a module, choose M here. The module
will be called 3c523.
config ELMC_II
tristate "3c527 \"EtherLink/MC 32\" support (EXPERIMENTAL)"
depends on MCA && MCA_LEGACY
---help---
If you have a network (Ethernet) card of this type, say Y and read
the Ethernet-HOWTO, available from
<http://www.tldp.org/docs.html#howto>.
To compile this driver as a module, choose M here. The module
will be called 3c527.
config ARM_ETHER1
tristate "Acorn Ether1 support"
depends on ARM && ARCH_ACORN

View file

@ -7,8 +7,6 @@ obj-$(CONFIG_EEXPRESS) += eexpress.o
obj-$(CONFIG_EEXPRESS_PRO) += eepro.o
obj-$(CONFIG_ELPLUS) += 3c505.o
obj-$(CONFIG_EL16) += 3c507.o
obj-$(CONFIG_ELMC) += 3c523.o
obj-$(CONFIG_ELMC_II) += 3c527.o
obj-$(CONFIG_LP486E) += lp486e.o
obj-$(CONFIG_NI52) += ni52.o
obj-$(CONFIG_SUN3_82586) += sun3_82586.o

View file

@ -9,7 +9,7 @@
* Many modifications, and currently maintained, by
* Philip Blundell <philb@gnu.org>
* Added the Compaq LTE Alan Cox <alan@lxorguk.ukuu.org.uk>
* Added MCA support Adam Fritzler
* Added MCA support Adam Fritzler (now deleted)
*
* Note - this driver is experimental still - it has problems on faster
* machines. Someone needs to sit down and go through it line by line with
@ -111,7 +111,6 @@
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/mca-legacy.h>
#include <linux/spinlock.h>
#include <linux/bitops.h>
#include <linux/jiffies.h>
@ -227,16 +226,6 @@ static unsigned short start_code[] = {
/* maps irq number to EtherExpress magic value */
static char irqrmap[] = { 0,0,1,2,3,4,0,0,0,1,5,6,0,0,0,0 };
#ifdef CONFIG_MCA_LEGACY
/* mapping of the first four bits of the second POS register */
static unsigned short mca_iomap[] = {
0x270, 0x260, 0x250, 0x240, 0x230, 0x220, 0x210, 0x200,
0x370, 0x360, 0x350, 0x340, 0x330, 0x320, 0x310, 0x300
};
/* bits 5-7 of the second POS register */
static char mca_irqmap[] = { 12, 9, 3, 4, 5, 10, 11, 15 };
#endif
/*
* Prototypes for Linux interface
*/
@ -340,53 +329,6 @@ static int __init do_express_probe(struct net_device *dev)
dev->if_port = 0xff; /* not set */
#ifdef CONFIG_MCA_LEGACY
if (MCA_bus) {
int slot = 0;
/*
* Only find one card at a time. Subsequent calls
* will find others, however, proper multicard MCA
* probing and setup can't be done with the
* old-style Space.c init routines. -- ASF
*/
while (slot != MCA_NOTFOUND) {
int pos0, pos1;
slot = mca_find_unused_adapter(0x628B, slot);
if (slot == MCA_NOTFOUND)
break;
pos0 = mca_read_stored_pos(slot, 2);
pos1 = mca_read_stored_pos(slot, 3);
ioaddr = mca_iomap[pos1&0xf];
dev->irq = mca_irqmap[(pos1>>4)&0x7];
/*
* XXX: Transceiver selection is done
* differently on the MCA version.
* How to get it to select something
* other than external/AUI is currently
* unknown. This code is just for looks. -- ASF
*/
if ((pos0 & 0x7) == 0x1)
dev->if_port = AUI;
else if ((pos0 & 0x7) == 0x5) {
if (pos1 & 0x80)
dev->if_port = BNC;
else
dev->if_port = TPE;
}
mca_set_adapter_name(slot, "Intel EtherExpress 16 MCA");
mca_set_adapter_procfn(slot, NULL, dev);
mca_mark_as_used(slot);
break;
}
}
#endif
if (ioaddr&0xfe00) {
if (!request_region(ioaddr, EEXP_IO_EXTENT, "EtherExpress"))
return -EBUSY;

View file

@ -6,9 +6,8 @@ config NET_VENDOR_NATSEMI
bool "National Semi-conductor devices"
default y
depends on AMIGA_PCMCIA || ARM || EISA || EXPERIMENTAL || H8300 || \
ISA || M32R || MAC || MACH_JAZZ || MACH_TX49XX || MCA || \
MCA_LEGACY || MIPS || PCI || PCMCIA || SUPERH || \
XTENSA_PLATFORM_XT2000 || ZORRO
ISA || M32R || MAC || MACH_JAZZ || MACH_TX49XX || MIPS || \
PCI || PCMCIA || SUPERH || XTENSA_PLATFORM_XT2000 || ZORRO
---help---
If you have a network (Ethernet) card belonging to this class, say Y
and read the Ethernet-HOWTO, available from
@ -21,21 +20,6 @@ config NET_VENDOR_NATSEMI
if NET_VENDOR_NATSEMI
config IBMLANA
tristate "IBM LAN Adapter/A support"
depends on MCA
---help---
This is a Micro Channel Ethernet adapter. You need to set
CONFIG_MCA to use this driver. It is both available as an in-kernel
driver and as a module.
To compile this driver as a module, choose M here. The only
currently supported card is the IBM LAN Adapter/A for Ethernet. It
will both support 16K and 32K memory windows, however a 32K window
gives a better security against packet losses. Usage of multiple
boards with this driver should be possible, but has not been tested
up to now due to lack of hardware.
config MACSONIC
tristate "Macintosh SONIC based ethernet (onboard, NuBus, LC, CS)"
depends on MAC

View file

@ -2,7 +2,6 @@
# Makefile for the National Semi-conductor Sonic devices.
#
obj-$(CONFIG_IBMLANA) += ibmlana.o
obj-$(CONFIG_MACSONIC) += macsonic.o
obj-$(CONFIG_MIPS_JAZZ_SONIC) += jazzsonic.o
obj-$(CONFIG_NATSEMI) += natsemi.o