/* * Linux ARCnet driver - COM90xx chipset (IO-mapped buffers) * * Written 1997 by David Woodhouse. * Written 1994-1999 by Avery Pennarun. * Written 1999-2000 by Martin Mares <mj@ucw.cz>. * Derived from skeleton.c by Donald Becker. * * Special thanks to Contemporary Controls, Inc. (www.ccontrols.com) * for sponsoring the further development of this driver. * * ********************** * * The original copyright of skeleton.c was as follows: * * skeleton.c Written 1993 by Donald Becker. * Copyright 1993 United States Government as represented by the * Director, National Security Agency. This software may only be used * and distributed according to the terms of the GNU General Public License as * modified by SRC, incorporated herein by reference. * * ********************** * * For more details, see drivers/net/arcnet.c * * **********************
*/
/* We cannot probe for an IO mapped card either, although we can check that * it's where we were told it was, and even autoirq
*/ staticint __init com90io_probe(struct net_device *dev)
{ int ioaddr = dev->base_addr, status; unsignedlong airqmask;
if (BUGLVL(D_NORMAL)) {
pr_info("%s\n", "COM90xx IO-mapped mode support (by David Woodhouse et el.)");
pr_info("E-mail me if you actually test this driver, please!\n");
}
if (!ioaddr) {
arc_printk(D_NORMAL, dev, "No autoprobe for IO mapped cards; you must specify the base address!\n"); return -ENODEV;
} if (!request_region(ioaddr, ARCNET_TOTAL_SIZE, "com90io probe")) {
arc_printk(D_INIT_REASONS, dev, "IO request_region %x-%x failed\n",
ioaddr, ioaddr + ARCNET_TOTAL_SIZE - 1); return -ENXIO;
} if (arcnet_inb(ioaddr, COM9026_REG_R_STATUS) == 0xFF) {
arc_printk(D_INIT_REASONS, dev, "IO address %x empty\n",
ioaddr); goto err_out;
}
arcnet_inb(ioaddr, COM9026_REG_R_RESET);
mdelay(RESETtime);
status = arcnet_inb(ioaddr, COM9026_REG_R_STATUS);
status = arcnet_inb(ioaddr, COM9026_REG_RW_MEMDATA); if (status != 0xd1) {
arc_printk(D_INIT_REASONS, dev, "Signature byte not found (%Xh instead).\n",
status); goto err_out;
} if (!dev->irq) { /* if we do this, we're sure to get an IRQ since the * card has just reset and the NORXflag is on until * we tell it to start receiving.
*/
/* Set up the struct net_device associated with this card. Called after * probing succeeds.
*/ staticint __init com90io_found(struct net_device *dev)
{ struct arcnet_local *lp; int ioaddr = dev->base_addr; int err;
/* Reserve the irq */ if (request_irq(dev->irq, arcnet_interrupt, 0, "arcnet (COM90xx-IO)", dev)) {
arc_printk(D_NORMAL, dev, "Can't get IRQ %d!\n", dev->irq); return -ENODEV;
} /* Reserve the I/O region */ if (!request_region(dev->base_addr, ARCNET_TOTAL_SIZE, "arcnet (COM90xx-IO)")) {
free_irq(dev->irq, dev); return -EBUSY;
}
arc_printk(D_NORMAL, dev, "COM90IO: station %02Xh found at %03lXh, IRQ %d.\n",
dev->dev_addr[0], dev->base_addr, dev->irq);
return 0;
}
/* Do a hardware reset on the card, and set up necessary registers. * * This should be called as little as possible, because it disrupts the * token on the network (causes a RECON) and requires a significant delay. * * However, it does make sure the card is in a defined state.
*/ staticint com90io_reset(struct net_device *dev, int really_reset)
{ struct arcnet_local *lp = netdev_priv(dev); short ioaddr = dev->base_addr;
/* In case the old driver is loaded later, * set the thing back to MMAP mode
*/
arcnet_outb(arcnet_inb(ioaddr, COM9026_REG_RW_CONFIG) & ~IOMAPflag,
ioaddr, COM9026_REG_RW_CONFIG);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.