+++ /dev/null
-/**@file\r
- PS2 Mouse Communication Interface \r
- \r
-Copyright (c) 2006 - 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "Ps2MouseAbsolutePointer.h"\r
-#include "CommPs2.h"\r
-\r
-UINT8 SampleRateTbl[MAX_SR] = { 0xa, 0x14, 0x28, 0x3c, 0x50, 0x64, 0xc8 };\r
-\r
-UINT8 ResolutionTbl[MAX_CMR] = { 0, 1, 2, 3 };\r
-\r
-EFI_STATUS\r
-KbcSelfTest (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- EFI_DEVICE_ERROR - GC_TODO: Add description for return value\r
- EFI_SUCCESS - GC_TODO: Add description for return value\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
- UINT8 Data;\r
-\r
- //\r
- // Keyboard controller self test\r
- //\r
- Status = Out8042Command (IsaIo, SELF_TEST);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
- //\r
- // Read return code\r
- //\r
- Status = In8042Data (IsaIo, &Data);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- if (Data != 0x55) {\r
- return EFI_DEVICE_ERROR;\r
- }\r
- //\r
- // Set system flag\r
- //\r
- Status = Out8042Command (IsaIo, READ_CMD_BYTE);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- Status = In8042Data (IsaIo, &Data);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- Status = Out8042Command (IsaIo, WRITE_CMD_BYTE);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- Data |= CMD_SYS_FLAG;\r
- Status = Out8042Data (IsaIo, Data);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-KbcEnableAux (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-{\r
- //\r
- // Send 8042 enable mouse command\r
- //\r
- return Out8042Command (IsaIo, ENABLE_AUX);\r
-}\r
-\r
-EFI_STATUS\r
-KbcDisableAux (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-{\r
- //\r
- // Send 8042 disable mouse command\r
- //\r
- return Out8042Command (IsaIo, DISABLE_AUX);\r
-}\r
-\r
-EFI_STATUS\r
-KbcEnableKb (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-{\r
- //\r
- // Send 8042 enable keyboard command\r
- //\r
- return Out8042Command (IsaIo, ENABLE_KB);\r
-}\r
-\r
-EFI_STATUS\r
-KbcDisableKb (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-{\r
- //\r
- // Send 8042 disable keyboard command\r
- //\r
- return Out8042Command (IsaIo, DISABLE_KB);\r
-}\r
-\r
-EFI_STATUS\r
-CheckKbStatus (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- OUT BOOLEAN *KeyboardEnable\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
- KeyboardEnable - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - GC_TODO: Add description for return value\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
- UINT8 Data;\r
-\r
- //\r
- // Send command to read KBC command byte\r
- //\r
- Status = Out8042Command (IsaIo, READ_CMD_BYTE);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- Status = In8042Data (IsaIo, &Data);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
- //\r
- // Check keyboard enable or not\r
- //\r
- if ((Data & CMD_KB_STS) == CMD_KB_DIS) {\r
- *KeyboardEnable = FALSE;\r
- } else {\r
- *KeyboardEnable = TRUE;\r
- }\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-PS2MouseReset (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- EFI_DEVICE_ERROR - GC_TODO: Add description for return value\r
- EFI_DEVICE_ERROR - GC_TODO: Add description for return value\r
- EFI_SUCCESS - GC_TODO: Add description for return value\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
- UINT8 Data;\r
-\r
- Status = Out8042AuxCommand (IsaIo, RESET_CMD, FALSE);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- Status = In8042AuxData (IsaIo, &Data);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
- //\r
- // Check BAT Complete Code\r
- //\r
- if (Data != PS2MOUSE_BAT1) {\r
- return EFI_DEVICE_ERROR;\r
- }\r
-\r
- Status = In8042AuxData (IsaIo, &Data);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
- //\r
- // Check BAT Complete Code\r
- //\r
- if (Data != PS2MOUSE_BAT2) {\r
- return EFI_DEVICE_ERROR;\r
- }\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-PS2MouseSetSampleRate (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN MOUSE_SR SampleRate\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
- SampleRate - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
-\r
- //\r
- // Send auxiliary command to set mouse sample rate\r
- //\r
- Status = Out8042AuxCommand (IsaIo, SETSR_CMD, FALSE);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- Status = Out8042AuxData (IsaIo, SampleRateTbl[SampleRate]);\r
-\r
- return Status;\r
-}\r
-\r
-EFI_STATUS\r
-PS2MouseSetResolution (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN MOUSE_RE Resolution\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
- Resolution - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
-\r
- //\r
- // Send auxiliary command to set mouse resolution\r
- //\r
- Status = Out8042AuxCommand (IsaIo, SETRE_CMD, FALSE);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- Status = Out8042AuxData (IsaIo, ResolutionTbl[Resolution]);\r
-\r
- return Status;\r
-}\r
-\r
-EFI_STATUS\r
-PS2MouseSetScaling (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN MOUSE_SF Scaling\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
- Scaling - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-{\r
- UINT8 Command;\r
-\r
- Command = (UINT8) (Scaling == SF1 ? SETSF1_CMD : SETSF2_CMD);\r
-\r
- //\r
- // Send auxiliary command to set mouse scaling data\r
- //\r
- return Out8042AuxCommand (IsaIo, Command, FALSE);\r
-}\r
-\r
-EFI_STATUS\r
-PS2MouseEnable (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-{\r
- //\r
- // Send auxiliary command to enable mouse\r
- //\r
- return Out8042AuxCommand (IsaIo, ENABLE_CMD, FALSE);\r
-}\r
-\r
-EFI_STATUS\r
-PS2MouseGetPacket (\r
- PS2_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Get mouse packet . Only care first 3 bytes\r
-\r
-Arguments:\r
-\r
- MouseDev - Pointer of PS2 Mouse Private Data Structure \r
-\r
-Returns:\r
-\r
- EFI_NOT_READY - Mouse Device not ready to input data packet, or some error happened during getting the packet\r
- EFI_SUCCESS - The data packet is gotten successfully.\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
- BOOLEAN KeyboardEnable;\r
- UINT8 Packet[PS2_PACKET_LENGTH];\r
- UINT8 Data;\r
- UINTN Count;\r
- UINTN State;\r
- INT16 RelativeMovementX;\r
- INT16 RelativeMovementY;\r
- BOOLEAN LButton;\r
- BOOLEAN RButton;\r
-\r
- KeyboardEnable = FALSE;\r
- Count = 1;\r
- State = PS2_READ_BYTE_ONE;\r
-\r
- //\r
- // State machine to get mouse packet\r
- //\r
- while (1) {\r
-\r
- switch (State) {\r
- case PS2_READ_BYTE_ONE:\r
- //\r
- // Read mouse first byte data, if failed, immediately return\r
- //\r
- KbcDisableAux (MouseAbsolutePointerDev->IsaIo);\r
- Status = PS2MouseRead (MouseAbsolutePointerDev->IsaIo, &Data, &Count, State);\r
- if (EFI_ERROR (Status)) {\r
- KbcEnableAux (MouseAbsolutePointerDev->IsaIo);\r
- return EFI_NOT_READY;\r
- }\r
-\r
- if (Count != 1) {\r
- KbcEnableAux (MouseAbsolutePointerDev->IsaIo);\r
- return EFI_NOT_READY;\r
- }\r
-\r
- if (IS_PS2_SYNC_BYTE (Data)) {\r
- Packet[0] = Data;\r
- State = PS2_READ_DATA_BYTE;\r
-\r
- CheckKbStatus (MouseAbsolutePointerDev->IsaIo, &KeyboardEnable);\r
- KbcDisableKb (MouseAbsolutePointerDev->IsaIo);\r
- KbcEnableAux (MouseAbsolutePointerDev->IsaIo);\r
- }\r
- break;\r
-\r
- case PS2_READ_DATA_BYTE:\r
- Count = 2;\r
- Status = PS2MouseRead (MouseAbsolutePointerDev->IsaIo, (Packet + 1), &Count, State);\r
- if (EFI_ERROR (Status)) {\r
- if (KeyboardEnable) {\r
- KbcEnableKb (MouseAbsolutePointerDev->IsaIo);\r
- }\r
-\r
- return EFI_NOT_READY;\r
- }\r
-\r
- if (Count != 2) {\r
- if (KeyboardEnable) {\r
- KbcEnableKb (MouseAbsolutePointerDev->IsaIo);\r
- }\r
-\r
- return EFI_NOT_READY;\r
- }\r
-\r
- State = PS2_PROCESS_PACKET;\r
- break;\r
-\r
- case PS2_PROCESS_PACKET:\r
- if (KeyboardEnable) {\r
- KbcEnableKb (MouseAbsolutePointerDev->IsaIo);\r
- }\r
- //\r
- // Decode the packet\r
- //\r
- RelativeMovementX = Packet[1];\r
- RelativeMovementY = Packet[2];\r
- //\r
- // Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 \r
- // Byte 0 | Y overflow | X overflow | Y sign bit | X sign bit | Always 1 | Middle Btn | Right Btn | Left Btn \r
- // Byte 1 | 8 bit X Movement \r
- // Byte 2 | 8 bit Y Movement \r
- // \r
- // X sign bit + 8 bit X Movement : 9-bit signed twos complement integer that presents the relative displacement of the device in the X direction since the last data transmission.\r
- // Y sign bit + 8 bit Y Movement : Same as X sign bit + 8 bit X Movement.\r
- //\r
- //\r
- // First, Clear X and Y high 8 bits\r
- //\r
- RelativeMovementX = (INT16) (RelativeMovementX & 0xFF); \r
- RelativeMovementY = (INT16) (RelativeMovementY & 0xFF); \r
- //\r
- // Second, if the 9-bit signed twos complement integer is negative, set the high 8 bit 0xff\r
- //\r
- if ((Packet[0] & 0x10) != 0) {\r
- RelativeMovementX = (INT16) (RelativeMovementX | 0xFF00);\r
- }\r
- if ((Packet[0] & 0x20) != 0) {\r
- RelativeMovementY = (INT16) (RelativeMovementY | 0xFF00);\r
- }\r
-\r
- \r
- RButton = (UINT8) (Packet[0] & 0x2);\r
- LButton = (UINT8) (Packet[0] & 0x1);\r
-\r
- //\r
- // Update mouse state\r
- //\r
- MouseAbsolutePointerDev->State.CurrentX += RelativeMovementX;\r
- MouseAbsolutePointerDev->State.CurrentY -= RelativeMovementY;\r
- MouseAbsolutePointerDev->State.CurrentZ = 0;\r
- MouseAbsolutePointerDev->State.ActiveButtons = (UINT8) (LButton || RButton) & 0x3;\r
- MouseAbsolutePointerDev->StateChanged = TRUE;\r
-\r
- return EFI_SUCCESS;\r
- }\r
- }\r
-}\r
-\r
-EFI_STATUS\r
-PS2MouseRead (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- OUT VOID *Buffer,\r
- IN OUT UINTN *BufSize,\r
- IN UINTN State\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
- Buffer - GC_TODO: add argument description\r
- BufSize - GC_TODO: add argument description\r
- State - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
- UINTN BytesRead;\r
-\r
- Status = EFI_SUCCESS;\r
- BytesRead = 0;\r
-\r
- if (State == PS2_READ_BYTE_ONE) {\r
- //\r
- // Check input for mouse\r
- //\r
- Status = CheckForInput (IsaIo);\r
-\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
- }\r
-\r
- while (BytesRead < *BufSize) {\r
-\r
- Status = WaitOutputFull (IsaIo, TIMEOUT);\r
- if (EFI_ERROR (Status)) {\r
- break;\r
- }\r
-\r
- IsaIo->Io.Read (IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, Buffer);\r
-\r
- BytesRead++;\r
- Buffer = (UINT8 *) Buffer + 1;\r
- }\r
- //\r
- // Verify the correct number of bytes read\r
- //\r
- if (BytesRead == 0 || BytesRead != *BufSize) {\r
- Status = EFI_NOT_FOUND;\r
- }\r
-\r
- *BufSize = BytesRead;\r
- return Status;\r
-}\r
-//\r
-// 8042 I/O function\r
-//\r
-EFI_STATUS\r
-Out8042Command (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN UINT8 Command\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
- Command - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - GC_TODO: Add description for return value\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
- UINT8 Data;\r
-\r
- //\r
- // Wait keyboard controller input buffer empty\r
- //\r
- Status = WaitInputEmpty (IsaIo, TIMEOUT);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
- //\r
- // Send command\r
- //\r
- Data = Command;\r
- IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Data);\r
-\r
- Status = WaitInputEmpty (IsaIo, TIMEOUT);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-Out8042Data (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN UINT8 Data\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
- Data - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - GC_TODO: Add description for return value\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
- UINT8 temp;\r
- //\r
- // Wait keyboard controller input buffer empty\r
- //\r
- Status = WaitInputEmpty (IsaIo, TIMEOUT);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- temp = Data;\r
- IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, &temp);\r
-\r
- Status = WaitInputEmpty (IsaIo, TIMEOUT);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-In8042Data (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN OUT UINT8 *Data\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
- Data - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- EFI_TIMEOUT - GC_TODO: Add description for return value\r
- EFI_SUCCESS - GC_TODO: Add description for return value\r
-\r
---*/\r
-{\r
- UINTN Delay;\r
- UINT8 temp;\r
-\r
- Delay = TIMEOUT / 50;\r
-\r
- do {\r
- IsaIo->Io.Read (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &temp);\r
-\r
- //\r
- // Check keyboard controller status bit 0(output buffer status)\r
- //\r
- if ((temp & KBC_OUTB) == KBC_OUTB) {\r
- break;\r
- }\r
-\r
- gBS->Stall (50);\r
- Delay--;\r
- } while (Delay);\r
-\r
- if (Delay == 0) {\r
- return EFI_TIMEOUT;\r
- }\r
-\r
- IsaIo->Io.Read (IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, Data);\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-Out8042AuxCommand (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN UINT8 Command,\r
- IN BOOLEAN Resend\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
- Command - GC_TODO: add argument description\r
- Resend - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - GC_TODO: Add description for return value\r
- EFI_DEVICE_ERROR - GC_TODO: Add description for return value\r
- EFI_DEVICE_ERROR - GC_TODO: Add description for return value\r
- EFI_SUCCESS - GC_TODO: Add description for return value\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
- UINT8 Data;\r
-\r
- //\r
- // Wait keyboard controller input buffer empty\r
- //\r
- Status = WaitInputEmpty (IsaIo, TIMEOUT);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
- //\r
- // Send write to auxiliary device command\r
- //\r
- Data = WRITE_AUX_DEV;\r
- IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Data);\r
-\r
- Status = WaitInputEmpty (IsaIo, TIMEOUT);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
- //\r
- // Send auxiliary device command\r
- //\r
- IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, &Command);\r
-\r
- //\r
- // Read return code\r
- //\r
- Status = In8042AuxData (IsaIo, &Data);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- if (Data == PS2_ACK) {\r
- //\r
- // Receive mouse acknowledge, command send success\r
- //\r
- return EFI_SUCCESS;\r
-\r
- } else if (Resend) {\r
- //\r
- // Resend fail\r
- //\r
- return EFI_DEVICE_ERROR;\r
-\r
- } else if (Data == PS2_RESEND) {\r
- //\r
- // Resend command\r
- //\r
- Status = Out8042AuxCommand (IsaIo, Command, TRUE);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- } else {\r
- //\r
- // Invalid return code\r
- //\r
- return EFI_DEVICE_ERROR;\r
-\r
- }\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-Out8042AuxData (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN UINT8 Data\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
- Data - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - GC_TODO: Add description for return value\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
- UINT8 Temp;\r
- //\r
- // Wait keyboard controller input buffer empty\r
- //\r
- Status = WaitInputEmpty (IsaIo, TIMEOUT);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
- //\r
- // Send write to auxiliary device command\r
- //\r
- Temp = WRITE_AUX_DEV;\r
- IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Temp);\r
-\r
- Status = WaitInputEmpty (IsaIo, TIMEOUT);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- Temp = Data;\r
- IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, &Temp);\r
-\r
- Status = WaitInputEmpty (IsaIo, TIMEOUT);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-In8042AuxData (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN OUT UINT8 *Data\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
- Data - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - GC_TODO: Add description for return value\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
-\r
- //\r
- // wait for output data\r
- //\r
- Status = WaitOutputFull (IsaIo, BAT_TIMEOUT);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- IsaIo->Io.Read (IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, Data);\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-CheckForInput (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- EFI_NOT_READY - GC_TODO: Add description for return value\r
- EFI_SUCCESS - GC_TODO: Add description for return value\r
-\r
---*/\r
-{\r
- UINT8 Data;\r
-\r
- IsaIo->Io.Read (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Data);\r
-\r
- //\r
- // Check keyboard controller status, if it is output buffer full and for auxiliary device\r
- //\r
- if ((Data & (KBC_OUTB | KBC_AUXB)) != (KBC_OUTB | KBC_AUXB)) {\r
- return EFI_NOT_READY;\r
- }\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-WaitInputEmpty (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN UINTN Timeout\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
- Timeout - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- EFI_TIMEOUT - GC_TODO: Add description for return value\r
- EFI_SUCCESS - GC_TODO: Add description for return value\r
-\r
---*/\r
-{\r
- UINTN Delay;\r
- UINT8 Data;\r
-\r
- Delay = Timeout / 50;\r
-\r
- do {\r
- IsaIo->Io.Read (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Data);\r
-\r
- //\r
- // Check keyboard controller status bit 1(input buffer status)\r
- //\r
- if ((Data & KBC_INPB) == 0) {\r
- break;\r
- }\r
-\r
- gBS->Stall (50);\r
- Delay--;\r
- } while (Delay);\r
-\r
- if (Delay == 0) {\r
- return EFI_TIMEOUT;\r
- }\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-WaitOutputFull (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN UINTN Timeout\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
- Timeout - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- EFI_TIMEOUT - GC_TODO: Add description for return value\r
- EFI_SUCCESS - GC_TODO: Add description for return value\r
-\r
---*/\r
-{\r
- UINTN Delay;\r
- UINT8 Data;\r
-\r
- Delay = Timeout / 50;\r
-\r
- do {\r
- IsaIo->Io.Read (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Data);\r
-\r
- //\r
- // Check keyboard controller status bit 0(output buffer status)\r
- // & bit5(output buffer for auxiliary device)\r
- //\r
- if ((Data & (KBC_OUTB | KBC_AUXB)) == (KBC_OUTB | KBC_AUXB)) {\r
- break;\r
- }\r
-\r
- gBS->Stall (50);\r
- Delay--;\r
- } while (Delay);\r
-\r
- if (Delay == 0) {\r
- return EFI_TIMEOUT;\r
- }\r
-\r
- return EFI_SUCCESS;\r
-}\r
+++ /dev/null
-/**@file\r
- PS2 Mouse Communication Interface \r
-\r
- \r
-Copyright (c) 2006 - 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#ifndef _COMMPS2_H_\r
-#define _COMMPS2_H_\r
-\r
-#define PS2_PACKET_LENGTH 3\r
-#define PS2_SYNC_MASK 0xc\r
-#define PS2_SYNC_BYTE 0x8\r
-\r
-#define IS_PS2_SYNC_BYTE(byte) ((byte & PS2_SYNC_MASK) == PS2_SYNC_BYTE)\r
-\r
-#define PS2_READ_BYTE_ONE 0\r
-#define PS2_READ_DATA_BYTE 1\r
-#define PS2_PROCESS_PACKET 2\r
-\r
-#define TIMEOUT 50000\r
-#define BAT_TIMEOUT 500000\r
-\r
-//\r
-// 8042 I/O Port\r
-//\r
-#define KBC_DATA_PORT 0x60\r
-#define KBC_CMD_STS_PORT 0x64\r
-\r
-//\r
-// 8042 Command\r
-//\r
-#define READ_CMD_BYTE 0x20\r
-#define WRITE_CMD_BYTE 0x60\r
-#define DISABLE_AUX 0xa7\r
-#define ENABLE_AUX 0xa8\r
-#define SELF_TEST 0xaa\r
-#define DISABLE_KB 0xad\r
-#define ENABLE_KB 0xae\r
-#define WRITE_AUX_DEV 0xd4\r
-\r
-#define CMD_SYS_FLAG 0x04\r
-#define CMD_KB_STS 0x10\r
-#define CMD_KB_DIS 0x10\r
-#define CMD_KB_EN 0x0\r
-\r
-//\r
-// 8042 Auxiliary Device Command\r
-//\r
-#define SETSF1_CMD 0xe6\r
-#define SETSF2_CMD 0xe7\r
-#define SETRE_CMD 0xe8\r
-#define READ_CMD 0xeb\r
-#define SETRM_CMD 0xf0\r
-#define SETSR_CMD 0xf3\r
-#define ENABLE_CMD 0xf4\r
-#define DISABLE_CMD 0xf5\r
-#define RESET_CMD 0xff\r
-\r
-//\r
-// return code\r
-//\r
-#define PS2_ACK 0xfa\r
-#define PS2_RESEND 0xfe\r
-#define PS2MOUSE_BAT1 0xaa\r
-#define PS2MOUSE_BAT2 0x0\r
-\r
-//\r
-// Keyboard Controller Status\r
-//\r
-#define KBC_PARE 0x80 // Parity Error\r
-#define KBC_TIM 0x40 // General Time Out\r
-#define KBC_AUXB 0x20 // Output buffer for auxiliary device (PS/2):\r
-// 0 - Holds keyboard data\r
-// 1 - Holds data for auxiliary device\r
-//\r
-#define KBC_KEYL 0x10 // Keyboard lock status:\r
-// 0 - keyboard locked\r
-// 1 - keyboard free\r
-//\r
-#define KBC_CD 0x08 // Command/Data:\r
-// 0 - data byte written via port 60h\r
-// 1 - command byte written via port 64h\r
-//\r
-#define KBC_SYSF 0x04 // System Flag:\r
-// 0 - power-on reset\r
-// 1 - self-test successful\r
-//\r
-#define KBC_INPB 0x02 // Input Buffer Status :\r
-// 0 - input buffer empty\r
-// 1 - CPU data in input buffer\r
-//\r
-#define KBC_OUTB 0x01 // Output Buffer Status :\r
-// 0 - output buffer empty\r
-// 1 - keyboard controller data in output buffer\r
-//\r
-EFI_STATUS\r
-KbcSelfTest (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-KbcEnableAux (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-KbcDisableAux (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-KbcEnableKb (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-KbcDisableKb (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CheckKbStatus (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- OUT BOOLEAN *KeyboardEnable\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
- KeyboardEnable - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-PS2MouseReset (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-PS2MouseSetSampleRate (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN MOUSE_SR SampleRate\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
- SampleRate - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-PS2MouseSetResolution (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN MOUSE_RE Resolution\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
- Resolution - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-PS2MouseSetScaling (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN MOUSE_SF Scaling\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
- Scaling - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-PS2MouseEnable (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- IsaIo - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-PS2MouseGetPacket (\r
- PS2_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- MouseDev - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- GC_TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-PS2MouseRead (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- OUT VOID *Buffer,\r
- IN OUT UINTN *BufSize,\r
- IN UINTN State\r
- );\r
-\r
-//\r
-// 8042 I/O function\r
-//\r
-EFI_STATUS\r
-Out8042Command (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN UINT8 Command\r
- );\r
-\r
-EFI_STATUS\r
-In8042Data (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN OUT UINT8 *Data\r
- );\r
-\r
-EFI_STATUS\r
-Out8042Data (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN UINT8 Data\r
- );\r
-\r
-EFI_STATUS\r
-Out8042AuxCommand (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN UINT8 Command,\r
- IN BOOLEAN Resend\r
- );\r
-\r
-EFI_STATUS\r
-In8042AuxData (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN OUT UINT8 *Data\r
- );\r
-\r
-EFI_STATUS\r
-Out8042AuxData (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN UINT8 Data\r
- );\r
-\r
-EFI_STATUS\r
-CheckForInput (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo\r
- );\r
-\r
-EFI_STATUS\r
-WaitInputEmpty (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN UINTN Timeout\r
- );\r
-\r
-EFI_STATUS\r
-WaitOutputFull (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN UINTN Timeout\r
- );\r
-\r
-#endif // _COMMPS2_H_\r
+++ /dev/null
-/**@file\r
-\r
-Copyright (c) 2006 - 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "Ps2MouseAbsolutePointer.h"\r
-\r
-//\r
-// EFI Component Name Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gPs2MouseAbsolutePointerComponentName = {\r
- Ps2MouseAbsolutePointerComponentNameGetDriverName,\r
- Ps2MouseAbsolutePointerComponentNameGetControllerName,\r
- "eng"\r
-};\r
-\r
-//\r
-// EFI Component Name 2 Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gPs2MouseAbsolutePointerComponentName2 = {\r
- (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) Ps2MouseAbsolutePointerComponentNameGetDriverName,\r
- (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) Ps2MouseAbsolutePointerComponentNameGetControllerName,\r
- "en"\r
-};\r
-\r
-\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mPs2MouseAbsolutePointerDriverNameTable[] = {\r
- {\r
- "eng;en",\r
- L"faked PS/2 Touchpad Driver"\r
- },\r
- {\r
- NULL,\r
- NULL\r
- }\r
-};\r
-\r
-/**\r
- Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
- This function retrieves the user readable name of a driver in the form of a\r
- Unicode string. If the driver specified by This has a user readable name in\r
- the language specified by Language, then a pointer to the driver name is\r
- returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
- by This does not support the language specified by Language,\r
- then EFI_UNSUPPORTED is returned.\r
-\r
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
- EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
- @param Language[in] A pointer to a Null-terminated ASCII string\r
- array indicating the language. This is the\r
- language of the driver name that the caller is\r
- requesting, and it must match one of the\r
- languages specified in SupportedLanguages. The\r
- number of languages supported by a driver is up\r
- to the driver writer. Language is specified\r
- in RFC 3066 or ISO 639-2 language code format.\r
-\r
- @param DriverName[out] A pointer to the Unicode string to return.\r
- This Unicode string is the name of the\r
- driver specified by This in the language\r
- specified by Language.\r
-\r
- @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
- This and the language specified by Language was\r
- returned in DriverName.\r
-\r
- @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
- @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
- @retval EFI_UNSUPPORTED The driver specified by This does not support\r
- the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Ps2MouseAbsolutePointerComponentNameGetDriverName (\r
- IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
- IN CHAR8 *Language,\r
- OUT CHAR16 **DriverName\r
- )\r
-{\r
- return LookupUnicodeString2 (\r
- Language,\r
- This->SupportedLanguages,\r
- mPs2MouseAbsolutePointerDriverNameTable,\r
- DriverName,\r
- (BOOLEAN)(This == &gPs2MouseAbsolutePointerComponentName)\r
- );\r
-}\r
-\r
-/**\r
- Retrieves a Unicode string that is the user readable name of the controller\r
- that is being managed by a driver.\r
-\r
- This function retrieves the user readable name of the controller specified by\r
- ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
- driver specified by This has a user readable name in the language specified by\r
- Language, then a pointer to the controller name is returned in ControllerName,\r
- and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
- managing the controller specified by ControllerHandle and ChildHandle,\r
- then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
- support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
- EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
- @param ControllerHandle[in] The handle of a controller that the driver\r
- specified by This is managing. This handle\r
- specifies the controller whose name is to be\r
- returned.\r
-\r
- @param ChildHandle[in] The handle of the child controller to retrieve\r
- the name of. This is an optional parameter that\r
- may be NULL. It will be NULL for device\r
- drivers. It will also be NULL for a bus drivers\r
- that wish to retrieve the name of the bus\r
- controller. It will not be NULL for a bus\r
- driver that wishes to retrieve the name of a\r
- child controller.\r
-\r
- @param Language[in] A pointer to a Null-terminated ASCII string\r
- array indicating the language. This is the\r
- language of the driver name that the caller is\r
- requesting, and it must match one of the\r
- languages specified in SupportedLanguages. The\r
- number of languages supported by a driver is up\r
- to the driver writer. Language is specified in\r
- RFC 3066 or ISO 639-2 language code format.\r
-\r
- @param ControllerName[out] A pointer to the Unicode string to return.\r
- This Unicode string is the name of the\r
- controller specified by ControllerHandle and\r
- ChildHandle in the language specified by\r
- Language from the point of view of the driver\r
- specified by This.\r
-\r
- @retval EFI_SUCCESS The Unicode string for the user readable name in\r
- the language specified by Language for the\r
- driver specified by This was returned in\r
- DriverName.\r
-\r
- @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
- @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
- EFI_HANDLE.\r
-\r
- @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
- @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
- @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
- managing the controller specified by\r
- ControllerHandle and ChildHandle.\r
-\r
- @retval EFI_UNSUPPORTED The driver specified by This does not support\r
- the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Ps2MouseAbsolutePointerComponentNameGetControllerName (\r
- IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
- IN EFI_HANDLE ControllerHandle,\r
- IN EFI_HANDLE ChildHandle OPTIONAL,\r
- IN CHAR8 *Language,\r
- OUT CHAR16 **ControllerName\r
- )\r
-{\r
- EFI_STATUS Status;\r
- EFI_ABSOLUTE_POINTER_PROTOCOL *AbsolutePointerProtocol;\r
- PS2_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev;\r
- EFI_ISA_IO_PROTOCOL *IsaIoProtocol;\r
-\r
- //\r
- // This is a device driver, so ChildHandle must be NULL.\r
- //\r
- if (ChildHandle != NULL) {\r
- return EFI_UNSUPPORTED;\r
- }\r
- //\r
- // Check Controller's handle\r
- //\r
- Status = gBS->OpenProtocol (\r
- ControllerHandle,\r
- &gEfiIsaIoProtocolGuid,\r
- (VOID **) &IsaIoProtocol,\r
- gPS2MouseAbsolutePointerDriver.DriverBindingHandle,\r
- ControllerHandle,\r
- EFI_OPEN_PROTOCOL_BY_DRIVER\r
- );\r
- if (!EFI_ERROR (Status)) {\r
- gBS->CloseProtocol (\r
- ControllerHandle,\r
- &gEfiIsaIoProtocolGuid,\r
- gPS2MouseAbsolutePointerDriver.DriverBindingHandle,\r
- ControllerHandle\r
- );\r
-\r
- return EFI_UNSUPPORTED;\r
- }\r
-\r
- if (Status != EFI_ALREADY_STARTED) {\r
- return EFI_UNSUPPORTED;\r
- }\r
- //\r
- // Get the device context\r
- //\r
- Status = gBS->OpenProtocol (\r
- ControllerHandle,\r
- &gEfiAbsolutePointerProtocolGuid,\r
- (VOID **) &AbsolutePointerProtocol,\r
- gPS2MouseAbsolutePointerDriver.DriverBindingHandle,\r
- ControllerHandle,\r
- EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
- );\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- MouseAbsolutePointerDev = PS2_MOUSE_ABSOLUTE_POINTER_DEV_FROM_THIS (AbsolutePointerProtocol);\r
-\r
- return LookupUnicodeString2 (\r
- Language,\r
- This->SupportedLanguages,\r
- MouseAbsolutePointerDev->ControllerNameTable,\r
- ControllerName,\r
- (BOOLEAN)(This == &gPs2MouseAbsolutePointerComponentName)\r
- );\r
-}\r
+++ /dev/null
-/**@file\r
- A faked PS/2 Touchpad driver. Routines that interacts with callers,\r
- conforming to EFI driver model\r
- \r
-Copyright (c) 2006 - 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "Ps2MouseAbsolutePointer.h"\r
-#include "CommPs2.h"\r
-\r
-//\r
-// DriverBinding Protocol Instance\r
-//\r
-EFI_DRIVER_BINDING_PROTOCOL gPS2MouseAbsolutePointerDriver = {\r
- PS2MouseAbsolutePointerDriverSupported,\r
- PS2MouseAbsolutePointerDriverStart,\r
- PS2MouseAbsolutePointerDriverStop,\r
- 0x1,\r
- NULL,\r
- NULL\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PS2MouseAbsolutePointerDriverSupported (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- ControllerDriver Protocol Method\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
---*/\r
-// GC_TODO: This - add argument and description to function comment\r
-// GC_TODO: Controller - add argument and description to function comment\r
-// GC_TODO: RemainingDevicePath - add argument and description to function comment\r
-{\r
- EFI_STATUS Status;\r
- EFI_ISA_IO_PROTOCOL *IsaIo;\r
-\r
- Status = EFI_SUCCESS;\r
-\r
- //\r
- // Open the IO Abstraction(s) needed to perform the supported test\r
- //\r
- Status = gBS->OpenProtocol (\r
- Controller,\r
- &gEfiIsaIoProtocolGuid,\r
- (VOID **) &IsaIo,\r
- This->DriverBindingHandle,\r
- Controller,\r
- EFI_OPEN_PROTOCOL_BY_DRIVER\r
- );\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
- //\r
- // Use the ISA I/O Protocol to see if Controller is the Mouse controller\r
- //\r
- switch (IsaIo->ResourceList->Device.HID) {\r
- case EISA_PNP_ID (0xF03):\r
- //\r
- // Microsoft PS/2 style mouse\r
- //\r
- case EISA_PNP_ID (0xF13):\r
- //\r
- // PS/2 Port for PS/2-style Mice\r
- //\r
- break;\r
-\r
- case EISA_PNP_ID (0x303):\r
- //\r
- // IBM Enhanced (101/102-key, PS/2 mouse support)\r
- //\r
- if (IsaIo->ResourceList->Device.UID == 1) {\r
- break;\r
- }\r
-\r
- default:\r
- Status = EFI_UNSUPPORTED;\r
- break;\r
- }\r
- //\r
- // Close the I/O Abstraction(s) used to perform the supported test\r
- //\r
- gBS->CloseProtocol (\r
- Controller,\r
- &gEfiIsaIoProtocolGuid,\r
- This->DriverBindingHandle,\r
- Controller\r
- );\r
-\r
- return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PS2MouseAbsolutePointerDriverStart (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Start protocol interfaces for the mouse device handles.\r
-\r
-Arguments:\r
- This - Protocol instance pointer.\r
- Controller - Handle of device to bind driver to.\r
- RemainingDevicePath - Not used.\r
-\r
-Returns:\r
- EFI_SUCCESS - This driver is added to DeviceHandle.\r
- other - Errors occurred.\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
- EFI_STATUS EmptyStatus;\r
- EFI_ISA_IO_PROTOCOL *IsaIo;\r
- PS2_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev;\r
- UINT8 Data;\r
- EFI_TPL OldTpl;\r
- EFI_STATUS_CODE_VALUE StatusCode;\r
- EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;\r
-\r
- StatusCode = 0;\r
- MouseAbsolutePointerDev = NULL;\r
- IsaIo = NULL;\r
-\r
- //\r
- // Open the device path protocol\r
- //\r
- Status = gBS->OpenProtocol (\r
- Controller,\r
- &gEfiDevicePathProtocolGuid,\r
- (VOID **) &ParentDevicePath,\r
- This->DriverBindingHandle,\r
- Controller,\r
- EFI_OPEN_PROTOCOL_BY_DRIVER\r
- );\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
- //\r
- // Report that the keyboard is being enabled\r
- //\r
- REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
- EFI_PROGRESS_CODE,\r
- EFI_PERIPHERAL_MOUSE | EFI_P_PC_ENABLE,\r
- ParentDevicePath\r
- );\r
-\r
- //\r
- // Get the ISA I/O Protocol on Controller's handle\r
- //\r
- Status = gBS->OpenProtocol (\r
- Controller,\r
- &gEfiIsaIoProtocolGuid,\r
- (VOID **) &IsaIo,\r
- This->DriverBindingHandle,\r
- Controller,\r
- EFI_OPEN_PROTOCOL_BY_DRIVER\r
- );\r
- if (EFI_ERROR (Status)) {\r
- gBS->CloseProtocol (\r
- Controller,\r
- &gEfiDevicePathProtocolGuid,\r
- This->DriverBindingHandle,\r
- Controller\r
- );\r
- return EFI_INVALID_PARAMETER;\r
- }\r
- //\r
- // Raise TPL to avoid keyboard operation impact\r
- //\r
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);\r
-\r
- //\r
- // Allocate private data\r
- //\r
- MouseAbsolutePointerDev = AllocateZeroPool (sizeof (PS2_MOUSE_ABSOLUTE_POINTER_DEV));\r
- if (MouseAbsolutePointerDev == NULL) {\r
- Status = EFI_OUT_OF_RESOURCES;\r
- goto ErrorExit;\r
- }\r
- //\r
- // Setup the device instance\r
- //\r
- MouseAbsolutePointerDev->Signature = PS2_MOUSE_ABSOLUTE_POINTER_DEV_SIGNATURE;\r
- MouseAbsolutePointerDev->Handle = Controller;\r
- MouseAbsolutePointerDev->SampleRate = SSR_20;\r
- MouseAbsolutePointerDev->Resolution = CMR4;\r
- MouseAbsolutePointerDev->Scaling = SF1;\r
- MouseAbsolutePointerDev->DataPackageSize = 3;\r
- MouseAbsolutePointerDev->IsaIo = IsaIo;\r
- MouseAbsolutePointerDev->DevicePath = ParentDevicePath;\r
-\r
- //\r
- // Resolution = 4 counts/mm\r
- //\r
- MouseAbsolutePointerDev->Mode.AbsoluteMaxX = 1024;\r
- MouseAbsolutePointerDev->Mode.AbsoluteMinX = 0;\r
- MouseAbsolutePointerDev->Mode.AbsoluteMaxY = 798;\r
- MouseAbsolutePointerDev->Mode.AbsoluteMinY = 0;\r
- MouseAbsolutePointerDev->Mode.AbsoluteMaxZ = 0;\r
- MouseAbsolutePointerDev->Mode.AbsoluteMinZ = 0;\r
- MouseAbsolutePointerDev->Mode.Attributes = 0x03;\r
-\r
- MouseAbsolutePointerDev->AbsolutePointerProtocol.Reset = MouseAbsolutePointerReset;\r
- MouseAbsolutePointerDev->AbsolutePointerProtocol.GetState = MouseAbsolutePointerGetState;\r
- MouseAbsolutePointerDev->AbsolutePointerProtocol.Mode = &(MouseAbsolutePointerDev->Mode);\r
-\r
- //\r
- // Initialize keyboard controller if necessary\r
- //\r
- IsaIo->Io.Read (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Data);\r
- if ((Data & KBC_SYSF) != KBC_SYSF) {\r
- Status = KbcSelfTest (IsaIo);\r
- if (EFI_ERROR (Status)) {\r
- StatusCode = EFI_PERIPHERAL_MOUSE | EFI_P_EC_CONTROLLER_ERROR;\r
- goto ErrorExit;\r
- }\r
- }\r
-\r
- KbcEnableAux (IsaIo);\r
-\r
- REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
- EFI_PROGRESS_CODE,\r
- EFI_PERIPHERAL_MOUSE | EFI_P_PC_PRESENCE_DETECT,\r
- ParentDevicePath\r
- );\r
-\r
- //\r
- // Reset the mouse\r
- //\r
- Status = MouseAbsolutePointerDev->AbsolutePointerProtocol.Reset (&MouseAbsolutePointerDev->AbsolutePointerProtocol, TRUE);\r
- if (EFI_ERROR (Status)) {\r
- //\r
- // mouse not connected\r
- //\r
- Status = EFI_SUCCESS;\r
- StatusCode = EFI_PERIPHERAL_MOUSE | EFI_P_EC_NOT_DETECTED;\r
- goto ErrorExit;\r
- }\r
- //\r
- // Setup the WaitForKey event\r
- //\r
- Status = gBS->CreateEvent (\r
- EVT_NOTIFY_WAIT,\r
- TPL_NOTIFY,\r
- MouseAbsolutePointerWaitForInput,\r
- MouseAbsolutePointerDev,\r
- &((MouseAbsolutePointerDev->AbsolutePointerProtocol).WaitForInput)\r
- );\r
- if (EFI_ERROR (Status)) {\r
- Status = EFI_OUT_OF_RESOURCES;\r
- goto ErrorExit;\r
- }\r
- //\r
- // Setup a periodic timer, used to poll mouse state\r
- //\r
- Status = gBS->CreateEvent (\r
- EVT_TIMER | EVT_NOTIFY_SIGNAL,\r
- TPL_NOTIFY,\r
- PollMouseAbsolutePointer,\r
- MouseAbsolutePointerDev,\r
- &MouseAbsolutePointerDev->TimerEvent\r
- );\r
- if (EFI_ERROR (Status)) {\r
- Status = EFI_OUT_OF_RESOURCES;\r
- goto ErrorExit;\r
- }\r
- //\r
- // Start timer to poll mouse (100 samples per second)\r
- //\r
- Status = gBS->SetTimer (MouseAbsolutePointerDev->TimerEvent, TimerPeriodic, 100000);\r
- if (EFI_ERROR (Status)) {\r
- Status = EFI_OUT_OF_RESOURCES;\r
- goto ErrorExit;\r
- }\r
-\r
- MouseAbsolutePointerDev->ControllerNameTable = NULL;\r
- AddUnicodeString2 (\r
- "eng",\r
- gPs2MouseAbsolutePointerComponentName.SupportedLanguages,\r
- &MouseAbsolutePointerDev->ControllerNameTable,\r
- L"Faked PS/2 Touchpad Device",\r
- TRUE\r
- );\r
- AddUnicodeString2 (\r
- "en",\r
- gPs2MouseAbsolutePointerComponentName2.SupportedLanguages,\r
- &MouseAbsolutePointerDev->ControllerNameTable,\r
- L"Faked PS/2 Touchpad Device",\r
- FALSE\r
- );\r
-\r
-\r
- //\r
- // Install protocol interfaces for the mouse device.\r
- //\r
- Status = gBS->InstallMultipleProtocolInterfaces (\r
- &Controller,\r
- &gEfiAbsolutePointerProtocolGuid,\r
- &MouseAbsolutePointerDev->AbsolutePointerProtocol,\r
- NULL\r
- );\r
- if (EFI_ERROR (Status)) {\r
- goto ErrorExit;\r
- }\r
-\r
- gBS->RestoreTPL (OldTpl);\r
-\r
- return Status;\r
-\r
-ErrorExit:\r
-\r
- KbcDisableAux (IsaIo);\r
-\r
- if (StatusCode != 0) {\r
- REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
- EFI_ERROR_CODE | EFI_ERROR_MINOR,\r
- StatusCode,\r
- ParentDevicePath\r
- );\r
- }\r
-\r
- if ((MouseAbsolutePointerDev != NULL) && (MouseAbsolutePointerDev->AbsolutePointerProtocol.WaitForInput != NULL)) {\r
- gBS->CloseEvent (MouseAbsolutePointerDev->AbsolutePointerProtocol.WaitForInput);\r
- }\r
-\r
- if ((MouseAbsolutePointerDev != NULL) && (MouseAbsolutePointerDev->TimerEvent != NULL)) {\r
- gBS->CloseEvent (MouseAbsolutePointerDev->TimerEvent);\r
- }\r
-\r
- if ((MouseAbsolutePointerDev != NULL) && (MouseAbsolutePointerDev->ControllerNameTable != NULL)) {\r
- FreeUnicodeStringTable (MouseAbsolutePointerDev->ControllerNameTable);\r
- }\r
- //\r
- // Since there will be no timer handler for mouse input any more,\r
- // exhaust input data just in case there is still mouse data left\r
- //\r
- EmptyStatus = EFI_SUCCESS;\r
- while (!EFI_ERROR (EmptyStatus)) {\r
- EmptyStatus = In8042Data (IsaIo, &Data);\r
- }\r
-\r
- if (MouseAbsolutePointerDev != NULL) {\r
- gBS->FreePool (MouseAbsolutePointerDev);\r
- }\r
-\r
- gBS->CloseProtocol (\r
- Controller,\r
- &gEfiDevicePathProtocolGuid,\r
- This->DriverBindingHandle,\r
- Controller\r
- );\r
-\r
- gBS->CloseProtocol (\r
- Controller,\r
- &gEfiIsaIoProtocolGuid,\r
- This->DriverBindingHandle,\r
- Controller\r
- );\r
-\r
- gBS->RestoreTPL (OldTpl);\r
-\r
- return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PS2MouseAbsolutePointerDriverStop (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN UINTN NumberOfChildren,\r
- IN EFI_HANDLE *ChildHandleBuffer\r
- )\r
-/*++\r
-\r
- Routine Description:\r
-\r
- Arguments:\r
-\r
- Returns:\r
-\r
---*/\r
-// GC_TODO: This - add argument and description to function comment\r
-// GC_TODO: Controller - add argument and description to function comment\r
-// GC_TODO: NumberOfChildren - add argument and description to function comment\r
-// GC_TODO: ChildHandleBuffer - add argument and description to function comment\r
-// GC_TODO: EFI_SUCCESS - add return value to function comment\r
-// GC_TODO: EFI_SUCCESS - add return value to function comment\r
-{\r
- EFI_STATUS Status;\r
- EFI_ABSOLUTE_POINTER_PROTOCOL *AbsolutePointerProtocol;\r
- PS2_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev;\r
- UINT8 Data;\r
-\r
- Status = gBS->OpenProtocol (\r
- Controller,\r
- &gEfiAbsolutePointerProtocolGuid,\r
- (VOID **) &AbsolutePointerProtocol,\r
- This->DriverBindingHandle,\r
- Controller,\r
- EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
- );\r
- if (EFI_ERROR (Status)) {\r
- return EFI_SUCCESS;\r
- }\r
-\r
- MouseAbsolutePointerDev = PS2_MOUSE_ABSOLUTE_POINTER_DEV_FROM_THIS (AbsolutePointerProtocol);\r
-\r
- //\r
- // Report that the keyboard is being disabled\r
- //\r
- REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
- EFI_PROGRESS_CODE,\r
- EFI_PERIPHERAL_MOUSE | EFI_P_PC_DISABLE,\r
- MouseAbsolutePointerDev->DevicePath\r
- );\r
-\r
- Status = gBS->UninstallProtocolInterface (\r
- Controller,\r
- &gEfiAbsolutePointerProtocolGuid,\r
- &MouseAbsolutePointerDev->AbsolutePointerProtocol\r
- );\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
- //\r
- // Disable mouse on keyboard controller\r
- //\r
- KbcDisableAux (MouseAbsolutePointerDev->IsaIo);\r
-\r
- //\r
- // Cancel mouse data polling timer, close timer event\r
- //\r
- gBS->SetTimer (MouseAbsolutePointerDev->TimerEvent, TimerCancel, 0);\r
- gBS->CloseEvent (MouseAbsolutePointerDev->TimerEvent);\r
-\r
- //\r
- // Since there will be no timer handler for mouse input any more,\r
- // exhaust input data just in case there is still mouse data left\r
- //\r
- Status = EFI_SUCCESS;\r
- while (!EFI_ERROR (Status)) {\r
- Status = In8042Data (MouseAbsolutePointerDev->IsaIo, &Data);\r
- }\r
-\r
- gBS->CloseEvent (MouseAbsolutePointerDev->AbsolutePointerProtocol.WaitForInput);\r
- FreeUnicodeStringTable (MouseAbsolutePointerDev->ControllerNameTable);\r
- gBS->FreePool (MouseAbsolutePointerDev);\r
-\r
- gBS->CloseProtocol (\r
- Controller,\r
- &gEfiDevicePathProtocolGuid,\r
- This->DriverBindingHandle,\r
- Controller\r
- );\r
-\r
- gBS->CloseProtocol (\r
- Controller,\r
- &gEfiIsaIoProtocolGuid,\r
- This->DriverBindingHandle,\r
- Controller\r
- );\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-MouseAbsolutePointerReset (\r
- IN EFI_ABSOLUTE_POINTER_PROTOCOL *This,\r
- IN BOOLEAN ExtendedVerification\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Reset the Mouse and do BAT test for it, if ExtendedVerification isTRUE and there is a mouse device connectted to system\r
-\r
-Arguments:\r
-\r
- This - Pointer of simple pointer Protocol.\r
- ExtendedVerification - Whether configure mouse parameters. True: do; FALSE: skip.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - The command byte is written successfully.\r
- EFI_DEVICE_ERROR - Errors occurred during reseting keyboard.\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
- PS2_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev;\r
- EFI_TPL OldTpl;\r
- BOOLEAN KeyboardEnable;\r
- UINT8 Data;\r
-\r
- MouseAbsolutePointerDev = PS2_MOUSE_ABSOLUTE_POINTER_DEV_FROM_THIS (This);\r
-\r
- //\r
- // Report reset progress code\r
- //\r
- REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
- EFI_PROGRESS_CODE,\r
- EFI_PERIPHERAL_MOUSE | EFI_P_PC_RESET,\r
- MouseAbsolutePointerDev->DevicePath\r
- );\r
-\r
- KeyboardEnable = FALSE;\r
-\r
- //\r
- // Raise TPL to avoid keyboard operation impact\r
- //\r
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);\r
-\r
- ZeroMem (&MouseAbsolutePointerDev->State, sizeof (EFI_ABSOLUTE_POINTER_STATE));\r
- MouseAbsolutePointerDev->StateChanged = FALSE;\r
-\r
- //\r
- // Exhaust input data\r
- //\r
- Status = EFI_SUCCESS;\r
- while (!EFI_ERROR (Status)) {\r
- Status = In8042Data (MouseAbsolutePointerDev->IsaIo, &Data);\r
- }\r
-\r
- CheckKbStatus (MouseAbsolutePointerDev->IsaIo, &KeyboardEnable);\r
-\r
- KbcDisableKb (MouseAbsolutePointerDev->IsaIo);\r
-\r
- MouseAbsolutePointerDev->IsaIo->Io.Read (MouseAbsolutePointerDev->IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Data);\r
-\r
- //\r
- // if there's data block on KBC data port, read it out\r
- //\r
- if ((Data & KBC_OUTB) == KBC_OUTB) {\r
- MouseAbsolutePointerDev->IsaIo->Io.Read (MouseAbsolutePointerDev->IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, &Data);\r
- }\r
-\r
- Status = EFI_SUCCESS;\r
- //\r
- // The PS2 mouse driver reset behavior is always successfully return no matter wheater or not there is mouse connected to system.\r
- // This behavior is needed by performance speed. The following mouse command only succeessfully finish when mouse device is\r
- // connected to system, so if PS2 mouse device not connect to system or user not ask for, we skip the mouse configuration and enabling\r
- //\r
- if (ExtendedVerification && CheckMouseAbsolutePointerConnect (MouseAbsolutePointerDev)) {\r
- //\r
- // Send mouse reset command and set mouse default configure\r
- //\r
- Status = PS2MouseReset (MouseAbsolutePointerDev->IsaIo);\r
- if (EFI_ERROR (Status)) {\r
- Status = EFI_DEVICE_ERROR;\r
- goto Exit;\r
- }\r
-\r
- Status = PS2MouseSetSampleRate (MouseAbsolutePointerDev->IsaIo, MouseAbsolutePointerDev->SampleRate);\r
- if (EFI_ERROR (Status)) {\r
- Status = EFI_DEVICE_ERROR;\r
- goto Exit;\r
- }\r
-\r
- Status = PS2MouseSetResolution (MouseAbsolutePointerDev->IsaIo, MouseAbsolutePointerDev->Resolution);\r
- if (EFI_ERROR (Status)) {\r
- Status = EFI_DEVICE_ERROR;\r
- goto Exit;\r
- }\r
-\r
- Status = PS2MouseSetScaling (MouseAbsolutePointerDev->IsaIo, MouseAbsolutePointerDev->Scaling);\r
- if (EFI_ERROR (Status)) {\r
- Status = EFI_DEVICE_ERROR;\r
- goto Exit;\r
- }\r
-\r
- Status = PS2MouseEnable (MouseAbsolutePointerDev->IsaIo);\r
- if (EFI_ERROR (Status)) {\r
- Status = EFI_DEVICE_ERROR;\r
- goto Exit;\r
- }\r
- }\r
-Exit:\r
- gBS->RestoreTPL (OldTpl);\r
-\r
- if (KeyboardEnable) {\r
- KbcEnableKb (MouseAbsolutePointerDev->IsaIo);\r
- }\r
-\r
- return Status;\r
-}\r
-\r
-BOOLEAN\r
-CheckMouseAbsolutePointerConnect (\r
- IN PS2_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Check whether there is Ps/2 mouse device in system\r
-\r
-Arguments:\r
-\r
- PS2_MOUSE_DEV - Mouse Private Data Structure\r
-\r
-Returns:\r
-\r
- TRUE - Keyboard in System.\r
- FALSE - Keyboard not in System.\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
-\r
- Status = PS2MouseEnable (MouseAbsolutePointerDev->IsaIo);\r
- if (!EFI_ERROR (Status)) {\r
- return TRUE;\r
- }\r
-\r
- return FALSE;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-MouseAbsolutePointerGetState (\r
- IN EFI_ABSOLUTE_POINTER_PROTOCOL *This,\r
- IN OUT EFI_ABSOLUTE_POINTER_STATE *State\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
- This - GC_TODO: add argument description\r
- State - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
- EFI_INVALID_PARAMETER - GC_TODO: Add description for return value\r
- EFI_NOT_READY - GC_TODO: Add description for return value\r
- EFI_SUCCESS - GC_TODO: Add description for return value\r
-\r
---*/\r
-{\r
- PS2_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev;\r
- EFI_TPL OldTpl;\r
-\r
- MouseAbsolutePointerDev = PS2_MOUSE_ABSOLUTE_POINTER_DEV_FROM_THIS (This);\r
-\r
- if (State == NULL) {\r
- return EFI_INVALID_PARAMETER;\r
- }\r
-\r
- if (!MouseAbsolutePointerDev->StateChanged) {\r
- return EFI_NOT_READY;\r
- }\r
-\r
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);\r
- CopyMem (State, &(MouseAbsolutePointerDev->State), sizeof (EFI_ABSOLUTE_POINTER_STATE));\r
-\r
- //\r
- // clear mouse state\r
- //\r
- MouseAbsolutePointerDev->State.CurrentX = 0;\r
- MouseAbsolutePointerDev->State.CurrentY = 0;\r
- MouseAbsolutePointerDev->State.CurrentZ = 0;\r
- MouseAbsolutePointerDev->State.ActiveButtons = 0x0;\r
- MouseAbsolutePointerDev->StateChanged = FALSE;\r
- gBS->RestoreTPL (OldTpl);\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-VOID\r
-EFIAPI\r
-MouseAbsolutePointerWaitForInput (\r
- IN EFI_EVENT Event,\r
- IN VOID *Context\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Event notification function for SIMPLE_POINTER.WaitForInput event\r
- Signal the event if there is input from mouse\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
---*/\r
-// GC_TODO: Event - add argument and description to function comment\r
-// GC_TODO: Context - add argument and description to function comment\r
-{\r
- PS2_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev;\r
-\r
- MouseAbsolutePointerDev = (PS2_MOUSE_ABSOLUTE_POINTER_DEV *) Context;\r
-\r
- //\r
- // Someone is waiting on the mouse event, if there's\r
- // input from mouse, signal the event\r
- //\r
- if (MouseAbsolutePointerDev->StateChanged) {\r
- gBS->SignalEvent (Event);\r
- }\r
-\r
-}\r
-\r
-VOID\r
-EFIAPI\r
-PollMouseAbsolutePointer(\r
- IN EFI_EVENT Event,\r
- IN VOID *Context\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Event notification function for TimerEvent event\r
- If mouse device is connected to system, try to get the mouse packet data\r
-\r
-Arguments:\r
-\r
- Event - TimerEvent in PS2_MOUSE_DEV\r
- Context - Pointer to PS2_MOUSE_DEV structure\r
-\r
-Returns:\r
-\r
- None\r
-\r
---*/\r
-{\r
- PS2_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev;\r
-\r
- MouseAbsolutePointerDev = (PS2_MOUSE_ABSOLUTE_POINTER_DEV *) Context;\r
-\r
- //\r
- // Polling mouse packet data\r
- //\r
- PS2MouseGetPacket (MouseAbsolutePointerDev);\r
-}\r
-\r
-/**\r
- The user Entry Point for module Ps2MouseAbsolutePointer. The user code starts with this function.\r
-\r
- @param[in] ImageHandle The firmware allocated handle for the EFI image. \r
- @param[in] SystemTable A pointer to the EFI System Table.\r
- \r
- @retval EFI_SUCCESS The entry point is executed successfully.\r
- @retval other Some error occurs when executing this entry point.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-InitializePs2MouseAbsolutePointer(\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- )\r
-{\r
- EFI_STATUS Status;\r
-\r
- //\r
- // Install driver model protocol(s).\r
- //\r
- Status = EfiLibInstallDriverBindingComponentName2 (\r
- ImageHandle,\r
- SystemTable,\r
- &gPS2MouseAbsolutePointerDriver,\r
- ImageHandle,\r
- &gPs2MouseAbsolutePointerComponentName,\r
- &gPs2MouseAbsolutePointerComponentName2\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
-\r
- return Status;\r
-}\r
+++ /dev/null
-/**@file\r
- A Ps2MouseAbsolutePointer driver header file\r
- \r
-Copyright (c) 2006 - 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#ifndef _PS2MOUSEABSOLUTEPOINTER_H\r
-#define _PS2MOUSEABSOLUTEPOINTER_H\r
-\r
-#include <PiDxe.h>\r
-#include <Framework/StatusCode.h>\r
-\r
-#include <Protocol/AbsolutePointer.h>\r
-#include <Protocol/IsaIo.h>\r
-#include <Protocol/DevicePath.h>\r
-\r
-#include <Library/DebugLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/ReportStatusCodeLib.h>\r
-\r
-//\r
-// PS/2 mouse sample rate\r
-//\r
-typedef enum {\r
- SSR_10,\r
- SSR_20,\r
- SSR_40,\r
- SSR_60,\r
- SSR_80,\r
- SSR_100,\r
- SSR_200,\r
- MAX_SR\r
-} MOUSE_SR;\r
-\r
-//\r
-// PS/2 mouse resolution\r
-//\r
-typedef enum {\r
- CMR1,\r
- CMR2,\r
- CMR4,\r
- CMR8,\r
- MAX_CMR\r
-} MOUSE_RE;\r
-\r
-//\r
-// PS/2 mouse scaling\r
-//\r
-typedef enum {\r
- SF1,\r
- SF2\r
-} MOUSE_SF;\r
-\r
-//\r
-// Driver Private Data\r
-//\r
-#define PS2_MOUSE_ABSOLUTE_POINTER_DEV_SIGNATURE EFI_SIGNATURE_32 ('p', '2', 's', 't')\r
-\r
-typedef struct {\r
- UINTN Signature;\r
-\r
- EFI_HANDLE Handle;\r
- EFI_ABSOLUTE_POINTER_PROTOCOL AbsolutePointerProtocol;\r
- EFI_ABSOLUTE_POINTER_STATE State;\r
- EFI_ABSOLUTE_POINTER_MODE Mode;\r
- BOOLEAN StateChanged;\r
-\r
- //\r
- // PS2 Mouse device specific information\r
- //\r
- MOUSE_SR SampleRate;\r
- MOUSE_RE Resolution;\r
- MOUSE_SF Scaling;\r
- UINT8 DataPackageSize;\r
-\r
- EFI_ISA_IO_PROTOCOL *IsaIo;\r
-\r
- EFI_EVENT TimerEvent;\r
-\r
- EFI_UNICODE_STRING_TABLE *ControllerNameTable;\r
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
-} PS2_MOUSE_ABSOLUTE_POINTER_DEV;\r
-\r
-#define PS2_MOUSE_ABSOLUTE_POINTER_DEV_FROM_THIS(a) CR (a, PS2_MOUSE_ABSOLUTE_POINTER_DEV, AbsolutePointerProtocol, PS2_MOUSE_ABSOLUTE_POINTER_DEV_SIGNATURE)\r
-\r
-//\r
-// Global Variables\r
-//\r
-extern EFI_DRIVER_BINDING_PROTOCOL gPS2MouseAbsolutePointerDriver;\r
-extern EFI_COMPONENT_NAME_PROTOCOL gPs2MouseAbsolutePointerComponentName;\r
-extern EFI_COMPONENT_NAME2_PROTOCOL gPs2MouseAbsolutePointerComponentName2;\r
-\r
-//\r
-// Function prototypes\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-PS2MouseAbsolutePointerDriverSupported (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PS2MouseAbsolutePointerDriverStart (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PS2MouseAbsolutePointerDriverStop (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN UINTN NumberOfChildren,\r
- IN EFI_HANDLE *ChildHandleBuffer\r
- );\r
-\r
-//\r
-// EFI Component Name Functions\r
-//\r
-/**\r
- Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
- This function retrieves the user readable name of a driver in the form of a\r
- Unicode string. If the driver specified by This has a user readable name in\r
- the language specified by Language, then a pointer to the driver name is\r
- returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
- by This does not support the language specified by Language,\r
- then EFI_UNSUPPORTED is returned.\r
-\r
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
- EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
- @param Language[in] A pointer to a Null-terminated ASCII string\r
- array indicating the language. This is the\r
- language of the driver name that the caller is\r
- requesting, and it must match one of the\r
- languages specified in SupportedLanguages. The\r
- number of languages supported by a driver is up\r
- to the driver writer. Language is specified\r
- in RFC 3066 or ISO 639-2 language code format.\r
-\r
- @param DriverName[out] A pointer to the Unicode string to return.\r
- This Unicode string is the name of the\r
- driver specified by This in the language\r
- specified by Language.\r
-\r
- @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
- This and the language specified by Language was\r
- returned in DriverName.\r
-\r
- @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
- @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
- @retval EFI_UNSUPPORTED The driver specified by This does not support\r
- the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Ps2MouseAbsolutePointerComponentNameGetDriverName (\r
- IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
- IN CHAR8 *Language,\r
- OUT CHAR16 **DriverName\r
- );\r
-\r
-\r
-/**\r
- Retrieves a Unicode string that is the user readable name of the controller\r
- that is being managed by a driver.\r
-\r
- This function retrieves the user readable name of the controller specified by\r
- ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
- driver specified by This has a user readable name in the language specified by\r
- Language, then a pointer to the controller name is returned in ControllerName,\r
- and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
- managing the controller specified by ControllerHandle and ChildHandle,\r
- then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
- support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
- EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
- @param ControllerHandle[in] The handle of a controller that the driver\r
- specified by This is managing. This handle\r
- specifies the controller whose name is to be\r
- returned.\r
-\r
- @param ChildHandle[in] The handle of the child controller to retrieve\r
- the name of. This is an optional parameter that\r
- may be NULL. It will be NULL for device\r
- drivers. It will also be NULL for a bus drivers\r
- that wish to retrieve the name of the bus\r
- controller. It will not be NULL for a bus\r
- driver that wishes to retrieve the name of a\r
- child controller.\r
-\r
- @param Language[in] A pointer to a Null-terminated ASCII string\r
- array indicating the language. This is the\r
- language of the driver name that the caller is\r
- requesting, and it must match one of the\r
- languages specified in SupportedLanguages. The\r
- number of languages supported by a driver is up\r
- to the driver writer. Language is specified in\r
- RFC 3066 or ISO 639-2 language code format.\r
-\r
- @param ControllerName[out] A pointer to the Unicode string to return.\r
- This Unicode string is the name of the\r
- controller specified by ControllerHandle and\r
- ChildHandle in the language specified by\r
- Language from the point of view of the driver\r
- specified by This.\r
-\r
- @retval EFI_SUCCESS The Unicode string for the user readable name in\r
- the language specified by Language for the\r
- driver specified by This was returned in\r
- DriverName.\r
-\r
- @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
- @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
- EFI_HANDLE.\r
-\r
- @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
- @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
- @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
- managing the controller specified by\r
- ControllerHandle and ChildHandle.\r
-\r
- @retval EFI_UNSUPPORTED The driver specified by This does not support\r
- the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Ps2MouseAbsolutePointerComponentNameGetControllerName (\r
- IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
- IN EFI_HANDLE ControllerHandle,\r
- IN EFI_HANDLE ChildHandle OPTIONAL,\r
- IN CHAR8 *Language,\r
- OUT CHAR16 **ControllerName\r
- );\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-MouseAbsolutePointerReset (\r
- IN EFI_ABSOLUTE_POINTER_PROTOCOL *This,\r
- IN BOOLEAN ExtendedVerification\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-MouseAbsolutePointerGetState (\r
- IN EFI_ABSOLUTE_POINTER_PROTOCOL *This,\r
- IN OUT EFI_ABSOLUTE_POINTER_STATE *State\r
- );\r
-\r
-VOID\r
-EFIAPI\r
-MouseAbsolutePointerWaitForInput (\r
- IN EFI_EVENT Event,\r
- IN VOID *Context\r
- );\r
-\r
-VOID\r
-EFIAPI\r
-PollMouseAbsolutePointer (\r
- IN EFI_EVENT Event,\r
- IN VOID *Context\r
- );\r
-\r
-EFI_STATUS\r
-In8042Data (\r
- IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
- IN OUT UINT8 *Data\r
- );\r
-BOOLEAN\r
-CheckMouseAbsolutePointerConnect (\r
- IN PS2_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev\r
- );\r
-\r
-#endif\r
+++ /dev/null
-#/** @file\r
-# Ps2 Mouse Simulate TouchPad Driver\r
-#\r
-# This dirver directly uses IsaIo protocol service to support a faked Ps2 TouchPad work.\r
-# Copyright (c) 2006 - 2007, Intel Corporation.\r
-#\r
-# Copyright (c) 2006 - 2007, Intel Corporation\r
-# All rights reserved. This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#\r
-#**/\r
-\r
-[Defines]\r
- INF_VERSION = 0x00010005\r
- BASE_NAME = Ps2MouseAbsolutePointerDxe\r
- FILE_GUID = 2899C94A-1FB6-4b1a-B96B-8364975303E0\r
- MODULE_TYPE = DXE_DRIVER\r
- VERSION_STRING = 1.0\r
- EDK_RELEASE_VERSION = 0x00020000\r
- EFI_SPECIFICATION_VERSION = 0x00020000\r
-\r
- ENTRY_POINT = InitializePs2MouseAbsolutePointer\r
-\r
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC\r
-\r
-[Sources.common]\r
- ComponentName.c\r
- CommPs2.h\r
- CommPs2.c\r
- Ps2MouseAbsolutePointer.h\r
- Ps2MouseAbsolutePointer.c\r
-\r
-[Packages]\r
- MdePkg/MdePkg.dec\r
- MdeModulePkg/MdeModulePkg.dec\r
- IntelFrameworkPkg/IntelFrameworkPkg.dec\r
- IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
-\r
-[LibraryClasses]\r
- ReportStatusCodeLib\r
- UefiBootServicesTableLib\r
- MemoryAllocationLib\r
- BaseMemoryLib\r
- UefiLib\r
- UefiDriverEntryPoint\r
- DebugLib\r
-\r
-[Protocols]\r
- gEfiIsaIoProtocolGuid # PROTOCOL TO_START\r
- gEfiAbsolutePointerProtocolGuid # PROTOCOL BY_START\r
- gEfiDevicePathProtocolGuid # PROTOCOL TO_START\r
-\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<ModuleSurfaceArea xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0 http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd" xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
- <MsaHeader>\r
- <ModuleName>Ps2MouseAbsolutePointer</ModuleName>\r
- <ModuleType>DXE_DRIVER</ModuleType>\r
- <GuidValue>2899C94A-1FB6-4b1a-B96B-8364975303E0</GuidValue>\r
- <Version>1.0</Version>\r
- <Abstract>Ps2 Mouse Absolute Pointer Driver</Abstract>\r
- <Description>This dirver directly uses IsaIo protocol service to support a faked Ps2 touchpad work.</Description>\r
- <Copyright>Copyright (c) 2006 - 2007, Intel Corporation.</Copyright>\r
- <License>All rights reserved. This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
- <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>\r
- </MsaHeader>\r
- <ModuleDefinitions>\r
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
- <BinaryModule>false</BinaryModule>\r
- <OutputFileBasename>Ps2MouseAbsolutePointer</OutputFileBasename>\r
- </ModuleDefinitions>\r
- <LibraryClassDefinitions>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>DebugLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>UefiDriverModelLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>UefiDriverEntryPoint</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>UefiLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>BaseMemoryLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>MemoryAllocationLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>UefiBootServicesTableLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>ReportStatusCodeLib</Keyword>\r
- </LibraryClass>\r
- </LibraryClassDefinitions>\r
- <SourceFiles>\r
- <Filename>Ps2MouseAbsolutePointer.c</Filename>\r
- <Filename>Ps2MouseAbsolutePointer.h</Filename>\r
- <Filename>CommPs2.c</Filename>\r
- <Filename>CommPs2.h</Filename>\r
- <Filename>ComponentName.c</Filename>\r
- </SourceFiles>\r
- <PackageDependencies>\r
- <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
- <Package PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d"/>\r
- </PackageDependencies>\r
- <Protocols>\r
- <Protocol Usage="TO_START">\r
- <ProtocolCName>gEfiDevicePathProtocolGuid</ProtocolCName>\r
- </Protocol>\r
- <Protocol Usage="BY_START">\r
- <ProtocolCName>gEfiAbsolutePointerProtocolGuid</ProtocolCName>\r
- </Protocol>\r
- <Protocol Usage="TO_START">\r
- <ProtocolCName>gEfiIsaIoProtocolGuid</ProtocolCName>\r
- </Protocol>\r
- </Protocols>\r
- <Events>\r
- <CreateEvents>\r
- <EventTypes Usage="ALWAYS_PRODUCED">\r
- <EventType>EVENT_TYPE_RELATIVE_TIMER</EventType>\r
- <HelpText>Set up a time event to wait for the faked touchpad input</HelpText>\r
- </EventTypes>\r
- <EventTypes Usage="ALWAYS_PRODUCED">\r
- <EventType>EVENT_TYPE_PERIODIC_TIMER</EventType>\r
- <HelpText>Set up a periodic timer to poll the faked touchpad state at a fixed interval</HelpText>\r
- </EventTypes>\r
- </CreateEvents>\r
- <SignalEvents>\r
- <EventTypes Usage="SOMETIMES_PRODUCED">\r
- <EventType>EVENT_TYPE_RELATIVE_TIMER</EventType>\r
- <HelpText>Signal an event whenever these is a pending event from the faked touchpad input</HelpText>\r
- </EventTypes>\r
- </SignalEvents>\r
- </Events>\r
- <Externs>\r
- <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
- <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
- <Extern>\r
- <DriverBinding>gPS2MouseAbsolutePointerDriver</DriverBinding>\r
- <ComponentName>gPs2MouseAbsolutePointerComponentName</ComponentName>\r
- </Extern>\r
- </Externs>\r
-</ModuleSurfaceArea>
\ No newline at end of file
IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf\r
IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2keyboardDxe.inf\r
IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.inf\r
- IntelFrameworkModulePkg/Bus/Isa/Ps2MouseSimulateTouchPadDxe/Ps2MouseSimulateTouchPadDxe.inf\r
+ IntelFrameworkModulePkg/Bus/Isa/Ps2MouseAbsolutePointerDxe/Ps2MouseAbsolutePointerDxe.inf\r
IntelFrameworkModulePkg/Universal/DataHubDxe/DataHubDxe.inf\r
IntelFrameworkModulePkg/Universal/DataHubStdErrDxe/DataHubStdErrDxe.inf\r
IntelFrameworkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.inf\r