1 /** @file
2   Tools of clarify the content of the smbios table.
3 
4   Copyright (c) 2005 - 2015, 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 _SMBIOS_VIEW_H_
16 #define _SMBIOS_VIEW_H_
17 
18 #define STRUCTURE_TYPE_RANDOM     (UINT8) 0xFE
19 #define STRUCTURE_TYPE_INVALID    (UINT8) 0xFF
20 
21 typedef struct {
22   UINT16  Index;
23   UINT8   Type;
24   UINT16  Handle;
25   UINT16  Addr;   // offset from table head
26   UINT16  Length; // total structure length
27 } STRUCTURE_STATISTICS;
28 
29 /**
30   Query all structures Data from SMBIOS table and Display
31   the information to users as required display option.
32 
33   @param[in] QueryType      Structure type to view.
34   @param[in] QueryHandle    Structure handle to view.
35   @param[in] Option         Display option: none,outline,normal,detail.
36   @param[in] RandomView     Support for -h parameter.
37 
38   @retval EFI_SUCCESS           print is successful.
39   @retval EFI_BAD_BUFFER_SIZE   structure is out of the range of SMBIOS table.
40 **/
41 EFI_STATUS
42 EFIAPI
43 SMBiosView (
44   IN  UINT8     QueryType,
45   IN  UINT16    QueryHandle,
46   IN  UINT8     Option,
47   IN  BOOLEAN   RandomView
48   );
49 
50 /**
51   Query all structures Data from SMBIOS table and Display
52   the information to users as required display option.
53 
54   @param[in] QueryType      Structure type to view.
55   @param[in] QueryHandle    Structure handle to view.
56   @param[in] Option         Display option: none,outline,normal,detail.
57   @param[in] RandomView     Support for -h parameter.
58 
59   @retval EFI_SUCCESS           print is successful.
60   @retval EFI_BAD_BUFFER_SIZE   structure is out of the range of SMBIOS table.
61 **/
62 EFI_STATUS
63 EFIAPI
64 SMBios64View (
65   IN  UINT8     QueryType,
66   IN  UINT16    QueryHandle,
67   IN  UINT8     Option,
68   IN  BOOLEAN   RandomView
69   );
70 
71 /**
72   Function to initialize the global mStatisticsTable object.
73 
74   @retval EFI_SUCCESS           print is successful.
75 **/
76 EFI_STATUS
77 EFIAPI
78 InitSmbiosTableStatistics (
79   VOID
80   );
81 
82 /**
83   Function to initialize the global mSmbios64BitStatisticsTable object.
84 
85   @retval EFI_SUCCESS           print is successful.
86 **/
87 EFI_STATUS
88 EFIAPI
89 InitSmbios64BitTableStatistics (
90   VOID
91   );
92 
93 /**
94   Function to display the global mStatisticsTable object.
95 
96   @param[in] Option             ECHO, NORMAL, or DETAIL control the amount of detail displayed.
97 
98   @retval EFI_SUCCESS           print is successful.
99 **/
100 EFI_STATUS
101 EFIAPI
102 DisplayStatisticsTable (
103   IN UINT8 Option
104   );
105 
106 /**
107   Function to display the global mSmbios64BitStatisticsTable object.
108 
109   @param[in] Option             ECHO, NORMAL, or DETAIL control the amount of detail displayed.
110 
111   @retval EFI_SUCCESS           print is successful.
112 **/
113 EFI_STATUS
114 EFIAPI
115 DisplaySmbios64BitStatisticsTable (
116   IN UINT8 Option
117   );
118 
119 /**
120   function to return a string of the detail level.
121 
122   @param[in] ShowType         The detail level whose name is desired in clear text.
123 
124   @return   A pointer to a string representing the ShowType (or 'undefined type' if not known).
125 **/
126 CHAR16*
127 EFIAPI
128 GetShowTypeString (
129   UINT8 ShowType
130   );
131 
132 extern UINT8  gShowType;
133 
134 extern UINTN  mSmbios64BitTableLength;
135 
136 #endif
137