]> git.proxmox.com Git - mirror_edk2.git/blob - QuarkPlatformPkg/Platform/Dxe/SmbiosMiscDxe/SmbiosMisc.h
b59933ba3a43624d97c8fc28954ca5a1ff3327a0
[mirror_edk2.git] / QuarkPlatformPkg / Platform / Dxe / SmbiosMiscDxe / SmbiosMisc.h
1 /** @file
2 Header file for the SmbiosMisc Driver.
3
4 Copyright (c) 2013-2015 Intel Corporation.
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8
9 **/
10
11 #ifndef _SMBIOS_MISC_H
12 #define _SMBIOS_MISC_H
13
14 #include "MiscDevicePath.h"
15 #include <Library/UefiBootServicesTableLib.h>
16 #include <Library/PrintLib.h>
17
18 ///
19 /// Reference SMBIOS 2.6, chapter 3.1.3.
20 /// Each text string is limited to 64 significant characters due to system MIF limitations.
21 ///
22 #define SMBIOS_STRING_MAX_LENGTH 64
23 #define SMBIOS_PORT_CONNECTOR_MAX_NUM 14
24
25 typedef struct {
26 CHAR16 PortInternalConnectorDesignator[SMBIOS_STRING_MAX_LENGTH];
27 CHAR16 PortExternalConnectorDesignator[SMBIOS_STRING_MAX_LENGTH];
28 UINT8 PortInternalConnectorType;
29 UINT8 PortExternalConnectorType;
30 UINT8 PortType;
31 } SMBIOS_PORT_CONNECTOR_DESIGNATOR;
32
33 typedef struct {
34 UINT8 SMBIOSConnectorNumber;
35 SMBIOS_PORT_CONNECTOR_DESIGNATOR SMBIOSPortConnector[SMBIOS_PORT_CONNECTOR_MAX_NUM];
36 } SMBIOS_PORT_CONNECTOR_DESIGNATOR_COFNIG;
37
38 #define SMBIOS_SYSTEM_SLOT_MAX_NUM 14
39
40 typedef struct {
41 CHAR16 SlotDesignation[SMBIOS_STRING_MAX_LENGTH];
42 UINT8 SlotType;
43 UINT8 SlotDataBusWidth;
44 UINT8 SlotUsage;
45 UINT8 SlotLength;
46 UINT16 SlotId;
47 UINT32 SlotCharacteristics;
48 } SMBIOS_SLOT_DESIGNATION;
49
50 typedef struct {
51 UINT8 SMBIOSSystemSlotNumber;
52 SMBIOS_SLOT_DESIGNATION SMBIOSSystemSlot[SMBIOS_SYSTEM_SLOT_MAX_NUM];
53 } SMBIOS_SLOT_COFNIG;
54
55 //
56 // Data table entry update function.
57 //
58 typedef EFI_STATUS (EFIAPI EFI_MISC_SMBIOS_DATA_FUNCTION) (
59 IN VOID *RecordData,
60 IN EFI_SMBIOS_PROTOCOL *Smbios
61 );
62
63
64 //
65 // Data table entry definition.
66 //
67 typedef struct {
68 //
69 // intermediat input data for SMBIOS record
70 //
71 VOID *RecordData;
72 EFI_MISC_SMBIOS_DATA_FUNCTION *Function;
73 } EFI_MISC_SMBIOS_DATA_TABLE;
74
75 //
76 // Data Table extern definitions.
77 //
78 #define MISC_SMBIOS_DATA_TABLE_POINTER(NAME1) \
79 & NAME1 ## Data
80
81 //
82 // Data Table extern definitions.
83 //
84 #define MISC_SMBIOS_DATA_TABLE_EXTERNS(NAME1, NAME2) \
85 extern NAME1 NAME2 ## Data
86
87 //
88 // Data and function Table extern definitions.
89 //
90 #define MISC_SMBIOS_TABLE_EXTERNS(NAME1, NAME2, NAME3) \
91 extern NAME1 NAME2 ## Data; \
92 extern EFI_MISC_SMBIOS_DATA_FUNCTION NAME3 ## Function
93
94
95 //
96 // Data Table entries
97 //
98
99 #define MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(NAME1, NAME2) \
100 { \
101 & NAME1 ## Data, \
102 & NAME2 ## Function \
103 }
104
105
106 //
107 // Global definition macros.
108 //
109 #define MISC_SMBIOS_TABLE_DATA(NAME1, NAME2) \
110 NAME1 NAME2 ## Data
111
112 #define MISC_SMBIOS_TABLE_FUNCTION(NAME2) \
113 EFI_STATUS EFIAPI NAME2 ## Function( \
114 IN VOID *RecordData, \
115 IN EFI_SMBIOS_PROTOCOL *Smbios \
116 )
117
118
119 // Data Table Array
120 //
121 extern EFI_MISC_SMBIOS_DATA_TABLE mSmbiosMiscDataTable[];
122
123 //
124 // Data Table Array Entries
125 //
126 extern UINTN mSmbiosMiscDataTableEntries;
127 extern EFI_HII_HANDLE mHiiHandle;
128 //
129 // Prototypes
130 //
131 EFI_STATUS
132 PiSmbiosMiscEntryPoint (
133 IN EFI_HANDLE ImageHandle,
134 IN EFI_SYSTEM_TABLE *SystemTable
135 );
136
137 #endif