mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
OvmfPkg: Add virtio keyboard device hooks
This commit adds: - missing virtio subsystem ID for input device - PrepareVirtioKeyboardDevicePath() handler to boot manager library Signed-off-by: Paweł Poławski <ppolawsk@redhat.com>
This commit is contained in:
parent
0986082d7e
commit
0eea7b9c02
@ -17,6 +17,7 @@
|
||||
// Subsystem Device IDs (to be) introduced in VirtIo 1.0
|
||||
//
|
||||
#define VIRTIO_SUBSYSTEM_GPU_DEVICE 16
|
||||
#define VIRTIO_SUBSYSTEM_INPUT 18
|
||||
//
|
||||
// Subsystem Device IDs from the VirtIo spec at git commit 87fa6b5d8155;
|
||||
// <https://github.com/oasis-tcs/virtio-spec/tree/87fa6b5d8155>.
|
||||
|
@ -1111,6 +1111,28 @@ PrepareVirtioSerialDevicePath (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
PrepareVirtioKeyboardDevicePath (
|
||||
IN EFI_HANDLE DeviceHandle
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
|
||||
DevicePath = NULL;
|
||||
Status = gBS->HandleProtocol (
|
||||
DeviceHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
(VOID *)&DevicePath
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
VisitAllInstancesOfProtocol (
|
||||
IN EFI_GUID *Id,
|
||||
@ -1287,6 +1309,12 @@ DetectAndPreparePlatformPciDevicePath (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
if ((Pci->Hdr.VendorId == 0x1af4) && (Pci->Hdr.DeviceId == 0x1052)) {
|
||||
DEBUG ((DEBUG_INFO, "Found virtio keyboard device\n"));
|
||||
PrepareVirtioKeyboardDevicePath (Handle);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user