Commit 1e9551de authored by Eyal Shapira's avatar Eyal Shapira Committed by Emmanuel Grumbach

iwlwifi: mvm: rs: don't allow TPC when power save is disabled

Currently we were checking only if the driver power_scheme is set
to CAM. TPC shouldn't be enabled also when disabling powersave on the
interface (e.g. iw wlan0 set power_save off)
which may occur even if power_scheme wasn't set to CAM.
Signed-off-by: default avatarEyal Shapira <eyalx.shapira@intel.com>
Reviewed-by: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 80763515
...@@ -1750,16 +1750,21 @@ static void rs_get_adjacent_txp(struct iwl_mvm *mvm, int index, ...@@ -1750,16 +1750,21 @@ static void rs_get_adjacent_txp(struct iwl_mvm *mvm, int index,
*stronger = TPC_INVALID; *stronger = TPC_INVALID;
} }
static bool rs_tpc_allowed(struct iwl_mvm *mvm, struct rs_rate *rate, static bool rs_tpc_allowed(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
enum ieee80211_band band) struct rs_rate *rate, enum ieee80211_band band)
{ {
int index = rate->index; int index = rate->index;
bool cam = (iwlmvm_mod_params.power_scheme == IWL_POWER_SCHEME_CAM);
bool sta_ps_disabled = (vif->type == NL80211_IFTYPE_STATION &&
!vif->bss_conf.ps);
IWL_DEBUG_RATE(mvm, "cam: %d sta_ps_disabled %d\n",
cam, sta_ps_disabled);
/* /*
* allow tpc only if power management is enabled, or bt coex * allow tpc only if power management is enabled, or bt coex
* activity grade allows it and we are on 2.4Ghz. * activity grade allows it and we are on 2.4Ghz.
*/ */
if (iwlmvm_mod_params.power_scheme == IWL_POWER_SCHEME_CAM && if ((cam || sta_ps_disabled) &&
!iwl_mvm_bt_coex_is_tpc_allowed(mvm, band)) !iwl_mvm_bt_coex_is_tpc_allowed(mvm, band))
return false; return false;
...@@ -1876,7 +1881,7 @@ static bool rs_tpc_perform(struct iwl_mvm *mvm, ...@@ -1876,7 +1881,7 @@ static bool rs_tpc_perform(struct iwl_mvm *mvm,
band = chanctx_conf->def.chan->band; band = chanctx_conf->def.chan->band;
rcu_read_unlock(); rcu_read_unlock();
if (!rs_tpc_allowed(mvm, rate, band)) { if (!rs_tpc_allowed(mvm, vif, rate, band)) {
IWL_DEBUG_RATE(mvm, IWL_DEBUG_RATE(mvm,
"tpc is not allowed. remove txp restrictions"); "tpc is not allowed. remove txp restrictions");
lq_sta->lq.reduced_tpc = TPC_NO_REDUCTION; lq_sta->lq.reduced_tpc = TPC_NO_REDUCTION;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment