aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/bt-coex.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/bt-coex.c')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/bt-coex.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/bt-coex.c b/drivers/net/wireless/iwlwifi/mvm/bt-coex.c
index 7d41a0efd37b..57a7503030fc 100644
--- a/drivers/net/wireless/iwlwifi/mvm/bt-coex.c
+++ b/drivers/net/wireless/iwlwifi/mvm/bt-coex.c
@@ -267,7 +267,13 @@ iwl_get_coex_type(struct iwl_mvm *mvm, const struct ieee80211_vif *vif)
267 enum iwl_bt_coex_lut_type ret; 267 enum iwl_bt_coex_lut_type ret;
268 u16 phy_ctx_id; 268 u16 phy_ctx_id;
269 269
270 lockdep_assert_held(&mvm->mutex); 270 /*
271 * Checking that we hold mvm->mutex is a good idea, but the rate
272 * control can't acquire the mutex since it runs in Tx path.
273 * So this is racy in that case, but in the worst case, the AMPDU
274 * size limit will be wrong for a short time which is not a big
275 * issue.
276 */
271 277
272 rcu_read_lock(); 278 rcu_read_lock();
273 279
@@ -843,6 +849,28 @@ void iwl_mvm_bt_rssi_event(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
843 IWL_ERR(mvm, "Failed to update the ctrl_kill_msk\n"); 849 IWL_ERR(mvm, "Failed to update the ctrl_kill_msk\n");
844} 850}
845 851
852#define LINK_QUAL_AGG_TIME_LIMIT_DEF (4000)
853#define LINK_QUAL_AGG_TIME_LIMIT_BT_ACT (1200)
854
855u16 iwl_mvm_bt_coex_agg_time_limit(struct iwl_mvm *mvm,
856 struct ieee80211_sta *sta)
857{
858 struct iwl_mvm_sta *mvmsta = (void *)sta->drv_priv;
859 enum iwl_bt_coex_lut_type lut_type;
860
861 if (le32_to_cpu(mvm->last_bt_notif.bt_activity_grading) <
862 BT_LOW_TRAFFIC)
863 return LINK_QUAL_AGG_TIME_LIMIT_DEF;
864
865 lut_type = iwl_get_coex_type(mvm, mvmsta->vif);
866
867 if (lut_type == BT_COEX_LOOSE_LUT)
868 return LINK_QUAL_AGG_TIME_LIMIT_DEF;
869
870 /* tight coex, high bt traffic, reduce AGG time limit */
871 return LINK_QUAL_AGG_TIME_LIMIT_BT_ACT;
872}
873
846void iwl_mvm_bt_coex_vif_change(struct iwl_mvm *mvm, struct ieee80211_vif *vif) 874void iwl_mvm_bt_coex_vif_change(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
847{ 875{
848 if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_NEWBT_COEX)) 876 if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_NEWBT_COEX))