From 6df100415c991b52b4b3557b10c799c998a40525 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Fri, 3 Jul 2026 09:14:41 +0100 Subject: [PATCH] SES: Correctly interpret element index field when EIIOE=1 In SES-3, the EIIOE field indicates whether the ELEMENT INDEX field includes overall elements. If EIIOE=1, ELEMENT INDEX includes overall elements. For all other values of EIIOE, ELEMENT INDEX excludes overall elements. There will be one overall element per element type (including the current one). Signed-off-by: Chris Smith --- src/lib/ses.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lib/ses.c b/src/lib/ses.c index 301cc59e..710ab428 100644 --- a/src/lib/ses.c +++ b/src/lib/ses.c @@ -565,6 +565,18 @@ int ses_get_slots(struct ses_pages *sp, struct ses_slot **out_slots, int *out_sl ((uint64_t)addr_p[19]); slots[j].index = ap[0] & 0x10 ? ap[3] : j; + + /* + * ses_slot.index excludes overall elements. + * If EIIOE=1, ELEMENT INDEX includes overall + * elements. For all other values of EIIOE, + * ELEMENT INDEX excludes overall elements. + * There will be one overall element per + * element type (including the current one). + */ + if ((ap[0] & 0x10) && ((ap[2] & 0x3) == 0x01)) + slots[j].index -= (i+1); + get_led_status(sp, t->element_type, slots[j].index, &slots[j].ibpi_status); }