]> git.proxmox.com Git - mirror_edk2.git/blob - ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h
add comments to function declarations and definitions and updated to match coding...
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / SmbiosView / LibSmbiosView.h
1 /** @file
2 API for SMBIOS Plug and Play functions, access to SMBIOS table and structures.
3
4 Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _LIB_SMBIOS_VIEW_H_
16 #define _LIB_SMBIOS_VIEW_H_
17
18 #include "LibSmbios.h"
19
20 #define DMI_SUCCESS 0x00
21 #define DMI_UNKNOWN_FUNCTION 0x81
22 #define DMI_FUNCTION_NOT_SUPPORTED 0x82
23 #define DMI_INVALID_HANDLE 0x83
24 #define DMI_BAD_PARAMETER 0x84
25 #define DMI_INVALID_SUBFUNCTION 0x85
26 #define DMI_NO_CHANGE 0x86
27 #define DMI_ADD_STRUCTURE_FAILED 0x87
28 #define DMI_READ_ONLY 0x8D
29 #define DMI_LOCK_NOT_SUPPORTED 0x90
30 #define DMI_CURRENTLY_LOCKED 0x91
31 #define DMI_INVALID_LOCK 0x92
32
33 #define INVALIDE_HANDLE (UINT16) (-1)
34
35 #define EFI_SMBIOSERR(val) EFIERR (0x30000 | val)
36
37 #define EFI_SMBIOSERR_FAILURE EFI_SMBIOSERR (1)
38 #define EFI_SMBIOSERR_STRUCT_NOT_FOUND EFI_SMBIOSERR (2)
39 #define EFI_SMBIOSERR_TYPE_UNKNOWN EFI_SMBIOSERR (3)
40 #define EFI_SMBIOSERR_UNSUPPORTED EFI_SMBIOSERR (4)
41
42 /**
43 Init the SMBIOS VIEW API's environment.
44
45 @retval EFI_SUCCESS Successful to init the SMBIOS VIEW Lib.
46 **/
47 EFI_STATUS
48 LibSmbiosInit (
49 VOID
50 );
51
52 /**
53 Cleanup the Smbios information.
54 **/
55 VOID
56 LibSmbiosCleanup (
57 VOID
58 );
59
60 /**
61 Get the entry point structure for the table.
62
63 @param[out] EntryPointStructure The pointer to populate.
64 **/
65 VOID
66 LibSmbiosGetEPS (
67 OUT SMBIOS_STRUCTURE_TABLE **EntryPointStructure
68 );
69
70 /**
71 Get SMBIOS structure given the Handle,copy data to the Buffer,
72 Handle is changed to the next handle or 0xFFFF when the end is
73 reached or the handle is not found.
74
75 @param[in,out] Handle 0xFFFF: get the first structure
76 Others: get a structure according to this value.
77 @param[in,out] Buffer The pointer to the caller's memory buffer.
78 @param[out] Length Length of return buffer in bytes.
79
80 @retval DMI_SUCCESS Buffer contains the required structure data
81 Handle is updated with next structure handle or
82 0xFFFF(end-of-list).
83
84 @retval DMI_INVALID_HANDLE Buffer not contain the requiring structure data.
85 Handle is updated with next structure handle or
86 0xFFFF(end-of-list).
87 **/
88 EFI_STATUS
89 LibGetSmbiosStructure (
90 IN OUT UINT16 *Handle,
91 IN OUT UINT8 *Buffer,
92 OUT UINT16 *Length
93 );
94
95 /**
96 Get a string from the smbios information.
97
98 @param[in] Smbios The pointer to the smbios information.
99 @param[in] StringNumber The index to the string to get.
100 @param[out] Buffer The buffer to fill with the string when retrieved.
101 **/
102 VOID
103 SmbiosGetPendingString (
104 IN SMBIOS_STRUCTURE_POINTER *Smbios,
105 IN UINT16 StringNumber,
106 OUT CHAR8 *Buffer
107 );
108
109 /**
110 Check the structure to see if it is legal.
111
112 @param[in] Smbios - Pointer to the structure that will be checked.
113
114 @retval DMI_SUCCESS Structure data is legal.
115 @retval DMI_BAD_PARAMETER Structure data contains bad parameter.
116 **/
117 EFI_STATUS
118 SmbiosCheckStructure (
119 IN SMBIOS_STRUCTURE_POINTER *Smbios
120 );
121
122 #endif