|
@@ -160,7 +160,7 @@ static ssize_t iwl_dbgfs_tx_statistics_read(struct file *file,
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-static ssize_t iwl_dbgfs_tx_statistics_write(struct file *file,
|
|
|
+static ssize_t iwl_dbgfs_clear_traffic_statistics_write(struct file *file,
|
|
|
const char __user *user_buf,
|
|
|
size_t count, loff_t *ppos)
|
|
|
{
|
|
@@ -175,8 +175,7 @@ static ssize_t iwl_dbgfs_tx_statistics_write(struct file *file,
|
|
|
return -EFAULT;
|
|
|
if (sscanf(buf, "%x", &clear_flag) != 1)
|
|
|
return -EFAULT;
|
|
|
- if (clear_flag == 1)
|
|
|
- iwl_clear_tx_stats(priv);
|
|
|
+ iwl_clear_traffic_stats(priv);
|
|
|
|
|
|
return count;
|
|
|
}
|
|
@@ -221,26 +220,6 @@ static ssize_t iwl_dbgfs_rx_statistics_read(struct file *file,
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-static ssize_t iwl_dbgfs_rx_statistics_write(struct file *file,
|
|
|
- const char __user *user_buf,
|
|
|
- size_t count, loff_t *ppos)
|
|
|
-{
|
|
|
- struct iwl_priv *priv = file->private_data;
|
|
|
- u32 clear_flag;
|
|
|
- char buf[8];
|
|
|
- int buf_size;
|
|
|
-
|
|
|
- memset(buf, 0, sizeof(buf));
|
|
|
- buf_size = min(count, sizeof(buf) - 1);
|
|
|
- if (copy_from_user(buf, user_buf, buf_size))
|
|
|
- return -EFAULT;
|
|
|
- if (sscanf(buf, "%x", &clear_flag) != 1)
|
|
|
- return -EFAULT;
|
|
|
- if (clear_flag == 1)
|
|
|
- iwl_clear_rx_stats(priv);
|
|
|
- return count;
|
|
|
-}
|
|
|
-
|
|
|
#define BYTE1_MASK 0x000000ff;
|
|
|
#define BYTE2_MASK 0x0000ffff;
|
|
|
#define BYTE3_MASK 0x00ffffff;
|
|
@@ -1823,7 +1802,7 @@ static ssize_t iwl_dbgfs_power_save_status_read(struct file *file,
|
|
|
return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
|
|
|
}
|
|
|
|
|
|
-static ssize_t iwl_dbgfs_clear_statistics_write(struct file *file,
|
|
|
+static ssize_t iwl_dbgfs_clear_ucode_statistics_write(struct file *file,
|
|
|
const char __user *user_buf,
|
|
|
size_t count, loff_t *ppos)
|
|
|
{
|
|
@@ -1847,8 +1826,8 @@ static ssize_t iwl_dbgfs_clear_statistics_write(struct file *file,
|
|
|
return count;
|
|
|
}
|
|
|
|
|
|
-DEBUGFS_READ_WRITE_FILE_OPS(rx_statistics);
|
|
|
-DEBUGFS_READ_WRITE_FILE_OPS(tx_statistics);
|
|
|
+DEBUGFS_READ_FILE_OPS(rx_statistics);
|
|
|
+DEBUGFS_READ_FILE_OPS(tx_statistics);
|
|
|
DEBUGFS_READ_WRITE_FILE_OPS(traffic_log);
|
|
|
DEBUGFS_READ_FILE_OPS(rx_queue);
|
|
|
DEBUGFS_READ_FILE_OPS(tx_queue);
|
|
@@ -1859,7 +1838,8 @@ DEBUGFS_READ_FILE_OPS(sensitivity);
|
|
|
DEBUGFS_READ_FILE_OPS(chain_noise);
|
|
|
DEBUGFS_READ_FILE_OPS(tx_power);
|
|
|
DEBUGFS_READ_FILE_OPS(power_save_status);
|
|
|
-DEBUGFS_WRITE_FILE_OPS(clear_statistics);
|
|
|
+DEBUGFS_WRITE_FILE_OPS(clear_ucode_statistics);
|
|
|
+DEBUGFS_WRITE_FILE_OPS(clear_traffic_statistics);
|
|
|
|
|
|
/*
|
|
|
* Create the debugfs files and directories
|
|
@@ -1908,7 +1888,8 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
|
|
|
DEBUGFS_ADD_FILE(tx_queue, debug);
|
|
|
DEBUGFS_ADD_FILE(tx_power, debug);
|
|
|
DEBUGFS_ADD_FILE(power_save_status, debug);
|
|
|
- DEBUGFS_ADD_FILE(clear_statistics, debug);
|
|
|
+ DEBUGFS_ADD_FILE(clear_ucode_statistics, debug);
|
|
|
+ DEBUGFS_ADD_FILE(clear_traffic_statistics, debug);
|
|
|
if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) {
|
|
|
DEBUGFS_ADD_FILE(ucode_rx_stats, debug);
|
|
|
DEBUGFS_ADD_FILE(ucode_tx_stats, debug);
|
|
@@ -1962,7 +1943,10 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv)
|
|
|
DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_tx_queue);
|
|
|
DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_tx_power);
|
|
|
DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_power_save_status);
|
|
|
- DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_clear_statistics);
|
|
|
+ DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.
|
|
|
+ file_clear_ucode_statistics);
|
|
|
+ DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.
|
|
|
+ file_clear_traffic_statistics);
|
|
|
if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) {
|
|
|
DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.
|
|
|
file_ucode_rx_stats);
|