summaryrefslogtreecommitdiffstats
path: root/discover/ipmi.c
Commit message (Collapse)AuthorAgeFilesLines
* Various fixups and checks to make scan-build happySamuel Mendoza-Jonas2019-05-301-1/+0
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover: Nicely format IPMI response buffersv1.9.2Samuel Mendoza-Jonas2018-11-161-18/+15
| | | | | | | | | | | | | | | A few places where we print out the response buffer from an IPMI command weren't updated when log timestamps were added, resulting in very hard to read output. Add a little helper to format buffers and use it to print these with only one timestamp. Example: [04:59:01] ipmi_get_bmc_versions: BMC version resp [0][16]: 0x00 0x20 0x01 0x02 0x13 0x02 0xbf 0x00 0x00 0x00 0xbb 0xaa 0x58 0x98 0x01 0x00 Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover: Move generic ipmi routines to ipmiGe Song2018-08-071-0/+123
| | | | | | | Signed-off-by: Ge Song <ge.song@hxt-semitech.com> [Split from a larger patch] Signed-off-by: Geoff Levand <geoff@infradead.org> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* lib/log: Switch to pb_log_fnGeoff Levand2018-08-071-1/+1
| | | | | | | | The only functional change should be an additional '/n' to a few log messagees that seemed to be missing it. Signed-off-by: Geoff Levand <geoff@infradead.org> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover/ipmi: Open devnode with O_CLOEXECSamuel Mendoza-Jonas2017-08-221-1/+1
| | | | | | | The IPMI device node is kept open for the life of the platform - include the O_CLOEXEC flag so it is not kept open for child processes. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover: Avoid writing network overrides to NVRAMSamuel Mendoza-Jonas2016-09-081-0/+1
| | | | | | | | Explicitly keep track of whether the current interface config was set by an IPMI network override, and avoid overwriting any saved config unless the override was marked persistent. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover: Respect persistent flag for network overridesv1.0.0Samuel Mendoza-Jonas2016-03-231-9/+11
| | | | | | | If the persistent bit is set in a IPMI network override, overwrite any existing interface config in NVRAM with the new network override. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* discover: Add support for IPMI network overrideSam Mendoza-Jonas2016-02-261-0/+97
| | | | | | | | | | | | | | | | | | | | | | On BMC platforms the 'Get System Boot Options' command can also be used to check for a temporary network interface config override. This is implemented via the optional 'OEM Parameters' field defined in the IPMI v2 spec. We define the actual format of the field as: - 4 byte cookie value - 2 byte version value - 1 byte hardware address size - 1 byte IP address size - Hardware address - 1 byte flags for 'ignore' and 'method' And for static configs: - IP Address - 1 byte subnet value - Gateway address If set the config override replaces any other interface config, forcing the use of the specified configuration. Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
* discover: Properly handle return valuesSamuel Mendoza-Jonas2015-12-171-1/+2
| | | | | | | | Fixes three unchecked return values, and one missing initialisation. Fixes Coverity defects #30450, #30451, #30454, and #30483 Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* discover/ipmi: Use advisory locking on ipmi deviceJeremy Kerr2015-09-301-4/+22
| | | | | | | | | | | | The ipmi module is shared between pb-config and pb-discover. During system initilisation, we're likely to have a few invocations of pb-config running, as well as pb-discover starting. We may have multiple potential concurrent accesses to the ipmi device node. To avoid problems, this change introduces a fcntl lock on the device node. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/platform-powerpc: Implement direct IPMI interfaceJeremy Kerr2014-12-151-1/+181
| | | | | | | This change adds a direct IPMI interface to the /dev/ipmi0 device node, which is present on OpenPower machines. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/powerpc: Separate ipmi bootdev handling into separate functionsJeremy Kerr2014-12-151-0/+15
| | | | | | | | We'd like to add a new backend to the bootdev storage, so move the common bootdev-handling code into separate functions, moving ipmi_bootdev_is_valid to ipmi.c. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Add ipmi moduleJeremy Kerr2014-12-151-0/+8
Move our IPMI-specific definitions to a separate header, and a mostly-empty ipmi.c file. We'll populate this with IPMI functionality in later changes. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud