blob: 957bb98783de941abcfcf665e98051201fc6c4b6 [file] [log] [blame]
Kuiying Wang6d6dc7a2020-04-02 10:15:19 +08001/*
2// Copyright (c) 2020 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
19#include <array>
20#include <fstream>
21#include <iostream>
22#include <string>
23#include <variant>
24#include <vector>
25
26constexpr uint8_t maxPayloadSupported = 0x6;
27constexpr uint8_t maxHashSize = 64;
Ayushi Smriti32381872021-06-23 11:05:48 +053028constexpr uint8_t maxSeedSize = 32;
Kuiying Wang6d6dc7a2020-04-02 10:15:19 +080029constexpr uint8_t maxPasswordSize = 64;
30
31#pragma pack(push, 1)
32struct PayloadStartTransfer
33{
34 uint16_t payloadVersion;
35 uint32_t payloadTotalSize;
36 uint32_t payloadTotalChecksum;
37 uint8_t payloadFlag;
38};
39#pragma pack(pop)
40
41struct PayloadInProgress
42{
43 uint32_t payloadReservationID;
44 uint32_t payloadOffset;
45 uint32_t payloadCurrentSize;
46 uint32_t payloadCurrentChecksum;
47};
48
49struct PayloadEndTransfer
50{
51 uint32_t payloadReservationID;
52};
53
54struct SetPayloadRetValue
55{
56 uint32_t reservationToken;
57 uint32_t actualPayloadWritten;
58 uint32_t actualTotalPayloadWritten;
59};
60
61struct setBIOSCapabilitiesReq
62{
63 uint8_t OOBCapability;
64 uint8_t reserved1;
65 uint8_t reserved2;
66 uint8_t reserved3;
67};
68
69struct PayloadInfo
70{
71 uint32_t payloadReservationID;
72 uint8_t payloadType;
73 uint16_t payloadVersion;
74 uint32_t payloadTotalSize;
75 uint32_t payloadTotalChecksum;
76 uint8_t payloadStatus;
77 uint8_t payloadflag;
78 uint32_t payloadTimeStamp;
79 uint32_t payloadCurrentSize;
80 uint32_t payloadCurrentChecksum;
81 uint32_t actualTotalPayloadWritten;
Kuiying Wang6d6dc7a2020-04-02 10:15:19 +080082};
83
84struct NVOOBdata
85{
86 setBIOSCapabilitiesReq mBIOSCapabilities;
87 uint8_t mIsBIOSCapInitDone;
88 PayloadInfo payloadInfo[maxPayloadSupported];
89};