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
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.
14 MiscOnboardDeviceFunction.c
18 Onboard device information boot time changes.
19 Misc. subclass type 8.
24 #include "MiscSubclassDriver.h"
25 #include "winntio/winntio.h"
26 #include "winntthunk/winntthunk.h"
30 typedef struct _VENDOR_DEVICE
{
31 EFI_DEVICE_PATH_PROTOCOL Platform
;
32 EFI_GUID PlatformGuid
;
33 EFI_DEVICE_PATH_PROTOCOL Device
;
36 EFI_DEVICE_PATH_PROTOCOL End
;
41 MISC_SUBCLASS_TABLE_FUNCTION (
42 MiscOnboardDeviceVideo
47 This function makes boot time changes to the contents of the
48 MiscOnboardDevice structure.
53 Type of record to be processed from the Data Table.
54 mMiscSubclassDataTable[].RecordType
57 Size of static RecordData from the Data Table.
58 mMiscSubclassDataTable[].RecordLen
61 Pointer to copy of RecordData from the Data Table. Changes made
62 to this copy will be written to the Data Hub but will not alter
63 the contents of the static Data Table.
66 Set *LogRecordData to TRUE to log RecordData to Data Hub.
67 Set *LogRecordData to FALSE when there is no more data to log.
72 All parameters were valid and *RecordData and *LogRecordData have
76 Unexpected RecordType value.
79 One of the following parameter conditions was true:
82 LogRecordData was NULL.
85 STATIC VENDOR_DEVICE mVideoDevicePath
= {
91 EFI_WIN_NT_THUNK_PROTOCOL_GUID
,
105 STATIC BOOLEAN Done
= FALSE
;
108 // First check for invalid parameters.
110 if (RecordLen
== 0 || RecordData
== NULL
|| LogRecordData
== NULL
) {
111 return EFI_INVALID_PARAMETER
;
114 // Then check for unsupported RecordType.
116 if (RecordType
!= EFI_MISC_ONBOARD_DEVICE_DATA_RECORD_NUMBER
) {
117 return EFI_UNSUPPORTED
;
120 // Is this the first time through this function?
124 // Yes, this is the first time. Inspect/Change the contents of the
125 // RecordData structure.
132 // Set Done flag to TRUE for next pass through this function.
133 // Set *LogRecordData to TRUE so data will get logged to Data Hub.
135 switch (((EFI_MISC_ONBOARD_DEVICE_DATA
*) RecordData
)->OnBoardDeviceDescription
) {
136 case STR_MISC_ONBOARD_DEVICE_VIDEO_DESCRIPTION
:
139 &((EFI_MISC_ONBOARD_DEVICE_DATA
*) RecordData
)->OnBoardDevicePath
,
141 GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL
*) &mVideoDevicePath
)
143 *RecordLen
= *RecordLen
- sizeof (EFI_DEVICE_PATH_PROTOCOL
) + GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL
*) &mVideoDevicePath
);
149 *LogRecordData
= TRUE
;
152 // No, this is the second time. Reset the state of the Done flag
153 // to FALSE and tell the data logger that there is no more data
154 // to be logged for this record type. If any memory allocations
155 // were made by earlier passes, they must be released now.
158 *LogRecordData
= FALSE
;
164 /* eof - MiscOnboardDeviceFunction.c */