TianoCore EDK2 master
|
#include "ConPlatform.h"
Go to the source code of this file.
Macros | |
#define | USB_BASE_CLASS_MISCELLANEOUS 0xEF |
#define | USB_MISCELLANEOUS_SUBCLASS_COMMON 0x02 |
#define | USB_MISCELLANEOUS_PROTOCOL_IAD 0x01 |
Variables | |
EFI_DRIVER_BINDING_PROTOCOL | gConPlatformTextInDriverBinding |
EFI_DRIVER_BINDING_PROTOCOL | gConPlatformTextOutDriverBinding |
Console Platform DXE Driver, install Console Device Guids and update Console Environment Variables.
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file ConPlatform.c.
#define USB_BASE_CLASS_MISCELLANEOUS 0xEF |
Definition at line 35 of file ConPlatform.c.
#define USB_MISCELLANEOUS_PROTOCOL_IAD 0x01 |
Definition at line 37 of file ConPlatform.c.
#define USB_MISCELLANEOUS_SUBCLASS_COMMON 0x02 |
Definition at line 36 of file ConPlatform.c.
EFI_STATUS ConPlatformDriverBindingSupported | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_GUID * | ProtocolGuid | ||
) |
Test to see if the specified protocol is supported on ControllerHandle.
This | Protocol instance pointer. |
ControllerHandle | Handle of device to test. |
ProtocolGuid | The specfic protocol. |
EFI_SUCCESS | This driver supports this device. |
other | This driver does not support this device. |
Definition at line 149 of file ConPlatform.c.
VOID * ConPlatformGetVariable | ( | IN CHAR16 * | Name | ) |
Get the necessary size of buffer and read the variable.
First get the necessary size of buffer. Then read the EFI variable (Name) and return a dynamically allocated buffer. On failure return NULL.
Name | String part of EFI variable name |
Definition at line 661 of file ConPlatform.c.
EFI_STATUS ConPlatformMatchDevicePaths | ( | IN EFI_DEVICE_PATH_PROTOCOL * | Multi, |
IN EFI_DEVICE_PATH_PROTOCOL * | Single, | ||
OUT EFI_DEVICE_PATH_PROTOCOL **NewDevicePath | OPTIONAL, | ||
IN BOOLEAN | Delete | ||
) |
Function compares a device path data structure to that of all the nodes of a second device path instance.
Multi | A pointer to a multi-instance device path data structure. |
Single | A pointer to a single-instance device path data structure. |
NewDevicePath | If Delete is TRUE, this parameter must not be null, and it points to the remaining device path data structure. (remaining device path = Multi - Single.) |
Delete | If TRUE, means removing Single from Multi. If FALSE, the routine just check whether Single matches with any instance in Multi. |
EFI_SUCCESS | If the Single is contained within Multi. |
EFI_NOT_FOUND | If the Single is not contained within Multi. |
EFI_INVALID_PARAMETER | Multi is NULL. |
EFI_INVALID_PARAMETER | Single is NULL. |
EFI_INVALID_PARAMETER | NewDevicePath is NULL when Delete is TRUE. |
Definition at line 1076 of file ConPlatform.c.
EFI_STATUS EFIAPI ConPlatformTextInDriverBindingStart | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Start this driver on the device for console input.
Start this driver on ControllerHandle by opening Simple Text Input Protocol, reading Device Path, and installing Console In Devcice GUID on ControllerHandle.
Append its device path into the console environment variables ConInDev.
This | Protocol instance pointer. |
ControllerHandle | Handle of device to bind driver to |
RemainingDevicePath | Optional parameter use to pick a specific child device to start. |
EFI_SUCCESS | This driver is added to ControllerHandle |
EFI_ALREADY_STARTED | This driver is already running on ControllerHandle |
other | This driver does not support this device. |
Definition at line 219 of file ConPlatform.c.
EFI_STATUS EFIAPI ConPlatformTextInDriverBindingStop | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN UINTN | NumberOfChildren, | ||
IN EFI_HANDLE * | ChildHandleBuffer | ||
) |
Stop this driver on ControllerHandle by removing Console In Devcice GUID and closing the Simple Text Input protocol on ControllerHandle.
This | Protocol instance pointer. |
ControllerHandle | Handle of device to stop driver on |
NumberOfChildren | Number of Handles in ChildHandleBuffer. If number of children is zero stop the entire bus driver. |
ChildHandleBuffer | List of Child Handles to Stop. |
EFI_SUCCESS | This driver is removed ControllerHandle |
other | This driver was not removed from this device |
Definition at line 470 of file ConPlatform.c.
EFI_STATUS EFIAPI ConPlatformTextInDriverBindingSupported | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath | OPTIONAL | ||
) |
Test to see if EFI_SIMPLE_TEXT_INPUT_PROTOCOL is supported on ControllerHandle.
This | Protocol instance pointer. |
ControllerHandle | Handle of device to test. |
RemainingDevicePath | Optional parameter use to pick a specific child device to start. |
EFI_SUCCESS | This driver supports this device. |
other | This driver does not support this device. |
Definition at line 97 of file ConPlatform.c.
EFI_STATUS EFIAPI ConPlatformTextOutDriverBindingStart | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Start this driver on the device for console output and standard error output.
Start this driver on ControllerHandle by opening Simple Text Output Protocol, reading Device Path, and installing Console Out Devcic GUID, Standard Error Device GUID on ControllerHandle.
Append its device path into the console environment variables ConOutDev, ErrOutDev.
This | Protocol instance pointer. |
ControllerHandle | Handle of device to bind driver to |
RemainingDevicePath | Optional parameter use to pick a specific child device to start. |
EFI_SUCCESS | This driver is added to ControllerHandle |
EFI_ALREADY_STARTED | This driver is already running on ControllerHandle |
other | This driver does not support this device |
Definition at line 326 of file ConPlatform.c.
EFI_STATUS EFIAPI ConPlatformTextOutDriverBindingStop | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN UINTN | NumberOfChildren, | ||
IN EFI_HANDLE * | ChildHandleBuffer | ||
) |
Stop this driver on ControllerHandle by removing Console Out Devcice GUID and closing the Simple Text Output protocol on ControllerHandle.
This | Protocol instance pointer. |
ControllerHandle | Handle of device to stop driver on |
NumberOfChildren | Number of Handles in ChildHandleBuffer. If number of children is zero stop the entire bus driver. |
ChildHandleBuffer | List of Child Handles to Stop. |
EFI_SUCCESS | This driver is removed ControllerHandle |
other | This driver was not removed from this device |
Definition at line 543 of file ConPlatform.c.
EFI_STATUS EFIAPI ConPlatformTextOutDriverBindingSupported | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | ControllerHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath | OPTIONAL | ||
) |
Test to see if EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL is supported on ControllerHandle.
This | Protocol instance pointer. |
ControllerHandle | Handle of device to test. |
RemainingDevicePath | Optional parameter use to pick a specific child device to start. |
EFI_SUCCESS | This driver supports this device. |
other | This driver does not support this device. |
Definition at line 124 of file ConPlatform.c.
VOID ConPlatformUnInstallProtocol | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Handle, | ||
IN EFI_GUID * | ProtocolGuid | ||
) |
Uninstall the specified protocol.
This | Protocol instance pointer. |
Handle | Handle of device to uninstall protocol on. |
ProtocolGuid | The specified protocol need to be uninstalled. |
Definition at line 617 of file ConPlatform.c.
EFI_STATUS ConPlatformUpdateDeviceVariable | ( | IN CHAR16 * | VariableName, |
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath, | ||
IN CONPLATFORM_VAR_OPERATION | Operation | ||
) |
Update console environment variables.
VariableName | Console environment variables, ConOutDev, ConInDev ErrOutDev, ConIn ,ConOut or ErrOut. |
DevicePath | Console devcie's device path. |
Operation | Variable operations, including APPEND, CHECK and DELETE. |
EFI_SUCCESS | Variable operates successfully. |
EFI_OUT_OF_RESOURCES | If variable cannot be appended. |
other | Variable updating failed. |
Definition at line 1171 of file ConPlatform.c.
BOOLEAN ConPlatformUpdateGopCandidate | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ) |
Update ConOutDev and ErrOutDev variables to add the device path of GOP controller itself and the sibling controllers.
DevicePath | Pointer to device's device path. |
TRUE | The devcie is a GOP device. |
FALSE | The devcie is not a GOP device. |
Definition at line 1276 of file ConPlatform.c.
EFI_STATUS EFIAPI InitializeConPlatform | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Entrypoint of this module.
This function is the entrypoint of this module. It installs Driver Binding Protocols together with Component Name Protocols.
ImageHandle | The firmware allocated handle for the EFI image. |
SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The entry point is executed successfully. |
Definition at line 53 of file ConPlatform.c.
BOOLEAN IsGopSibling | ( | IN EFI_DEVICE_PATH_PROTOCOL * | Left, |
IN EFI_DEVICE_PATH_PROTOCOL * | Right | ||
) |
Function returns TRUE when the two input device paths point to the two GOP child handles that have the same parent.
Left | A pointer to a device path data structure. |
Right | A pointer to a device path data structure. |
TRUE | Left and Right share the same parent. |
FALSE | Left and Right don't share the same parent or either of them is not a GOP device path. |
Definition at line 726 of file ConPlatform.c.
BOOLEAN MatchUsbClass | ( | IN EFI_USB_IO_PROTOCOL * | UsbIo, |
IN USB_CLASS_DEVICE_PATH * | UsbClass | ||
) |
Check whether a USB device match the specified USB Class device path. This function follows "Load Option Processing" behavior in UEFI specification.
UsbIo | USB I/O protocol associated with the USB device. |
UsbClass | The USB Class device path to match. |
TRUE | The USB device match the USB Class device path. |
FALSE | The USB device does not match the USB Class device path. |
Definition at line 779 of file ConPlatform.c.
BOOLEAN MatchUsbShortformDevicePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | FullPath, |
IN EFI_DEVICE_PATH_PROTOCOL * | ShortformPath | ||
) |
Compare whether a full console device path matches a USB shortform device path.
[in] | FullPath | Full console device path. |
[in] | ShortformPath | Short-form device path. Short-form device node may in the beginning or in the middle. |
TRUE | The full console device path matches the short-form device path. |
FALSE | The full console device path doesn't match the short-form device path. |
Definition at line 990 of file ConPlatform.c.
BOOLEAN MatchUsbWwid | ( | IN EFI_USB_IO_PROTOCOL * | UsbIo, |
IN USB_WWID_DEVICE_PATH * | UsbWwid | ||
) |
Check whether a USB device match the specified USB WWID device path. This function follows "Load Option Processing" behavior in UEFI specification.
UsbIo | USB I/O protocol associated with the USB device. |
UsbWwid | The USB WWID device path to match. |
TRUE | The USB device match the USB WWID device path. |
FALSE | The USB device does not match the USB WWID device path. |
Definition at line 877 of file ConPlatform.c.
EFI_DRIVER_BINDING_PROTOCOL gConPlatformTextInDriverBinding |
Definition at line 12 of file ConPlatform.c.
EFI_DRIVER_BINDING_PROTOCOL gConPlatformTextOutDriverBinding |
Definition at line 21 of file ConPlatform.c.