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