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