aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJay Sternberg <jay.e.sternberg@intel.com>2008-10-14 15:32:42 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-31 19:00:26 -0400
commit56e1261596334e60210fb8ecd9eb6a3db53aba94 (patch)
treeedf7b73ac17bdaf892f2a74fb08954c9ffde612e /drivers
parent4e062f99af771173b601742b0c1c98eb4d52ea08 (diff)
iwlwifi: expand error lookup and align output
change desc_lookup from hard coded switch to a simple lookup table and expand list to include all errors. Also corrected output using this string so info is aligned and easier to read when debugging issues. Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c57
1 files changed, 40 insertions, 17 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 2c4162e4814..59dd608b909 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1162,24 +1162,47 @@ int iwl_verify_ucode(struct iwl_priv *priv)
1162} 1162}
1163EXPORT_SYMBOL(iwl_verify_ucode); 1163EXPORT_SYMBOL(iwl_verify_ucode);
1164 1164
1165
1166static const char *desc_lookup_text[] = {
1167 "OK",
1168 "FAIL",
1169 "BAD_PARAM",
1170 "BAD_CHECKSUM",
1171 "NMI_INTERRUPT_WDG",
1172 "SYSASSERT",
1173 "FATAL_ERROR",
1174 "BAD_COMMAND",
1175 "HW_ERROR_TUNE_LOCK",
1176 "HW_ERROR_TEMPERATURE",
1177 "ILLEGAL_CHAN_FREQ",
1178 "VCC_NOT_STABLE",
1179 "FH_ERROR",
1180 "NMI_INTERRUPT_HOST",
1181 "NMI_INTERRUPT_ACTION_PT",
1182 "NMI_INTERRUPT_UNKNOWN",
1183 "UCODE_VERSION_MISMATCH",
1184 "HW_ERROR_ABS_LOCK",
1185 "HW_ERROR_CAL_LOCK_FAIL",
1186 "NMI_INTERRUPT_INST_ACTION_PT",
1187 "NMI_INTERRUPT_DATA_ACTION_PT",
1188 "NMI_TRM_HW_ER",
1189 "NMI_INTERRUPT_TRM",
1190 "NMI_INTERRUPT_BREAK_POINT"
1191 "DEBUG_0",
1192 "DEBUG_1",
1193 "DEBUG_2",
1194 "DEBUG_3",
1195 "UNKNOWN"
1196};
1197
1165static const char *desc_lookup(int i) 1198static const char *desc_lookup(int i)
1166{ 1199{
1167 switch (i) { 1200 int max = ARRAY_SIZE(desc_lookup_text) - 1;
1168 case 1: 1201
1169 return "FAIL"; 1202 if (i < 0 || i > max)
1170 case 2: 1203 i = max;
1171 return "BAD_PARAM";
1172 case 3:
1173 return "BAD_CHECKSUM";
1174 case 4:
1175 return "NMI_INTERRUPT";
1176 case 5:
1177 return "SYSASSERT";
1178 case 6:
1179 return "FATAL_ERROR";
1180 }
1181 1204
1182 return "UNKNOWN"; 1205 return desc_lookup_text[i];
1183} 1206}
1184 1207
1185#define ERROR_START_OFFSET (1 * sizeof(u32)) 1208#define ERROR_START_OFFSET (1 * sizeof(u32))
@@ -1225,9 +1248,9 @@ void iwl_dump_nic_error_log(struct iwl_priv *priv)
1225 line = iwl_read_targ_mem(priv, base + 9 * sizeof(u32)); 1248 line = iwl_read_targ_mem(priv, base + 9 * sizeof(u32));
1226 time = iwl_read_targ_mem(priv, base + 11 * sizeof(u32)); 1249 time = iwl_read_targ_mem(priv, base + 11 * sizeof(u32));
1227 1250
1228 IWL_ERROR("Desc Time " 1251 IWL_ERROR("Desc Time "
1229 "data1 data2 line\n"); 1252 "data1 data2 line\n");
1230 IWL_ERROR("%-13s (#%d) %010u 0x%08X 0x%08X %u\n", 1253 IWL_ERROR("%-28s (#%02d) %010u 0x%08X 0x%08X %u\n",
1231 desc_lookup(desc), desc, time, data1, data2, line); 1254 desc_lookup(desc), desc, time, data1, data2, line);
1232 IWL_ERROR("blink1 blink2 ilink1 ilink2\n"); 1255 IWL_ERROR("blink1 blink2 ilink1 ilink2\n");
1233 IWL_ERROR("0x%05X 0x%05X 0x%05X 0x%05X\n", blink1, blink2, 1256 IWL_ERROR("0x%05X 0x%05X 0x%05X 0x%05X\n", blink1, blink2,