aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-debugfs.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-07-17 12:30:19 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-24 15:05:24 -0400
commita283c0116b0cc5e82327e50ad4d05f6d4d42c603 (patch)
treec49a656810495162e85bba2887874f944df2faf6 /drivers/net/wireless/iwlwifi/iwl-debugfs.c
parent2d1bb9e58c2b13df13741d1efe1129cf1098405d (diff)
iwlwifi: add led debugfs function
Adding debugfs file to show current led blinking rate /sys/kernel/debug/ieee80211/phy0/iwlagn/data/led 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.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 0b9e824b67c2..0ab3463aa07e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -591,6 +591,33 @@ static ssize_t iwl_dbgfs_qos_read(struct file *file, char __user *user_buf,
591 return ret; 591 return ret;
592} 592}
593 593
594#ifdef CONFIG_IWLWIFI_LEDS
595static ssize_t iwl_dbgfs_led_read(struct file *file, char __user *user_buf,
596 size_t count, loff_t *ppos)
597{
598 struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
599 int pos = 0;
600 char buf[256];
601 const size_t bufsz = sizeof(buf);
602 ssize_t ret;
603
604 pos += scnprintf(buf + pos, bufsz - pos,
605 "allow blinking: %s\n",
606 (priv->allow_blinking) ? "True" : "False");
607 if (priv->allow_blinking) {
608 pos += scnprintf(buf + pos, bufsz - pos,
609 "Led blinking rate: %u\n",
610 priv->last_blink_rate);
611 pos += scnprintf(buf + pos, bufsz - pos,
612 "Last blink time: %lu\n",
613 priv->last_blink_time);
614 }
615
616 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
617 return ret;
618}
619#endif
620
594DEBUGFS_READ_WRITE_FILE_OPS(sram); 621DEBUGFS_READ_WRITE_FILE_OPS(sram);
595DEBUGFS_WRITE_FILE_OPS(log_event); 622DEBUGFS_WRITE_FILE_OPS(log_event);
596DEBUGFS_READ_FILE_OPS(nvm); 623DEBUGFS_READ_FILE_OPS(nvm);
@@ -601,6 +628,9 @@ DEBUGFS_READ_FILE_OPS(channels);
601DEBUGFS_READ_FILE_OPS(status); 628DEBUGFS_READ_FILE_OPS(status);
602DEBUGFS_READ_WRITE_FILE_OPS(interrupt); 629DEBUGFS_READ_WRITE_FILE_OPS(interrupt);
603DEBUGFS_READ_FILE_OPS(qos); 630DEBUGFS_READ_FILE_OPS(qos);
631#ifdef CONFIG_IWLWIFI_LEDS
632DEBUGFS_READ_FILE_OPS(led);
633#endif
604 634
605/* 635/*
606 * Create the debugfs files and directories 636 * Create the debugfs files and directories
@@ -638,6 +668,9 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
638 DEBUGFS_ADD_FILE(status, data); 668 DEBUGFS_ADD_FILE(status, data);
639 DEBUGFS_ADD_FILE(interrupt, data); 669 DEBUGFS_ADD_FILE(interrupt, data);
640 DEBUGFS_ADD_FILE(qos, data); 670 DEBUGFS_ADD_FILE(qos, data);
671#ifdef CONFIG_IWLWIFI_LEDS
672 DEBUGFS_ADD_FILE(led, data);
673#endif
641 DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal); 674 DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal);
642 DEBUGFS_ADD_BOOL(disable_chain_noise, rf, 675 DEBUGFS_ADD_BOOL(disable_chain_noise, rf,
643 &priv->disable_chain_noise_cal); 676 &priv->disable_chain_noise_cal);
@@ -673,6 +706,9 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv)
673 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_status); 706 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_status);
674 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_interrupt); 707 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_interrupt);
675 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_qos); 708 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_qos);
709#ifdef CONFIG_IWLWIFI_LEDS
710 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_led);
711#endif
676 DEBUGFS_REMOVE(priv->dbgfs->dir_data); 712 DEBUGFS_REMOVE(priv->dbgfs->dir_data);
677 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity); 713 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity);
678 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise); 714 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise);