]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iwlwifi: mvm: don't send identical PHY_CTXT_CMD
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 14 Sep 2017 12:45:44 +0000 (15:45 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 6 Oct 2017 11:57:22 +0000 (14:57 +0300)
When we have an AP which supports HT and a single HT
station is connected, we change the min_width from
NL80211_CHAN_WIDTH_20_NOHT to NL80211_CHAN_WIDTH_20. This
of course has no implication on the channel width but still
sends a command to the firmware.
Remember the last width that was sent and refrain from
sending unnecessary commands to the firmware.

Sending a PHY_CTXT_CMD to the firmware has a cost since it
recalculates the presence on the medium and because of that
it closes the transmit queues for a short while.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c

index d7530474c1d3961ea4ac4241408594ba86cbd2f2..d6180463e92f1d9a47f2824711883cc5c7187088 100644 (file)
@@ -3406,10 +3406,24 @@ static void iwl_mvm_change_chanctx(struct ieee80211_hw *hw,
                return;
 
        mutex_lock(&mvm->mutex);
+
+       /* we are only changing the min_width, may be a noop */
+       if (changed == IEEE80211_CHANCTX_CHANGE_MIN_WIDTH) {
+               if (phy_ctxt->width == ctx->min_def.width)
+                       goto out_unlock;
+
+               /* we are just toggling between 20_NOHT and 20 */
+               if (phy_ctxt->width <= NL80211_CHAN_WIDTH_20 &&
+                   ctx->min_def.width <= NL80211_CHAN_WIDTH_20)
+                       goto out_unlock;
+       }
+
        iwl_mvm_bt_coex_vif_change(mvm);
        iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &ctx->min_def,
                                 ctx->rx_chains_static,
                                 ctx->rx_chains_dynamic);
+
+out_unlock:
        mutex_unlock(&mvm->mutex);
 }
 
index e8be5104b9090269587d09e0d5a4ecf5f5d2698c..2867683f1aa0965779eed4ac28987a811a767aeb 100644 (file)
@@ -147,6 +147,8 @@ struct iwl_mvm_phy_ctxt {
        u16 color;
        u32 ref;
 
+       enum nl80211_chan_width width;
+
        /*
         * TODO: This should probably be removed. Currently here only for rate
         * scaling algorithm
index 7ee8e9077baf761f1beef30c28c4801d448a6a71..305cd56bf7464f8788b0fa384746efea2367c01e 100644 (file)
@@ -272,6 +272,7 @@ int iwl_mvm_phy_ctxt_changed(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt,
        }
 
        ctxt->channel = chandef->chan;
+       ctxt->width = chandef->width;
        return iwl_mvm_phy_ctxt_apply(mvm, ctxt, chandef,
                                      chains_static, chains_dynamic,
                                      action, 0);