]> git.proxmox.com Git - mirror_edk2.git/blob - Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c
add in MiscSubClassPlatformDxe
[mirror_edk2.git] / Nt32Pkg / MiscSubClassPlatformDxe / 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 //
24 // Include common header file for this module.
25 //
26 #include "CommonHeader.h"
27
28 #include "MiscSubclassDriver.h"
29
30 //
31 //
32 //
33 MISC_SUBCLASS_TABLE_FUNCTION (
34 MiscSystemManufacturer
35 )
36 /*++
37 Description:
38
39 This function makes boot time changes to the contents of the
40 MiscSystemManufacturer (Type 13).
41
42 Parameters:
43
44 RecordType
45 Type of record to be processed from the Data Table.
46 mMiscSubclassDataTable[].RecordType
47
48 RecordLen
49 Size of static RecordData from the Data Table.
50 mMiscSubclassDataTable[].RecordLen
51
52 RecordData
53 Pointer to copy of RecordData from the Data Table. Changes made
54 to this copy will be written to the Data Hub but will not alter
55 the contents of the static Data Table.
56
57 LogRecordData
58 Set *LogRecordData to TRUE to log RecordData to Data Hub.
59 Set *LogRecordData to FALSE when there is no more data to log.
60
61 Returns:
62
63 EFI_SUCCESS
64 All parameters were valid and *RecordData and *LogRecordData have
65 been set.
66
67 EFI_UNSUPPORTED
68 Unexpected RecordType value.
69
70 EFI_INVALID_PARAMETER
71 One of the following parameter conditions was true:
72 RecordLen was zero.
73 RecordData was NULL.
74 LogRecordData was NULL.
75 --*/
76 {
77 STATIC BOOLEAN Done = FALSE;
78
79 //
80 // First check for invalid parameters.
81 //
82 if (*RecordLen == 0 || RecordData == NULL || LogRecordData == NULL) {
83 return EFI_INVALID_PARAMETER;
84 }
85 //
86 // Then check for unsupported RecordType.
87 //
88 if (RecordType != EFI_MISC_SYSTEM_MANUFACTURER_RECORD_NUMBER) {
89 return EFI_UNSUPPORTED;
90 }
91 //
92 // Is this the first time through this function?
93 //
94 if (!Done) {
95 //
96 // Yes, this is the first time. Inspect/Change the contents of the
97 // RecordData structure.
98 //
99 //
100 // Set system GUID.
101 //
102 // ((EFI_MISC_SYSTEM_MANUFACTURER_DATA *)RecordData)->SystemUuid = %%TBD
103 //
104 // Set power-on type.
105 //
106 // ((EFI_MISC_SYSTEM_MANUFACTURER_DATA *)RecordData)->SystemWakeupType = %%TBD
107 //
108 // Set Done flag to TRUE for next pass through this function.
109 // Set *LogRecordData to TRUE so data will get logged to Data Hub.
110 //
111 Done = TRUE;
112 *LogRecordData = TRUE;
113 } else {
114 //
115 // No, this is the second time. Reset the state of the Done flag
116 // to FALSE and tell the data logger that there is no more data
117 // to be logged for this record type. If any memory allocations
118 // were made by earlier passes, they must be released now.
119 //
120 Done = FALSE;
121 *LogRecordData = FALSE;
122 }
123
124 return EFI_SUCCESS;
125 }
126
127 /* eof - MiscSystemManufacturerFunction.c */