summaryrefslogtreecommitdiffstats
path: root/systemintfcmds.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'systemintfcmds.cpp')
-rw-r--r--systemintfcmds.cpp34
1 files changed, 14 insertions, 20 deletions
diff --git a/systemintfcmds.cpp b/systemintfcmds.cpp
index 0c50c87..9ec65d1 100644
--- a/systemintfcmds.cpp
+++ b/systemintfcmds.cpp
@@ -100,30 +100,23 @@ ipmi_ret_t ipmi_app_get_bmc_global_enables(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
return rc;
}
-ipmi_ret_t ipmi_app_set_bmc_global_enables(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<> ipmiAppSetBMCGlobalEnable(
+ ipmi::Context::ptr ctx, bool receiveMessageQueueInterruptEnabled,
+ bool eventMessageBufferFullInterruptEnabled, bool eventMessageBufferEnabled,
+ bool systemEventLogEnable, uint1_t reserved, bool OEM0Enabled,
+ bool OEM1Enabled, bool OEM2Enabled)
{
- ipmi_ret_t rc = IPMI_CC_OK;
-
- uint8_t reqMask = *reinterpret_cast<uint8_t*>(request);
- if (sizeof(reqMask) != *data_len)
- {
- *data_len = 0;
- return IPMI_CC_REQ_DATA_LEN_INVALID;
- }
-
- *data_len = 0;
// Recv Message Queue and SEL are enabled by default.
// Event Message buffer are disabled by default (not supported).
// Any request that try to change the mask will be rejected
- if (reqMask != (selEnable | recvMsgQueueEnable))
+ if (!receiveMessageQueueInterruptEnabled || !systemEventLogEnable ||
+ eventMessageBufferFullInterruptEnabled || eventMessageBufferEnabled ||
+ OEM0Enabled || OEM1Enabled || OEM2Enabled || reserved)
{
- return IPMI_CC_INVALID_FIELD_REQUEST;
+ return ipmi::responseInvalidFieldRequest();
}
- return rc;
+
+ return ipmi::responseSuccess();
}
namespace
@@ -143,8 +136,9 @@ void register_netfn_app_functions()
ipmi_app_read_event, SYSTEM_INTERFACE);
// <Set BMC Global Enables>
- ipmi_register_callback(NETFUN_APP, IPMI_CMD_SET_BMC_GLOBAL_ENABLES, NULL,
- ipmi_app_set_bmc_global_enables, SYSTEM_INTERFACE);
+ ipmi::registerHandler(ipmi::prioOpenBmcBase, ipmi::netFnApp,
+ ipmi::app::cmdSetBmcGlobalEnables,
+ ipmi::Privilege::Admin, ipmiAppSetBMCGlobalEnable);
// <Get BMC Global Enables>
ipmi_register_callback(NETFUN_APP, IPMI_CMD_GET_BMC_GLOBAL_ENABLES, NULL,
OpenPOWER on IntegriCloud