diff options
author | Ryan Mallon <ryan@bluewatersys.com> | 2007-09-06 21:32:42 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:52:27 -0400 |
commit | 28de0b36be2a4e7fb0ba7c9a77d61aeb229b27c0 (patch) | |
tree | f1aaa2fa6af4c1d58bb3d17483e3684e0390b889 | |
parent | 6f05cbe5882e8b0fc5a984313cbb14ce7741411b (diff) |
[LIBERTAS]: fix interrupts in CF driver
The following patch fixes the tx transmit timeout problem, which is
caused by the interrupts being incorrectly check and masked. The patch
moves the interrupt masking code so that interrupts are enabled only
when the driver is registered and only disabled when the driver is
unregistered.
Signed-off-by: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/wireless/libertas/if_cs.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c index 364da4cac214..e74ec5c309be 100644 --- a/drivers/net/wireless/libertas/if_cs.c +++ b/drivers/net/wireless/libertas/if_cs.c | |||
@@ -248,22 +248,26 @@ static irqreturn_t if_cs_interrupt(int irq, void *data) | |||
248 | lbs_deb_enter(LBS_DEB_CS); | 248 | lbs_deb_enter(LBS_DEB_CS); |
249 | 249 | ||
250 | int_cause = if_cs_read16(card, IF_CS_C_INT_CAUSE); | 250 | int_cause = if_cs_read16(card, IF_CS_C_INT_CAUSE); |
251 | switch (int_cause) { | 251 | if(int_cause == 0x0) { |
252 | case 0x0000: | 252 | /* Not for us */ |
253 | /* not for us */ | ||
254 | return IRQ_NONE; | 253 | return IRQ_NONE; |
255 | case 0xffff: | 254 | |
256 | /* if one reads junk, then probably the card was removed */ | 255 | } else if(int_cause == 0xffff) { |
256 | /* Read in junk, the card has probably been removed */ | ||
257 | card->priv->adapter->surpriseremoved = 1; | 257 | card->priv->adapter->surpriseremoved = 1; |
258 | break; | 258 | |
259 | case IF_CS_H_IC_TX_OVER: | 259 | } else { |
260 | if (card->priv->adapter->connect_status == LIBERTAS_CONNECTED) | 260 | if(int_cause & IF_CS_H_IC_TX_OVER) { |
261 | netif_wake_queue(card->priv->dev); | 261 | card->priv->dnld_sent = DNLD_RES_RECEIVED; |
262 | /* fallthrought */ | 262 | if (!card->priv->adapter->cur_cmd) |
263 | default: | 263 | wake_up_interruptible(&card->priv->waitq); |
264 | |||
265 | if (card->priv->adapter->connect_status == LIBERTAS_CONNECTED) | ||
266 | netif_wake_queue(card->priv->dev); | ||
267 | } | ||
268 | |||
264 | /* clear interrupt */ | 269 | /* clear interrupt */ |
265 | if_cs_write16(card, IF_CS_C_INT_CAUSE, int_cause & IF_CS_C_IC_MASK); | 270 | if_cs_write16(card, IF_CS_C_INT_CAUSE, int_cause & IF_CS_C_IC_MASK); |
266 | if_cs_disable_ints(card); | ||
267 | } | 271 | } |
268 | 272 | ||
269 | libertas_interrupt(card->priv->dev); | 273 | libertas_interrupt(card->priv->dev); |
@@ -652,7 +656,6 @@ static int if_cs_get_int_status(wlan_private *priv, u8 *ireg) | |||
652 | if_cs_write16(card, IF_CS_C_INT_CAUSE, int_cause); | 656 | if_cs_write16(card, IF_CS_C_INT_CAUSE, int_cause); |
653 | 657 | ||
654 | *ireg = if_cs_read16(card, IF_CS_C_STATUS) & IF_CS_C_S_MASK; | 658 | *ireg = if_cs_read16(card, IF_CS_C_STATUS) & IF_CS_C_S_MASK; |
655 | if_cs_enable_ints(card); | ||
656 | 659 | ||
657 | if (!*ireg) | 660 | if (!*ireg) |
658 | goto sbi_get_int_status_exit; | 661 | goto sbi_get_int_status_exit; |
@@ -841,7 +844,6 @@ static int if_cs_probe(struct pcmcia_device *p_dev) | |||
841 | p_dev->irq.AssignedIRQ, p_dev->io.BasePort1, | 844 | p_dev->irq.AssignedIRQ, p_dev->io.BasePort1, |
842 | p_dev->io.BasePort1 + p_dev->io.NumPorts1 - 1); | 845 | p_dev->io.BasePort1 + p_dev->io.NumPorts1 - 1); |
843 | 846 | ||
844 | if_cs_enable_ints(card); | ||
845 | 847 | ||
846 | /* Load the firmware early, before calling into libertas.ko */ | 848 | /* Load the firmware early, before calling into libertas.ko */ |
847 | ret = if_cs_prog_helper(card); | 849 | ret = if_cs_prog_helper(card); |
@@ -874,6 +876,8 @@ static int if_cs_probe(struct pcmcia_device *p_dev) | |||
874 | goto out3; | 876 | goto out3; |
875 | } | 877 | } |
876 | 878 | ||
879 | if_cs_enable_ints(card); | ||
880 | |||
877 | /* And finally bring the card up */ | 881 | /* And finally bring the card up */ |
878 | if (libertas_start_card(priv) != 0) { | 882 | if (libertas_start_card(priv) != 0) { |
879 | lbs_pr_err("could not activate card\n"); | 883 | lbs_pr_err("could not activate card\n"); |
@@ -909,6 +913,7 @@ static void if_cs_detach(struct pcmcia_device *p_dev) | |||
909 | 913 | ||
910 | libertas_stop_card(card->priv); | 914 | libertas_stop_card(card->priv); |
911 | libertas_remove_card(card->priv); | 915 | libertas_remove_card(card->priv); |
916 | if_cs_disable_ints(card); | ||
912 | if_cs_release(p_dev); | 917 | if_cs_release(p_dev); |
913 | kfree(card); | 918 | kfree(card); |
914 | 919 | ||