OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
EfiKey.c
Go to the documentation of this file.
1
11#include "EfiKey.h"
12#include "AppleKey.h"
13#include "KeyBoard.h"
14
15STATIC BOOLEAN mExitingBootServices = FALSE;
16
17//
18// USB Keyboard Driver Global Variables
19//
20EFI_DRIVER_BINDING_PROTOCOL gUsbKeyboardDriverBinding = {
24 0x10,
25 NULL,
26 NULL
27};
28
41EFI_STATUS
42EFIAPI
44 IN EFI_HANDLE ImageHandle,
45 IN EFI_SYSTEM_TABLE *SystemTable
46 )
47{
48 EFI_STATUS Status;
49
50 Status = EfiLibInstallDriverBindingComponentName2 (
51 ImageHandle,
52 SystemTable,
54 ImageHandle,
57 );
58 ASSERT_EFI_ERROR (Status);
59
60 return EFI_SUCCESS;
61}
62
74EFI_STATUS
75EFIAPI
77 IN EFI_DRIVER_BINDING_PROTOCOL *This,
78 IN EFI_HANDLE Controller,
79 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
80 )
81{
82 EFI_STATUS Status;
83 EFI_USB_IO_PROTOCOL *UsbIo;
84
85 //
86 // Check if USB I/O Protocol is attached on the controller handle.
87 //
88 Status = gBS->OpenProtocol (
89 Controller,
90 &gEfiUsbIoProtocolGuid,
91 (VOID **)&UsbIo,
92 This->DriverBindingHandle,
93 Controller,
94 PcdGetBool (PcdUsbKbDriverTakePrecedence)
95 ? EFI_OPEN_PROTOCOL_GET_PROTOCOL
96 : EFI_OPEN_PROTOCOL_BY_DRIVER
97 );
98 if (EFI_ERROR (Status)) {
99 return Status;
100 }
101
102 //
103 // Use the USB I/O Protocol interface to check whether Controller is
104 // a keyboard device that can be managed by this driver.
105 //
106 Status = EFI_SUCCESS;
107
108 if (!IsUSBKeyboard (UsbIo)) {
109 Status = EFI_UNSUPPORTED;
110 }
111
112 gBS->CloseProtocol (
113 Controller,
114 &gEfiUsbIoProtocolGuid,
115 This->DriverBindingHandle,
116 Controller
117 );
118
119 return Status;
120}
121
139EFI_STATUS
140EFIAPI
142 IN EFI_DRIVER_BINDING_PROTOCOL *This,
143 IN EFI_HANDLE Controller,
144 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
145 )
146{
147 EFI_STATUS Status;
148 EFI_USB_IO_PROTOCOL *UsbIo;
149 USB_KB_DEV *UsbKeyboardDevice;
150 UINT8 EndpointNumber;
151 EFI_USB_ENDPOINT_DESCRIPTOR EndpointDescriptor;
152 UINT8 Index;
153 UINT8 EndpointAddr;
154 UINT8 PollingInterval;
155 UINT8 PacketSize;
156 BOOLEAN Found;
157 EFI_TPL OldTpl;
158
159 OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
160 //
161 // Open USB I/O Protocol
162 //
163 Status = gBS->OpenProtocol (
164 Controller,
165 &gEfiUsbIoProtocolGuid,
166 (VOID **)&UsbIo,
167 This->DriverBindingHandle,
168 Controller,
169 EFI_OPEN_PROTOCOL_BY_DRIVER
170 );
171 if (PcdGetBool (PcdUsbKbDriverTakePrecedence)) {
172 if (Status == EFI_ACCESS_DENIED) {
173 Status = gBS->DisconnectController (
174 Controller,
175 NULL,
176 NULL
177 );
178 if (EFI_ERROR (Status)) {
179 goto ErrorExit1;
180 }
181
182 Status = gBS->OpenProtocol (
183 Controller,
184 &gEfiUsbIoProtocolGuid,
185 (VOID **)&UsbIo,
186 This->DriverBindingHandle,
187 Controller,
188 EFI_OPEN_PROTOCOL_BY_DRIVER
189 );
190 }
191 }
192
193 if (EFI_ERROR (Status)) {
194 goto ErrorExit1;
195 }
196
197 UsbKeyboardDevice = AllocateZeroPool (sizeof (USB_KB_DEV));
198 if (UsbKeyboardDevice == NULL) {
199 goto ErrorExit1;
200 }
201
202 //
203 // Get the Device Path Protocol on Controller's handle
204 //
205 Status = gBS->OpenProtocol (
206 Controller,
208 (VOID **)&UsbKeyboardDevice->DevicePath,
209 This->DriverBindingHandle,
210 Controller,
211 EFI_OPEN_PROTOCOL_GET_PROTOCOL
212 );
213
214 if (EFI_ERROR (Status)) {
215 goto ErrorExit;
216 }
217
218 //
219 // Report that the USB keyboard is being enabled
220 //
221 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
222 EFI_PROGRESS_CODE,
223 (EFI_PERIPHERAL_KEYBOARD | EFI_P_PC_ENABLE),
224 UsbKeyboardDevice->DevicePath
225 );
226
227 //
228 // This is pretty close to keyboard detection, so log progress
229 //
230 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
231 EFI_PROGRESS_CODE,
232 (EFI_PERIPHERAL_KEYBOARD | EFI_P_PC_PRESENCE_DETECT),
233 UsbKeyboardDevice->DevicePath
234 );
235
236 UsbKeyboardDevice->UsbIo = UsbIo;
237
238 //
239 // Valid signature is required by UsbKbLocateAppleKeyMapDb.
240 //
241 UsbKeyboardDevice->Signature = USB_KB_DEV_SIGNATURE;
242 UsbKbLocateAppleKeyMapDb (UsbKeyboardDevice);
243
244 //
245 // Get interface & endpoint descriptor
246 //
247 UsbIo->UsbGetInterfaceDescriptor (
248 UsbIo,
249 &UsbKeyboardDevice->InterfaceDescriptor
250 );
251
252 EndpointNumber = UsbKeyboardDevice->InterfaceDescriptor.NumEndpoints;
253
254 //
255 // Traverse endpoints to find interrupt endpoint IN
256 //
257 Found = FALSE;
258 for (Index = 0; Index < EndpointNumber; Index++) {
259 UsbIo->UsbGetEndpointDescriptor (
260 UsbIo,
261 Index,
262 &EndpointDescriptor
263 );
264
265 if (((EndpointDescriptor.Attributes & (BIT0 | BIT1)) == USB_ENDPOINT_INTERRUPT) &&
266 ((EndpointDescriptor.EndpointAddress & USB_ENDPOINT_DIR_IN) != 0))
267 {
268 //
269 // We only care interrupt endpoint here
270 //
271 CopyMem (&UsbKeyboardDevice->IntEndpointDescriptor, &EndpointDescriptor, sizeof (EndpointDescriptor));
272 Found = TRUE;
273 break;
274 }
275 }
276
277 if (!Found) {
278 //
279 // Report Status Code to indicate that there is no USB keyboard
280 //
281 REPORT_STATUS_CODE (
282 EFI_ERROR_CODE | EFI_ERROR_MINOR,
283 (EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_NOT_DETECTED)
284 );
285 //
286 // No interrupt endpoint found, then return unsupported.
287 //
288 Status = EFI_UNSUPPORTED;
289 goto ErrorExit;
290 }
291
292 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
293 EFI_PROGRESS_CODE,
294 (EFI_PERIPHERAL_KEYBOARD | EFI_P_PC_DETECTED),
295 UsbKeyboardDevice->DevicePath
296 );
297
298 UsbKeyboardDevice->Signature = USB_KB_DEV_SIGNATURE;
299 UsbKeyboardDevice->SimpleInput.Reset = USBKeyboardReset;
300 UsbKeyboardDevice->SimpleInput.ReadKeyStroke = USBKeyboardReadKeyStroke;
301
302 UsbKeyboardDevice->SimpleInputEx.Reset = USBKeyboardResetEx;
303 UsbKeyboardDevice->SimpleInputEx.ReadKeyStrokeEx = USBKeyboardReadKeyStrokeEx;
304 UsbKeyboardDevice->SimpleInputEx.SetState = USBKeyboardSetState;
305 UsbKeyboardDevice->SimpleInputEx.RegisterKeyNotify = USBKeyboardRegisterKeyNotify;
306 UsbKeyboardDevice->SimpleInputEx.UnregisterKeyNotify = USBKeyboardUnregisterKeyNotify;
307
308 InitializeListHead (&UsbKeyboardDevice->NotifyList);
309
310 Status = gBS->CreateEvent (
311 EVT_TIMER | EVT_NOTIFY_SIGNAL,
312 TPL_NOTIFY,
314 UsbKeyboardDevice,
315 &UsbKeyboardDevice->TimerEvent
316 );
317 if (!EFI_ERROR (Status)) {
318 Status = gBS->SetTimer (UsbKeyboardDevice->TimerEvent, TimerPeriodic, KEYBOARD_TIMER_INTERVAL);
319 }
320
321 if (EFI_ERROR (Status)) {
322 goto ErrorExit;
323 }
324
325 Status = gBS->CreateEvent (
326 EVT_NOTIFY_WAIT,
327 TPL_NOTIFY,
329 UsbKeyboardDevice,
330 &(UsbKeyboardDevice->SimpleInputEx.WaitForKeyEx)
331 );
332
333 if (EFI_ERROR (Status)) {
334 goto ErrorExit;
335 }
336
337 Status = gBS->CreateEvent (
338 EVT_NOTIFY_WAIT,
339 TPL_NOTIFY,
341 UsbKeyboardDevice,
342 &(UsbKeyboardDevice->SimpleInput.WaitForKey)
343 );
344 if (EFI_ERROR (Status)) {
345 goto ErrorExit;
346 }
347
348 Status = gBS->CreateEvent (
349 EVT_NOTIFY_SIGNAL,
350 TPL_CALLBACK,
352 UsbKeyboardDevice,
353 &UsbKeyboardDevice->KeyNotifyProcessEvent
354 );
355 if (EFI_ERROR (Status)) {
356 goto ErrorExit;
357 }
358
359 //
360 // Install Simple Text Input Protocol and Simple Text Input Ex Protocol
361 // for the USB keyboard device.
362 // USB keyboard is a hot plug device, and expected to work immediately
363 // when plugging into system, other conventional console devices could
364 // distinguish it by its device path.
365 //
366 Status = gBS->InstallMultipleProtocolInterfaces (
367 &Controller,
368 &gEfiSimpleTextInProtocolGuid,
369 &UsbKeyboardDevice->SimpleInput,
370 &gEfiSimpleTextInputExProtocolGuid,
371 &UsbKeyboardDevice->SimpleInputEx,
372 NULL
373 );
374 if (EFI_ERROR (Status)) {
375 goto ErrorExit;
376 }
377
378 UsbKeyboardDevice->ControllerHandle = Controller;
379 Status = InitKeyboardLayout (UsbKeyboardDevice);
380 if (EFI_ERROR (Status)) {
381 gBS->UninstallMultipleProtocolInterfaces (
382 Controller,
383 &gEfiSimpleTextInProtocolGuid,
384 &UsbKeyboardDevice->SimpleInput,
385 &gEfiSimpleTextInputExProtocolGuid,
386 &UsbKeyboardDevice->SimpleInputEx,
387 NULL
388 );
389 goto ErrorExit;
390 }
391
392 //
393 // Reset USB Keyboard Device exhaustively.
394 //
395 Status = UsbKeyboardDevice->SimpleInputEx.Reset (
396 &UsbKeyboardDevice->SimpleInputEx,
397 TRUE
398 );
399 if (EFI_ERROR (Status)) {
400 gBS->UninstallMultipleProtocolInterfaces (
401 Controller,
402 &gEfiSimpleTextInProtocolGuid,
403 &UsbKeyboardDevice->SimpleInput,
404 &gEfiSimpleTextInputExProtocolGuid,
405 &UsbKeyboardDevice->SimpleInputEx,
406 NULL
407 );
408 goto ErrorExit;
409 }
410
411 //
412 // Submit Asynchronous Interrupt Transfer to manage this device.
413 //
414 EndpointAddr = UsbKeyboardDevice->IntEndpointDescriptor.EndpointAddress;
415 PollingInterval = UsbKeyboardDevice->IntEndpointDescriptor.Interval;
416 PacketSize = (UINT8)(UsbKeyboardDevice->IntEndpointDescriptor.MaxPacketSize);
417
418 Status = UsbIo->UsbAsyncInterruptTransfer (
419 UsbIo,
420 EndpointAddr,
421 TRUE,
422 PollingInterval,
423 PacketSize,
425 UsbKeyboardDevice
426 );
427
428 if (EFI_ERROR (Status)) {
429 gBS->UninstallMultipleProtocolInterfaces (
430 Controller,
431 &gEfiSimpleTextInProtocolGuid,
432 &UsbKeyboardDevice->SimpleInput,
433 &gEfiSimpleTextInputExProtocolGuid,
434 &UsbKeyboardDevice->SimpleInputEx,
435 NULL
436 );
437 goto ErrorExit;
438 }
439
440 UsbKeyboardDevice->ControllerNameTable = NULL;
441 AddUnicodeString2 (
442 "eng",
443 gUsbKeyboardComponentName.SupportedLanguages,
444 &UsbKeyboardDevice->ControllerNameTable,
445 L"Generic Usb Keyboard",
446 TRUE
447 );
448 AddUnicodeString2 (
449 "en",
450 gUsbKeyboardComponentName2.SupportedLanguages,
451 &UsbKeyboardDevice->ControllerNameTable,
452 L"Generic Usb Keyboard",
453 FALSE
454 );
455
456 gBS->RestoreTPL (OldTpl);
457
458 if (PcdGetBool (PcdEnableDisconnectOnExitBootServicesInUsbKbDriver)) {
459 Status = gBS->CreateEvent (
460 EVT_SIGNAL_EXIT_BOOT_SERVICES,
461 TPL_NOTIFY,
463 UsbKeyboardDevice,
464 &UsbKeyboardDevice->ExitBootServicesEvent
465 );
466 ASSERT_EFI_ERROR (Status);
467 }
468
469 return EFI_SUCCESS;
470
471 //
472 // Error handler
473 //
474ErrorExit:
475 if (UsbKeyboardDevice->TimerEvent != NULL) {
476 gBS->CloseEvent (UsbKeyboardDevice->TimerEvent);
477 }
478
479 if (UsbKeyboardDevice->SimpleInput.WaitForKey != NULL) {
480 gBS->CloseEvent (UsbKeyboardDevice->SimpleInput.WaitForKey);
481 }
482
483 if (UsbKeyboardDevice->SimpleInputEx.WaitForKeyEx != NULL) {
484 gBS->CloseEvent (UsbKeyboardDevice->SimpleInputEx.WaitForKeyEx);
485 }
486
487 if (UsbKeyboardDevice->KeyNotifyProcessEvent != NULL) {
488 gBS->CloseEvent (UsbKeyboardDevice->KeyNotifyProcessEvent);
489 }
490
491 ReleaseKeyboardLayoutResources (UsbKeyboardDevice);
492 UsbKbFreeAppleKeyMapDb (UsbKeyboardDevice);
493 FreePool (UsbKeyboardDevice);
494 UsbKeyboardDevice = NULL;
495
496 gBS->CloseProtocol (
497 Controller,
498 &gEfiUsbIoProtocolGuid,
499 This->DriverBindingHandle,
500 Controller
501 );
502
503ErrorExit1:
504 gBS->RestoreTPL (OldTpl);
505
506 return Status;
507}
508
524EFI_STATUS
525EFIAPI
527 IN EFI_DRIVER_BINDING_PROTOCOL *This,
528 IN EFI_HANDLE Controller,
529 IN UINTN NumberOfChildren,
530 IN EFI_HANDLE *ChildHandleBuffer
531 )
532{
533 EFI_STATUS Status;
534 EFI_SIMPLE_TEXT_INPUT_PROTOCOL *SimpleInput;
535 USB_KB_DEV *UsbKeyboardDevice;
536
537 Status = gBS->OpenProtocol (
538 Controller,
539 &gEfiSimpleTextInProtocolGuid,
540 (VOID **)&SimpleInput,
541 This->DriverBindingHandle,
542 Controller,
543 EFI_OPEN_PROTOCOL_GET_PROTOCOL
544 );
545 if (EFI_ERROR (Status)) {
546 return EFI_UNSUPPORTED;
547 }
548
549 Status = gBS->OpenProtocol (
550 Controller,
551 &gEfiSimpleTextInputExProtocolGuid,
552 NULL,
553 This->DriverBindingHandle,
554 Controller,
555 EFI_OPEN_PROTOCOL_TEST_PROTOCOL
556 );
557 if (EFI_ERROR (Status)) {
558 return EFI_UNSUPPORTED;
559 }
560
561 UsbKeyboardDevice = USB_KB_DEV_FROM_THIS (SimpleInput);
562
563 //
564 // The key data input from this device will be disabled.
565 //
566 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
567 EFI_PROGRESS_CODE,
568 (EFI_PERIPHERAL_KEYBOARD | EFI_P_PC_DISABLE),
569 UsbKeyboardDevice->DevicePath
570 );
571
572 //
573 // Delete the Asynchronous Interrupt Transfer from this device
574 //
575 UsbKeyboardDevice->UsbIo->UsbAsyncInterruptTransfer (
576 UsbKeyboardDevice->UsbIo,
577 UsbKeyboardDevice->IntEndpointDescriptor.EndpointAddress,
578 FALSE,
579 UsbKeyboardDevice->IntEndpointDescriptor.Interval,
580 0,
581 NULL,
582 NULL
583 );
584
585 gBS->CloseProtocol (
586 Controller,
587 &gEfiUsbIoProtocolGuid,
588 This->DriverBindingHandle,
589 Controller
590 );
591
592 if ( !PcdGetBool (PcdEnableDisconnectOnExitBootServicesInUsbKbDriver)
594 {
595 UsbKbFreeAppleKeyMapDb (UsbKeyboardDevice);
596
597 Status = gBS->UninstallMultipleProtocolInterfaces (
598 Controller,
599 &gEfiSimpleTextInProtocolGuid,
600 &UsbKeyboardDevice->SimpleInput,
601 &gEfiSimpleTextInputExProtocolGuid,
602 &UsbKeyboardDevice->SimpleInputEx,
603 NULL
604 );
605 //
606 // Free all resources.
607 //
608 gBS->CloseEvent (UsbKeyboardDevice->TimerEvent);
609 gBS->CloseEvent (UsbKeyboardDevice->RepeatTimer);
610 gBS->CloseEvent (UsbKeyboardDevice->DelayedRecoveryEvent);
611 gBS->CloseEvent (UsbKeyboardDevice->SimpleInput.WaitForKey);
612 gBS->CloseEvent (UsbKeyboardDevice->SimpleInputEx.WaitForKeyEx);
613 gBS->CloseEvent (UsbKeyboardDevice->KeyNotifyProcessEvent);
614
615 if (PcdGetBool (PcdEnableDisconnectOnExitBootServicesInUsbKbDriver)) {
616 gBS->CloseEvent (UsbKeyboardDevice->ExitBootServicesEvent);
617 }
618
619 KbdFreeNotifyList (&UsbKeyboardDevice->NotifyList);
620
621 ReleaseKeyboardLayoutResources (UsbKeyboardDevice);
622
623 if (UsbKeyboardDevice->ControllerNameTable != NULL) {
624 FreeUnicodeStringTable (UsbKeyboardDevice->ControllerNameTable);
625 }
626
627 DestroyQueue (&UsbKeyboardDevice->UsbKeyQueue);
628 DestroyQueue (&UsbKeyboardDevice->EfiKeyQueue);
629 DestroyQueue (&UsbKeyboardDevice->EfiKeyQueueForNotify);
630
631 FreePool (UsbKeyboardDevice);
632 }
633
634 return Status;
635}
636
652EFI_STATUS
654 IN OUT USB_KB_DEV *UsbKeyboardDevice,
655 OUT EFI_KEY_DATA *KeyData
656 )
657{
658 if (KeyData == NULL) {
659 return EFI_INVALID_PARAMETER;
660 }
661
662 if (IsQueueEmpty (&UsbKeyboardDevice->EfiKeyQueue)) {
663 ZeroMem (&KeyData->Key, sizeof (KeyData->Key));
664 InitializeKeyState (UsbKeyboardDevice, &KeyData->KeyState);
665 return EFI_NOT_READY;
666 }
667
668 Dequeue (&UsbKeyboardDevice->EfiKeyQueue, KeyData, sizeof (*KeyData));
669
670 return EFI_SUCCESS;
671}
672
688EFI_STATUS
689EFIAPI
691 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
692 IN BOOLEAN ExtendedVerification
693 )
694{
695 EFI_STATUS Status;
696 USB_KB_DEV *UsbKeyboardDevice;
697
698 UsbKeyboardDevice = USB_KB_DEV_FROM_THIS (This);
699
700 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
701 EFI_PROGRESS_CODE,
702 (EFI_PERIPHERAL_KEYBOARD | EFI_P_PC_RESET),
703 UsbKeyboardDevice->DevicePath
704 );
705
706 //
707 // Non-exhaustive reset:
708 // only reset private data structures.
709 //
710 if (!ExtendedVerification) {
711 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
712 EFI_PROGRESS_CODE,
713 (EFI_PERIPHERAL_KEYBOARD | EFI_P_KEYBOARD_PC_CLEAR_BUFFER),
714 UsbKeyboardDevice->DevicePath
715 );
716 //
717 // Clear the key buffer of this USB keyboard
718 //
719 InitQueue (&UsbKeyboardDevice->UsbKeyQueue, sizeof (USB_KEY));
720 InitQueue (&UsbKeyboardDevice->EfiKeyQueue, sizeof (EFI_KEY_DATA));
721 InitQueue (&UsbKeyboardDevice->EfiKeyQueueForNotify, sizeof (EFI_KEY_DATA));
722
723 return EFI_SUCCESS;
724 }
725
726 //
727 // Exhaustive reset
728 //
729 Status = InitUSBKeyboard (UsbKeyboardDevice);
730 if (EFI_ERROR (Status)) {
731 return EFI_DEVICE_ERROR;
732 }
733
734 return EFI_SUCCESS;
735}
736
750EFI_STATUS
751EFIAPI
753 IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
754 OUT EFI_INPUT_KEY *Key
755 )
756{
757 USB_KB_DEV *UsbKeyboardDevice;
758 EFI_STATUS Status;
759 EFI_KEY_DATA KeyData;
760
761 UsbKeyboardDevice = USB_KB_DEV_FROM_THIS (This);
762
763 //
764 // Considering if the partial keystroke is enabled, there maybe a partial
765 // keystroke in the queue, so here skip the partial keystroke and get the
766 // next key from the queue
767 //
768 while (1) {
769 Status = USBKeyboardReadKeyStrokeWorker (UsbKeyboardDevice, &KeyData);
770 if (EFI_ERROR (Status)) {
771 return Status;
772 }
773
774 //
775 // SimpleTextIn Protocol doesn't support partial keystroke;
776 //
777 if ((KeyData.Key.ScanCode == CHAR_NULL) && (KeyData.Key.UnicodeChar == SCAN_NULL)) {
778 continue;
779 }
780
781 //
782 // Translate the CTRL-Alpha characters to their corresponding control value
783 // (ctrl-a = 0x0001 through ctrl-Z = 0x001A)
784 //
785 if ((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) != 0) {
786 if ((KeyData.Key.UnicodeChar >= L'a') && (KeyData.Key.UnicodeChar <= L'z')) {
787 KeyData.Key.UnicodeChar = (CHAR16)(KeyData.Key.UnicodeChar - L'a' + 1);
788 } else if ((KeyData.Key.UnicodeChar >= L'A') && (KeyData.Key.UnicodeChar <= L'Z')) {
789 KeyData.Key.UnicodeChar = (CHAR16)(KeyData.Key.UnicodeChar - L'A' + 1);
790 }
791 }
792
793 CopyMem (Key, &KeyData.Key, sizeof (EFI_INPUT_KEY));
794 return EFI_SUCCESS;
795 }
796}
797
806VOID
807EFIAPI
809 IN EFI_EVENT Event,
810 IN VOID *Context
811 )
812{
813 USB_KB_DEV *UsbKeyboardDevice;
814 EFI_KEY_DATA KeyData;
815 EFI_TPL OldTpl;
816
817 UsbKeyboardDevice = (USB_KB_DEV *)Context;
818
819 //
820 // Enter critical section
821 //
822 OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
823
824 //
825 // WaitforKey doesn't support the partial key.
826 // Considering if the partial keystroke is enabled, there maybe a partial
827 // keystroke in the queue, so here skip the partial keystroke and get the
828 // next key from the queue
829 //
830 while (!IsQueueEmpty (&UsbKeyboardDevice->EfiKeyQueue)) {
831 //
832 // If there is pending key, signal the event.
833 //
834 CopyMem (
835 &KeyData,
836 UsbKeyboardDevice->EfiKeyQueue.Buffer[UsbKeyboardDevice->EfiKeyQueue.Head],
837 sizeof (EFI_KEY_DATA)
838 );
839 if ((KeyData.Key.ScanCode == SCAN_NULL) && (KeyData.Key.UnicodeChar == CHAR_NULL)) {
840 Dequeue (&UsbKeyboardDevice->EfiKeyQueue, &KeyData, sizeof (EFI_KEY_DATA));
841 continue;
842 }
843
844 gBS->SignalEvent (Event);
845 break;
846 }
847
848 //
849 // Leave critical section and return
850 //
851 gBS->RestoreTPL (OldTpl);
852}
853
860VOID
861EFIAPI
863 IN EFI_EVENT Event,
864 IN VOID *Context
865 )
866{
867 EFI_STATUS Status;
868 USB_KB_DEV *UsbKeyboardDevice;
869 UINT8 KeyCode;
870 EFI_KEY_DATA KeyData;
871
872 UsbKeyboardDevice = (USB_KB_DEV *)Context;
873
874 //
875 // Fetch raw data from the USB keyboard buffer,
876 // and translate it into USB keycode.
877 //
878 Status = USBParseKey (UsbKeyboardDevice, &KeyCode);
879 if (EFI_ERROR (Status)) {
880 return;
881 }
882
883 //
884 // Translate saved USB keycode into EFI_INPUT_KEY
885 //
886 Status = UsbKeyCodeToEfiInputKey (UsbKeyboardDevice, KeyCode, &KeyData);
887 if (EFI_ERROR (Status)) {
888 return;
889 }
890
891 //
892 // Insert to the EFI Key queue
893 //
894 Enqueue (&UsbKeyboardDevice->EfiKeyQueue, &KeyData, sizeof (KeyData));
895}
896
903VOID
904EFIAPI
906 IN EFI_EVENT Event,
907 IN VOID *Context
908 )
909{
910 USB_KB_DEV *UsbKeyboardDevice;
911
912 UsbKeyboardDevice = (USB_KB_DEV *)Context;
913
915
916 gBS->DisconnectController (
917 UsbKeyboardDevice->ControllerHandle,
919 NULL
920 );
921}
922
932EFI_STATUS
934 IN OUT LIST_ENTRY *NotifyList
935 )
936{
938 LIST_ENTRY *Link;
939
940 if (NotifyList == NULL) {
941 return EFI_INVALID_PARAMETER;
942 }
943
944 while (!IsListEmpty (NotifyList)) {
945 Link = GetFirstNode (NotifyList);
946 NotifyNode = CR (Link, KEYBOARD_CONSOLE_IN_EX_NOTIFY, NotifyEntry, USB_KB_CONSOLE_IN_EX_NOTIFY_SIGNATURE);
947 RemoveEntryList (Link);
948 FreePool (NotifyNode);
949 }
950
951 return EFI_SUCCESS;
952}
953
964BOOLEAN
966 IN EFI_KEY_DATA *RegsiteredData,
967 IN EFI_KEY_DATA *InputData
968 )
969{
970 ASSERT (RegsiteredData != NULL && InputData != NULL);
971
972 if ((RegsiteredData->Key.ScanCode != InputData->Key.ScanCode) ||
973 (RegsiteredData->Key.UnicodeChar != InputData->Key.UnicodeChar))
974 {
975 return FALSE;
976 }
977
978 //
979 // Assume KeyShiftState/KeyToggleState = 0 in Registered key data means these state could be ignored.
980 //
981 if ((RegsiteredData->KeyState.KeyShiftState != 0) &&
982 (RegsiteredData->KeyState.KeyShiftState != InputData->KeyState.KeyShiftState))
983 {
984 return FALSE;
985 }
986
987 if ((RegsiteredData->KeyState.KeyToggleState != 0) &&
988 (RegsiteredData->KeyState.KeyToggleState != InputData->KeyState.KeyToggleState))
989 {
990 return FALSE;
991 }
992
993 return TRUE;
994}
995
996//
997// Simple Text Input Ex protocol functions
998//
999
1022EFI_STATUS
1023EFIAPI
1025 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
1026 IN BOOLEAN ExtendedVerification
1027 )
1028{
1029 EFI_STATUS Status;
1030 USB_KB_DEV *UsbKeyboardDevice;
1031
1032 UsbKeyboardDevice = TEXT_INPUT_EX_USB_KB_DEV_FROM_THIS (This);
1033
1034 Status = UsbKeyboardDevice->SimpleInput.Reset (&UsbKeyboardDevice->SimpleInput, ExtendedVerification);
1035 if (EFI_ERROR (Status)) {
1036 return EFI_DEVICE_ERROR;
1037 }
1038
1039 UsbKeyboardDevice->KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID;
1040 UsbKeyboardDevice->KeyState.KeyToggleState = EFI_TOGGLE_STATE_VALID;
1041
1042 return EFI_SUCCESS;
1043}
1044
1059EFI_STATUS
1060EFIAPI
1062 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
1063 OUT EFI_KEY_DATA *KeyData
1064 )
1065{
1066 USB_KB_DEV *UsbKeyboardDevice;
1067
1068 if (KeyData == NULL) {
1069 return EFI_INVALID_PARAMETER;
1070 }
1071
1072 UsbKeyboardDevice = TEXT_INPUT_EX_USB_KB_DEV_FROM_THIS (This);
1073
1074 return USBKeyboardReadKeyStrokeWorker (UsbKeyboardDevice, KeyData);
1075}
1076
1091EFI_STATUS
1092EFIAPI
1094 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
1095 IN EFI_KEY_TOGGLE_STATE *KeyToggleState
1096 )
1097{
1098 USB_KB_DEV *UsbKeyboardDevice;
1099
1100 if (KeyToggleState == NULL) {
1101 return EFI_INVALID_PARAMETER;
1102 }
1103
1104 UsbKeyboardDevice = TEXT_INPUT_EX_USB_KB_DEV_FROM_THIS (This);
1105
1106 if (((UsbKeyboardDevice->KeyState.KeyToggleState & EFI_TOGGLE_STATE_VALID) != EFI_TOGGLE_STATE_VALID) ||
1107 ((*KeyToggleState & EFI_TOGGLE_STATE_VALID) != EFI_TOGGLE_STATE_VALID))
1108 {
1109 return EFI_UNSUPPORTED;
1110 }
1111
1112 //
1113 // Update the status light
1114 //
1115
1116 UsbKeyboardDevice->ScrollOn = FALSE;
1117 UsbKeyboardDevice->NumLockOn = FALSE;
1118 UsbKeyboardDevice->CapsOn = FALSE;
1119 UsbKeyboardDevice->IsSupportPartialKey = FALSE;
1120
1121 if ((*KeyToggleState & EFI_SCROLL_LOCK_ACTIVE) == EFI_SCROLL_LOCK_ACTIVE) {
1122 UsbKeyboardDevice->ScrollOn = TRUE;
1123 }
1124
1125 if ((*KeyToggleState & EFI_NUM_LOCK_ACTIVE) == EFI_NUM_LOCK_ACTIVE) {
1126 UsbKeyboardDevice->NumLockOn = TRUE;
1127 }
1128
1129 if ((*KeyToggleState & EFI_CAPS_LOCK_ACTIVE) == EFI_CAPS_LOCK_ACTIVE) {
1130 UsbKeyboardDevice->CapsOn = TRUE;
1131 }
1132
1133 if ((*KeyToggleState & EFI_KEY_STATE_EXPOSED) == EFI_KEY_STATE_EXPOSED) {
1134 UsbKeyboardDevice->IsSupportPartialKey = TRUE;
1135 }
1136
1137 SetKeyLED (UsbKeyboardDevice);
1138
1139 UsbKeyboardDevice->KeyState.KeyToggleState = *KeyToggleState;
1140
1141 return EFI_SUCCESS;
1142}
1143
1163EFI_STATUS
1164EFIAPI
1166 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
1167 IN EFI_KEY_DATA *KeyData,
1168 IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,
1169 OUT VOID **NotifyHandle
1170 )
1171{
1172 USB_KB_DEV *UsbKeyboardDevice;
1174 LIST_ENTRY *Link;
1175 LIST_ENTRY *NotifyList;
1176 KEYBOARD_CONSOLE_IN_EX_NOTIFY *CurrentNotify;
1177
1178 if ((KeyData == NULL) || (NotifyHandle == NULL) || (KeyNotificationFunction == NULL)) {
1179 return EFI_INVALID_PARAMETER;
1180 }
1181
1182 UsbKeyboardDevice = TEXT_INPUT_EX_USB_KB_DEV_FROM_THIS (This);
1183
1184 //
1185 // Return EFI_SUCCESS if the (KeyData, NotificationFunction) is already registered.
1186 //
1187 NotifyList = &UsbKeyboardDevice->NotifyList;
1188
1189 for (Link = GetFirstNode (NotifyList);
1190 !IsNull (NotifyList, Link);
1191 Link = GetNextNode (NotifyList, Link))
1192 {
1193 CurrentNotify = CR (
1194 Link,
1196 NotifyEntry,
1198 );
1199 if (IsKeyRegistered (&CurrentNotify->KeyData, KeyData)) {
1200 if (CurrentNotify->KeyNotificationFn == KeyNotificationFunction) {
1201 *NotifyHandle = CurrentNotify;
1202 return EFI_SUCCESS;
1203 }
1204 }
1205 }
1206
1207 //
1208 // Allocate resource to save the notification function
1209 //
1210 NewNotify = (KEYBOARD_CONSOLE_IN_EX_NOTIFY *)AllocateZeroPool (sizeof (KEYBOARD_CONSOLE_IN_EX_NOTIFY));
1211 if (NewNotify == NULL) {
1212 return EFI_OUT_OF_RESOURCES;
1213 }
1214
1216 NewNotify->KeyNotificationFn = KeyNotificationFunction;
1217 CopyMem (&NewNotify->KeyData, KeyData, sizeof (EFI_KEY_DATA));
1218 InsertTailList (&UsbKeyboardDevice->NotifyList, &NewNotify->NotifyEntry);
1219
1220 *NotifyHandle = NewNotify;
1221
1222 return EFI_SUCCESS;
1223}
1224
1235EFI_STATUS
1236EFIAPI
1238 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
1239 IN VOID *NotificationHandle
1240 )
1241{
1242 USB_KB_DEV *UsbKeyboardDevice;
1243 KEYBOARD_CONSOLE_IN_EX_NOTIFY *CurrentNotify;
1244 LIST_ENTRY *Link;
1245 LIST_ENTRY *NotifyList;
1246
1247 if (NotificationHandle == NULL) {
1248 return EFI_INVALID_PARAMETER;
1249 }
1250
1251 UsbKeyboardDevice = TEXT_INPUT_EX_USB_KB_DEV_FROM_THIS (This);
1252
1253 //
1254 // Traverse notify list of USB keyboard and remove the entry of NotificationHandle.
1255 //
1256 NotifyList = &UsbKeyboardDevice->NotifyList;
1257 for (Link = GetFirstNode (NotifyList);
1258 !IsNull (NotifyList, Link);
1259 Link = GetNextNode (NotifyList, Link))
1260 {
1261 CurrentNotify = CR (
1262 Link,
1264 NotifyEntry,
1266 );
1267 if (CurrentNotify == NotificationHandle) {
1268 //
1269 // Remove the notification function from NotifyList and free resources
1270 //
1271 RemoveEntryList (&CurrentNotify->NotifyEntry);
1272
1273 FreePool (CurrentNotify);
1274 return EFI_SUCCESS;
1275 }
1276 }
1277
1278 //
1279 // Cannot find the matching entry in database.
1280 //
1281 return EFI_INVALID_PARAMETER;
1282}
1283
1290VOID
1291EFIAPI
1293 IN EFI_EVENT Event,
1294 IN VOID *Context
1295 )
1296{
1297 EFI_STATUS Status;
1298 USB_KB_DEV *UsbKeyboardDevice;
1299 EFI_KEY_DATA KeyData;
1300 LIST_ENTRY *Link;
1301 LIST_ENTRY *NotifyList;
1302 KEYBOARD_CONSOLE_IN_EX_NOTIFY *CurrentNotify;
1303 EFI_TPL OldTpl;
1304
1305 UsbKeyboardDevice = (USB_KB_DEV *)Context;
1306
1307 //
1308 // Invoke notification functions.
1309 //
1310 NotifyList = &UsbKeyboardDevice->NotifyList;
1311 while (TRUE) {
1312 //
1313 // Enter critical section
1314 //
1315 OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
1316 Status = Dequeue (&UsbKeyboardDevice->EfiKeyQueueForNotify, &KeyData, sizeof (KeyData));
1317 //
1318 // Leave critical section
1319 //
1320 gBS->RestoreTPL (OldTpl);
1321 if (EFI_ERROR (Status)) {
1322 break;
1323 }
1324
1325 for (Link = GetFirstNode (NotifyList); !IsNull (NotifyList, Link); Link = GetNextNode (NotifyList, Link)) {
1326 CurrentNotify = CR (Link, KEYBOARD_CONSOLE_IN_EX_NOTIFY, NotifyEntry, USB_KB_CONSOLE_IN_EX_NOTIFY_SIGNATURE);
1327 if (IsKeyRegistered (&CurrentNotify->KeyData, &KeyData)) {
1328 CurrentNotify->KeyNotificationFn (&KeyData);
1329 }
1330 }
1331 }
1332}
VOID UsbKbFreeAppleKeyMapDb(IN USB_KB_DEV *UsbKeyboardDevice)
Definition AppleKey.c:124
VOID UsbKbLocateAppleKeyMapDb(IN USB_KB_DEV *UsbKeyboardDevice)
Definition AppleKey.c:88
EFI_DRIVER_BINDING_PROTOCOL gUsbKeyboardDriverBinding
Definition EfiKey.c:20
EFI_STATUS USBKeyboardReadKeyStrokeWorker(IN OUT USB_KB_DEV *UsbKeyboardDevice, OUT EFI_KEY_DATA *KeyData)
Definition EfiKey.c:653
EFI_STATUS EFIAPI USBKeyboardDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition EfiKey.c:76
VOID EFIAPI KeyNotifyProcessHandler(IN EFI_EVENT Event, IN VOID *Context)
Definition EfiKey.c:1292
EFI_STATUS EFIAPI USBKeyboardUnregisterKeyNotify(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN VOID *NotificationHandle)
Definition EfiKey.c:1237
EFI_STATUS EFIAPI USBKeyboardResetEx(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
Definition EfiKey.c:1024
VOID EFIAPI USBKeyboardExitBootServices(IN EFI_EVENT Event, IN VOID *Context)
Definition EfiKey.c:905
EFI_STATUS EFIAPI USBKeyboardRegisterKeyNotify(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN EFI_KEY_DATA *KeyData, IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction, OUT VOID **NotifyHandle)
Definition EfiKey.c:1165
EFI_STATUS EFIAPI USBKeyboardDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
Definition EfiKey.c:526
EFI_STATUS EFIAPI USBKeyboardDriverBindingEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition EfiKey.c:43
VOID EFIAPI USBKeyboardWaitForKey(IN EFI_EVENT Event, IN VOID *Context)
Definition EfiKey.c:808
EFI_STATUS EFIAPI USBKeyboardSetState(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN EFI_KEY_TOGGLE_STATE *KeyToggleState)
Definition EfiKey.c:1093
VOID EFIAPI USBKeyboardTimerHandler(IN EFI_EVENT Event, IN VOID *Context)
Definition EfiKey.c:862
STATIC BOOLEAN mExitingBootServices
Definition EfiKey.c:15
EFI_STATUS EFIAPI USBKeyboardDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition EfiKey.c:141
EFI_STATUS KbdFreeNotifyList(IN OUT LIST_ENTRY *NotifyList)
Definition EfiKey.c:933
EFI_STATUS EFIAPI USBKeyboardReset(IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
Definition EfiKey.c:690
EFI_STATUS EFIAPI USBKeyboardReadKeyStrokeEx(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, OUT EFI_KEY_DATA *KeyData)
Definition EfiKey.c:1061
EFI_STATUS EFIAPI USBKeyboardReadKeyStroke(IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, OUT EFI_INPUT_KEY *Key)
Definition EfiKey.c:752
BOOLEAN IsKeyRegistered(IN EFI_KEY_DATA *RegsiteredData, IN EFI_KEY_DATA *InputData)
Definition EfiKey.c:965
#define USB_KB_DEV_SIGNATURE
Definition EfiKey.h:63
#define USB_KB_DEV_FROM_THIS(a)
Definition EfiKey.h:171
#define USB_KB_CONSOLE_IN_EX_NOTIFY_SIGNATURE
Definition EfiKey.h:64
#define TEXT_INPUT_EX_USB_KB_DEV_FROM_THIS(a)
Definition EfiKey.h:173
#define KEYBOARD_TIMER_INTERVAL
Definition EfiKey.h:36
EFI_STATUS EFIAPI KeyboardHandler(IN VOID *Data, IN UINTN DataLength, IN VOID *Context, IN UINT32 Result)
Definition KeyBoard.c:773
VOID SetKeyLED(IN USB_KB_DEV *UsbKeyboardDevice)
Definition KeyBoard.c:1712
VOID DestroyQueue(IN OUT USB_SIMPLE_QUEUE *Queue)
Definition KeyBoard.c:1596
EFI_STATUS InitUSBKeyboard(IN OUT USB_KB_DEV *UsbKeyboardDevice)
Definition KeyBoard.c:618
EFI_STATUS Dequeue(IN OUT USB_SIMPLE_QUEUE *Queue, OUT VOID *Item, IN UINTN ItemSize)
Definition KeyBoard.c:1683
VOID ReleaseKeyboardLayoutResources(IN OUT USB_KB_DEV *UsbKeyboardDevice)
Definition KeyBoard.c:472
EFI_STATUS USBParseKey(IN OUT USB_KB_DEV *UsbKeyboardDevice, OUT UINT8 *KeyCode)
Definition KeyBoard.c:1100
VOID InitQueue(IN OUT USB_SIMPLE_QUEUE *Queue, IN UINTN ItemSize)
Definition KeyBoard.c:1567
VOID Enqueue(IN OUT USB_SIMPLE_QUEUE *Queue, IN VOID *Item, IN UINTN ItemSize)
Definition KeyBoard.c:1648
VOID InitializeKeyState(IN USB_KB_DEV *UsbKeyboardDevice, OUT EFI_KEY_STATE *KeyState)
Definition KeyBoard.c:1335
BOOLEAN IsUSBKeyboard(IN EFI_USB_IO_PROTOCOL *UsbIo)
Definition KeyBoard.c:324
EFI_STATUS UsbKeyCodeToEfiInputKey(IN USB_KB_DEV *UsbKeyboardDevice, IN UINT8 KeyCode, OUT EFI_KEY_DATA *KeyData)
Definition KeyBoard.c:1417
EFI_STATUS InitKeyboardLayout(OUT USB_KB_DEV *UsbKeyboardDevice)
Definition KeyBoard.c:515
BOOLEAN IsQueueEmpty(IN USB_SIMPLE_QUEUE *Queue)
Definition KeyBoard.c:1613
EFI_HANDLE gImageHandle
EFI_BOOT_SERVICES * gBS
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gUsbKeyboardComponentName
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gUsbKeyboardComponentName2
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_GUID gEfiDevicePathProtocolGuid
#define ASSERT(x)
Definition coder.h:55
EFI_KEY_NOTIFY_FUNCTION KeyNotificationFn
Definition EfiKey.h:69
EFI_EVENT KeyNotifyProcessEvent
Definition EfiKey.h:146
EFI_HANDLE ControllerHandle
Definition EfiKey.h:98
EFI_USB_ENDPOINT_DESCRIPTOR IntEndpointDescriptor
Definition EfiKey.h:106
BOOLEAN NumLockOn
Definition EfiKey.h:114
BOOLEAN ScrollOn
Definition EfiKey.h:116
EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL SimpleInputEx
Definition EfiKey.h:102
USB_SIMPLE_QUEUE UsbKeyQueue
Definition EfiKey.h:108
EFI_USB_IO_PROTOCOL * UsbIo
Definition EfiKey.h:103
EFI_KEY_STATE KeyState
Definition EfiKey.h:141
EFI_UNICODE_STRING_TABLE * ControllerNameTable
Definition EfiKey.h:125
EFI_EVENT TimerEvent
Definition EfiKey.h:120
EFI_EVENT ExitBootServicesEvent
Definition EfiKey.h:161
EFI_EVENT RepeatTimer
Definition EfiKey.h:123
UINTN Signature
Definition EfiKey.h:97
USB_SIMPLE_QUEUE EfiKeyQueue
Definition EfiKey.h:109
EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleInput
Definition EfiKey.h:101
USB_SIMPLE_QUEUE EfiKeyQueueForNotify
Definition EfiKey.h:110
BOOLEAN IsSupportPartialKey
Definition EfiKey.h:139
LIST_ENTRY NotifyList
Definition EfiKey.h:145
BOOLEAN CapsOn
Definition EfiKey.h:115
EFI_DEVICE_PATH_PROTOCOL * DevicePath
Definition EfiKey.h:99
EFI_EVENT DelayedRecoveryEvent
Definition EfiKey.h:100
EFI_USB_INTERFACE_DESCRIPTOR InterfaceDescriptor
Definition EfiKey.h:105
VOID * Buffer[MAX_KEY_ALLOWED+1]
Definition EfiKey.h:57