summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* watchdog: Get only the initialized property during resetWilliam A. Kennington III2018-05-223-3/+46
| | | | | | | | | | Since we switched to resetting the watchdog with a built-in method, we are only using a single property from the watchdog. Instead of fetching all the properties and reading just the initialized one, only request the initialized property from the watchdog. Change-Id: I5e29b5100629e1ce23f352b0b749a434cd1ab793 Signed-off-by: William A. Kennington III <wak@google.com>
* watchdog: Use ResetTimeRemaining for wd_resetWilliam A. Kennington III2018-05-223-6/+32
| | | | | | | | Using this helper method reduces the number of dbus calls made during each watchdog reset. Change-Id: I373db3babe03e05fca33eb4dbbbc7c07f95a39ea Signed-off-by: William A. Kennington III <wak@google.com>
* watchdog_service: Convert runtime errors to internal failuresWilliam A. Kennington III2018-05-221-2/+14
| | | | | | | | We want to better adhere to the openbmc convention of logging our errors and reporting and internal exception upstack. Change-Id: I78a277ed564b1ac269d84c024b75d2b0f534e911 Signed-off-by: William A. Kennington III <wak@google.com>
* watchdog: Handle and report internal failuresWilliam A. Kennington III2018-05-221-0/+26
| | | | | | | | | An upcoming change will introduce InternalFailures instead of using runtime exceptions for error handling in the watchdog service. We need to handle these exceptions appropriately. Change-Id: Icfc02d98821f307a37a4cf59911913c820e88744 Signed-off-by: William A. Kennington III <wak@google.com>
* Implement Get POH Counter commandNagaraju Goruganti2018-05-213-0/+73
| | | | | | | | | | It returns a counter value proportional to the system operating power-on hours. Partially Resolves openbmc/openbmc#2979 Change-Id: Ib0cd43fe5cbc055ae84991577d766bedae58d775 Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* watchdog: Retry dbus requests if the service was cachedWilliam A. Kennington III2018-05-111-0/+12
| | | | | | | | | | | | Right now if the phosphor-watchdog gets restarted, the first ipmi request querying it will fail and return all the way back up to the ipmi client. In this case, it would be nicer for the client if we retried the request once before reporting a failure. Resolves openbmc/phosphor-host-ipmid#111 Change-Id: I73fce5431911279f9c2e4389d32b671ed60c2305 Signed-off-by: William A. Kennington III <wak@google.com>
* utils/ServiceCache: Make isValid publicWilliam A. Kennington III2018-05-111-7/+7
| | | | | | | | | Some of our apps may want to know if the ServiceCache was determined to be valid prior to using it, so that they can retry their request in case the cache was stale. Change-Id: I106f11a18cd2290df9c18f29a8e779aacb5ef552 Signed-off-by: William A. Kennington III <wak@google.com>
* Fix get boot options returning unexpected resultsMarri Devender Rao2018-05-081-0/+16
| | | | | | | | | | | | | | | | | | | | | | | Get boot options is returning wrong value when boot device is set to cdrom followed by setting boot device to bios. In the IPMI spec the boot device selector has options for both "boot source" (default/disk/crdom/network) and "boot mode" (default/bios/safe/diag). Since this isn't a bit field, you can't override for eg both the source and mode at the same time. The solution is if a set boot device is mapping to a boot source, then reset the boot mode D-Bus property to default, or vice versa. This way the ipmid code can determine which property is not at the default value Resolves openbmc/openbmc#3067 Resolves openbmc/openbmc#3068 Change-Id: I072c82a161d56f118510fe1f9e5c75cb5c610295 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Add set boot source and boot mode methods for reuseMarri Devender Rao2018-05-081-39/+62
| | | | | | | | | setBootMode and setBootSource methods are introduced by refactoring code from ipmi_chassis_set_sys_boot_options for code reuse. Change-Id: I30b641239686b0411a0995468d098f5ad3d61754 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Fix Host time is not getting printed to journalNagaraju Goruganti2018-05-081-2/+4
| | | | | | | | | | | | log<level::DEBUG> is not putting Host time into journal, instead it is putting it in the metadata. Made fix for it. Testing: ipmitool sel time get # Host time:xxx XXX x xx:xx:xx xxxx will be # printed in into journal Change-Id: I0ba72a871469a30c605ee3ec91a07787959d5ae3 Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* Fix Sensor query for derating factor returns 0Nagaraju Goruganti2018-05-081-1/+28
| | | | | | | | | | | | | 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>
* Check the offset length in the Read FRU commandTom Joseph2018-05-081-0/+5
| | | | | | | | | | The offset length is validated against the size of the FRU area, before proceeding with populating the response of the Read FRU command. Resolves openbmc/openbmc#3132 Change-Id: I2bc660b7e389f5c85bac0acc8068dd53ab328a65 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Fix tabs to spacesMarri Devender Rao2018-05-081-6/+6
| | | | | Change-Id: I0d8205b378ab5044f58f528aad3b4fab7c993044 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
* Remove completion code from the response data structureTom Joseph2018-05-021-1/+0
| | | | | | | | | The completion code is the return parameter for the registered functions so should not be part of the response structure. Client applications like ipmitool will get the size wrong. Change-Id: Ibe082096f5002948f01636c6dfd7e54fadced2ef Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* MAINTAINERS: add repo-local MAINTAINERS fileEmily Shaffer2018-05-011-0/+69
| | | | | Change-Id: Id93e51694e527790209ad4511e4cefb154fe9887 Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
* Check if the FRU Id is valid for FRU commandsTom Joseph2018-04-231-2/+16
| | | | | | | | | | | Validate FRU Id before proceesing with the command handling. Do not report error log for any FRU command failure, since IPMI is an external interface. Resolves openbmc/openbmc#3016 Change-Id: I9e2af3ce50285662f1b8f9600222e9ff3057a7e3 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Remove trailing spacesGunnar Mills2018-04-185-38/+38
| | | | | Change-Id: I3a58137b3300fcfe51a4182eb304a1b70885ad30 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Grammar and spelling fixesGunnar Mills2018-04-185-13/+13
| | | | | | | | | | Spelling errors found using github.com/lucasdemarchi/codespell A tool to fix common misspellings. This tool is licensed under GNU General Public License, version 2. Some additional grammar and capitalization errors were fixed as well. Change-Id: I700db4e6d7ba52b02374c9c3e84be0af8bd91859 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Replace tabs with 4 spacesNagaraju Goruganti2018-04-182-136/+136
| | | | | | | replaced tabs with four spaces. Change-Id: Ib36bf7956a280921c45a7944a972c0f19fe39e5c Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* Implement RMCP+ cipher parameters in Get LAN Config parametersTom Joseph2018-04-182-0/+74
| | | | | Change-Id: Ic78965be94b1ba31149a05a29c1a768f06b492e4 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Reducing IPMI logging footprintAditya Saripalli2018-04-1818-222/+157
| | | | | | | | | | | | -host-ipmid is very noisy in terms of journal logging. A small step towards cleaning that up. -Also converted printfs to phosphor-logging. Partially Resolves openbmc/openbmc#2507 Change-Id: I749c19c18d1cabf6f0216830c8cb0a08ee43d6de Signed-off-by: Aditya Saripalli <aditya0124@gmail.com> Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* Fix FRU BuildDate DBus/IPMI exportingAndres Oportus2018-04-171-4/+25
| | | | | | | | | | | | | | | | When BMC exports the date into DBUS it translates/expands the 3 bytes FRU format date into an easy to read string as in "2015-11-06 - 22:23:00", when exporting the DBUS date back to IPMI it needs to translate back this date into the 3 bytes FRU format, without this fix we get a build date in 1996 that is the epoch for the FRU date format. This change reconstructs the FRU date from the easy to read string for exporting into IPMI. Tested: Manual check that BuildDate from busctl and ipmitool match Resolves openbmc/openbmc#3013 Change-Id: I0fd1dd8f945f18b53c14bff321c9e233fdb2d742 Signed-off-by: Andres Oportus <andresoportus@google.com>
* Implement Get Channel Cipher Suites commandTom Joseph2018-04-165-0/+212
| | | | | Change-Id: I8c808ce7e2bbd3ae5e225573138d7e04871f1643 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* sensorhandler: changed mutabiltity error code in get sensorJayanth Othayoth2018-04-111-1/+1
| | | | | | | | Changed mutability handling error code in get sensor from IPMI_CC_SENSOR_INVALID to IPMI_CC_ILLEGAL_COMMAND Change-Id: I599de08e3d3bc6a9820ac3978f0a4d160f19f55e Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
* sensorhandler: Enable mutability based set functionJayanth Othayoth2018-04-113-0/+15
| | | | | | | Resolves openbmc/openbmc#2980 Change-Id: I67afd4e84ec96e5cfc2dd315604d70f41c67a438 Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
* Fix error level lookupDeepak Kodihalli2018-04-111-17/+23
| | | | | | | | | | | | | | The mapping between an error level in the esel to a phosphor-logging error level was broken. This commit fixes it. This commits also specifies the error level while calling the error report() API, so that error D-Bus objects reflect the right error level (as per the esel). Resolves openbmc/openbmc#3014. Change-Id: I9891d468d98d169f73275a3693df4f3a2166001d Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Handle sensors that can not be found in SystemManagerLei YU2018-04-101-1/+8
| | | | | | | | | | | | | | | | | When a sensor id is not managed in yaml the code tries to get it from legacy SystemManager; And when the sensor id can not be found in SystemManager, it returns empty path, and cause segment fault. This commit makes it return -EINVAL when path is empty, and thus the code will handle this case properly without crash. Resolves openbmc/openbmc#3062 Tested: Boot host without ipmid crash on Romulus. Change-Id: I4240b9be54824543b5e795e898330aeb02c5eb90 Signed-off-by: Lei YU <mine260309@gmail.com>
* README: Reword cleaning the repoGunnar Mills2018-04-101-1/+1
| | | | | | | Reworded cleaning the repo. The old wording did not make sense. Change-Id: I129faed7b8de5781c4f67e77be6122937e4a6e5d Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Revert "Revert "Add chassis identify ipmi command.""Tom Joseph2018-04-042-2/+118
| | | | | | | | | | This reverts commit 82feb17d0c244ed04b82b0fbed3c0a9456986a86. The fix for armv5 futures is provided in yocto 2.4 Resolves openbmc/openbmc#3010 Change-Id: Ifc7e224f6f1fa115e0299642e8866b82d6e4f38c
* utils: Add a class to cache service lookupsWilliam A. Kennington III2018-04-022-1/+101
| | | | | | | | | | | Currently we are doing interface + path -> service lookups for each ipmi command sent to the daemon. For many types of commands this is not ideal as the daemon is unlikely to change often at runtime. Implement a basic cache with the ability to invalidate the service name at any time. This is used by code in a future commit. Change-Id: I85b04dd17ac19e31d49070f289704b429bd1e577 Signed-off-by: William A. Kennington III <wak@google.com>
* watchdog: Cache service nameWilliam A. Kennington III2018-04-022-8/+10
| | | | | | | | | | | | | | | | | | | | | We have occasionally noticed that the watchdog will be enabled and then immediately trip upon booting of the BMC. This happens if the host is still running when the BMC is coming up. Digging into the issue we notice that the phosphor-mapper can be under very heavy load responding to all of the initial mapping requests from BMC daemons starting. This causes a delay in the phosphor-watchdog service name lookup during an attempt to reset the watchdog countdown. The lookup delay is so long that the watchdog ends up tripping before the reset is actually issued, causing the BMC to reset the host. Since we know that the watchdog will not be armed until the service resolves for the first time, we can reduce the dependence and pressure on the service mapper by caching the service name. Since it is the case that we want to keep issuing resets to the same daemon that was initially configured, we should have no worries about invalidating the cached service name. The name will be invalidated any time we encounter a dbus level error issuing a watchdog commmand. Change-Id: I303a39be997c2e57050b71efc8ef2e2cb27f8cf7 Signed-off-by: William A. Kennington III <wak@google.com>
* Fixed broken "fru read" commandNagaraju Goruganti2018-03-272-15/+23
| | | | | | | | | | | | | | | | Fixed below given two issues: 1.We are getting seg-fault due to incorrect format specifiers for log-entry. 2.When requested data count plus offset exceeds fruArea size, we through error, instead we can return remaining bytes. Tested: 1.Verified using below given command. ipmitool -I lanplus -C 3 -P 0penBmc -H <BMP_IP> fru read <fru_id> fru_file Resolves openbmc/openbmc#2893 Change-Id: Iecfe80ed7230b936eca86fd16208582ee7b4e09c Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* Spelling fixesGunnar Mills2018-03-231-3/+3
| | | | | | | | | | Spelling errors found using github.com/lucasdemarchi/codespell A tool to fix common misspellings. This tool is licensed under GNU General Public License, version 2. Change-Id: I1d0551f8b7ceb7f74a975cae0a35ced15c01a74d Tested: Built the repo Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* SetLan: Fix the IP address if partial data givenRatan Gupta2018-03-201-1/+1
| | | | | | | | | | | | Presently when partial lan data is given the code was not getting the correct IP object,it was getting the linklocal address. This defect was introduced due to this commit c7c1c3c. This commit fixes this problem. Change-Id: I8f6d915cd3e1757ba28394cd93f16396e087d4f7 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* SetLan: Apply the network changes once the timer expiresRatan Gupta2018-03-203-35/+73
| | | | | | | | | | | | Start the timer once the set in progress parameter set to set complete as part of Set LAN Configuration Parameters command. Resolves openbmc/openbmc#2932 Resolves openbmc/openbmc#2993 Change-Id: Ie6f3b331531da23c74fa44bb52fa1ddccffabd13 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* Timer: Fix the timer expire property.Ratan Gupta2018-03-202-2/+4
| | | | | | | | | | | | | | | Presently when the call back associated with timer gets called then the expire property becomes true, which is correct as it tells the timer has expired and calls the callback. On the other hand it doesn't set the expire property to false when it starts the timer. This commit sets the expire property to false when startTimer function gets called. Change-Id: I0bb4fe3c375b2a73d214ba9ccbdf25f223b11449 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* SetLan: Move the setChannel access functionRatan Gupta2018-03-202-324/+325
| | | | | | | | | | | | | | | Move the function from app/channel.cpp to the transporthandler.cpp setChannel access is disabled now as the functionality to apply the network changes would be done through timer based approach. In later commit we would create this function as callback when the network timer expires. Change-Id: Ic128a47237b2ecdbc56267227105909f8886a862 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* setlan: Remove registration of handler for Set Channel AccessRatan Gupta2018-03-201-10/+0
| | | | | | | | | | | | | Presently through set channel access command we apply the network changes which is not a standard BMC implementation. It was decided that we should apply the network changes with the timer based approach. Timer based implementation would be done in later commits. This commit only removes the registration handler for set channel access command. Change-Id: Ic67c09d0f688d30be0fc7bfcda4f3290f89baf20 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* sensor: Refactor get sensor reading implementationTom Joseph2018-03-201-72/+75
| | | | | | | | | | Legacy sensors(org.openbmc) implementation is stubbed into a separate function for clarity. Sensor type lookup is needed to populate the reading for the legacy sensors, this was done for all the sensors. With this patch sensor type lookup is done only for the legacy sensors. Change-Id: Idd33e41669d8ad33529ad9ccdbed9d4da5ecda79 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* sensor: Fix set sensor reading for analog sensorsTom Joseph2018-03-161-15/+9
| | | | | | | Tested: Set temperature sensor to sensor object Change-Id: I77b8dcd6f298ca7b09aac475c2e8da4af5825940 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Change the byte order for aux firmware revisionTom Joseph2018-03-161-4/+4
| | | | | | | | | | According to the specification, any generic utilities should display each byte as 2-digit hexadecimal numbers, with byte 13 displayed first as the most-significant byte. This patch corrects the byte order so that byte 13 represents the most-significant byte. Change-Id: Ie71d2af6a9e9f14c8d1d12cea7e45a57aa15a3dd Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
OpenPOWER on IntegriCloud