diff options
author | Joel Stanley <joel@jms.id.au> | 2014-09-11 15:43:50 +0930 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-10-01 14:23:06 +1000 |
commit | ae5fb8512e8ecfc1f1b24f5f89ef373dc4502844 (patch) | |
tree | a890b2891db1628f51229821c7ce4a49e60ef18d /hw/ipmi | |
parent | d0521e8074012f368033879b1b6e09c89e41b379 (diff) | |
download | skiboot-ae5fb8512e8ecfc1f1b24f5f89ef373dc4502844.zip skiboot-ae5fb8512e8ecfc1f1b24f5f89ef373dc4502844.tar.gz skiboot-ae5fb8512e8ecfc1f1b24f5f89ef373dc4502844.tar.bz2 |
ipmi/power: Update chassis control command
Linux sends us a 0 when shutting down. This means we don't need to pass
the u64 to the IPMI driver. Add a check that the value is what we expect
in case Linux changes it's behaviour in the future.
When rebooting, we should send the BMC a HARD_RESET command (0x03), not
POWER_CYCLE (0x02).
While we are here, trim some whitespace and drop opal from the IPMI
function name for readability.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'hw/ipmi')
-rw-r--r-- | hw/ipmi/ipmi-power.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/hw/ipmi/ipmi-power.c b/hw/ipmi/ipmi-power.c index c8589c1..32e66d2 100644 --- a/hw/ipmi/ipmi-power.c +++ b/hw/ipmi/ipmi-power.c @@ -18,17 +18,15 @@ #include <ipmi.h> #include <opal.h> -int64_t ipmi_opal_chassis_control(uint64_t request) +int ipmi_chassis_control(uint8_t request) { struct ipmi_msg *msg; - uint8_t chassis_control = request; - if (chassis_control > IPMI_CHASSIS_SOFT_SHUTDOWN) + if (request > IPMI_CHASSIS_SOFT_SHUTDOWN) return OPAL_PARAMETER; - - msg = ipmi_mkmsg_simple(IPMI_CHASSIS_CONTROL, &chassis_control, - sizeof(chassis_control)); + msg = ipmi_mkmsg_simple(IPMI_CHASSIS_CONTROL, &request, + sizeof(request)); if (!msg) return OPAL_HARDWARE; |