Added support for sensor types - Processor related sensor 
type 0x07, system incharectorization 0x20, Memory sensor type.


Signed-off-by: Srinivas Gowda G <srinivas_g_go...@dell.com>
---
 include/ipmitool/ipmi_sel.h |    1 +
 lib/ipmi_sel.c              |  108 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 109 insertions(+), 0 deletions(-)

diff --git a/include/ipmitool/ipmi_sel.h b/include/ipmitool/ipmi_sel.h
index 169d405..9eea4ed 100644
--- a/include/ipmitool/ipmi_sel.h
+++ b/include/ipmitool/ipmi_sel.h
@@ -106,6 +106,7 @@ struct standard_spec_sel_rec{
 #define        SENSOR_TYPE_WTDOG               0x23
 #define        SENSOR_TYPE_OEM_NFATAL_ERROR    0xC2
 #define        SENSOR_TYPE_OEM_FATAL_ERROR     0xC3
+#define SENSOR_TYPE_TXT_CMD_ERROR      0x20
 /* End of Macro for DELL Specific */
 #define SEL_OEM_TS_DATA_LEN            6
 #define SEL_OEM_NOTS_DATA_LEN          13
diff --git a/lib/ipmi_sel.c b/lib/ipmi_sel.c
index 9ce605c..5054f43 100644
--- a/lib/ipmi_sel.c
+++ b/lib/ipmi_sel.c
@@ -558,6 +558,33 @@ char * get_dell_evt_desc(struct ipmi_intf * intf, struct 
sel_event_record * rec)
                memset(desc,0,SIZE_OF_DESC);
                memset(tmpdesc,0,SIZE_OF_DESC);
                switch (sensor_type) {                                  
+                       case SENSOR_TYPE_PROCESSOR:     /* Processor/CPU 
related OEM Sel Byte Decoding for DELL Platforms only */
+                               if((OEM_CODE_IN_BYTE2 == (data1 & 
DATA_BYTE2_SPECIFIED_MASK)))
+                               {
+                                       if(0x00 == (data1 & MASK_LOWER_NIBBLE)) 
+                                               snprintf(desc,SIZE_OF_DESC,"CPU 
Internal Err | ");
+                                       if(0x06 == (data1 & MASK_LOWER_NIBBLE))
+                                       {
+                                               snprintf(desc,SIZE_OF_DESC,"CPU 
Protocol Err | ");
+                                                       
+                                       }
+                                       
+                                       /* change bit location to a number */
+                                       for (count= 0; count < 8; count++)
+                                       {
+                                         if (BIT(count)& data2)
+                                         {
+                                           count++;
+                                               /* 0x0A - CPU sensor number */
+                                               if((0x06 == (data1 & 
MASK_LOWER_NIBBLE)) && (0x0A == rec->sel_type.standard_type.sensor_num)) 
+                                                   
snprintf(desc,SIZE_OF_DESC,"FSB %d ",count);                        // Which 
CPU Has generated the FSB
+                                               else
+                                                   
snprintf(desc,SIZE_OF_DESC,"CPU %d | APIC ID %d ",count,data3);     /* Specific 
CPU related info */
+                                           break;
+                                         }
+                                       }
+                               }
+                       break;
                        case SENSOR_TYPE_MEMORY:        /* Memory or DIMM 
related OEM Sel Byte Decoding for DELL Platforms only */
                        case SENSOR_TYPE_EVT_LOG:       /* Events Logging for 
Memory or DIMM related OEM Sel Byte Decoding for DELL Platforms only */         
          
 
@@ -601,6 +628,56 @@ char * get_dell_evt_desc(struct ipmi_intf * intf, struct 
sel_event_record * rec)
                                        {
                                                if(0x00 == (data1 & 
MASK_LOWER_NIBBLE))
                                                {
+                                                       /* 0x1C - Memory Sensor 
Number */
+                                                       if(0x1C == 
rec->sel_type.standard_type.sensor_num)
+                                                       {
+                                                               /*Add the 
complete information about the Memory Configs.*/
+                                                               if((data1 &  
OEM_CODE_IN_BYTE2) && (data1 & OEM_CODE_IN_BYTE3 ))
+                                                               {               
                                                        
+                                                                       count = 
0;
+                                                                       
snprintf(desc,SIZE_OF_DESC,"CRC Error on:");
+                                                                       
for(i=0;i<4;i++)
+                                                                       {
+                                                                               
if((BIT(i))&(data2))
+                                                                               
{
+                                                                               
        if(count)
+                                                                               
        {
+                                                                       str = 
desc+strlen(desc);
+                                                                               
                *str++ = ',';
+                                                                               
                str = '\0';
+                                                                               
                count = 0;
+                                                                               
        }                       
+                                                                               
        switch(i) /* Which type of memory config is present.. */
+                                                                               
        {
+                                                                               
                case 0: snprintf(tmpdesc,SIZE_OF_DESC,"South Bound Memory");
+                                                                               
                                strcat(desc,tmpdesc);
+                                                                               
                                count++;
+                                                                               
                                break;
+                                                                               
                case 1: snprintf(tmpdesc,SIZE_OF_DESC,"South Bound Config");
+                                                                               
                                strcat(desc,tmpdesc);
+                                                                               
                                count++;
+                                                                               
                                break;
+                                                                               
                case 2: snprintf(tmpdesc,SIZE_OF_DESC,"North Bound memory");
+                                                                               
                                strcat(desc,tmpdesc);
+                                                                               
                                count++;
+                                                                               
                                break;
+                                                                               
                case 3: snprintf(tmpdesc,SIZE_OF_DESC,"North Bound 
memory-corr");
+                                                                               
                                strcat(desc,tmpdesc);
+                                                                               
                                count++;
+                                                                               
                                break;
+                                                                               
                default:
+                                                                               
                                break;
+                                                                               
        }
+                                                                               
}
+                                                                       }
+                                                                       
if(data3>=0x00 && data3<0xFF)
+                                                                       {
+                                                                               
snprintf(tmpdesc,SIZE_OF_DESC,"|Failing_Channel:%d",data3);
+                                                                               
strcat(desc,tmpdesc);
+                                                                       }
+                                                               }
+                                                               break;
+                                                       }
                                                        
snprintf(desc,SIZE_OF_DESC,"Correctable ECC | ");
                                                }
                                                else if(0x01 == (data1 & 
MASK_LOWER_NIBBLE))  
@@ -731,10 +808,41 @@ char * get_dell_evt_desc(struct ipmi_intf * intf, struct 
sel_event_record * rec)
                                        }
                                }
                        break;
+                       /* Sensor In system charectorization Error Decoding.
+                               Sensor type  0x20*/
+                       case SENSOR_TYPE_TXT_CMD_ERROR:
+                               if((0x00 == (data1 & 
MASK_LOWER_NIBBLE))&&((data1 & OEM_CODE_IN_BYTE2) && (data1 & 
OEM_CODE_IN_BYTE3)))
+                               {
+                                       switch(data3)
+                                       {
+                                               case 0x01:
+                                                       
snprintf(desc,SIZE_OF_DESC,"BIOS TXT Error");
+                                                       break;
+                                               case 0x02:
+                                                       
snprintf(desc,SIZE_OF_DESC,"Processor/FIT TXT");
+                                                       break;
+                                               case 0x03:
+                                                       
snprintf(desc,SIZE_OF_DESC,"BIOS ACM TXT Error");
+                                                       break;
+                                               case 0x04:
+                                                       
snprintf(desc,SIZE_OF_DESC,"SINIT ACM TXT Error");
+                                                       break;
+                                               case 0xff:
+                                                       
snprintf(desc,SIZE_OF_DESC,"Unrecognized TT Error12");
+                                                       break;
+                                               default:
+                                                       break;                  
                        
+                                       }
+                               }
+                       break;  
                        default:
                        break;                          
                } 
        }
+       else
+       {
+               sensor_type = rec->sel_type.standard_type.event_type;
+       }
        return desc;
 }
 
-- 
1.7.7.6


Thanks,
G
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to