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