diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-01-03 02:33:44 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-01-03 02:33:44 +0100 |
commit | f85b8b834b7ff85c80503faa73f237040330087b (patch) | |
tree | 595cb1ac38c0a8222c9a768b3c0523e36c063be4 /util/oem_dell.c | |
parent | db5e8f26947114f06480dd22b9db7e22e50ee133 (diff) |
New upstream version 3.0.1upstream/3.0.1
Diffstat (limited to 'util/oem_dell.c')
-rw-r--r-- | util/oem_dell.c | 63 |
1 files changed, 42 insertions, 21 deletions
diff --git a/util/oem_dell.c b/util/oem_dell.c index bd11446..0389355 100644 --- a/util/oem_dell.c +++ b/util/oem_dell.c @@ -132,7 +132,7 @@ char NIC_Selection_Mode_String_12g[] [50] = { "shared with failover all loms" }; -static char * progver = "3.00"; +static char * progver = "3.01"; static char * progname = "idelloem"; static int verbose = 0; static char fdebug = 0; @@ -1319,16 +1319,12 @@ ipmi_lcd_get_single_line_text (void * intf, char* lcdstring, uint8_t max_length) static int ipmi_lcd_get_info_wh(void * intf) - { uint8_t rsp[IPMI_RSPBUF_SIZE]; int rsp_len, rv; struct ipmi_rq req; uint8_t data[4]; - uint8_t command = 0; IPMI_DELL_LCD_CAPS* lcd_caps; char lcdstring[IPMI_DELL_LCD_STRING_LENGTH_MAX+1] = {0}; - int rc; - printf("LCD info\n"); @@ -1382,7 +1378,7 @@ ipmi_lcd_get_info_wh(void * intf) { memset(lcdstring, 0, IPMI_DELL_LCD_STRING_LENGTH_MAX+1); - rc = ipmi_lcd_get_single_line_text (intf, lcdstring, lcd_caps->max_chars[0]); + rv = ipmi_lcd_get_single_line_text (intf, lcdstring, lcd_caps->max_chars[0]); printf(" Text: %s\n", lcdstring); } else @@ -1454,7 +1450,6 @@ static int ipmi_lcd_get_info(void * intf) IPMI_DELL_LCD_CAPS * lcd_caps; uint8_t command = 0; char lcdstring[IPMI_DELL_LCD_STRING_LENGTH_MAX+1] = {0}; - int rc; printf("LCD info\n"); @@ -1504,7 +1499,7 @@ static int ipmi_lcd_get_info(void * intf) if (lcd_caps->number_lines > 0) { memset (lcdstring,0,IPMI_DELL_LCD_STRING_LENGTH_MAX+1); - rc = ipmi_lcd_get_single_line_text (intf, lcdstring, lcd_caps->max_chars[0]); + rv = ipmi_lcd_get_single_line_text (intf, lcdstring, lcd_caps->max_chars[0]); printf(" Text: %s\n", lcdstring); } else @@ -4141,7 +4136,7 @@ static int ipmi_get_peakpower_consmpt_history(void* intf,IPMI_POWER_CONSUMP_HIST if (verbose > 1) { - printf("Peak power consmhistory Data : %x %x %x %x %x %x %x %x %x %x\n %x %x %x %x %x %x %x %x %x %x %x %x %x\n\n", + printf("Peak power consmhistory Data : %x %x %x %x %x %x %x %x %x %x\n %x %x %x %x %x %x %x %x %x %x %x %x %x %x\n\n", rsp[0], rsp[1], rsp[2], rsp[3], rsp[4], rsp[5], rsp[6], rsp[7], rsp[8], rsp[9], rsp[10], rsp[11], @@ -5461,7 +5456,7 @@ int decode_sensor_dell(uchar *sdr,uchar *reading,char *pstring, int slen) #define BIT(x) (1 << x) #define SIZE_OF_DESC 128 -char * get_dell_evt_desc(uchar *sel_rec) +char * get_dell_evt_desc(uchar *sel_rec, int *psev) { struct sel_event_record * rec = (struct sel_event_record *)sel_rec; int data1, data2, data3; @@ -5505,6 +5500,7 @@ char * get_dell_evt_desc(uchar *sel_rec) case 0x07: if( ((data1 & DATA_BYTE2_SPECIFIED_MASK) == 0x80)) { + *psev = SEV_CRIT; if((data1 & 0x0f) == 0x00) snprintf(desc,SIZE_OF_DESC,"CPU Internal Err | "); if((data1 & 0x0f) == 0x06) @@ -5530,6 +5526,7 @@ char * get_dell_evt_desc(uchar *sel_rec) if ( (rec->sel_type.standard_type.event_type == 0x0B) && !(data1 & 0x03) ) { + *psev = SEV_INFO; if(data2 & 0x04) strcpy(desc,"Memory is in Spare Mode"); else if(data2 & 0x02) @@ -5538,12 +5535,13 @@ char * get_dell_evt_desc(uchar *sel_rec) strcpy(desc,"Memory is in Mirror Mode "); break; } - case 0x10: + case 0x10: get_devid_ver(NULL,NULL,&iver); // rv = ipmi_getdeviceid(devid,sizeof(devid),fdbg); // if (rv != 0) return NULL; version = iver; /* Memory DIMMS */ + *psev = SEV_MAJ; /*default severity for DIMM events*/ if( (data1 & 0x80) || (data1 & 0x20 ) ) { if( (code == 0x0c) && (rec->sel_type.standard_type.event_type == 0x0B) ) @@ -5551,10 +5549,12 @@ char * get_dell_evt_desc(uchar *sel_rec) if((data1 & 0x0f) == 0x00) { snprintf(desc,SIZE_OF_DESC," Redundancy Regained | "); + *psev = SEV_INFO; } else if((data1 & 0x0f) == 0x01) { snprintf(desc,SIZE_OF_DESC,"Redundancy Lost | "); + *psev = SEV_MAJ; } } else if(code == 0x0c) @@ -5610,29 +5610,37 @@ char * get_dell_evt_desc(uchar *sel_rec) break; } snprintf(desc,SIZE_OF_DESC,"Correctable ECC | "); + *psev = SEV_MAJ; } else if((data1 & 0x0f) == 0x01) { snprintf(desc,SIZE_OF_DESC,"UnCorrectable ECC | "); + *psev = SEV_CRIT; } } else if(code == 0x10) { - if((data1 & 0x0f) == 0x00) - snprintf(desc,SIZE_OF_DESC,"Corr Memory Log Dissabled | "); + if((data1 & 0x0f) == 0x00) { + snprintf(desc,SIZE_OF_DESC,"Corr Memory Log Disabled | "); + *psev = SEV_INFO; + } } } else { if(code == 0x12) { - if((data1 & 0x0f) == 0x02) + if((data1 & 0x0f) == 0x02) { snprintf(desc,SIZE_OF_DESC,"Unknown System Hardware Failure "); + *psev = SEV_MAJ; + } } if(code == 0x10) { - if((data1 & 0x0f) == 0x03) + if((data1 & 0x0f) == 0x03) { snprintf(desc,SIZE_OF_DESC,"All Even Logging Dissabled"); + *psev = SEV_INFO; + } } } if(data1 & 0x80 ) @@ -5731,6 +5739,7 @@ char * get_dell_evt_desc(uchar *sel_rec) case 0x20: if(((data1 & 0x0f)== 0x00)&&((data1 & 0x80) && (data1 & 0x20))) { + *psev = SEV_MAJ; if((data2 > 0x00)&&(data2<0xFF)) { //Add the code to display 194 entries.This sensor present only in ORCA @@ -5764,6 +5773,7 @@ char * get_dell_evt_desc(uchar *sel_rec) { if(data2 == 0x04) { + *psev = SEV_CRIT; snprintf(desc,SIZE_OF_DESC,"Hard Reset|Interrupt type None,SMS/OS Timer used at expiration"); } } @@ -5774,6 +5784,7 @@ char * get_dell_evt_desc(uchar *sel_rec) { if(data2 == 0x02) { + *psev = SEV_MAJ; if(data3 == 0x00) { snprintf(desc, SIZE_OF_DESC, "between BMC/iDRAC Firmware and other hardware"); @@ -5789,6 +5800,7 @@ char * get_dell_evt_desc(uchar *sel_rec) case 0xC1: if(rec->sel_type.standard_type.sensor_num == 0x25) { + *psev = SEV_MAJ; if((data1 & 0x0f) == 0x01) { snprintf(desc, SIZE_OF_DESC, "Failed to program Virtual Mac Address"); @@ -5819,6 +5831,7 @@ char * get_dell_evt_desc(uchar *sel_rec) case 0xC3: if(rec->sel_type.standard_type.sensor_num == 0x29) { + *psev = SEV_MAJ; if(((data1 & 0x0f)== 0x02)&&((data1 & 0x80) && (data1 & 0x20))) { #if 1 /*This sensor is not implemented in iDRAC code*/ @@ -5850,11 +5863,12 @@ char * get_dell_evt_desc(uchar *sel_rec) } strcat(desc,tmpdesc); #endif + *psev = SEV_MAJ; } } else { - + *psev = SEV_MAJ; if((data1 & 0x0f) == 0x02) { sprintf(desc,"%s","IO channel Check NMI"); @@ -5889,11 +5903,13 @@ char * get_dell_evt_desc(uchar *sel_rec) data2 & 0x7); strcat(desc,tmpdesc); } + *psev = SEV_CRIT; } break; case 0x0F: if(((data1 & 0x0f)== 0x0F)&&(data1 & 0x80)) { + *psev = SEV_CRIT; switch(data2) { case 0x80: @@ -5944,6 +5960,11 @@ char * get_dell_evt_desc(uchar *sel_rec) default: break; } + if (desc[0] == 0) { /* if no description specified above */ + /* snprintf(desc,SIZE_OF_DESC,"%02x [%02x %02x %02x]", + code,data1,date2,data3); // show raw data */ + desc = NULL; /*if empty, handle with default logic*/ + } } else { @@ -5986,8 +6007,6 @@ int decode_sel_dell(uint8_t *evt, char *outbuf, int outsz, char fdesc, snum = evt[11]; gstr = "BMC "; if (genid == 0x0033) gstr = "Bios"; - type_str = ""; - if (rectype == 0x02) type_str = get_sensor_type_desc(stype); #ifdef OTHER /* evt[13] is data1/offset*/ @@ -5995,18 +6014,20 @@ int decode_sel_dell(uint8_t *evt, char *outbuf, int outsz, char fdesc, ((evt[13] & DATA_BYTE3_SPECIFIED_MASK) == 0x20) ) { // if (evt[13] & DATA_BYTE2_SPECIFIED_MASK) // evt->data = rec->sel_type.standard_type.event_data[1]; - pstr = get_dell_evt_desc(evt); + pstr = get_dell_evt_desc(evt,&sevid); } else if (evt[13] == 0xC1) { if (snum == 0x23) { // evt->data = rec->sel_type.standard_type.event_data[1]; - pstr = get_dell_evt_desc(evt); + pstr = get_dell_evt_desc(evt,&sevid); } } #endif - pstr = get_dell_evt_desc(evt); + pstr = get_dell_evt_desc(evt,&sevid); if (pstr != NULL) rv = 0; if (rv == 0) { + type_str = ""; + if (rectype == 0x02) type_str = get_sensor_type_desc(stype); format_event(id,timestamp, sevid, genid, type_str, snum,NULL,pstr,NULL,outbuf,outsz); } |