4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync PS2 Mouse Communication Interface.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncCopyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncThis program and the accompanying materials
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncare licensed and made available under the terms and conditions of the BSD License
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncwhich accompanies this distribution. The full text of the license may be found at
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncTHE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncWITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8 SampleRateTbl[MaxSampleRate] = { 0xa, 0x14, 0x28, 0x3c, 0x50, 0x64, 0xc8 };
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncUINT8 ResolutionTbl[MaxResolution] = { 0, 1, 2, 3 };
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Issue self test command via IsaIo interface.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return EFI_SUCCESS Success to do keyboard self testing.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return others Fail to do keyboard self testing.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Keyboard controller self test
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Read return code
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Set system flag
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Issue command to enable keyboard AUX functionality.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Status of command issuing.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Send 8042 enable mouse command
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Issue command to disable keyboard AUX functionality.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Status of command issuing.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Send 8042 disable mouse command
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Issue command to enable keyboard.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Status of command issuing.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Send 8042 enable keyboard command
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Issue command to disable keyboard.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Status of command issuing.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Send 8042 disable keyboard command
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Issue command to check keyboard status.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param KeyboardEnable return whether keyboard is enable.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Status of command issuing.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Send command to read KBC command byte
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Check keyboard enable or not
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Issue command to reset keyboard.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Status of command issuing.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Status = Out8042AuxCommand (IsaIo, RESET_CMD, FALSE);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Check BAT Complete Code
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Check BAT Complete Code
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Issue command to set mouse's sample rate
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param SampleRate value of sample rate
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Status of command issuing.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Send auxiliary command to set mouse sample rate
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Status = Out8042AuxCommand (IsaIo, SETSR_CMD, FALSE);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Status = Out8042AuxData (IsaIo, SampleRateTbl[SampleRate]);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Issue command to set mouse's resolution.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Resolution value of resolution
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Status of command issuing.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Send auxiliary command to set mouse resolution
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Status = Out8042AuxCommand (IsaIo, SETRE_CMD, FALSE);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Status = Out8042AuxData (IsaIo, ResolutionTbl[Resolution]);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Issue command to set mouse's scaling.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Scaling value of scaling
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Status of command issuing.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Command = (UINT8) (Scaling == Scaling1 ? SETSF1_CMD : SETSF2_CMD);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Send auxiliary command to set mouse scaling data
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Issue command to enable Ps2 mouse.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return Status of command issuing.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Send auxiliary command to enable mouse
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync return Out8042AuxCommand (IsaIo, ENABLE_CMD, FALSE);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Get mouse packet . Only care first 3 bytes
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param MouseDev Pointer of PS2 Mouse Private Data Structure
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_NOT_READY Mouse Device not ready to input data packet, or some error happened during getting the packet
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The data packet is gotten successfully.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // State machine to get mouse packet
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync while (1) {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Read mouse first byte data, if failed, immediately return
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Status = PS2MouseRead (MouseDev->IsaIo, &Data, &Count, State);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Status = PS2MouseRead (MouseDev->IsaIo, (Packet + 1), &Count, State);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Decode the packet
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Byte 0 | Y overflow | X overflow | Y sign bit | X sign bit | Always 1 | Middle Btn | Right Btn | Left Btn
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Byte 1 | 8 bit X Movement
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Byte 2 | 8 bit Y Movement
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // 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.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Y sign bit + 8 bit Y Movement : Same as X sign bit + 8 bit X Movement.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // First, Clear X and Y high 8 bits
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync RelativeMovementX = (INT16) (RelativeMovementX & 0xFF);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync RelativeMovementY = (INT16) (RelativeMovementY & 0xFF);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Second, if the 9-bit signed twos complement integer is negative, set the high 8 bit 0xff
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync RelativeMovementX = (INT16) (RelativeMovementX | 0xFF00);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync RelativeMovementY = (INT16) (RelativeMovementY | 0xFF00);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Update mouse state
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync MouseDev->State.RelativeMovementX += RelativeMovementX;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync MouseDev->State.RelativeMovementY -= RelativeMovementY;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync MouseDev->State.RightButton = (UINT8) (RButton ? TRUE : FALSE);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync MouseDev->State.LeftButton = (UINT8) (LButton ? TRUE : FALSE);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Read data via IsaIo protocol with given number.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Buffer Buffer receive data of mouse
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param BufSize The size of buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param State Check input or read data
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @return status of reading mouse data.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Check input for mouse
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IsaIo->Io.Read (IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, Buffer);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Verify the correct number of bytes read
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// 8042 I/O function
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync I/O work flow of outing 8042 command.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Command I/O command.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS Success to excute I/O work flow
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_TIMEOUT Keyboard controller time out.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Wait keyboard controller input buffer empty
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Send command
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Data);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync I/O work flow of outing 8042 data.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Data Data value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS Success to excute I/O work flow
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_TIMEOUT Keyboard controller time out.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Wait keyboard controller input buffer empty
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, &Temp);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync I/O work flow of in 8042 data.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Data Data value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS Success to excute I/O work flow
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_TIMEOUT Keyboard controller time out.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IsaIo->Io.Read (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Temp);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Check keyboard controller status bit 0(output buffer status)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync } while (Delay != 0);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IsaIo->Io.Read (IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, Data);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync I/O work flow of outing 8042 Aux command.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Command Aux I/O command
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Resend Whether need resend the Aux command.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS Success to excute I/O work flow
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_TIMEOUT Keyboard controller time out.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Wait keyboard controller input buffer empty
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Send write to auxiliary device command
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Data);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Send auxiliary device command
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, &Command);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Read return code
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Receive mouse acknowledge, command send success
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync } else if (Resend) {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Resend fail
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Resend command
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Invalid return code
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync I/O work flow of outing 8042 Aux data.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Data Buffer holding return value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS Success to excute I/O work flow
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_TIMEOUT Keyboard controller time out.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Wait keyboard controller input buffer empty
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Send write to auxiliary device command
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Temp);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, &Temp);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync I/O work flow of in 8042 Aux data.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Data Buffer holding return value.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS Success to excute I/O work flow
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_TIMEOUT Keyboard controller time out.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // wait for output data
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IsaIo->Io.Read (IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, Data);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Check keyboard controller status, if it is output buffer full and for auxiliary device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS Keyboard controller is ready
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_NOT_READY Keyboard controller is not ready
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IsaIo->Io.Read (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Data);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Check keyboard controller status, if it is output buffer full and for auxiliary device
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync if ((Data & (KBC_OUTB | KBC_AUXB)) != (KBC_OUTB | KBC_AUXB)) {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync I/O work flow to wait input buffer empty in given time.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Timeout Wating time.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_TIMEOUT if input is still not empty in given time.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS input is empty.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IsaIo->Io.Read (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Data);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Check keyboard controller status bit 1(input buffer status)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync } while (Delay != 0);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync I/O work flow to wait output buffer full in given time.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Timeout given time
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_TIMEOUT output is not full in given time
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS output is full in given time.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IsaIo->Io.Read (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Data);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Check keyboard controller status bit 0(output buffer status)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // & bit5(output buffer for auxiliary device)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync if ((Data & (KBC_OUTB | KBC_AUXB)) == (KBC_OUTB | KBC_AUXB)) {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync } while (Delay != 0);