hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/net/wireless/intel/iwlwifi/mvm/coex.c
....@@ -5,7 +5,7 @@
55 *
66 * GPL LICENSE SUMMARY
77 *
8
- * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved.
8
+ * Copyright(c) 2013 - 2014, 2018 - 2020 Intel Corporation. All rights reserved.
99 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
1010 *
1111 * This program is free software; you can redistribute it and/or modify
....@@ -17,11 +17,6 @@
1717 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1818 * General Public License for more details.
1919 *
20
- * You should have received a copy of the GNU General Public License
21
- * along with this program; if not, write to the Free Software
22
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
23
- * USA
24
- *
2520 * The full GNU General Public License is included in this distribution
2621 * in the file called COPYING.
2722 *
....@@ -31,7 +26,7 @@
3126 *
3227 * BSD LICENSE
3328 *
34
- * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved.
29
+ * Copyright(c) 2013 - 2014, 2018 - 2020 Intel Corporation. All rights reserved.
3530 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
3631 * All rights reserved.
3732 *
....@@ -221,8 +216,7 @@
221216 goto send_cmd;
222217 }
223218
224
- mode = iwlwifi_mod_params.bt_coex_active ? BT_COEX_NW : BT_COEX_DISABLE;
225
- bt_cmd.mode = cpu_to_le32(mode);
219
+ bt_cmd.mode = cpu_to_le32(BT_COEX_NW);
226220
227221 if (IWL_MVM_BT_COEX_SYNC2SCO)
228222 bt_cmd.enabled_modules |=
....@@ -246,7 +240,6 @@
246240 struct iwl_bt_coex_reduced_txp_update_cmd cmd = {};
247241 struct iwl_mvm_sta *mvmsta;
248242 u32 value;
249
- int ret;
250243
251244 mvmsta = iwl_mvm_sta_from_staid_protected(mvm, sta_id);
252245 if (!mvmsta)
....@@ -267,10 +260,8 @@
267260 cmd.reduced_txp = cpu_to_le32(value);
268261 mvmsta->bt_reduced_txpower = enable;
269262
270
- ret = iwl_mvm_send_cmd_pdu(mvm, BT_COEX_UPDATE_REDUCED_TXP, CMD_ASYNC,
271
- sizeof(cmd), &cmd);
272
-
273
- return ret;
263
+ return iwl_mvm_send_cmd_pdu(mvm, BT_COEX_UPDATE_REDUCED_TXP,
264
+ CMD_ASYNC, sizeof(cmd), &cmd);
274265 }
275266
276267 struct iwl_bt_iterator_data {
....@@ -331,7 +322,7 @@
331322 struct ieee80211_chanctx_conf *chanctx_conf;
332323 /* default smps_mode is AUTOMATIC - only used for client modes */
333324 enum ieee80211_smps_mode smps_mode = IEEE80211_SMPS_AUTOMATIC;
334
- u32 bt_activity_grading;
325
+ u32 bt_activity_grading, min_ag_for_static_smps;
335326 int ave_rssi;
336327
337328 lockdep_assert_held(&mvm->mutex);
....@@ -363,8 +354,13 @@
363354 return;
364355 }
365356
357
+ if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_COEX_SCHEMA_2))
358
+ min_ag_for_static_smps = BT_VERY_HIGH_TRAFFIC;
359
+ else
360
+ min_ag_for_static_smps = BT_HIGH_TRAFFIC;
361
+
366362 bt_activity_grading = le32_to_cpu(data->notif->bt_activity_grading);
367
- if (bt_activity_grading >= BT_HIGH_TRAFFIC)
363
+ if (bt_activity_grading >= min_ag_for_static_smps)
368364 smps_mode = IEEE80211_SMPS_STATIC;
369365 else if (bt_activity_grading >= BT_LOW_TRAFFIC)
370366 smps_mode = IEEE80211_SMPS_DYNAMIC;
....@@ -691,6 +687,15 @@
691687 return bt_activity >= BT_LOW_TRAFFIC;
692688 }
693689
690
+u8 iwl_mvm_bt_coex_get_single_ant_msk(struct iwl_mvm *mvm, u8 enabled_ants)
691
+{
692
+ if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_COEX_SCHEMA_2) &&
693
+ (mvm->cfg->non_shared_ant & enabled_ants))
694
+ return mvm->cfg->non_shared_ant;
695
+
696
+ return first_antenna(enabled_ants);
697
+}
698
+
694699 u8 iwl_mvm_bt_coex_tx_prio(struct iwl_mvm *mvm, struct ieee80211_hdr *hdr,
695700 struct ieee80211_tx_info *info, u8 ac)
696701 {