aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/coex.c
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-05-28 05:06:41 -0400
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-06-24 14:55:34 -0400
commita39979a8c3e71eac72f43568b2535da60099b8e4 (patch)
treee78e2f2ffeafc5035144710f0538355e14994b7e /drivers/net/wireless/iwlwifi/mvm/coex.c
parent5daddc99024b952bb4e66452febd2175fff8d26e (diff)
iwlwifi: mvm: BT Coex - allow to force the antenna allocation
This can be used for testing. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/coex.c')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/coex.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/coex.c b/drivers/net/wireless/iwlwifi/mvm/coex.c
index c8c3b38228f0..b2003d82260a 100644
--- a/drivers/net/wireless/iwlwifi/mvm/coex.c
+++ b/drivers/net/wireless/iwlwifi/mvm/coex.c
@@ -106,6 +106,9 @@ static const u8 iwl_bt_prio_tbl[BT_COEX_PRIO_TBL_EVT_MAX] = {
106 106
107static int iwl_send_bt_prio_tbl(struct iwl_mvm *mvm) 107static int iwl_send_bt_prio_tbl(struct iwl_mvm *mvm)
108{ 108{
109 if (unlikely(mvm->bt_force_ant_mode != BT_FORCE_ANT_DIS))
110 return 0;
111
109 return iwl_mvm_send_cmd_pdu(mvm, BT_COEX_PRIO_TABLE, 0, 112 return iwl_mvm_send_cmd_pdu(mvm, BT_COEX_PRIO_TABLE, 0,
110 sizeof(struct iwl_bt_coex_prio_tbl_cmd), 113 sizeof(struct iwl_bt_coex_prio_tbl_cmd),
111 &iwl_bt_prio_tbl); 114 &iwl_bt_prio_tbl);
@@ -578,6 +581,29 @@ int iwl_send_bt_init_conf(struct iwl_mvm *mvm)
578 return -ENOMEM; 581 return -ENOMEM;
579 cmd.data[0] = bt_cmd; 582 cmd.data[0] = bt_cmd;
580 583
584 lockdep_assert_held(&mvm->mutex);
585
586 if (unlikely(mvm->bt_force_ant_mode != BT_FORCE_ANT_DIS)) {
587 switch (mvm->bt_force_ant_mode) {
588 case BT_FORCE_ANT_AUTO:
589 flags = BT_COEX_AUTO;
590 break;
591 case BT_FORCE_ANT_BT:
592 flags = BT_COEX_BT;
593 break;
594 case BT_FORCE_ANT_WIFI:
595 flags = BT_COEX_WIFI;
596 break;
597 default:
598 WARN_ON(1);
599 flags = 0;
600 }
601
602 bt_cmd->flags = cpu_to_le32(flags);
603 bt_cmd->valid_bit_msk = cpu_to_le32(BT_VALID_ENABLE);
604 goto send_cmd;
605 }
606
581 bt_cmd->max_kill = 5; 607 bt_cmd->max_kill = 5;
582 bt_cmd->bt4_antenna_isolation_thr = BT_ANTENNA_COUPLING_THRESHOLD; 608 bt_cmd->bt4_antenna_isolation_thr = BT_ANTENNA_COUPLING_THRESHOLD;
583 bt_cmd->bt4_antenna_isolation = iwlwifi_mod_params.ant_coupling; 609 bt_cmd->bt4_antenna_isolation = iwlwifi_mod_params.ant_coupling;
@@ -642,6 +668,7 @@ int iwl_send_bt_init_conf(struct iwl_mvm *mvm)
642 bt_cmd->kill_cts_msk = 668 bt_cmd->kill_cts_msk =
643 cpu_to_le32(iwl_bt_cts_kill_msk[BT_KILL_MSK_DEFAULT]); 669 cpu_to_le32(iwl_bt_cts_kill_msk[BT_KILL_MSK_DEFAULT]);
644 670
671send_cmd:
645 memset(&mvm->last_bt_notif, 0, sizeof(mvm->last_bt_notif)); 672 memset(&mvm->last_bt_notif, 0, sizeof(mvm->last_bt_notif));
646 memset(&mvm->last_bt_ci_cmd, 0, sizeof(mvm->last_bt_ci_cmd)); 673 memset(&mvm->last_bt_ci_cmd, 0, sizeof(mvm->last_bt_ci_cmd));
647 674
@@ -955,6 +982,10 @@ static void iwl_mvm_bt_coex_notif_handle(struct iwl_mvm *mvm)
955 struct iwl_bt_coex_ci_cmd cmd = {}; 982 struct iwl_bt_coex_ci_cmd cmd = {};
956 u8 ci_bw_idx; 983 u8 ci_bw_idx;
957 984
985 /* Ignore updates if we are in force mode */
986 if (unlikely(mvm->bt_force_ant_mode != BT_FORCE_ANT_DIS))
987 return;
988
958 rcu_read_lock(); 989 rcu_read_lock();
959 ieee80211_iterate_active_interfaces_atomic( 990 ieee80211_iterate_active_interfaces_atomic(
960 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, 991 mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
@@ -1121,6 +1152,10 @@ void iwl_mvm_bt_rssi_event(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
1121 1152
1122 lockdep_assert_held(&mvm->mutex); 1153 lockdep_assert_held(&mvm->mutex);
1123 1154
1155 /* Ignore updates if we are in force mode */
1156 if (unlikely(mvm->bt_force_ant_mode != BT_FORCE_ANT_DIS))
1157 return;
1158
1124 /* 1159 /*
1125 * Rssi update while not associated - can happen since the statistics 1160 * Rssi update while not associated - can happen since the statistics
1126 * are handled asynchronously 1161 * are handled asynchronously
@@ -1274,6 +1309,10 @@ int iwl_mvm_rx_ant_coupling_notif(struct iwl_mvm *mvm,
1274 1309
1275 lockdep_assert_held(&mvm->mutex); 1310 lockdep_assert_held(&mvm->mutex);
1276 1311
1312 /* Ignore updates if we are in force mode */
1313 if (unlikely(mvm->bt_force_ant_mode != BT_FORCE_ANT_DIS))
1314 return 0;
1315
1277 if (ant_isolation == mvm->last_ant_isol) 1316 if (ant_isolation == mvm->last_ant_isol)
1278 return 0; 1317 return 0;
1279 1318