]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.c
Replace references to RFC 3066 with RFC 4646.
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Isa / Ps2MouseDxe / Ps2Mouse.c
1 /**@file
2 PS/2 Mouse driver. Routines that interacts with callers,
3 conforming to EFI driver model
4
5 Copyright (c) 2006 - 2007, 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
10
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.
13
14 **/
15
16 #include "Ps2Mouse.h"
17 #include "CommPs2.h"
18
19 //
20 // DriverBinding Protocol Instance
21 //
22 EFI_DRIVER_BINDING_PROTOCOL gPS2MouseDriver = {
23 PS2MouseDriverSupported,
24 PS2MouseDriverStart,
25 PS2MouseDriverStop,
26 0xa,
27 NULL,
28 NULL
29 };
30
31 /**
32 Test to see if this driver supports ControllerHandle. Any ControllerHandle
33 than contains a IsaIo protocol can be supported.
34
35 @param This Protocol instance pointer.
36 @param ControllerHandle Handle of device to test
37 @param RemainingDevicePath Optional parameter use to pick a specific child
38 device to start.
39
40 @retval EFI_SUCCESS This driver supports this device
41 @retval EFI_ALREADY_STARTED This driver is already running on this device
42 @retval other This driver does not support this device
43
44 **/
45 EFI_STATUS
46 EFIAPI
47 PS2MouseDriverSupported (
48 IN EFI_DRIVER_BINDING_PROTOCOL *This,
49 IN EFI_HANDLE Controller,
50 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
51 )
52 {
53 EFI_STATUS Status;
54 EFI_ISA_IO_PROTOCOL *IsaIo;
55
56 Status = EFI_SUCCESS;
57
58 //
59 // Open the IO Abstraction(s) needed to perform the supported test
60 //
61 Status = gBS->OpenProtocol (
62 Controller,
63 &gEfiIsaIoProtocolGuid,
64 (VOID **) &IsaIo,
65 This->DriverBindingHandle,
66 Controller,
67 EFI_OPEN_PROTOCOL_BY_DRIVER
68 );
69 if (EFI_ERROR (Status)) {
70 return Status;
71 }
72 //
73 // Use the ISA I/O Protocol to see if Controller is the Keyboard controller
74 //
75 switch (IsaIo->ResourceList->Device.HID) {
76 case EISA_PNP_ID (0xF03):
77 //
78 // Microsoft PS/2 style mouse
79 //
80 case EISA_PNP_ID (0xF13):
81 //
82 // PS/2 Port for PS/2-style Mice
83 //
84 break;
85
86 case EISA_PNP_ID (0x303):
87 //
88 // IBM Enhanced (101/102-key, PS/2 mouse support)
89 //
90 if (IsaIo->ResourceList->Device.UID == 1) {
91 break;
92 }
93
94 default:
95 Status = EFI_UNSUPPORTED;
96 break;
97 }
98 //
99 // Close the I/O Abstraction(s) used to perform the supported test
100 //
101 gBS->CloseProtocol (
102 Controller,
103 &gEfiIsaIoProtocolGuid,
104 This->DriverBindingHandle,
105 Controller
106 );
107
108 return Status;
109 }
110
111 /**
112 Start this driver on ControllerHandle by opening a IsaIo
113 protocol, creating PS2_MOUSE_ABSOLUTE_POINTER_DEV device and install gEfiAbsolutePointerProtocolGuid
114 finnally.
115
116 @param This Protocol instance pointer.
117 @param ControllerHandle Handle of device to bind driver to
118 @param RemainingDevicePath Optional parameter use to pick a specific child
119 device to start.
120
121 @retval EFI_SUCCESS This driver is added to ControllerHandle
122 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
123 @retval other This driver does not support this device
124
125 **/
126 EFI_STATUS
127 EFIAPI
128 PS2MouseDriverStart (
129 IN EFI_DRIVER_BINDING_PROTOCOL *This,
130 IN EFI_HANDLE Controller,
131 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
132 )
133 {
134 EFI_STATUS Status;
135 EFI_STATUS EmptyStatus;
136 EFI_ISA_IO_PROTOCOL *IsaIo;
137 PS2_MOUSE_DEV *MouseDev;
138 UINT8 Data;
139 EFI_TPL OldTpl;
140 EFI_STATUS_CODE_VALUE StatusCode;
141 EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
142
143 StatusCode = 0;
144 MouseDev = NULL;
145 IsaIo = NULL;
146
147 //
148 // Open the device path protocol
149 //
150 Status = gBS->OpenProtocol (
151 Controller,
152 &gEfiDevicePathProtocolGuid,
153 (VOID **) &ParentDevicePath,
154 This->DriverBindingHandle,
155 Controller,
156 EFI_OPEN_PROTOCOL_BY_DRIVER
157 );
158 if (EFI_ERROR (Status)) {
159 return Status;
160 }
161 //
162 // Report that the keyboard is being enabled
163 //
164 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
165 EFI_PROGRESS_CODE,
166 EFI_PERIPHERAL_MOUSE | EFI_P_PC_ENABLE,
167 ParentDevicePath
168 );
169
170 //
171 // Get the ISA I/O Protocol on Controller's handle
172 //
173 Status = gBS->OpenProtocol (
174 Controller,
175 &gEfiIsaIoProtocolGuid,
176 (VOID **) &IsaIo,
177 This->DriverBindingHandle,
178 Controller,
179 EFI_OPEN_PROTOCOL_BY_DRIVER
180 );
181 if (EFI_ERROR (Status)) {
182 gBS->CloseProtocol (
183 Controller,
184 &gEfiDevicePathProtocolGuid,
185 This->DriverBindingHandle,
186 Controller
187 );
188 return EFI_INVALID_PARAMETER;
189 }
190 //
191 // Raise TPL to avoid keyboard operation impact
192 //
193 OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
194
195 //
196 // Allocate private data
197 //
198 MouseDev = AllocateZeroPool (sizeof (PS2_MOUSE_DEV));
199 if (MouseDev == NULL) {
200 Status = EFI_OUT_OF_RESOURCES;
201 goto ErrorExit;
202 }
203 //
204 // Setup the device instance
205 //
206 MouseDev->Signature = PS2_MOUSE_DEV_SIGNATURE;
207 MouseDev->Handle = Controller;
208 MouseDev->SampleRate = SSR_20;
209 MouseDev->Resolution = CMR4;
210 MouseDev->Scaling = SF1;
211 MouseDev->DataPackageSize = 3;
212 MouseDev->IsaIo = IsaIo;
213 MouseDev->DevicePath = ParentDevicePath;
214
215 //
216 // Resolution = 4 counts/mm
217 //
218 MouseDev->Mode.ResolutionX = 4;
219 MouseDev->Mode.ResolutionY = 4;
220 MouseDev->Mode.LeftButton = TRUE;
221 MouseDev->Mode.RightButton = TRUE;
222
223 MouseDev->SimplePointerProtocol.Reset = MouseReset;
224 MouseDev->SimplePointerProtocol.GetState = MouseGetState;
225 MouseDev->SimplePointerProtocol.Mode = &(MouseDev->Mode);
226
227 //
228 // Initialize keyboard controller if necessary
229 //
230 IsaIo->Io.Read (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Data);
231 if ((Data & KBC_SYSF) != KBC_SYSF) {
232 Status = KbcSelfTest (IsaIo);
233 if (EFI_ERROR (Status)) {
234 StatusCode = EFI_PERIPHERAL_MOUSE | EFI_P_EC_CONTROLLER_ERROR;
235 goto ErrorExit;
236 }
237 }
238
239 KbcEnableAux (IsaIo);
240
241 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
242 EFI_PROGRESS_CODE,
243 EFI_PERIPHERAL_MOUSE | EFI_P_PC_PRESENCE_DETECT,
244 ParentDevicePath
245 );
246
247 //
248 // Reset the mouse
249 //
250 Status = MouseDev->SimplePointerProtocol.Reset (&MouseDev->SimplePointerProtocol, TRUE);
251 if (EFI_ERROR (Status)) {
252 //
253 // mouse not connected
254 //
255 Status = EFI_SUCCESS;
256 StatusCode = EFI_PERIPHERAL_MOUSE | EFI_P_EC_NOT_DETECTED;
257 goto ErrorExit;
258 }
259 //
260 // Setup the WaitForKey event
261 //
262 Status = gBS->CreateEvent (
263 EVT_NOTIFY_WAIT,
264 TPL_NOTIFY,
265 MouseWaitForInput,
266 MouseDev,
267 &((MouseDev->SimplePointerProtocol).WaitForInput)
268 );
269 if (EFI_ERROR (Status)) {
270 Status = EFI_OUT_OF_RESOURCES;
271 goto ErrorExit;
272 }
273 //
274 // Setup a periodic timer, used to poll mouse state
275 //
276 Status = gBS->CreateEvent (
277 EVT_TIMER | EVT_NOTIFY_SIGNAL,
278 TPL_NOTIFY,
279 PollMouse,
280 MouseDev,
281 &MouseDev->TimerEvent
282 );
283 if (EFI_ERROR (Status)) {
284 Status = EFI_OUT_OF_RESOURCES;
285 goto ErrorExit;
286 }
287 //
288 // Start timer to poll mouse (100 samples per second)
289 //
290 Status = gBS->SetTimer (MouseDev->TimerEvent, TimerPeriodic, 100000);
291 if (EFI_ERROR (Status)) {
292 Status = EFI_OUT_OF_RESOURCES;
293 goto ErrorExit;
294 }
295
296 MouseDev->ControllerNameTable = NULL;
297 AddUnicodeString2 (
298 "eng",
299 gPs2MouseComponentName.SupportedLanguages,
300 &MouseDev->ControllerNameTable,
301 L"PS/2 Mouse Device",
302 TRUE
303 );
304 AddUnicodeString2 (
305 "en",
306 gPs2MouseComponentName2.SupportedLanguages,
307 &MouseDev->ControllerNameTable,
308 L"PS/2 Mouse Device",
309 FALSE
310 );
311
312
313 //
314 // Install protocol interfaces for the mouse device.
315 //
316 Status = gBS->InstallMultipleProtocolInterfaces (
317 &Controller,
318 &gEfiSimplePointerProtocolGuid,
319 &MouseDev->SimplePointerProtocol,
320 NULL
321 );
322 if (EFI_ERROR (Status)) {
323 goto ErrorExit;
324 }
325
326 gBS->RestoreTPL (OldTpl);
327
328 return Status;
329
330 ErrorExit:
331
332 KbcDisableAux (IsaIo);
333
334 if (StatusCode != 0) {
335 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
336 EFI_ERROR_CODE | EFI_ERROR_MINOR,
337 StatusCode,
338 ParentDevicePath
339 );
340 }
341
342 if ((MouseDev != NULL) && (MouseDev->SimplePointerProtocol.WaitForInput != NULL)) {
343 gBS->CloseEvent (MouseDev->SimplePointerProtocol.WaitForInput);
344 }
345
346 if ((MouseDev != NULL) && (MouseDev->TimerEvent != NULL)) {
347 gBS->CloseEvent (MouseDev->TimerEvent);
348 }
349
350 if ((MouseDev != NULL) && (MouseDev->ControllerNameTable != NULL)) {
351 FreeUnicodeStringTable (MouseDev->ControllerNameTable);
352 }
353 //
354 // Since there will be no timer handler for mouse input any more,
355 // exhaust input data just in case there is still mouse data left
356 //
357 EmptyStatus = EFI_SUCCESS;
358 while (!EFI_ERROR (EmptyStatus)) {
359 EmptyStatus = In8042Data (IsaIo, &Data);
360 }
361
362 if (MouseDev != NULL) {
363 gBS->FreePool (MouseDev);
364 }
365
366 gBS->CloseProtocol (
367 Controller,
368 &gEfiDevicePathProtocolGuid,
369 This->DriverBindingHandle,
370 Controller
371 );
372
373 gBS->CloseProtocol (
374 Controller,
375 &gEfiIsaIoProtocolGuid,
376 This->DriverBindingHandle,
377 Controller
378 );
379
380 gBS->RestoreTPL (OldTpl);
381
382 return Status;
383 }
384
385 /**
386 Stop this driver on ControllerHandle. Support stoping any child handles
387 created by this driver.
388
389 @param This Protocol instance pointer.
390 @param ControllerHandle Handle of device to stop driver on
391 @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
392 children is zero stop the entire bus driver.
393 @param ChildHandleBuffer List of Child Handles to Stop.
394
395 @retval EFI_SUCCESS This driver is removed ControllerHandle
396 @retval other This driver was not removed from this device
397
398 **/
399 EFI_STATUS
400 EFIAPI
401 PS2MouseDriverStop (
402 IN EFI_DRIVER_BINDING_PROTOCOL *This,
403 IN EFI_HANDLE Controller,
404 IN UINTN NumberOfChildren,
405 IN EFI_HANDLE *ChildHandleBuffer
406 )
407 {
408 EFI_STATUS Status;
409 EFI_SIMPLE_POINTER_PROTOCOL *SimplePointerProtocol;
410 PS2_MOUSE_DEV *MouseDev;
411 UINT8 Data;
412
413 Status = gBS->OpenProtocol (
414 Controller,
415 &gEfiSimplePointerProtocolGuid,
416 (VOID **) &SimplePointerProtocol,
417 This->DriverBindingHandle,
418 Controller,
419 EFI_OPEN_PROTOCOL_GET_PROTOCOL
420 );
421 if (EFI_ERROR (Status)) {
422 return EFI_SUCCESS;
423 }
424
425 MouseDev = PS2_MOUSE_DEV_FROM_THIS (SimplePointerProtocol);
426
427 //
428 // Report that the keyboard is being disabled
429 //
430 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
431 EFI_PROGRESS_CODE,
432 EFI_PERIPHERAL_MOUSE | EFI_P_PC_DISABLE,
433 MouseDev->DevicePath
434 );
435
436 Status = gBS->UninstallProtocolInterface (
437 Controller,
438 &gEfiSimplePointerProtocolGuid,
439 &MouseDev->SimplePointerProtocol
440 );
441 if (EFI_ERROR (Status)) {
442 return Status;
443 }
444 //
445 // Disable mouse on keyboard controller
446 //
447 KbcDisableAux (MouseDev->IsaIo);
448
449 //
450 // Cancel mouse data polling timer, close timer event
451 //
452 gBS->SetTimer (MouseDev->TimerEvent, TimerCancel, 0);
453 gBS->CloseEvent (MouseDev->TimerEvent);
454
455 //
456 // Since there will be no timer handler for mouse input any more,
457 // exhaust input data just in case there is still mouse data left
458 //
459 Status = EFI_SUCCESS;
460 while (!EFI_ERROR (Status)) {
461 Status = In8042Data (MouseDev->IsaIo, &Data);
462 }
463
464 gBS->CloseEvent (MouseDev->SimplePointerProtocol.WaitForInput);
465 FreeUnicodeStringTable (MouseDev->ControllerNameTable);
466 gBS->FreePool (MouseDev);
467
468 gBS->CloseProtocol (
469 Controller,
470 &gEfiDevicePathProtocolGuid,
471 This->DriverBindingHandle,
472 Controller
473 );
474
475 gBS->CloseProtocol (
476 Controller,
477 &gEfiIsaIoProtocolGuid,
478 This->DriverBindingHandle,
479 Controller
480 );
481
482 return EFI_SUCCESS;
483 }
484
485 /**
486 Reset the Mouse and do BAT test for it, if ExtendedVerification isTRUE and there is a mouse device connectted to system
487
488 @param This - Pointer of simple pointer Protocol.
489 @param ExtendedVerification - Whether configure mouse parameters. True: do; FALSE: skip.
490
491
492 @retval EFI_SUCCESS - The command byte is written successfully.
493 @retval EFI_DEVICE_ERROR - Errors occurred during reseting keyboard.
494
495 **/
496 EFI_STATUS
497 EFIAPI
498 MouseReset (
499 IN EFI_SIMPLE_POINTER_PROTOCOL *This,
500 IN BOOLEAN ExtendedVerification
501 )
502 {
503 EFI_STATUS Status;
504 PS2_MOUSE_DEV *MouseDev;
505 EFI_TPL OldTpl;
506 BOOLEAN KeyboardEnable;
507 UINT8 Data;
508
509 MouseDev = PS2_MOUSE_DEV_FROM_THIS (This);
510
511 //
512 // Report reset progress code
513 //
514 REPORT_STATUS_CODE_WITH_DEVICE_PATH (
515 EFI_PROGRESS_CODE,
516 EFI_PERIPHERAL_MOUSE | EFI_P_PC_RESET,
517 MouseDev->DevicePath
518 );
519
520 KeyboardEnable = FALSE;
521
522 //
523 // Raise TPL to avoid keyboard operation impact
524 //
525 OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
526
527 ZeroMem (&MouseDev->State, sizeof (EFI_SIMPLE_POINTER_STATE));
528 MouseDev->StateChanged = FALSE;
529
530 //
531 // Exhaust input data
532 //
533 Status = EFI_SUCCESS;
534 while (!EFI_ERROR (Status)) {
535 Status = In8042Data (MouseDev->IsaIo, &Data);
536 }
537
538 CheckKbStatus (MouseDev->IsaIo, &KeyboardEnable);
539
540 KbcDisableKb (MouseDev->IsaIo);
541
542 MouseDev->IsaIo->Io.Read (MouseDev->IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Data);
543
544 //
545 // if there's data block on KBC data port, read it out
546 //
547 if ((Data & KBC_OUTB) == KBC_OUTB) {
548 MouseDev->IsaIo->Io.Read (MouseDev->IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, &Data);
549 }
550
551 Status = EFI_SUCCESS;
552 //
553 // The PS2 mouse driver reset behavior is always successfully return no matter wheater or not there is mouse connected to system.
554 // This behavior is needed by performance speed. The following mouse command only succeessfully finish when mouse device is
555 // connected to system, so if PS2 mouse device not connect to system or user not ask for, we skip the mouse configuration and enabling
556 //
557 if (ExtendedVerification && CheckMouseConnect (MouseDev)) {
558 //
559 // Send mouse reset command and set mouse default configure
560 //
561 Status = PS2MouseReset (MouseDev->IsaIo);
562 if (EFI_ERROR (Status)) {
563 Status = EFI_DEVICE_ERROR;
564 goto Exit;
565 }
566
567 Status = PS2MouseSetSampleRate (MouseDev->IsaIo, MouseDev->SampleRate);
568 if (EFI_ERROR (Status)) {
569 Status = EFI_DEVICE_ERROR;
570 goto Exit;
571 }
572
573 Status = PS2MouseSetResolution (MouseDev->IsaIo, MouseDev->Resolution);
574 if (EFI_ERROR (Status)) {
575 Status = EFI_DEVICE_ERROR;
576 goto Exit;
577 }
578
579 Status = PS2MouseSetScaling (MouseDev->IsaIo, MouseDev->Scaling);
580 if (EFI_ERROR (Status)) {
581 Status = EFI_DEVICE_ERROR;
582 goto Exit;
583 }
584
585 Status = PS2MouseEnable (MouseDev->IsaIo);
586 if (EFI_ERROR (Status)) {
587 Status = EFI_DEVICE_ERROR;
588 goto Exit;
589 }
590 }
591 Exit:
592 gBS->RestoreTPL (OldTpl);
593
594 if (KeyboardEnable) {
595 KbcEnableKb (MouseDev->IsaIo);
596 }
597
598 return Status;
599 }
600
601 /**
602 Check whether there is Ps/2 mouse device in system
603
604 @param PS2_MOUSE_DEV - Mouse Private Data Structure
605
606 @retval TRUE - Keyboard in System.
607 @retval FALSE - Keyboard not in System.
608
609 **/
610 BOOLEAN
611 CheckMouseConnect (
612 IN PS2_MOUSE_DEV *MouseDev
613 )
614
615 {
616 EFI_STATUS Status;
617
618 Status = PS2MouseEnable (MouseDev->IsaIo);
619 if (!EFI_ERROR (Status)) {
620 return TRUE;
621 }
622
623 return FALSE;
624 }
625
626 /**
627 Get and Clear mouse status.
628
629 @param This - Pointer of simple pointer Protocol.
630 @param State - Output buffer holding status.
631
632 @retval EFI_INVALID_PARAMETER Output buffer is invalid.
633 @retval EFI_NOT_READY Mouse is not changed status yet.
634 @retval EFI_SUCCESS Mouse status is changed and get successful.
635 **/
636 EFI_STATUS
637 EFIAPI
638 MouseGetState (
639 IN EFI_SIMPLE_POINTER_PROTOCOL *This,
640 IN OUT EFI_SIMPLE_POINTER_STATE *State
641 )
642 {
643 PS2_MOUSE_DEV *MouseDev;
644 EFI_TPL OldTpl;
645
646 MouseDev = PS2_MOUSE_DEV_FROM_THIS (This);
647
648 if (State == NULL) {
649 return EFI_INVALID_PARAMETER;
650 }
651
652 if (!MouseDev->StateChanged) {
653 return EFI_NOT_READY;
654 }
655
656 OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
657 CopyMem (State, &(MouseDev->State), sizeof (EFI_SIMPLE_POINTER_STATE));
658
659 //
660 // clear mouse state
661 //
662 MouseDev->State.RelativeMovementX = 0;
663 MouseDev->State.RelativeMovementY = 0;
664 MouseDev->State.RelativeMovementZ = 0;
665 MouseDev->StateChanged = FALSE;
666 gBS->RestoreTPL (OldTpl);
667
668 return EFI_SUCCESS;
669 }
670
671 /**
672
673 Event notification function for SIMPLE_POINTER.WaitForInput event
674 Signal the event if there is input from mouse
675
676 @param Event event object
677 @param Context event context
678
679 **/
680
681 VOID
682 EFIAPI
683 MouseWaitForInput (
684 IN EFI_EVENT Event,
685 IN VOID *Context
686 )
687 // GC_TODO: Event - add argument and description to function comment
688 // GC_TODO: Context - add argument and description to function comment
689 {
690 PS2_MOUSE_DEV *MouseDev;
691
692 MouseDev = (PS2_MOUSE_DEV *) Context;
693
694 //
695 // Someone is waiting on the mouse event, if there's
696 // input from mouse, signal the event
697 //
698 if (MouseDev->StateChanged) {
699 gBS->SignalEvent (Event);
700 }
701
702 }
703
704 /**
705 Event notification function for TimerEvent event
706 If mouse device is connected to system, try to get the mouse packet data
707
708 @param Event - TimerEvent in PS2_MOUSE_DEV
709 @param Context - Pointer to PS2_MOUSE_DEV structure
710
711 **/
712 VOID
713 EFIAPI
714 PollMouse (
715 IN EFI_EVENT Event,
716 IN VOID *Context
717 )
718
719 {
720 PS2_MOUSE_DEV *MouseDev;
721
722 MouseDev = (PS2_MOUSE_DEV *) Context;
723
724 //
725 // Polling mouse packet data
726 //
727 PS2MouseGetPacket (MouseDev);
728 }
729
730 /**
731 The user Entry Point for module Ps2Mouse. The user code starts with this function.
732
733 @param[in] ImageHandle The firmware allocated handle for the EFI image.
734 @param[in] SystemTable A pointer to the EFI System Table.
735
736 @retval EFI_SUCCESS The entry point is executed successfully.
737 @retval other Some error occurs when executing this entry point.
738
739 **/
740 EFI_STATUS
741 EFIAPI
742 InitializePs2Mouse(
743 IN EFI_HANDLE ImageHandle,
744 IN EFI_SYSTEM_TABLE *SystemTable
745 )
746 {
747 EFI_STATUS Status;
748
749 //
750 // Install driver model protocol(s).
751 //
752 Status = EfiLibInstallDriverBindingComponentName2 (
753 ImageHandle,
754 SystemTable,
755 &gPS2MouseDriver,
756 ImageHandle,
757 &gPs2MouseComponentName,
758 &gPs2MouseComponentName2
759 );
760 ASSERT_EFI_ERROR (Status);
761
762
763 return Status;
764 }
765