3 Usb Mouse Driver Binding and Implement SIMPLE_POINTER_PROTOCOL Protocol.
5 Copyright (c) 2004 - 2008, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #include <Library/DebugLib.h>
19 #include <IndustryStandard/Usb.h>
26 EFI_GUID gEfiUsbMouseDriverGuid
= {
27 0x290156b5, 0x6a05, 0x4ac0, {0xb8, 0x0, 0x51, 0x27, 0x55, 0xad, 0x14, 0x29}
30 EFI_DRIVER_BINDING_PROTOCOL gUsbMouseDriverBinding
= {
31 USBMouseDriverBindingSupported
,
32 USBMouseDriverBindingStart
,
33 USBMouseDriverBindingStop
,
40 Tell if a Usb Controller is a mouse.
42 @param UsbIo Protocol instance pointer.
44 @retval TRUE It is a mouse.
45 @retval FALSE It is not a mouse.
50 IN EFI_USB_IO_PROTOCOL
*UsbIo
54 Initialize the Usb Mouse Device.
56 @param UsbMouseDev Device instance to be initialized.
58 @retval EFI_SUCCESS Success.
59 @retval EFI_OUT_OF_RESOURCES Can't allocate memory.
60 @retval Other Init error.
64 InitializeUsbMouseDevice (
65 IN USB_MOUSE_DEV
*UsbMouseDev
69 Event notification function for SIMPLE_POINTER.WaitForInput event
70 Signal the event if there is input from mouse.
72 @param Event Wait Event.
73 @param Context Passed parameter to event handler.
78 UsbMouseWaitForInput (
84 It is called whenever there is data received from async interrupt
87 @param Data Data received.
88 @param DataLength Length of Data.
89 @param Context Passed in context.
90 @param Result Async Interrupt Transfer result.
92 @return EFI_SUCCESS Receive data successfully.
93 @return EFI_DEVICE_ERROR USB async interrupt transfer fails.
98 OnMouseInterruptComplete (
106 Get the mouse state, see SIMPLE POINTER PROTOCOL.
108 @param This Protocol instance pointer.
109 @param MouseState Current mouse state.
111 @return EFI_SUCCESS Get usb mouse status successfully.
112 @return EFI_DEVICE_ERROR The parameter is error.
113 @return EFI_NOT_READY Mouse status doesn't change.
119 IN EFI_SIMPLE_POINTER_PROTOCOL
*This
,
120 OUT EFI_SIMPLE_POINTER_STATE
*MouseState
124 Reset the mouse device, see SIMPLE POINTER PROTOCOL.
126 @param This Protocol instance pointer.
127 @param ExtendedVerification Ignored here.
129 @return EFI_SUCCESS Reset usb mouse successfully.
135 IN EFI_SIMPLE_POINTER_PROTOCOL
*This
,
136 IN BOOLEAN ExtendedVerification
141 The USB Mouse driver entry pointer.
143 @param ImageHandle The driver image handle.
144 @param SystemTable The system table.
146 @return EFI_SUCCESS The component name protocol is installed.
147 @return Others Failed to init the usb driver.
152 USBMouseDriverBindingEntryPoint (
153 IN EFI_HANDLE ImageHandle
,
154 IN EFI_SYSTEM_TABLE
*SystemTable
157 return EfiLibInstallDriverBindingComponentName2 (
160 &gUsbMouseDriverBinding
,
162 &gUsbMouseComponentName
,
163 &gUsbMouseComponentName2
169 Test to see if this driver supports ControllerHandle. Any ControllerHandle
170 that has UsbIoProtocol installed will be supported.
172 @param This Protocol instance pointer.
173 @param Controller Handle of device to test
174 @param RemainingDevicePath Not used.
176 @retval EFI_SUCCESS This driver supports this device.
177 @retval EFI_UNSUPPORTED This driver does not support this device.
182 USBMouseDriverBindingSupported (
183 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
184 IN EFI_HANDLE Controller
,
185 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
188 EFI_STATUS OpenStatus
;
189 EFI_USB_IO_PROTOCOL
*UsbIo
;
192 OpenStatus
= gBS
->OpenProtocol (
194 &gEfiUsbIoProtocolGuid
,
196 This
->DriverBindingHandle
,
198 EFI_OPEN_PROTOCOL_BY_DRIVER
200 if (EFI_ERROR (OpenStatus
) && (OpenStatus
!= EFI_ALREADY_STARTED
)) {
201 return EFI_UNSUPPORTED
;
204 if (OpenStatus
== EFI_ALREADY_STARTED
) {
205 return EFI_ALREADY_STARTED
;
209 // Use the USB I/O protocol interface to see the Controller is
210 // the Mouse controller that can be managed by this driver.
212 Status
= EFI_SUCCESS
;
213 if (!IsUsbMouse (UsbIo
)) {
214 Status
= EFI_UNSUPPORTED
;
219 &gEfiUsbIoProtocolGuid
,
220 This
->DriverBindingHandle
,
228 Starting the Usb Mouse Driver.
230 @param This Protocol instance pointer.
231 @param Controller Handle of device to test.
232 @param RemainingDevicePath Not used.
234 @retval EFI_SUCCESS This driver supports this device.
235 @retval EFI_UNSUPPORTED This driver does not support this device.
236 @retval EFI_DEVICE_ERROR This driver cannot be started due to device Error.
237 @retval EFI_OUT_OF_RESOURCES Can't allocate memory resources.
238 @retval EFI_ALREADY_STARTED This driver has been started.
243 USBMouseDriverBindingStart (
244 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
245 IN EFI_HANDLE Controller
,
246 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
250 EFI_USB_IO_PROTOCOL
*UsbIo
;
251 EFI_USB_ENDPOINT_DESCRIPTOR
*EndpointDesc
;
252 USB_MOUSE_DEV
*UsbMouseDevice
;
253 UINT8 EndpointNumber
;
256 UINT8 PollingInterval
;
259 UsbMouseDevice
= NULL
;
260 Status
= EFI_SUCCESS
;
262 Status
= gBS
->OpenProtocol (
264 &gEfiUsbIoProtocolGuid
,
266 This
->DriverBindingHandle
,
268 EFI_OPEN_PROTOCOL_BY_DRIVER
270 if (EFI_ERROR (Status
)) {
274 UsbMouseDevice
= AllocateZeroPool (sizeof (USB_MOUSE_DEV
));
275 if (UsbMouseDevice
== NULL
) {
276 Status
= EFI_OUT_OF_RESOURCES
;
280 UsbMouseDevice
->UsbIo
= UsbIo
;
282 UsbMouseDevice
->Signature
= USB_MOUSE_DEV_SIGNATURE
;
284 UsbMouseDevice
->InterfaceDescriptor
= AllocatePool (sizeof (EFI_USB_INTERFACE_DESCRIPTOR
));
285 if (UsbMouseDevice
->InterfaceDescriptor
== NULL
) {
286 Status
= EFI_OUT_OF_RESOURCES
;
290 EndpointDesc
= AllocatePool (sizeof (EFI_USB_ENDPOINT_DESCRIPTOR
));
291 if (EndpointDesc
== NULL
) {
292 Status
= EFI_OUT_OF_RESOURCES
;
296 // Get the Device Path Protocol on Controller's handle
298 Status
= gBS
->OpenProtocol (
300 &gEfiDevicePathProtocolGuid
,
301 (VOID
**) &UsbMouseDevice
->DevicePath
,
302 This
->DriverBindingHandle
,
304 EFI_OPEN_PROTOCOL_GET_PROTOCOL
307 if (EFI_ERROR (Status
)) {
311 // Get interface & endpoint descriptor
313 UsbIo
->UsbGetInterfaceDescriptor (
315 UsbMouseDevice
->InterfaceDescriptor
318 EndpointNumber
= UsbMouseDevice
->InterfaceDescriptor
->NumEndpoints
;
320 for (Index
= 0; Index
< EndpointNumber
; Index
++) {
321 UsbIo
->UsbGetEndpointDescriptor (
327 if ((EndpointDesc
->Attributes
& 0x03) == 0x03) {
330 // We only care interrupt endpoint here
332 UsbMouseDevice
->IntEndpointDescriptor
= EndpointDesc
;
336 if (UsbMouseDevice
->IntEndpointDescriptor
== NULL
) {
338 // No interrupt endpoint, then error
340 Status
= EFI_UNSUPPORTED
;
344 Status
= InitializeUsbMouseDevice (UsbMouseDevice
);
345 if (EFI_ERROR (Status
)) {
346 MouseReportStatusCode (
347 UsbMouseDevice
->DevicePath
,
348 EFI_ERROR_CODE
| EFI_ERROR_MINOR
,
349 PcdGet32 (PcdStatusCodeValueMouseInterfaceError
)
355 UsbMouseDevice
->SimplePointerProtocol
.GetState
= GetMouseState
;
356 UsbMouseDevice
->SimplePointerProtocol
.Reset
= UsbMouseReset
;
357 UsbMouseDevice
->SimplePointerProtocol
.Mode
= &UsbMouseDevice
->Mode
;
359 Status
= gBS
->CreateEvent (
362 UsbMouseWaitForInput
,
364 &((UsbMouseDevice
->SimplePointerProtocol
).WaitForInput
)
366 if (EFI_ERROR (Status
)) {
370 Status
= gBS
->InstallProtocolInterface (
372 &gEfiSimplePointerProtocolGuid
,
373 EFI_NATIVE_INTERFACE
,
374 &UsbMouseDevice
->SimplePointerProtocol
377 if (EFI_ERROR (Status
)) {
378 Status
= EFI_DEVICE_ERROR
;
383 // After Enabling Async Interrupt Transfer on this mouse Device
384 // we will be able to get key data from it. Thus this is deemed as
385 // the enable action of the mouse
388 MouseReportStatusCode (
389 UsbMouseDevice
->DevicePath
,
391 PcdGet32 (PcdStatusCodeValueMouseEnable
)
395 // submit async interrupt transfer
397 EndpointAddr
= UsbMouseDevice
->IntEndpointDescriptor
->EndpointAddress
;
398 PollingInterval
= UsbMouseDevice
->IntEndpointDescriptor
->Interval
;
399 PacketSize
= (UINT8
) (UsbMouseDevice
->IntEndpointDescriptor
->MaxPacketSize
);
401 Status
= UsbIo
->UsbAsyncInterruptTransfer (
407 OnMouseInterruptComplete
,
411 if (!EFI_ERROR (Status
)) {
413 UsbMouseDevice
->ControllerNameTable
= NULL
;
416 gUsbMouseComponentName
.SupportedLanguages
,
417 &UsbMouseDevice
->ControllerNameTable
,
418 L
"Generic Usb Mouse",
423 gUsbMouseComponentName2
.SupportedLanguages
,
424 &UsbMouseDevice
->ControllerNameTable
,
425 L
"Generic Usb Mouse",
434 // If submit error, uninstall that interface
436 Status
= EFI_DEVICE_ERROR
;
437 gBS
->UninstallProtocolInterface (
439 &gEfiSimplePointerProtocolGuid
,
440 &UsbMouseDevice
->SimplePointerProtocol
444 if (EFI_ERROR (Status
)) {
447 &gEfiUsbIoProtocolGuid
,
448 This
->DriverBindingHandle
,
452 if (UsbMouseDevice
!= NULL
) {
453 if (UsbMouseDevice
->InterfaceDescriptor
!= NULL
) {
454 gBS
->FreePool (UsbMouseDevice
->InterfaceDescriptor
);
457 if (UsbMouseDevice
->IntEndpointDescriptor
!= NULL
) {
458 gBS
->FreePool (UsbMouseDevice
->IntEndpointDescriptor
);
461 if ((UsbMouseDevice
->SimplePointerProtocol
).WaitForInput
!= NULL
) {
462 gBS
->CloseEvent ((UsbMouseDevice
->SimplePointerProtocol
).WaitForInput
);
465 gBS
->FreePool (UsbMouseDevice
);
466 UsbMouseDevice
= NULL
;
475 Stop this driver on ControllerHandle. Support stopping any child handles
476 created by this driver.
478 @param This Protocol instance pointer.
479 @param Controller Handle of device to stop driver on.
480 @param NumberOfChildren Number of Children in the ChildHandleBuffer.
481 @param ChildHandleBuffer List of handles for the children we need to stop.
483 @retval EFI_SUCCESS The controller or children are stopped.
484 @retval Other Failed to stop the driver.
489 USBMouseDriverBindingStop (
490 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
491 IN EFI_HANDLE Controller
,
492 IN UINTN NumberOfChildren
,
493 IN EFI_HANDLE
*ChildHandleBuffer
497 USB_MOUSE_DEV
*UsbMouseDevice
;
498 EFI_SIMPLE_POINTER_PROTOCOL
*SimplePointerProtocol
;
499 EFI_USB_IO_PROTOCOL
*UsbIo
;
502 // Get our context back.
504 Status
= gBS
->OpenProtocol (
506 &gEfiSimplePointerProtocolGuid
,
507 (VOID
**) &SimplePointerProtocol
,
508 This
->DriverBindingHandle
,
510 EFI_OPEN_PROTOCOL_GET_PROTOCOL
513 if (EFI_ERROR (Status
)) {
514 return EFI_UNSUPPORTED
;
517 UsbMouseDevice
= USB_MOUSE_DEV_FROM_MOUSE_PROTOCOL (SimplePointerProtocol
);
521 &gEfiSimplePointerProtocolGuid
,
522 This
->DriverBindingHandle
,
526 UsbIo
= UsbMouseDevice
->UsbIo
;
529 // Uninstall the Asyn Interrupt Transfer from this device
530 // will disable the mouse data input from this device
532 MouseReportStatusCode (
533 UsbMouseDevice
->DevicePath
,
535 PcdGet32 (PcdStatusCodeValueMouseDisable
)
539 // Delete Mouse Async Interrupt Transfer
541 UsbIo
->UsbAsyncInterruptTransfer (
543 UsbMouseDevice
->IntEndpointDescriptor
->EndpointAddress
,
545 UsbMouseDevice
->IntEndpointDescriptor
->Interval
,
551 gBS
->CloseEvent (UsbMouseDevice
->SimplePointerProtocol
.WaitForInput
);
553 if (UsbMouseDevice
->DelayedRecoveryEvent
!= NULL
) {
554 gBS
->CloseEvent (UsbMouseDevice
->DelayedRecoveryEvent
);
555 UsbMouseDevice
->DelayedRecoveryEvent
= 0;
558 Status
= gBS
->UninstallProtocolInterface (
560 &gEfiSimplePointerProtocolGuid
,
561 &UsbMouseDevice
->SimplePointerProtocol
563 if (EFI_ERROR (Status
)) {
569 &gEfiUsbIoProtocolGuid
,
570 This
->DriverBindingHandle
,
574 gBS
->FreePool (UsbMouseDevice
->InterfaceDescriptor
);
575 gBS
->FreePool (UsbMouseDevice
->IntEndpointDescriptor
);
577 if (UsbMouseDevice
->ControllerNameTable
!= NULL
) {
578 FreeUnicodeStringTable (UsbMouseDevice
->ControllerNameTable
);
581 gBS
->FreePool (UsbMouseDevice
);
589 Tell if a Usb Controller is a mouse.
591 @param UsbIo Protocol instance pointer.
593 @retval TRUE It is a mouse.
594 @retval FALSE It is not a mouse.
599 IN EFI_USB_IO_PROTOCOL
*UsbIo
603 EFI_USB_INTERFACE_DESCRIPTOR InterfaceDescriptor
;
606 // Get the Default interface descriptor, now we only
607 // suppose it is interface 1
609 Status
= UsbIo
->UsbGetInterfaceDescriptor (
614 if (EFI_ERROR (Status
)) {
618 if ((InterfaceDescriptor
.InterfaceClass
== CLASS_HID
) &&
619 (InterfaceDescriptor
.InterfaceSubClass
== SUBCLASS_BOOT
) &&
620 (InterfaceDescriptor
.InterfaceProtocol
== PROTOCOL_MOUSE
)
630 Initialize the Usb Mouse Device.
632 @param UsbMouseDev Device instance to be initialized.
634 @retval EFI_SUCCESS Success.
635 @retval EFI_OUT_OF_RESOURCES Can't allocate memory.
636 @retval Other Init error.
640 InitializeUsbMouseDevice (
641 IN USB_MOUSE_DEV
*UsbMouseDev
644 EFI_USB_IO_PROTOCOL
*UsbIo
;
647 EFI_USB_HID_DESCRIPTOR MouseHidDesc
;
650 UsbIo
= UsbMouseDev
->UsbIo
;
653 // Get HID descriptor
655 Status
= UsbGetHidDescriptor (
657 UsbMouseDev
->InterfaceDescriptor
->InterfaceNumber
,
661 if (EFI_ERROR (Status
)) {
666 // Get Report descriptor
668 if (MouseHidDesc
.HidClassDesc
[0].DescriptorType
!= 0x22) {
669 return EFI_UNSUPPORTED
;
672 ReportDesc
= AllocateZeroPool (MouseHidDesc
.HidClassDesc
[0].DescriptorLength
);
673 if (ReportDesc
== NULL
) {
674 return EFI_OUT_OF_RESOURCES
;
677 Status
= UsbGetReportDescriptor (
679 UsbMouseDev
->InterfaceDescriptor
->InterfaceNumber
,
680 MouseHidDesc
.HidClassDesc
[0].DescriptorLength
,
684 if (EFI_ERROR (Status
)) {
685 gBS
->FreePool (ReportDesc
);
690 // Parse report descriptor
692 Status
= ParseMouseReportDescriptor (
695 MouseHidDesc
.HidClassDesc
[0].DescriptorLength
698 if (EFI_ERROR (Status
)) {
699 gBS
->FreePool (ReportDesc
);
703 if (UsbMouseDev
->NumberOfButtons
>= 1) {
704 UsbMouseDev
->Mode
.LeftButton
= TRUE
;
707 if (UsbMouseDev
->NumberOfButtons
> 1) {
708 UsbMouseDev
->Mode
.RightButton
= TRUE
;
711 UsbMouseDev
->Mode
.ResolutionX
= 8;
712 UsbMouseDev
->Mode
.ResolutionY
= 8;
713 UsbMouseDev
->Mode
.ResolutionZ
= 0;
715 // Here we just assume interface 0 is the mouse interface
717 UsbGetProtocolRequest (
723 if (Protocol
!= BOOT_PROTOCOL
) {
724 Status
= UsbSetProtocolRequest (
730 if (EFI_ERROR (Status
)) {
731 gBS
->FreePool (ReportDesc
);
732 return EFI_DEVICE_ERROR
;
737 // Set indefinite Idle rate for USB Mouse
746 gBS
->FreePool (ReportDesc
);
748 if (UsbMouseDev
->DelayedRecoveryEvent
!= NULL
) {
749 gBS
->CloseEvent (UsbMouseDev
->DelayedRecoveryEvent
);
750 UsbMouseDev
->DelayedRecoveryEvent
= 0;
753 Status
= gBS
->CreateEvent (
754 EVT_TIMER
| EVT_NOTIFY_SIGNAL
,
756 USBMouseRecoveryHandler
,
758 &UsbMouseDev
->DelayedRecoveryEvent
766 It is called whenever there is data received from async interrupt
769 @param Data Data received.
770 @param DataLength Length of Data.
771 @param Context Passed in context.
772 @param Result Async Interrupt Transfer result.
774 @return EFI_SUCCESS Receive data successfully.
775 @return EFI_DEVICE_ERROR USB async interrupt transfer fails.
780 OnMouseInterruptComplete (
787 USB_MOUSE_DEV
*UsbMouseDevice
;
788 EFI_USB_IO_PROTOCOL
*UsbIo
;
792 UsbMouseDevice
= (USB_MOUSE_DEV
*) Context
;
793 UsbIo
= UsbMouseDevice
->UsbIo
;
795 if (Result
!= EFI_USB_NOERROR
) {
797 // Some errors happen during the process
799 MouseReportStatusCode (
800 UsbMouseDevice
->DevicePath
,
801 EFI_ERROR_CODE
| EFI_ERROR_MINOR
,
802 PcdGet32 (PcdStatusCodeValueMouseInputError
)
805 if ((Result
& EFI_USB_ERR_STALL
) == EFI_USB_ERR_STALL
) {
806 EndpointAddr
= UsbMouseDevice
->IntEndpointDescriptor
->EndpointAddress
;
808 UsbClearEndpointHalt (
815 UsbIo
->UsbAsyncInterruptTransfer (
817 UsbMouseDevice
->IntEndpointDescriptor
->EndpointAddress
,
826 UsbMouseDevice
->DelayedRecoveryEvent
,
828 EFI_USB_INTERRUPT_DELAY
830 return EFI_DEVICE_ERROR
;
833 if (DataLength
== 0 || Data
== NULL
) {
837 UsbMouseDevice
->StateChanged
= TRUE
;
842 UsbMouseDevice
->State
.LeftButton
= (BOOLEAN
) (*(UINT8
*) Data
& 0x01);
843 UsbMouseDevice
->State
.RightButton
= (BOOLEAN
) (*(UINT8
*) Data
& 0x02);
844 UsbMouseDevice
->State
.RelativeMovementX
+= *((INT8
*) Data
+ 1);
845 UsbMouseDevice
->State
.RelativeMovementY
+= *((INT8
*) Data
+ 2);
847 if (DataLength
> 3) {
848 UsbMouseDevice
->State
.RelativeMovementZ
+= *((INT8
*) Data
+ 3);
856 Get the mouse state, see SIMPLE POINTER PROTOCOL.
858 @param This Protocol instance pointer.
859 @param MouseState Current mouse state.
861 @return EFI_SUCCESS Get usb mouse status successfully.
862 @return EFI_DEVICE_ERROR The parameter is error.
863 @return EFI_NOT_READY Mouse status doesn't change.
869 IN EFI_SIMPLE_POINTER_PROTOCOL
*This
,
870 OUT EFI_SIMPLE_POINTER_STATE
*MouseState
873 USB_MOUSE_DEV
*MouseDev
;
875 if (MouseState
== NULL
) {
876 return EFI_DEVICE_ERROR
;
879 MouseDev
= USB_MOUSE_DEV_FROM_MOUSE_PROTOCOL (This
);
881 if (!MouseDev
->StateChanged
) {
882 return EFI_NOT_READY
;
888 sizeof (EFI_SIMPLE_POINTER_STATE
)
892 // Clear previous move state
894 MouseDev
->State
.RelativeMovementX
= 0;
895 MouseDev
->State
.RelativeMovementY
= 0;
896 MouseDev
->State
.RelativeMovementZ
= 0;
898 MouseDev
->StateChanged
= FALSE
;
905 Reset the mouse device, see SIMPLE POINTER PROTOCOL.
907 @param This Protocol instance pointer.
908 @param ExtendedVerification Ignored here.
910 @return EFI_SUCCESS Reset usb mouse successfully.
916 IN EFI_SIMPLE_POINTER_PROTOCOL
*This
,
917 IN BOOLEAN ExtendedVerification
920 USB_MOUSE_DEV
*UsbMouseDevice
;
922 UsbMouseDevice
= USB_MOUSE_DEV_FROM_MOUSE_PROTOCOL (This
);
924 MouseReportStatusCode (
925 UsbMouseDevice
->DevicePath
,
927 PcdGet32 (PcdStatusCodeValueMouseReset
)
932 &UsbMouseDevice
->State
,
933 sizeof (EFI_SIMPLE_POINTER_STATE
)
935 UsbMouseDevice
->StateChanged
= FALSE
;
942 Event notification function for SIMPLE_POINTER.WaitForInput event
943 Signal the event if there is input from mouse.
945 @param Event Wait Event
946 @param Context Passed parameter to event handler
951 UsbMouseWaitForInput (
956 USB_MOUSE_DEV
*UsbMouseDev
;
958 UsbMouseDev
= (USB_MOUSE_DEV
*) Context
;
961 // Someone is waiting on the mouse event, if there's
962 // input from mouse, signal the event
964 if (UsbMouseDev
->StateChanged
) {
965 gBS
->SignalEvent (Event
);
971 Timer handler for Delayed Recovery timer.
973 @param Event The Delayed Recovery event.
974 @param Context Points to the USB_KB_DEV instance.
980 USBMouseRecoveryHandler (
985 USB_MOUSE_DEV
*UsbMouseDev
;
986 EFI_USB_IO_PROTOCOL
*UsbIo
;
988 UsbMouseDev
= (USB_MOUSE_DEV
*) Context
;
990 UsbIo
= UsbMouseDev
->UsbIo
;
992 UsbIo
->UsbAsyncInterruptTransfer (
994 UsbMouseDev
->IntEndpointDescriptor
->EndpointAddress
,
996 UsbMouseDev
->IntEndpointDescriptor
->Interval
,
997 UsbMouseDev
->IntEndpointDescriptor
->MaxPacketSize
,
998 OnMouseInterruptComplete
,
1005 Report Status Code in Usb Bot Driver.
1007 @param DevicePath Use this to get Device Path
1008 @param CodeType Status Code Type
1009 @param CodeValue Status Code Value
1015 MouseReportStatusCode (
1016 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
1017 IN EFI_STATUS_CODE_TYPE CodeType
,
1018 IN EFI_STATUS_CODE_VALUE Value
1021 REPORT_STATUS_CODE_WITH_DEVICE_PATH (