diff options
author | Sujith Manoharan <Sujith.Manoharan@atheros.com> | 2011-04-13 01:56:39 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-04-13 15:24:30 -0400 |
commit | 859c3ca1e4608615788dc6cbc199210fe4b5efa2 (patch) | |
tree | 523b8939326f1c8605b037201142f73816cdee37 /drivers/net/wireless/ath/ath9k/htc_drv_main.c | |
parent | c4d04186c7023d54445b695da226b3e98e0a55f9 (diff) |
ath9k_htc: Add a timer to cleanup WMI events
Occasionally, a WMI event would arrive ahead of the TX
URB completion handler. Discarding these events would exhaust
the available TX slots, so handle them by running a timer
cleaning up such events. Also, timeout packets for which TX
completion events have not arrived.
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/htc_drv_main.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_main.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index ae85cc4373f..4de38643cb5 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c | |||
@@ -194,6 +194,7 @@ void ath9k_htc_reset(struct ath9k_htc_priv *priv) | |||
194 | ath9k_htc_stop_ani(priv); | 194 | ath9k_htc_stop_ani(priv); |
195 | ieee80211_stop_queues(priv->hw); | 195 | ieee80211_stop_queues(priv->hw); |
196 | 196 | ||
197 | del_timer_sync(&priv->tx.cleanup_timer); | ||
197 | ath9k_htc_tx_drain(priv); | 198 | ath9k_htc_tx_drain(priv); |
198 | 199 | ||
199 | WMI_CMD(WMI_DISABLE_INTR_CMDID); | 200 | WMI_CMD(WMI_DISABLE_INTR_CMDID); |
@@ -225,6 +226,9 @@ void ath9k_htc_reset(struct ath9k_htc_priv *priv) | |||
225 | ath9k_htc_vif_reconfig(priv); | 226 | ath9k_htc_vif_reconfig(priv); |
226 | ieee80211_wake_queues(priv->hw); | 227 | ieee80211_wake_queues(priv->hw); |
227 | 228 | ||
229 | mod_timer(&priv->tx.cleanup_timer, | ||
230 | jiffies + msecs_to_jiffies(ATH9K_HTC_TX_CLEANUP_INTERVAL)); | ||
231 | |||
228 | ath9k_htc_ps_restore(priv); | 232 | ath9k_htc_ps_restore(priv); |
229 | mutex_unlock(&priv->mutex); | 233 | mutex_unlock(&priv->mutex); |
230 | } | 234 | } |
@@ -251,6 +255,7 @@ static int ath9k_htc_set_channel(struct ath9k_htc_priv *priv, | |||
251 | 255 | ||
252 | ath9k_htc_ps_wakeup(priv); | 256 | ath9k_htc_ps_wakeup(priv); |
253 | 257 | ||
258 | del_timer_sync(&priv->tx.cleanup_timer); | ||
254 | ath9k_htc_tx_drain(priv); | 259 | ath9k_htc_tx_drain(priv); |
255 | 260 | ||
256 | WMI_CMD(WMI_DISABLE_INTR_CMDID); | 261 | WMI_CMD(WMI_DISABLE_INTR_CMDID); |
@@ -301,6 +306,9 @@ static int ath9k_htc_set_channel(struct ath9k_htc_priv *priv, | |||
301 | !(hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)) | 306 | !(hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)) |
302 | ath9k_htc_vif_reconfig(priv); | 307 | ath9k_htc_vif_reconfig(priv); |
303 | 308 | ||
309 | mod_timer(&priv->tx.cleanup_timer, | ||
310 | jiffies + msecs_to_jiffies(ATH9K_HTC_TX_CLEANUP_INTERVAL)); | ||
311 | |||
304 | err: | 312 | err: |
305 | ath9k_htc_ps_restore(priv); | 313 | ath9k_htc_ps_restore(priv); |
306 | return ret; | 314 | return ret; |
@@ -937,6 +945,9 @@ static int ath9k_htc_start(struct ieee80211_hw *hw) | |||
937 | 945 | ||
938 | ieee80211_wake_queues(hw); | 946 | ieee80211_wake_queues(hw); |
939 | 947 | ||
948 | mod_timer(&priv->tx.cleanup_timer, | ||
949 | jiffies + msecs_to_jiffies(ATH9K_HTC_TX_CLEANUP_INTERVAL)); | ||
950 | |||
940 | if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE) { | 951 | if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE) { |
941 | ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT, | 952 | ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT, |
942 | AR_STOMP_LOW_WLAN_WGHT); | 953 | AR_STOMP_LOW_WLAN_WGHT); |
@@ -972,6 +983,7 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw) | |||
972 | 983 | ||
973 | tasklet_kill(&priv->rx_tasklet); | 984 | tasklet_kill(&priv->rx_tasklet); |
974 | 985 | ||
986 | del_timer_sync(&priv->tx.cleanup_timer); | ||
975 | ath9k_htc_tx_drain(priv); | 987 | ath9k_htc_tx_drain(priv); |
976 | ath9k_wmi_event_drain(priv); | 988 | ath9k_wmi_event_drain(priv); |
977 | 989 | ||