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>
int lbs_allocate_cmd_buffer(struct lbs_private *priv);
int lbs_execute_next_command(struct lbs_private *priv);
int lbs_process_event(struct lbs_private *priv);
int lbs_allocate_cmd_buffer(struct lbs_private *priv);
int lbs_execute_next_command(struct lbs_private *priv);
int lbs_process_event(struct lbs_private *priv);
-void lbs_interrupt(struct net_device *);
+void lbs_interrupt(struct lbs_private *priv);
int lbs_set_radio_control(struct lbs_private *priv);
u32 lbs_fw_index_to_data_rate(u8 index);
u8 lbs_data_rate_to_fw_index(u32 rate);
int lbs_set_radio_control(struct lbs_private *priv);
u32 lbs_fw_index_to_data_rate(u8 index);
u8 lbs_data_rate_to_fw_index(u32 rate);
/* clear interrupt */
if_cs_write16(card, IF_CS_C_INT_CAUSE, int_cause & IF_CS_C_IC_MASK);
}
/* clear interrupt */
if_cs_write16(card, IF_CS_C_INT_CAUSE, int_cause & IF_CS_C_IC_MASK);
}
-
- lbs_interrupt(card->priv->dev);
+ spin_lock(&card->priv->driver_lock);
+ lbs_interrupt(card->priv);
+ spin_unlock(&card->priv->driver_lock);
card->int_cause |= MRVDRV_CMD_UPLD_RDY;
card->int_cause |= MRVDRV_CMD_UPLD_RDY;
- lbs_interrupt(card->priv->dev);
+ lbs_interrupt(card->priv);
card->event = event;
card->int_cause |= MRVDRV_CARDEVENT;
card->event = event;
card->int_cause |= MRVDRV_CARDEVENT;
- lbs_interrupt(card->priv->dev);
+ lbs_interrupt(card->priv);
spin_unlock_irqrestore(&card->priv->driver_lock, flags);
spin_unlock_irqrestore(&card->priv->driver_lock, flags);
priv->upld_len);
kfree_skb(skb);
priv->upld_len);
kfree_skb(skb);
- lbs_interrupt(priv->dev);
spin_unlock(&priv->driver_lock);
lbs_deb_usbd(&cardp->udev->dev,
spin_unlock(&priv->driver_lock);
lbs_deb_usbd(&cardp->udev->dev,
cardp->usb_event_cause <<= 3;
cardp->usb_int_cause |= MRVDRV_CARDEVENT;
kfree_skb(skb);
cardp->usb_event_cause <<= 3;
cardp->usb_int_cause |= MRVDRV_CARDEVENT;
kfree_skb(skb);
- lbs_interrupt(priv->dev);
spin_unlock(&priv->driver_lock);
goto rx_exit;
default:
spin_unlock(&priv->driver_lock);
goto rx_exit;
default:
* @param dev A pointer to net_device structure
* @return n/a
*/
* @param dev A pointer to net_device structure
* @return n/a
*/
-void lbs_interrupt(struct net_device *dev)
+void lbs_interrupt(struct lbs_private *priv)
- struct lbs_private *priv = dev->priv;
-
lbs_deb_enter(LBS_DEB_THREAD);
lbs_deb_enter(LBS_DEB_THREAD);
- lbs_deb_thread("lbs_interrupt: intcounter=%d\n",
- priv->intcounter);
+ lbs_deb_thread("lbs_interrupt: intcounter=%d\n", priv->intcounter);
+
+ if (spin_trylock(&priv->driver_lock)) {
+ spin_unlock(&priv->driver_lock);
+ printk(KERN_CRIT "%s called without driver_lock held\n", __func__);
+ WARN_ON(1);
+ }
- if (priv->psstate == PS_STATE_SLEEP) {
+ if (priv->psstate == PS_STATE_SLEEP)
priv->psstate = PS_STATE_AWAKE;
priv->psstate = PS_STATE_AWAKE;
- netif_wake_queue(dev);
- if (priv->mesh_dev)
- netif_wake_queue(priv->mesh_dev);
- }
wake_up_interruptible(&priv->waitq);
wake_up_interruptible(&priv->waitq);