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.136; helo=mga12.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (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 28D15203569B4 for ; Wed, 25 Apr 2018 23:52:39 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2018 23:52:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,329,1520924400"; d="scan'208";a="50934488" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga001.jf.intel.com with ESMTP; 25 Apr 2018 23:52:38 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 25 Apr 2018 23:52:38 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 25 Apr 2018 23:52:37 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.240]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.210]) with mapi id 14.03.0319.002; Thu, 26 Apr 2018 14:52:35 +0800 From: "Ni, Ruiyu" To: Laszlo Ersek CC: "Wu, Hao A" , "Kinney, Michael D" , "edk2-devel@lists.01.org" , "Zeng, Star" Thread-Topic: [edk2] [PATCH] MdeModulePkg/ConPlatform: Support short-form USB device path Thread-Index: AQHT3FiDhEAuGX8BEU+a5k/Us+kYmqQRAS+AgAGcV3A= Date: Thu, 26 Apr 2018 06:52:35 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BC7F813@SHSMSX104.ccr.corp.intel.com> References: <20180425054415.26028-1-ruiyu.ni@intel.com> <1ec8e5ef-1c90-43dd-2c89-befc77cd31f5@redhat.com> In-Reply-To: <1ec8e5ef-1c90-43dd-2c89-befc77cd31f5@redhat.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] 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: Thu, 26 Apr 2018 06:52:39 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: edk2-devel On Behalf Of Laszlo > Ersek > Sent: Wednesday, April 25, 2018 10:16 PM > To: Ni, Ruiyu > Cc: Wu, Hao A ; Kinney, Michael D > ; edk2-devel@lists.01.org; Zeng, Star > > Subject: Re: [edk2] [PATCH] MdeModulePkg/ConPlatform: Support short- > form USB device path >=20 > Hello Ray, >=20 > On 04/25/18 07:44, Ruiyu Ni wrote: > > 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. > > > > 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 | 526 > > ++++++++++++++------- > > .../Universal/Console/ConPlatformDxe/ConPlatform.h | 20 +- > > 2 files changed, 353 insertions(+), 193 deletions(-) >=20 > just a quick question: in OvmfPkg and ArmVirtPkg (more precisely: > ArmVirtQemu*), we add a "wild card" USB keyboard to ConIn: >=20 > > STATIC PLATFORM_USB_KEYBOARD mUsbKeyboard =3D { > > // > > // USB_CLASS_DEVICE_PATH Keyboard > > // > > { > > { > > MESSAGING_DEVICE_PATH, MSG_USB_CLASS_DP, > > DP_NODE_LEN (USB_CLASS_DEVICE_PATH) > > }, > > 0xFFFF, // VendorId: any > > 0xFFFF, // ProductId: any > > 3, // DeviceClass: HID > > 1, // DeviceSubClass: boot > > 1 // DeviceProtocol: keyboard > > }, > > > > // > > // EFI_DEVICE_PATH_PROTOCOL End > > // > > { > > END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, > > DP_NODE_LEN (EFI_DEVICE_PATH_PROTOCOL) > > } > > }; > > > > [...] > > > > // > > // Add the hardcoded short-form USB keyboard device path to ConIn. > > // > > EfiBootManagerUpdateConsoleVariable (ConIn, > > (EFI_DEVICE_PATH_PROTOCOL *)&mUsbKeyboard, NULL); >=20 > The idea is to connect any USB keyboard(s) that the virtual machine might > have. >=20 > This patch for ConPlatformDxe will keep that working, right? Right! >=20 > Thanks! > Laszlo > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel