summaryrefslogtreecommitdiffstats
path: root/dcmihandler.hpp
diff options
context:
space:
mode:
authorTom Joseph <tomjoseph@in.ibm.com>2017-07-26 18:11:55 +0530
committerPatrick Williams <patrick@stwcx.xyz>2017-07-28 02:26:09 +0000
commit46fa37d94fcfa617357deb2de41dca84a4550a19 (patch)
treef0a90003022729e412eba296300327d24e7f9bc0 /dcmihandler.hpp
parentb9d86f4c791823c8bc0387578effcf2ef88c0231 (diff)
downloadphosphor-host-ipmid-46fa37d94fcfa617357deb2de41dca84a4550a19.tar.gz
phosphor-host-ipmid-46fa37d94fcfa617357deb2de41dca84a4550a19.zip
dcmi: Implement set power limit command
Change-Id: I6427a0715a4bba5e18a5e483309a23f8493ea370 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
Diffstat (limited to 'dcmihandler.hpp')
-rw-r--r--dcmihandler.hpp33
1 files changed, 33 insertions, 0 deletions
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
OpenPOWER on IntegriCloud