From becaec236c86fc839dad52f311d94c5600d42c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20=C3=96hrn?= Date: Mon, 19 Jan 2004 22:52:41 +0000 Subject: [PATCH] Don't abort when encountering OEM records. Add support for the Linux kernel panic OEM record. --- ipmitool/lib/ipmi_sel.c | 43 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/ipmitool/lib/ipmi_sel.c b/ipmitool/lib/ipmi_sel.c index 2cc190e..ad61cec 100644 --- a/ipmitool/lib/ipmi_sel.c +++ b/ipmitool/lib/ipmi_sel.c @@ -211,11 +211,6 @@ ipmi_sel_get_std_entry(struct ipmi_intf * intf, unsigned short * next_id) *next_id = (rsp->data[1] << 8) | rsp->data[0]; - if (rsp->data[4] >= 0xc0) { - printf("Not a standard SEL Entry!\n"); - return NULL; - } - return (struct sel_event_record *) &rsp->data[2]; } @@ -254,6 +249,24 @@ ipmi_sel_print_std_entry(struct sel_event_record * evt) else printf("%4x | ", evt->record_id); + + if (evt->record_type == 0xf0) + { + char tmp [12]; + memcpy (tmp, (char *) evt + 5, 11); + tmp [11] = 0; + + printf ("Linux kernel panic: %s\n", tmp); + + return; + } + + if (evt->record_type >= 0xc0) + { + printf ("OEM record\n"); + return; + } + if (evt->timestamp < 0x20000000) { printf("Pre-Init Time-stamp"); if (csv_output) @@ -292,6 +305,26 @@ ipmi_sel_print_std_entry_verbose(struct sel_event_record * evt) printf("SEL Record ID : %04x\n", evt->record_id); + + if (evt->record_type == 0xf0) + { + char tmp [12]; + printf (" Record Type : Linux kernel panic (OEM record).\n"); + + memcpy (tmp, (char *) evt + 5, 11); + tmp [11] = 0; + + printf (" Panic string : %s\n\n", tmp); + + return; + } + + if (evt->record_type >= 0xc0) + { + printf (" Record Type : OEM record\n"); + return; + } + printf(" Record Type : %02x\n", evt->record_type); printf(" Timestamp : %s\n",