Commit 41b3a9f2 authored by Kent Yoder's avatar Kent Yoder Committed by Jeff Garzik

[netdrvr lanstreamer] a fix and a feature addition:

This patch takes 2 calls to free_irq out of the interrupt
function's code path, which if hit would cause the machine
to hang. It also adds netif_carrier_{on|off} calls where
necessary.
parent 62350638
......@@ -66,6 +66,8 @@
* the number of TX descriptors to 1, which together can prevent
* the card from locking up the box - <yoder1@us.ibm.com>
* 09/27/02 - New PCI interface + bug fix. - <yoder1@us.ibm.com>
* 11/13/02 - Removed free_irq calls which could cause a hang, added
* netif_carrier_{on|off} - <yoder1@us.ibm.com>
*
* To Do:
*
......@@ -136,7 +138,7 @@
*/
static char version[] = "LanStreamer.c v0.4.0 03/08/01 - Mike Sullivan\n"
" v0.5.2 09/30/02 - Kent Yoder";
" v0.5.3 11/13/02 - Kent Yoder";
static struct pci_device_id streamer_pci_tbl[] __initdata = {
{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_TR, PCI_ANY_ID, PCI_ANY_ID,},
......@@ -878,6 +880,7 @@ static int streamer_open(struct net_device *dev)
#endif
netif_start_queue(dev);
netif_carrier_on(dev);
return 0;
}
......@@ -1101,7 +1104,9 @@ static void streamer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
ntohs(readw(streamer_mmio + LAPDINC)),
ntohs(readw(streamer_mmio + LAPDINC)),
ntohs(readw(streamer_mmio + LAPDINC)));
free_irq(dev->irq, dev);
netif_stop_queue(dev);
netif_carrier_off(dev);
printk(KERN_WARNING "%s: Adapter must be manually reset.\n", dev->name);
}
/* SISR_ADAPTER_CHECK */
......@@ -1199,6 +1204,7 @@ static int streamer_close(struct net_device *dev)
int i;
netif_stop_queue(dev);
netif_carrier_off(dev);
writew(streamer_priv->srb, streamer_mmio + LAPA);
writew(htons(SRB_CLOSE_ADAPTER << 8),streamer_mmio+LAPDINC);
writew(htons(STREAMER_CLEAR_RET_CODE << 8), streamer_mmio+LAPDINC);
......@@ -1669,11 +1675,10 @@ static void streamer_arb_cmd(struct net_device *dev)
/* @TBD. no llc reset on autostreamer writel(readl(streamer_mmio+BCTL)|(3<<13),streamer_mmio+BCTL);
udelay(1);
writel(readl(streamer_mmio+BCTL)&~(3<<13),streamer_mmio+BCTL); */
netif_stop_queue(dev);
free_irq(dev->irq, dev);
printk(KERN_WARNING "%s: Adapter has been closed \n", dev->name);
netif_stop_queue(dev);
netif_carrier_off(dev);
printk(KERN_WARNING "%s: Adapter must be manually reset.\n", dev->name);
}
/* If serious error */
if (streamer_priv->streamer_message_level) {
......
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