aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c14
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rx.c11
4 files changed, 13 insertions, 20 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index e4eab5196b7f..8c93f8d56a70 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -1879,21 +1879,9 @@ static int iwl4965_is_temp_calib_needed(struct iwl_priv *priv)
1879 return 1; 1879 return 1;
1880} 1880}
1881 1881
1882static void iwl4965_temperature_calib(struct iwl_priv *priv, 1882static void iwl4965_temperature_calib(struct iwl_priv *priv)
1883 struct iwl_notif_statistics *stats)
1884{ 1883{
1885 s32 temp; 1884 s32 temp;
1886 int change = ((priv->statistics.general.temperature !=
1887 stats->general.temperature) ||
1888 ((priv->statistics.flag &
1889 STATISTICS_REPLY_FLG_FAT_MODE_MSK) !=
1890 (stats->flag & STATISTICS_REPLY_FLG_FAT_MODE_MSK)));
1891
1892 /* If the hardware hasn't reported a change in
1893 * temperature then don't bother computing a
1894 * calibrated temperature value */
1895 if (!change)
1896 return;
1897 1885
1898 temp = iwl4965_hw_get_temperature(priv); 1886 temp = iwl4965_hw_get_temperature(priv);
1899 if (temp < 0) 1887 if (temp < 0)
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 1be6ca435f3d..7cc73e9a711c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -1422,11 +1422,10 @@ static int iwl5000_send_tx_power(struct iwl_priv *priv)
1422 NULL); 1422 NULL);
1423} 1423}
1424 1424
1425static void iwl5000_temperature(struct iwl_priv *priv, 1425static void iwl5000_temperature(struct iwl_priv *priv)
1426 struct iwl_notif_statistics *stats)
1427{ 1426{
1428 /* store temperature from statistics (in Celsius) */ 1427 /* store temperature from statistics (in Celsius) */
1429 priv->temperature = le32_to_cpu(stats->general.temperature); 1428 priv->temperature = le32_to_cpu(priv->statistics.general.temperature);
1430} 1429}
1431 1430
1432static struct iwl_hcmd_ops iwl5000_hcmd = { 1431static struct iwl_hcmd_ops iwl5000_hcmd = {
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index d7562c39dda7..eb4abe1ebbdb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -140,8 +140,7 @@ struct iwl_lib_ops {
140 int (*set_power)(struct iwl_priv *priv, void *cmd); 140 int (*set_power)(struct iwl_priv *priv, void *cmd);
141 int (*send_tx_power) (struct iwl_priv *priv); 141 int (*send_tx_power) (struct iwl_priv *priv);
142 void (*update_chain_flags)(struct iwl_priv *priv); 142 void (*update_chain_flags)(struct iwl_priv *priv);
143 void (*temperature) (struct iwl_priv *priv, 143 void (*temperature) (struct iwl_priv *priv);
144 struct iwl_notif_statistics *stats);
145 /* eeprom operations (as defined in iwl-eeprom.h) */ 144 /* eeprom operations (as defined in iwl-eeprom.h) */
146 struct iwl_eeprom_ops eeprom_ops; 145 struct iwl_eeprom_ops eeprom_ops;
147}; 146};
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
index 0c734fd529ac..3e8500ecf598 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
@@ -557,11 +557,18 @@ static void iwl_rx_calc_noise(struct iwl_priv *priv)
557void iwl_rx_statistics(struct iwl_priv *priv, 557void iwl_rx_statistics(struct iwl_priv *priv,
558 struct iwl_rx_mem_buffer *rxb) 558 struct iwl_rx_mem_buffer *rxb)
559{ 559{
560 int change;
560 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data; 561 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
561 562
562 IWL_DEBUG_RX("Statistics notification received (%d vs %d).\n", 563 IWL_DEBUG_RX("Statistics notification received (%d vs %d).\n",
563 (int)sizeof(priv->statistics), pkt->len); 564 (int)sizeof(priv->statistics), pkt->len);
564 565
566 change = ((priv->statistics.general.temperature !=
567 pkt->u.stats.general.temperature) ||
568 ((priv->statistics.flag &
569 STATISTICS_REPLY_FLG_FAT_MODE_MSK) !=
570 (pkt->u.stats.flag & STATISTICS_REPLY_FLG_FAT_MODE_MSK)));
571
565 memcpy(&priv->statistics, &pkt->u.stats, sizeof(priv->statistics)); 572 memcpy(&priv->statistics, &pkt->u.stats, sizeof(priv->statistics));
566 573
567 set_bit(STATUS_STATISTICS, &priv->status); 574 set_bit(STATUS_STATISTICS, &priv->status);
@@ -581,8 +588,8 @@ void iwl_rx_statistics(struct iwl_priv *priv,
581 588
582 iwl_leds_background(priv); 589 iwl_leds_background(priv);
583 590
584 if (priv->cfg->ops->lib->temperature) 591 if (priv->cfg->ops->lib->temperature && change)
585 priv->cfg->ops->lib->temperature(priv, &pkt->u.stats); 592 priv->cfg->ops->lib->temperature(priv);
586} 593}
587EXPORT_SYMBOL(iwl_rx_statistics); 594EXPORT_SYMBOL(iwl_rx_statistics);
588 595