aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorBen Cahill <ben.m.cahill@intel.com>2007-11-28 22:10:01 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:05:27 -0500
commit5991b419f04dee78c36d43de6b6ff2d27934d707 (patch)
tree968a0b30866ee3f4ac28895bfaf13cc8be328c50 /drivers/net/wireless/iwlwifi
parentfcd427bbba10fc315d1c958b85bba74448db4eb4 (diff)
iwlwifi: document temperature calculation
Document temperature calculation Signed-off-by: Ben Cahill <ben.m.cahill@intel.com> Signed-off-by: Zhu Yi <yi.zhu@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-4965-hw.h57
1 files changed, 46 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
index 3c09225c6623..78d9854f7506 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
@@ -645,21 +645,43 @@ static inline int iwl4965_hw_valid_rtc_data_addr(u32 addr)
645 (addr < KDR_RTC_DATA_UPPER_BOUND); 645 (addr < KDR_RTC_DATA_UPPER_BOUND);
646} 646}
647 647
648/********************* START TXPOWER *****************************************/ 648/********************* START TEMPERATURE *************************************/
649
650enum {
651 CALIB_CH_GROUP_1 = 0,
652 CALIB_CH_GROUP_2 = 1,
653 CALIB_CH_GROUP_3 = 2,
654 CALIB_CH_GROUP_4 = 3,
655 CALIB_CH_GROUP_5 = 4,
656 CALIB_CH_GROUP_MAX
657};
658 649
659/* Temperature calibration offset is 3% 0C in Kelvin */ 650/*
651 * 4965 temperature calculation.
652 *
653 * The driver must calculate the device temperature before calculating
654 * a txpower setting (amplifier gain is temperature dependent). The
655 * calculation uses 4 measurements, 3 of which (R1, R2, R3) are calibration
656 * values used for the life of the driver, and one of which (R4) is the
657 * real-time temperature indicator.
658 *
659 * uCode provides all 4 values to the driver via the "initialize alive"
660 * notification (see struct iwl4965_init_alive_resp). After the runtime uCode
661 * image loads, uCode updates the R4 value via statistics notifications
662 * (see STATISTICS_NOTIFICATION), which occur after each received beacon
663 * when associated, or can be requested via REPLY_STATISTICS_CMD.
664 *
665 * NOTE: uCode provides the R4 value as a 23-bit signed value. Driver
666 * must sign-extend to 32 bits before applying formula below.
667 *
668 * Formula:
669 *
670 * degrees Kelvin = ((97 * 259 * (R4 - R2) / (R3 - R1)) / 100) + 8
671 *
672 * NOTE: The basic formula is 259 * (R4-R2) / (R3-R1). The 97/100 is
673 * an additional correction, which should be centered around 0 degrees
674 * Celsius (273 degrees Kelvin). The 8 (3 percent of 273) compensates for
675 * centering the 97/100 correction around 0 degrees K.
676 *
677 * Add 273 to Kelvin value to find degrees Celsius, for comparing current
678 * temperature with factory-measured temperatures when calculating txpower
679 * settings.
680 */
660#define TEMPERATURE_CALIB_KELVIN_OFFSET 8 681#define TEMPERATURE_CALIB_KELVIN_OFFSET 8
661#define TEMPERATURE_CALIB_A_VAL 259 682#define TEMPERATURE_CALIB_A_VAL 259
662 683
684/* Limit range of calculated temperature to be between these Kelvin values */
663#define IWL_TX_POWER_TEMPERATURE_MIN (263) 685#define IWL_TX_POWER_TEMPERATURE_MIN (263)
664#define IWL_TX_POWER_TEMPERATURE_MAX (410) 686#define IWL_TX_POWER_TEMPERATURE_MAX (410)
665 687
@@ -667,6 +689,19 @@ enum {
667 (((t) < IWL_TX_POWER_TEMPERATURE_MIN) || \ 689 (((t) < IWL_TX_POWER_TEMPERATURE_MIN) || \
668 ((t) > IWL_TX_POWER_TEMPERATURE_MAX)) 690 ((t) > IWL_TX_POWER_TEMPERATURE_MAX))
669 691
692/********************* END TEMPERATURE ***************************************/
693
694/********************* START TXPOWER *****************************************/
695
696enum {
697 CALIB_CH_GROUP_1 = 0,
698 CALIB_CH_GROUP_2 = 1,
699 CALIB_CH_GROUP_3 = 2,
700 CALIB_CH_GROUP_4 = 3,
701 CALIB_CH_GROUP_5 = 4,
702 CALIB_CH_GROUP_MAX
703};
704
670#define IWL_TX_POWER_MIMO_REGULATORY_COMPENSATION (6) 705#define IWL_TX_POWER_MIMO_REGULATORY_COMPENSATION (6)
671 706
672#define IWL_TX_POWER_TARGET_POWER_MIN (0) /* 0 dBm = 1 milliwatt */ 707#define IWL_TX_POWER_TARGET_POWER_MIN (0) /* 0 dBm = 1 milliwatt */