diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2012-12-20 08:31:51 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-01-07 15:16:53 -0500 |
commit | 70277f47b58b174a6b0b891dcd06ae5125afb73b (patch) | |
tree | 7e03b3f60879982502e944366ebcb5db005c1f4b /drivers/net | |
parent | 93476b1e685036e8513be8df34ca442096af6b4c (diff) |
iwlegacy: add flush callback
Dump implementation of flush, which just wait until all TX queues
become empty.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/iwlegacy/3945-mac.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/4965-mac.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/common.c | 36 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/common.h | 1 |
4 files changed, 39 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c index d604b4036a76..962400a20161 100644 --- a/drivers/net/wireless/iwlegacy/3945-mac.c +++ b/drivers/net/wireless/iwlegacy/3945-mac.c | |||
@@ -3474,6 +3474,7 @@ struct ieee80211_ops il3945_mac_ops = { | |||
3474 | .sta_add = il3945_mac_sta_add, | 3474 | .sta_add = il3945_mac_sta_add, |
3475 | .sta_remove = il_mac_sta_remove, | 3475 | .sta_remove = il_mac_sta_remove, |
3476 | .tx_last_beacon = il_mac_tx_last_beacon, | 3476 | .tx_last_beacon = il_mac_tx_last_beacon, |
3477 | .flush = il_mac_flush, | ||
3477 | }; | 3478 | }; |
3478 | 3479 | ||
3479 | static int | 3480 | static int |
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c index 6a86ed45835d..c40020c8b273 100644 --- a/drivers/net/wireless/iwlegacy/4965-mac.c +++ b/drivers/net/wireless/iwlegacy/4965-mac.c | |||
@@ -6308,6 +6308,7 @@ const struct ieee80211_ops il4965_mac_ops = { | |||
6308 | .sta_remove = il_mac_sta_remove, | 6308 | .sta_remove = il_mac_sta_remove, |
6309 | .channel_switch = il4965_mac_channel_switch, | 6309 | .channel_switch = il4965_mac_channel_switch, |
6310 | .tx_last_beacon = il_mac_tx_last_beacon, | 6310 | .tx_last_beacon = il_mac_tx_last_beacon, |
6311 | .flush = il_mac_flush, | ||
6311 | }; | 6312 | }; |
6312 | 6313 | ||
6313 | static int | 6314 | static int |
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c index 7e16d10a7f14..56b80219d695 100644 --- a/drivers/net/wireless/iwlegacy/common.c +++ b/drivers/net/wireless/iwlegacy/common.c | |||
@@ -4707,6 +4707,42 @@ out: | |||
4707 | } | 4707 | } |
4708 | EXPORT_SYMBOL(il_mac_change_interface); | 4708 | EXPORT_SYMBOL(il_mac_change_interface); |
4709 | 4709 | ||
4710 | void | ||
4711 | il_mac_flush(struct ieee80211_hw *hw, bool drop) | ||
4712 | { | ||
4713 | struct il_priv *il = hw->priv; | ||
4714 | unsigned long timeout = jiffies + msecs_to_jiffies(500); | ||
4715 | int i; | ||
4716 | |||
4717 | mutex_lock(&il->mutex); | ||
4718 | D_MAC80211("enter\n"); | ||
4719 | |||
4720 | if (il->txq == NULL) | ||
4721 | goto out; | ||
4722 | |||
4723 | for (i = 0; i < il->hw_params.max_txq_num; i++) { | ||
4724 | struct il_queue *q; | ||
4725 | |||
4726 | if (i == il->cmd_queue) | ||
4727 | continue; | ||
4728 | |||
4729 | q = &il->txq[i].q; | ||
4730 | if (q->read_ptr == q->write_ptr) | ||
4731 | continue; | ||
4732 | |||
4733 | if (time_after(jiffies, timeout)) { | ||
4734 | IL_ERR("Failed to flush queue %d\n", q->id); | ||
4735 | break; | ||
4736 | } | ||
4737 | |||
4738 | msleep(20); | ||
4739 | } | ||
4740 | out: | ||
4741 | D_MAC80211("leave\n"); | ||
4742 | mutex_unlock(&il->mutex); | ||
4743 | } | ||
4744 | EXPORT_SYMBOL(il_mac_flush); | ||
4745 | |||
4710 | /* | 4746 | /* |
4711 | * On every watchdog tick we check (latest) time stamp. If it does not | 4747 | * On every watchdog tick we check (latest) time stamp. If it does not |
4712 | * change during timeout period and queue is not empty we reset firmware. | 4748 | * change during timeout period and queue is not empty we reset firmware. |
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h index a9a569f432fb..37fe553b25e0 100644 --- a/drivers/net/wireless/iwlegacy/common.h +++ b/drivers/net/wireless/iwlegacy/common.h | |||
@@ -1723,6 +1723,7 @@ void il_mac_remove_interface(struct ieee80211_hw *hw, | |||
1723 | struct ieee80211_vif *vif); | 1723 | struct ieee80211_vif *vif); |
1724 | int il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 1724 | int il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
1725 | enum nl80211_iftype newtype, bool newp2p); | 1725 | enum nl80211_iftype newtype, bool newp2p); |
1726 | void il_mac_flush(struct ieee80211_hw *hw, bool drop); | ||
1726 | int il_alloc_txq_mem(struct il_priv *il); | 1727 | int il_alloc_txq_mem(struct il_priv *il); |
1727 | void il_free_txq_mem(struct il_priv *il); | 1728 | void il_free_txq_mem(struct il_priv *il); |
1728 | 1729 | ||