PATCH: bring 2.5 arcnet into line with 2.4

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Sat Feb 15 2003 - 14:28:40 EST


Fixes a request region breakage
Fixes a size request error
Handles a new card type

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.61/drivers/net/arcnet/com20020.c linux-2.5.61-ac1/drivers/net/arcnet/com20020.c
--- linux-2.5.61/drivers/net/arcnet/com20020.c 2003-02-10 18:38:17.000000000 +0000
+++ linux-2.5.61-ac1/drivers/net/arcnet/com20020.c 2003-02-14 23:22:10.000000000 +0000
@@ -98,6 +98,10 @@
         lp->setup = lp->clockm ? 0 : (lp->clockp << 1);
         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);
         outb(lp->setup, _XREG);
 
@@ -202,7 +206,7 @@
                 return -ENODEV;
         }
         /* 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);
                 return -EBUSY;
         }
@@ -300,8 +304,9 @@
         struct arcnet_local *lp = (struct arcnet_local *) dev->priv;
         int ioaddr = dev->base_addr;
 
- if (open)
+ if (open) {
                 MOD_INC_USE_COUNT;
+ }
         else {
                 /* disable transmitter */
                 lp->config &= ~TXENcfg;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.61/drivers/net/arcnet/com20020-pci.c linux-2.5.61-ac1/drivers/net/arcnet/com20020-pci.c
--- linux-2.5.61/drivers/net/arcnet/com20020-pci.c 2003-02-10 18:38:00.000000000 +0000
+++ linux-2.5.61-ac1/drivers/net/arcnet/com20020-pci.c 2003-02-14 23:22:15.000000000 +0000
@@ -1,5 +1,6 @@
 /*
- * 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,
  * based on an ISA version by David Woodhouse.
@@ -86,7 +87,21 @@
         memset(lp, 0, sizeof(struct arcnet_local));
         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->irq = pdev->irq;
         dev->dev_addr[0] = node;
@@ -152,6 +167,7 @@
         { 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, 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,}
 };
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Feb 15 2003 - 22:01:03 EST