Fix minor fw revision to be BCD encoded
The IPMI 2.0 spec requires the minor version revision
to be BCD encoded, but the current implementation uses a binary
encoding.
Fixes openbmc/phosphor-host-ipmid#89
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/apphandler.C b/apphandler.C
index 71dba66..d014f5b 100644
--- a/apphandler.C
+++ b/apphandler.C
@@ -187,7 +187,9 @@
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);
}
}