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>
This commit is contained in:
@@ -21,6 +21,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#include <Protocol/DevicePath.h>
|
||||
#include <Protocol/SimpleTextIn.h>
|
||||
#include <Protocol/PciIo.h>
|
||||
#include <Protocol/UsbIo.h>
|
||||
#include <Protocol/GraphicsOutput.h>
|
||||
|
||||
#include <Guid/GlobalVariable.h>
|
||||
@@ -119,8 +120,7 @@ ConPlatformTextOutDriverBindingSupported (
|
||||
Start this driver on ControllerHandle by opening Simple Text Input Protocol,
|
||||
reading Device Path, and installing Console In Devcice GUID on ControllerHandle.
|
||||
|
||||
If this devcie is not one hot-plug devce, append its device path into the
|
||||
console environment variables ConInDev.
|
||||
Append its device path into the console environment variables ConInDev.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param ControllerHandle Handle of device to bind driver to
|
||||
@@ -147,8 +147,7 @@ ConPlatformTextInDriverBindingStart (
|
||||
reading Device Path, and installing Console Out Devcic GUID, Standard Error
|
||||
Device GUID on ControllerHandle.
|
||||
|
||||
If this devcie is not one hot-plug devce, append its device path into the
|
||||
console environment variables ConOutDev, StdErrDev.
|
||||
Append its device path into the console environment variables ConOutDev, ErrOutDev.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param ControllerHandle Handle of device to bind driver to
|
||||
@@ -294,23 +293,6 @@ ConPlatformUpdateDeviceVariable (
|
||||
IN CONPLATFORM_VAR_OPERATION Operation
|
||||
);
|
||||
|
||||
/**
|
||||
Check if the device supports hot-plug through its device path.
|
||||
|
||||
This function could be updated to check more types of Hot Plug devices.
|
||||
Currently, it checks USB and PCCard device.
|
||||
|
||||
@param DevicePath Pointer to device's device path.
|
||||
|
||||
@retval TRUE The devcie is a hot-plug device
|
||||
@retval FALSE The devcie is not a hot-plug device.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
IsHotPlugDevice (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
|
||||
);
|
||||
|
||||
//
|
||||
// EFI Component Name Functions
|
||||
//
|
||||
|
Reference in New Issue
Block a user