| .. | .. |
|---|
| 5 | 5 | * |
|---|
| 6 | 6 | * GPL LICENSE SUMMARY |
|---|
| 7 | 7 | * |
|---|
| 8 | | - * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. |
|---|
| 8 | + * Copyright(c) 2013 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. |
|---|
| 9 | 9 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
|---|
| 10 | 10 | * |
|---|
| 11 | 11 | * This program is free software; you can redistribute it and/or modify |
|---|
| .. | .. |
|---|
| 17 | 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 18 | 18 | * General Public License for more details. |
|---|
| 19 | 19 | * |
|---|
| 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 | | - * |
|---|
| 25 | 20 | * The full GNU General Public License is included in this distribution |
|---|
| 26 | 21 | * in the file called COPYING. |
|---|
| 27 | 22 | * |
|---|
| .. | .. |
|---|
| 31 | 26 | * |
|---|
| 32 | 27 | * BSD LICENSE |
|---|
| 33 | 28 | * |
|---|
| 34 | | - * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. |
|---|
| 29 | + * Copyright(c) 2013 - 2014, 2018 - 2020 Intel Corporation. All rights reserved. |
|---|
| 35 | 30 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
|---|
| 36 | 31 | * All rights reserved. |
|---|
| 37 | 32 | * |
|---|
| .. | .. |
|---|
| 221 | 216 | goto send_cmd; |
|---|
| 222 | 217 | } |
|---|
| 223 | 218 | |
|---|
| 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); |
|---|
| 226 | 220 | |
|---|
| 227 | 221 | if (IWL_MVM_BT_COEX_SYNC2SCO) |
|---|
| 228 | 222 | bt_cmd.enabled_modules |= |
|---|
| .. | .. |
|---|
| 246 | 240 | struct iwl_bt_coex_reduced_txp_update_cmd cmd = {}; |
|---|
| 247 | 241 | struct iwl_mvm_sta *mvmsta; |
|---|
| 248 | 242 | u32 value; |
|---|
| 249 | | - int ret; |
|---|
| 250 | 243 | |
|---|
| 251 | 244 | mvmsta = iwl_mvm_sta_from_staid_protected(mvm, sta_id); |
|---|
| 252 | 245 | if (!mvmsta) |
|---|
| .. | .. |
|---|
| 267 | 260 | cmd.reduced_txp = cpu_to_le32(value); |
|---|
| 268 | 261 | mvmsta->bt_reduced_txpower = enable; |
|---|
| 269 | 262 | |
|---|
| 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); |
|---|
| 274 | 265 | } |
|---|
| 275 | 266 | |
|---|
| 276 | 267 | struct iwl_bt_iterator_data { |
|---|
| .. | .. |
|---|
| 331 | 322 | struct ieee80211_chanctx_conf *chanctx_conf; |
|---|
| 332 | 323 | /* default smps_mode is AUTOMATIC - only used for client modes */ |
|---|
| 333 | 324 | enum ieee80211_smps_mode smps_mode = IEEE80211_SMPS_AUTOMATIC; |
|---|
| 334 | | - u32 bt_activity_grading; |
|---|
| 325 | + u32 bt_activity_grading, min_ag_for_static_smps; |
|---|
| 335 | 326 | int ave_rssi; |
|---|
| 336 | 327 | |
|---|
| 337 | 328 | lockdep_assert_held(&mvm->mutex); |
|---|
| .. | .. |
|---|
| 363 | 354 | return; |
|---|
| 364 | 355 | } |
|---|
| 365 | 356 | |
|---|
| 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 | + |
|---|
| 366 | 362 | 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) |
|---|
| 368 | 364 | smps_mode = IEEE80211_SMPS_STATIC; |
|---|
| 369 | 365 | else if (bt_activity_grading >= BT_LOW_TRAFFIC) |
|---|
| 370 | 366 | smps_mode = IEEE80211_SMPS_DYNAMIC; |
|---|
| .. | .. |
|---|
| 691 | 687 | return bt_activity >= BT_LOW_TRAFFIC; |
|---|
| 692 | 688 | } |
|---|
| 693 | 689 | |
|---|
| 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 | + |
|---|
| 694 | 699 | u8 iwl_mvm_bt_coex_tx_prio(struct iwl_mvm *mvm, struct ieee80211_hdr *hdr, |
|---|
| 695 | 700 | struct ieee80211_tx_info *info, u8 ac) |
|---|
| 696 | 701 | { |
|---|