aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2010-06-24 16:18:36 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-07-02 14:10:57 -0400
commit4bf49a90bc0bda131ef353cca631025849f36b4e (patch)
treecb551f38ffeebe4457f42d22c3bfc593492ef4ca /drivers/net/wireless/iwlwifi
parent6555063666fea1fc81a14396aca53ab021ccb4f2 (diff)
iwlwifi: debugfs file for txfifo command testing
Add debugfs file for REPLY_TXFIFO_FLUSH host command testing. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 48f890883f4e..088a2c13f59b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -1495,6 +1495,30 @@ static ssize_t iwl_dbgfs_force_reset_write(struct file *file,
1495 return ret ? ret : count; 1495 return ret ? ret : count;
1496} 1496}
1497 1497
1498static ssize_t iwl_dbgfs_txfifo_flush_write(struct file *file,
1499 const char __user *user_buf,
1500 size_t count, loff_t *ppos) {
1501
1502 struct iwl_priv *priv = file->private_data;
1503 char buf[8];
1504 int buf_size;
1505 int flush;
1506
1507 memset(buf, 0, sizeof(buf));
1508 buf_size = min(count, sizeof(buf) - 1);
1509 if (copy_from_user(buf, user_buf, buf_size))
1510 return -EFAULT;
1511 if (sscanf(buf, "%d", &flush) != 1)
1512 return -EINVAL;
1513
1514 if (iwl_is_rfkill(priv))
1515 return -EFAULT;
1516
1517 priv->cfg->ops->lib->dev_txfifo_flush(priv, IWL_DROP_ALL);
1518
1519 return count;
1520}
1521
1498DEBUGFS_READ_FILE_OPS(rx_statistics); 1522DEBUGFS_READ_FILE_OPS(rx_statistics);
1499DEBUGFS_READ_FILE_OPS(tx_statistics); 1523DEBUGFS_READ_FILE_OPS(tx_statistics);
1500DEBUGFS_READ_WRITE_FILE_OPS(traffic_log); 1524DEBUGFS_READ_WRITE_FILE_OPS(traffic_log);
@@ -1516,6 +1540,7 @@ DEBUGFS_READ_WRITE_FILE_OPS(plcp_delta);
1516DEBUGFS_READ_WRITE_FILE_OPS(force_reset); 1540DEBUGFS_READ_WRITE_FILE_OPS(force_reset);
1517DEBUGFS_READ_FILE_OPS(rxon_flags); 1541DEBUGFS_READ_FILE_OPS(rxon_flags);
1518DEBUGFS_READ_FILE_OPS(rxon_filter_flags); 1542DEBUGFS_READ_FILE_OPS(rxon_filter_flags);
1543DEBUGFS_WRITE_FILE_OPS(txfifo_flush);
1519 1544
1520/* 1545/*
1521 * Create the debugfs files and directories 1546 * Create the debugfs files and directories
@@ -1574,6 +1599,8 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
1574 DEBUGFS_ADD_FILE(ucode_rx_stats, dir_debug, S_IRUSR); 1599 DEBUGFS_ADD_FILE(ucode_rx_stats, dir_debug, S_IRUSR);
1575 DEBUGFS_ADD_FILE(ucode_tx_stats, dir_debug, S_IRUSR); 1600 DEBUGFS_ADD_FILE(ucode_tx_stats, dir_debug, S_IRUSR);
1576 DEBUGFS_ADD_FILE(ucode_general_stats, dir_debug, S_IRUSR); 1601 DEBUGFS_ADD_FILE(ucode_general_stats, dir_debug, S_IRUSR);
1602 if (priv->cfg->ops->lib->dev_txfifo_flush)
1603 DEBUGFS_ADD_FILE(txfifo_flush, dir_debug, S_IWUSR);
1577 1604
1578 if (priv->cfg->sensitivity_calib_by_driver) 1605 if (priv->cfg->sensitivity_calib_by_driver)
1579 DEBUGFS_ADD_FILE(sensitivity, dir_debug, S_IRUSR); 1606 DEBUGFS_ADD_FILE(sensitivity, dir_debug, S_IRUSR);