aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-03-16 15:55:43 -0400
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-03-18 15:15:37 -0400
commitcdb00563fe2c25a782d2fc57ad1778280fbf9edb (patch)
tree01000b1e11b4771459e8875b61eb85c00112c3f5
parent1bd3cbc1a0e9ed977a6bd470c5bc7bd36fd87e26 (diff)
iwlwifi: mvm: BT Coex - add debugfs hook to set BT Tx priority
In order to debug the firmware, we need to be able to set the BT priority of WiFi packets. This priority is set based on the type of the packet (control frames, EAPOL etc...). For debugging purposes, allow to override this priority by a debugfs controlled value. Enable this feature that needs this priority to be able to test it. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/coex.c8
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/constants.h1
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/debugfs.c18
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/fw-api-coex.h2
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mvm.h1
5 files changed, 30 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/coex.c b/drivers/net/wireless/iwlwifi/mvm/coex.c
index 018d75c805ad..c9b320a06070 100644
--- a/drivers/net/wireless/iwlwifi/mvm/coex.c
+++ b/drivers/net/wireless/iwlwifi/mvm/coex.c
@@ -616,6 +616,11 @@ int iwl_send_bt_init_conf(struct iwl_mvm *mvm)
616 bt_cmd->flags |= cpu_to_le32(BT_COEX_CORUNNING); 616 bt_cmd->flags |= cpu_to_le32(BT_COEX_CORUNNING);
617 } 617 }
618 618
619 if (IWL_MVM_BT_COEX_MPLUT) {
620 bt_cmd->flags |= cpu_to_le32(BT_COEX_MPLUT);
621 bt_cmd->valid_bit_msk = cpu_to_le32(BT_VALID_MULTI_PRIO_LUT);
622 }
623
619 if (mvm->cfg->bt_shared_single_ant) 624 if (mvm->cfg->bt_shared_single_ant)
620 memcpy(&bt_cmd->decision_lut, iwl_single_shared_ant, 625 memcpy(&bt_cmd->decision_lut, iwl_single_shared_ant,
621 sizeof(iwl_single_shared_ant)); 626 sizeof(iwl_single_shared_ant));
@@ -1215,6 +1220,9 @@ u8 iwl_mvm_bt_coex_tx_prio(struct iwl_mvm *mvm, struct ieee80211_hdr *hdr,
1215 if (info->band != IEEE80211_BAND_2GHZ) 1220 if (info->band != IEEE80211_BAND_2GHZ)
1216 return 0; 1221 return 0;
1217 1222
1223 if (unlikely(mvm->bt_tx_prio))
1224 return mvm->bt_tx_prio - 1;
1225
1218 /* High prio packet (wrt. BT coex) if it is EAPOL, MCAST or MGMT */ 1226 /* High prio packet (wrt. BT coex) if it is EAPOL, MCAST or MGMT */
1219 if (info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO || 1227 if (info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO ||
1220 is_multicast_ether_addr(hdr->addr1) || 1228 is_multicast_ether_addr(hdr->addr1) ||
diff --git a/drivers/net/wireless/iwlwifi/mvm/constants.h b/drivers/net/wireless/iwlwifi/mvm/constants.h
index 37d5f3594c4f..921b177a92b8 100644
--- a/drivers/net/wireless/iwlwifi/mvm/constants.h
+++ b/drivers/net/wireless/iwlwifi/mvm/constants.h
@@ -83,5 +83,6 @@
83#define IWL_MVM_LOWLAT_DUAL_BINDING_MAXDUR 24 /* TU */ 83#define IWL_MVM_LOWLAT_DUAL_BINDING_MAXDUR 24 /* TU */
84#define IWL_MVM_BT_COEX_SYNC2SCO 1 84#define IWL_MVM_BT_COEX_SYNC2SCO 1
85#define IWL_MVM_BT_COEX_CORUNNING 1 85#define IWL_MVM_BT_COEX_CORUNNING 1
86#define IWL_MVM_BT_COEX_MPLUT 1
86 87
87#endif /* __MVM_CONSTANTS_H */ 88#endif /* __MVM_CONSTANTS_H */
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
index cf1fa498e53e..2566fa9913ef 100644
--- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
@@ -441,6 +441,22 @@ static ssize_t iwl_dbgfs_bt_cmd_read(struct file *file, char __user *user_buf,
441 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); 441 return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
442} 442}
443 443
444static ssize_t
445iwl_dbgfs_bt_tx_prio_write(struct iwl_mvm *mvm, char *buf,
446 size_t count, loff_t *ppos)
447{
448 u32 bt_tx_prio;
449
450 if (sscanf(buf, "%u", &bt_tx_prio) != 1)
451 return -EINVAL;
452 if (bt_tx_prio > 4)
453 return -EINVAL;
454
455 mvm->bt_tx_prio = bt_tx_prio;
456
457 return count;
458}
459
444#define PRINT_STATS_LE32(_str, _val) \ 460#define PRINT_STATS_LE32(_str, _val) \
445 pos += scnprintf(buf + pos, bufsz - pos, \ 461 pos += scnprintf(buf + pos, bufsz - pos, \
446 fmt_table, _str, \ 462 fmt_table, _str, \
@@ -1085,6 +1101,7 @@ MVM_DEBUGFS_READ_FILE_OPS(fw_rx_stats);
1085MVM_DEBUGFS_READ_FILE_OPS(drv_rx_stats); 1101MVM_DEBUGFS_READ_FILE_OPS(drv_rx_stats);
1086MVM_DEBUGFS_WRITE_FILE_OPS(fw_restart, 10); 1102MVM_DEBUGFS_WRITE_FILE_OPS(fw_restart, 10);
1087MVM_DEBUGFS_WRITE_FILE_OPS(fw_nmi, 10); 1103MVM_DEBUGFS_WRITE_FILE_OPS(fw_nmi, 10);
1104MVM_DEBUGFS_WRITE_FILE_OPS(bt_tx_prio, 10);
1088MVM_DEBUGFS_READ_WRITE_FILE_OPS(scan_ant_rxchain, 8); 1105MVM_DEBUGFS_READ_WRITE_FILE_OPS(scan_ant_rxchain, 8);
1089MVM_DEBUGFS_READ_WRITE_FILE_OPS(d0i3_refs, 8); 1106MVM_DEBUGFS_READ_WRITE_FILE_OPS(d0i3_refs, 8);
1090 1107
@@ -1126,6 +1143,7 @@ int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)
1126 MVM_DEBUGFS_ADD_FILE(drv_rx_stats, mvm->debugfs_dir, S_IRUSR); 1143 MVM_DEBUGFS_ADD_FILE(drv_rx_stats, mvm->debugfs_dir, S_IRUSR);
1127 MVM_DEBUGFS_ADD_FILE(fw_restart, mvm->debugfs_dir, S_IWUSR); 1144 MVM_DEBUGFS_ADD_FILE(fw_restart, mvm->debugfs_dir, S_IWUSR);
1128 MVM_DEBUGFS_ADD_FILE(fw_nmi, mvm->debugfs_dir, S_IWUSR); 1145 MVM_DEBUGFS_ADD_FILE(fw_nmi, mvm->debugfs_dir, S_IWUSR);
1146 MVM_DEBUGFS_ADD_FILE(bt_tx_prio, mvm->debugfs_dir, S_IWUSR);
1129 MVM_DEBUGFS_ADD_FILE(scan_ant_rxchain, mvm->debugfs_dir, 1147 MVM_DEBUGFS_ADD_FILE(scan_ant_rxchain, mvm->debugfs_dir,
1130 S_IWUSR | S_IRUSR); 1148 S_IWUSR | S_IRUSR);
1131 MVM_DEBUGFS_ADD_FILE(prph_reg, mvm->debugfs_dir, S_IWUSR | S_IRUSR); 1149 MVM_DEBUGFS_ADD_FILE(prph_reg, mvm->debugfs_dir, S_IWUSR | S_IRUSR);
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-coex.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-coex.h
index 32156d7e2d07..21877e5966a8 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw-api-coex.h
+++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-coex.h
@@ -78,6 +78,7 @@
78 * @BT_COEX_NW: 78 * @BT_COEX_NW:
79 * @BT_COEX_SYNC2SCO: 79 * @BT_COEX_SYNC2SCO:
80 * @BT_COEX_CORUNNING: 80 * @BT_COEX_CORUNNING:
81 * @BT_COEX_MPLUT:
81 * 82 *
82 * The COEX_MODE must be set for each command. Even if it is not changed. 83 * The COEX_MODE must be set for each command. Even if it is not changed.
83 */ 84 */
@@ -90,6 +91,7 @@ enum iwl_bt_coex_flags {
90 BT_COEX_NW = 0x3 << BT_COEX_MODE_POS, 91 BT_COEX_NW = 0x3 << BT_COEX_MODE_POS,
91 BT_COEX_SYNC2SCO = BIT(7), 92 BT_COEX_SYNC2SCO = BIT(7),
92 BT_COEX_CORUNNING = BIT(8), 93 BT_COEX_CORUNNING = BIT(8),
94 BT_COEX_MPLUT = BIT(9),
93}; 95};
94 96
95/* 97/*
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index cb6dbb140820..d58118241d61 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -611,6 +611,7 @@ struct iwl_mvm {
611 struct iwl_bt_coex_ci_cmd last_bt_ci_cmd; 611 struct iwl_bt_coex_ci_cmd last_bt_ci_cmd;
612 u32 last_ant_isol; 612 u32 last_ant_isol;
613 u8 last_corun_lut; 613 u8 last_corun_lut;
614 u8 bt_tx_prio;
614 615
615 /* Thermal Throttling and CTkill */ 616 /* Thermal Throttling and CTkill */
616 struct iwl_mvm_tt_mgmt thermal_throttle; 617 struct iwl_mvm_tt_mgmt thermal_throttle;