]> git.proxmox.com Git - mirror_edk2.git/blob - EdkNt32Pkg/Dxe/Nt32Platform/MiscSubclass/MiscSystemManufacturerFunction.c
DebugLib:
[mirror_edk2.git] / EdkNt32Pkg / Dxe / Nt32Platform / MiscSubclass / MiscSystemManufacturerFunction.c
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 MiscSystemManufacturerFunction.c
15
16 Abstract:
17
18 This driver parses the mMiscSubclassDataTable structure and reports
19 any generated data to the DataHub.
20
21 --*/
22
23 #include "MiscSubclassDriver.h"
24
25 //
26 //
27 //
28 MISC_SUBCLASS_TABLE_FUNCTION (
29 MiscSystemManufacturer
30 )
31 /*++
32 Description:
33
34 This function makes boot time changes to the contents of the
35 MiscSystemManufacturer (Type 13).
36
37 Parameters:
38
39 RecordType
40 Type of record to be processed from the Data Table.
41 mMiscSubclassDataTable[].RecordType
42
43 RecordLen
44 Size of static RecordData from the Data Table.
45 mMiscSubclassDataTable[].RecordLen
46
47 RecordData
48 Pointer to copy of RecordData from the Data Table. Changes made
49 to this copy will be written to the Data Hub but will not alter
50 the contents of the static Data Table.
51
52 LogRecordData
53 Set *LogRecordData to TRUE to log RecordData to Data Hub.
54 Set *LogRecordData to FALSE when there is no more data to log.
55
56 Returns:
57
58 EFI_SUCCESS
59 All parameters were valid and *RecordData and *LogRecordData have
60 been set.
61
62 EFI_UNSUPPORTED
63 Unexpected RecordType value.
64
65 EFI_INVALID_PARAMETER
66 One of the following parameter conditions was true:
67 RecordLen was zero.
68 RecordData was NULL.
69 LogRecordData was NULL.
70 --*/
71 {
72 STATIC BOOLEAN Done = FALSE;
73
74 //
75 // First check for invalid parameters.
76 //
77 if (*RecordLen == 0 || RecordData == NULL || LogRecordData == NULL) {
78 return EFI_INVALID_PARAMETER;
79 }
80 //
81 // Then check for unsupported RecordType.
82 //
83 if (RecordType != EFI_MISC_SYSTEM_MANUFACTURER_RECORD_NUMBER) {
84 return EFI_UNSUPPORTED;
85 }
86 //
87 // Is this the first time through this function?
88 //
89 if (!Done) {
90 //
91 // Yes, this is the first time. Inspect/Change the contents of the
92 // RecordData structure.
93 //
94 //
95 // Set system GUID.
96 //
97 // ((EFI_MISC_SYSTEM_MANUFACTURER_DATA *)RecordData)->SystemUuid = %%TBD
98 //
99 // Set power-on type.
100 //
101 // ((EFI_MISC_SYSTEM_MANUFACTURER_DATA *)RecordData)->SystemWakeupType = %%TBD
102 //
103 // Set Done flag to TRUE for next pass through this function.
104 // Set *LogRecordData to TRUE so data will get logged to Data Hub.
105 //
106 Done = TRUE;
107 *LogRecordData = TRUE;
108 } else {
109 //
110 // No, this is the second time. Reset the state of the Done flag
111 // to FALSE and tell the data logger that there is no more data
112 // to be logged for this record type. If any memory allocations
113 // were made by earlier passes, they must be released now.
114 //
115 Done = FALSE;
116 *LogRecordData = FALSE;
117 }
118
119 return EFI_SUCCESS;
120 }
121
122 /* eof - MiscSystemManufacturerFunction.c */