return 1;
}
-static void iwl4965_temperature_calib(struct iwl_priv *priv,
- struct iwl_notif_statistics *stats)
+static void iwl4965_temperature_calib(struct iwl_priv *priv)
{
s32 temp;
- int change = ((priv->statistics.general.temperature !=
- stats->general.temperature) ||
- ((priv->statistics.flag &
- STATISTICS_REPLY_FLG_FAT_MODE_MSK) !=
- (stats->flag & STATISTICS_REPLY_FLG_FAT_MODE_MSK)));
-
- /* If the hardware hasn't reported a change in
- * temperature then don't bother computing a
- * calibrated temperature value */
- if (!change)
- return;
temp = iwl4965_hw_get_temperature(priv);
if (temp < 0)
NULL);
}
-static void iwl5000_temperature(struct iwl_priv *priv,
- struct iwl_notif_statistics *stats)
+static void iwl5000_temperature(struct iwl_priv *priv)
{
/* store temperature from statistics (in Celsius) */
- priv->temperature = le32_to_cpu(stats->general.temperature);
+ priv->temperature = le32_to_cpu(priv->statistics.general.temperature);
}
static struct iwl_hcmd_ops iwl5000_hcmd = {
int (*set_power)(struct iwl_priv *priv, void *cmd);
int (*send_tx_power) (struct iwl_priv *priv);
void (*update_chain_flags)(struct iwl_priv *priv);
- void (*temperature) (struct iwl_priv *priv,
- struct iwl_notif_statistics *stats);
+ void (*temperature) (struct iwl_priv *priv);
/* eeprom operations (as defined in iwl-eeprom.h) */
struct iwl_eeprom_ops eeprom_ops;
};
void iwl_rx_statistics(struct iwl_priv *priv,
struct iwl_rx_mem_buffer *rxb)
{
+ int change;
struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
IWL_DEBUG_RX("Statistics notification received (%d vs %d).\n",
(int)sizeof(priv->statistics), pkt->len);
+ change = ((priv->statistics.general.temperature !=
+ pkt->u.stats.general.temperature) ||
+ ((priv->statistics.flag &
+ STATISTICS_REPLY_FLG_FAT_MODE_MSK) !=
+ (pkt->u.stats.flag & STATISTICS_REPLY_FLG_FAT_MODE_MSK)));
+
memcpy(&priv->statistics, &pkt->u.stats, sizeof(priv->statistics));
set_bit(STATUS_STATISTICS, &priv->status);
iwl_leds_background(priv);
- if (priv->cfg->ops->lib->temperature)
- priv->cfg->ops->lib->temperature(priv, &pkt->u.stats);
+ if (priv->cfg->ops->lib->temperature && change)
+ priv->cfg->ops->lib->temperature(priv);
}
EXPORT_SYMBOL(iwl_rx_statistics);