[PATCH phosphor-host-ipmid] Fix minor fw revision to be BCD encoded
OpenBMC Patches
openbmc-patches at stwcx.xyz
Thu Jun 23 08:00:51 AEST 2016
From: Adriana Kobylak <anoo at us.ibm.com>
The IPMI spec requires the minor version revision to be BCD encoded.
Currently the hex value was returned.
Fixes https://github.com/openbmc/phosphor-host-ipmid
Signed-off-by: Adriana Kobylak <anoo at us.ibm.com>
---
apphandler.C | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/apphandler.C b/apphandler.C
index 71dba66..d014f5b 100644
--- a/apphandler.C
+++ b/apphandler.C
@@ -187,7 +187,9 @@ ipmi_ret_t ipmi_app_get_device_id(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
if( r >= 0 ) {
// bit7 identifies state of SDR repository, hence the mask
dev_id[DEVICE_FW1] |= 0x7F & rev.major;
- dev_id[DEVICE_FW2] = rev.minor;
+
+ rev.minor = (rev.minor > 99 ? 99 : rev.minor);
+ dev_id[DEVICE_FW2] = rev.minor % 10 + (rev.minor / 10) * 16;
memcpy(&dev_id[DEVICE_AUX], rev.d, 4);
}
}
--
2.9.0
More information about the openbmc
mailing list