Commit 15d6f88e authored by Alan Cox's avatar Alan Cox Committed by Jens Axboe

[PATCH] bring 2.5 arcnet into line with 2.4

Fixes a request region breakage
Fixes a size request error
Handles a new card type
parent 110f2e73
/* /*
* Linux ARCnet driver - COM20020 PCI support (Contemporary Controls PCI20) * Linux ARCnet driver - COM20020 PCI support
* Contemporary Controls PCI20 and SOHARD SH-ARC PCI
* *
* Written 1994-1999 by Avery Pennarun, * Written 1994-1999 by Avery Pennarun,
* based on an ISA version by David Woodhouse. * based on an ISA version by David Woodhouse.
...@@ -86,7 +87,21 @@ static int __devinit com20020pci_probe(struct pci_dev *pdev, const struct pci_de ...@@ -86,7 +87,21 @@ static int __devinit com20020pci_probe(struct pci_dev *pdev, const struct pci_de
memset(lp, 0, sizeof(struct arcnet_local)); memset(lp, 0, sizeof(struct arcnet_local));
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);
ioaddr = pci_resource_start(pdev, 2); // SOHARD needs PCI base addr 4
if (pdev->vendor==0x10B5) {
BUGMSG(D_NORMAL, "SOHARD\n");
ioaddr = pci_resource_start(pdev, 4);
}
else {
BUGMSG(D_NORMAL, "Contemporary Controls\n");
ioaddr = pci_resource_start(pdev, 2);
}
// Dummy access after Reset
// ARCNET controller needs this access to detect bustype
outb(0x00,ioaddr+1);
inb(ioaddr+1);
dev->base_addr = ioaddr; dev->base_addr = ioaddr;
dev->irq = pdev->irq; dev->irq = pdev->irq;
dev->dev_addr[0] = node; dev->dev_addr[0] = node;
...@@ -152,6 +167,7 @@ static struct pci_device_id com20020pci_id_table[] __devinitdata = { ...@@ -152,6 +167,7 @@ static struct pci_device_id com20020pci_id_table[] __devinitdata = {
{ 0x1571, 0xa204, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT }, { 0x1571, 0xa204, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
{ 0x1571, 0xa205, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT }, { 0x1571, 0xa205, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
{ 0x1571, 0xa206, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT }, { 0x1571, 0xa206, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
{ 0x10B5, 0x9050, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
{0,} {0,}
}; };
......
...@@ -98,6 +98,10 @@ int __devinit com20020_check(struct net_device *dev) ...@@ -98,6 +98,10 @@ int __devinit com20020_check(struct net_device *dev)
lp->setup = lp->clockm ? 0 : (lp->clockp << 1); lp->setup = lp->clockm ? 0 : (lp->clockp << 1);
lp->setup2 = (lp->clockm << 4) | 8; lp->setup2 = (lp->clockm << 4) | 8;
/* CHECK: should we do this for SOHARD cards ? */
/* Enable P1Mode for backplane mode */
lp->setup = lp->setup | P1MODE;
SET_SUBADR(SUB_SETUP1); SET_SUBADR(SUB_SETUP1);
outb(lp->setup, _XREG); outb(lp->setup, _XREG);
...@@ -202,7 +206,7 @@ int __devinit com20020_found(struct net_device *dev, int shared) ...@@ -202,7 +206,7 @@ int __devinit com20020_found(struct net_device *dev, int shared)
return -ENODEV; return -ENODEV;
} }
/* reserve the I/O region */ /* reserve the I/O region */
if (request_region(ioaddr, ARCNET_TOTAL_SIZE, "arcnet (COM20020)")) { if (!request_region(ioaddr, ARCNET_TOTAL_SIZE, "arcnet (COM20020)")) {
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
return -EBUSY; return -EBUSY;
} }
...@@ -300,8 +304,9 @@ static void com20020_openclose(struct net_device *dev, bool open) ...@@ -300,8 +304,9 @@ static void com20020_openclose(struct net_device *dev, bool open)
struct arcnet_local *lp = (struct arcnet_local *) dev->priv; struct arcnet_local *lp = (struct arcnet_local *) dev->priv;
int ioaddr = dev->base_addr; int ioaddr = dev->base_addr;
if (open) if (open) {
MOD_INC_USE_COUNT; MOD_INC_USE_COUNT;
}
else { else {
/* disable transmitter */ /* disable transmitter */
lp->config &= ~TXENcfg; lp->config &= ~TXENcfg;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment