1 #include <linux/module.h>
2 #include <linux/kernel.h>
6 static void i2o_report_util_cmd(
u8 cmd);
7 static void i2o_report_exec_cmd(
u8 cmd);
8 static void i2o_report_fail_status(
u8 req_status,
u32 *
msg);
9 static void i2o_report_common_status(
u8 req_status);
10 static void i2o_report_common_dsc(
u16 detailed_status);
20 u8 cmd = (msg[1] >> 24) & 0xFF;
21 u8 req_status = (msg[4] >> 24) & 0xFF;
22 u16 detailed_status = msg[4] & 0xFFFF;
27 printk(
"%s%s: ", severity, str);
30 i2o_report_util_cmd(cmd);
32 else if (cmd >= 0xA0 && cmd <= 0xEF)
33 i2o_report_exec_cmd(cmd);
35 printk(
"Cmd = %0#2x, ", cmd);
38 i2o_report_fail_status(req_status, msg);
42 i2o_report_common_status(req_status);
44 if (cmd < 0x1F || (cmd >= 0xA0 && cmd <= 0xEF))
45 i2o_report_common_dsc(detailed_status);
47 printk(
" / DetailedStatus = %0#4x.\n",
58 msg[0] >> 16 & 0xffff, msg);
59 for (i = 0; i < ((msg[0] >> 16) & 0xffff); i++)
69 static void i2o_report_fail_status(
u8 req_status,
u32 *
msg)
71 static char *FAIL_STATUS[] = {
86 "INVALID_INITIATOR_ID",
87 "INVALID_INITIATOR_CONTEX",
92 printk(
"TRANSPORT_UNKNOWN_FAILURE (%0#2x).\n",
96 FAIL_STATUS[req_status & 0x0F]);
101 (msg[1] >> 12) & 0xFFF, msg[1] & 0xFFF);
102 printk(
KERN_ERR " LowestVersion = 0x%02X, HighestVersion = 0x%02X\n",
103 (msg[4] >> 8) & 0xFF, msg[4] & 0xFF);
104 printk(
KERN_ERR " FailingHostUnit = 0x%04X, FailingIOP = 0x%03X\n",
105 msg[5] >> 16, msg[5] & 0xFFF);
108 if (msg[4] & (1 << 16))
110 "this msg can never be delivered/processed.\n");
111 if (msg[4] & (1 << 17))
113 "this msg can no longer be delivered/processed.\n");
114 if (msg[4] & (1 << 18))
116 "the system state does not allow delivery.\n");
117 if (msg[4] & (1 << 19))
119 "(Congestion), resources temporarily not available;"
120 "do not retry immediately.\n");
127 static void i2o_report_common_status(
u8 req_status)
129 static char *REPLY_STATUS[] = {
132 "ABORT_NO_DATA_TRANSFER",
133 "ABORT_PARTIAL_TRANSFER",
135 "ERROR_NO_DATA_TRANSFER",
136 "ERROR_PARTIAL_TRANSFER",
137 "PROCESS_ABORT_DIRTY",
138 "PROCESS_ABORT_NO_DATA_TRANSFER",
139 "PROCESS_ABORT_PARTIAL_TRANSFER",
145 printk(
"RequestStatus = %0#2x", req_status);
147 printk(
"%s", REPLY_STATUS[req_status]);
155 static void i2o_report_common_dsc(
u16 detailed_status)
157 static char *COMMON_DSC[] = {
164 "INSUFFICIENT_RESOURCE_SOFT",
165 "INSUFFICIENT_RESOURCE_HARD",
167 "CHAIN_BUFFER_TOO_LARGE",
168 "UNSUPPORTED_FUNCTION",
171 "INAPPROPRIATE_FUNCTION",
172 "INVALID_INITIATOR_ADDRESS",
173 "INVALID_MESSAGE_FLAGS",
177 "INVALID_TARGET_ADDRESS",
184 "UNSUPPORTED_VERSION",
186 "DEVICE_NOT_AVAILABLE"
190 printk(
" / DetailedStatus = %0#4x.\n",
193 printk(
" / %s.\n", COMMON_DSC[detailed_status]);
199 static void i2o_report_util_cmd(
u8 cmd)
212 printk(
"UTIL_CLAIM_RELEASE, ");
215 printk(
"UTIL_CONFIG_DIALOG, ");
218 printk(
"UTIL_DEVICE_RESERVE, ");
221 printk(
"UTIL_DEVICE_RELEASE, ");
224 printk(
"UTIL_EVENT_ACKNOWLEDGE, ");
227 printk(
"UTIL_EVENT_REGISTER, ");
233 printk(
"UTIL_LOCK_RELEASE, ");
236 printk(
"UTIL_PARAMS_GET, ");
239 printk(
"UTIL_PARAMS_SET, ");
242 printk(
"UTIL_REPLY_FAULT_NOTIFY, ");
245 printk(
"Cmd = %0#2x, ", cmd);
252 static void i2o_report_exec_cmd(
u8 cmd)
256 printk(
"EXEC_ADAPTER_ASSIGN, ");
259 printk(
"EXEC_ADAPTER_READ, ");
262 printk(
"EXEC_ADAPTER_RELEASE, ");
265 printk(
"EXEC_BIOS_INFO_SET, ");
268 printk(
"EXEC_BOOT_DEVICE_SET, ");
271 printk(
"EXEC_CONFIG_VALIDATE, ");
274 printk(
"EXEC_CONN_SETUP, ");
277 printk(
"EXEC_DDM_DESTROY, ");
280 printk(
"EXEC_DDM_ENABLE, ");
283 printk(
"EXEC_DDM_QUIESCE, ");
286 printk(
"EXEC_DDM_RESET, ");
289 printk(
"EXEC_DDM_SUSPEND, ");
292 printk(
"EXEC_DEVICE_ASSIGN, ");
295 printk(
"EXEC_DEVICE_RELEASE, ");
301 printk(
"EXEC_IOP_CLEAR, ");
304 printk(
"EXEC_IOP_CONNECT, ");
307 printk(
"EXEC_IOP_RESET, ");
310 printk(
"EXEC_LCT_NOTIFY, ");
313 printk(
"EXEC_OUTBOUND_INIT, ");
316 printk(
"EXEC_PATH_ENABLE, ");
319 printk(
"EXEC_PATH_QUIESCE, ");
322 printk(
"EXEC_PATH_RESET, ");
325 printk(
"EXEC_STATIC_MF_CREATE, ");
328 printk(
"EXEC_STATIC_MF_RELEASE, ");
331 printk(
"EXEC_STATUS_GET, ");
334 printk(
"EXEC_SW_DOWNLOAD, ");
337 printk(
"EXEC_SW_UPLOAD, ");
340 printk(
"EXEC_SW_REMOVE, ");
343 printk(
"EXEC_SYS_ENABLE, ");
346 printk(
"EXEC_SYS_MODIFY, ");
349 printk(
"EXEC_SYS_QUIESCE, ");
352 printk(
"EXEC_SYS_TAB_SET, ");
355 printk(
"Cmd = %#02x, ", cmd);
385 printk(
"%x (unknown !!)\n",
402 "%s: HRT table for controller is too new a version.\n",
407 count =
p[0] | (
p[1] << 8);
411 c->
name, count, length << 2);
415 for (i = 0; i <
count; i++) {
417 p = (
u8 *) (rows + 1);
418 d = (
u8 *) (rows + 2);
419 state =
p[1] << 8 |
p[0];
421 printk(
"TID %04X:[", state & 0xFFF);
423 if (state & (1 << 0))
425 if (state & (1 << 2)) {
427 if (state & (1 << 1))
435 switch (
p[3] & 0xFFFF) {
438 printk(
"Local bus %d: I/O at 0x%04X Mem 0x%08X",
p[2],
439 d[1] << 8 | d[0], *(
u32 *) (d + 4));
443 printk(
"ISA %d: CSN %d I/O at 0x%04X Mem 0x%08X",
p[2],
444 d[2], d[1] << 8 | d[0], *(
u32 *) (d + 4));
448 printk(
"EISA %d: Slot %d I/O at 0x%04X Mem 0x%08X",
449 p[2], d[3], d[1] << 8 | d[0], *(
u32 *) (d + 4));
453 printk(
"MCA %d: Slot %d I/O at 0x%04X Mem 0x%08X",
p[2],
454 d[3], d[1] << 8 | d[0], *(
u32 *) (d + 4));
458 printk(
"PCI %d: Bus %d Device %d Function %d",
p[2],
464 printk(
"Unsupported bus type.");