diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-02-19 01:03:07 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-02-19 15:52:50 -0500 |
commit | 528c3126a98e75f47fc9fa11b243c82a59271d0d (patch) | |
tree | 0aa27e95d6d817b2bd03874715e51f47ea88b0f2 /drivers/net/wireless/iwlwifi/iwl-debugfs.c | |
parent | 8a472da431998b7357e6dc562e79a3061ed56cad (diff) |
iwlwifi: add debugfs to monitor force reset parameters
Adding debugfs file to monitor the counters and other
information related to "force_reset" request.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-debugfs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index 7241fda022c5..7bf44f146799 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -2221,6 +2221,36 @@ static ssize_t iwl_dbgfs_plcp_delta_write(struct file *file, | |||
2221 | return count; | 2221 | return count; |
2222 | } | 2222 | } |
2223 | 2223 | ||
2224 | static ssize_t iwl_dbgfs_force_reset_read(struct file *file, | ||
2225 | char __user *user_buf, | ||
2226 | size_t count, loff_t *ppos) { | ||
2227 | |||
2228 | struct iwl_priv *priv = file->private_data; | ||
2229 | int i, pos = 0; | ||
2230 | char buf[300]; | ||
2231 | const size_t bufsz = sizeof(buf); | ||
2232 | struct iwl_force_reset *force_reset; | ||
2233 | |||
2234 | for (i = 0; i < IWL_MAX_FORCE_RESET; i++) { | ||
2235 | force_reset = &priv->force_reset[i]; | ||
2236 | pos += scnprintf(buf + pos, bufsz - pos, | ||
2237 | "Force reset method %d\n", i); | ||
2238 | pos += scnprintf(buf + pos, bufsz - pos, | ||
2239 | "\tnumber of reset request: %d\n", | ||
2240 | force_reset->reset_request_count); | ||
2241 | pos += scnprintf(buf + pos, bufsz - pos, | ||
2242 | "\tnumber of reset request success: %d\n", | ||
2243 | force_reset->reset_success_count); | ||
2244 | pos += scnprintf(buf + pos, bufsz - pos, | ||
2245 | "\tnumber of reset request reject: %d\n", | ||
2246 | force_reset->reset_reject_count); | ||
2247 | pos += scnprintf(buf + pos, bufsz - pos, | ||
2248 | "\treset duration: %lu\n", | ||
2249 | force_reset->reset_duration); | ||
2250 | } | ||
2251 | return simple_read_from_buffer(user_buf, count, ppos, buf, pos); | ||
2252 | } | ||
2253 | |||
2224 | static ssize_t iwl_dbgfs_force_reset_write(struct file *file, | 2254 | static ssize_t iwl_dbgfs_force_reset_write(struct file *file, |
2225 | const char __user *user_buf, | 2255 | const char __user *user_buf, |
2226 | size_t count, loff_t *ppos) { | 2256 | size_t count, loff_t *ppos) { |
@@ -2267,7 +2297,7 @@ DEBUGFS_READ_FILE_OPS(fh_reg); | |||
2267 | DEBUGFS_READ_WRITE_FILE_OPS(missed_beacon); | 2297 | DEBUGFS_READ_WRITE_FILE_OPS(missed_beacon); |
2268 | DEBUGFS_WRITE_FILE_OPS(internal_scan); | 2298 | DEBUGFS_WRITE_FILE_OPS(internal_scan); |
2269 | DEBUGFS_READ_WRITE_FILE_OPS(plcp_delta); | 2299 | DEBUGFS_READ_WRITE_FILE_OPS(plcp_delta); |
2270 | DEBUGFS_WRITE_FILE_OPS(force_reset); | 2300 | DEBUGFS_READ_WRITE_FILE_OPS(force_reset); |
2271 | 2301 | ||
2272 | /* | 2302 | /* |
2273 | * Create the debugfs files and directories | 2303 | * Create the debugfs files and directories |
@@ -2321,7 +2351,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
2321 | DEBUGFS_ADD_FILE(missed_beacon, dir_debug, S_IWUSR); | 2351 | DEBUGFS_ADD_FILE(missed_beacon, dir_debug, S_IWUSR); |
2322 | DEBUGFS_ADD_FILE(internal_scan, dir_debug, S_IWUSR); | 2352 | DEBUGFS_ADD_FILE(internal_scan, dir_debug, S_IWUSR); |
2323 | DEBUGFS_ADD_FILE(plcp_delta, dir_debug, S_IWUSR | S_IRUSR); | 2353 | DEBUGFS_ADD_FILE(plcp_delta, dir_debug, S_IWUSR | S_IRUSR); |
2324 | DEBUGFS_ADD_FILE(force_reset, dir_debug, S_IWUSR); | 2354 | DEBUGFS_ADD_FILE(force_reset, dir_debug, S_IWUSR | S_IRUSR); |
2325 | if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) { | 2355 | if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) { |
2326 | DEBUGFS_ADD_FILE(ucode_rx_stats, dir_debug, S_IRUSR); | 2356 | DEBUGFS_ADD_FILE(ucode_rx_stats, dir_debug, S_IRUSR); |
2327 | DEBUGFS_ADD_FILE(ucode_tx_stats, dir_debug, S_IRUSR); | 2357 | DEBUGFS_ADD_FILE(ucode_tx_stats, dir_debug, S_IRUSR); |