aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-core.c
diff options
context:
space:
mode:
authorEster Kummer <ester.kummer@intel.com>2008-05-29 04:34:46 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-03 15:00:17 -0400
commitede0cba45f2caf47715d105f6acc1086f4112a7a (patch)
treeb5ea2c0ba7c499ec34fb7c1b9da0907983263e4d /drivers/net/wireless/iwlwifi/iwl-core.c
parente623157b8d778a63736b0f41c04acc57c4f61ae0 (diff)
iwlwifi: move iwl_dump_nic_error_log to iwlcore module
This patch moves the function iwl_dump_nic_error_log to iwlcore. Remove sysfs entry it cannot be really triggered. Signed-off-by: Ester Kummer <ester.kummer@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-core.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c72
1 files changed, 72 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 7e25ca45f671..785396fd39a0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1056,6 +1056,78 @@ int iwl_verify_ucode(struct iwl_priv *priv)
1056EXPORT_SYMBOL(iwl_verify_ucode); 1056EXPORT_SYMBOL(iwl_verify_ucode);
1057 1057
1058 1058
1059static const char *desc_lookup(int i)
1060{
1061 switch (i) {
1062 case 1:
1063 return "FAIL";
1064 case 2:
1065 return "BAD_PARAM";
1066 case 3:
1067 return "BAD_CHECKSUM";
1068 case 4:
1069 return "NMI_INTERRUPT";
1070 case 5:
1071 return "SYSASSERT";
1072 case 6:
1073 return "FATAL_ERROR";
1074 }
1075
1076 return "UNKNOWN";
1077}
1078
1079#define ERROR_START_OFFSET (1 * sizeof(u32))
1080#define ERROR_ELEM_SIZE (7 * sizeof(u32))
1081
1082void iwl_dump_nic_error_log(struct iwl_priv *priv)
1083{
1084 u32 data2, line;
1085 u32 desc, time, count, base, data1;
1086 u32 blink1, blink2, ilink1, ilink2;
1087 int rc;
1088
1089 base = le32_to_cpu(priv->card_alive.error_event_table_ptr);
1090
1091 if (!priv->cfg->ops->lib->is_valid_rtc_data_addr(base)) {
1092 IWL_ERROR("Not valid error log pointer 0x%08X\n", base);
1093 return;
1094 }
1095
1096 rc = iwl_grab_nic_access(priv);
1097 if (rc) {
1098 IWL_WARNING("Can not read from adapter at this time.\n");
1099 return;
1100 }
1101
1102 count = iwl_read_targ_mem(priv, base);
1103
1104 if (ERROR_START_OFFSET <= count * ERROR_ELEM_SIZE) {
1105 IWL_ERROR("Start IWL Error Log Dump:\n");
1106 IWL_ERROR("Status: 0x%08lX, count: %d\n", priv->status, count);
1107 }
1108
1109 desc = iwl_read_targ_mem(priv, base + 1 * sizeof(u32));
1110 blink1 = iwl_read_targ_mem(priv, base + 3 * sizeof(u32));
1111 blink2 = iwl_read_targ_mem(priv, base + 4 * sizeof(u32));
1112 ilink1 = iwl_read_targ_mem(priv, base + 5 * sizeof(u32));
1113 ilink2 = iwl_read_targ_mem(priv, base + 6 * sizeof(u32));
1114 data1 = iwl_read_targ_mem(priv, base + 7 * sizeof(u32));
1115 data2 = iwl_read_targ_mem(priv, base + 8 * sizeof(u32));
1116 line = iwl_read_targ_mem(priv, base + 9 * sizeof(u32));
1117 time = iwl_read_targ_mem(priv, base + 11 * sizeof(u32));
1118
1119 IWL_ERROR("Desc Time "
1120 "data1 data2 line\n");
1121 IWL_ERROR("%-13s (#%d) %010u 0x%08X 0x%08X %u\n",
1122 desc_lookup(desc), desc, time, data1, data2, line);
1123 IWL_ERROR("blink1 blink2 ilink1 ilink2\n");
1124 IWL_ERROR("0x%05X 0x%05X 0x%05X 0x%05X\n", blink1, blink2,
1125 ilink1, ilink2);
1126
1127 iwl_release_nic_access(priv);
1128}
1129EXPORT_SYMBOL(iwl_dump_nic_error_log);
1130
1059#define EVENT_START_OFFSET (4 * sizeof(u32)) 1131#define EVENT_START_OFFSET (4 * sizeof(u32))
1060 1132
1061/** 1133/**