diff options
author | Bill Hoffa <wghoffa@us.ibm.com> | 2015-05-12 10:44:34 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-06-10 14:37:19 -0500 |
commit | bd0dfe4c4d58d28208225a16ff341edcf32ff255 (patch) | |
tree | 275cb60738a4f8b9dcaaad548c79dfeef5c7b3e0 /src/usr/ipmi | |
parent | ca80eb16f02700ea16a25f01c92c700497a81993 (diff) | |
download | talos-hostboot-bd0dfe4c4d58d28208225a16ff341edcf32ff255.tar.gz talos-hostboot-bd0dfe4c4d58d28208225a16ff341edcf32ff255.zip |
Ignore IPMI SEL Event instead of treating as a Power-Cycle Command
Change-Id: I8a720130400c6f4e8b989d61f00a75e89d248c06
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/17992
Reviewed-by: MATTHEW A. PLOETZ <maploetz@us.ibm.com>
Tested-by: Jenkins Server
Reviewed-by: Richard J. Knight <rjknight@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/ipmi')
-rw-r--r-- | src/usr/ipmi/ipmirp.C | 96 | ||||
-rw-r--r-- | src/usr/ipmi/ipmirp.H | 6 |
2 files changed, 64 insertions, 38 deletions
diff --git a/src/usr/ipmi/ipmirp.C b/src/usr/ipmi/ipmirp.C index 1b550386d..9b69991c9 100644 --- a/src/usr/ipmi/ipmirp.C +++ b/src/usr/ipmi/ipmirp.C @@ -415,6 +415,63 @@ static void rejectPnorRequest(void) errlCommit(err, IPMI_COMP_ID); } } + +/** + * @brief Handle various IPMI Power Messages + */ +void IpmiRP::handlePowerMessage( IPMI::oemSEL* i_event ) +{ + + do { + // if the event type is "soft off" then update the modifier to send + // a power off to the BMC + if( i_event->iv_cmd[1] == IPMI::CHASSIS_POWER_OFF ) + { + iv_chassis_power_mod = IPMI::CHASSIS_POWER_OFF; + + // handle the graceful shutdown message + IPMI_TRAC("Graceful shutdown request received"); + +#ifdef CONFIG_CONSOLE + CONSOLE::displayf(NULL, "IPMI: shutdown requested"); + CONSOLE::flush(); +#endif + + } + // If the event type is a power soft reset aka power cycle + // update the modifier to send to the BMC + else if( i_event->iv_cmd[1] == IPMI::CHASSIS_POWER_SOFT_RESET ) + { + // handle the message as a power cycle request + IPMI_TRAC("IPMI power cycle request received"); + iv_chassis_power_mod = IPMI::CHASSIS_POWER_CYCLE; +#ifdef CONFIG_CONSOLE + CONSOLE::displayf(NULL, "IPMI: power cycle requested"); + CONSOLE::flush(); +#endif + } + else + { + //Ignore this message - It is an undefined/unsupported command + IPMI_TRAC("Ignoring command with unknown Power Control Action: %x", + i_event->iv_cmd[1]); + break; + } + + // register for the post memory flush callback + INITSERVICE::registerShutdownEvent(iv_msgQ, + IPMI::MSG_STATE_GRACEFUL_SHUTDOWN, + INITSERVICE::POST_MEM_FLUSH_NOTIFY_LAST); + + iv_graceful_shutdown_pending = true; + lwsync(); + + // initiate the shutdown processing in the background + INITSERVICE::doShutdown(SHUTDOWN_STATUS_GOOD,true); + + } while (0); + +} /** * @brief Wait for events and read them */ @@ -448,44 +505,7 @@ void IpmiRP::lastChanceEventHandler(void) } else if ( event->iv_cmd[0] == IPMI::power_off().second ) { - // if the event type is "soft off" then update the modifier to send - // a power off to the BMC, otherwise all other requests will be - // handled as a power cycle - if( event->iv_cmd[1] == IPMI::CHASSIS_POWER_OFF ) - { - iv_chassis_power_mod = IPMI::CHASSIS_POWER_OFF; - - // handle the graceful shutdown message - IPMI_TRAC("Graceful shutdown request received"); - -#ifdef CONFIG_CONSOLE - CONSOLE::displayf(NULL, "IPMI: shutdown requested"); - CONSOLE::flush(); -#endif - - } - else - { - // handle the message as a power cycle request - IPMI_TRAC("IPMI power cycle request received"); - iv_chassis_power_mod = IPMI::CHASSIS_POWER_CYCLE; -#ifdef CONFIG_CONSOLE - CONSOLE::displayf(NULL, "IPMI: power cycle requested"); - CONSOLE::flush(); -#endif - } - - // register for the post memory flush callback - INITSERVICE::registerShutdownEvent(iv_msgQ, - IPMI::MSG_STATE_GRACEFUL_SHUTDOWN, - INITSERVICE::POST_MEM_FLUSH_NOTIFY_LAST); - - iv_graceful_shutdown_pending = true; - lwsync(); - - // initiate the shutdown processing in the background - INITSERVICE::doShutdown(SHUTDOWN_STATUS_GOOD,true); - + handlePowerMessage(event); } else { // TODO: RTC: 120128 diff --git a/src/usr/ipmi/ipmirp.H b/src/usr/ipmi/ipmirp.H index 6db0c9b1f..9e8832555 100644 --- a/src/usr/ipmi/ipmirp.H +++ b/src/usr/ipmi/ipmirp.H @@ -132,6 +132,12 @@ class IpmiRP */ void postEvent(IPMI::oemSEL* i_event); + /** + * @brief Give the resource provider a message to put in the eventq + * @param[in] i_event, pointer to the power event data to handle (OEM SEL) + */ + void handlePowerMessage(IPMI::oemSEL* i_event); + private: /** |