Commit e1dfc085 authored by Gregory Greenman's avatar Gregory Greenman Committed by John W. Linville

iwlwifi: use uCode error and event tables pointer w.r.t loaded image

This patch updates the usage of the pointers to error and log tables
received in alive response w.r.t. the current uCode image.
Signed-off-by: default avatarGregory Greenman <gregory.greenman@intel.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 87283cc1
...@@ -1084,8 +1084,11 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv) ...@@ -1084,8 +1084,11 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv)
u32 data2, line; u32 data2, line;
u32 desc, time, count, base, data1; u32 desc, time, count, base, data1;
u32 blink1, blink2, ilink1, ilink2; u32 blink1, blink2, ilink1, ilink2;
int rc; int ret;
if (priv->ucode_type == UCODE_INIT)
base = le32_to_cpu(priv->card_alive_init.error_event_table_ptr);
else
base = le32_to_cpu(priv->card_alive.error_event_table_ptr); base = le32_to_cpu(priv->card_alive.error_event_table_ptr);
if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) { if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) {
...@@ -1093,8 +1096,8 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv) ...@@ -1093,8 +1096,8 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv)
return; return;
} }
rc = iwl_grab_nic_access(priv); ret = iwl_grab_nic_access(priv);
if (rc) { if (ret) {
IWL_WARNING("Can not read from adapter at this time.\n"); IWL_WARNING("Can not read from adapter at this time.\n");
return; return;
} }
...@@ -1146,7 +1149,9 @@ void iwl_print_event_log(struct iwl_priv *priv, u32 start_idx, ...@@ -1146,7 +1149,9 @@ void iwl_print_event_log(struct iwl_priv *priv, u32 start_idx,
if (num_events == 0) if (num_events == 0)
return; return;
if (priv->ucode_type == UCODE_INIT)
base = le32_to_cpu(priv->card_alive_init.log_event_table_ptr);
else
base = le32_to_cpu(priv->card_alive.log_event_table_ptr); base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
if (mode == 0) if (mode == 0)
...@@ -1177,7 +1182,7 @@ EXPORT_SYMBOL(iwl_print_event_log); ...@@ -1177,7 +1182,7 @@ EXPORT_SYMBOL(iwl_print_event_log);
void iwl_dump_nic_event_log(struct iwl_priv *priv) void iwl_dump_nic_event_log(struct iwl_priv *priv)
{ {
int rc; int ret;
u32 base; /* SRAM byte address of event log header */ u32 base; /* SRAM byte address of event log header */
u32 capacity; /* event log capacity in # entries */ u32 capacity; /* event log capacity in # entries */
u32 mode; /* 0 - no timestamp, 1 - timestamp recorded */ u32 mode; /* 0 - no timestamp, 1 - timestamp recorded */
...@@ -1185,14 +1190,18 @@ void iwl_dump_nic_event_log(struct iwl_priv *priv) ...@@ -1185,14 +1190,18 @@ void iwl_dump_nic_event_log(struct iwl_priv *priv)
u32 next_entry; /* index of next entry to be written by uCode */ u32 next_entry; /* index of next entry to be written by uCode */
u32 size; /* # entries that we'll print */ u32 size; /* # entries that we'll print */
if (priv->ucode_type == UCODE_INIT)
base = le32_to_cpu(priv->card_alive_init.log_event_table_ptr);
else
base = le32_to_cpu(priv->card_alive.log_event_table_ptr); base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) { if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) {
IWL_ERROR("Invalid event log pointer 0x%08X\n", base); IWL_ERROR("Invalid event log pointer 0x%08X\n", base);
return; return;
} }
rc = iwl_grab_nic_access(priv); ret = iwl_grab_nic_access(priv);
if (rc) { if (ret) {
IWL_WARNING("Can not read from adapter at this time.\n"); IWL_WARNING("Can not read from adapter at this time.\n");
return; return;
} }
......
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