linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	Emmanuel Grumbach <emmanuel.grumbach@intel.com>,
	Tomas Winkler <tomas.winkler@intel.com>
Subject: [PATCH 24/29] iwlwifi: retfactor get_temperature functions
Date: Thu, 12 Jun 2008 09:47:14 +0800	[thread overview]
Message-ID: <1213235239-2954-25-git-send-email-yi.zhu@intel.com> (raw)
In-Reply-To: <1213235239-2954-24-git-send-email-yi.zhu@intel.com>

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

This patch renames iwl4965_get_tempearture to iwl4965_hw_get_temperature
and replaces usage of original iwl4965_hw_get_temperature by
direct access to priv->temperature.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-4965.c     |   24 +++++++++---------------
 drivers/net/wireless/iwlwifi/iwl-core.h     |    1 -
 drivers/net/wireless/iwlwifi/iwl-dev.h      |    1 -
 drivers/net/wireless/iwlwifi/iwl4965-base.c |    2 +-
 4 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index aeb29b9..6e6038f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -47,6 +47,7 @@
 #include "iwl-sta.h"
 
 static int iwl4965_send_tx_power(struct iwl_priv *priv);
+static int iwl4965_hw_get_temperature(const struct iwl_priv *priv);
 
 /* module parameters */
 static struct iwl_mod_params iwl4965_mod_params = {
@@ -283,7 +284,7 @@ static void iwl4965_init_alive_start(struct iwl_priv *priv)
 	}
 
 	/* Calculate temperature */
-	priv->temperature = iwl4965_get_temperature(priv);
+	priv->temperature = iwl4965_hw_get_temperature(priv);
 
 	/* Send pointers to protocol/runtime uCode image ... init code will
 	 * load and launch runtime uCode, which will send us another "Alive"
@@ -1691,11 +1692,6 @@ static int iwl4965_shared_mem_rx_idx(struct iwl_priv *priv)
 	return le32_to_cpu(s->rb_closed) & 0xFFF;
 }
 
-int iwl4965_hw_get_temperature(struct iwl_priv *priv)
-{
-	return priv->temperature;
-}
-
 unsigned int iwl4965_hw_get_beacon_cmd(struct iwl_priv *priv,
 			  struct iwl_frame *frame, u8 rate)
 {
@@ -1793,12 +1789,12 @@ static s32 sign_extend(u32 oper, int index)
 }
 
 /**
- * iwl4965_get_temperature - return the calibrated temperature (in Kelvin)
+ * iwl4965_hw_get_temperature - return the calibrated temperature (in Kelvin)
  * @statistics: Provides the temperature reading from the uCode
  *
  * A return of <0 indicates bogus data in the statistics
  */
-int iwl4965_get_temperature(const struct iwl_priv *priv)
+static int iwl4965_hw_get_temperature(const struct iwl_priv *priv)
 {
 	s32 temperature;
 	s32 vt;
@@ -1833,8 +1829,7 @@ int iwl4965_get_temperature(const struct iwl_priv *priv)
 		vt = sign_extend(
 			le32_to_cpu(priv->statistics.general.temperature), 23);
 
-	IWL_DEBUG_TEMP("Calib values R[1-3]: %d %d %d R4: %d\n",
-		       R1, R2, R3, vt);
+	IWL_DEBUG_TEMP("Calib values R[1-3]: %d %d %d R4: %d\n", R1, R2, R3, vt);
 
 	if (R3 == R1) {
 		IWL_ERROR("Calibration conflict R1 == R3\n");
@@ -1845,11 +1840,10 @@ int iwl4965_get_temperature(const struct iwl_priv *priv)
 	 * Add offset to center the adjustment around 0 degrees Centigrade. */
 	temperature = TEMPERATURE_CALIB_A_VAL * (vt - R2);
 	temperature /= (R3 - R1);
-	temperature = (temperature * 97) / 100 +
-	    TEMPERATURE_CALIB_KELVIN_OFFSET;
+	temperature = (temperature * 97) / 100 + TEMPERATURE_CALIB_KELVIN_OFFSET;
 
-	IWL_DEBUG_TEMP("Calibrated temperature: %dK, %dC\n", temperature,
-	    KELVIN_TO_CELSIUS(temperature));
+	IWL_DEBUG_TEMP("Calibrated temperature: %dK, %dC\n",
+			temperature, KELVIN_TO_CELSIUS(temperature));
 
 	return temperature;
 }
@@ -1977,7 +1971,7 @@ void iwl4965_hw_rx_statistics(struct iwl_priv *priv,
 	if (!change)
 		return;
 
-	temp = iwl4965_get_temperature(priv);
+	temp = iwl4965_hw_get_temperature(priv);
 	if (temp < 0)
 		return;
 
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 59dd342..054ab7c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -359,7 +359,6 @@ static inline int iwl_is_ready_rf(struct iwl_priv *priv)
 	return iwl_is_ready(priv);
 }
 
-
 enum iwlcore_card_notify {
 	IWLCORE_INIT_EVT = 0,
 	IWLCORE_START_EVT = 1,
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index ef74159..7001854 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -643,7 +643,6 @@ extern void iwl4965_hw_cancel_deferred_work(struct iwl_priv *priv);
 extern int iwl4965_hw_set_hw_params(struct iwl_priv *priv);
 extern int iwl_rxq_stop(struct iwl_priv *priv);
 extern void iwl_txq_ctx_stop(struct iwl_priv *priv);
-extern int iwl4965_hw_get_temperature(struct iwl_priv *priv);
 extern unsigned int iwl4965_hw_get_beacon_cmd(struct iwl_priv *priv,
 				 struct iwl_frame *frame, u8 rate);
 extern void iwl4965_hw_build_tx_cmd_rate(struct iwl_priv *priv,
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 3717f99..14d4432 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -3867,7 +3867,7 @@ static ssize_t show_temperature(struct device *d,
 	if (!iwl_is_alive(priv))
 		return -EAGAIN;
 
-	return sprintf(buf, "%d\n", iwl4965_hw_get_temperature(priv));
+	return sprintf(buf, "%d\n", priv->temperature);
 }
 
 static DEVICE_ATTR(temperature, S_IRUGO, show_temperature, NULL);
-- 
1.5.3.6


  reply	other threads:[~2008-06-12  1:50 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-12  1:46 [PATCH 00/29] iwlwifi driver 06/12 updates Zhu Yi
2008-06-12  1:46 ` [PATCH 01/29] iwlwifi: removing IWL4965_HT config Zhu Yi
2008-06-12  1:46   ` [PATCH 02/29] iwlwifi: removes the RUN_TIME_CALIB ifdef Zhu Yi
2008-06-12  1:46     ` [PATCH 03/29] iwlwifi: clean up in setup/cancel deferred work Zhu Yi
2008-06-12  1:46       ` [PATCH 04/29] iwlwifi: add possibility to disable tx_power calibration Zhu Yi
2008-06-12  1:46         ` [PATCH 05/29] iwlwifi: map sw and hw ampdu queues Zhu Yi
2008-06-12  1:46           ` [PATCH 06/29] iwlwifi: add TX aggregation code for 5000 HW Zhu Yi
2008-06-12  1:46             ` [PATCH 07/29] iwlwifi: use ieee80211_conf to examine rate capabilities Zhu Yi
2008-06-12  1:46               ` [PATCH 08/29] iwlwifi: fix allow iwlwifi to aggregate according to tid load Zhu Yi
2008-06-12  1:46                 ` [PATCH 09/29] iwlwifi: remove unused flag Zhu Yi
2008-06-12  1:47                   ` [PATCH 10/29] iwlwifi: remove redundant flags regarding to FAT channel Zhu Yi
2008-06-12  1:47                     ` [PATCH 11/29] iwlwifi: fix bug when moving from 11gn to 11a or 11an to 11g Zhu Yi
2008-06-12  1:47                       ` [PATCH 12/29] iwlwifi: format log prints for easier parsing Zhu Yi
2008-06-12  1:47                         ` [PATCH 13/29] iwlwifi: fix resume SW RF-kill Zhu Yi
2008-06-12  1:47                           ` [PATCH 14/29] iwlwifi: fix resart flow after fw error Zhu Yi
2008-06-12  1:47                             ` [PATCH 15/29] iwlwifi enabling IBSS (Ad-Hoc) mode Zhu Yi
2008-06-12  1:47                               ` [PATCH 16/29] iwlwifi: Fix mode changes (ad-hoc <--> managed) Zhu Yi
2008-06-12  1:47                                 ` [PATCH 17/29] iwlwifi: refactor tx aggregation response flow Zhu Yi
2008-06-12  1:47                                   ` [PATCH 18/29] iwlwifi: refactor setting tx power Zhu Yi
2008-06-12  1:47                                     ` [PATCH 19/29] iwlwifi: add bad length check for WEP keys Zhu Yi
2008-06-12  1:47                                       ` [PATCH 20/29] iwlwifi: move scan to iwl-scan.c iwlcore Zhu Yi
2008-06-12  1:47                                         ` [PATCH 21/29] iwlwifi: move rate helpers to iwlcore Zhu Yi
2008-06-12  1:47                                           ` [PATCH 22/29] iwlwifi: cleans up scanning code Zhu Yi
2008-06-12  1:47                                             ` [PATCH 23/29] iwlwifi: move iwl4965_rf_kill_ct_config to iwl-core.c Zhu Yi
2008-06-12  1:47                                               ` Zhu Yi [this message]
2008-06-12  1:47                                                 ` [PATCH 25/29] iwlwifi: remove dead code iwl4965_calc_db_from_ratio Zhu Yi
2008-06-12  1:47                                                   ` [PATCH 26/29] mac80211 : fix for iwconfig in ad-hoc mode Zhu Yi
2008-06-12  1:47                                                     ` [PATCH 27/29] iwlwifi: fix software rf_kill problem when interface is down Zhu Yi
2008-06-12  1:47                                                       ` [PATCH 28/29] iwlwifi: general code clean up Zhu Yi
2008-06-12  1:47                                                         ` [PATCH 29/29] iwlwifi: remove iwlcore_low_level_notify Zhu Yi
2008-06-12  2:14                                                     ` [PATCH 26/29] mac80211 : fix for iwconfig in ad-hoc mode Dan Williams
2008-06-12  5:15 ` [PATCH 00/29] iwlwifi driver 06/12 updates Harvey Harrison
2008-06-12  5:26   ` Zhu Yi
2008-06-12 14:00     ` John W. Linville
2008-06-13  1:30       ` Zhu Yi

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=1213235239-2954-25-git-send-email-yi.zhu@intel.com \
    --to=yi.zhu@intel.com \
    --cc=emmanuel.grumbach@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=tomas.winkler@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;
as well as URLs for NNTP newsgroup(s).