Store sensor return codes for dbus removal

Add any return codes defined at the device level and/or the sensor
within the hwmon device config file for removal of the sensor.
The sensor is removed from dbus when any of those return codes given are
received by hwmon when doing a read.

ex.)
Removal return codes 2 & 11 defined at device level apply for all
sensors(gpu0 core & mem) whereas removal return code 5 applies to only
the the gpu0 core temp sensor.

REMOVERCS = "2,11"

LABEL_temp1 = "gpu0_core_temp"
WARNHI_temp1 = "75000"
WARNLO_temp1 = "0"
CRITHI_temp1 = "80000"
CRITLO_temp1 = "0"
REMOVERCS_temp1 = "5"

LABEL_temp2 = "gpu0_mem_temp"
WARNHI_temp2 = "75000"
WARNLO_temp2 = "0"
CRITHI_temp2 = "80000"
CRITLO_temp2 = "0"

Tested:
    All device sensors contain removal return code defined on the device
    Each sensor contains removal return codes defined on them

Change-Id: Ib0bf1e38ae40aaaea06e93d96322f9499eeefdb1
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
1 file changed
tree: 77604fa31346e01c62af7ded8bfc7ec65954520f
  1. msl/
  2. test/
  3. .gitignore
  4. argument.cpp
  5. argument.hpp
  6. bootstrap.sh
  7. configure.ac
  8. env.cpp
  9. env.hpp
  10. fan_pwm.cpp
  11. fan_pwm.hpp
  12. fan_speed.cpp
  13. fan_speed.hpp
  14. hwmon.hpp
  15. interface.hpp
  16. LICENSE
  17. mainloop.cpp
  18. mainloop.hpp
  19. Makefile.am
  20. readd.cpp
  21. README.iio.md
  22. README.md
  23. sensorset.cpp
  24. sensorset.hpp
  25. sysfs.cpp
  26. sysfs.hpp
  27. targets.hpp
  28. thresholds.hpp
  29. timer.cpp
  30. timer.hpp
  31. util.hpp
README.md

Exposes generic hwmon entries as DBus objects.

To Build

To build this package, do the following steps:

    1. ./bootstrap.sh
    2. ./configure ${CONFIGURE_FLAGS}
    3. make

To clean the repository run `./bootstrap.sh clean`.

D-Bus bus names

To enable the use of Linux features like cgroups prioritization and
udev/systemd control, one instance of phosphor-hwmon is intended to
be run per hwmon sysfs class instance.

This requires an algorithm for selecting a stable, well-known D-Bus busname.

The algorithm is <PREFIX>-<ID>.Hwmon<N> where PREFIX is an autoconf
configurable prefix (BUSNAME_PREFIX, xyz.openbmc_project by default),
ID is a std::hash of the /sys/devices path backing the hwmon class
instance, and N is the implemented phosphor-hwmon D-Bus API version.