ID:405 - Use meaningful Generator ID for "ipmitool sel add"

"ipmitool sel add" always sets the Generator ID field of the generated SEL entry
to 0x0000.

Looking at the IPMI spec v2, §13.2, this is questionable. The value 0 would be
read as a HW-generated event from IPMB with slave address 0, which is the
broadcast or ["general call"]http://www.i2c-bus.org/addressing/ address.

The spec says that the Generator ID should be "Software ID if event was
generated from system software", and goes on to say that bit 0 should be set to
1 and bit 1-7 should be set to the Software ID for software-generated events.
SEL entries generated by ipmitool will usually be software-generated.

Out of the SWIDs defined in §5.5 of the IPMI spec, "System management Software"
or "OEM" would match ipmitool's use best, thus it would make sense to set the
generator ID field to 0x0041 or 0x0061. I am using 0x0041 here.

Signed-off-by: Martin Wilck <martin.wilck@ts.fujitsu.com>
This commit is contained in:
Martin Wilck 2015-12-08 11:47:04 +01:00 committed by Zdenek Styblik
parent 2c3a876a73
commit 336b2cb1ab

View File

@ -419,7 +419,12 @@ ipmi_sel_add_entries_fromfile(struct ipmi_intf * intf, const char * filename)
memset(&sel_event, 0, sizeof(struct sel_event_record)); memset(&sel_event, 0, sizeof(struct sel_event_record));
sel_event.record_id = 0x0000; sel_event.record_id = 0x0000;
sel_event.record_type = 0x02; sel_event.record_type = 0x02;
sel_event.sel_type.standard_type.gen_id = 0x00; /*
* IPMI spec §32.1 generator ID
* Bit 0 = 1 "Software defined"
* Bit 1-7: SWID (IPMI spec §5.5), using 2 = "System management software"
*/
sel_event.sel_type.standard_type.gen_id = 0x41;
sel_event.sel_type.standard_type.evm_rev = rqdata[0]; sel_event.sel_type.standard_type.evm_rev = rqdata[0];
sel_event.sel_type.standard_type.sensor_type = rqdata[1]; sel_event.sel_type.standard_type.sensor_type = rqdata[1];
sel_event.sel_type.standard_type.sensor_num = rqdata[2]; sel_event.sel_type.standard_type.sensor_num = rqdata[2];