iwlwifi: LTR updates

New FW versions introduces LTR feature enablement by default.
For such FW versions, driver (mvm/xvt) should not send
host command to enable LTR feature, also it should be possible to
override LTR configuration through the debugfs.

1. Send LTR feature enablement command only for FW versions
which does not advertises SET_LTR_GEN2 capability.
2. Implement ltr_config file in debugfs for LTR configuration override.

Signed-off-by: Alex Malamud <alex.malamud@intel.com>
This commit is contained in:
Alex Malamud 2019-05-22 13:49:18 +03:00 committed by Luca Coelho
parent 24d2176d17
commit aa43ae1216
3 changed files with 41 additions and 2 deletions

View File

@ -441,9 +441,10 @@ enum iwl_ucode_tlv_capa {
IWL_UCODE_TLV_CAPA_DYNAMIC_QUOTA = (__force iwl_ucode_tlv_capa_t)44,
IWL_UCODE_TLV_CAPA_COEX_SCHEMA_2 = (__force iwl_ucode_tlv_capa_t)45,
IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD = (__force iwl_ucode_tlv_capa_t)46,
IWL_UCODE_TLV_CAPA_ULTRA_HB_CHANNELS = (__force iwl_ucode_tlv_capa_t)48,
IWL_UCODE_TLV_CAPA_FTM_CALIBRATED = (__force iwl_ucode_tlv_capa_t)47,
IWL_UCODE_TLV_CAPA_ULTRA_HB_CHANNELS = (__force iwl_ucode_tlv_capa_t)48,
IWL_UCODE_TLV_CAPA_CS_MODIFY = (__force iwl_ucode_tlv_capa_t)49,
IWL_UCODE_TLV_CAPA_SET_LTR_GEN2 = (__force iwl_ucode_tlv_capa_t)50,
/* set 2 */
IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE = (__force iwl_ucode_tlv_capa_t)64,

View File

@ -1758,6 +1758,38 @@ iwl_dbgfs_uapsd_noagg_bssids_read(struct file *file, char __user *user_buf,
return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
}
static ssize_t
iwl_dbgfs_ltr_config_write(struct iwl_mvm *mvm,
char *buf, size_t count, loff_t *ppos)
{
int ret;
struct iwl_ltr_config_cmd ltr_config = {0};
if (!iwl_mvm_firmware_running(mvm))
return -EIO;
if (sscanf(buf, "%x,%x,%x,%x,%x,%x,%x",
&ltr_config.flags,
&ltr_config.static_long,
&ltr_config.static_short,
&ltr_config.ltr_cfg_values[0],
&ltr_config.ltr_cfg_values[1],
&ltr_config.ltr_cfg_values[2],
&ltr_config.ltr_cfg_values[3]) != 7) {
return -EINVAL;
}
mutex_lock(&mvm->mutex);
ret = iwl_mvm_send_cmd_pdu(mvm, LTR_CONFIG, 0, sizeof(ltr_config),
&ltr_config);
mutex_unlock(&mvm->mutex);
if (ret)
IWL_ERR(mvm, "failed to send ltr configuration cmd\n");
return ret ?: count;
}
MVM_DEBUGFS_READ_WRITE_FILE_OPS(prph_reg, 64);
/* Device wide debugfs entries */
@ -1806,6 +1838,8 @@ MVM_DEBUGFS_READ_WRITE_STA_FILE_OPS(amsdu_len, 16);
MVM_DEBUGFS_READ_WRITE_FILE_OPS(he_sniffer_params, 32);
MVM_DEBUGFS_WRITE_FILE_OPS(ltr_config, 512);
static ssize_t iwl_dbgfs_mem_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
@ -1993,6 +2027,9 @@ void iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)
#endif
MVM_DEBUGFS_ADD_FILE(he_sniffer_params, mvm->debugfs_dir, 0600);
if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_SET_LTR_GEN2))
MVM_DEBUGFS_ADD_FILE(ltr_config, mvm->debugfs_dir, 0200);
debugfs_create_bool("enable_scan_iteration_notif", 0600,
mvm->debugfs_dir, &mvm->scan_iter_notif_enabled);
debugfs_create_bool("drop_bcn_ap_mode", 0600, mvm->debugfs_dir,

View File

@ -1302,7 +1302,8 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
iwl_mvm_tt_tx_backoff(mvm, 0);
#endif
WARN_ON(iwl_mvm_config_ltr(mvm));
if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_SET_LTR_GEN2))
WARN_ON(iwl_mvm_config_ltr(mvm));
ret = iwl_mvm_power_update_device(mvm);
if (ret)