]>
Commit | Line | Data |
---|---|---|
5d73d92f | 1 | /** @file\r |
2 | API for SMBIOS Plug and Play functions, access to SMBIOS table and structures.\r | |
3 | \r | |
ec8a502e | 4 | Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>\r |
56ba3746 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
5d73d92f | 6 | \r |
7 | **/\r | |
8 | \r | |
a1d4bfcc | 9 | #ifndef _LIB_SMBIOS_VIEW_H_\r |
10 | #define _LIB_SMBIOS_VIEW_H_\r | |
5d73d92f | 11 | \r |
187cb3dd | 12 | #include <IndustryStandard/SmBios.h>\r |
5d73d92f | 13 | \r |
47d20b54 MK |
14 | #define DMI_SUCCESS 0x00\r |
15 | #define DMI_UNKNOWN_FUNCTION 0x81\r | |
16 | #define DMI_FUNCTION_NOT_SUPPORTED 0x82\r | |
17 | #define DMI_INVALID_HANDLE 0x83\r | |
18 | #define DMI_BAD_PARAMETER 0x84\r | |
19 | #define DMI_INVALID_SUBFUNCTION 0x85\r | |
20 | #define DMI_NO_CHANGE 0x86\r | |
21 | #define DMI_ADD_STRUCTURE_FAILED 0x87\r | |
22 | #define DMI_READ_ONLY 0x8D\r | |
23 | #define DMI_LOCK_NOT_SUPPORTED 0x90\r | |
24 | #define DMI_CURRENTLY_LOCKED 0x91\r | |
25 | #define DMI_INVALID_LOCK 0x92\r | |
26 | \r | |
27 | #define INVALID_HANDLE (UINT16) (-1)\r | |
28 | \r | |
29 | #define EFI_SMBIOSERR(val) EFIERR (0x30000 | val)\r | |
5d73d92f | 30 | \r |
31 | #define EFI_SMBIOSERR_FAILURE EFI_SMBIOSERR (1)\r | |
32 | #define EFI_SMBIOSERR_STRUCT_NOT_FOUND EFI_SMBIOSERR (2)\r | |
33 | #define EFI_SMBIOSERR_TYPE_UNKNOWN EFI_SMBIOSERR (3)\r | |
34 | #define EFI_SMBIOSERR_UNSUPPORTED EFI_SMBIOSERR (4)\r | |
35 | \r | |
a1d4bfcc | 36 | /**\r |
ec8a502e | 37 | Init the SMBIOS VIEW API's environment for the 32-bit table..\r |
a1d4bfcc | 38 | \r |
39 | @retval EFI_SUCCESS Successful to init the SMBIOS VIEW Lib.\r | |
40 | **/\r | |
5d73d92f | 41 | EFI_STATUS\r |
42 | LibSmbiosInit (\r | |
43 | VOID\r | |
44 | );\r | |
45 | \r | |
ec8a502e EL |
46 | /**\r |
47 | Init the SMBIOS VIEW API's environment for the 64-bit table..\r | |
48 | \r | |
49 | @retval EFI_SUCCESS Successful to init the SMBIOS VIEW Lib.\r | |
50 | **/\r | |
51 | EFI_STATUS\r | |
52 | LibSmbios64BitInit (\r | |
53 | VOID\r | |
54 | );\r | |
55 | \r | |
a1d4bfcc | 56 | /**\r |
57 | Cleanup the Smbios information.\r | |
58 | **/\r | |
5d73d92f | 59 | VOID\r |
60 | LibSmbiosCleanup (\r | |
61 | VOID\r | |
62 | );\r | |
63 | \r | |
ec8a502e EL |
64 | /**\r |
65 | Cleanup the Smbios information.\r | |
66 | **/\r | |
67 | VOID\r | |
68 | LibSmbios64BitCleanup (\r | |
69 | VOID\r | |
70 | );\r | |
71 | \r | |
a1d4bfcc | 72 | /**\r |
73 | Get the entry point structure for the table.\r | |
5d73d92f | 74 | \r |
a1d4bfcc | 75 | @param[out] EntryPointStructure The pointer to populate.\r |
76 | **/\r | |
5d73d92f | 77 | VOID\r |
a1d4bfcc | 78 | LibSmbiosGetEPS (\r |
47d20b54 | 79 | OUT SMBIOS_TABLE_ENTRY_POINT **EntryPointStructure\r |
5d73d92f | 80 | );\r |
81 | \r | |
ec8a502e EL |
82 | /**\r |
83 | Get the entry point structure for the 64-bit table.\r | |
84 | \r | |
85 | @param[out] EntryPointStructure The pointer to populate.\r | |
86 | **/\r | |
87 | VOID\r | |
88 | LibSmbios64BitGetEPS (\r | |
47d20b54 | 89 | OUT SMBIOS_TABLE_3_0_ENTRY_POINT **EntryPointStructure\r |
ec8a502e EL |
90 | );\r |
91 | \r | |
a1d4bfcc | 92 | /**\r |
187cb3dd SZ |
93 | Return SMBIOS string for the given string number.\r |
94 | \r | |
95 | @param[in] Smbios Pointer to SMBIOS structure.\r | |
96 | @param[in] StringNumber String number to return. -1 is used to skip all strings and\r | |
97 | point to the next SMBIOS structure.\r | |
98 | \r | |
99 | @return Pointer to string, or pointer to next SMBIOS strcuture if StringNumber == -1\r | |
100 | **/\r | |
47d20b54 | 101 | CHAR8 *\r |
187cb3dd | 102 | LibGetSmbiosString (\r |
47d20b54 MK |
103 | IN SMBIOS_STRUCTURE_POINTER *Smbios,\r |
104 | IN UINT16 StringNumber\r | |
187cb3dd SZ |
105 | );\r |
106 | \r | |
107 | /**\r | |
108 | Get SMBIOS structure for the given Handle,\r | |
a1d4bfcc | 109 | Handle is changed to the next handle or 0xFFFF when the end is\r |
110 | reached or the handle is not found.\r | |
5d73d92f | 111 | \r |
4ff7e37b ED |
112 | @param[in, out] Handle 0xFFFF: get the first structure\r |
113 | Others: get a structure according to this value.\r | |
187cb3dd SZ |
114 | @param[out] Buffer The pointer to the pointer to the structure.\r |
115 | @param[out] Length Length of the structure.\r | |
5d73d92f | 116 | \r |
187cb3dd | 117 | @retval DMI_SUCCESS Handle is updated with next structure handle or\r |
a1d4bfcc | 118 | 0xFFFF(end-of-list).\r |
5d73d92f | 119 | \r |
187cb3dd | 120 | @retval DMI_INVALID_HANDLE Handle is updated with first structure handle or\r |
a1d4bfcc | 121 | 0xFFFF(end-of-list).\r |
5d73d92f | 122 | **/\r |
123 | EFI_STATUS\r | |
124 | LibGetSmbiosStructure (\r | |
125 | IN OUT UINT16 *Handle,\r | |
187cb3dd | 126 | OUT UINT8 **Buffer,\r |
5d73d92f | 127 | OUT UINT16 *Length\r |
128 | );\r | |
129 | \r | |
ec8a502e EL |
130 | /**\r |
131 | Get SMBIOS structure for the given Handle in 64-bit table,\r | |
132 | Handle is changed to the next handle or 0xFFFF when the end is\r | |
133 | reached or the handle is not found.\r | |
134 | \r | |
135 | @param[in, out] Handle 0xFFFF: get the first structure\r | |
136 | Others: get a structure according to this value.\r | |
137 | @param[out] Buffer The pointer to the pointer to the structure.\r | |
138 | @param[out] Length Length of the structure.\r | |
139 | \r | |
140 | @retval DMI_SUCCESS Handle is updated with next structure handle or\r | |
141 | 0xFFFF(end-of-list).\r | |
142 | \r | |
143 | @retval DMI_INVALID_HANDLE Handle is updated with first structure handle or\r | |
144 | 0xFFFF(end-of-list).\r | |
145 | **/\r | |
146 | EFI_STATUS\r | |
147 | LibGetSmbios64BitStructure (\r | |
148 | IN OUT UINT16 *Handle,\r | |
149 | OUT UINT8 **Buffer,\r | |
150 | OUT UINT16 *Length\r | |
151 | );\r | |
152 | \r | |
5d73d92f | 153 | #endif\r |