diff options
author | Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com> | 2016-02-24 05:19:22 -0500 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2016-03-09 13:59:11 -0500 |
commit | 00f481bd895a826058d301b3093e86e819497b51 (patch) | |
tree | 67610301751637636cae68b9c4f8564ce2cb2605 /drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | |
parent | 7c70fee5ae5c4fb542e432599cb85c8031b952a0 (diff) |
iwlwifi: mvm: add ctdp operations to debugfs
Add debugfs entries to get the ctdp budget average
and to stop ctdp.
Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c index 56e6b0b8b9cc..a43b3921c4c1 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | |||
@@ -73,6 +73,44 @@ | |||
73 | #include "debugfs.h" | 73 | #include "debugfs.h" |
74 | #include "iwl-fw-error-dump.h" | 74 | #include "iwl-fw-error-dump.h" |
75 | 75 | ||
76 | static ssize_t iwl_dbgfs_ctdp_budget_read(struct file *file, | ||
77 | char __user *user_buf, | ||
78 | size_t count, loff_t *ppos) | ||
79 | { | ||
80 | struct iwl_mvm *mvm = file->private_data; | ||
81 | char buf[16]; | ||
82 | int pos, budget; | ||
83 | |||
84 | if (!mvm->ucode_loaded || mvm->cur_ucode != IWL_UCODE_REGULAR) | ||
85 | return -EIO; | ||
86 | |||
87 | mutex_lock(&mvm->mutex); | ||
88 | budget = iwl_mvm_ctdp_command(mvm, CTDP_CMD_OPERATION_REPORT, 0); | ||
89 | mutex_unlock(&mvm->mutex); | ||
90 | |||
91 | if (budget < 0) | ||
92 | return budget; | ||
93 | |||
94 | pos = scnprintf(buf, sizeof(buf), "%d\n", budget); | ||
95 | |||
96 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); | ||
97 | } | ||
98 | |||
99 | static ssize_t iwl_dbgfs_stop_ctdp_write(struct iwl_mvm *mvm, char *buf, | ||
100 | size_t count, loff_t *ppos) | ||
101 | { | ||
102 | int ret; | ||
103 | |||
104 | if (!mvm->ucode_loaded || mvm->cur_ucode != IWL_UCODE_REGULAR) | ||
105 | return -EIO; | ||
106 | |||
107 | mutex_lock(&mvm->mutex); | ||
108 | ret = iwl_mvm_ctdp_command(mvm, CTDP_CMD_OPERATION_STOP, 0); | ||
109 | mutex_unlock(&mvm->mutex); | ||
110 | |||
111 | return ret ?: count; | ||
112 | } | ||
113 | |||
76 | static ssize_t iwl_dbgfs_tx_flush_write(struct iwl_mvm *mvm, char *buf, | 114 | static ssize_t iwl_dbgfs_tx_flush_write(struct iwl_mvm *mvm, char *buf, |
77 | size_t count, loff_t *ppos) | 115 | size_t count, loff_t *ppos) |
78 | { | 116 | { |
@@ -1493,6 +1531,8 @@ iwl_dbgfs_send_echo_cmd_write(struct iwl_mvm *mvm, char *buf, | |||
1493 | MVM_DEBUGFS_READ_WRITE_FILE_OPS(prph_reg, 64); | 1531 | MVM_DEBUGFS_READ_WRITE_FILE_OPS(prph_reg, 64); |
1494 | 1532 | ||
1495 | /* Device wide debugfs entries */ | 1533 | /* Device wide debugfs entries */ |
1534 | MVM_DEBUGFS_READ_FILE_OPS(ctdp_budget); | ||
1535 | MVM_DEBUGFS_WRITE_FILE_OPS(stop_ctdp, 8); | ||
1496 | MVM_DEBUGFS_WRITE_FILE_OPS(tx_flush, 16); | 1536 | MVM_DEBUGFS_WRITE_FILE_OPS(tx_flush, 16); |
1497 | MVM_DEBUGFS_WRITE_FILE_OPS(sta_drain, 8); | 1537 | MVM_DEBUGFS_WRITE_FILE_OPS(sta_drain, 8); |
1498 | MVM_DEBUGFS_WRITE_FILE_OPS(send_echo_cmd, 8); | 1538 | MVM_DEBUGFS_WRITE_FILE_OPS(send_echo_cmd, 8); |
@@ -1542,6 +1582,8 @@ int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir) | |||
1542 | MVM_DEBUGFS_ADD_FILE(set_nic_temperature, mvm->debugfs_dir, | 1582 | MVM_DEBUGFS_ADD_FILE(set_nic_temperature, mvm->debugfs_dir, |
1543 | S_IWUSR | S_IRUSR); | 1583 | S_IWUSR | S_IRUSR); |
1544 | MVM_DEBUGFS_ADD_FILE(nic_temp, dbgfs_dir, S_IRUSR); | 1584 | MVM_DEBUGFS_ADD_FILE(nic_temp, dbgfs_dir, S_IRUSR); |
1585 | MVM_DEBUGFS_ADD_FILE(ctdp_budget, dbgfs_dir, S_IRUSR); | ||
1586 | MVM_DEBUGFS_ADD_FILE(stop_ctdp, dbgfs_dir, S_IWUSR); | ||
1545 | MVM_DEBUGFS_ADD_FILE(stations, dbgfs_dir, S_IRUSR); | 1587 | MVM_DEBUGFS_ADD_FILE(stations, dbgfs_dir, S_IRUSR); |
1546 | MVM_DEBUGFS_ADD_FILE(bt_notif, dbgfs_dir, S_IRUSR); | 1588 | MVM_DEBUGFS_ADD_FILE(bt_notif, dbgfs_dir, S_IRUSR); |
1547 | MVM_DEBUGFS_ADD_FILE(bt_cmd, dbgfs_dir, S_IRUSR); | 1589 | MVM_DEBUGFS_ADD_FILE(bt_cmd, dbgfs_dir, S_IRUSR); |