2 Provides services to create, get and update HSTI table in AIP protocol.
4 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #define __HSTI_LIB_H__
13 Publish HSTI table in AIP protocol.
15 One system should have only one PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE.
17 If the Role is NOT PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE,
18 SecurityFeaturesRequired field will be ignored.
21 @param HstiSize HSTI size
23 @retval EFI_SUCCESS The HSTI data is published in AIP protocol.
24 @retval EFI_ALREADY_STARTED There is already HSTI table with Role and ImplementationID published in system.
25 @retval EFI_VOLUME_CORRUPTED The input HSTI data does not follow HSTI specification.
26 @retval EFI_OUT_OF_RESOURCES There is not enough system resource to publish HSTI data in AIP protocol.
36 Search HSTI table in AIP protocol, and return the data.
37 This API will return the HSTI table with indicated Role and ImplementationID,
38 NULL ImplementationID means to find the first HSTI table with indicated Role.
40 @param Role Role of HSTI data.
41 @param ImplementationID ImplementationID of HSTI data.
42 NULL means find the first one match Role.
43 @param Hsti HSTI data. This buffer is allocated by callee, and it
44 is the responsibility of the caller to free it after
46 @param HstiSize HSTI size
48 @retval EFI_SUCCESS The HSTI data in AIP protocol is returned.
49 @retval EFI_NOT_FOUND There is not HSTI table with the Role and ImplementationID published in system.
55 IN CHAR16
*ImplementationID OPTIONAL
,
61 Set FeaturesVerified in published HSTI table.
62 This API will update the HSTI table with indicated Role and ImplementationID,
63 NULL ImplementationID means to find the first HSTI table with indicated Role.
65 @param Role Role of HSTI data.
66 @param ImplementationID ImplementationID of HSTI data.
67 NULL means find the first one match Role.
68 @param ByteIndex Byte index of FeaturesVerified of HSTI data.
69 @param BitMask Bit mask of FeaturesVerified of HSTI data.
71 @retval EFI_SUCCESS The FeaturesVerified of HSTI data updated in AIP protocol.
72 @retval EFI_NOT_STARTED There is not HSTI table with the Role and ImplementationID published in system.
73 @retval EFI_UNSUPPORTED The ByteIndex is invalid.
77 HstiLibSetFeaturesVerified (
79 IN CHAR16
*ImplementationID
, OPTIONAL
85 Clear FeaturesVerified in published HSTI table.
86 This API will update the HSTI table with indicated Role and ImplementationID,
87 NULL ImplementationID means to find the first HSTI table with indicated Role.
89 @param Role Role of HSTI data.
90 @param ImplementationID ImplementationID of HSTI data.
91 NULL means find the first one match Role.
92 @param ByteIndex Byte index of FeaturesVerified of HSTI data.
93 @param BitMask Bit mask of FeaturesVerified of HSTI data.
95 @retval EFI_SUCCESS The FeaturesVerified of HSTI data updated in AIP protocol.
96 @retval EFI_NOT_STARTED There is not HSTI table with the Role and ImplementationID published in system.
97 @retval EFI_UNSUPPORTED The ByteIndex is invalid.
101 HstiLibClearFeaturesVerified (
103 IN CHAR16
*ImplementationID
, OPTIONAL
109 Append ErrorString in published HSTI table.
110 This API will update the HSTI table with indicated Role and ImplementationID,
111 NULL ImplementationID means to find the first HSTI table with indicated Role.
113 @param Role Role of HSTI data.
114 @param ImplementationID ImplementationID of HSTI data.
115 NULL means find the first one match Role.
116 @param ErrorString ErrorString of HSTI data.
118 @retval EFI_SUCCESS The ErrorString of HSTI data is updated in AIP protocol.
119 @retval EFI_NOT_STARTED There is not HSTI table with the Role and ImplementationID published in system.
120 @retval EFI_OUT_OF_RESOURCES There is not enough system resource to update ErrorString.
124 HstiLibAppendErrorString (
126 IN CHAR16
*ImplementationID
, OPTIONAL
127 IN CHAR16
*ErrorString
131 Set a new ErrorString in published HSTI table.
132 This API will update the HSTI table with indicated Role and ImplementationID,
133 NULL ImplementationID means to find the first HSTI table with indicated Role.
135 @param Role Role of HSTI data.
136 @param ImplementationID ImplementationID of HSTI data.
137 NULL means find the first one match Role.
138 @param ErrorString ErrorString of HSTI data.
140 @retval EFI_SUCCESS The ErrorString of HSTI data is updated in AIP protocol.
141 @retval EFI_NOT_STARTED There is not HSTI table with the Role and ImplementationID published in system.
142 @retval EFI_OUT_OF_RESOURCES There is not enough system resource to update ErrorString.
146 HstiLibSetErrorString (
148 IN CHAR16
*ImplementationID
, OPTIONAL
149 IN CHAR16
*ErrorString