blob: b78630060b1864c6849db2eeea032a74fa7dc2ec [file] [log] [blame]
Dawid Fryckia642a942018-06-12 10:44:23 -07001/* 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 Williamsf140ed62023-03-30 16:14:04 -050021// -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 Fryckia642a942018-06-12 10:44:23 -070026#pragma pack(1)
27typedef 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 Simmering0736e212023-11-01 16:28:55 -070040 uint8_t rqSA; /// @brief requester's target address, LS bit=0
Dawid Fryckia642a942018-06-12 10:44:23 -070041 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 Simmering0736e212023-11-01 16:28:55 -070056 uint8_t rsSA; /// @brief responder's target address, LS bit=0
Dawid Fryckia642a942018-06-12 10:44:23 -070057 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 Khemka37a7eac2019-12-06 13:52:28 -080069typedef struct _IPMB_DRV_HDR
70{
71 uint8_t len;
72 IPMB_HEADER hdr;
73} IPMB_PKT;
74
Patrick Williamsf140ed62023-03-30 16:14:04 -050075#pragma GCC diagnostic pop
Dawid Fryckia642a942018-06-12 10:44:23 -070076#endif