summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
diff options
context:
space:
mode:
authorChaya Rachel Ivgi <chaya.rachel.ivgi@intel.com>2015-12-03 15:51:46 +0200
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2015-12-20 23:27:40 +0200
commit0e39eb0386841fc71a86ad3feb5ddff553d2888e (patch)
tree7f3bb7a79dd21502645a642fa3a7cddd431d74a0 /drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
parentc3e230b167a9d618c4eb41c0a5ba1851d33d6dbd (diff)
iwlwifi: mvm: Add a station in monitor mode
Currently when creating a new vif in monitor mode the driver doesn't allocate a specific station. This causes that in the situation that tx traffic is injected, the tx queues are not scheduled, with the result of a TFD queue hang. Fix that by allocating a station and ensuring its tx queues are scheduled. This fixes https://bugzilla.kernel.org/show_bug.cgi?id=104591 Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
index d00a6e9982f2..5e3a7582885b 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
@@ -855,11 +855,17 @@ static int iwl_mvm_mac_ctxt_cmd_listener(struct iwl_mvm *mvm,
u32 action)
{
struct iwl_mac_ctx_cmd cmd = {};
+ u32 tfd_queue_msk = 0;
+ int ret, i;
WARN_ON(vif->type != NL80211_IFTYPE_MONITOR);
iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, NULL, action);
+ for (i = 0; i < IEEE80211_NUM_ACS; i++)
+ if (vif->hw_queue[i] != IEEE80211_INVAL_HW_QUEUE)
+ tfd_queue_msk |= BIT(vif->hw_queue[i]);
+
cmd.filter_flags = cpu_to_le32(MAC_FILTER_IN_PROMISC |
MAC_FILTER_IN_CONTROL_AND_MGMT |
MAC_FILTER_IN_BEACON |
@@ -867,6 +873,12 @@ static int iwl_mvm_mac_ctxt_cmd_listener(struct iwl_mvm *mvm,
MAC_FILTER_IN_CRC32);
ieee80211_hw_set(mvm->hw, RX_INCLUDES_FCS);
+ /* Allocate sniffer station */
+ ret = iwl_mvm_allocate_int_sta(mvm, &mvm->snif_sta, tfd_queue_msk,
+ vif->type);
+ if (ret)
+ return ret;
+
return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd);
}
@@ -1289,8 +1301,10 @@ int iwl_mvm_mac_ctxt_remove(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
mvmvif->uploaded = false;
- if (vif->type == NL80211_IFTYPE_MONITOR)
+ if (vif->type == NL80211_IFTYPE_MONITOR) {
__clear_bit(IEEE80211_HW_RX_INCLUDES_FCS, mvm->hw->flags);
+ iwl_mvm_dealloc_snif_sta(mvm);
+ }
return 0;
}