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