diff options
author | Eyal Shapira <eyal@wizery.com> | 2014-04-21 14:33:17 -0400 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-05-06 13:39:58 -0400 |
commit | 1e9551debacdaa044eeb514f4366beac6e18f6d9 (patch) | |
tree | c8bc546d6627c80336480c415aca8d7a79757709 /drivers/net/wireless/iwlwifi | |
parent | 80763515c371202916ecdb4118dbed51f801aeb5 (diff) |
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: Eyal Shapira <eyalx.shapira@intel.com>
Reviewed-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/rs.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/rs.c b/drivers/net/wireless/iwlwifi/mvm/rs.c index a7ad532dfd9a..32ac66b5c4a3 100644 --- a/drivers/net/wireless/iwlwifi/mvm/rs.c +++ b/drivers/net/wireless/iwlwifi/mvm/rs.c | |||
@@ -1750,16 +1750,21 @@ static void rs_get_adjacent_txp(struct iwl_mvm *mvm, int index, | |||
1750 | *stronger = TPC_INVALID; | 1750 | *stronger = TPC_INVALID; |
1751 | } | 1751 | } |
1752 | 1752 | ||
1753 | static bool rs_tpc_allowed(struct iwl_mvm *mvm, struct rs_rate *rate, | 1753 | static bool rs_tpc_allowed(struct iwl_mvm *mvm, struct ieee80211_vif *vif, |
1754 | enum ieee80211_band band) | 1754 | struct rs_rate *rate, enum ieee80211_band band) |
1755 | { | 1755 | { |
1756 | int index = rate->index; | 1756 | int index = rate->index; |
1757 | bool cam = (iwlmvm_mod_params.power_scheme == IWL_POWER_SCHEME_CAM); | ||
1758 | bool sta_ps_disabled = (vif->type == NL80211_IFTYPE_STATION && | ||
1759 | !vif->bss_conf.ps); | ||
1757 | 1760 | ||
1761 | IWL_DEBUG_RATE(mvm, "cam: %d sta_ps_disabled %d\n", | ||
1762 | cam, sta_ps_disabled); | ||
1758 | /* | 1763 | /* |
1759 | * allow tpc only if power management is enabled, or bt coex | 1764 | * allow tpc only if power management is enabled, or bt coex |
1760 | * activity grade allows it and we are on 2.4Ghz. | 1765 | * activity grade allows it and we are on 2.4Ghz. |
1761 | */ | 1766 | */ |
1762 | if (iwlmvm_mod_params.power_scheme == IWL_POWER_SCHEME_CAM && | 1767 | if ((cam || sta_ps_disabled) && |
1763 | !iwl_mvm_bt_coex_is_tpc_allowed(mvm, band)) | 1768 | !iwl_mvm_bt_coex_is_tpc_allowed(mvm, band)) |
1764 | return false; | 1769 | return false; |
1765 | 1770 | ||
@@ -1876,7 +1881,7 @@ static bool rs_tpc_perform(struct iwl_mvm *mvm, | |||
1876 | band = chanctx_conf->def.chan->band; | 1881 | band = chanctx_conf->def.chan->band; |
1877 | rcu_read_unlock(); | 1882 | rcu_read_unlock(); |
1878 | 1883 | ||
1879 | if (!rs_tpc_allowed(mvm, rate, band)) { | 1884 | if (!rs_tpc_allowed(mvm, vif, rate, band)) { |
1880 | IWL_DEBUG_RATE(mvm, | 1885 | IWL_DEBUG_RATE(mvm, |
1881 | "tpc is not allowed. remove txp restrictions"); | 1886 | "tpc is not allowed. remove txp restrictions"); |
1882 | lq_sta->lq.reduced_tpc = TPC_NO_REDUCTION; | 1887 | lq_sta->lq.reduced_tpc = TPC_NO_REDUCTION; |