blob: 40e081f63f2b8a8c2ad4fbc44949f2f5f900944e [file] [log] [blame]
Vernon Mauerya3702c12019-05-22 13:20:59 -07001/*
2// Copyright (c) 2018 Intel Corporation
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15*/
16
17#pragma once
18#include <cstddef>
19#include <cstdint>
20#include <oemcommands.hpp>
21
22#include "ipmid/api.h"
23
24constexpr uint16_t msgPayloadSize = 1024 * 60;
25
26typedef enum
27{
28 regionLockUnlocked = 0,
29 regionLockStrict,
30 regionLockPreemptable
31} MDRLockType;
32
33typedef struct
34{
35 uint8_t DirVer;
36 uint8_t MDRType;
37 uint16_t timestamp;
38 uint16_t DataSize;
39} __attribute__((packed)) MDRSmbios_Header;
40
41typedef struct
42{
43 uint8_t MdrVersion;
44 uint8_t regionId;
45 bool valid;
46 uint8_t updateCount;
47 uint8_t lockPolicy;
48 uint16_t regionLength;
49 uint16_t regionUsed;
50 uint8_t CRC8;
51} __attribute__((packed)) MDRState;
52
53struct RegionStatusRequest
54{
55 uint8_t regionId;
56} __attribute__((packed));
57
58struct RegionStatusResponse
59{
60 MDRState State;
61} __attribute__((packed));
62
Vernon Mauerya3702c12019-05-22 13:20:59 -070063struct RegionReadRequest
64{
65 uint8_t regionId;
66 uint8_t length;
67 uint16_t offset;
68} __attribute__((packed));
69
70struct RegionReadResponse
71{
72 uint8_t length;
73 uint8_t updateCount;
74 uint8_t data[msgPayloadSize];
75} __attribute__((packed));
76
Vernon Mauerya3702c12019-05-22 13:20:59 -070077constexpr size_t maxMDRId = 5;