Messages in this thread Patch in this message |  | | Subject | Little Lance Patch | Date | Thu, 16 Jan 97 17:49:50 CET | From | Tekno Soft Snc <> |
| |
Hi all,
this is a little patch for the lance cards. The patch generate a better code for the lance interrupt routine.
--- cut here --- cut here --- cut here --- cut here --- --- drivers/net/lance.c.orig Mon Aug 26 13:28:33 1996 +++ drivers/net/lance.c Thu Jan 16 17:36:07 1997 @@ -907,7 +907,6 @@ struct device *dev = (struct device *)(irq2dev_map[irq]); struct lance_private *lp; int csr0, ioaddr, boguscnt=10; - int must_restart; if (dev == NULL) { printk ("lance_interrupt(): irq %d for unknown device.\n", irq); @@ -927,8 +926,6 @@ /* Acknowledge all of the current interrupt sources ASAP. */ outw(csr0 & ~0x004f, dev->base_addr + LANCE_DATA); - must_restart = 0; - if (lance_debug > 5) printk("%s: interrupt csr0=%#2.2x new csr=%#2.2x.\n", dev->name, csr0, inw(dev->base_addr + LANCE_DATA)); @@ -962,7 +959,10 @@ printk("%s: Tx FIFO error! Status %4.4x.\n", dev->name, csr0); /* Restart the chip. */ - must_restart = 1; + /* stop the chip to clear the error condition */ + outw(0x0000, dev->base_addr + LANCE_ADDR); + outw(0x0004, dev->base_addr + LANCE_DATA); + lance_restart(dev, 0x0002, 0); } } else { if (status & 0x18000000) @@ -1005,15 +1005,12 @@ printk("%s: Bus master arbitration failure, status %4.4x.\n", dev->name, csr0); /* Restart the chip. */ - must_restart = 1; - } - - if (must_restart) { - /* stop the chip to clear the error condition, then restart */ + /* stop the chip to clear the error condition */ outw(0x0000, dev->base_addr + LANCE_ADDR); outw(0x0004, dev->base_addr + LANCE_DATA); lance_restart(dev, 0x0002, 0); } + } /* Clear any other interrupt, and set interrupt enable. */ --- drivers/net/lance32.c.orig Tue Oct 15 21:01:28 1996 +++ drivers/net/lance32.c Thu Jan 16 17:36:09 1997 @@ -555,7 +555,6 @@ struct device *dev = (struct device *)dev_id; struct lance32_private *lp; int csr0, ioaddr, boguscnt=10; - int must_restart; if (dev == NULL) { printk ("lance32_interrupt(): irq %d for unknown device.\n", irq); @@ -575,8 +574,6 @@ /* Acknowledge all of the current interrupt sources ASAP. */ outw(csr0 & ~0x004f, dev->base_addr + LANCE_DATA); - must_restart = 0; - if (lance32_debug > 5) printk("%s: interrupt csr0=%#2.2x new csr=%#2.2x.\n", dev->name, csr0, inw(dev->base_addr + LANCE_DATA)); @@ -610,7 +607,10 @@ printk("%s: Tx FIFO error! Status %4.4x.\n", dev->name, csr0); /* Restart the chip. */ - must_restart = 1; + /* stop the chip to clear the error condition */ + outw(0x0000, dev->base_addr + LANCE_ADDR); + outw(0x0004, dev->base_addr + LANCE_DATA); + lance32_restart(dev, 0x0002, 0); } } else { if (status & 0x1800) @@ -652,15 +652,12 @@ printk("%s: Bus master arbitration failure, status %4.4x.\n", dev->name, csr0); /* Restart the chip. */ - must_restart = 1; - } - - if (must_restart) { - /* stop the chip to clear the error condition, then restart */ + /* stop the chip to clear the error condition */ outw(0x0000, dev->base_addr + LANCE_ADDR); outw(0x0004, dev->base_addr + LANCE_DATA); lance32_restart(dev, 0x0002, 0); } + } /* Clear any other interrupt, and set interrupt enable. */ --- cut here --- cut here --- cut here --- cut here ---
Roberto Fichera - email MC3641@mclink.it
|  |