3 Copyright (c) 2004 - 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
23 #include <Library/DebugLib.h>
24 #include <IndustryStandard/Usb.h>
32 // Driver model protocol interface
36 USBMouseDriverBindingEntryPoint (
37 IN EFI_HANDLE ImageHandle
,
38 IN EFI_SYSTEM_TABLE
*SystemTable
43 USBMouseDriverBindingSupported (
44 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
45 IN EFI_HANDLE Controller
,
46 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
51 USBMouseDriverBindingStart (
52 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
53 IN EFI_HANDLE Controller
,
54 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
59 USBMouseDriverBindingStop (
60 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
61 IN EFI_HANDLE Controller
,
62 IN UINTN NumberOfChildren
,
63 IN EFI_HANDLE
*ChildHandleBuffer
66 EFI_GUID gEfiUsbMouseDriverGuid
= {
67 0x290156b5, 0x6a05, 0x4ac0, {0xb8, 0x0, 0x51, 0x27, 0x55, 0xad, 0x14, 0x29}
70 EFI_DRIVER_BINDING_PROTOCOL gUsbMouseDriverBinding
= {
71 USBMouseDriverBindingSupported
,
72 USBMouseDriverBindingStart
,
73 USBMouseDriverBindingStop
,
85 IN EFI_USB_IO_PROTOCOL
*UsbIo
90 InitializeUsbMouseDevice (
91 IN USB_MOUSE_DEV
*UsbMouseDev
97 UsbMouseWaitForInput (
103 // Mouse interrupt handler
108 OnMouseInterruptComplete (
122 IN EFI_SIMPLE_POINTER_PROTOCOL
*This
,
123 OUT EFI_SIMPLE_POINTER_STATE
*MouseState
130 IN EFI_SIMPLE_POINTER_PROTOCOL
*This
,
131 IN BOOLEAN ExtendedVerification
139 USBMouseDriverBindingEntryPoint (
140 IN EFI_HANDLE ImageHandle
,
141 IN EFI_SYSTEM_TABLE
*SystemTable
146 Entry point for EFI drivers.
149 ImageHandle - EFI_HANDLE
150 SystemTable - EFI_SYSTEM_TABLE
157 return EfiLibInstallDriverBindingComponentName2 (
160 &gUsbMouseDriverBinding
,
162 &gUsbMouseComponentName
,
163 &gUsbMouseComponentName2
169 Test to see if this driver supports ControllerHandle. Any ControllerHandle
170 that has UsbHcProtocol 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 Bus 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 EFI_OUT_OF_RESOURCES- Can't allocate memory
239 @retval EFI_ALREADY_STARTED Thios driver has been started
244 USBMouseDriverBindingStart (
245 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
246 IN EFI_HANDLE Controller
,
247 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
251 EFI_USB_IO_PROTOCOL
*UsbIo
;
252 EFI_USB_ENDPOINT_DESCRIPTOR
*EndpointDesc
;
253 USB_MOUSE_DEV
*UsbMouseDevice
;
254 UINT8 EndpointNumber
;
257 UINT8 PollingInterval
;
260 UsbMouseDevice
= NULL
;
261 Status
= EFI_SUCCESS
;
263 Status
= gBS
->OpenProtocol (
265 &gEfiUsbIoProtocolGuid
,
267 This
->DriverBindingHandle
,
269 EFI_OPEN_PROTOCOL_BY_DRIVER
271 if (EFI_ERROR (Status
)) {
275 UsbMouseDevice
= AllocateZeroPool (sizeof (USB_MOUSE_DEV
));
276 if (UsbMouseDevice
== NULL
) {
277 Status
= EFI_OUT_OF_RESOURCES
;
281 UsbMouseDevice
->UsbIo
= UsbIo
;
283 UsbMouseDevice
->Signature
= USB_MOUSE_DEV_SIGNATURE
;
285 UsbMouseDevice
->InterfaceDescriptor
= AllocatePool (sizeof (EFI_USB_INTERFACE_DESCRIPTOR
));
286 if (UsbMouseDevice
->InterfaceDescriptor
== NULL
) {
287 Status
= EFI_OUT_OF_RESOURCES
;
291 EndpointDesc
= AllocatePool (sizeof (EFI_USB_ENDPOINT_DESCRIPTOR
));
292 if (EndpointDesc
== NULL
) {
293 Status
= EFI_OUT_OF_RESOURCES
;
297 // Get the Device Path Protocol on Controller's handle
299 Status
= gBS
->OpenProtocol (
301 &gEfiDevicePathProtocolGuid
,
302 (VOID
**) &UsbMouseDevice
->DevicePath
,
303 This
->DriverBindingHandle
,
305 EFI_OPEN_PROTOCOL_GET_PROTOCOL
308 if (EFI_ERROR (Status
)) {
312 // Get interface & endpoint descriptor
314 UsbIo
->UsbGetInterfaceDescriptor (
316 UsbMouseDevice
->InterfaceDescriptor
319 EndpointNumber
= UsbMouseDevice
->InterfaceDescriptor
->NumEndpoints
;
321 for (Index
= 0; Index
< EndpointNumber
; Index
++) {
322 UsbIo
->UsbGetEndpointDescriptor (
328 if ((EndpointDesc
->Attributes
& 0x03) == 0x03) {
331 // We only care interrupt endpoint here
333 UsbMouseDevice
->IntEndpointDescriptor
= EndpointDesc
;
337 if (UsbMouseDevice
->IntEndpointDescriptor
== NULL
) {
339 // No interrupt endpoint, then error
341 Status
= EFI_UNSUPPORTED
;
345 Status
= InitializeUsbMouseDevice (UsbMouseDevice
);
346 if (EFI_ERROR (Status
)) {
347 MouseReportStatusCode (
348 UsbMouseDevice
->DevicePath
,
349 EFI_ERROR_CODE
| EFI_ERROR_MINOR
,
350 PcdGet32 (PcdStatusCodeValueMouseInterfaceError
)
356 UsbMouseDevice
->SimplePointerProtocol
.GetState
= GetMouseState
;
357 UsbMouseDevice
->SimplePointerProtocol
.Reset
= UsbMouseReset
;
358 UsbMouseDevice
->SimplePointerProtocol
.Mode
= &UsbMouseDevice
->Mode
;
360 Status
= gBS
->CreateEvent (
363 UsbMouseWaitForInput
,
365 &((UsbMouseDevice
->SimplePointerProtocol
).WaitForInput
)
367 if (EFI_ERROR (Status
)) {
371 Status
= gBS
->InstallProtocolInterface (
373 &gEfiSimplePointerProtocolGuid
,
374 EFI_NATIVE_INTERFACE
,
375 &UsbMouseDevice
->SimplePointerProtocol
378 if (EFI_ERROR (Status
)) {
379 Status
= EFI_DEVICE_ERROR
;
384 // After Enabling Async Interrupt Transfer on this mouse Device
385 // we will be able to get key data from it. Thus this is deemed as
386 // the enable action of the mouse
389 MouseReportStatusCode (
390 UsbMouseDevice
->DevicePath
,
392 PcdGet32 (PcdStatusCodeValueMouseEnable
)
396 // submit async interrupt transfer
398 EndpointAddr
= UsbMouseDevice
->IntEndpointDescriptor
->EndpointAddress
;
399 PollingInterval
= UsbMouseDevice
->IntEndpointDescriptor
->Interval
;
400 PacketSize
= (UINT8
) (UsbMouseDevice
->IntEndpointDescriptor
->MaxPacketSize
);
402 Status
= UsbIo
->UsbAsyncInterruptTransfer (
408 OnMouseInterruptComplete
,
412 if (!EFI_ERROR (Status
)) {
414 UsbMouseDevice
->ControllerNameTable
= NULL
;
417 gUsbMouseComponentName
.SupportedLanguages
,
418 &UsbMouseDevice
->ControllerNameTable
,
419 L
"Generic Usb Mouse",
424 gUsbMouseComponentName2
.SupportedLanguages
,
425 &UsbMouseDevice
->ControllerNameTable
,
426 L
"Generic Usb Mouse",
435 // If submit error, uninstall that interface
437 Status
= EFI_DEVICE_ERROR
;
438 gBS
->UninstallProtocolInterface (
440 &gEfiSimplePointerProtocolGuid
,
441 &UsbMouseDevice
->SimplePointerProtocol
445 if (EFI_ERROR (Status
)) {
448 &gEfiUsbIoProtocolGuid
,
449 This
->DriverBindingHandle
,
453 if (UsbMouseDevice
!= NULL
) {
454 if (UsbMouseDevice
->InterfaceDescriptor
!= NULL
) {
455 gBS
->FreePool (UsbMouseDevice
->InterfaceDescriptor
);
458 if (UsbMouseDevice
->IntEndpointDescriptor
!= NULL
) {
459 gBS
->FreePool (UsbMouseDevice
->IntEndpointDescriptor
);
462 if ((UsbMouseDevice
->SimplePointerProtocol
).WaitForInput
!= NULL
) {
463 gBS
->CloseEvent ((UsbMouseDevice
->SimplePointerProtocol
).WaitForInput
);
466 gBS
->FreePool (UsbMouseDevice
);
467 UsbMouseDevice
= NULL
;
476 Stop this driver on ControllerHandle. Support stoping any child handles
477 created by this driver.
479 @param This Protocol instance pointer.
480 @param Controller Handle of device to stop driver on
481 @param NumberOfChildren Number of Children in the ChildHandleBuffer
482 @param ChildHandleBuffer List of handles for the children we need to stop.
485 @return EFI_DEVICE_ERROR
491 USBMouseDriverBindingStop (
492 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
493 IN EFI_HANDLE Controller
,
494 IN UINTN NumberOfChildren
,
495 IN EFI_HANDLE
*ChildHandleBuffer
499 USB_MOUSE_DEV
*UsbMouseDevice
;
500 EFI_SIMPLE_POINTER_PROTOCOL
*SimplePointerProtocol
;
501 EFI_USB_IO_PROTOCOL
*UsbIo
;
504 // Get our context back.
506 Status
= gBS
->OpenProtocol (
508 &gEfiSimplePointerProtocolGuid
,
509 (VOID
**) &SimplePointerProtocol
,
510 This
->DriverBindingHandle
,
512 EFI_OPEN_PROTOCOL_GET_PROTOCOL
515 if (EFI_ERROR (Status
)) {
516 return EFI_UNSUPPORTED
;
519 UsbMouseDevice
= USB_MOUSE_DEV_FROM_MOUSE_PROTOCOL (SimplePointerProtocol
);
523 &gEfiSimplePointerProtocolGuid
,
524 This
->DriverBindingHandle
,
528 UsbIo
= UsbMouseDevice
->UsbIo
;
531 // Uninstall the Asyn Interrupt Transfer from this device
532 // will disable the mouse data input from this device
534 MouseReportStatusCode (
535 UsbMouseDevice
->DevicePath
,
537 PcdGet32 (PcdStatusCodeValueMouseDisable
)
541 // Delete Mouse Async Interrupt Transfer
543 UsbIo
->UsbAsyncInterruptTransfer (
545 UsbMouseDevice
->IntEndpointDescriptor
->EndpointAddress
,
547 UsbMouseDevice
->IntEndpointDescriptor
->Interval
,
553 gBS
->CloseEvent (UsbMouseDevice
->SimplePointerProtocol
.WaitForInput
);
555 if (UsbMouseDevice
->DelayedRecoveryEvent
) {
556 gBS
->CloseEvent (UsbMouseDevice
->DelayedRecoveryEvent
);
557 UsbMouseDevice
->DelayedRecoveryEvent
= 0;
560 Status
= gBS
->UninstallProtocolInterface (
562 &gEfiSimplePointerProtocolGuid
,
563 &UsbMouseDevice
->SimplePointerProtocol
565 if (EFI_ERROR (Status
)) {
571 &gEfiUsbIoProtocolGuid
,
572 This
->DriverBindingHandle
,
576 gBS
->FreePool (UsbMouseDevice
->InterfaceDescriptor
);
577 gBS
->FreePool (UsbMouseDevice
->IntEndpointDescriptor
);
579 if (UsbMouseDevice
->ControllerNameTable
) {
580 FreeUnicodeStringTable (UsbMouseDevice
->ControllerNameTable
);
583 gBS
->FreePool (UsbMouseDevice
);
591 Tell if a Usb Controller is a mouse
593 @param UsbIo Protocol instance pointer.
595 @retval TRUE It is a mouse
596 @retval FALSE It is not a mouse
601 IN EFI_USB_IO_PROTOCOL
*UsbIo
605 EFI_USB_INTERFACE_DESCRIPTOR InterfaceDescriptor
;
608 // Get the Default interface descriptor, now we only
609 // suppose it is interface 1
611 Status
= UsbIo
->UsbGetInterfaceDescriptor (
616 if (EFI_ERROR (Status
)) {
620 if ((InterfaceDescriptor
.InterfaceClass
== CLASS_HID
) &&
621 (InterfaceDescriptor
.InterfaceSubClass
== SUBCLASS_BOOT
) &&
622 (InterfaceDescriptor
.InterfaceProtocol
== PROTOCOL_MOUSE
)
632 Initialize the Usb Mouse Device.
634 @param UsbMouseDev Device instance to be initialized
636 @retval EFI_SUCCESS Success
637 @retval EFI_DEVICE_ERROR Init error. EFI_OUT_OF_RESOURCES- Can't allocate
643 InitializeUsbMouseDevice (
644 IN USB_MOUSE_DEV
*UsbMouseDev
647 EFI_USB_IO_PROTOCOL
*UsbIo
;
650 EFI_USB_HID_DESCRIPTOR MouseHidDesc
;
653 UsbIo
= UsbMouseDev
->UsbIo
;
656 // Get HID descriptor
658 Status
= UsbGetHidDescriptor (
660 UsbMouseDev
->InterfaceDescriptor
->InterfaceNumber
,
664 if (EFI_ERROR (Status
)) {
669 // Get Report descriptor
671 if (MouseHidDesc
.HidClassDesc
[0].DescriptorType
!= 0x22) {
672 return EFI_UNSUPPORTED
;
675 ReportDesc
= AllocateZeroPool (MouseHidDesc
.HidClassDesc
[0].DescriptorLength
);
676 if (ReportDesc
== NULL
) {
677 return EFI_OUT_OF_RESOURCES
;
680 Status
= UsbGetReportDescriptor (
682 UsbMouseDev
->InterfaceDescriptor
->InterfaceNumber
,
683 MouseHidDesc
.HidClassDesc
[0].DescriptorLength
,
687 if (EFI_ERROR (Status
)) {
688 gBS
->FreePool (ReportDesc
);
693 // Parse report descriptor
695 Status
= ParseMouseReportDescriptor (
698 MouseHidDesc
.HidClassDesc
[0].DescriptorLength
701 if (EFI_ERROR (Status
)) {
702 gBS
->FreePool (ReportDesc
);
706 if (UsbMouseDev
->NumberOfButtons
>= 1) {
707 UsbMouseDev
->Mode
.LeftButton
= TRUE
;
710 if (UsbMouseDev
->NumberOfButtons
> 1) {
711 UsbMouseDev
->Mode
.RightButton
= TRUE
;
714 UsbMouseDev
->Mode
.ResolutionX
= 8;
715 UsbMouseDev
->Mode
.ResolutionY
= 8;
716 UsbMouseDev
->Mode
.ResolutionZ
= 0;
718 // Here we just assume interface 0 is the mouse interface
720 UsbGetProtocolRequest (
726 if (Protocol
!= BOOT_PROTOCOL
) {
727 Status
= UsbSetProtocolRequest (
733 if (EFI_ERROR (Status
)) {
734 gBS
->FreePool (ReportDesc
);
735 return EFI_DEVICE_ERROR
;
740 // Set indefinite Idle rate for USB Mouse
749 gBS
->FreePool (ReportDesc
);
751 if (UsbMouseDev
->DelayedRecoveryEvent
) {
752 gBS
->CloseEvent (UsbMouseDev
->DelayedRecoveryEvent
);
753 UsbMouseDev
->DelayedRecoveryEvent
= 0;
756 Status
= gBS
->CreateEvent (
757 EVT_TIMER
| EVT_NOTIFY_SIGNAL
,
759 USBMouseRecoveryHandler
,
761 &UsbMouseDev
->DelayedRecoveryEvent
769 It is called whenever there is data received from async interrupt
772 @param Data Data received.
773 @param DataLength Length of Data
774 @param Context Passed in context
775 @param Result Async Interrupt Transfer result
778 @return EFI_DEVICE_ERROR
784 OnMouseInterruptComplete (
791 USB_MOUSE_DEV
*UsbMouseDevice
;
792 EFI_USB_IO_PROTOCOL
*UsbIo
;
796 UsbMouseDevice
= (USB_MOUSE_DEV
*) Context
;
797 UsbIo
= UsbMouseDevice
->UsbIo
;
799 if (Result
!= EFI_USB_NOERROR
) {
801 // Some errors happen during the process
803 MouseReportStatusCode (
804 UsbMouseDevice
->DevicePath
,
805 EFI_ERROR_CODE
| EFI_ERROR_MINOR
,
806 PcdGet32 (PcdStatusCodeValueMouseInputError
)
809 if ((Result
& EFI_USB_ERR_STALL
) == EFI_USB_ERR_STALL
) {
810 EndpointAddr
= UsbMouseDevice
->IntEndpointDescriptor
->EndpointAddress
;
812 UsbClearEndpointHalt (
819 UsbIo
->UsbAsyncInterruptTransfer (
821 UsbMouseDevice
->IntEndpointDescriptor
->EndpointAddress
,
830 UsbMouseDevice
->DelayedRecoveryEvent
,
832 EFI_USB_INTERRUPT_DELAY
834 return EFI_DEVICE_ERROR
;
837 if (DataLength
== 0 || Data
== NULL
) {
841 UsbMouseDevice
->StateChanged
= TRUE
;
846 UsbMouseDevice
->State
.LeftButton
= (BOOLEAN
) (*(UINT8
*) Data
& 0x01);
847 UsbMouseDevice
->State
.RightButton
= (BOOLEAN
) (*(UINT8
*) Data
& 0x02);
848 UsbMouseDevice
->State
.RelativeMovementX
+= *((INT8
*) Data
+ 1);
849 UsbMouseDevice
->State
.RelativeMovementY
+= *((INT8
*) Data
+ 2);
851 if (DataLength
> 3) {
852 UsbMouseDevice
->State
.RelativeMovementZ
+= *((INT8
*) Data
+ 3);
861 IN EFI_MOUSE_STATE *MouseState
864 Aprint("(%x: %x, %x)\n",
865 MouseState->ButtonStates,
873 Get the mouse state, see SIMPLE POINTER PROTOCOL.
875 @param This Protocol instance pointer.
876 @param MouseState Current mouse state
879 @return EFI_DEVICE_ERROR
880 @return EFI_NOT_READY
887 IN EFI_SIMPLE_POINTER_PROTOCOL
*This
,
888 OUT EFI_SIMPLE_POINTER_STATE
*MouseState
891 USB_MOUSE_DEV
*MouseDev
;
893 if (MouseState
== NULL
) {
894 return EFI_DEVICE_ERROR
;
897 MouseDev
= USB_MOUSE_DEV_FROM_MOUSE_PROTOCOL (This
);
899 if (!MouseDev
->StateChanged
) {
900 return EFI_NOT_READY
;
906 sizeof (EFI_SIMPLE_POINTER_STATE
)
910 // Clear previous move state
912 MouseDev
->State
.RelativeMovementX
= 0;
913 MouseDev
->State
.RelativeMovementY
= 0;
914 MouseDev
->State
.RelativeMovementZ
= 0;
916 MouseDev
->StateChanged
= FALSE
;
923 Reset the mouse device, see SIMPLE POINTER PROTOCOL.
925 @param This Protocol instance pointer.
926 @param ExtendedVerification Ignored here/
935 IN EFI_SIMPLE_POINTER_PROTOCOL
*This
,
936 IN BOOLEAN ExtendedVerification
939 USB_MOUSE_DEV
*UsbMouseDevice
;
941 UsbMouseDevice
= USB_MOUSE_DEV_FROM_MOUSE_PROTOCOL (This
);
943 MouseReportStatusCode (
944 UsbMouseDevice
->DevicePath
,
946 PcdGet32 (PcdStatusCodeValueMouseReset
)
951 &UsbMouseDevice
->State
,
952 sizeof (EFI_SIMPLE_POINTER_STATE
)
954 UsbMouseDevice
->StateChanged
= FALSE
;
961 Event notification function for SIMPLE_POINTER.WaitForInput event
962 Signal the event if there is input from mouse
964 @param Event Wait Event
965 @param Context Passed parameter to event handler
972 UsbMouseWaitForInput (
977 USB_MOUSE_DEV
*UsbMouseDev
;
979 UsbMouseDev
= (USB_MOUSE_DEV
*) Context
;
982 // Someone is waiting on the mouse event, if there's
983 // input from mouse, signal the event
985 if (UsbMouseDev
->StateChanged
) {
986 gBS
->SignalEvent (Event
);
992 Timer handler for Delayed Recovery timer.
994 @param Event The Delayed Recovery event.
995 @param Context Points to the USB_KB_DEV instance.
1001 USBMouseRecoveryHandler (
1006 USB_MOUSE_DEV
*UsbMouseDev
;
1007 EFI_USB_IO_PROTOCOL
*UsbIo
;
1009 UsbMouseDev
= (USB_MOUSE_DEV
*) Context
;
1011 UsbIo
= UsbMouseDev
->UsbIo
;
1013 UsbIo
->UsbAsyncInterruptTransfer (
1015 UsbMouseDev
->IntEndpointDescriptor
->EndpointAddress
,
1017 UsbMouseDev
->IntEndpointDescriptor
->Interval
,
1018 UsbMouseDev
->IntEndpointDescriptor
->MaxPacketSize
,
1019 OnMouseInterruptComplete
,
1026 Report Status Code in Usb Bot Driver
1028 @param DevicePath Use this to get Device Path
1029 @param CodeType Status Code Type
1030 @param CodeValue Status Code Value
1036 MouseReportStatusCode (
1037 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
1038 IN EFI_STATUS_CODE_TYPE CodeType
,
1039 IN EFI_STATUS_CODE_VALUE Value
1042 REPORT_STATUS_CODE_WITH_DEVICE_PATH (