summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNagaraju Goruganti <ngorugan@in.ibm.com>2018-05-08 06:42:57 -0500
committerVernon Mauery <vernon.mauery@linux.intel.com>2018-05-08 20:49:12 +0000
commite98d146addcab8a25037f927673c0616cde7d962 (patch)
treee8ac09df97708b50f2c297214b907353681a2605
parentefcd68b23d7dafb4038aa76e4c0914b9a54d0103 (diff)
downloadphosphor-host-ipmid-e98d146addcab8a25037f927673c0616cde7d962.tar.gz
phosphor-host-ipmid-e98d146addcab8a25037f927673c0616cde7d962.zip
Fix Sensor query for derating factor returns 0
The issue here is that for derating factor sensor read command, hostboot is expecting return value in event_status field, but we are sending it in sensor reading field. Testing: ipmitool raw 0x04 0x2d 0xd8 #it has to retrun "00 00 5a 00" Resolves openbmc/openbmc#3012 Change-Id: I09e3d02c946ad1d8a39ea747fc400fb623cbe6ef Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
-rw-r--r--sensorhandler.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index 1feef5b..ee62e17 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -460,7 +460,6 @@ ipmi_ret_t legacyGetSensorReading(uint8_t sensorNum,
switch(type) {
case 0xC2:
- case 0xC8:
r = sd_bus_get_property(bus,a.bus, a.path, a.interface,
"value", NULL, &reply, "i");
if (r < 0)
@@ -488,6 +487,34 @@ ipmi_ret_t legacyGetSensorReading(uint8_t sensorNum,
resp->indication[1] = 0;
break;
+ case 0xC8:
+ r = sd_bus_get_property(bus,a.bus, a.path, a.interface,
+ "value", NULL, &reply, "i");
+ if (r < 0)
+ {
+ sd_journal_print(LOG_ERR, "Failed to call sd_bus_get_property:"
+ " %d, %s\n", r, strerror(-r));
+ sd_journal_print(LOG_ERR, "Bus: %s, Path: %s, Interface: %s\n",
+ a.bus, a.path, a.interface);
+ break;
+ }
+
+ r = sd_bus_message_read(reply, "i", &reading);
+ if (r < 0) {
+ sd_journal_print(LOG_ERR, "Failed to read sensor: %s\n",
+ strerror(-r));
+ break;
+ }
+
+ rc = IPMI_CC_OK;
+ *data_len=sizeof(sensorreadingresp_t);
+
+ resp->value = 0;
+ resp->operation = 0;
+ resp->indication[0] = (uint8_t)reading;
+ resp->indication[1] = 0;
+ break;
+
//TODO openbmc/openbmc#2154 Move this sensor to right place.
case 0xCA:
r = sd_bus_get_property(bus,a.bus, a.path, a.interface, "value",
OpenPOWER on IntegriCloud