iwlwifi: mvm: Do not consider invalid HW queues in queue mask
authorIlan Peer <ilan.peer@intel.com>
Sun, 18 Jan 2015 03:35:00 +0000 (22:35 -0500)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 22 Jan 2015 15:55:22 +0000 (17:55 +0200)
The iwl_mvm_mac_get_queues_mask() added vif->hw_queue[ac] to the
queue mask although it might be set to IEEE80211_INVAL_HW_QUEUE.
Fix it.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c

index a3e9cd955e7d7cfc9ea18e226a4b9db9756b8c83..8bf78fa8ace00c6d5d4e98aabd193cb977fc1153 100644 (file)
@@ -208,8 +208,10 @@ u32 iwl_mvm_mac_get_queues_mask(struct ieee80211_vif *vif)
        if (vif->type == NL80211_IFTYPE_P2P_DEVICE)
                return BIT(IWL_MVM_OFFCHANNEL_QUEUE);
 
-       for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
-               qmask |= BIT(vif->hw_queue[ac]);
+       for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
+               if (vif->hw_queue[ac] != IEEE80211_INVAL_HW_QUEUE)
+                       qmask |= BIT(vif->hw_queue[ac]);
+       }
 
        if (vif->type == NL80211_IFTYPE_AP)
                qmask |= BIT(vif->cab_queue);