From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 23AE620957AEA for ; Wed, 2 May 2018 01:00:07 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 May 2018 01:00:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,354,1520924400"; d="scan'208";a="50805761" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga004.fm.intel.com with ESMTP; 02 May 2018 01:00:06 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 2 May 2018 01:00:06 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 2 May 2018 01:00:06 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.79]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.40]) with mapi id 14.03.0319.002; Wed, 2 May 2018 16:00:04 +0800 From: "Zeng, Star" To: "Ni, Ruiyu" , "edk2-devel@lists.01.org" CC: "Wu, Hao A" , "Kinney, Michael D" , "Zeng, Star" Thread-Topic: [edk2] [PATCH v2] MdeModulePkg/ConPlatform: Support short-form USB device path Thread-Index: AQHT4ep4ynlghKDuK0KeAFx+u8lbE6QcEiSQ Date: Wed, 2 May 2018 08:00:03 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BAE6889@shsmsx102.ccr.corp.intel.com> References: <20180502075157.194800-1-ruiyu.ni@intel.com> In-Reply-To: <20180502075157.194800-1-ruiyu.ni@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v2] MdeModulePkg/ConPlatform: Support short-form USB device path X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 May 2018 08:00:07 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Since the checking of MSG_USB_DP and HW_PCCARD_DP is removed on purpose, we= 'd better to add commit message for that. :) With that, Reviewed-by: Star Zeng . Thanks, Star -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ruiy= u Ni Sent: Wednesday, May 2, 2018 3:52 PM To: edk2-devel@lists.01.org Cc: Wu, Hao A ; Kinney, Michael D ; Zeng, Star Subject: [edk2] [PATCH v2] 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 de= vice paths corresponding to each port. Even worse, today's BDS core logic removes the device path from ConIn/ConOu= t/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 c= are whether its device path is in ConIn or not. But the rule is too loose, and now causes platform BDS cannot control wheth= er to enable USB keyboard as an active console. The patch changes ConPlatform to support USB short-form device path when ch= ecking whether the device path of a console is in ConIn/ConOut/ErrOut. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Hao A Wu Cc: Michael D Kinney Cc: Star Zeng --- .../Universal/Console/ConPlatformDxe/ConPlatform.c | 534 ++++++++++++++---= ---- .../Universal/Console/ConPlatformDxe/ConPlatform.h | 30 +- .../Console/ConPlatformDxe/ConPlatformDxe.inf | 3 +- 3 files changed, 361 insertions(+), 206 deletions(-) diff --git a/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c b/= MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c index 6b53e8ac74..e12876a34b 100644 --- a/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c +++ b/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c @@ -2,7 +2,7 @@ Console Platform DXE Driver, install Console Device Guids and update Con= sole Environment Variables. =20 -Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made availab= le under the terms and conditions of the BSD License which accompanies thi= s distribution. The full text of the license may be found at @@ -202,9 +20= 2,8 @@ ConPlatformDriverBindingSupported ( Start this driver on ControllerHandle by opening Simple Text Input Proto= col, reading Device Path, and installing Console In Devcice GUID on Controlle= rHandle. =20 - If this devcie is not one hot-plug devce, append its device path into th= e - console environment variables ConInDev. - =20 + Append its device path into the console environment variables ConInDev. + @param This Protocol instance pointer. @param ControllerHandle Handle of device to bind driver to @param RemainingDevicePath Optional parameter use to pick a specific c= hild @@ -270,58 +269,32 @@ ConPlatformTextInDriverBindingStart ( } =20 // - // Check the device path, if it is a hot plug device, - // do not put the device path into ConInDev, and install - // gEfiConsoleInDeviceGuid to the device handle directly. - // The policy is, make hot plug device plug in and play immediately. + // Append the device path to the ConInDev environment variable // =20 + ConPlatformUpdateDeviceVariable ( + L"ConInDev", + DevicePath, + Append + ); + + // + // If the device path is an instance in the ConIn environment=20 + variable, // then install EfiConsoleInDeviceGuid onto=20 + ControllerHandle // - if (IsHotPlugDevice (DevicePath)) { + if (IsInConInVariable) { gBS->InstallMultipleProtocolInterfaces ( &ControllerHandle, &gEfiConsoleInDeviceGuid, NULL, NULL ); - // - // Append the device path to ConInDev only if it is in ConIn variable. - // - if (IsInConInVariable) { - ConPlatformUpdateDeviceVariable ( - L"ConInDev", - DevicePath, - Append - ); - } } else { - // - // If it is not a hot-plug device, append the device path to the - // ConInDev environment variable - // - ConPlatformUpdateDeviceVariable ( - L"ConInDev", - DevicePath, - Append - ); - - // - // If the device path is an instance in the ConIn environment variable= , - // then install EfiConsoleInDeviceGuid onto ControllerHandle - // - if (IsInConInVariable) { - gBS->InstallMultipleProtocolInterfaces ( - &ControllerHandle, - &gEfiConsoleInDeviceGuid, - NULL, - NULL - ); - } else { - gBS->CloseProtocol ( - ControllerHandle, - &gEfiSimpleTextInProtocolGuid, - This->DriverBindingHandle, - ControllerHandle - ); - } + gBS->CloseProtocol ( + ControllerHandle, + &gEfiSimpleTextInProtocolGuid, + This->DriverBindingHandle, + ControllerHandle + ); } =20 return EFI_SUCCESS; @@ -334,9 +307,8 @@ ConPlatformTextInDriverBindingStart ( reading Device Path, and installing Console Out Devcic GUID, Standard Er= ror Device GUID on ControllerHandle. =20 - If this devcie is not one hot-plug devce, append its device path into th= e - console environment variables ConOutDev, ErrOutDev. - =20 + 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 @param RemainingDevicePath Optional parameter use to pick a specific c= hild @@ -416,95 +388,59 @@ ConPlatformTextOutDriverBindingStart ( } =20 // - // Check the device path, if it is a hot plug device, - // do not put the device path into ConOutDev and ErrOutDev, - // and install gEfiConsoleOutDeviceGuid to the device handle directly. - // The policy is, make hot plug device plug in and play immediately. + // Append the device path to the ConOutDev and ErrOutDev environment var= iable. + // For GOP device path, append the sibling device path as well. // - if (IsHotPlugDevice (DevicePath)) { + if (!ConPlatformUpdateGopCandidate (DevicePath)) { + ConPlatformUpdateDeviceVariable ( + L"ConOutDev", + DevicePath, + Append + ); + // + // Then append the device path to the ErrOutDev environment variable + // + ConPlatformUpdateDeviceVariable ( + L"ErrOutDev", + DevicePath, + Append + ); + } + + // + // If the device path is an instance in the ConOut environment=20 + variable, // then install EfiConsoleOutDeviceGuid onto=20 + ControllerHandle // if (IsInConOutVariable) { + NeedClose =3D FALSE; + Status =3D gBS->InstallMultipleProtocolInterfaces ( + &ControllerHandle, + &gEfiConsoleOutDeviceGuid, + NULL, + NULL + ); + } + // + // If the device path is an instance in the ErrOut environment=20 + variable, // then install EfiStandardErrorDeviceGuid onto=20 + ControllerHandle // if (IsInErrOutVariable) { + NeedClose =3D FALSE; gBS->InstallMultipleProtocolInterfaces ( &ControllerHandle, - &gEfiConsoleOutDeviceGuid, + &gEfiStandardErrorDeviceGuid, NULL, NULL ); - // - // Append the device path to ConOutDev only if it is in ConOut variabl= e. - // - if (IsInConOutVariable) { - ConPlatformUpdateDeviceVariable ( - L"ConOutDev", - DevicePath, - Append - ); - } - // - // Append the device path to ErrOutDev only if it is in ErrOut variabl= e. - // - if (IsInErrOutVariable) { - ConPlatformUpdateDeviceVariable ( - L"ErrOutDev", - DevicePath, - Append - ); - } - } else { - // - // If it is not a hot-plug device, append the device path to=20 - // the ConOutDev and ErrOutDev environment variable. - // For GOP device path, append the sibling device path as well. - // - if (!ConPlatformUpdateGopCandidate (DevicePath)) { - ConPlatformUpdateDeviceVariable ( - L"ConOutDev", - DevicePath, - Append - ); - // - // Then append the device path to the ErrOutDev environment variable - // - ConPlatformUpdateDeviceVariable ( - L"ErrOutDev", - DevicePath, - Append - ); - } - - // - // If the device path is an instance in the ConOut environment variabl= e, - // then install EfiConsoleOutDeviceGuid onto ControllerHandle - // - if (IsInConOutVariable) { - NeedClose =3D FALSE; - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &ControllerHandle, - &gEfiConsoleOutDeviceGuid, - NULL, - NULL - ); - } - // - // If the device path is an instance in the ErrOut environment variabl= e, - // then install EfiStandardErrorDeviceGuid onto ControllerHandle - // - if (IsInErrOutVariable) { - NeedClose =3D FALSE; - gBS->InstallMultipleProtocolInterfaces ( - &ControllerHandle, - &gEfiStandardErrorDeviceGuid, - NULL, - NULL - ); - } + } =20 - if (NeedClose) { - gBS->CloseProtocol ( - ControllerHandle, - &gEfiSimpleTextOutProtocolGuid, - This->DriverBindingHandle, - ControllerHandle - ); - } + if (NeedClose) { + gBS->CloseProtocol ( + ControllerHandle, + &gEfiSimpleTextOutProtocolGuid, + This->DriverBindingHandle, + ControllerHandle + ); } =20 return EFI_SUCCESS; @@ -822,6 +758,288 @@ IsGopSibling ( return (BOOLEAN) (CompareMem (Left, Right, (UINTN) NodeLeft - (UINTN) Le= ft) =3D=3D 0); } =20 +/** + Check whether a USB device match the specified USB Class device path.=20 +This + function follows "Load Option Processing" behavior in UEFI specification= . + + @param UsbIo USB I/O protocol associated with the USB device. + @param UsbClass The USB Class device path to match. + + @retval TRUE The USB device match the USB Class device path. + @retval FALSE The USB device does not match the USB Class device pa= th. + +**/ +BOOLEAN +MatchUsbClass ( + IN EFI_USB_IO_PROTOCOL *UsbIo, + IN USB_CLASS_DEVICE_PATH *UsbClass + ) +{ + EFI_STATUS Status; + EFI_USB_DEVICE_DESCRIPTOR DevDesc; + EFI_USB_INTERFACE_DESCRIPTOR IfDesc; + UINT8 DeviceClass; + UINT8 DeviceSubClass; + UINT8 DeviceProtocol; + + if ((DevicePathType (UsbClass) !=3D MESSAGING_DEVICE_PATH) || + (DevicePathSubType (UsbClass) !=3D MSG_USB_CLASS_DP)){ + return FALSE; + } + + // + // Check Vendor Id and Product Id. + // + Status =3D UsbIo->UsbGetDeviceDescriptor (UsbIo, &DevDesc); if=20 + (EFI_ERROR (Status)) { + return FALSE; + } + + if ((UsbClass->VendorId !=3D 0xffff) && + (UsbClass->VendorId !=3D DevDesc.IdVendor)) { + return FALSE; + } + + if ((UsbClass->ProductId !=3D 0xffff) && + (UsbClass->ProductId !=3D DevDesc.IdProduct)) { + return FALSE; + } + + DeviceClass =3D DevDesc.DeviceClass; + DeviceSubClass =3D DevDesc.DeviceSubClass; DeviceProtocol =3D=20 + DevDesc.DeviceProtocol; if (DeviceClass =3D=3D 0) { + // + // If Class in Device Descriptor is set to 0, use the Class, SubClass = and + // Protocol in Interface Descriptor instead. + // + Status =3D UsbIo->UsbGetInterfaceDescriptor (UsbIo, &IfDesc); + if (EFI_ERROR (Status)) { + return FALSE; + } + + DeviceClass =3D IfDesc.InterfaceClass; + DeviceSubClass =3D IfDesc.InterfaceSubClass; + DeviceProtocol =3D IfDesc.InterfaceProtocol; } + + // + // Check Class, SubClass and Protocol. + // + if ((UsbClass->DeviceClass !=3D 0xff) && + (UsbClass->DeviceClass !=3D DeviceClass)) { + return FALSE; + } + + if ((UsbClass->DeviceSubClass !=3D 0xff) && + (UsbClass->DeviceSubClass !=3D DeviceSubClass)) { + return FALSE; + } + + if ((UsbClass->DeviceProtocol !=3D 0xff) && + (UsbClass->DeviceProtocol !=3D DeviceProtocol)) { + return FALSE; + } + + return TRUE; +} + +/** + Check whether a USB device match the specified USB WWID device path.=20 +This + function follows "Load Option Processing" behavior in UEFI specification= . + + @param UsbIo USB I/O protocol associated with the USB device. + @param UsbWwid The USB WWID device path to match. + + @retval TRUE The USB device match the USB WWID device path. + @retval FALSE The USB device does not match the USB WWID device pat= h. + +**/ +BOOLEAN +MatchUsbWwid ( + IN EFI_USB_IO_PROTOCOL *UsbIo, + IN USB_WWID_DEVICE_PATH *UsbWwid + ) +{ + EFI_STATUS Status; + EFI_USB_DEVICE_DESCRIPTOR DevDesc; + EFI_USB_INTERFACE_DESCRIPTOR IfDesc; + UINT16 *LangIdTable; + UINT16 TableSize; + UINT16 Index; + CHAR16 *CompareStr; + UINTN CompareLen; + CHAR16 *SerialNumberStr; + UINTN Length; + + if ((DevicePathType (UsbWwid) !=3D MESSAGING_DEVICE_PATH) || + (DevicePathSubType (UsbWwid) !=3D MSG_USB_WWID_DP)) { + return FALSE; + } + + // + // Check Vendor Id and Product Id. + // + Status =3D UsbIo->UsbGetDeviceDescriptor (UsbIo, &DevDesc); if=20 + (EFI_ERROR (Status)) { + return FALSE; + } + if ((DevDesc.IdVendor !=3D UsbWwid->VendorId) || + (DevDesc.IdProduct !=3D UsbWwid->ProductId)) { + return FALSE; + } + + // + // Check Interface Number. + // + Status =3D UsbIo->UsbGetInterfaceDescriptor (UsbIo, &IfDesc); if=20 + (EFI_ERROR (Status)) { + return FALSE; + } + if (IfDesc.InterfaceNumber !=3D UsbWwid->InterfaceNumber) { + return FALSE; + } + + // + // Check Serial Number. + // + if (DevDesc.StrSerialNumber =3D=3D 0) { + return FALSE; + } + + // + // Get all supported languages. + // + TableSize =3D 0; + LangIdTable =3D NULL; + Status =3D UsbIo->UsbGetSupportedLanguages (UsbIo, &LangIdTable,=20 + &TableSize); if (EFI_ERROR (Status) || (TableSize =3D=3D 0) || (LangIdTa= ble =3D=3D NULL)) { + return FALSE; + } + + // + // Serial number in USB WWID device path is the last 64-or-less UTF-16 c= haracters. + // + CompareStr =3D (CHAR16 *) (UINTN) (UsbWwid + 1); CompareLen =3D=20 + (DevicePathNodeLength (UsbWwid) - sizeof (USB_WWID_DEVICE_PATH)) /=20 + sizeof (CHAR16); if (CompareStr[CompareLen - 1] =3D=3D L'\0') { + CompareLen--; + } + + // + // Compare serial number in each supported language. + // + for (Index =3D 0; Index < TableSize / sizeof (UINT16); Index++) { + SerialNumberStr =3D NULL; + Status =3D UsbIo->UsbGetStringDescriptor ( + UsbIo, + LangIdTable[Index], + DevDesc.StrSerialNumber, + &SerialNumberStr + ); + if (EFI_ERROR (Status) || (SerialNumberStr =3D=3D NULL)) { + continue; + } + + Length =3D StrLen (SerialNumberStr); + if ((Length >=3D CompareLen) && + (CompareMem (SerialNumberStr + Length - CompareLen, CompareStr, Co= mpareLen * sizeof (CHAR16)) =3D=3D 0)) { + FreePool (SerialNumberStr); + return TRUE; + } + + FreePool (SerialNumberStr); + } + + return FALSE; +} + +/** + Compare whether a full console device path matches a USB shortform devic= e path. + + @param[in] FullPath Full console device path. + @param[in] ShortformPath Short-form device path. Short-form device node = may in the beginning or in the middle. + + @retval TRUE The full console device path matches the short-form device= path. + @retval FALSE The full console device path doesn't match the short-form = device path. +**/ +BOOLEAN +MatchUsbShortformDevicePath ( + IN EFI_DEVICE_PATH_PROTOCOL *FullPath, + IN EFI_DEVICE_PATH_PROTOCOL *ShortformPath + ) +{ + EFI_STATUS Status; + EFI_DEVICE_PATH_PROTOCOL *ShortformNode; + EFI_DEVICE_PATH_PROTOCOL *ShortformRemainingDevicePath; + UINTN ParentDevicePathSize; + EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath; + EFI_USB_IO_PROTOCOL *UsbIo; + EFI_HANDLE Handle; + + for ( ShortformNode =3D ShortformPath + ; !IsDevicePathEnd (ShortformNode) + ; ShortformNode =3D NextDevicePathNode (ShortformNode) + ) { + if ((DevicePathType (ShortformNode) =3D=3D MESSAGING_DEVICE_PATH) && + ((DevicePathSubType (ShortformNode) =3D=3D MSG_USB_CLASS_DP) || + (DevicePathSubType (ShortformNode) =3D=3D MSG_USB_WWID_DP)) + ) { + break; + } + } + + // + // Skip further compare when it's not a shortform device path. + // + if (IsDevicePathEnd (ShortformNode)) { + return FALSE; + } + + // + // Match the parent device path below USB layer when the ShortformPath d= oesn't start with short-form node. + // + ParentDevicePathSize =3D (UINTN) ShortformNode - (UINTN) Shortf= ormPath; + ShortformRemainingDevicePath =3D NextDevicePathNode (ShortformNode); + =20 + RemainingDevicePath =3D FullPath; + Status =3D gBS->LocateDevicePath (&gEfiUsbIoProtocolGuid, &= RemainingDevicePath, &Handle); + if (EFI_ERROR (Status)) { + return FALSE; + } + + if (ParentDevicePathSize !=3D 0) { + // + // Skip comparing the parent device path when ShortformPath begins wit= h short-form node. + // + if ((ParentDevicePathSize !=3D (UINTN) RemainingDevicePath - (UINTN) F= ullPath) || + (CompareMem (FullPath, ShortformPath, ParentDevicePathSize) !=3D 0= )) { + return FALSE; + } + } + + // + // Match the remaining device path above USB layer. + // For USB keyboard, the remaining device path above USB layer is END no= de. + // + if (CompareMem (RemainingDevicePath, ShortformRemainingDevicePath, GetDe= vicePathSize (RemainingDevicePath)) !=3D 0) { + return FALSE; + } + + // + // Match the USB layer. + // + Status =3D gBS->HandleProtocol( + Handle, + &gEfiUsbIoProtocolGuid, + (VOID **) &UsbIo + ); + ASSERT_EFI_ERROR (Status); + =20 + return MatchUsbClass (UsbIo, (USB_CLASS_DEVICE_PATH *)ShortformNode) || + MatchUsbWwid (UsbIo, (USB_WWID_DEVICE_PATH *)ShortformNode); } + /** Function compares a device path data structure to that of all the nodes = of a second device path instance. @@ -881,7 +1099,8 @@ ConPlatformMatchDevicePaths ( // Search for the match of 'Single' in 'Multi' // while (DevicePathInst !=3D NULL) { - if ((CompareMem (Single, DevicePathInst, Size) =3D=3D 0) || IsGopSibli= ng (Single, DevicePathInst)) { + if ((CompareMem (Single, DevicePathInst, Size) =3D=3D 0) || + IsGopSibling (Single, DevicePathInst) ||=20 + MatchUsbShortformDevicePath (Single, DevicePathInst)) { if (!Delete) { // // If Delete is FALSE, return EFI_SUCCESS if Single is found in Mu= lti. @@ -1029,53 +1248,6 @@ ConPlatformUpdateDeviceVariable ( return Status; } =20 -/** - 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_DEVICE_PATH_PROTOCOL *CheckDevicePath; - - CheckDevicePath =3D DevicePath; - while (!IsDevicePathEnd (CheckDevicePath)) { - // - // Check device whether is hot plug device or not throught Device Path - //=20 - if ((DevicePathType (CheckDevicePath) =3D=3D MESSAGING_DEVICE_PATH) && - (DevicePathSubType (CheckDevicePath) =3D=3D MSG_USB_DP || - DevicePathSubType (CheckDevicePath) =3D=3D MSG_USB_CLASS_DP || - DevicePathSubType (CheckDevicePath) =3D=3D MSG_USB_WWID_DP)) { - // - // If Device is USB device - // - return TRUE; - } - if ((DevicePathType (CheckDevicePath) =3D=3D HARDWARE_DEVICE_PATH) && - (DevicePathSubType (CheckDevicePath) =3D=3D HW_PCCARD_DP)) { - // - // If Device is PCCard - // - return TRUE; - } - =20 - CheckDevicePath =3D NextDevicePathNode (CheckDevicePath); - } - - return FALSE; -} - /** Update ConOutDev and ErrOutDev variables to add the device path of GOP controller itself and the sibling controllers. diff --git a/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.h b/= MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.h index 6d853c1360..63e023facb 100644 --- a/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.h +++ b/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.h @@ -1,7 +1,7 @@ /** @file Header file for Console Platfrom DXE Driver. =20 -Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made availab= le under the terms and conditions of the BSD License which accompanies thi= s distribution. The full text of the license may be found at @@ -21,6 +21,= 7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. #include #include #include +#include #include =20 #include @@ -119,9 +120,8 @@ ConPlatformTextOutDriverBindingSupported ( Start this driver on ControllerHandle by opening Simple Text Input Proto= col, reading Device Path, and installing Console In Devcice GUID on Controlle= rHandle. =20 - If this devcie is not one hot-plug devce, append its device path into th= e - console environment variables ConInDev. - =20 + Append its device path into the console environment variables ConInDev. + @param This Protocol instance pointer. @param ControllerHandle Handle of device to bind driver to @param RemainingDevicePath Optional parameter use to pick a specific c= hild @@ -147,9 +147,8 @@ ConPlatformTextInDriverBindingStart ( reading Device Path, and installing Console Out Devcic GUID, Standard Er= ror Device GUID on ControllerHandle. =20 - If this devcie is not one hot-plug devce, append its device path into th= e - console environment variables ConOutDev, StdErrDev. - =20 + 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 @param RemainingDevicePath Optional parameter use to pick a specific c= hild @@ -294,23 +293,6 @@ ConPlatformUpdateDeviceVariable ( IN CONPLATFORM_VAR_OPERATION Operation ); =20 -/** - 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 // diff --git a/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.i= nf b/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf index 1d404dfc6f..72522da53f 100644 --- a/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf +++ b/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf @@ -4,7 +4,7 @@ # Console Platfrom DXE Driver that specifies whether device can be used as= console # input/output device or error output device and update global va= riables accordingly. # -# Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2018, Intel Corporation. All rights=20 +reserved.
# # This program and the accompanying materials # are licensed and made a= vailable under the terms and conditions of the BSD License @@ -94,6 +94,7 @= @ [Protocols] gEfiSimpleTextOutProtocolGuid ## TO_START gEfiPciIoProtocolGuid ## SOMETIMES_CONSUMES gEfiGraphicsOutputProtocolGuid ## SOMETIMES_CONSUMES + gEfiUsbIoProtocolGuid ## SOMETIMES_CONSUMES =20 [UserExtensions.TianoCore."ExtraFiles"] ConPlatformDxeExtra.uni \ No newline at end of file -- 2.16.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel