* to improve the throughput.
*/
static bool iwl_good_plcp_health(struct iwl_priv *priv,
- struct iwl_rx_packet *pkt)
+ struct iwl_rx_packet *pkt, unsigned int msecs)
{
- unsigned int msecs;
- unsigned long stamp;
int delta;
int threshold = priv->cfg->base_params->plcp_delta_threshold;
return true;
}
- stamp = jiffies;
- msecs = jiffies_to_msecs(stamp - priv->plcp_jiffies);
- priv->plcp_jiffies = stamp;
-
- if (msecs == 0)
- return true;
-
if (iwl_bt_statistics(priv)) {
struct statistics_rx_bt *cur, *old;
struct iwl_rx_packet *pkt)
{
const struct iwl_mod_params *mod_params = priv->cfg->mod_params;
+ unsigned int msecs;
+ unsigned long stamp;
- if (test_bit(STATUS_EXIT_PENDING, &priv->status) ||
- !iwl_is_any_associated(priv))
+ if (test_bit(STATUS_EXIT_PENDING, &priv->status))
+ return;
+
+ stamp = jiffies;
+ msecs = jiffies_to_msecs(stamp - priv->rx_statistics_jiffies);
+
+ /* Only gather statistics and update time stamp when not associated */
+ if (!iwl_is_any_associated(priv))
+ goto out;
+
+ /* Do not check/recover when do not have enough statistics data */
+ if (msecs < 99)
return;
if (mod_params->ack_check && !iwl_good_ack_health(priv, pkt)) {
return;
}
- if (mod_params->plcp_check && !iwl_good_plcp_health(priv, pkt))
+ if (mod_params->plcp_check && !iwl_good_plcp_health(priv, pkt, msecs))
iwl_force_reset(priv, IWL_RF_RESET, false);
+
+out:
+ if (iwl_bt_statistics(priv))
+ memcpy(&priv->_agn.statistics_bt, &pkt->u.stats_bt,
+ sizeof(priv->_agn.statistics_bt));
+ else
+ memcpy(&priv->_agn.statistics, &pkt->u.stats,
+ sizeof(priv->_agn.statistics));
+
+ priv->rx_statistics_jiffies = stamp;
}
/* Calculate noise level, based on measurements during network silence just
iwl_recover_from_statistics(priv, pkt);
- if (iwl_bt_statistics(priv))
- memcpy(&priv->_agn.statistics_bt, &pkt->u.stats_bt,
- sizeof(priv->_agn.statistics_bt));
- else
- memcpy(&priv->_agn.statistics, &pkt->u.stats,
- sizeof(priv->_agn.statistics));
-
set_bit(STATUS_STATISTICS, &priv->status);
/* Reschedule the statistics timer to occur in