From: Reinette Chatre <reinette.chatre@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
ipw3945-devel@lists.sourceforge.net,
Wey-Yi Guy <wey-yi.w.guy@intel.com>,
Reinette Chatre <reinette.chatre@intel.com>
Subject: [PATCH 05/14] iwlwifi: Thermal Throttling debugfs function
Date: Fri, 24 Jul 2009 11:13:04 -0700 [thread overview]
Message-ID: <1248459194-10239-6-git-send-email-reinette.chatre@intel.com> (raw)
In-Reply-To: <1248459194-10239-1-git-send-email-reinette.chatre@intel.com>
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
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>
---
drivers/net/wireless/iwlwifi/iwl-debug.h | 1 +
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 9faf0c2..609a681 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debug.h
+++ b/drivers/net/wireless/iwlwifi/iwl-debug.h
@@ -84,6 +84,7 @@ struct iwl_debugfs {
struct dentry *file_status;
struct dentry *file_interrupt;
struct dentry *file_qos;
+ struct dentry *file_thermal_throttling;
#ifdef CONFIG_IWLWIFI_LEDS
struct dentry *file_led;
#endif
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 0ab3463..748dc31 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,
}
#endif
+static ssize_t iwl_dbgfs_thermal_throttling_read(struct file *file,
+ char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
+ struct iwl_tt_mgmt *tt = &priv->power_data.tt;
+ struct iwl_tt_restriction *restriction;
+ char buf[100];
+ int pos = 0;
+ const size_t bufsz = sizeof(buf);
+ ssize_t ret;
+
+ pos += scnprintf(buf + pos, bufsz - pos,
+ "Thermal Throttling Mode: %s\n",
+ (priv->power_data.adv_tt)
+ ? "Advance" : "Legacy");
+ pos += scnprintf(buf + pos, bufsz - pos,
+ "Thermal Throttling State: %d\n",
+ tt->state);
+ if (priv->power_data.adv_tt) {
+ restriction = tt->restriction + tt->state;
+ pos += scnprintf(buf + pos, bufsz - pos,
+ "Tx mode: %d\n",
+ restriction->tx_stream);
+ pos += scnprintf(buf + pos, bufsz - pos,
+ "Rx mode: %d\n",
+ restriction->rx_stream);
+ pos += scnprintf(buf + pos, bufsz - pos,
+ "HT mode: %d\n",
+ restriction->is_ht);
+ }
+ ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
+ return ret;
+}
+
DEBUGFS_READ_WRITE_FILE_OPS(sram);
DEBUGFS_WRITE_FILE_OPS(log_event);
DEBUGFS_READ_FILE_OPS(nvm);
@@ -631,6 +666,7 @@ DEBUGFS_READ_FILE_OPS(qos);
#ifdef CONFIG_IWLWIFI_LEDS
DEBUGFS_READ_FILE_OPS(led);
#endif
+DEBUGFS_READ_FILE_OPS(thermal_throttling);
/*
* Create the debugfs files and directories
@@ -671,6 +707,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
#ifdef CONFIG_IWLWIFI_LEDS
DEBUGFS_ADD_FILE(led, data);
#endif
+ DEBUGFS_ADD_FILE(thermal_throttling, data);
DEBUGFS_ADD_BOOL(disable_sensitivity, rf, &priv->disable_sens_cal);
DEBUGFS_ADD_BOOL(disable_chain_noise, rf,
&priv->disable_chain_noise_cal);
@@ -709,6 +746,7 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv)
#ifdef CONFIG_IWLWIFI_LEDS
DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_led);
#endif
+ DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_thermal_throttling);
DEBUGFS_REMOVE(priv->dbgfs->dir_data);
DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_sensitivity);
DEBUGFS_REMOVE(priv->dbgfs->dbgfs_rf_files.file_disable_chain_noise);
--
1.5.6.3
next prev parent reply other threads:[~2009-07-24 18:13 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-24 18:12 [PATCH 0/14] iwlwifi driver updates 07/24/2009 Reinette Chatre
2009-07-24 18:13 ` [PATCH 01/14] iwlwifi: revert to active table when rate is not valid Reinette Chatre
2009-07-24 18:13 ` [PATCH 02/14] iwlwifi: critical temperature enter/exit condition Reinette Chatre
2009-07-24 18:13 ` [PATCH 03/14] iwlwifi: Thermal Throttling Management - Part 1 Reinette Chatre
2009-07-24 18:13 ` [PATCH 04/14] iwlwifi: Thermal Throttling Management - part 2 Reinette Chatre
2009-07-27 22:29 ` Johannes Berg
2009-07-27 22:46 ` reinette chatre
2009-07-28 7:33 ` Johannes Berg
2009-07-28 7:47 ` reinette chatre
2009-07-24 18:13 ` Reinette Chatre [this message]
2009-07-24 18:13 ` [PATCH 06/14] iwlwifi: fix up command sending Reinette Chatre
2009-07-24 18:13 ` [PATCH 07/14] iwlwifi: remove command callback return value Reinette Chatre
2009-07-24 18:13 ` [PATCH 08/14] iwlwifi: fix TX queue race Reinette Chatre
2009-07-24 18:13 ` [PATCH 09/14] iwlwifi: print packet contents in error case Reinette Chatre
2009-07-24 18:13 ` [PATCH 10/14] iwlwifi: Name fix for MPDU density for TX aggregation Reinette Chatre
2009-07-24 18:13 ` [PATCH 11/14] iwlwifi: fix LED config option Reinette Chatre
2009-07-24 18:13 ` [PATCH 12/14] iwlwifi: debugFs to enable/disable 40MHz channel support Reinette Chatre
2009-07-24 21:40 ` Gábor Stefanik
2009-07-25 17:24 ` Guy, Wey-Yi W
2009-07-24 18:13 ` [PATCH 13/14] iwlagn: fix null pointer access during ucode load on 1000 Reinette Chatre
2009-07-24 18:13 ` [PATCH 14/14] iwlagn: fix sparse warning when compiling without debug Reinette Chatre
2009-07-24 18:13 ` [PATCH v2.6.31] iwlwifi: fix TX queue race Reinette Chatre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1248459194-10239-6-git-send-email-reinette.chatre@intel.com \
--to=reinette.chatre@intel.com \
--cc=ipw3945-devel@lists.sourceforge.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=wey-yi.w.guy@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox