Loss of support for 3c509 Revisited

From: Vernon H. Soden (vsoden@umich.edu)
Date: Sat Feb 19 2000 - 16:07:12 EST


I put in a message earlier about the loss of 3c509 support in 2.3.45.
Thanks to encouragement from Craig Kulesa and silence from the rest of the
list I dug into this a lot deeper. The patch for the 3c509.c code that
was installed by 2.3.44 causes the probe at boot time to completely ignore
the 3c509 card. There is nothing in dmesg that even indicates that it
looked for the card. I applied only this patch (see below) to 2.3.43 and
caused the failure. I am not familiar enough with the code to guess what
causes the test to slide by but it is clearly the case.
-----------------patch used -----------------------
diff -u --recursive --new-file v2.3.43/linux/drivers/net/3c509.c linux/drivers/net/3c509.c
--- v2.3.43/linux/drivers/net/3c509.c Thu Feb 10 17:11:09 2000
+++ linux/drivers/net/3c509.c Fri Feb 11 08:25:33 2000
@@ -412,6 +412,9 @@
                 }
         }
 
+ if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509"))
+ return -EBUSY;
+
         /* Set the adaptor tag so that the next card can be found. */
         outb(0xd0 + ++current_tag, id_port);
 
@@ -419,22 +422,26 @@
         outb((ioaddr >> 4) | 0xe0, id_port);
 
         EL3WINDOW(0);
- if (inw(ioaddr) != 0x6d50)
+ if (inw(ioaddr) != 0x6d50) {
+ release_region(ioaddr, EL3_IO_EXTENT);
                 return -ENODEV;
+ }
 
         /* Free the interrupt so that some other card can use it. */
         outw(0x0f00, ioaddr + WN0_IRQ);
  found:
         if (dev == NULL) {
                 dev = init_etherdev(dev, sizeof(struct el3_private));
+ if (dev == NULL) {
+ release_region(ioaddr, EL3_IO_EXTENT);
+ return -ENOMEM;
+ }
         }
         memcpy(dev->dev_addr, phys_addr, sizeof(phys_addr));
         dev->base_addr = ioaddr;
         dev->irq = irq;
         dev->if_port = (dev->mem_start & 0x1f) ? dev->mem_start & 3 : if_port;
 
- request_region(dev->base_addr, EL3_IO_EXTENT, "3c509");
-
         {
                 const char *if_names[] = {"10baseT", "AUI", "undefined", "BNC"};
                 printk("%s: 3c509 at %#3.3lx, %s port, address ",
@@ -599,7 +606,7 @@
         /* Issue TX_RESET and TX_START commands. */
         outw(TxReset, ioaddr + EL3_CMD);
         outw(TxEnable, ioaddr + EL3_CMD);
- netif_start_queue(dev);
+ netif_wake_queue(dev);
 }
 
 
@@ -609,6 +616,8 @@
         struct el3_private *lp = (struct el3_private *)dev->priv;
         int ioaddr = dev->base_addr;
         unsigned long flags;
+
+ netif_stop_queue (dev);
 
         lp->stats.tx_bytes += skb->len;
         
-------------------- end of patch ------------------------------

 Vern Soden
<vsoden@umich.edu>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:24 EST