提交 678b385d 编写于 作者: W Wey-Yi Guy 提交者: Reinette Chatre

iwlwifi: default max event log size

Size of event log is determined by uCode which is different per NICs.
Set the maximum event log size per device to better match uCode
configuration.
Signed-off-by: NWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: NReinette Chatre <reinette.chatre@intel.com>
上级 ace5d5de
...@@ -253,6 +253,7 @@ struct iwl_cfg iwl1000_bgn_cfg = { ...@@ -253,6 +253,7 @@ struct iwl_cfg iwl1000_bgn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF, .plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000, .chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 128,
}; };
struct iwl_cfg iwl1000_bg_cfg = { struct iwl_cfg iwl1000_bg_cfg = {
...@@ -282,6 +283,7 @@ struct iwl_cfg iwl1000_bg_cfg = { ...@@ -282,6 +283,7 @@ struct iwl_cfg iwl1000_bg_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF, .plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000, .chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 128,
}; };
MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX)); MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX));
...@@ -2770,6 +2770,7 @@ static struct iwl_cfg iwl3945_bg_cfg = { ...@@ -2770,6 +2770,7 @@ static struct iwl_cfg iwl3945_bg_cfg = {
.broken_powersave = true, .broken_powersave = true,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 512,
}; };
static struct iwl_cfg iwl3945_abg_cfg = { static struct iwl_cfg iwl3945_abg_cfg = {
...@@ -2789,6 +2790,7 @@ static struct iwl_cfg iwl3945_abg_cfg = { ...@@ -2789,6 +2790,7 @@ static struct iwl_cfg iwl3945_abg_cfg = {
.broken_powersave = true, .broken_powersave = true,
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 512,
}; };
DEFINE_PCI_DEVICE_TABLE(iwl3945_hw_card_ids) = { DEFINE_PCI_DEVICE_TABLE(iwl3945_hw_card_ids) = {
......
...@@ -2250,6 +2250,7 @@ struct iwl_cfg iwl4965_agn_cfg = { ...@@ -2250,6 +2250,7 @@ struct iwl_cfg iwl4965_agn_cfg = {
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.temperature_kelvin = true, .temperature_kelvin = true,
.off_channel_workaround = true, .off_channel_workaround = true,
.max_event_log_size = 512,
}; };
/* Module firmware */ /* Module firmware */
......
...@@ -423,6 +423,7 @@ struct iwl_cfg iwl5300_agn_cfg = { ...@@ -423,6 +423,7 @@ struct iwl_cfg iwl5300_agn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000, .chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 512,
}; };
struct iwl_cfg iwl5100_bgn_cfg = { struct iwl_cfg iwl5100_bgn_cfg = {
...@@ -450,6 +451,7 @@ struct iwl_cfg iwl5100_bgn_cfg = { ...@@ -450,6 +451,7 @@ struct iwl_cfg iwl5100_bgn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000, .chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 512,
}; };
struct iwl_cfg iwl5100_abg_cfg = { struct iwl_cfg iwl5100_abg_cfg = {
...@@ -475,6 +477,7 @@ struct iwl_cfg iwl5100_abg_cfg = { ...@@ -475,6 +477,7 @@ struct iwl_cfg iwl5100_abg_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000, .chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 512,
}; };
struct iwl_cfg iwl5100_agn_cfg = { struct iwl_cfg iwl5100_agn_cfg = {
...@@ -502,6 +505,7 @@ struct iwl_cfg iwl5100_agn_cfg = { ...@@ -502,6 +505,7 @@ struct iwl_cfg iwl5100_agn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000, .chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 512,
}; };
struct iwl_cfg iwl5350_agn_cfg = { struct iwl_cfg iwl5350_agn_cfg = {
...@@ -529,6 +533,7 @@ struct iwl_cfg iwl5350_agn_cfg = { ...@@ -529,6 +533,7 @@ struct iwl_cfg iwl5350_agn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000, .chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 512,
}; };
struct iwl_cfg iwl5150_agn_cfg = { struct iwl_cfg iwl5150_agn_cfg = {
...@@ -556,6 +561,7 @@ struct iwl_cfg iwl5150_agn_cfg = { ...@@ -556,6 +561,7 @@ struct iwl_cfg iwl5150_agn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000, .chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 512,
}; };
struct iwl_cfg iwl5150_abg_cfg = { struct iwl_cfg iwl5150_abg_cfg = {
...@@ -581,6 +587,7 @@ struct iwl_cfg iwl5150_abg_cfg = { ...@@ -581,6 +587,7 @@ struct iwl_cfg iwl5150_abg_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
.chain_noise_scale = 1000, .chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 512,
}; };
MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX)); MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));
......
...@@ -394,6 +394,7 @@ struct iwl_cfg iwl6000i_g2_2agn_cfg = { ...@@ -394,6 +394,7 @@ struct iwl_cfg iwl6000i_g2_2agn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000, .chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 1024,
}; };
struct iwl_cfg iwl6000i_2agn_cfg = { struct iwl_cfg iwl6000i_2agn_cfg = {
...@@ -427,6 +428,7 @@ struct iwl_cfg iwl6000i_2agn_cfg = { ...@@ -427,6 +428,7 @@ struct iwl_cfg iwl6000i_2agn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000, .chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 1024,
}; };
struct iwl_cfg iwl6000i_2abg_cfg = { struct iwl_cfg iwl6000i_2abg_cfg = {
...@@ -459,6 +461,7 @@ struct iwl_cfg iwl6000i_2abg_cfg = { ...@@ -459,6 +461,7 @@ struct iwl_cfg iwl6000i_2abg_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000, .chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 1024,
}; };
struct iwl_cfg iwl6000i_2bg_cfg = { struct iwl_cfg iwl6000i_2bg_cfg = {
...@@ -491,6 +494,7 @@ struct iwl_cfg iwl6000i_2bg_cfg = { ...@@ -491,6 +494,7 @@ struct iwl_cfg iwl6000i_2bg_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000, .chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 1024,
}; };
struct iwl_cfg iwl6050_2agn_cfg = { struct iwl_cfg iwl6050_2agn_cfg = {
...@@ -524,6 +528,7 @@ struct iwl_cfg iwl6050_2agn_cfg = { ...@@ -524,6 +528,7 @@ struct iwl_cfg iwl6050_2agn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1500, .chain_noise_scale = 1500,
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 1024,
}; };
struct iwl_cfg iwl6050_2abg_cfg = { struct iwl_cfg iwl6050_2abg_cfg = {
...@@ -556,6 +561,7 @@ struct iwl_cfg iwl6050_2abg_cfg = { ...@@ -556,6 +561,7 @@ struct iwl_cfg iwl6050_2abg_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1500, .chain_noise_scale = 1500,
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 1024,
}; };
struct iwl_cfg iwl6000_3agn_cfg = { struct iwl_cfg iwl6000_3agn_cfg = {
...@@ -589,6 +595,7 @@ struct iwl_cfg iwl6000_3agn_cfg = { ...@@ -589,6 +595,7 @@ struct iwl_cfg iwl6000_3agn_cfg = {
.plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
.chain_noise_scale = 1000, .chain_noise_scale = 1000,
.monitor_recover_period = IWL_MONITORING_PERIOD, .monitor_recover_period = IWL_MONITORING_PERIOD,
.max_event_log_size = 1024,
}; };
MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
......
...@@ -1990,9 +1990,6 @@ static int iwl_print_last_event_logs(struct iwl_priv *priv, u32 capacity, ...@@ -1990,9 +1990,6 @@ static int iwl_print_last_event_logs(struct iwl_priv *priv, u32 capacity,
return pos; return pos;
} }
/* For sanity check only. Actual size is determined by uCode, typ. 512 */
#define MAX_EVENT_LOG_SIZE (512)
#define DEFAULT_DUMP_EVENT_LOG_ENTRIES (20) #define DEFAULT_DUMP_EVENT_LOG_ENTRIES (20)
int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log, int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
...@@ -2025,16 +2022,16 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log, ...@@ -2025,16 +2022,16 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32))); num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32)));
next_entry = iwl_read_targ_mem(priv, base + (3 * sizeof(u32))); next_entry = iwl_read_targ_mem(priv, base + (3 * sizeof(u32)));
if (capacity > MAX_EVENT_LOG_SIZE) { if (capacity > priv->cfg->max_event_log_size) {
IWL_ERR(priv, "Log capacity %d is bogus, limit to %d entries\n", IWL_ERR(priv, "Log capacity %d is bogus, limit to %d entries\n",
capacity, MAX_EVENT_LOG_SIZE); capacity, priv->cfg->max_event_log_size);
capacity = MAX_EVENT_LOG_SIZE; capacity = priv->cfg->max_event_log_size;
} }
if (next_entry > MAX_EVENT_LOG_SIZE) { if (next_entry > priv->cfg->max_event_log_size) {
IWL_ERR(priv, "Log write index %d is bogus, limit to %d\n", IWL_ERR(priv, "Log write index %d is bogus, limit to %d\n",
next_entry, MAX_EVENT_LOG_SIZE); next_entry, priv->cfg->max_event_log_size);
next_entry = MAX_EVENT_LOG_SIZE; next_entry = priv->cfg->max_event_log_size;
} }
size = num_wraps ? capacity : next_entry; size = num_wraps ? capacity : next_entry;
......
...@@ -307,6 +307,7 @@ struct iwl_cfg { ...@@ -307,6 +307,7 @@ struct iwl_cfg {
u32 monitor_recover_period; u32 monitor_recover_period;
bool temperature_kelvin; bool temperature_kelvin;
bool off_channel_workaround; bool off_channel_workaround;
u32 max_event_log_size;
}; };
/*************************** /***************************
......
...@@ -1603,9 +1603,6 @@ static int iwl3945_print_last_event_logs(struct iwl_priv *priv, u32 capacity, ...@@ -1603,9 +1603,6 @@ static int iwl3945_print_last_event_logs(struct iwl_priv *priv, u32 capacity,
return pos; return pos;
} }
/* For sanity check only. Actual size is determined by uCode, typ. 512 */
#define IWL3945_MAX_EVENT_LOG_SIZE (512)
#define DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES (20) #define DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES (20)
int iwl3945_dump_nic_event_log(struct iwl_priv *priv, bool full_log, int iwl3945_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
...@@ -1632,16 +1629,16 @@ int iwl3945_dump_nic_event_log(struct iwl_priv *priv, bool full_log, ...@@ -1632,16 +1629,16 @@ int iwl3945_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32))); num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32)));
next_entry = iwl_read_targ_mem(priv, base + (3 * sizeof(u32))); next_entry = iwl_read_targ_mem(priv, base + (3 * sizeof(u32)));
if (capacity > IWL3945_MAX_EVENT_LOG_SIZE) { if (capacity > priv->cfg->max_event_log_size) {
IWL_ERR(priv, "Log capacity %d is bogus, limit to %d entries\n", IWL_ERR(priv, "Log capacity %d is bogus, limit to %d entries\n",
capacity, IWL3945_MAX_EVENT_LOG_SIZE); capacity, priv->cfg->max_event_log_size);
capacity = IWL3945_MAX_EVENT_LOG_SIZE; capacity = priv->cfg->max_event_log_size;
} }
if (next_entry > IWL3945_MAX_EVENT_LOG_SIZE) { if (next_entry > priv->cfg->max_event_log_size) {
IWL_ERR(priv, "Log write index %d is bogus, limit to %d\n", IWL_ERR(priv, "Log write index %d is bogus, limit to %d\n",
next_entry, IWL3945_MAX_EVENT_LOG_SIZE); next_entry, priv->cfg->max_event_log_size);
next_entry = IWL3945_MAX_EVENT_LOG_SIZE; next_entry = priv->cfg->max_event_log_size;
} }
size = num_wraps ? capacity : next_entry; size = num_wraps ? capacity : next_entry;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册