Commit ab5c0f1f authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

iwlwifi: keep plcp_delta_threshold in priv

The base_params shouldn't be writable, so keep
a copy of this in priv that can be modified.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 3cc241ad
...@@ -320,7 +320,7 @@ static bool iwlagn_good_plcp_health(struct iwl_priv *priv, ...@@ -320,7 +320,7 @@ static bool iwlagn_good_plcp_health(struct iwl_priv *priv,
unsigned int msecs) unsigned int msecs)
{ {
int delta; int delta;
int threshold = cfg(priv)->base_params->plcp_delta_threshold; int threshold = priv->plcp_delta_threshold;
if (threshold == IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE) { if (threshold == IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE) {
IWL_DEBUG_RADIO(priv, "plcp_err check disabled\n"); IWL_DEBUG_RADIO(priv, "plcp_err check disabled\n");
......
...@@ -1045,6 +1045,9 @@ static int iwl_init_drv(struct iwl_priv *priv) ...@@ -1045,6 +1045,9 @@ static int iwl_init_drv(struct iwl_priv *priv)
priv->ieee_rates = NULL; priv->ieee_rates = NULL;
priv->band = IEEE80211_BAND_2GHZ; priv->band = IEEE80211_BAND_2GHZ;
priv->plcp_delta_threshold =
cfg(priv)->base_params->plcp_delta_threshold;
priv->iw_mode = NL80211_IFTYPE_STATION; priv->iw_mode = NL80211_IFTYPE_STATION;
priv->current_ht_config.smps = IEEE80211_SMPS_STATIC; priv->current_ht_config.smps = IEEE80211_SMPS_STATIC;
priv->missed_beacon_threshold = IWL_MISSED_BEACON_THRESHOLD_DEF; priv->missed_beacon_threshold = IWL_MISSED_BEACON_THRESHOLD_DEF;
......
...@@ -2241,7 +2241,7 @@ static ssize_t iwl_dbgfs_plcp_delta_read(struct file *file, ...@@ -2241,7 +2241,7 @@ static ssize_t iwl_dbgfs_plcp_delta_read(struct file *file,
const size_t bufsz = sizeof(buf); const size_t bufsz = sizeof(buf);
pos += scnprintf(buf + pos, bufsz - pos, "%u\n", pos += scnprintf(buf + pos, bufsz - pos, "%u\n",
cfg(priv)->base_params->plcp_delta_threshold); priv->plcp_delta_threshold);
return simple_read_from_buffer(user_buf, count, ppos, buf, pos); return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
} }
...@@ -2263,10 +2263,10 @@ static ssize_t iwl_dbgfs_plcp_delta_write(struct file *file, ...@@ -2263,10 +2263,10 @@ static ssize_t iwl_dbgfs_plcp_delta_write(struct file *file,
return -EINVAL; return -EINVAL;
if ((plcp < IWL_MAX_PLCP_ERR_THRESHOLD_MIN) || if ((plcp < IWL_MAX_PLCP_ERR_THRESHOLD_MIN) ||
(plcp > IWL_MAX_PLCP_ERR_THRESHOLD_MAX)) (plcp > IWL_MAX_PLCP_ERR_THRESHOLD_MAX))
cfg(priv)->base_params->plcp_delta_threshold = priv->plcp_delta_threshold =
IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE; IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE;
else else
cfg(priv)->base_params->plcp_delta_threshold = plcp; priv->plcp_delta_threshold = plcp;
return count; return count;
} }
......
...@@ -770,6 +770,8 @@ struct iwl_priv { ...@@ -770,6 +770,8 @@ struct iwl_priv {
struct iwl_channel_info *channel_info; /* channel info array */ struct iwl_channel_info *channel_info; /* channel info array */
u8 channel_count; /* # of channels */ u8 channel_count; /* # of channels */
u8 plcp_delta_threshold;
/* thermal calibration */ /* thermal calibration */
s32 temperature; /* Celsius */ s32 temperature; /* Celsius */
s32 last_temperature; s32 last_temperature;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment