o wl3501: add locking in the interrupt handler

parent fd18c378
...@@ -1322,30 +1322,29 @@ static irqreturn_t wl3501_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1322,30 +1322,29 @@ static irqreturn_t wl3501_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct net_device *dev = (struct net_device *)dev_id; struct net_device *dev = (struct net_device *)dev_id;
struct wl3501_card *this; struct wl3501_card *this;
int handled = 1;
if (!dev) { if (!dev)
printk(KERN_ERR "%s: irq %d for unknown device.\n", goto unknown;
__FUNCTION__, irq); this = dev->priv;
return IRQ_NONE; spin_lock(&this->lock);
}
this = (struct wl3501_card *)dev->priv;
wl3501_ack_interrupt(this); wl3501_ack_interrupt(this);
wl3501_block_interrupt(this); wl3501_block_interrupt(this);
wl3501_rx_interrupt(dev); wl3501_rx_interrupt(dev);
/* Clean Zone End */
wl3501_unblock_interrupt(this); wl3501_unblock_interrupt(this);
return IRQ_HANDLED; spin_unlock(&this->lock);
out:
return IRQ_RETVAL(handled);
unknown:
handled = 0;
printk(KERN_ERR "%s: irq %d for unknown device.\n", __FUNCTION__, irq);
goto out;
} }
static int wl3501_reset_board(struct wl3501_card *this) static int wl3501_reset_board(struct wl3501_card *this)
{ {
u8 tmp; u8 tmp = 0;
u32 i; int i, rc = 0;
int rc = 0;
/* Coreset */ /* Coreset */
wl3501_outb_p(WL3501_GCR_CORESET, this->base_addr + WL3501_NIC_GCR); wl3501_outb_p(WL3501_GCR_CORESET, this->base_addr + WL3501_NIC_GCR);
...@@ -1353,7 +1352,6 @@ static int wl3501_reset_board(struct wl3501_card *this) ...@@ -1353,7 +1352,6 @@ static int wl3501_reset_board(struct wl3501_card *this)
wl3501_outb_p(WL3501_GCR_CORESET, this->base_addr + WL3501_NIC_GCR); wl3501_outb_p(WL3501_GCR_CORESET, this->base_addr + WL3501_NIC_GCR);
/* Reset SRAM 0x480 to zero */ /* Reset SRAM 0x480 to zero */
tmp = 0;
wl3501_set_to_wla(this, 0x480, &tmp, sizeof(tmp)); wl3501_set_to_wla(this, 0x480, &tmp, sizeof(tmp));
/* Start up */ /* Start up */
......
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