diff options
author | Tom Joseph <tomjoseph@in.ibm.com> | 2017-04-03 01:56:04 +0530 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-04-25 19:12:26 +0000 |
commit | e14ac96f33e8fcd25d1b165734126811ebd97e0d (patch) | |
tree | 5f8f36652beb6aa03d4ec3d723446dfa750ed95f | |
parent | 64b3dec812821351dbf75bf8c73c5d7f0cb0fe98 (diff) | |
download | phosphor-net-ipmid-e14ac96f33e8fcd25d1b165734126811ebd97e0d.tar.gz phosphor-net-ipmid-e14ac96f33e8fcd25d1b165734126811ebd97e0d.zip |
Add command handler for SOL activating command.
Change-Id: I81094330b3fa7f320bd4518cabcfb8fc5b75411c
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
-rw-r--r-- | command/sol_cmds.cpp | 22 | ||||
-rw-r--r-- | command/sol_cmds.hpp | 39 |
2 files changed, 61 insertions, 0 deletions
diff --git a/command/sol_cmds.cpp b/command/sol_cmds.cpp index 8f5b0c6..3096d2e 100644 --- a/command/sol_cmds.cpp +++ b/command/sol_cmds.cpp @@ -47,6 +47,28 @@ std::vector<uint8_t> payloadHandler(std::vector<uint8_t>& inPayload, return std::vector<uint8_t>(); } +void activating(uint8_t payloadInstance, uint32_t sessionID) +{ + std::vector<uint8_t> outPayload(sizeof(ActivatingRequest)); + + auto request = reinterpret_cast<ActivatingRequest*> + (outPayload.data()); + + request->sessionState = 0; + request->payloadInstance = payloadInstance; + request->majorVersion = MAJOR_VERSION; + request->minorVersion = MINOR_VERSION; + + auto session = (std::get<session::Manager&>(singletonPool).getSession( + sessionID)).lock(); + + message::Handler msgHandler(session->channelPtr, sessionID); + + msgHandler.sendUnsolicitedIPMIPayload(netfnTransport, + solActivatingCmd, + outPayload); +} + } // namespace command } // namespace sol diff --git a/command/sol_cmds.hpp b/command/sol_cmds.hpp index 3c3e23d..010a245 100644 --- a/command/sol_cmds.hpp +++ b/command/sol_cmds.hpp @@ -22,6 +22,45 @@ namespace command */ std::vector<uint8_t> payloadHandler(std::vector<uint8_t>& inPayload, const message::Handler& handler); + +constexpr uint8_t netfnTransport = 0x0C; +constexpr uint8_t solActivatingCmd = 0x20; + +/** @struct ActivatingRequest + * + * IPMI payload for SOL Activating command. + */ +struct ActivatingRequest +{ +#if BYTE_ORDER == LITTLE_ENDIAN + uint8_t sessionState : 4; //!< SOL session state. + uint8_t reserved : 4; //!< Reserved. +#endif + +#if BYTE_ORDER == BIG_ENDIAN + uint8_t reserved : 4; //!< Reserved. + uint8_t sessionState : 4; //!< SOL session state. +#endif + + uint8_t payloadInstance; //!< Payload instance. + uint8_t majorVersion; //!< SOL format major version + uint8_t minorVersion; //!< SOL format minor version +} __attribute__((packed)); + +/** @brief SOL Activating Command. + * + * This command provides a mechanism for the BMC to notify a remote application + * that a SOL payload is activating on another channel.The request message is a + * message that is asynchronously generated by the BMC. The BMC will not wait + * for a response from the remote console before dropping the serial connection + * to proceed with SOL, therefore the remote console does not need to respond + * to this command. + * + * @param[in] payloadInstance - SOL payload instance. + * @param[in] sessionID - IPMI session ID. + */ +void activating(uint8_t payloadInstance, uint32_t sessionID); + } // namespace command } // namespace sol |