From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::244; helo=mail-io0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AA9102244E3EE for ; Sun, 15 Apr 2018 22:41:16 -0700 (PDT) Received: by mail-io0-x244.google.com with SMTP id d7so16656857ioc.11 for ; Sun, 15 Apr 2018 22:41:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=gAQyI/fjj4LwbHENRQrH3W6uo4N3iLRPJP6pPtE9fq0=; b=j3GH+Coqy0ophO94J0WkgfUEfp9/iDmgfsx1uMS+Cbg3oHdpP7Qwan2DM0LtFHvj2+ orTw1B6TwamyxR10Wp6ojv1vmkRT9t5ILxU3mcXvWs/zC3YeUNKjjXTia9AQ85pd5sM1 iBWjqi44FI7LFb09GKtwGSwpk8Jua16U9w8ek= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=gAQyI/fjj4LwbHENRQrH3W6uo4N3iLRPJP6pPtE9fq0=; b=PUkzg1/bPLQj3yzjVK2qzQOd0mXIJUtkspSKa4ovL3WMA8qhi32/3VabHRC/ELvx8G IXr8PLCVMptCWPLGz1UGLhysaKhgCFmAGAXcMQi5DzAh7HW3q75cITgakPkxyJxrXL7a rMWZvGjjvyASEXKL05bvBC6+ePu0n85qT0vmZuHD+Z3vzmosbajfY3L9zxmyP9HUtLs/ y4dsSEWzw6/smPhbzCTE/C6wcWCs7oHTOukHPGbEDzJH9N0MqggcZX8EL+cLiiLj7G5q yNaQPQHnZ7LG2D1hoFaihcBWjNAr0+PrEgU1wfdpPcBgQSMDn18ww3lor9T8ASIGX2gL z/4g== X-Gm-Message-State: ALQs6tBGo4FLoLkomsp8kjur8PXVg7lhCvZX8awjgXs5DS9hn/p+FEX4 MV2z9QZ7YcnFyN7+rOP4azULKWJovFw2DHRwQzNqzA== X-Google-Smtp-Source: AIpwx49Av1E0h0ITp0LpD7x3p56zaCubzf9GMdy1axoHAOMTMBobRpXFjtFIKJTuoni0I/3RFozwsOCPrLuiDh1tY84= X-Received: by 10.107.14.136 with SMTP id 130mr21455479ioo.170.1523857275872; Sun, 15 Apr 2018 22:41:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.187.67 with HTTP; Sun, 15 Apr 2018 22:41:15 -0700 (PDT) In-Reply-To: <20180415211523.10635-1-lersek@redhat.com> References: <20180415211523.10635-1-lersek@redhat.com> From: Ard Biesheuvel Date: Mon, 16 Apr 2018 07:41:15 +0200 Message-ID: To: Laszlo Ersek Cc: "edk2-devel@lists.01.org" , Jordan Justen Subject: Re: [PATCH] OvmfPkg/PlatformBootManagerLib: add USB keyboard to ConIn 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: Mon, 16 Apr 2018 05:41:16 -0000 Content-Type: text/plain; charset="UTF-8" On 15 April 2018 at 23:15, Laszlo Ersek wrote: > PlatformInitializeConsole() (called by PlatformBootManagerBeforeConsole()) > adds elements of "gPlatformConsole" to ConIn / ConOut / ErrOut (as > requested per element) if at boot at least one of ConIn and ConOut doesn't > exist. This typically applies to new VMs, and VMs with freshly recreated > varstores. > > Add a USB keyboard wildcard to ConIn via "gPlatformConsole", so that we > not only bind the PS/2 keyboard. (The PS/2 keyboard is added in > PrepareLpcBridgeDevicePath()). Explicitly connecting the USB keyboard is > necessary after commit 245c643cc8b7. > > Cc: Ard Biesheuvel > Cc: Jordan Justen > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel > --- > > Notes: > Repo: https://github.com/lersek/edk2.git > Branch: ovmf_usb_kbd_con > > OvmfPkg/Library/PlatformBootManagerLib/PlatformData.c | 32 ++++++++++++++++++++ > 1 file changed, 32 insertions(+) > > diff --git a/OvmfPkg/Library/PlatformBootManagerLib/PlatformData.c b/OvmfPkg/Library/PlatformBootManagerLib/PlatformData.c > index 82f294577ecf..a50cd7bcaf90 100644 > --- a/OvmfPkg/Library/PlatformBootManagerLib/PlatformData.c > +++ b/OvmfPkg/Library/PlatformBootManagerLib/PlatformData.c > @@ -27,6 +27,16 @@ typedef struct { > } VENDOR_UART_DEVICE_PATH; > #pragma pack() > > +// > +// USB Keyboard Device Path structure > +// > +#pragma pack (1) > +typedef struct { > + USB_CLASS_DEVICE_PATH Keyboard; > + EFI_DEVICE_PATH_PROTOCOL End; > +} USB_KEYBOARD_DEVICE_PATH; > +#pragma pack () > + > ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode = gPnpPs2Keyboard; > ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode = gPnp16550ComPort; > UART_DEVICE_PATH gUartDeviceNode = gUart; > @@ -71,6 +81,24 @@ VENDOR_UART_DEVICE_PATH gDebugAgentUartDevicePath = { > gEndEntire > }; > > +STATIC USB_KEYBOARD_DEVICE_PATH gUsbKeyboardDevicePath = { > + { > + { > + MESSAGING_DEVICE_PATH, > + MSG_USB_CLASS_DP, > + { > + (UINT8)sizeof (USB_CLASS_DEVICE_PATH), > + (UINT8)(sizeof (USB_CLASS_DEVICE_PATH) >> 8) > + } > + }, > + 0xFFFF, // VendorId: any > + 0xFFFF, // ProductId: any > + 3, // DeviceClass: HID > + 1, // DeviceSubClass: boot > + 1 // DeviceProtocol: keyboard > + }, > + gEndEntire > +}; > > // > // Predefined platform default console device path > @@ -80,6 +108,10 @@ PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[] = { > (EFI_DEVICE_PATH_PROTOCOL *) &gDebugAgentUartDevicePath, > (CONSOLE_OUT | CONSOLE_IN | STD_ERROR) > }, > + { > + (EFI_DEVICE_PATH_PROTOCOL *)&gUsbKeyboardDevicePath, > + CONSOLE_IN > + }, > { > NULL, > 0 > -- > 2.14.1.3.gb7cf6e02401b >