aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-12-10 14:58:37 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:06:35 -0500
commit4f679496567809ce1e95730c25274e1832537f4b (patch)
treee46717a8df0eda9e741098ddaf56b7e1c36ab580 /drivers/net/wireless
parent1309b55b4de18bbfe19c73225a5481d6cdc8a463 (diff)
libertas: clean up lbs_interrupt()
Make it take struct lbs_private as argument; that's all it wants anyway, and all callers were starting off from that. Don't wake the netif queues, because those should be handled elsewhere. And sort out the locking, with a big nasty warning for those who don't have the driver_lock locked when they call it. Oh, and fix if_cs.c to lock the driver_lock before calling it. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/libertas/decl.h2
-rw-r--r--drivers/net/wireless/libertas/if_cs.c5
-rw-r--r--drivers/net/wireless/libertas/if_sdio.c4
-rw-r--r--drivers/net/wireless/libertas/if_usb.c4
-rw-r--r--drivers/net/wireless/libertas/main.c19
5 files changed, 17 insertions, 17 deletions
diff --git a/drivers/net/wireless/libertas/decl.h b/drivers/net/wireless/libertas/decl.h
index a086d0c6dfed..82727a87ea92 100644
--- a/drivers/net/wireless/libertas/decl.h
+++ b/drivers/net/wireless/libertas/decl.h
@@ -39,7 +39,7 @@ void lbs_queue_cmd(struct lbs_private *priv,
39int lbs_allocate_cmd_buffer(struct lbs_private *priv); 39int lbs_allocate_cmd_buffer(struct lbs_private *priv);
40int lbs_execute_next_command(struct lbs_private *priv); 40int lbs_execute_next_command(struct lbs_private *priv);
41int lbs_process_event(struct lbs_private *priv); 41int lbs_process_event(struct lbs_private *priv);
42void lbs_interrupt(struct net_device *); 42void lbs_interrupt(struct lbs_private *priv);
43int lbs_set_radio_control(struct lbs_private *priv); 43int lbs_set_radio_control(struct lbs_private *priv);
44u32 lbs_fw_index_to_data_rate(u8 index); 44u32 lbs_fw_index_to_data_rate(u8 index);
45u8 lbs_data_rate_to_fw_index(u32 rate); 45u8 lbs_data_rate_to_fw_index(u32 rate);
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index 49a01780dd03..2acbe5dcff7d 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -264,8 +264,9 @@ static irqreturn_t if_cs_interrupt(int irq, void *data)
264 /* clear interrupt */ 264 /* clear interrupt */
265 if_cs_write16(card, IF_CS_C_INT_CAUSE, int_cause & IF_CS_C_IC_MASK); 265 if_cs_write16(card, IF_CS_C_INT_CAUSE, int_cause & IF_CS_C_IC_MASK);
266 } 266 }
267 267 spin_lock(&card->priv->driver_lock);
268 lbs_interrupt(card->priv->dev); 268 lbs_interrupt(card->priv);
269 spin_unlock(&card->priv->driver_lock);
269 270
270 return IRQ_HANDLED; 271 return IRQ_HANDLED;
271} 272}
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 24239609367f..1ed72b9b6bf2 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -154,7 +154,7 @@ static int if_sdio_handle_cmd(struct if_sdio_card *card,
154 154
155 card->int_cause |= MRVDRV_CMD_UPLD_RDY; 155 card->int_cause |= MRVDRV_CMD_UPLD_RDY;
156 156
157 lbs_interrupt(card->priv->dev); 157 lbs_interrupt(card->priv);
158 158
159 ret = 0; 159 ret = 0;
160 160
@@ -236,7 +236,7 @@ static int if_sdio_handle_event(struct if_sdio_card *card,
236 card->event = event; 236 card->event = event;
237 card->int_cause |= MRVDRV_CARDEVENT; 237 card->int_cause |= MRVDRV_CARDEVENT;
238 238
239 lbs_interrupt(card->priv->dev); 239 lbs_interrupt(card->priv);
240 240
241 spin_unlock_irqrestore(&card->priv->driver_lock, flags); 241 spin_unlock_irqrestore(&card->priv->driver_lock, flags);
242 242
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index f59fd73468fc..1c23166783f4 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -632,7 +632,7 @@ static inline void process_cmdrequest(int recvlength, u8 *recvbuff,
632 priv->upld_len); 632 priv->upld_len);
633 633
634 kfree_skb(skb); 634 kfree_skb(skb);
635 lbs_interrupt(priv->dev); 635 lbs_interrupt(priv);
636 spin_unlock(&priv->driver_lock); 636 spin_unlock(&priv->driver_lock);
637 637
638 lbs_deb_usbd(&cardp->udev->dev, 638 lbs_deb_usbd(&cardp->udev->dev,
@@ -705,7 +705,7 @@ static void if_usb_receive(struct urb *urb)
705 cardp->usb_event_cause <<= 3; 705 cardp->usb_event_cause <<= 3;
706 cardp->usb_int_cause |= MRVDRV_CARDEVENT; 706 cardp->usb_int_cause |= MRVDRV_CARDEVENT;
707 kfree_skb(skb); 707 kfree_skb(skb);
708 lbs_interrupt(priv->dev); 708 lbs_interrupt(priv);
709 spin_unlock(&priv->driver_lock); 709 spin_unlock(&priv->driver_lock);
710 goto rx_exit; 710 goto rx_exit;
711 default: 711 default:
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index f16c93ba6efd..2797149649ca 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -1408,23 +1408,22 @@ out:
1408 * @param dev A pointer to net_device structure 1408 * @param dev A pointer to net_device structure
1409 * @return n/a 1409 * @return n/a
1410 */ 1410 */
1411void lbs_interrupt(struct net_device *dev) 1411void lbs_interrupt(struct lbs_private *priv)
1412{ 1412{
1413 struct lbs_private *priv = dev->priv;
1414
1415 lbs_deb_enter(LBS_DEB_THREAD); 1413 lbs_deb_enter(LBS_DEB_THREAD);
1416 1414
1417 lbs_deb_thread("lbs_interrupt: intcounter=%d\n", 1415 lbs_deb_thread("lbs_interrupt: intcounter=%d\n", priv->intcounter);
1418 priv->intcounter); 1416
1417 if (spin_trylock(&priv->driver_lock)) {
1418 spin_unlock(&priv->driver_lock);
1419 printk(KERN_CRIT "%s called without driver_lock held\n", __func__);
1420 WARN_ON(1);
1421 }
1419 1422
1420 priv->intcounter++; 1423 priv->intcounter++;
1421 1424
1422 if (priv->psstate == PS_STATE_SLEEP) { 1425 if (priv->psstate == PS_STATE_SLEEP)
1423 priv->psstate = PS_STATE_AWAKE; 1426 priv->psstate = PS_STATE_AWAKE;
1424 netif_wake_queue(dev);
1425 if (priv->mesh_dev)
1426 netif_wake_queue(priv->mesh_dev);
1427 }
1428 1427
1429 wake_up_interruptible(&priv->waitq); 1428 wake_up_interruptible(&priv->waitq);
1430 1429