diff options
| author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-05-18 02:16:45 -0400 |
|---|---|---|
| committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-05-19 09:38:21 -0400 |
| commit | 5c90422439d62b574fd9e021fabaae2dc9a3065e (patch) | |
| tree | 07aa1c5b8deab261bf06f40395853ca63078d912 | |
| parent | 894981ed43fc5e706330469e27972f7c2dd046cb (diff) | |
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>
| -rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mvm.h | 1 | ||||
| -rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c | 3 | ||||
| -rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/utils.c | 33 |
3 files changed, 35 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h index 5d2effb4832a..4a5db07ae028 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h | |||
| @@ -1008,6 +1008,7 @@ int iwl_mvm_update_beacon_filter(struct iwl_mvm *mvm, | |||
| 1008 | void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | 1008 | void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif, |
| 1009 | enum iwl_mvm_smps_type_request req_type, | 1009 | enum iwl_mvm_smps_type_request req_type, |
| 1010 | enum ieee80211_smps_mode smps_request); | 1010 | enum ieee80211_smps_mode smps_request); |
| 1011 | bool iwl_mvm_rx_diversity_allowed(struct iwl_mvm *mvm); | ||
| 1011 | 1012 | ||
| 1012 | /* Low latency */ | 1013 | /* Low latency */ |
| 1013 | int iwl_mvm_update_low_latency(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | 1014 | int iwl_mvm_update_low_latency(struct iwl_mvm *mvm, struct ieee80211_vif *vif, |
diff --git a/drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c b/drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c index acb79af6fa89..539f3a942d43 100644 --- a/drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c +++ b/drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c | |||
| @@ -163,8 +163,7 @@ static void iwl_mvm_phy_ctxt_cmd_data(struct iwl_mvm *mvm, | |||
| 163 | * between the two antennas is sufficiently different to impact | 163 | * between the two antennas is sufficiently different to impact |
| 164 | * performance. | 164 | * performance. |
| 165 | */ | 165 | */ |
| 166 | if (active_cnt == 1 && num_of_ant(mvm->fw->valid_rx_ant) > 1 && | 166 | if (active_cnt == 1 && iwl_mvm_rx_diversity_allowed(mvm)) { |
| 167 | !mvm->cfg->rx_with_siso_diversity) { | ||
| 168 | idle_cnt = 2; | 167 | idle_cnt = 2; |
| 169 | active_cnt = 2; | 168 | active_cnt = 2; |
| 170 | } | 169 | } |
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, | |||
| 650 | ieee80211_request_smps(vif, smps_mode); | 650 | ieee80211_request_smps(vif, smps_mode); |
| 651 | } | 651 | } |
| 652 | 652 | ||
| 653 | static void iwl_mvm_diversity_iter(void *_data, u8 *mac, | ||
| 654 | struct ieee80211_vif *vif) | ||
| 655 | { | ||
| 656 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); | ||
| 657 | bool *result = _data; | ||
| 658 | int i; | ||
| 659 | |||
| 660 | for (i = 0; i < NUM_IWL_MVM_SMPS_REQ; i++) { | ||
| 661 | if (mvmvif->smps_requests[i] == IEEE80211_SMPS_STATIC || | ||
| 662 | mvmvif->smps_requests[i] == IEEE80211_SMPS_DYNAMIC) | ||
| 663 | *result = false; | ||
| 664 | } | ||
| 665 | } | ||
| 666 | |||
| 667 | bool iwl_mvm_rx_diversity_allowed(struct iwl_mvm *mvm) | ||
| 668 | { | ||
| 669 | bool result = true; | ||
| 670 | |||
| 671 | lockdep_assert_held(&mvm->mutex); | ||
| 672 | |||
| 673 | if (num_of_ant(mvm->fw->valid_rx_ant) == 1) | ||
| 674 | return false; | ||
| 675 | |||
| 676 | if (!mvm->cfg->rx_with_siso_diversity) | ||
| 677 | return false; | ||
| 678 | |||
| 679 | ieee80211_iterate_active_interfaces_atomic( | ||
| 680 | mvm->hw, IEEE80211_IFACE_ITER_NORMAL, | ||
| 681 | iwl_mvm_diversity_iter, &result); | ||
| 682 | |||
| 683 | return result; | ||
| 684 | } | ||
| 685 | |||
| 653 | int iwl_mvm_update_low_latency(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | 686 | int iwl_mvm_update_low_latency(struct iwl_mvm *mvm, struct ieee80211_vif *vif, |
| 654 | bool value) | 687 | bool value) |
| 655 | { | 688 | { |
