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 21a642a948SDawid Frycki #pragma pack(1) 22a642a948SDawid Frycki typedef struct _IPMB_HEADER 23a642a948SDawid Frycki { 24a642a948SDawid Frycki union 25a642a948SDawid Frycki { 26a642a948SDawid Frycki struct 27a642a948SDawid Frycki { 28a642a948SDawid Frycki /** @brief IPMB Connection Header Format */ 29a642a948SDawid Frycki uint8_t address; 30a642a948SDawid Frycki uint8_t rsNetFnLUN; /// @brief responder's net function and logical 31a642a948SDawid Frycki /// unit number 32a642a948SDawid Frycki uint8_t checksum1; /// @brief checksum computed on first two bytes 33a642a948SDawid Frycki /// of IPMB_HEADER 34a642a948SDawid Frycki /** @brief IPMB Header */ 35a642a948SDawid Frycki uint8_t rqSA; /// @brief requester's slave address, LS bit=0 36a642a948SDawid Frycki uint8_t rqSeqLUN; /// @brief requester's sequence number and logical 37a642a948SDawid Frycki /// unit number 38a642a948SDawid Frycki uint8_t cmd; /// @brief command required by the network identify the 39a642a948SDawid Frycki /// type of rqts 40a642a948SDawid Frycki uint8_t data[]; /// @brief payload 41a642a948SDawid Frycki } Req; /// @brief IPMB request header 42a642a948SDawid Frycki struct 43a642a948SDawid Frycki { 44a642a948SDawid Frycki uint8_t address; 45a642a948SDawid Frycki /** @brief IPMB Connection Header Format */ 46a642a948SDawid Frycki uint8_t rqNetFnLUN; /// @brief requester's net function and logical 47a642a948SDawid Frycki /// unit number 48a642a948SDawid Frycki uint8_t checksum1; /// @brief checksum computed on first two bytes 49a642a948SDawid Frycki /// of IPMB_HEADER 50a642a948SDawid Frycki /** @brief IPMB Header */ 51a642a948SDawid Frycki uint8_t rsSA; /// @brief responder's slave address, LS bit=0 52a642a948SDawid Frycki uint8_t rsSeqLUN; /// @brief responder's sequence number and logical 53a642a948SDawid Frycki /// unit number 54a642a948SDawid Frycki uint8_t cmd; /// @brief command required by the network identify the 55a642a948SDawid Frycki /// type of rqts 56a642a948SDawid Frycki uint8_t completionCode; /// @brief IPMB nodes return a Completion 57a642a948SDawid Frycki /// Code in all response msgs 58a642a948SDawid Frycki uint8_t data[]; /// @brief payload 59a642a948SDawid Frycki } Resp; /// @brief IPMB response header 60a642a948SDawid Frycki } Header; /// @brief IPMB frame header 61a642a948SDawid Frycki } IPMB_HEADER; 62a642a948SDawid Frycki #pragma pack() 63a642a948SDawid Frycki 64*37a7eaceSVijay Khemka typedef struct _IPMB_DRV_HDR 65*37a7eaceSVijay Khemka { 66*37a7eaceSVijay Khemka uint8_t len; 67*37a7eaceSVijay Khemka IPMB_HEADER hdr; 68*37a7eaceSVijay Khemka } IPMB_PKT; 69*37a7eaceSVijay Khemka 70a642a948SDawid Frycki #endif 71