diff options
author | Brian Silver <bsilver@us.ibm.com> | 2014-09-30 08:22:11 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-10-23 04:51:02 -0500 |
commit | a9010ccc1130b81e45d1151bb5de9453d31c08a5 (patch) | |
tree | ecc60da4bd3623cc97851dfa75e98293f9c77bdd /src/usr/ipmi/ipmibt.H | |
parent | a6b67089037c83373f548749a463dfd769938b77 (diff) | |
download | talos-hostboot-a9010ccc1130b81e45d1151bb5de9453d31c08a5.tar.gz talos-hostboot-a9010ccc1130b81e45d1151bb5de9453d31c08a5.zip |
IPMI Block Transfer implementation
Change-Id: I8f6a590b29d9171389d10abc5b6e68f91ac94d16
RTC: 114907
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/13721
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/ipmi/ipmibt.H')
-rw-r--r-- | src/usr/ipmi/ipmibt.H | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/src/usr/ipmi/ipmibt.H b/src/usr/ipmi/ipmibt.H new file mode 100644 index 000000000..6414e59b8 --- /dev/null +++ b/src/usr/ipmi/ipmibt.H @@ -0,0 +1,140 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/ipmi/ipmibt.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef __IPMI_IPMIBT_H +#define __IPMI_IPMIBT_H + +#include "ipmimsg.H" + +// How many bytes are in the IPMI BT message header +#define IPMI_BT_HEADER_SIZE 3 + +// Per BMC Firmware Specification v3.6 James, et al the ASPEED +// is limited to a 64 byte IPMI message buffer. +#define IPMI_BT_MAX_MESSAGE_SIZE 64 + +#define IPMI_BT_MAX_DATA (IPMI_BT_MAX_MESSAGE_SIZE - IPMI_BT_HEADER_SIZE) + +namespace IPMI +{ + // IPMI block-transfer message base class + class BTMessage : public Message + { + public: + /// + /// @brief msg ctor + /// @param[in] i_netfun, the network function + /// @param[in] i_cmd, the network command + /// @param[in] i_data, the data for the command + /// @param[in] i_len, the length of the data + /// @param[in] i_data, the data (new'd space) + /// + BTMessage(const network_function i_netfun = NETFUN_NONE, + const uint8_t i_cmd = 0, + const uint8_t i_len = 0, + uint8_t* i_data = NULL); + + /// + /// @brief transmit a message. + /// @return Error from operation + /// + errlHndl_t xmit(void); + + /// + /// @brief transmit a message. + /// @param[in] i_respondq, a map sequence->msg_t + /// @return true iff there was no transmission error + /// + /// @note we're not pure abstract as we want to be able to + /// instantiate an object of BTMessage for reading. + /// + virtual bool xmit(respond_q_t& i_respondq) + {return true;}; + + /// + /// @brief receive a message. + /// + errlHndl_t recv(void); + + /// + /// @brief the maximum buffer size of the underlying transport + /// @param void + /// @return size_t, the max buffer size + /// + size_t max_buffer(void) + { return IPMI_BT_MAX_DATA; } + + }; + + // IPMI BT synchronous message + class BTSyncMessage : public BTMessage + { + public: + /// + /// @brief BTSyncMessage ctor + /// @param[in] i_netfun, the network function + /// @param[in] i_cmd, the network command + /// @param[in] i_data, the data for the command + /// @param[in] i_len, the length of the data + /// @param[in] i_data, the data (new'd space) + /// + BTSyncMessage(const network_function i_netfun, const uint8_t i_cmd, + const uint8_t i_len, uint8_t* i_data); + + /// + /// @brief transmit a message. + /// @param[in] i_respondq, a map sequence->msg_t + /// + /// @return true iff there was no transmission error + /// + bool xmit(respond_q_t& i_respondq); + }; + + // IPMI BT asynchronous message + class BTAsyncMessage : public BTMessage + { + public: + /// + /// @brief BTSyncMessage ctor + /// @param[in] i_netfun, the network function + /// @param[in] i_cmd, the network command + /// @param[in] i_data, the data for the command + /// @param[in] i_len, the length of the data + /// @param[in] i_data, the data (new'd space) + /// + BTAsyncMessage(const network_function i_netfun, const uint8_t i_cmd, + const uint8_t i_len, uint8_t* i_data); + + /// + /// @brief transmit a message. + /// @param[in] respond_q_t unused + /// + /// @return true iff there was no transmission error + /// + bool xmit(respond_q_t&); + }; + +}; // end namespace IPMI + +#endif |