aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
index 5c0f93997b7b..005cc09757d2 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
@@ -7,6 +7,7 @@
7 * 7 *
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * Copyright(c) 2016 Intel Deutschland GmbH
10 * 11 *
11 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as 13 * it under the terms of version 2 of the GNU General Public License as
@@ -943,6 +944,47 @@ iwl_dbgfs_scan_ant_rxchain_write(struct iwl_mvm *mvm, char *buf,
943 return count; 944 return count;
944} 945}
945 946
947static ssize_t iwl_dbgfs_indirection_tbl_write(struct iwl_mvm *mvm,
948 char *buf, size_t count,
949 loff_t *ppos)
950{
951 struct iwl_rss_config_cmd cmd = {
952 .flags = cpu_to_le32(IWL_RSS_ENABLE),
953 .hash_mask = IWL_RSS_HASH_TYPE_IPV4_TCP |
954 IWL_RSS_HASH_TYPE_IPV4_PAYLOAD |
955 IWL_RSS_HASH_TYPE_IPV6_TCP |
956 IWL_RSS_HASH_TYPE_IPV6_PAYLOAD,
957 };
958 int ret, i, num_repeats, nbytes = count / 2;
959
960 ret = hex2bin(cmd.indirection_table, buf, nbytes);
961 if (ret)
962 return ret;
963
964 /*
965 * The input is the redirection table, partial or full.
966 * Repeat the pattern if needed.
967 * For example, input of 01020F will be repeated 42 times,
968 * indirecting RSS hash results to queues 1, 2, 15 (skipping
969 * queues 3 - 14).
970 */
971 num_repeats = ARRAY_SIZE(cmd.indirection_table) / nbytes;
972 for (i = 1; i < num_repeats; i++)
973 memcpy(&cmd.indirection_table[i * nbytes],
974 cmd.indirection_table, nbytes);
975 /* handle cut in the middle pattern for the last places */
976 memcpy(&cmd.indirection_table[i * nbytes], cmd.indirection_table,
977 ARRAY_SIZE(cmd.indirection_table) % nbytes);
978
979 memcpy(cmd.secret_key, mvm->secret_key, ARRAY_SIZE(cmd.secret_key));
980
981 mutex_lock(&mvm->mutex);
982 ret = iwl_mvm_send_cmd_pdu(mvm, RSS_CONFIG_CMD, 0, sizeof(cmd), &cmd);
983 mutex_unlock(&mvm->mutex);
984
985 return ret ?: count;
986}
987
946static ssize_t iwl_dbgfs_fw_dbg_conf_read(struct file *file, 988static ssize_t iwl_dbgfs_fw_dbg_conf_read(struct file *file,
947 char __user *user_buf, 989 char __user *user_buf,
948 size_t count, loff_t *ppos) 990 size_t count, loff_t *ppos)
@@ -1455,6 +1497,7 @@ MVM_DEBUGFS_READ_WRITE_FILE_OPS(d0i3_refs, 8);
1455MVM_DEBUGFS_READ_WRITE_FILE_OPS(fw_dbg_conf, 8); 1497MVM_DEBUGFS_READ_WRITE_FILE_OPS(fw_dbg_conf, 8);
1456MVM_DEBUGFS_WRITE_FILE_OPS(fw_dbg_collect, 64); 1498MVM_DEBUGFS_WRITE_FILE_OPS(fw_dbg_collect, 64);
1457MVM_DEBUGFS_WRITE_FILE_OPS(cont_recording, 8); 1499MVM_DEBUGFS_WRITE_FILE_OPS(cont_recording, 8);
1500MVM_DEBUGFS_WRITE_FILE_OPS(indirection_tbl, 16);
1458 1501
1459#ifdef CONFIG_IWLWIFI_BCAST_FILTERING 1502#ifdef CONFIG_IWLWIFI_BCAST_FILTERING
1460MVM_DEBUGFS_READ_WRITE_FILE_OPS(bcast_filters, 256); 1503MVM_DEBUGFS_READ_WRITE_FILE_OPS(bcast_filters, 256);
@@ -1499,6 +1542,7 @@ int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)
1499 MVM_DEBUGFS_ADD_FILE(fw_dbg_collect, mvm->debugfs_dir, S_IWUSR); 1542 MVM_DEBUGFS_ADD_FILE(fw_dbg_collect, mvm->debugfs_dir, S_IWUSR);
1500 MVM_DEBUGFS_ADD_FILE(send_echo_cmd, mvm->debugfs_dir, S_IWUSR); 1543 MVM_DEBUGFS_ADD_FILE(send_echo_cmd, mvm->debugfs_dir, S_IWUSR);
1501 MVM_DEBUGFS_ADD_FILE(cont_recording, mvm->debugfs_dir, S_IWUSR); 1544 MVM_DEBUGFS_ADD_FILE(cont_recording, mvm->debugfs_dir, S_IWUSR);
1545 MVM_DEBUGFS_ADD_FILE(indirection_tbl, mvm->debugfs_dir, S_IWUSR);
1502 if (!debugfs_create_bool("enable_scan_iteration_notif", 1546 if (!debugfs_create_bool("enable_scan_iteration_notif",
1503 S_IRUSR | S_IWUSR, 1547 S_IRUSR | S_IWUSR,
1504 mvm->debugfs_dir, 1548 mvm->debugfs_dir,