summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill Pakhomov <k.pakhomov@yadro.com>2018-10-22 16:25:35 +0300
committerVernon Mauery <vernon.mauery@linux.intel.com>2018-12-12 16:08:31 +0000
commit812e44c7b6ff1e25b8cf79e8595db86bae7a98a5 (patch)
tree1ed7c700d5e1232fbe3bbe108e173a28c985f07f
parent4026e446d67cc1e1b08cdc43b5208416cfca8af0 (diff)
downloadphosphor-host-ipmid-812e44c7b6ff1e25b8cf79e8595db86bae7a98a5.tar.gz
phosphor-host-ipmid-812e44c7b6ff1e25b8cf79e8595db86bae7a98a5.zip
Fix units for fan RPM sensor
Use actual RPM unit type code from IPMI specification instead of revolutions type code coupled with per minute bit, which is also unused in most ipmi client implementations. Change-Id: If42900950a21f5526e890aef0dd6822e4e54c6e3 Signed-off-by: Kirill Pakhomov <k.pakhomov@yadro.com>
-rw-r--r--sensorhandler.cpp4
-rw-r--r--sensorhandler.hpp1
2 files changed, 2 insertions, 3 deletions
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index 1058230..21677ea 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -625,9 +625,7 @@ void setUnitFieldsForObject(const ipmi::sensor::Info* info,
body->sensor_units_2_base = get_sdr::SENSOR_UNIT_DEGREES_C;
break;
case server::Value::Unit::RPMS:
- body->sensor_units_2_base =
- get_sdr::SENSOR_UNIT_REVOLUTIONS; // revolutions
- get_sdr::body::set_rate_unit(0b100, body); // per minute
+ body->sensor_units_2_base = get_sdr::SENSOR_UNIT_RPM;
break;
case server::Value::Unit::Volts:
body->sensor_units_2_base = get_sdr::SENSOR_UNIT_VOLTS;
diff --git a/sensorhandler.hpp b/sensorhandler.hpp
index b32034f..5e55080 100644
--- a/sensorhandler.hpp
+++ b/sensorhandler.hpp
@@ -548,6 +548,7 @@ enum SensorUnitTypeCodes
SENSOR_UNIT_AMPERES = 5,
SENSOR_UNIT_WATTS = 6,
SENSOR_UNIT_JOULES = 7,
+ SENSOR_UNIT_RPM = 18,
SENSOR_UNIT_METERS = 34,
SENSOR_UNIT_REVOLUTIONS = 41,
};
OpenPOWER on IntegriCloud