diff options
author | Matthew Barth <msbarth@us.ibm.com> | 2016-08-08 15:26:29 -0500 |
---|---|---|
committer | Matthew Barth <msbarth@us.ibm.com> | 2016-08-08 15:42:28 -0500 |
commit | 98a238406ff5765cc6db3e61ba787c27144dad1d (patch) | |
tree | ea2e16068905deb631bebfeb7b5cca1392318506 /dcmihandler.cpp | |
parent | 9a61b4f4e9213608653852ba2388fa89663029c3 (diff) | |
download | phosphor-host-ipmid-98a238406ff5765cc6db3e61ba787c27144dad1d.tar.gz phosphor-host-ipmid-98a238406ff5765cc6db3e61ba787c27144dad1d.zip |
Switch C++ source files to .cpp extension
Change-Id: I495186b4afd58ec1e5d9d5c6472394f96541d17d
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'dcmihandler.cpp')
-rw-r--r-- | dcmihandler.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/dcmihandler.cpp b/dcmihandler.cpp new file mode 100644 index 0000000..fafebdc --- /dev/null +++ b/dcmihandler.cpp @@ -0,0 +1,40 @@ +#include "dcmihandler.h" +#include "ipmid-api.h" +#include <stdio.h> +#include <string.h> +#include <stdint.h> + +void register_netfn_dcmi_functions() __attribute__((constructor)); + + +ipmi_ret_t ipmi_dcmi_get_power_limit(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_ret_t rc = IPMI_DCMI_CC_NO_ACTIVE_POWER_LIMIT; + + // dcmi-v1-5-rev-spec.pdf 6.6.2. + // This is good enough for OpenBMC support for OpenPOWER based systems + // TODO research if more is needed + uint8_t data_response[] = { 0xDC, 0x00, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01}; + + + + printf("IPMI DCMI_GET_POWER_LEVEL\n"); + + memcpy(response, data_response, sizeof(data_response)); + *data_len = sizeof(data_response); + + return rc; +} + + +void register_netfn_dcmi_functions() +{ + printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_GRPEXT, IPMI_CMD_DCMI_GET_POWER); + ipmi_register_callback(NETFUN_GRPEXT, IPMI_CMD_DCMI_GET_POWER, NULL, ipmi_dcmi_get_power_limit); + return; +} +// 956379
\ No newline at end of file |