diff options
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 785396fd39a0..373e9847c378 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -1084,17 +1084,20 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv) | |||
1084 | u32 data2, line; | 1084 | u32 data2, line; |
1085 | u32 desc, time, count, base, data1; | 1085 | u32 desc, time, count, base, data1; |
1086 | u32 blink1, blink2, ilink1, ilink2; | 1086 | u32 blink1, blink2, ilink1, ilink2; |
1087 | int rc; | 1087 | int ret; |
1088 | 1088 | ||
1089 | base = le32_to_cpu(priv->card_alive.error_event_table_ptr); | 1089 | if (priv->ucode_type == UCODE_INIT) |
1090 | base = le32_to_cpu(priv->card_alive_init.error_event_table_ptr); | ||
1091 | else | ||
1092 | base = le32_to_cpu(priv->card_alive.error_event_table_ptr); | ||
1090 | 1093 | ||
1091 | if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) { | 1094 | if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) { |
1092 | IWL_ERROR("Not valid error log pointer 0x%08X\n", base); | 1095 | IWL_ERROR("Not valid error log pointer 0x%08X\n", base); |
1093 | return; | 1096 | return; |
1094 | } | 1097 | } |
1095 | 1098 | ||
1096 | rc = iwl_grab_nic_access(priv); | 1099 | ret = iwl_grab_nic_access(priv); |
1097 | if (rc) { | 1100 | if (ret) { |
1098 | IWL_WARNING("Can not read from adapter at this time.\n"); | 1101 | IWL_WARNING("Can not read from adapter at this time.\n"); |
1099 | return; | 1102 | return; |
1100 | } | 1103 | } |
@@ -1146,8 +1149,10 @@ void iwl_print_event_log(struct iwl_priv *priv, u32 start_idx, | |||
1146 | 1149 | ||
1147 | if (num_events == 0) | 1150 | if (num_events == 0) |
1148 | return; | 1151 | return; |
1149 | 1152 | if (priv->ucode_type == UCODE_INIT) | |
1150 | base = le32_to_cpu(priv->card_alive.log_event_table_ptr); | 1153 | base = le32_to_cpu(priv->card_alive_init.log_event_table_ptr); |
1154 | else | ||
1155 | base = le32_to_cpu(priv->card_alive.log_event_table_ptr); | ||
1151 | 1156 | ||
1152 | if (mode == 0) | 1157 | if (mode == 0) |
1153 | event_size = 2 * sizeof(u32); | 1158 | event_size = 2 * sizeof(u32); |
@@ -1177,7 +1182,7 @@ EXPORT_SYMBOL(iwl_print_event_log); | |||
1177 | 1182 | ||
1178 | void iwl_dump_nic_event_log(struct iwl_priv *priv) | 1183 | void iwl_dump_nic_event_log(struct iwl_priv *priv) |
1179 | { | 1184 | { |
1180 | int rc; | 1185 | int ret; |
1181 | u32 base; /* SRAM byte address of event log header */ | 1186 | u32 base; /* SRAM byte address of event log header */ |
1182 | u32 capacity; /* event log capacity in # entries */ | 1187 | u32 capacity; /* event log capacity in # entries */ |
1183 | u32 mode; /* 0 - no timestamp, 1 - timestamp recorded */ | 1188 | u32 mode; /* 0 - no timestamp, 1 - timestamp recorded */ |
@@ -1185,14 +1190,18 @@ void iwl_dump_nic_event_log(struct iwl_priv *priv) | |||
1185 | u32 next_entry; /* index of next entry to be written by uCode */ | 1190 | u32 next_entry; /* index of next entry to be written by uCode */ |
1186 | u32 size; /* # entries that we'll print */ | 1191 | u32 size; /* # entries that we'll print */ |
1187 | 1192 | ||
1188 | base = le32_to_cpu(priv->card_alive.log_event_table_ptr); | 1193 | if (priv->ucode_type == UCODE_INIT) |
1194 | base = le32_to_cpu(priv->card_alive_init.log_event_table_ptr); | ||
1195 | else | ||
1196 | base = le32_to_cpu(priv->card_alive.log_event_table_ptr); | ||
1197 | |||
1189 | if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) { | 1198 | if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) { |
1190 | IWL_ERROR("Invalid event log pointer 0x%08X\n", base); | 1199 | IWL_ERROR("Invalid event log pointer 0x%08X\n", base); |
1191 | return; | 1200 | return; |
1192 | } | 1201 | } |
1193 | 1202 | ||
1194 | rc = iwl_grab_nic_access(priv); | 1203 | ret = iwl_grab_nic_access(priv); |
1195 | if (rc) { | 1204 | if (ret) { |
1196 | IWL_WARNING("Can not read from adapter at this time.\n"); | 1205 | IWL_WARNING("Can not read from adapter at this time.\n"); |
1197 | return; | 1206 | return; |
1198 | } | 1207 | } |