summaryrefslogtreecommitdiffstats
path: root/systemintfcmds.cpp
diff options
context:
space:
mode:
authorAndrew Geissler <geissonator@yahoo.com>2019-04-22 10:34:34 -0500
committerTom Joseph <tomjoseph@in.ibm.com>2019-04-23 17:08:38 +0000
commit461f464527d1f9e57920cfcfbaed9e918f830741 (patch)
tree2bbef85c8d48f8f1aa66944a3f4e237925198d72 /systemintfcmds.cpp
parent735ee953d0ae274435fb0276415ca7a01a0c3c9d (diff)
downloadphosphor-host-ipmid-461f464527d1f9e57920cfcfbaed9e918f830741.tar.gz
phosphor-host-ipmid-461f464527d1f9e57920cfcfbaed9e918f830741.zip
Ensure host is told data available on SMS_ATN
The SMS_ATN path is used by OpenBMC to communicate certain commands to the host. To ensure the host queries OpenBMC for its pending command, the response to the get_msg_flags command must indicate the event message buffer is full. Commit 30206dba changed this behavior and caused a regression in this area for openpower systems. Tested: Verified phosphor-host-check now passes when host is up and running Resolves openbmc/openbmc#3526 Change-Id: I700a55d8fa35b367dc20ae0db532a0b1c0664fba Signed-off-by: Andrew Geissler <geissonator@yahoo.com> Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
Diffstat (limited to 'systemintfcmds.cpp')
-rw-r--r--systemintfcmds.cpp27
1 files changed, 8 insertions, 19 deletions
diff --git a/systemintfcmds.cpp b/systemintfcmds.cpp
index d298abd..0c50c87 100644
--- a/systemintfcmds.cpp
+++ b/systemintfcmds.cpp
@@ -71,28 +71,16 @@ ipmi_ret_t ipmi_app_read_event(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
// Called by Host on seeing a SMS_ATN bit set. Return a hardcoded
// value of 0x2 indicating we need Host read some data.
//-------------------------------------------------------------------
-ipmi_ret_t ipmi_app_get_msg_flags(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
- ipmi_request_t request,
- ipmi_response_t response,
- ipmi_data_len_t data_len,
- ipmi_context_t context)
+ipmi::RspType<uint8_t> ipmiAppGetMessageFlags()
{
- // Generic return from IPMI commands.
- ipmi_ret_t rc = IPMI_CC_OK;
-
// From IPMI spec V2.0 for Get Message Flags Command :
// bit:[1] from LSB : 1b = Event Message Buffer Full.
// Return as 0 if Event Message Buffer is not supported,
// or when the Event Message buffer is disabled.
- // For now, it is not supported.
-
- uint8_t set_event_msg_buffer_full = 0x0;
- *data_len = sizeof(set_event_msg_buffer_full);
-
- // Pack the actual response
- std::memcpy(response, &set_event_msg_buffer_full, *data_len);
-
- return rc;
+ // This path is used to communicate messages to the host
+ // from within the phosphor::host::command::Manager
+ constexpr uint8_t setEventMsgBufferFull = 0x2;
+ return ipmi::responseSuccess(setEventMsgBufferFull);
}
ipmi_ret_t ipmi_app_get_bmc_global_enables(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
@@ -163,8 +151,9 @@ void register_netfn_app_functions()
ipmi_app_get_bmc_global_enables, SYSTEM_INTERFACE);
// <Get Message Flags>
- ipmi_register_callback(NETFUN_APP, IPMI_CMD_GET_MSG_FLAGS, NULL,
- ipmi_app_get_msg_flags, SYSTEM_INTERFACE);
+ ipmi::registerHandler(ipmi::prioOpenBmcBase, ipmi::netFnApp,
+ ipmi::app::cmdGetMessageFlags, ipmi::Privilege::Admin,
+ ipmiAppGetMessageFlags);
// Create new xyz.openbmc_project.host object on the bus
auto objPath = std::string{CONTROL_HOST_OBJ_MGR} + '/' + HOST_NAME + '0';
OpenPOWER on IntegriCloud