Ruiyu Ni 5c9ac43f47 MdeModulePkg/ConPlatform: Support short-form USB device path
Today's implementation does an exact device path match to check
whether the device path of a console is in ConIn/ConOut/ErrOut.
But that doesn't work for the USB keyboard.
Because when a platform have multiple USB port, ConIn needs to
carry all device paths corresponding to each port.
Even worse, today's BDS core logic removes the device path from
ConIn/ConOut/ErrOut when the connection to that device path fails.
So if user switches the USB keyboard from one port to another across
boot, the USB keyboard doesn't work in the second boot.

ConPlatform driver solved this problem by adding the
IsHotPlugDevice() function. So that for USB keyboard, ConPlatform
doesn't care whether its device path is in ConIn or not.
But the rule is too loose, and now causes platform BDS cannot control
whether to enable USB keyboard as an active console.

The patch changes ConPlatform to support USB short-form device path
when checking whether the device path of a console is in
ConIn/ConOut/ErrOut.

The logic to always accept USB/PCCARD device as active console is
removed.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-09-12 10:12:05 +08:00

101 lines
3.8 KiB
INI

## @file
# Platform console driver manages console devices.
#
# Console Platfrom DXE Driver that specifies whether device can be used as console
# input/output device or error output device and update global variables accordingly.
#
# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
#
##
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = ConPlatformDxe
MODULE_UNI_FILE = ConPlatformDxe.uni
FILE_GUID = 51ccf399-4fdf-4e55-a45b-e123f84d456a
MODULE_TYPE = UEFI_DRIVER
VERSION_STRING = 1.0
ENTRY_POINT = InitializeConPlatform
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64 EBC
#
# DRIVER_BINDING = gConPlatformTextInDriverBinding
# COMPONENT_NAME = gConPlatformComponentName
# COMPONENT_NAME2 = gConPlatformComponentName2
# DRIVER_BINDING = gConPlatformTextOutDriverBinding
# COMPONENT_NAME = gConPlatformComponentName
# COMPONENT_NAME2 = gConPlatformComponentName2
#
[Sources]
ComponentName.c
ConPlatform.h
ConPlatform.c
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
[LibraryClasses]
MemoryAllocationLib
DevicePathLib
UefiRuntimeServicesTableLib
UefiBootServicesTableLib
BaseMemoryLib
UefiLib
UefiDriverEntryPoint
DebugLib
UefiBootManagerLib
[Guids]
#
# This is the VendorGuid of all architecturally defined variables in UEFI spec.
#
## SOMETIMES_CONSUMES ## Variable:L"ConIn"
## SOMETIMES_CONSUMES ## Variable:L"ConOut"
## SOMETIMES_CONSUMES ## Variable:L"ErrOut"
## SOMETIMES_PRODUCES ## Variable:L"ConInDev"
## SOMETIMES_PRODUCES ## Variable:L"ConOutDev"
## SOMETIMES_PRODUCES ## Variable:L"ErrOutDev"
gEfiGlobalVariableGuid
#
# This GUID is used to specify the device is the standard error device.
# If the device is a standard error device, this GUID as the protocol GUID will be installed
# onto this device handle.
#
gEfiStandardErrorDeviceGuid ## SOMETIMES_PRODUCES ## UNDEFINED # protocol GUID installed on device handle
#
# This GUID is used to specify the device is the console output device.
# If the device is a console output device, this GUID as the protocol GUID will be installed
# onto this device handle.
#
gEfiConsoleOutDeviceGuid ## SOMETIMES_PRODUCES ## UNDEFINED # protocol GUID installed on device handle
#
# This GUID is used to specify the device is the console input device.
# If the device is a console input device, this GUID as the protocol GUID will be installed
# onto this device handle.
#
gEfiConsoleInDeviceGuid ## SOMETIMES_PRODUCES ## UNDEFINED # protocol GUID installed on device handle
[Protocols]
gEfiDevicePathProtocolGuid ## TO_START
gEfiSimpleTextInProtocolGuid ## TO_START
gEfiSimpleTextOutProtocolGuid ## TO_START
gEfiPciIoProtocolGuid ## SOMETIMES_CONSUMES
gEfiGraphicsOutputProtocolGuid ## SOMETIMES_CONSUMES
gEfiUsbIoProtocolGuid ## SOMETIMES_CONSUMES
[UserExtensions.TianoCore."ExtraFiles"]
ConPlatformDxeExtra.uni