summaryrefslogtreecommitdiffstats
path: root/sensorhandler.cpp
diff options
context:
space:
mode:
authorNagaraju Goruganti <ngorugan@in.ibm.com>2018-02-20 09:52:00 -0600
committerNagaraju Goruganti <ngorugan@in.ibm.com>2018-03-12 21:25:29 -0500
commit744398dc49661363f32af3a34b71ca4b865c20e9 (patch)
treec9f5b415ed4938b3930368ea99a12ea2db60c8cc /sensorhandler.cpp
parent34e3d3f152ba010b2a7805a8bbb85ed08c7f05cd (diff)
downloadphosphor-host-ipmid-744398dc49661363f32af3a34b71ca4b865c20e9.tar.gz
phosphor-host-ipmid-744398dc49661363f32af3a34b71ca4b865c20e9.zip
Remove use of legacy inventory interface
Made below given changes: 1.With legacy code we used to read software version info from the system file: /etc/os-release, now with new updates we will read it from the s/w object which is implementing the interface "xyz.openbmc_project.Software.RedundancyPriority" interface. 2.Removed legacy code related to inventory(FRU) for sensors Tested: 1.Verified f/w version info using below given command >ipmitool mc info -I dbus 2.Verified get sensor type info using below given command >ipmitool raw 0x04 0x2f 0x02 -I dbus Resolves openbmc/openbmc#2870 Change-Id: I384bf4aaacd56f4a871833b533b2a8a68c489959 Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
Diffstat (limited to 'sensorhandler.cpp')
-rw-r--r--sensorhandler.cpp70
1 files changed, 0 insertions, 70 deletions
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index 7d9d394..f6ccc13 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -71,57 +71,6 @@ struct sensorreadingresp_t {
uint8_t indication[2];
} __attribute__ ((packed)) ;
-// Use a lookup table to find the interface name of a specific sensor
-// This will be used until an alternative is found. this is the first
-// step for mapping IPMI
-int find_interface_property_fru_type(dbus_interface_t *interface, const char *property_name, char *property_value) {
-
- char *str1;
- sd_bus_error error = SD_BUS_ERROR_NULL;
- sd_bus_message *reply = NULL, *m=NULL;
-
-
- int r;
-
- r = sd_bus_message_new_method_call(bus,&m,interface->bus,interface->path,"org.freedesktop.DBus.Properties","Get");
- if (r < 0) {
- fprintf(stderr, "Failed to create a method call: %s", strerror(-r));
- fprintf(stderr,"Bus: %s Path: %s Interface: %s \n",
- interface->bus, interface->path, interface->interface);
- goto final;
- }
-
- r = sd_bus_message_append(m, "ss", "org.openbmc.InventoryItem", property_name);
- if (r < 0) {
- fprintf(stderr, "Failed to create a input parameter: %s", strerror(-r));
- fprintf(stderr,"Bus: %s Path: %s Interface: %s \n",
- interface->bus, interface->path, interface->interface);
- goto final;
- }
-
- r = sd_bus_call(bus, m, 0, &error, &reply);
- if (r < 0) {
- fprintf(stderr, "Failed to call the method: %s", strerror(-r));
- goto final;
- }
-
- r = sd_bus_message_read(reply, "v", "s", &str1) ;
- if (r < 0) {
- fprintf(stderr, "Failed to get a response: %s", strerror(-r));
- goto final;
- }
-
- strcpy(property_value, str1);
-
-final:
-
- sd_bus_error_free(&error);
- m = sd_bus_message_unref(m);
- reply = sd_bus_message_unref(reply);
-
- return r;
-}
-
int get_bus_for_path(const char *path, char **busname) {
return mapper_get_service(bus, path, busname);
}
@@ -332,19 +281,6 @@ uint8_t dbus_to_sensor_type(char *p) {
}
-uint8_t dbus_to_sensor_type_from_dbus(dbus_interface_t *a) {
- char fru_type_name[64];
- int r= 0;
-
- r = find_interface_property_fru_type(a, "fru_type", fru_type_name);
- if (r<0) {
- fprintf(stderr, "Failed to get a fru type: %s", strerror(-r));
- return -1;
- } else {
- return dbus_to_sensor_type(fru_type_name);
- }
-}
-
uint8_t get_type_from_interface(dbus_interface_t dbus_if) {
char *p;
@@ -359,12 +295,6 @@ uint8_t get_type_from_interface(dbus_interface_t dbus_if) {
if (dbus_if.sensortype != 0)
{
type = dbus_if.sensortype;
- }
- // Legacy codebase does not populate type during initial handling:
- else if (strstr(dbus_if.interface, "InventoryItem")) {
- // InventoryItems are real frus. So need to get the
- // fru_type property
- type = dbus_to_sensor_type_from_dbus(&dbus_if);
} else {
// Non InventoryItems
p = strrchr (dbus_if.path, '/');
OpenPOWER on IntegriCloud