summaryrefslogtreecommitdiffstats
path: root/dcmihandler.hpp
diff options
context:
space:
mode:
authorDhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>2018-01-16 05:11:56 -0600
committerTom Joseph <tomjoseph@in.ibm.com>2018-01-31 09:13:20 +0000
commite29be41f1d014a55e93abd3e55ac23f158f5fa16 (patch)
treef084ca93eb46ef2545fc2e95abef384d1fbd0d84 /dcmihandler.hpp
parent9642391d3953754761d5312f59ecbc90341b4759 (diff)
downloadphosphor-host-ipmid-e29be41f1d014a55e93abd3e55ac23f158f5fa16.tar.gz
phosphor-host-ipmid-e29be41f1d014a55e93abd3e55ac23f158f5fa16.zip
DCMI: Implement Get DCMI capabilities info command.
This commit adds ipmi changes for supporting the get DCMI capabilities command Resolves openbmc/openbmc#2618 Change-Id: I7d0e7c132f4a8d459351e025fa2bfca9fcf1340b Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
Diffstat (limited to 'dcmihandler.hpp')
-rw-r--r--dcmihandler.hpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/dcmihandler.hpp b/dcmihandler.hpp
index 91707f3..288e4d7 100644
--- a/dcmihandler.hpp
+++ b/dcmihandler.hpp
@@ -12,6 +12,7 @@ namespace dcmi
enum Commands
{
// Get capability bits
+ GET_CAPABILITIES = 0x01,
GET_POWER_LIMIT = 0x03,
SET_POWER_LIMIT = 0x04,
APPLY_POWER_LIMIT = 0x05,
@@ -258,6 +259,67 @@ struct SetMgmntCtrlIdStrResponse
uint8_t offset; //!< Last Offset Written.
} __attribute__((packed));
+/** @enum DCMICapParameters
+ *
+ * DCMI Capability parameters
+ */
+enum class DCMICapParameters
+{
+ SUPPORTED_DCMI_CAPS = 0x01, //!< Supported DCMI Capabilities
+ MANDATORY_PLAT_ATTRIBUTES = 0x02, //!< Mandatory Platform Attributes
+ OPTIONAL_PLAT_ATTRIBUTES = 0x03, //!< Optional Platform Attributes
+ MANAGEABILITY_ACCESS_ATTRIBUTES = 0x04, //!< Manageability Access Attributes
+};
+
+/** @struct GetDCMICapRequest
+ *
+ * DCMI payload for Get capabilities cmd request.
+ */
+struct GetDCMICapRequest
+{
+ uint8_t groupID; //!< Group extension identification.
+ uint8_t param; //!< Capability parameter selector.
+} __attribute__((packed));
+
+/** @struct GetDCMICapRequest
+ *
+ * DCMI payload for Get capabilities cmd response.
+ */
+struct GetDCMICapResponse
+{
+ uint8_t groupID; //!< Group extension identification.
+ uint8_t major; //!< DCMI Specification Conformance - major ver
+ uint8_t minor; //!< DCMI Specification Conformance - minor ver
+ uint8_t paramRevision; //!< Parameter Revision = 02h
+ uint8_t data[]; //!< Capability array
+} __attribute__((packed));
+
+/** @struct DCMICap
+ *
+ * DCMI capabilities protocol info.
+ */
+struct DCMICap
+{
+ std::string name; //!< Name of DCMI capability.
+ uint8_t bytePosition; //!< Starting byte number from DCMI spec.
+ uint8_t position; //!< bit position from the DCMI spec.
+ uint8_t length; //!< Length of the value from DCMI spec.
+};
+
+using DCMICapList = std::vector<DCMICap>;
+
+/** @struct DCMICapEntry
+ *
+ * DCMI capabilities list and size for each parameter.
+ */
+struct DCMICapEntry
+{
+ uint8_t size; //!< Size of capability array in bytes.
+ DCMICapList capList; //!< List of capabilities for a parameter.
+};
+
+using DCMICaps = std::map<DCMICapParameters, DCMICapEntry>;
+
} // namespace dcmi
#endif
OpenPOWER on IntegriCloud