iwlwifi: mvm: rs: fix TPC action decision algorithm
authorGregory Greenman <gregory.greenman@intel.com>
Tue, 26 Jan 2016 22:10:15 +0000 (00:10 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Mon, 1 Feb 2016 14:40:27 +0000 (16:40 +0200)
Decreasing Tx power is allowed only when success ratio is
above the threshold defined in the algorithm. Add this condition.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/rs.c

index 7bb6fd0e4391a92f0200aad6e62362fc20c48802..986e12ab9dc2242a06deddfa0410807ca10b9f85 100644 (file)
@@ -2040,7 +2040,8 @@ static enum tpc_action rs_get_tpc_action(struct iwl_mvm *mvm,
        }
 
        /* try decreasing first if applicable */
-       if (weak != TPC_INVALID) {
+       if (sr >= RS_PERCENT(IWL_MVM_RS_TPC_SR_NO_INCREASE) &&
+           weak != TPC_INVALID) {
                if (weak_tpt == IWL_INVALID_VALUE &&
                    (strong_tpt == IWL_INVALID_VALUE ||
                     current_tpt >= strong_tpt)) {