From: "Ni, Ruiyu" <ruiyu.ni@intel.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>,
"Kinney, Michael D" <michael.d.kinney@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
"Zeng, Star" <star.zeng@intel.com>
Subject: Re: [PATCH] MdeModulePkg/ConPlatform: Support short-form USB device path
Date: Thu, 26 Apr 2018 06:52:35 +0000 [thread overview]
Message-ID: <734D49CCEBEEF84792F5B80ED585239D5BC7F813@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1ec8e5ef-1c90-43dd-2c89-befc77cd31f5@redhat.com>
> -----Original Message-----
> From: edk2-devel <edk2-devel-bounces@lists.01.org> On Behalf Of Laszlo
> Ersek
> Sent: Wednesday, April 25, 2018 10:16 PM
> To: Ni, Ruiyu <ruiyu.ni@intel.com>
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; edk2-devel@lists.01.org; Zeng, Star
> <star.zeng@intel.com>
> Subject: Re: [edk2] [PATCH] MdeModulePkg/ConPlatform: Support short-
> form USB device path
>
> Hello Ray,
>
> 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 <ruiyu.ni@intel.com>
> > Cc: Hao A Wu <hao.a.wu@intel.com>
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > Cc: Star Zeng <star.zeng@intel.com>
> > ---
> > .../Universal/Console/ConPlatformDxe/ConPlatform.c | 526
> > ++++++++++++++-------
> > .../Universal/Console/ConPlatformDxe/ConPlatform.h | 20 +-
> > 2 files changed, 353 insertions(+), 193 deletions(-)
>
> just a quick question: in OvmfPkg and ArmVirtPkg (more precisely:
> ArmVirtQemu*), we add a "wild card" USB keyboard to ConIn:
>
> > STATIC PLATFORM_USB_KEYBOARD mUsbKeyboard = {
> > //
> > // 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);
>
> The idea is to connect any USB keyboard(s) that the virtual machine might
> have.
>
> This patch for ConPlatformDxe will keep that working, right?
Right!
>
> Thanks!
> Laszlo
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
next prev parent reply other threads:[~2018-04-26 6:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-25 5:44 [PATCH] MdeModulePkg/ConPlatform: Support short-form USB device path Ruiyu Ni
2018-04-25 14:16 ` Laszlo Ersek
2018-04-26 6:52 ` Ni, Ruiyu [this message]
2018-04-26 7:04 ` Zeng, Star
2018-05-02 7:50 ` Ni, Ruiyu
-- strict thread matches above, loose matches on Subject: below --
2018-09-10 10:05 Ruiyu Ni
2018-09-12 1:47 ` Zeng, Star
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=734D49CCEBEEF84792F5B80ED585239D5BC7F813@SHSMSX104.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox