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/include/usr/ipmi | |
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/include/usr/ipmi')
-rw-r--r-- | src/include/usr/ipmi/ipmi_reasoncodes.H | 46 | ||||
-rw-r--r-- | src/include/usr/ipmi/ipmiif.H | 119 |
2 files changed, 165 insertions, 0 deletions
diff --git a/src/include/usr/ipmi/ipmi_reasoncodes.H b/src/include/usr/ipmi/ipmi_reasoncodes.H new file mode 100644 index 000000000..12a9391bc --- /dev/null +++ b/src/include/usr/ipmi/ipmi_reasoncodes.H @@ -0,0 +1,46 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/ipmi/ipmi_reasoncodes.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 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_REASONCODES_H +#define __IPMI_REASONCODES_H + +#include <hbotcompid.H> + +namespace IPMI +{ + enum IPMIModuleId + { + MOD_IPMISRV_SEND = 0x01, // IPMI::send/IPMI::sendrecv + MOD_IPMISRV_REPLY = 0x02, // IPMI::respond + }; + + enum IPMIReasonCode + { + RC_INVALID_QRESPONSE = IPMI_COMP_ID | 0x01, + RC_INVALID_SENDRECV = IPMI_COMP_ID | 0x02, + RC_INVALID_SEND = IPMI_COMP_ID | 0x03, + }; +}; + +#endif diff --git a/src/include/usr/ipmi/ipmiif.H b/src/include/usr/ipmi/ipmiif.H new file mode 100644 index 000000000..431b006ef --- /dev/null +++ b/src/include/usr/ipmi/ipmiif.H @@ -0,0 +1,119 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/ipmi/ipmiif.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_IPMIIF_H +#define __IPMI_IPMIIF_H + +#include <sys/msg.h> +#include <errl/errlentry.H> + +namespace IPMI +{ + // Message types which travel on the IPMI message queues + enum msg_type + { + // Sent when the interface goes idle *and* we had write which + // was told the interface was busy. We won't get notified of + // the general idle state. + MSG_STATE_IDLE, + + // Ready to read a response + MSG_STATE_RESP, + + // Ready to read an event/sms + MSG_STATE_EVNT, + + // A message which needs to be sent + MSG_STATE_SEND, + + MSG_STATE_SHUTDOWN, + + // Used to check range. Leave as last. + MSG_LAST_TYPE = MSG_STATE_SHUTDOWN, + }; + + // IPMI network functions + enum network_function + { + // These are the command network functions, the response + // network functions are the function + 1. So to determine + // the proper network function which issued the command + // associated with a response, subtract 1. + // Note: these are also shifted left to make room for the LUN. + NETFUN_CHASSIS = (0x00 << 2), + NETFUN_BRIDGE = (0x02 << 2), + NETFUN_SENSOR = (0x04 << 2), + NETFUN_APP = (0x06 << 2), + NETFUN_FIRMWARE = (0x08 << 2), + NETFUN_STORAGE = (0x0a << 2), + NETFUN_TRANPORT = (0x0c << 2), + + // Overload the OEM netfun for a "none" netfun. We use this as a + // default for objects which will have their netfun filled in + NETFUN_NONE = (0x30 << 2), + }; + + /** + * Send message asynchronously + * @param[in] i_netfun, the network function + * @param[in] i_cmd, the command + * @param[in] i_len, the length of the buffer + * @param[in] i_data, the buffer - must be new'd + * @example uint8_t* data = new uint8_t[length]; + * @warning do *not* delete data, the resource provider will do that. + * + * @return errlHndl_t, NULL on success + */ + errlHndl_t send(const network_function i_netfun, + const uint8_t i_cmd, const size_t i_len, + uint8_t* i_data); + + /** + * Send message synchronously + * @param[in] i_netfun, the network function + * @param[in] i_cmd, the command + * @param[out] o_completion_code, the completion code + * @param[in,out] io_len, the length of the buffer + * @param[in] i_data, the buffer - must be new'd + * @example uint8_t* data = new uint8_t[length]; + * @example delete[] data; + * + * @return errlHndl_t, NULL on success + */ + errlHndl_t sendrecv(const network_function i_netfun, + const uint8_t i_cmd, uint8_t& o_completion_code, + size_t& io_len, uint8_t*& io_data); + + /** + * Get the max buffer size + * @param void + * + * @return the maximum space allowed for data, per message + * (max message for the transport - the header size) + */ + inline size_t max_buffer(void); + +}; // end namespace IPMI + +#endif |