diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-05-18 09:16:45 +0300 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-05-19 16:38:21 +0300 |
commit | 5c90422439d62b574fd9e021fabaae2dc9a3065e (patch) | |
tree | 07aa1c5b8deab261bf06f40395853ca63078d912 /drivers/net/wireless/iwlwifi/mvm/utils.c | |
parent | 894981ed43fc5e706330469e27972f7c2dd046cb (diff) | |
download | linux-5c90422439d62b574fd9e021fabaae2dc9a3065e.tar.gz linux-5c90422439d62b574fd9e021fabaae2dc9a3065e.tar.bz2 linux-5c90422439d62b574fd9e021fabaae2dc9a3065e.zip |
iwlwifi: mvm: don't allow diversity if BT Coex / TT forbid it
We should not allow diversity when BT Coex needs the second
antenna. Thermal Throttling can also request to stop using
the second antenna. Honour those requests.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/utils.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/utils.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/utils.c b/drivers/net/wireless/iwlwifi/mvm/utils.c index b269f1e30e87..42cea32ac546 100644 --- a/drivers/net/wireless/iwlwifi/mvm/utils.c +++ b/drivers/net/wireless/iwlwifi/mvm/utils.c @@ -650,6 +650,39 @@ void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ieee80211_request_smps(vif, smps_mode); } +static void iwl_mvm_diversity_iter(void *_data, u8 *mac, + struct ieee80211_vif *vif) +{ + struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); + bool *result = _data; + int i; + + for (i = 0; i < NUM_IWL_MVM_SMPS_REQ; i++) { + if (mvmvif->smps_requests[i] == IEEE80211_SMPS_STATIC || + mvmvif->smps_requests[i] == IEEE80211_SMPS_DYNAMIC) + *result = false; + } +} + +bool iwl_mvm_rx_diversity_allowed(struct iwl_mvm *mvm) +{ + bool result = true; + + lockdep_assert_held(&mvm->mutex); + + if (num_of_ant(mvm->fw->valid_rx_ant) == 1) + return false; + + if (!mvm->cfg->rx_with_siso_diversity) + return false; + + ieee80211_iterate_active_interfaces_atomic( + mvm->hw, IEEE80211_IFACE_ITER_NORMAL, + iwl_mvm_diversity_iter, &result); + + return result; +} + int iwl_mvm_update_low_latency(struct iwl_mvm *mvm, struct ieee80211_vif *vif, bool value) { |