diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 22c0149e5d4a..c735a39ec176 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -3639,6 +3639,44 @@ out_exit: | |||
3639 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 3639 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
3640 | } | 3640 | } |
3641 | 3641 | ||
3642 | static void iwl_mac_flush(struct ieee80211_hw *hw, bool drop) | ||
3643 | { | ||
3644 | struct iwl_priv *priv = hw->priv; | ||
3645 | |||
3646 | mutex_lock(&priv->mutex); | ||
3647 | IWL_DEBUG_MAC80211(priv, "enter\n"); | ||
3648 | |||
3649 | /* do not support "flush" */ | ||
3650 | if (!priv->cfg->ops->lib->txfifo_flush) | ||
3651 | goto done; | ||
3652 | |||
3653 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) { | ||
3654 | IWL_DEBUG_TX(priv, "Aborting flush due to device shutdown\n"); | ||
3655 | goto done; | ||
3656 | } | ||
3657 | if (iwl_is_rfkill(priv)) { | ||
3658 | IWL_DEBUG_TX(priv, "Aborting flush due to RF Kill\n"); | ||
3659 | goto done; | ||
3660 | } | ||
3661 | |||
3662 | /* | ||
3663 | * mac80211 will not push any more frames for transmit | ||
3664 | * until the flush is completed | ||
3665 | */ | ||
3666 | if (drop) { | ||
3667 | IWL_DEBUG_MAC80211(priv, "send flush command\n"); | ||
3668 | if (priv->cfg->ops->lib->txfifo_flush(priv, IWL_DROP_ALL)) { | ||
3669 | IWL_ERR(priv, "flush request fail\n"); | ||
3670 | goto done; | ||
3671 | } | ||
3672 | } | ||
3673 | IWL_DEBUG_MAC80211(priv, "wait transmit/flush all frames\n"); | ||
3674 | iwlagn_wait_tx_queue_empty(priv); | ||
3675 | done: | ||
3676 | mutex_unlock(&priv->mutex); | ||
3677 | IWL_DEBUG_MAC80211(priv, "leave\n"); | ||
3678 | } | ||
3679 | |||
3642 | /***************************************************************************** | 3680 | /***************************************************************************** |
3643 | * | 3681 | * |
3644 | * driver setup and teardown | 3682 | * driver setup and teardown |
@@ -3812,6 +3850,7 @@ static struct ieee80211_ops iwl_hw_ops = { | |||
3812 | .sta_add = iwlagn_mac_sta_add, | 3850 | .sta_add = iwlagn_mac_sta_add, |
3813 | .sta_remove = iwl_mac_sta_remove, | 3851 | .sta_remove = iwl_mac_sta_remove, |
3814 | .channel_switch = iwl_mac_channel_switch, | 3852 | .channel_switch = iwl_mac_channel_switch, |
3853 | .flush = iwl_mac_flush, | ||
3815 | }; | 3854 | }; |
3816 | 3855 | ||
3817 | static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | 3856 | static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |