aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-07-09 13:33:36 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-24 15:05:09 -0400
commitf5ad69fa47e7b204d0032d569812544cd9a351fb (patch)
treeeb6f34d9642f93b681128b8e706304466cd5feaf /drivers/net/wireless/iwlwifi
parent80e5b06a1b0d9a6aa88dc5c9e93ba49510c52b45 (diff)
iwlwifi: move show_qos to debugfs
This move the show_qos file from sysfs to debugfs because the "one value per file" sysfs rule. The file is located in /sys/kernel/debug/ieee80211/phy0/iwlagn/data 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')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c21
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debug.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c25
3 files changed, 26 insertions, 21 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index e2cc5994d10..ad5002211ab 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2627,26 +2627,6 @@ static ssize_t show_power_level(struct device *d,
2627static DEVICE_ATTR(power_level, S_IWUSR | S_IRUSR, show_power_level, 2627static DEVICE_ATTR(power_level, S_IWUSR | S_IRUSR, show_power_level,
2628 store_power_level); 2628 store_power_level);
2629 2629
2630static ssize_t show_qos(struct device *d,
2631 struct device_attribute *attr, char *buf)
2632{
2633 struct iwl_priv *priv = dev_get_drvdata(d);
2634 char *p = buf;
2635 int q;
2636
2637 for (q = 0; q < AC_NUM; q++) {
2638 p += sprintf(p, "\tcw_min\tcw_max\taifsn\ttxop\n");
2639 p += sprintf(p, "AC[%d]\t%u\t%u\t%u\t%u\n", q,
2640 priv->qos_data.def_qos_parm.ac[q].cw_min,
2641 priv->qos_data.def_qos_parm.ac[q].cw_max,
2642 priv->qos_data.def_qos_parm.ac[q].aifsn,
2643 priv->qos_data.def_qos_parm.ac[q].edca_txop);
2644 }
2645
2646 return p - buf + 1;
2647}
2648
2649static DEVICE_ATTR(qos, S_IRUGO, show_qos, NULL);
2650 2630
2651static ssize_t show_statistics(struct device *d, 2631static ssize_t show_statistics(struct device *d,
2652 struct device_attribute *attr, char *buf) 2632 struct device_attribute *attr, char *buf)
@@ -2747,7 +2727,6 @@ static struct attribute *iwl_sysfs_entries[] = {
2747 &dev_attr_debug_level.attr, 2727 &dev_attr_debug_level.attr,
2748#endif 2728#endif
2749 &dev_attr_version.attr, 2729 &dev_attr_version.attr,
2750 &dev_attr_qos.attr,
2751 NULL 2730 NULL
2752}; 2731};
2753 2732
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h
index 65bbce0f171..1555676fc51 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debug.h
+++ b/drivers/net/wireless/iwlwifi/iwl-debug.h
@@ -82,6 +82,7 @@ struct iwl_debugfs {
82 struct dentry *file_channels; 82 struct dentry *file_channels;
83 struct dentry *file_status; 83 struct dentry *file_status;
84 struct dentry *file_interrupt; 84 struct dentry *file_interrupt;
85 struct dentry *file_qos;
85 } dbgfs_data_files; 86 } dbgfs_data_files;
86 struct dir_rf_files { 87 struct dir_rf_files {
87 struct dentry *file_disable_sensitivity; 88 struct dentry *file_disable_sensitivity;
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index f32ac74b69a..e38ec81b839 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -566,6 +566,28 @@ static ssize_t iwl_dbgfs_interrupt_write(struct file *file,
566 return count; 566 return count;
567} 567}
568 568
569static ssize_t iwl_dbgfs_qos_read(struct file *file, char __user *user_buf,
570 size_t count, loff_t *ppos)
571{
572 struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
573 int pos = 0, i;
574 char buf[256];
575 const size_t bufsz = sizeof(buf);
576 ssize_t ret;
577
578 for (i = 0; i < AC_NUM; i++) {
579 pos += scnprintf(buf + pos, bufsz - pos,
580 "\tcw_min\tcw_max\taifsn\ttxop\n");
581 pos += scnprintf(buf + pos, bufsz - pos,
582 "AC[%d]\t%u\t%u\t%u\t%u\n", i,
583 priv->qos_data.def_qos_parm.ac[i].cw_min,
584 priv->qos_data.def_qos_parm.ac[i].cw_max,
585 priv->qos_data.def_qos_parm.ac[i].aifsn,
586 priv->qos_data.def_qos_parm.ac[i].edca_txop);
587 }
588 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
589 return ret;
590}
569 591
570DEBUGFS_READ_WRITE_FILE_OPS(sram); 592DEBUGFS_READ_WRITE_FILE_OPS(sram);
571DEBUGFS_WRITE_FILE_OPS(log_event); 593DEBUGFS_WRITE_FILE_OPS(log_event);
@@ -576,6 +598,7 @@ DEBUGFS_READ_FILE_OPS(tx_statistics);
576DEBUGFS_READ_FILE_OPS(channels); 598DEBUGFS_READ_FILE_OPS(channels);
577DEBUGFS_READ_FILE_OPS(status); 599DEBUGFS_READ_FILE_OPS(status);
578DEBUGFS_READ_WRITE_FILE_OPS(interrupt); 600DEBUGFS_READ_WRITE_FILE_OPS(interrupt);
601DEBUGFS_READ_FILE_OPS(qos);
579 602
580/* 603/*
581 * Create the debugfs files and directories 604 * Create the debugfs files and directories
@@ -612,6 +635,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
612 DEBUGFS_ADD_FILE(channels, data); 635 DEBUGFS_ADD_FILE(channels, data);
613 DEBUGFS_ADD_FILE(status, data); 636 DEBUGFS_ADD_FILE(status, data);
614 DEBUGFS_ADD_FILE(interrupt, data); 637 DEBUGFS_ADD_FILE(interrupt, data);
638 DEBUGFS_ADD_FILE(qos, data);
615 DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal); 639 DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal);
616 DEBUGFS_ADD_BOOL(disable_chain_noise, rf, 640 DEBUGFS_ADD_BOOL(disable_chain_noise, rf,
617 &priv->disable_chain_noise_cal); 641 &priv->disable_chain_noise_cal);
@@ -646,6 +670,7 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv)
646 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_channels); 670 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_channels);
647 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_status); 671 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_status);
648 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_interrupt); 672 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_interrupt);
673 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_qos);
649 DEBUGFS_REMOVE(priv->dbgfs->dir_data); 674 DEBUGFS_REMOVE(priv->dbgfs->dir_data);
650 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity); 675 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity);
651 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise); 676 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise);