From 46fa37d94fcfa617357deb2de41dca84a4550a19 Mon Sep 17 00:00:00 2001 From: Tom Joseph Date: Wed, 26 Jul 2017 18:11:55 +0530 Subject: dcmi: Implement set power limit command Change-Id: I6427a0715a4bba5e18a5e483309a23f8493ea370 Signed-off-by: Tom Joseph --- dcmihandler.hpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'dcmihandler.hpp') diff --git a/dcmihandler.hpp b/dcmihandler.hpp index 8ebc660..e318294 100644 --- a/dcmihandler.hpp +++ b/dcmihandler.hpp @@ -11,6 +11,7 @@ enum ipmi_netfn_sen_cmds { // Get capability bits IPMI_CMD_DCMI_GET_POWER_LIMIT = 0x03, + IPMI_CMD_DCMI_SET_POWER_LIMIT = 0x04, IPMI_CMD_DCMI_GET_ASSET_TAG = 0x06, IPMI_CMD_DCMI_SET_ASSET_TAG = 0x08, }; @@ -145,6 +146,38 @@ struct GetPowerLimitResponse uint16_t samplingPeriod; //!< Statistics sampling period in seconds. } __attribute__((packed)); +/** @brief Set the power cap value + * + * @param[in] bus - dbus connection + * @param[in] powerCap - power cap value + */ +void setPcap(sdbusplus::bus::bus& bus, const uint32_t powerCap); + +/** @struct SetPowerLimitRequest + * + * DCMI payload for Set Power Limit command request. + */ +struct SetPowerLimitRequest +{ + uint8_t groupID; //!< Group extension identification. + uint16_t reserved; //!< Reserved + uint8_t reserved1; //!< Reserved + uint8_t exceptionAction; //!< Exception action. + uint16_t powerLimit; //!< Power limit requested in watts. + uint32_t correctionTime; //!< Correction time limit in milliseconds. + uint16_t reserved2; //!< Reserved. + uint16_t samplingPeriod; //!< Statistics sampling period in seconds. +} __attribute__((packed)); + +/** @struct SetPowerLimitResponse + * + * DCMI payload for Set Power Limit command response. + */ +struct SetPowerLimitResponse +{ + uint8_t groupID; //!< Group extension identification. +} __attribute__((packed)); + } // namespace dcmi #endif -- cgit v1.2.1