Blame SOURCES/0013-ID-405-Use-meaningful-Generator-ID-for-ipmitool-sel-.patch

4e2c59
From ef47a601eac2d17705a67007c89e2701fe00e3ba Mon Sep 17 00:00:00 2001
4e2c59
From: Martin Wilck <martin.wilck@ts.fujitsu.com>
4e2c59
Date: Tue, 8 Dec 2015 11:47:04 +0100
4e2c59
Subject: [PATCH] ID:405 - Use meaningful Generator ID for "ipmitool sel add"
4e2c59
MIME-Version: 1.0
4e2c59
Content-Type: text/plain; charset=UTF-8
4e2c59
Content-Transfer-Encoding: 8bit
4e2c59
4e2c59
"ipmitool sel add" always sets the Generator ID field of the generated SEL entry
4e2c59
to 0x0000.
4e2c59
4e2c59
Looking at the IPMI spec v2, ยง13.2, this is questionable. The value 0 would be
4e2c59
read as a HW-generated event from IPMB with slave address 0, which is the
4e2c59
broadcast or ["general call"]http://www.i2c-bus.org/addressing/ address.
4e2c59
4e2c59
The spec says that the Generator ID should be "Software ID if event was
4e2c59
generated from system software", and goes on to say that bit 0 should be set to
4e2c59
1 and bit 1-7 should be set to the Software ID for software-generated events.
4e2c59
SEL entries generated by ipmitool will usually be software-generated.
4e2c59
4e2c59
Out of the SWIDs defined in ยง5.5 of the IPMI spec, "System management Software"
4e2c59
or "OEM" would match ipmitool's use best, thus it would make sense to set the
4e2c59
generator ID field to 0x0041 or 0x0061. I am using 0x0041 here.
4e2c59
4e2c59
Signed-off-by: Martin Wilck <martin.wilck@ts.fujitsu.com>
4e2c59
---
4e2c59
 lib/ipmi_sel.c | 7 ++++++-
4e2c59
 1 file changed, 6 insertions(+), 1 deletion(-)
4e2c59
4e2c59
diff --git a/lib/ipmi_sel.c b/lib/ipmi_sel.c
4e2c59
index 67e12e3..affaed8 100644
4e2c59
--- a/lib/ipmi_sel.c
4e2c59
+++ b/lib/ipmi_sel.c
4e2c59
@@ -412,7 +412,12 @@ ipmi_sel_add_entries_fromfile(struct ipmi_intf * intf, const char * filename)
4e2c59
 		memset(&sel_event, 0, sizeof(struct sel_event_record));
4e2c59
 		sel_event.record_id = 0x0000;
4e2c59
 		sel_event.record_type = 0x02;
4e2c59
-		sel_event.sel_type.standard_type.gen_id = 0x00;
4e2c59
+		/*
4e2c59
+		 * IPMI spec ยง32.1 generator ID
4e2c59
+		 * Bit 0   = 1 "Software defined"
4e2c59
+		 * Bit 1-7: SWID (IPMI spec ยง5.5), using 2 = "System management software"
4e2c59
+		 */
4e2c59
+		sel_event.sel_type.standard_type.gen_id = 0x41;
4e2c59
 		sel_event.sel_type.standard_type.evm_rev = rqdata[0];
4e2c59
 		sel_event.sel_type.standard_type.sensor_type = rqdata[1];
4e2c59
 		sel_event.sel_type.standard_type.sensor_num = rqdata[2];
4e2c59
-- 
4e2c59
2.5.0
4e2c59