summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix the exponent B in writesensors mako templateKirill Pakhomov2018-10-151-3/+3
| | | | | | | | | expB has been mistyped as exp() function, resulting in a build error upon providing bExp as signed integer in config.yaml Change-Id: Ibc7ed45e445c4f37b7a6ccdf10346177a3317b0b Signed-off-by: Kirill Pakhomov <k.pakhomov@yadro.com>
* types: Convert ScaledOffset to doubleEmily Shaffer2018-10-111-1/+1
| | | | | | | | | | | ScaledOffset is derived from incoming int64 using pow() and there is a use case for having a fractional or negative ScaledOffset. Since it's derived internally and applied internally this change should have no impact on external interfaces. Change-Id: I419e4de089d3845295157fff440c5d8e029e7c96 Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Tested: Ran ipmitool sensor list to check value sanity
* Fix IPMI SEL reservations and cancellationsJason M. Bills2018-10-053-16/+43
| | | | | | | | | | | | | | | | | | | | | | | Per the IPMI Spec, the SEL must be reserved to Delete an entry Clear the SEL Get a partial entry Add a partial entry The current SEL reservation must be cancelled when A SEL entry is added A SEL entry is deleted The SEL is cleared The device is reset A new reservation is requested This change adds a reservation status to track when a reservation is active and a method to cancel the current reservation, and it uses that to cancel the reservation in the Delete, Clear, and Add SEL methods. Change-Id: Ifd72e6d06ecc622855bd9ce8cc3928cbd0f2c34b Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
* Fix clang-format issue in sensorhandler.cppJason M. Bills2018-10-051-4/+3
| | | | | | | | | | A clang-format issue in sensorhandler.cpp was introduced by commit 0fbdbce22771dac6fe8d651e4c8155645807b83d that is causing CI to fail for changes to phosphor-host-ipmid. This commit updates sensorhandler.cpp with the latest clang-format changes. Change-Id: If37a25c50ee04264ce55c8c7959a4fee2aba4045 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
* Fix compile error with g++ 7.3Yong Li2018-10-051-0/+1
| | | | | | | | | | Get the below error message when compiling with g++ 7.3: selutility.hpp:131:6: error: 'chrono' in namespace 'std' does not name a type Change the include order to fix this issue Change-Id: Ieaac302dd2e411a71736cbbe3f92431e30f3f5ea Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
* apphandler: Fix buffer underflow in ipmi_app_get_device_guidEmily Shaffer2018-10-011-0/+12
| | | | | Change-Id: I7e27130bbe8bfc847f81968d850abacb8914ad78 Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
* sensorhandler: fix buffer overflow in Get SDREmily Shaffer2018-10-011-3/+17
| | | | | Change-Id: Id49f6294a506a870696554715b4835c7d7e6207b Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
* sensorhandler: fix buffer overrun in ipmi_fru_get_sdrEmily Shaffer2018-09-281-11/+6
| | | | | Change-Id: Ic12598027a92495e49f7cb06aa28f77c0727be44 Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
* openbmc oem code: add ethStatsCmdPatrick Venture2018-09-251-0/+1
| | | | | | | ethStatsCmd is used by phosphor-ipmi-ethstats Change-Id: I481bf00b71cd483720c1d4824f7267a0c1e7e51f Signed-off-by: Patrick Venture <venture@google.com>
* add std namespace prefix to common methodsPatrick Venture2018-09-2510-158/+182
| | | | | | | | Standard clib methods should be explicitly grabbed from the standard namespace. Change-Id: I8bcfcb260a99180d535ec8102c1a24c318cbc209 Signed-off-by: Patrick Venture <venture@google.com>
* move filesystem inclusion to bottom of listPatrick Venture2018-09-256-82/+80
| | | | | Change-Id: I4aa3c984992236bb5b4a5c62c3d42a33c12d55de Signed-off-by: Patrick Venture <venture@google.com>
* oemrouter: add std namespace where missingPatrick Venture2018-09-251-16/+17
| | | | | | | | Found the std namespace declaration missing. It's not required, but encouraged. Change-Id: I83a90ad768f5b8aada98cfd02e244df34008e03d Signed-off-by: Patrick Venture <venture@google.com>
* replaced c headers with cpp where applicablePatrick Venture2018-09-2513-36/+13
| | | | | Change-Id: I23a70eb540ccde5d2aba467426769feffb07b516 Signed-off-by: Patrick Venture <venture@google.com>
* rename headers to match stylePatrick Venture2018-09-2536-115/+87
| | | | | | | | | | | | | | | | | | Moving headers from ".h" to ".hpp" Reworked the header inclusion a bit so that host-ipmid is treated as a library, and local headers aren't. renamed apphandler.h => apphandler.hpp renamed chassishandler.h => chassishandler.hpp renamed globalhandler.h => globalhandler.hpp renamed sensorhandler.h => sensorhandler.hpp renamed storageaddsel.h => storageaddsel.hpp renamed storagehandler.h => storagehandler.hpp renamed systemintfcmds.h => systemintfcmds.hpp Change-Id: I9d4ce3dd57e2e996800f9020a10cc10cdf2c3914 Signed-off-by: Patrick Venture <venture@google.com>
* apphandler: Add "System Name" System Info parameterXo Wang2018-09-251-0/+15
| | | | | | | | | Use the BMC's hostname to respond to requests for the "System Name" parameter. Signed-off-by: Xo Wang <xow@google.com> Change-Id: I23845aab6091a0d003b6f8370d2b67fc11e580e8 Signed-off-by: Patrick Venture <venture@google.com>
* apphandler: Implement Get/Set System Info ParameterXo Wang2018-09-253-8/+193
| | | | | | | | | | | | | | | | Implement Get System Info Parameter using the parameter storage code to back the string-type parameters. Supports up to 255 chunks (known as "sets" in the spec) for those parameters. Currently, iterated reads by chunk of a string parameter will repeatedly invoke that parameter's callback, which can result in chunks being incoherent with each other if the string changes between invocations. This is noted in a TODO comment. Stub out Set System Info Parameter. Full implementation for that is pending support for read-only flags in the parameter storage code. Change-Id: If0a9d807725ccf1f1f62e931010024841575469c Signed-off-by: Xo Wang <xow@google.com> Signed-off-by: Patrick Venture <venture@google.com>
* Get Device ID: Add handling of availability bitAlexander Amelkin2018-09-251-2/+32
| | | | | | | | | | | Make "Device available" bit in Firmware Version 1 field reflect the ready state of BMC as indicated in DBus by CurrentBMCState property of xyz.openbmc_project.State.BMC interface. Change-Id: Ic108507882c68d6cc70b40849668732f7b759ef6 Signed-off-by: Alexander Amelkin <a.amelkin@yadro.com> Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
* Implement Set Channel access commandTom Joseph2018-09-252-0/+128
| | | | | | | | The only option supported is the access mode for disabling or enabling the network IPMI. Change-Id: I2e6b20c317fec19e1e71b3adfc211e6fb847f737 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Implement chassis set power restore policy commandYong Li2018-09-253-0/+94
| | | | | | | | | | | | | | | | | | Implement the IPMI set power restore policy command 0x06. This command can be used to configure the power restore policy. This configuration parameter is kept in nonvolatile storage. The power restore policy determines how the system or chassis behaves when AC power returns after an AC power loss Tested: Run the below command to check the current Power Restore Policy: ipmitool -H <IP> -P 0penBmc -I lanplus chassis status Run the below command to change it: ipmitool -H <IP> -P 0penBmc -I lanplus chassis policy always-off Change-Id: I224912890f9a9e8b4dc98f840cd6f223c9f7dfe5 Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
* apphandler: Add storage for Get/Set System Info ParameterXo Wang2018-09-243-0/+100
| | | | | | | | | | | All but one standard System Info Parameter and most (all?) OEM parameters are string type. Add a interface to connect string callbacks to System Info Parameter selector codes. Also add a convenience call that can connect a static string to a parameter selector code. Change-Id: I5e35d0418b8ddf5b2575fac093acfc7d7ca2217c Signed-off-by: Xo Wang <xow@google.com> Signed-off-by: Patrick Venture <venture@google.com>
* sensorhandler: Remove legacy functionsAdriana Kobylak2018-09-241-213/+3
| | | | | | | | | | | | | | The legacy sensors in the /org/openbmc/sensors path have been moved to the phosphor-ipmi-sensor-inventory%/config.yaml files and this path has been deprecated (From openbmc/openbmc rev: 8de4ff9fe3e3a5cbd7af150c126e97b182aa44cc). Remove the legacy functions that searched this deprecated path. Tested: Powered on a witherspoon to the host OS and there were no errors for the sensors that were moved out of the old path. Change-Id: Ifced118defdb3fe30abf26e332d847e8d3707477 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* app/watchdog: Only log internal failures onceWilliam A. Kennington III2018-09-211-10/+35
| | | | | | | | | | | | | | | | | Logging internal failures to the phosphor-logger is a slow process that can take up to 5 seconds. If we do this for each watchdog reset for a relatively fast watchdog we will clog up the channel and fill the ESEL log with errors. We probably don't want that kind of information to build up. Instead, only report errors to the ESEL when the state of the internal watchdog transitions from HEALTHY -> UNHEALTHY. Tested: Works on zaius when booting and terminating the watchdog daemon while it is ticking. Produces the expected single error in the log and only delays the IPMI channel once. Change-Id: I8110ba66c4a85e188666a34cb6d055bdbec30622 Signed-off-by: William A. Kennington III <wak@google.com>
* storagehandler: add missing cstdint headerPatrick Venture2018-09-121-0/+2
| | | | | Change-Id: I3837f2f3219e6b641ebb237a405ce36bd2374c0f Signed-off-by: Patrick Venture <venture@google.com>
* openbmc oem code: add blobTranserCmdPatrick Venture2018-09-121-0/+1
| | | | | | | BlobTransferCmd is used by phosphor-ipmi-blobs Change-Id: I48b0e7a764d7fb5fb834320fbe415e4849f06cd8 Signed-off-by: Patrick Venture <venture@google.com>
* Handle SdBusError exception in SEL commandsTom Joseph2018-09-121-11/+41
| | | | | Change-Id: Ia79b3e2ea4ca8783c912c9864be32107d170d561 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* add iana header to store OEM NumbersPatrick Venture2018-09-104-9/+23
| | | | | | | | The iana.hpp header is installed to identify OEM IPMI numbers used, to avoid namespace conflicts. Change-Id: Ifd629817e3b921f86a5ea4cf2c2965a44a2d8201 Signed-off-by: Patrick Venture <venture@google.com>
* add .clang-formatPatrick Venture2018-09-0767-4365/+4311
| | | | | Change-Id: I7c2a527b4751a560703a61fcbe9638b150546af5 Signed-off-by: Patrick Venture <venture@google.com>
* add missing header: mapPatrick Venture2018-09-061-0/+2
| | | | | Change-Id: I453bad9fa811934daea59fdb9a2cc51524403783 Signed-off-by: Patrick Venture <venture@google.com>
* Add -flto to CXXFLAGSAndrew Geissler2018-08-271-3/+6
| | | | | | | | | | Per openbmc/openbmc#3364, adding -flto to CXX flags in order to reduce overall library and binary sizes. Ref: https://gcc.gnu.org/wiki/LinkTimeOptimization Change-Id: Idacb03d1ce6ad0253979f5e8b2638ac5129a6216 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
* Use visitor instead of pulling values directlyJames Feist2018-08-092-4/+29
| | | | | | | | | | | Sensor thresholds pull out an int64_t and immediately assign it to a double. Use a visitor instead to avoid the intermediate and add flexibility / saftey to type readings. Tested-By: Verifed sensor list still worked. Change-Id: If49bf54ec1c0636b3549d433b86ecdbd1ea99b0d Signed-off-by: James Feist <james.feist@linux.intel.com>
* Handle the case to turn off the Chassis Identify LEDTom Joseph2018-08-081-0/+6
| | | | | | | Resolves openbmc/openbmc#3327 Change-Id: Ib0cbfccdd91b6cdd2267a48b312d2736a4ce8fbc Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Add flags to Makefile.am to build as c++17 and header-only boostVernon Mauery2018-08-082-3/+10
| | | | | | | | | | As the project moves forward, we are updating it to use c++17 and some of the features that it offers, as well as some more boost bits. This patch makes sure that all the boost libraries are header only, adds in c++17, and makes sure that the libraries required are linked properly. Change-Id: I9a25ec971e4bf05c2c3b73e20938cf337e06077c Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
* rename libapphandler.so to libipmi20.soVernon Mauery2018-08-081-8/+12
| | | | | | | | | libapphandler contains way more than just App commands. This should be the base library that contains all of the default implementations of IPMI 2.0 commands. Change-Id: Ie12f706325808c9dd52d186d4e4406424052510b Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
* Standardize use of filesystemVernon Mauery2018-08-086-7/+67
| | | | | | | | | If <filesystem> exists, use that, if it doesn't, try <experimental/filesystem>. Either way, access it from std via a namespace splice. Change-Id: I5b35ee9f74b88e188cb3ca3fed9abaec64933697 Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
* add more files to the .gitignore listVernon Mauery2018-08-071-0/+10
| | | | | | | | This includes editor temp files, patch rejects, and other build/debug artifacts. Change-Id: I06c52dc36568baae73c1981034f1adf3ede87a82 Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
* Incorrect definition for Chassis net functionsKuiying Wang2018-08-021-1/+1
| | | | | | | | | | The enum definition for Chassis net functions in chassishandler.h is wrong. It should be defined as ipmi_netfn_chassis_cmds but not ipmi_netfn_app_cmds which is defined in apphandler.h. Change-Id: I26680d19b8c3be7ae2f832f851149352f0ed6303 Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
* Add empty default match argument for getAllDbusObjectsVernon Mauery2018-08-011-1/+1
| | | | | | | This is parallel to other functions defined in utils.hpp Change-Id: I8f40e27d1a179258df5059c27066c8cd1b37a260 Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
* Validate Mfg Date/Time in Board Info AreaNagaraju Goruganti2018-07-311-2/+5
| | | | | | | | | | | -FRU's Mfg Date/Time is the number of minutes from 0:00 hrs 1/1/96 and a 3 byte field length for Mfg Data/Time in Board Info Area. -So max Mfg date equals to 1006632900 secs from 00:00:00 hrs 1/1/1996. Resolves openbmc/openbmc#3202 Change-Id: I6a71b8b881b699195fee2a18b743e195fa4703a5 Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* test: disable OEM router unit-testsPatrick Venture2018-07-251-3/+4
| | | | | | | Until Issue #3325 is resolved, this will make the CI stable again. Change-Id: I5156f1fed153586512d184c973a8be4036620d19 Signed-off-by: Patrick Venture <venture@google.com>
* Add OemRouter facility.Peter Hanson2018-07-259-7/+453
| | | | | | | | | | | | | OemRouter adds a facility to register OEM Group Message handlers, then dispatch matching messages to the registered handler. Added as a core source so that any dynamic provider can register its messages without requiring any specific load order. Includes code fixes for x86 portability. Change-Id: I47b8fe7873e3c7fdf35a00d3c8a7e17d30c398c4 Signed-off-by: Peter Hanson <peterh@google.com> Signed-off-by: Patrick Venture <venture@google.com>
* Clear host command queue on a power onMatt Spinler2018-07-242-1/+70
| | | | | | | | | | | | | | | | | | | | | When the RequestedHostTransition property changes to On, clear any pending commands in the command queue. This is done to avoid race conditions around state transitions as well as other scenarios like the following: 1) Host is already off 2) RequestedHostTransition is set to Off 3) RequestedHostTransition is set to On 4) Host powers on 5) Host immediately powers off because of the pending command sent in 2). Resolves openbmc/openbmc#3207 Tested: Verified the scenario above no longer occurs. Change-Id: I26c8195c305c75b01333d1b10ff4bf16d76b91a6 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Correct the formatting of the network commands documentTom Joseph2018-07-241-6/+6
| | | | | | | The ipmitool commands are placed in the code block. Change-Id: I787dff9d6acd77ceaa1c6251b4287c2367212cad Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Fix to return sane error codeRichard Marian Thomaiyar2018-07-241-4/+17
| | | | | | | | | | | | | | Any unhandled exception in the IPMI command handler crashes the ipmi stack. IPMI command handler also becomes bulky to catch all exceptions which must return unspecified errors. This fix adds a catch in the ipmi router command handler functions, and returns IPMI_CC_UNSPECIFIED_ERROR for all the unhandled exceptions. With this fix, exceptions which has to throw IPMI_CC_UNSPECIFIED_ERROR, doesn't needs to be handled in the command handlers. Change-Id: I6cf9fa1f0e5c1d71c57eebb9a2d451fa986168d3 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* app/watchdog_service: More useful error outputWilliam A. Kennington III2018-07-181-13/+45
| | | | | | | | This patch adds error handling around the decoding of requests to the watchdog service, to give more useful context in the case of errors. Change-Id: If668b17e88dc65a938b69d8c2cdd760456170962 Signed-off-by: William A. Kennington III <wak@google.com>
* Add code coverage for phosphor-host-ipmid.Emily Shaffer2018-07-183-5/+18
| | | | | Change-Id: I940aadefdf0f78182aad1d4e586e3178e2d2fe97 Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
* Docs: Add IPMI command cheatsheetRatan Gupta2018-07-171-0/+36
| | | | | | | Adding the network configuration commands Change-Id: I0542e1266d3bf71c813c3d449bb2838f0dc887cf Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Add double to ipmi::Value typeJames Feist2018-06-151-3/+3
| | | | | | | | ipmi::Value is used as the type in setDbusProperty. As properties are allowed to be doubles, add it to the type. Change-Id: I3d2dd5063100b8e73732740ce056fc476a7e1e44 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Use s.c_str() in log messagesJoseph Reynolds2018-05-317-16/+16
| | | | | | | | | | Fixes issues with data passed to phosphor::logging::log(entry()). This is part of a series of commits that resolves openbmc 2905. Tested: static_assert only Change-Id: I9fac771f54e4acbec97ce1360c106b6e3eb4fe9d Signed-off-by: Joseph Reynolds <jrey@us.ibm.com>
* Fix D-Bus error from callback method invoked from async threadMarri Devender Rao2018-05-231-74/+105
| | | | | | | | | | | | | Noticed D-bus method invoked as part of the callback method invoked from async thread returns error Switching to use sd_event loop timer for callback after timer expiry Resolves openbmc/openbmc#3130 Change-Id: Ibe87a6b3aa179cc887593c7dea635c11d9ea844c Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Edit MAINTAINERS fileRatan Gupta2018-05-231-0/+1
| | | | | | | Proposing myself as a reviewer. Change-Id: Ie5303cf029980deeced20764d98b86dd7012aff5 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
OpenPOWER on IntegriCloud