summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Refactor ipmi::sensor::GetSensorResponse away from std::arraySui Chen2019-10-285-48/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change refactors GetSensorResponse from std::array to struct. This change depends on change #23544. GetSensorResponse is an internal, intermediate structure, an unpacked form of a Get Sensor Reading response, providing direct access to its fields. Its life time is: GetReadingResponse -> GetSensorResponse -> ipmi::RspType. It is written to in 5 functions in the ipmi::sensor::get namespace, by four setter functions (setOffset, setReading, setAssertionBytes, enableScanning). It is currently read from by 1 function (ipmiSensorGetSensorReading) for transforming to an ipmi::RspType. Originally, the setter functions assumed bitwise equivalence between GetSensorResponse and GetReadingResponse, and the setter functions used reinterpret_cast to assign to a GetSensorResponse as if it were a GetReadingResponse. With this change, the reinterpret_cast's are removed, and the set functions now accept GetSensorResponse instead of GetReadingResponse, so the code gets a bit easier to read. Tested: Tested using a server with a BMC; sensor readings obtained through `ipmitool` appear to be correct (the reading might change within a small range): # ipmitool raw 0x04 0x2d 0x16 9B 40 00 00 Signed-off-by: Sui Chen <suichen@google.com> Change-Id: I5d454d6249f5431fb98169e6ef7c585c34024004
* sensorhandler: move get sensor reading to new APIjayaprakash Mutyala2019-10-281-29/+71
| | | | | | | | | | Rewrite: "Get sensor reading" command to new IPMI provider API. Tested: verified using ipmitool sensor commands. Signed-off-by: jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> Change-Id: I61eb77216820795d6e422a69fc1f4314167373ff
* Implemented get session info cmd in host interfaceRajashekar Gade Reddy2019-10-252-1/+277
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This command can get info of any session Tested all positive and negative test cases Tested: Get active session info by valid session handle ipmitool raw 0x6 0x3d <sesssion index = search session by handle> <valid session handle> Response : successfully gets the session info as per IPMI spec Get active session info by valid session id ipmitool raw 0x6 0x3d <sesssion index = search session by id> <valid session id> Response : successfully gets the session info as per IPMI spec Get inactive session info by valid session handle ipmitool raw 0x6 0x3d <sesssion index = search session by handle> <valid session handle> Response : successfully gets the session info as per IPMI spec Get inactive session info by valid session id ipmitool raw 0x6 0x3d <sesssion index = search session by id> <valid session id> Response : successfully gets the session info as per IPMI spec Get session info by invalid session handle ipmitool raw 0x6 0x3d <sesssion index = search session by handle> <invalid session handle> Response : 0x88 // Inavlid Session Handle Get session info by invalid session id ipmitool raw 0x6 0x3d <sesssion index = search session by id> <invalid session id> Response : 0x87 // Inavlid Session Id Signed-off-by: Rajashekar Gade Reddy <raja.sekhar.reddy.gade@linux.intel.com> Change-Id: Ib36a9fe5eac58d15011cc9379ceed480ba0be96d
* channel:Fix get channel ciphersuite - payloadtypesjayaprakash Mutyala2019-10-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Issue: Get channel CipherSuite command passed with invalid payload type Fix: Added the check now to allow only valid payload types Tested: Command: ipmitool raw 0x06 0x54 0x01 0xff 0x80 Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 cmd=0x54 rsp=0x80): Unknown (0x80) Command: ipmitool raw 0x06 0x54 0x01 0x12 0x80 Response: 01 c0 03 01 41 81 c0 11 03 44 81 Command: ipmitool raw 0x06 0x54 0x01 0x09 0x80 Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 cmd=0x54 rsp=0x80): Unknown (0x80) Command: ipmitool raw 0x06 0x54 0x01 0x02 0x00 Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 cmd=0x54 rsp=0x80): Unknown (0x80) Command: ipmitool raw 0x06 0x54 0x01 0x12 0x00 Response: 01 01 03 41 44 81 Signed-off-by: jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> Change-Id: I552250736d7e898191ddbb45fd1bff42681b9c63
* Create framework for IPMI OEM extension commandsJohnathan Mantey2019-10-243-0/+89
| | | | | | | | | | | | | | | IPMI has four commands that accept "OEM Parameters". The existing IPMI command handlers do not account for these OEM extensions. This commit adds OEM Parameters support for the Set/Get LAN Configuration Parameters commands. Tested: ipmitool raw 0xc 1 3 0xc0 0 ;; received 0x80 return code ipmitool raw 0xc 2 3 0 0 ;; received 0x80 return code Change-Id: I81135b6d3269cec98ffd7754a03201a74c436c11 Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
* transporthandler: Support Gateway MACWilliam A. Kennington III2019-10-241-15/+182
| | | | | | | | | Adds support for setting the MAC address of the gateway. Most of the interesting code in this change is around saving / restoring the gateway MAC address when the gateway or interface change. Change-Id: I85b7c665c44af4f030f51456be355f3eb11ab2fc Signed-off-by: William A. Kennington III <wak@google.com>
* Clean-up: entry code msgs in user_channel cpp filesAyushi Smriti2019-10-183-34/+34
| | | | | | | | | Cleaning up phosphor logging entry messages from the usage of ':' to '=' in the whole user_channel dir cpp files. Signed-off-by: Ayushi Smriti <smriti.ayushi@linux.intel.com> Change-Id: Ifa8eb35751279cf6bebd876105b7a4d24deb98a0
* Restore IPMI RMCP+ cipher suite commandsJohnathan Mantey2019-10-171-6/+71
| | | | | | | | | | | | | | The work done to migrate this file from the old IPMI calling structure to the new calling structure removed the RMCP+ cipher suite commands. The prior commit was approved on the condition these commands be restored. Tested: ipmitool raw 0xc 2 1 22 0 0 ; returns correct cipher count ipmitool raw 0xc 2 1 23 0 0 ; returns the active cipher ID's Change-Id: Ie0ac0fb066f53772174e7e61d2c81ae876b6c2e3 Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
* docs: add contributing guidelinesEmily Shaffer2019-10-171-0/+122
| | | | | | | | | | | For some time now we the maintainers have been requesting things like 50/72 commit messages, unit tests, Tested: footers, etc. But these requirements haven't been written down. This document is an attempt to codify some of the unwritten rules of contribution in the OpenBMC IPMI stack. Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Change-Id: Ieb7a72f89f44374efbbe7265c7341338f6850158
* Data checking fix for watchdog set/get commandsYong Li2019-10-113-26/+31
| | | | | | | | | | | | | | | | | | data length check for timeout action and byte 1 reserved field check are missing, causing not to throw the error; Log flags is on bit 7, also needs to right-shift this flag; This commit fixes these issues; Tested: Set different timer use/actions: ipmitool raw 0x06 0x24 0x85 0x0 0x0 0x0 0x64 0x00 ipmitool raw 0x06 0x24 0x84 0x1 0x0 0x0 0x64 0x00 Check the settings are correct: ipmitool raw 0x06 0x25 Signed-off-by: Yong Li <yong.b.li@linux.intel.com> Change-Id: Ia4226bb4597d2c670f93522aa763e43d15eb6cf1
* add "set system info" commandJia, chunhui2019-10-111-15/+108
| | | | | | | | | | | | | | | | | | | | | | Set/get system info commands are pair commands that customer could use to save/restore system specified infomation like machine serial numbner/OS version/.. etc. One typical scenario is that customer could check current OS version even when tareget system is powered off. Current openbmc implements "Get system info" but "Set system info" is not available. This changes implements "Set system info" command. Tested: :~# ipmitool raw 0x6 0x58 0x1 0x0 0x0 0x2 0x30 0x31 :~# ipmitool raw 0x6 0x59 0x0 0x1 0x0 0x0 11 00 00 02 30 31 :~# ipmitool raw 0x6 0x59 0x0 0x1 0x1 0x0 Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 cmd=0x59 rsp=0xc9): Parameter out of range Change-Id: Iaa66e30bcec708e28a01c2e81d612e6ffdd36383 Signed-off-by: Jia, chunhui <chunhui.jia@linux.intel.com>
* transporthandler: Rewrite + New HandlerWilliam A. Kennington III2019-09-277-1215/+993
| | | | | | | | | | | | | | | | | | This rewrites the old transport handler to use the new ipmi handler registration functions. It attempts to clean up the old code, by refactoring any business logic out of the code that parses the IPMI messages. This makes the code paths easier to understand and allows for better code re-use. This also gets rid of the concept of the settings change timer. Clients expect to see their settings take effect as soon as they are set, regardless of the "Set In Progress" flag. This means we no longer need a cache for our network settings that are about to be set by the daemon, and a client can hold the BMC in "Set In Progress" while it verifies settings like other BMC implementations. Change-Id: I5406a674f087600afdfc2c0b3adeacde10986abc Signed-off-by: William A. Kennington III <wak@google.com>
* Implemented close session cmd in host interfaceRajashekar Gade Reddy2019-09-256-0/+336
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This command can close any session via host interface. Tested: Close the existing valid session by session id ipmitool raw 0x6 0x3c <valid sesssion id > Response : 00 // success Close the existing valid session by session handle ipmitool raw 0x6 0x3c <zero session id> <valid session handle> Response : 00 // success Close the session by zero session id ipmitool raw 0x6 0x3c <zero session id> Response : 0x87 // inavlid session id Close the session by zero session handle ipmitool raw 0x6 0x3c <zero session id> <zero session handle> Response : 0x88 // inavlid session handle Close an inactive session. ipmitool raw 0x6 0x3c <valid session id> Response : 0xcc // invalid data field in request Close an inactive session. ipmitool raw 0x6 0x3c <zero session id> <valid session hnadle> Response : 0xcc // invalid data field in request Signed-off-by: Rajashekar Gade Reddy <raja.sekhar.reddy.gade@linux.intel.com> Change-Id: I8af290001d8effbbcdbbe2dd93aabf1b015e7a88
* Fix: execute get channel cipher suite in lan chanAyushi Smriti2019-09-251-0/+9
| | | | | | | | | | | | | | | | | | Get channel cipher suites command was executed for non lan channels. Fixing the same by adding active lan channel support check. Tested: ipmitool raw 0x06 0x54 0x01 0x00 0x80 01 c0 03 01 41 81 c0 11 03 44 81 //cmd executed for lan chan 1 ipmitool raw 0x06 0x54 0x00 0x00 0x80 Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0 cmd=0x54 rsp=0xcc): Invalid data field in request //cc resulted for non lan chan 0 Signed-off-by: Ayushi Smriti <smriti.ayushi@linux.intel.com> Change-Id: Ic3c2dfa3f4537be789e2afc912fa8f4c2a49bda4
* Fix: refactor get channel cipher suite commandAyushi Smriti2019-09-254-78/+57
| | | | | | | | | | | | | | | Get channel cipher suites command updated as per new ipmi structure. Tested: ipmitool raw 0x06 0x54 0x01 0x00 0x80 01 c0 03 01 41 81 c0 11 03 44 81 //response Also verified by issuing cmd: ipmitool channel getciphers ipmi 0x01 which listed supported CIA algorithms as response Signed-off-by: Ayushi Smriti <smriti.ayushi@linux.intel.com> Change-Id: Ibc942f5b197c72071cd35a138fbe244db7519824
* Handle exceptions correctly in GetSelTime and SetSelTimeTom Joseph2019-09-251-2/+2
| | | | | | | | Tested: Ensured that the exception is caught in the command handler and printed on the journal Change-Id: I8b45bd154d0fe7f698487a19d01b1dd709c77c75 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* Channel: Fix atomic lock issue for file copyRichard Marian Thomaiyar2019-09-241-0/+3
| | | | | | | | | | | | | | | Atomic lock was missing in between volatile / non-volatile channel configuration check and restore. This was causing random failure when instances init channel management code. Fixed the same, by having a lock for init channel. Tested: 1. Verified that existing ipmitool commands still works including user & channel commands 2. Verified that random failure doesn't happen. Change-Id: I612917ea1a767e353d0b16b7dd9144e0e99d46e7 Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
* Static code analysis scan issue fixChen,Yugang2019-09-233-4/+5
| | | | | | | | | | | | | Fix the issues found during code static scan Tested: test in board, function works fine. 1. busctl set-property for watchdog, it works fine. 2. It works by running "ipmitool chassis power soft". 3. run "ipmitool raw 0x6 0x46 1", get expected user information. Change-Id: I7a2cc3c934db6a7531f8a8ea05956cb6d6337633 Signed-off-by: Chen,Yugang <yugang.chen@linux.intel.com>
* Update GetSystemInfo with new APIJia, chunhui2019-09-231-132/+61
| | | | | | | | | | | | | | | | | | | Tested: verified with ipmitool raw command ipmitool raw 0x6 0x59 0x0 0x0 0x0 0x0 11 00 ipmitool raw 0x6 0x59 0x80 0x0 0x0 0x0 11 ipmitool raw 0x6 0x59 0x81 0x0 0x0 0x0 11 ipmitool raw 0x6 0x59 0x82 0x0 0x0 0x0 11 ipmitool raw 0x6 0x59 0x0 0x2 0x0 0x0 11 00 00 0a 69 6e 74 65 6c 2d 6f 62 6d 63 00 00 00 00 Change-Id: I2e648faa43fb8405b3cdd2f021fc1a12a78b4752 Signed-off-by: Jia, chunhui <chunhui.jia@linux.intel.com>
* drop entity YAML in favor of json provided filePatrick Venture2019-09-196-118/+30
| | | | | | | | | | Step 5 of moving from entity map from YAML to JSON drops support for a built-in YAML mapping of the entity containers. Tested: Not tested. No platform upstream updates this YAML file in their builds. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: Ic2918f568f5a6f4a9f9135990889b3bb84a0c81d
* sensorhandler: use entity-map from json if filledPatrick Venture2019-09-193-5/+57
| | | | | | | | | | Step 4 of the transition from YAML to JSON will return the data from the JSON file if present and valid, otherwise it'll fallback and return the default example YAML present in the repository. Tested: This was not tested. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I33c773fc53660a9eb5e27a8c8c3e231c64fe079d
* entitymap: move accessor to separate modulePatrick Venture2019-09-174-15/+14
| | | | | Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I8c80acb694d067043b77d81dbb9a7ba0057fef56
* move sensors into ipmi::sensor namespacePatrick Venture2019-09-173-19/+39
| | | | | | | | The object was left in the global namespace, but the type was in the ipmi::sensor namespace. Move the object into the namespace. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I88e46da4abda220d3b6fcc2ea64b8ef0decb0dc3
* move entities into ipmi::sensor namespacePatrick Venture2019-09-172-6/+18
| | | | | | | | The object was left in the global namespace, but the type was in the ipmi::sensor namespace. Move the object into the namespace. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: If3aa72ebbae980b0b837c45c8fcbc4b47b7fb742
* writeentity: add missing header utilityPatrick Venture2019-09-171-0/+2
| | | | | | | The code includes utility indirectly. Utility is required for make_pair(). Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I3cdca868a69ca67363f2e3692cbfd511dfde7b5f
* fix logic error for unpack vector of tupleVernon Mauery2019-09-162-8/+56
| | | | | | | | | | | | | | | | | | | | | Unpacking a vector of tuples is failing if the correct number of bytes does not match an integral number of bytes needed to fully unpack all the tuples. Unpacking a tuple should return an error if it does not fully unpack all the items. This will signal the vector unpack to bail and return however many items it has unpacked to that point. A vector unpack should always return success because no matter how many items it has unpacked, it is fine, because a vector can have any number of items. Tested: Unit tests updated to check for proper unpacking of vectors and tuples (and optionals) as well as new unit tests added for more targetted testing. Change-Id: I4b45198f8bc4a49913beb923d10079983179402a Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Change yield from ptr to objectJames Feist2019-09-133-5/+5
| | | | | | | | | | | | The ptr makes for ugly code: i.e. *(ctx->yield) all over the place. Change it to copy as it is just 4 pointers. Tested: ipmitool mc info still works Change-Id: I30c5bc395849875cd58925fac99bb23c1804cd5b Signed-off-by: James Feist <james.feist@linux.intel.com>
* Watchdog: move get and set watchdog to new api.Deepak Kumar Sahu2019-09-105-106/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite "get and set watchdog" command to use the newly introduced ipmi api. Tested: Verified using ipmitool "get and set watchdog", timer behavior is same before and after the changes. Testing Procedure: default watchdog timer is 11.2 seconds. ipmitool raw 0x06 0x25 ---> Get Output: 00 00 00 00 70 17 70 17 Note: Here 70 count(hex value)->112 count(decimal value)->112*100=11200ms [100ms per count]->11.2sec (watchdog timer) watchdog timer set to 20 seconds. ipmitool raw 0x06 0x24 0x44 0x01 0x00 0x10 0xc8 0x00 ----> Set output: ipmitool raw 0x06 0x25 ---> Get output: 04 01 00 00 c8 00 c8 00 Note: Here 20sec->20000ms->200count->c8 (hex value) Signed-off-by: Deepak Kumar Sahu <deepakx.sahu@intel.com> Change-Id: Id8c096bc1635d1900ee842a9726c49fb690fa8bc
* Move i2c WR api into libipmidYong Li2019-08-303-42/+80
| | | | | | | | | | | | Move the low-level i2c write-read api into libipmid, to allow provider libraries access to i2c without duplicating this code. Tested: I2c master write read command still works: ipmitool i2c bus=2 0x9c 8 0 Signed-off-by: Yong Li <yong.b.li@linux.intel.com> Change-Id: I0d5f82cf46ecf871eebb47aae25537b5da1f2e6a
* Add compile option to disable white list checking for I2C master WR commandYong Li2019-08-302-1/+25
| | | | | | | | | | | | | | | | By default this white list checking is enabled, we can disable it by using the below command, ./configure --disable-i2c-whitelist-check Tested: Without the --disable-i2c-whitelist-check compile option, the white list checking works as before "ipmitool i2c bus=2 0x9c 8 0" command will fail with error message: Unable to perform I2C Master Write-Read After adding the compile option, there is no such error. Signed-off-by: Yong Li <yong.b.li@linux.intel.com> Change-Id: I91ced8b0dfb1dbf51292a6b3dea6fd5c03bdbde7
* legacy handlers need a bigger bufferVernon Mauery2019-08-301-4/+3
| | | | | | | | | | | | | | | | | In the original ipmi execution queue, handlers were passed a larger buffer. The current code was only passing in the configured channel size, or 64 if no size was configured. This is too small and leads to buffer overflows for responses greater than 64 bytes. This brings the buffer sizes up to a point that matches the legacy code and to a size that is larger than any of IPMI standard transport sizes. Tested: used a bogus handler to create a large response and found that the entire response was returned. Change-Id: I91b359812247ae5fdef105c7b7a9dfe003548494 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Added VLAN ID checking condition in Set LAN configSuryakanth Sekar2019-08-282-1/+15
| | | | | | | | | | According to the VLAN 802.1VLAN spec, VLAN ID should be 1-4095 Unit test: Verified VLAN ID 1-4095 is allowed and CC returns for 0 & > 4095 Signed-off-by: Suryakanth Sekar <suryakanth.sekar@linux.intel.com> Change-Id: I54bbc94c814c98dda11f8241fa31bfe0e5bbb150
* Set/Get LAN conf 0xCC return for invalid LAN chnlSuryakanth Sekar2019-08-271-1/+13
| | | | | | | | | | | | | | | | | | | | | In set /get LAN configuration Channel number should be validate before process the request and we have to handle only LAN medium Channel. Tested: In Get/ Set LAN configuraion,0xCC should be return for non LAN channel numbers. Trying to set the IP Source to the Invalid /Valid LAN channel ipmitool raw 0xc 0x1 <Invalid LAN channel> 0x4 2 Response : 0xCC ipmitool raw 0xc 0x1 <valid LAN channel number> 4 2 Response : 0x00 Signed-off-by: Suryakanth Sekar <suryakanth.sekar@linux.intel.com> Change-Id: I6d173f1ddaf22a5ee221b15dd3a4c7b2793ab0b5
* entitymap: add json file loading if presentPatrick Venture2019-08-232-0/+30
| | | | | | | | | | Step 3 to handle the entity-map transition from YAML to JSON. This patchset adds a method that will process the json file, if present to build the map. Tested: This patchset has not been tested. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I79297aef59844a21f20c0a77de7a21264e2ed96a
* entitymap: add json parsing supportPatrick Venture2019-08-205-0/+327
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a json parsing method that given an entity map in the format: [ { "id" : 1, "containerEntityId" : 2, "containerEntityInstance" : 3, "isList" : false, "isLinked" : false, "entities" : [ {"id" : 1, "instance" : 2}, {"id" : 1, "instance" : 3}, {"id" : 1, "instance" : 4}, {"id" : 1, "instance" : 5} ] } ] is constructed into the entity map used by sensorhandler. This is meant as part of the transition from the entity map in YAML to JSON. This is step 2. Step 1 moved access to the object behind a method. This adds JSON validation and parsing. Step 3 will add a file path to check and parse. Step 4 will provide a call to parse that file if present and use its data if non-empty. Tested: The method added has not been tested beyond unit-test validation. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: Ic29f022d3812fa9e3af775d542ad055629fd5a01
* user_channel: passwd_mgr: minor cleanup from cppcheckPatrick Venture2019-08-201-3/+4
| | | | | | | | | | | | | [user_channel/passwd_mgr.cpp:220]: (style) The scope of the variable 'userEPos' can be reduced. [user_channel/passwd_mgr.cpp:358]: (style) The scope of the variable 'userEPos' can be reduced. [user_channel/passwd_mgr.cpp:444]: (style) Variable 'fd' is assigned a value that is never used. Tested: Not tested. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: If02125c422ab1e9c15c6420dbf8da6a52fb68541
* user_channel: user_mgmt: minor cleanup from cppcheckPatrick Venture2019-08-201-2/+3
| | | | | | | | | | [user_channel/user_mgmt.cpp:1628]: (style) The scope of the variable 'usrEnabled' can be reduced. [user_channel/user_mgmt.cpp:310]: (style) Unused variable: update Tested: Not tested. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: Id38469ab5d5b0fa9c512f5a77fff1f1372e794c2
* sensorhandler: ipmi_sen_get_sdr: drop null checkPatrick Venture2019-08-201-5/+0
| | | | | | | The pointer for the request is never null, therefore do not check. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I03639db3cb579260cb6579ad01837e7078520f1f
* sensorhandler: ipmi_sen_get_sdr: invert logic checkPatrick Venture2019-08-201-80/+82
| | | | | | | | | Reduce indentation of code by flipping logic check. It looks like the failure case should also set dataLen to 0, but it didn't previously, therefore that would qualify for a follow-on patch. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I4abe6ec9382e7c5632bc364ba123c31323677e11
* Revert "Add system interface as the channel for the legacy interface"Tom Joseph2019-08-201-2/+1
| | | | | | This reverts commit 152e98cd339f3df58d5832af5779eff541f0adc5. Change-Id: Ib36cdbb2d140de749335a3ae9cbb279563c33a1c
* Add system interface as the channel for the legacy interfaceTom Joseph2019-08-181-1/+2
| | | | | | | | | The legacy interface org.openbmc.HostIpmi is used by the btbridge interface and the channel number was set to 0 which implies the IPMB bridge. This is corrected to use the system interface. Change-Id: I870d8fc6c2461b7fc75a90f9576f08599038f211 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* user_mgmt: update default ipmi_user.json file.Saravanan Palanisamy2019-08-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | By default, Serial Over LAN (SOL) payload access should be enabled for all users in all channels. Ensure that this clause is met when default ipmi_user.json file is created, usually because of BMC re-flashing. Tested-by: 1. Check SOL payload access values in ipmi_user.json after reflashing. // Command - grep "std_payload1" /var/lib/ipmi/ipmi_user.json // Response - OK. ... "payload_enabled":{..."std_payload1":[true,true,...]...}, ... 2. Check SOL payload access values in ipmi_user.json after BMC FW update // Command and Response same as (1.). OK. // ipmi_user.json file is updated upon its first write after FW update. Signed-off-by: Saravanan Palanisamy <saravanan.palanisamy@linux.intel.com> Change-Id: I604aac6d000eac40a3a3460ea46c6fe81d285dee
* SensorReading: Move set SensorReading to new API.Deepak Kumar Sahu2019-08-131-40/+53
| | | | | | | | | | | | Rewrite "set SensorReading" command to use the newly introduced IPMI provider API. Tested: Verified using ipmitool "set SensorReading", behavior is same before and after the changes. Signed-off-by: Deepak Kumar Sahu <deepakx.sahu@intel.com> Change-Id: I9ee4276775e7c4a348c32a746e7fd7d55a943e06
* sensordatahandler: Throw on sensor's OperationalStatusBrandon Kim2019-08-124-0/+67
| | | | | | | | | | Add UPDATE_FUNCTIONAL_ON_FAIL and only when defined, read sensor's OperationalStatus interface for the functional property and throw if the sensor is not funcitonal. Bug: openbmc/phosphor-hwmon#10 Signed-off-by: Brandon Kim <brandonkim@google.com> Change-Id: I1144a6d3f8145bda73f3363664ca48b848a295db
* fru: support two time string formatsPatrick Venture2019-08-081-3/+26
| | | | | | | | | | | Support parsing two time string formats to enable use of ipmi-fru-parser and entity-manager to provide FRU details on dbus. Tested: Verified the entity-manager dbus output for the FRU MfgDate is now parsed correctly. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I053ec225b51166269c5a5a800ad8d607fd0cc233
* gitignore: add test and coverage artifactsPatrick Venture2019-08-081-3/+3
| | | | | Signed-off-by: Patrick Venture <venture@google.com> Change-Id: If630a4c2411a66b4995f6807e185bd5cd36d165e
* fru: remove assumption on object ownerPatrick Venture2019-08-011-7/+25
| | | | | | | | | | | | | The fru read yaml configuration allows specifying a dbus path and a dbus interface. Dynamically look up what service provides that interface with that dbus path. Continue supporting partial paths for devices owned by the Inventory Manager. Tested: Verified the module now reads the FRU properties over dbus if the object is owned by another service (exported via entity-manager). Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I5c0aeb11d0b33fab437a55dea3351a47feab0783
* fru: use ipmifruproperty for property lookupPatrick Venture2019-08-012-6/+7
| | | | | | | | | | | | | | | | | | The member IPMIFruData::property was unused and instead the property lookup was performed with the phosphor-dbus-interface property name. The IPMIFruData::property field is meant to map from dbus property to FRU property to allow a variety of dbus mappings. Tested: Verified the member was unused. Tested: Verified that a configuration yaml mapping is respected and ipmid will report the information expected given a FRU published to dbus. Note: The fields for IPMI FRU properties were taken from the example YAML and are expected to be what was used by machines leveraging this feature. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I44f73b67ecdeae2d772daa38cc21cc18cdf9c7ce
* user_mgmt: Enable SOL payload access by default.Saravanan Palanisamy2019-08-011-29/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | Enabling SOL payload access for all users in all channels, by default. It is not mandated by IPMI spec, but needed for backward-compatibility. Tested-by: 1. Run Get User Payload Access Command for random user on LAN channel. // Command - (channel 3 is of LAN channel type) ipmitool -I lanplus...raw 0x06 0x4D 3 7 02 00 00 00 // Response 2. Disable SOL payload and rerun Get User Payload Access Command. // Command ipmitool -I lanplus...raw 0x06 0x4C 3 0x48 0x02 0 0x00 0 ipmitool -I lanplus...raw 0x06 0x4D 3 8 00 00 00 00 // Response 3. Run Get User Payload Access on non-LAN, session-less channel. // Command - (channel 7 is KCS channel type) ipmitool -I lanplus...raw 0x06 0x4D 7 7 Error:(...rsp=0xcc): Invalid data field in request // Response 4. Check SOL session activation and 'ipmi_user.json' file contents. Change-Id: I48c50e6366a0025d5ae066c8a8f3694d2f710732 Signed-off-by: Saravanan Palanisamy <saravanan.palanisamy@linux.intel.com>
* sensorhandler: add accessor for entities singletonPatrick Venture2019-07-311-7/+16
| | | | | | | | | Add an accessor to grab the entities singleton as a step towards building it on first access from json. Tested: This change has not been tested beyond build verification. Signed-off-by: Patrick Venture <venture@google.com> Change-Id: I2cf1fbd7ad10b4e1b63af347c824ad37bc8a56c9
OpenPOWER on IntegriCloud