From: Fry, Donald H Date: Fri, 25 Feb 2011 17:44:48 +0000 (-0800) Subject: iwlagn: report correct temperature for WiFi/BT devices. X-Git-Tag: firefly_0821_release~7613^2~967^2~16^2~578^2~77^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f8f79a5dbeb59a13a3f8101b24cbe19ec6e92d07;p=firefly-linux-kernel-4.4.55.git iwlagn: report correct temperature for WiFi/BT devices. The temperature reported by 'cat /sys/class/net/wlan?/device/temperature' is incorrect for devices with BT capability. Report the value from the correct statistics structure. Tested with 130, 100, 6205 and 5300. Signed-off-by: Don Fry Signed-off-by: Wey-Yi Guy --- diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index fd142bee9189..87a9fd8e41eb 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c @@ -533,9 +533,10 @@ int iwlagn_send_tx_power(struct iwl_priv *priv) void iwlagn_temperature(struct iwl_priv *priv) { - /* store temperature from statistics (in Celsius) */ - priv->temperature = - le32_to_cpu(priv->_agn.statistics.general.common.temperature); + /* store temperature from correct statistics (in Celsius) */ + priv->temperature = le32_to_cpu((iwl_bt_statistics(priv)) ? + priv->_agn.statistics_bt.general.common.temperature : + priv->_agn.statistics.general.common.temperature); iwl_tt_handler(priv); }