summaryrefslogtreecommitdiffstats
path: root/sensorhandler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* sensor: Modify Get Device SDR command implementationTom Joseph2018-01-301-14/+17
| | | | | | | | | | a) Specify the sensor name deduction in the yaml b) Entity ID and entity instance is populated c) Sensor owner is set to BMC address, since all the sensors are present on the BMC. Change-Id: I7b64c48ad1dbd386e12b20af459e40baf0d97cd4 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Remove unwarranted call to free()Deepak Kodihalli2018-01-291-1/+0
| | | | | | | | | | | Do not free() the pointer allocated by sd_bus_message_read(), because systemd will free that once the message is unreferenced. The free() in question here was causing an ipmid core dump. Resolves openbmc/openbmc#2846. Change-Id: I118f6947e7292b68744d0034c72572e4dcb99f01 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Add sensor entry for power supply redundancy enabled.Dhruvaraj Subhashchandran2018-01-221-0/+34
| | | | | | | | | | | IPMI to dbus lookup contained only mapping for PS redundancy disabled, adding the mapping for enabled. Changing the PS redundancy sensor type from D8 to CA. Resolves openbmc/openbmc#2810 Change-Id: I2399ce76a168f63f6a4528cff8aa397ef12d5e1e Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
* sensorhandler: allow preconfigured unit and scaleEmily Shaffer2017-12-101-20/+34
| | | | | | | | | | | Allow specifying the scale and unit for a sensor in the YAML configuration. This can save clock time by no longer requiring the daemon to reach out to the sensor owner for the information. Change-Id: I5f63286fc32fb9d64ebab7d86d1dbb7ff40591f4 Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Patrick Venture <venture@google.com>
* Update Journal Variable NamesGunnar Mills2017-10-191-2/+4
| | | | | | | | | Journal entry variable names should be uppercase. https://www.freedesktop.org/software/systemd/man/sd_journal_print.html Also, fixed indentation. Change-Id: I2c838332ab7811ccc9a2c99f5b1f558c48f25f76 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Revert "Remove legacy reading of PS derating"Dhruvaraj Subhashchandran2017-10-041-0/+1
| | | | | | | This reverts commit 1bf3b749e9217f03fbc55bbb45802df9e715e3b0. Change-Id: Ib364199f4d676c2003450cad4b4d3d6077356fc1 Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
* Handle std::runtime_error exception in get sensor readingTom Joseph2017-10-031-0/+9
| | | | | | | Resolves openbmc/openbmc#2374 Change-Id: I596b5f0662b2506c8af4143ffa6438320d7bf4a2 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Remove legacy reading of PS deratingDhruvaraj Subhashchandran2017-09-251-1/+0
| | | | | | | Resolves openbmc/openbmc#2154 Change-Id: Ia5e150951fd077eddb4ee5a11d361eceee404e44 Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
* sensor: Use getFunc for TPM and RebootAttempt sensorTom Joseph2017-09-141-71/+0
| | | | | Change-Id: I8d7581e2c14344425683870daf395fc895d1034c Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* sensor: Use getFunc to handle the get sensor readingTom Joseph2017-09-141-3/+22
| | | | | Change-Id: If0f3185e7ce1d300be20b58ee5004a58e35c222d Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* sensor: Handle the response of find_openbmc_pathTom Joseph2017-09-141-9/+12
| | | | | | | | | | | The sensor path of the inventory items does not include the inventory root, so would fail in the case of find_openbmc_path. If the return code of find_openbmc_path indicates failure, then it is logged and allowed to continue. The call to find_openbmc_path would be eventually removed. Change-Id: I7513bf4ab9b897ff5b64cfb77fd504e6ef4e227a Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* sensor: Add function to map dbus info to assertion statusTom Joseph2017-09-141-2/+2
| | | | | Change-Id: I30aae9abd7905ae3299856d798d41e10859fed7f Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* sensorhandler: support setting analog sensorsEmily Shaffer2017-09-131-57/+106
| | | | | | | | | | | | | | | | | | Refactor YAML format to denote mutability of sensors. Sensors which expect different formats for reads and writes should present two entries in the sensor YAML, one with the read interface and one with the write interface. Sensors which share a format for both reads and writes may present only one entry in the YAML with both readable and writable enums specified. If a sensor receives a write which has an interface of Sensor.Value, the "Set" message is sent via DBus to the path provided in the YAML. The previous codepath is maintained. Change-Id: I292f95b6fe936de759fd65ce72c842a1bfe66448 Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Patrick Venture <venture@google.com>
* Support Power Supply derating sensorTom Joseph2017-09-071-5/+4
| | | | | Change-Id: I893d09a4ecb88507386e8b89015c4b53b18951c3 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* tpm: Support TPM Sensor type in Get sensor reading commandTom Joseph2017-08-231-3/+69
| | | | | Change-Id: Icf4a10d8f6e2b95dae3d7dcf789711c5a3a46a39 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* sensorhandler: correctly report data length in Reserve SDREmily Shaffer2017-08-161-0/+1
| | | | | Change-Id: I30a2641dcb548a3ff5141f7688942a748c458070 Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
* Refactor set sensor handling codeDeepak Kodihalli2017-08-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | A summary of the changes: - Do not generate per sensor type code to update d-bus objects corresponding to sensors. Function to update d-bus objects based on standard sensor event types, such as assertion, event data, are now generic functions - the need not be generated per sensor or per sensor type. - There's a special case where the assertion is treated as a reading (i.e read the entire assertion field as-is). In this case, code needs to be generated per sensor because the type of the mapped d-bus property can vary. In this case have a generic template function, and generate minimal code like so: inline ipmi_ret_t readingAssertion(const SetSensorReadingReq& cmdData, const Info& sensorInfo) { // Corresponding d-bus property is uint32_t return set::readingAssertion<uint32_t>(cmdData, sensorInfo); } - Make sensor-example.yaml succinct. - Make the code in writesensor.mako.cpp more pythonic. Change-Id: I84415ca6e3f756bbb51a90e290539eb086a7f78b Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Fix for reboot attempt and catch internal failures.Dhruvaraj Subhashchandran2017-08-101-1/+17
| | | | | | | | | | | The assumption was reboot attempt left will be sent through reading data in ipmi sensor data, but it is being sent as assertion so adding support to read raw data from assertion bits. Added a catch for internal failures while calling update function for sensors. Change-Id: If45d003c1c22f60e7c8a723c1ff9d077c53cad37 Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
* IPMI: Virtual sensor support in host ipmidDhruvaraj Subhashchandran2017-08-041-80/+4
| | | | | | | Resolves openbmc/openbmc#1608 Change-Id: Id76446061fd0fa6dc3dead702538e424293af7ce Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
* sensorhandler: Add functionality to use m, b, b_exp from config.yamlEmily Shaffer2017-07-171-23/+34
| | | | | | Change-Id: I1b5b8a5e0e5abd74eadde494728f363cf1ca4ec6 Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* sensorhandler: implement get SDREmily Shaffer2017-07-171-2/+157
| | | | | | Change-Id: I79dc59585c1f3008fc42e95a5a4792afd7268255 Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* sensorhandler: add reserve_sdrEmily Shaffer2017-07-171-13/+42
| | | | | | Change-Id: I58300910e4cdb0c889e030615a034443816ae5db Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* sensorhandler: add get_sdr_infoEmily Shaffer2017-07-171-0/+35
| | | | | | Change-Id: I13c82b62cec1c2f505fa81786fdc60cb38b2a636 Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* sensorhandler: add missing pointer initializationPatrick Williams2017-06-131-1/+1
| | | | | | | | | | An uninitialized pointer was being sent to 'free' in cases where a dbus object was not found to back a sensor. Fixes openbmc/openbmc#1740. Change-Id: Iaa62bfe460c47f4a51a506b0219879f0b6d46dd4 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* sensorhandler: modify Get Sensor Reading to use dbus interfaceEmily Shaffer2017-06-061-0/+56
| | | | | Change-Id: Ice16bda6c151b0865f3fa6e8234b8e2456d5b887 Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
* sensorhandler: Fixes for dbus->type conversion.Emily Shaffer2017-06-061-1/+10
| | | | | | | This enables Get Type IPMI command. Change-Id: I2e7ec6320d5e6a8eeb6566c6a4389b77c49bc92a Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
* sensorhandler: Refactor find_openbmc_path to check sensor map firstEmily Shaffer2017-06-061-10/+50
| | | | | Change-Id: I846d538643af77705d5160bf4d9127f758b5c749 Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
* sensorhandler: Refactor find_sensor to eliminate redundant callEmily Shaffer2017-05-191-14/+19
| | | | | | | | find_openbmc_path was being called within find_sensor as well as following find_sensor Change-Id: Ie94eab7afbe34f214a07bda49bfbce729b20f237 Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
* sensorhandler: removed un-needed sd_bus_refPatrick Williams2017-04-181-1/+1
| | | | | | | | sdbusplus's bus object has a change in semantics that no longer require a 'sd_bus_ref' call. See changes for openbmc/openbmc#1432. Change-Id: I6e953cfbd83abec1534e75b8fbf6c7e5b711ceb3 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* sensor: Reuse ipmid bus for inventory-notifyPatrick Williams2017-03-311-1/+1
| | | | | | | Partially fixes openbmc/openbmc#875. Change-Id: Id1cf69f5e4e5413d95ebeccf73abde1de76de3e4 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* Add Sensor Reading Support for Power Supply DeratingJayanth Othayoth2017-03-301-0/+1
| | | | | Change-Id: I0eb106c37c33db01937ec61dd5553b5799651633 Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
* Sensor Reading Support for Turbo AllowedJayanth Othayoth2017-03-281-0/+1
| | | | | Change-Id: Ib2e89383fa1da4d3216ad5c50d257ec973547b71 Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
* IPMI Sensor Support for Power Supply RedundancyDhruvaraj S2017-03-271-0/+1
| | | | | Change-Id: Id475849a77fd18e8f6b05c73f55866aba604c9a7 Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
* Modify set sensor reading commandTom Joseph2017-03-151-7/+110
| | | | | | | | | The Set Sensor handling code is modified to use generated code for CPU, Core & DIMM sensors with Presence & Functional offset. Change-Id: I3b7fa4da870b745873da4732d457d793f5549ada Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Add privilege level for each IPMI commandTom2017-01-171-6/+12
| | | | | Change-Id: I07f160c6ea83dc91f46e21f263c4cf994aff081d Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Fix type overflow in find_sensorBrad Bishop2016-10-061-4/+9
| | | | | | Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I700c5847685b4432c1da42ec470860f1785b9abf
* Print failing object path after failed bus lookupBrad Bishop2016-10-061-2/+4
| | | | | Change-Id: I599d8297b4d2fd45831443685ea5b7d53f1515b6 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Refactor the code related to Sensor handlingTom2016-09-231-2/+202
| | | | | | | | | The sensor related code is moved to sensorhandler.c. These changes were part of the ipmi daemon code and would have to replicated in RMCP daemon. The refactoring would get away with those changes. Change-Id: Ib9e1a1929282221e6f259e4a54502eea82f42939 Signed-off-by: Tom <tomjoseph@in.ibm.com>
* Modify respond of un-supported IPMI commandNan Li2016-09-091-1/+1
| | | | | | | | | | | A number of callbacks are registered for 'WILDCARD' types, which currently do nothing except respond with CC_OK(00h). Change complete codes to CC_INVALID(C1h). Resolves openbmc/openbmc#469. Change-Id: I91ea5ee1a23284a4159ff1c1867342e89c6fa444 Signed-off-by: Nan Li <william.bjlinan@hotmail.com>
* Allow out-of-tree buildsPatrick Williams2016-09-061-1/+1
| | | | | Change-Id: If4b97e65f63c3abbf23140dd97b9febe00b3be0d Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* Switch C++ source files to .cpp extensionMatthew Barth2016-08-081-0/+262
Change-Id: I495186b4afd58ec1e5d9d5c6472394f96541d17d Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
OpenPOWER on IntegriCloud