diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2009-07-24 14:13:04 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-27 15:24:21 -0400 |
commit | fbf3a2af3834e8e93e9c2876de62c5b49988e352 (patch) | |
tree | a779c1b929c9a6df73b09ae7b333a860c705767a /drivers/net/wireless | |
parent | 46f9381aa3fb62f6a141bfd41dcbeda1ec5fa26e (diff) |
iwlwifi: Thermal Throttling debugfs function
Add debugfs function to display current thermal throttling status for
both Legacy and Advance Thermal Throttling Management
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')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debug.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 38 |
2 files changed, 39 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h index 9faf0c2ff608..609a68184dba 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debug.h +++ b/drivers/net/wireless/iwlwifi/iwl-debug.h | |||
@@ -84,6 +84,7 @@ struct iwl_debugfs { | |||
84 | struct dentry *file_status; | 84 | struct dentry *file_status; |
85 | struct dentry *file_interrupt; | 85 | struct dentry *file_interrupt; |
86 | struct dentry *file_qos; | 86 | struct dentry *file_qos; |
87 | struct dentry *file_thermal_throttling; | ||
87 | #ifdef CONFIG_IWLWIFI_LEDS | 88 | #ifdef CONFIG_IWLWIFI_LEDS |
88 | struct dentry *file_led; | 89 | struct dentry *file_led; |
89 | #endif | 90 | #endif |
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index 0ab3463aa07e..748dc31877bc 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -618,6 +618,41 @@ static ssize_t iwl_dbgfs_led_read(struct file *file, char __user *user_buf, | |||
618 | } | 618 | } |
619 | #endif | 619 | #endif |
620 | 620 | ||
621 | static ssize_t iwl_dbgfs_thermal_throttling_read(struct file *file, | ||
622 | char __user *user_buf, | ||
623 | size_t count, loff_t *ppos) | ||
624 | { | ||
625 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | ||
626 | struct iwl_tt_mgmt *tt = &priv->power_data.tt; | ||
627 | struct iwl_tt_restriction *restriction; | ||
628 | char buf[100]; | ||
629 | int pos = 0; | ||
630 | const size_t bufsz = sizeof(buf); | ||
631 | ssize_t ret; | ||
632 | |||
633 | pos += scnprintf(buf + pos, bufsz - pos, | ||
634 | "Thermal Throttling Mode: %s\n", | ||
635 | (priv->power_data.adv_tt) | ||
636 | ? "Advance" : "Legacy"); | ||
637 | pos += scnprintf(buf + pos, bufsz - pos, | ||
638 | "Thermal Throttling State: %d\n", | ||
639 | tt->state); | ||
640 | if (priv->power_data.adv_tt) { | ||
641 | restriction = tt->restriction + tt->state; | ||
642 | pos += scnprintf(buf + pos, bufsz - pos, | ||
643 | "Tx mode: %d\n", | ||
644 | restriction->tx_stream); | ||
645 | pos += scnprintf(buf + pos, bufsz - pos, | ||
646 | "Rx mode: %d\n", | ||
647 | restriction->rx_stream); | ||
648 | pos += scnprintf(buf + pos, bufsz - pos, | ||
649 | "HT mode: %d\n", | ||
650 | restriction->is_ht); | ||
651 | } | ||
652 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | ||
653 | return ret; | ||
654 | } | ||
655 | |||
621 | DEBUGFS_READ_WRITE_FILE_OPS(sram); | 656 | DEBUGFS_READ_WRITE_FILE_OPS(sram); |
622 | DEBUGFS_WRITE_FILE_OPS(log_event); | 657 | DEBUGFS_WRITE_FILE_OPS(log_event); |
623 | DEBUGFS_READ_FILE_OPS(nvm); | 658 | DEBUGFS_READ_FILE_OPS(nvm); |
@@ -631,6 +666,7 @@ DEBUGFS_READ_FILE_OPS(qos); | |||
631 | #ifdef CONFIG_IWLWIFI_LEDS | 666 | #ifdef CONFIG_IWLWIFI_LEDS |
632 | DEBUGFS_READ_FILE_OPS(led); | 667 | DEBUGFS_READ_FILE_OPS(led); |
633 | #endif | 668 | #endif |
669 | DEBUGFS_READ_FILE_OPS(thermal_throttling); | ||
634 | 670 | ||
635 | /* | 671 | /* |
636 | * Create the debugfs files and directories | 672 | * Create the debugfs files and directories |
@@ -671,6 +707,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
671 | #ifdef CONFIG_IWLWIFI_LEDS | 707 | #ifdef CONFIG_IWLWIFI_LEDS |
672 | DEBUGFS_ADD_FILE(led, data); | 708 | DEBUGFS_ADD_FILE(led, data); |
673 | #endif | 709 | #endif |
710 | DEBUGFS_ADD_FILE(thermal_throttling, data); | ||
674 | DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal); | 711 | DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal); |
675 | DEBUGFS_ADD_BOOL(disable_chain_noise, rf, | 712 | DEBUGFS_ADD_BOOL(disable_chain_noise, rf, |
676 | &priv->disable_chain_noise_cal); | 713 | &priv->disable_chain_noise_cal); |
@@ -709,6 +746,7 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv) | |||
709 | #ifdef CONFIG_IWLWIFI_LEDS | 746 | #ifdef CONFIG_IWLWIFI_LEDS |
710 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_led); | 747 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_led); |
711 | #endif | 748 | #endif |
749 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_thermal_throttling); | ||
712 | DEBUGFS_REMOVE(priv->dbgfs->dir_data); | 750 | DEBUGFS_REMOVE(priv->dbgfs->dir_data); |
713 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity); | 751 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity); |
714 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise); | 752 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise); |