1a642a948SDawid Frycki /* Copyright 2018 Intel 2a642a948SDawid Frycki * 3a642a948SDawid Frycki * Licensed under the Apache License, Version 2.0 (the "License"); 4a642a948SDawid Frycki * you may not use this file except in compliance with the License. 5a642a948SDawid Frycki * You may obtain a copy of the License at 6a642a948SDawid Frycki * 7a642a948SDawid Frycki * http://www.apache.org/licenses/LICENSE-2.0 8a642a948SDawid Frycki * 9a642a948SDawid Frycki * Unless required by applicable law or agreed to in writing, software 10a642a948SDawid Frycki * distributed under the License is distributed on an "AS IS" BASIS, 11a642a948SDawid Frycki * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12a642a948SDawid Frycki * See the License for the specific language governing permissions and 13a642a948SDawid Frycki * limitations under the License. 14a642a948SDawid Frycki */ 15a642a948SDawid Frycki 16a642a948SDawid Frycki #ifndef IPMBDEFINES_HPP 17a642a948SDawid Frycki #define IPMBDEFINES_HPP 18a642a948SDawid Frycki 19a642a948SDawid Frycki #include <inttypes.h> 20a642a948SDawid Frycki 21*f140ed6aSPatrick Williams // -Wpedantic doesn't like flexible array members in C++. 22*f140ed6aSPatrick Williams // Disable it for this file. 23*f140ed6aSPatrick Williams #pragma GCC diagnostic push 24*f140ed6aSPatrick Williams #pragma GCC diagnostic ignored "-Wpedantic" 25*f140ed6aSPatrick Williams 26a642a948SDawid Frycki #pragma pack(1) 27a642a948SDawid Frycki typedef struct _IPMB_HEADER 28a642a948SDawid Frycki { 29a642a948SDawid Frycki union 30a642a948SDawid Frycki { 31a642a948SDawid Frycki struct 32a642a948SDawid Frycki { 33a642a948SDawid Frycki /** @brief IPMB Connection Header Format */ 34a642a948SDawid Frycki uint8_t address; 35a642a948SDawid Frycki uint8_t rsNetFnLUN; /// @brief responder's net function and logical 36a642a948SDawid Frycki /// unit number 37a642a948SDawid Frycki uint8_t checksum1; /// @brief checksum computed on first two bytes 38a642a948SDawid Frycki /// of IPMB_HEADER 39a642a948SDawid Frycki /** @brief IPMB Header */ 40a642a948SDawid Frycki uint8_t rqSA; /// @brief requester's slave address, LS bit=0 41a642a948SDawid Frycki uint8_t rqSeqLUN; /// @brief requester's sequence number and logical 42a642a948SDawid Frycki /// unit number 43a642a948SDawid Frycki uint8_t cmd; /// @brief command required by the network identify the 44a642a948SDawid Frycki /// type of rqts 45a642a948SDawid Frycki uint8_t data[]; /// @brief payload 46a642a948SDawid Frycki } Req; /// @brief IPMB request header 47a642a948SDawid Frycki struct 48a642a948SDawid Frycki { 49a642a948SDawid Frycki uint8_t address; 50a642a948SDawid Frycki /** @brief IPMB Connection Header Format */ 51a642a948SDawid Frycki uint8_t rqNetFnLUN; /// @brief requester's net function and logical 52a642a948SDawid Frycki /// unit number 53a642a948SDawid Frycki uint8_t checksum1; /// @brief checksum computed on first two bytes 54a642a948SDawid Frycki /// of IPMB_HEADER 55a642a948SDawid Frycki /** @brief IPMB Header */ 56a642a948SDawid Frycki uint8_t rsSA; /// @brief responder's slave address, LS bit=0 57a642a948SDawid Frycki uint8_t rsSeqLUN; /// @brief responder's sequence number and logical 58a642a948SDawid Frycki /// unit number 59a642a948SDawid Frycki uint8_t cmd; /// @brief command required by the network identify the 60a642a948SDawid Frycki /// type of rqts 61a642a948SDawid Frycki uint8_t completionCode; /// @brief IPMB nodes return a Completion 62a642a948SDawid Frycki /// Code in all response msgs 63a642a948SDawid Frycki uint8_t data[]; /// @brief payload 64a642a948SDawid Frycki } Resp; /// @brief IPMB response header 65a642a948SDawid Frycki } Header; /// @brief IPMB frame header 66a642a948SDawid Frycki } IPMB_HEADER; 67a642a948SDawid Frycki #pragma pack() 68a642a948SDawid Frycki 6937a7eaceSVijay Khemka typedef struct _IPMB_DRV_HDR 7037a7eaceSVijay Khemka { 7137a7eaceSVijay Khemka uint8_t len; 7237a7eaceSVijay Khemka IPMB_HEADER hdr; 7337a7eaceSVijay Khemka } IPMB_PKT; 7437a7eaceSVijay Khemka 75*f140ed6aSPatrick Williams #pragma GCC diagnostic pop 76a642a948SDawid Frycki #endif 77