\r
UINT8 ResolutionTbl[MAX_CMR] = { 0, 1, 2, 3 };\r
\r
+/**\r
+ Issue self test command via IsaIo interface.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ \r
+ @return EFI_SUCCESS Success to do keyboard self testing.\r
+ @return others Fail to do keyboard self testing.\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
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ Issue command to enable keyboard AUX functionality.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ \r
+ @return Status of command issuing.\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
return Out8042Command (IsaIo, ENABLE_AUX);\r
}\r
\r
+/**\r
+ Issue command to disable keyboard AUX functionality.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ \r
+ @return Status of command issuing.\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
return Out8042Command (IsaIo, DISABLE_AUX);\r
}\r
\r
+/**\r
+ Issue command to enable keyboard.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ \r
+ @return Status of command issuing.\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
return Out8042Command (IsaIo, ENABLE_KB);\r
}\r
\r
+/**\r
+ Issue command to disable keyboard.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ \r
+ @return Status of command issuing.\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
return Out8042Command (IsaIo, DISABLE_KB);\r
}\r
\r
+/**\r
+ Issue command to check keyboard status.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param KeyboardEnable return whether keyboard is enable.\r
+ \r
+ @return Status of command issuing.\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
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ Issue command to reset keyboard.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ \r
+ @return Status of command issuing.\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
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ Issue command to set mouse's sample rate\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param SampleRate value of sample rate \r
+ \r
+ @return Status of command issuing.\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
return Status;\r
}\r
\r
+/**\r
+ Issue command to set mouse's resolution.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Resolution value of resolution\r
+ \r
+ @return Status of command issuing.\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
return Status;\r
}\r
\r
+/**\r
+ Issue command to set mouse's scaling.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Scaling value of scaling\r
+ \r
+ @return Status of command issuing.\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
return Out8042AuxCommand (IsaIo, Command, FALSE);\r
}\r
\r
+/**\r
+ Issue command to enable Ps2 mouse.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ \r
+ @return Status of command issuing.\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
return Out8042AuxCommand (IsaIo, ENABLE_CMD, FALSE);\r
}\r
\r
-EFI_STATUS\r
-PS2MouseGetPacket (\r
- PS2_MOUSE_DEV *MouseDev\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
+ @param 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
+ @retval EFI_NOT_READY Mouse Device not ready to input data packet, or some error happened during getting the packet\r
+ @retval EFI_SUCCESS The data packet is gotten successfully.\r
\r
**/\r
+EFI_STATUS\r
+PS2MouseGetPacket (\r
+ PS2_MOUSE_DEV *MouseDev\r
+ )\r
+\r
{\r
EFI_STATUS Status;\r
BOOLEAN KeyboardEnable;\r
}\r
}\r
\r
+/**\r
+ Read data via IsaIo protocol with given number.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Buffer Buffer receive data of mouse\r
+ @param BufSize The size of buffer\r
+ @param State Check input or read data\r
+ \r
+ @return status of reading mouse data.\r
+**/\r
EFI_STATUS\r
PS2MouseRead (\r
IN EFI_ISA_IO_PROTOCOL *IsaIo,\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
// 8042 I/O function\r
//\r
+/**\r
+ I/O work flow of outing 8042 command.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Command I/O command.\r
+ \r
+ @retval EFI_SUCCESS Success to excute I/O work flow\r
+ @retval EFI_TIMEOUT Keyboard controller time out.\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
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ I/O work flow of outing 8042 data.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Data Data value\r
+ \r
+ @retval EFI_SUCCESS Success to excute I/O work flow\r
+ @retval EFI_TIMEOUT Keyboard controller time out.\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
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ I/O work flow of in 8042 data.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Data Data value\r
+ \r
+ @retval EFI_SUCCESS Success to excute I/O work flow\r
+ @retval EFI_TIMEOUT Keyboard controller time out.\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
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ I/O work flow of outing 8042 Aux command.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Command Aux I/O command\r
+ @param Resend Whether need resend the Aux command.\r
+ \r
+ @retval EFI_SUCCESS Success to excute I/O work flow\r
+ @retval EFI_TIMEOUT Keyboard controller time out.\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
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ I/O work flow of outing 8042 Aux data.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Command Aux I/O command\r
+ \r
+ @retval EFI_SUCCESS Success to excute I/O work flow\r
+ @retval EFI_TIMEOUT Keyboard controller time out.\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
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ I/O work flow of in 8042 Aux data.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Data Buffer holding return value.\r
+ \r
+ @retval EFI_SUCCESS Success to excute I/O work flow\r
+ @retval EFI_TIMEOUT Keyboard controller time out.\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
return EFI_SUCCESS;\r
}\r
\r
+\r
+/**\r
+ Check keyboard controller status, if it is output buffer full and for auxiliary device\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ \r
+ @retval EFI_SUCCESS Keyboard controller is ready\r
+ @retval EFI_NOT_READY Keyboard controller is not ready\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
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ I/O work flow to wait input buffer empty in given time.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Timeout Wating time.\r
+ \r
+ @retval EFI_TIMEOUT if input is still not empty in given time.\r
+ @retval EFI_SUCCESS input is empty.\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
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ I/O work flow to wait output buffer full in given time.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Timeout given time\r
+ \r
+ @retval EFI_TIMEOUT output is not full in given time\r
+ @retval EFI_SUCCESS output is full in given time.\r
+**/\r
EFI_STATUS\r
WaitOutputFull (\r
IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
// 0 - output buffer empty\r
// 1 - keyboard controller data in output buffer\r
//\r
+\r
+/**\r
+ Issue self test command via IsaIo interface.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ \r
+ @return EFI_SUCCESS Success to do keyboard self testing.\r
+ @return others Fail to do keyboard self testing.\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
+/**\r
+ Issue command to enable keyboard AUX functionality.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ \r
+ @return Status of command issuing.\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
+/**\r
+ Issue command to disable keyboard AUX functionality.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ \r
+ @return Status of command issuing.\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
+/**\r
+ Issue command to enable keyboard.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ \r
+ @return Status of command issuing.\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
+/**\r
+ Issue command to disable keyboard.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ \r
+ @return Status of command issuing.\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
+/**\r
+ Issue command to check keyboard status.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param KeyboardEnable return whether keyboard is enable.\r
+ \r
+ @return Status of command issuing.\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
+/**\r
+ Issue command to reset keyboard.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ \r
+ @return Status of command issuing.\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
+/**\r
+ Issue command to set mouse's sample rate\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param SampleRate value of sample rate \r
+ \r
+ @return Status of command issuing.\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
+/**\r
+ Issue command to set mouse's resolution.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Resolution value of resolution\r
+ \r
+ @return Status of command issuing.\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
+/**\r
+ Issue command to set mouse's scaling.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Scaling value of scaling\r
+ \r
+ @return Status of command issuing.\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
+/**\r
+ Issue command to enable Ps2 mouse.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ \r
+ @return Status of command issuing.\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
\r
- IsaIo - GC_TODO: add argument description\r
+/**\r
+ Get mouse packet . Only care first 3 bytes\r
\r
-Returns:\r
+ @param MouseDev Pointer of PS2 Mouse Private Data Structure \r
\r
- GC_TODO: add return values\r
+ @retval EFI_NOT_READY Mouse Device not ready to input data packet, or some error happened during getting the packet\r
+ @retval EFI_SUCCESS The data packet is gotten successfully.\r
\r
**/\r
-;\r
-\r
EFI_STATUS\r
PS2MouseGetPacket (\r
PS2_MOUSE_DEV *MouseDev\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
+/**\r
+ Read data via IsaIo protocol with given number.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Buffer Buffer receive data of mouse\r
+ @param BufSize The size of buffer\r
+ @param State Check input or read data\r
+ \r
+ @return status of reading mouse data.\r
+**/\r
EFI_STATUS\r
PS2MouseRead (\r
IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
//\r
// 8042 I/O function\r
//\r
+/**\r
+ I/O work flow of outing 8042 command.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Command I/O command.\r
+ \r
+ @retval EFI_SUCCESS Success to excute I/O work flow\r
+ @retval EFI_TIMEOUT Keyboard controller time out.\r
+**/\r
EFI_STATUS\r
Out8042Command (\r
IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
IN UINT8 Command\r
);\r
\r
+/**\r
+ I/O work flow of in 8042 data.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Data Data value\r
+ \r
+ @retval EFI_SUCCESS Success to excute I/O work flow\r
+ @retval EFI_TIMEOUT Keyboard controller time out.\r
+**/\r
EFI_STATUS\r
In8042Data (\r
IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
IN OUT UINT8 *Data\r
);\r
\r
+/**\r
+ I/O work flow of outing 8042 data.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Data Data value\r
+ \r
+ @retval EFI_SUCCESS Success to excute I/O work flow\r
+ @retval EFI_TIMEOUT Keyboard controller time out.\r
+**/\r
EFI_STATUS\r
Out8042Data (\r
IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
IN UINT8 Data\r
);\r
\r
+/**\r
+ I/O work flow of outing 8042 Aux command.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Command Aux I/O command\r
+ @param Resend Whether need resend the Aux command.\r
+ \r
+ @retval EFI_SUCCESS Success to excute I/O work flow\r
+ @retval EFI_TIMEOUT Keyboard controller time out.\r
+**/\r
EFI_STATUS\r
Out8042AuxCommand (\r
IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
IN BOOLEAN Resend\r
);\r
\r
+/**\r
+ I/O work flow of in 8042 Aux data.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Data Buffer holding return value.\r
+ \r
+ @retval EFI_SUCCESS Success to excute I/O work flow\r
+ @retval EFI_TIMEOUT Keyboard controller time out.\r
+**/\r
EFI_STATUS\r
In8042AuxData (\r
IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
IN OUT UINT8 *Data\r
);\r
\r
+/**\r
+ I/O work flow of outing 8042 Aux data.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Command Aux I/O command\r
+ \r
+ @retval EFI_SUCCESS Success to excute I/O work flow\r
+ @retval EFI_TIMEOUT Keyboard controller time out.\r
+**/\r
EFI_STATUS\r
Out8042AuxData (\r
IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
IN UINT8 Data\r
);\r
\r
+/**\r
+ Check keyboard controller status, if it is output buffer full and for auxiliary device\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ \r
+ @retval EFI_SUCCESS Keyboard controller is ready\r
+ @retval EFI_NOT_READY Keyboard controller is not ready\r
+**/\r
EFI_STATUS\r
CheckForInput (\r
IN EFI_ISA_IO_PROTOCOL *IsaIo\r
);\r
\r
+/**\r
+ I/O work flow to wait input buffer empty in given time.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Timeout Wating time.\r
+ \r
+ @retval EFI_TIMEOUT if input is still not empty in given time.\r
+ @retval EFI_SUCCESS input is empty.\r
+**/\r
EFI_STATUS\r
WaitInputEmpty (\r
IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
IN UINTN Timeout\r
);\r
\r
+/**\r
+ I/O work flow to wait output buffer full in given time.\r
+ \r
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL\r
+ @param Timeout given time\r
+ \r
+ @retval EFI_TIMEOUT output is not full in given time\r
+ @retval EFI_SUCCESS output is full in given time.\r
+**/\r
EFI_STATUS\r
WaitOutputFull (\r
IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
NULL\r
};\r
\r
+/**\r
+ Test to see if this driver supports ControllerHandle. Any ControllerHandle\r
+ than contains a IsaIo protocol can be supported.\r
+\r
+ @param This Protocol instance pointer.\r
+ @param ControllerHandle Handle of device to test\r
+ @param RemainingDevicePath Optional parameter use to pick a specific child\r
+ device to start.\r
+\r
+ @retval EFI_SUCCESS This driver supports this device\r
+ @retval EFI_ALREADY_STARTED This driver is already running on this device\r
+ @retval other This driver does not support this device\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
PS2MouseDriverSupported (\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
return Status;\r
}\r
\r
+/**\r
+ Start this driver on ControllerHandle by opening a IsaIo\r
+ protocol, creating PS2_MOUSE_ABSOLUTE_POINTER_DEV device and install gEfiAbsolutePointerProtocolGuid\r
+ finnally.\r
+\r
+ @param This Protocol instance pointer.\r
+ @param ControllerHandle Handle of device to bind driver to\r
+ @param RemainingDevicePath Optional parameter use to pick a specific child\r
+ device to start.\r
+\r
+ @retval EFI_SUCCESS This driver is added to ControllerHandle\r
+ @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle\r
+ @retval other This driver does not support this device\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
PS2MouseDriverStart (\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
return Status;\r
}\r
\r
+/**\r
+ Stop this driver on ControllerHandle. Support stoping any child handles\r
+ created by this driver.\r
+\r
+ @param This Protocol instance pointer.\r
+ @param ControllerHandle Handle of device to stop driver on\r
+ @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of\r
+ children is zero stop the entire bus driver.\r
+ @param ChildHandleBuffer List of Child Handles to Stop.\r
+\r
+ @retval EFI_SUCCESS This driver is removed ControllerHandle\r
+ @retval other This driver was not removed from this device\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
PS2MouseDriverStop (\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_SIMPLE_POINTER_PROTOCOL *SimplePointerProtocol;\r
return EFI_SUCCESS;\r
}\r
\r
-EFI_STATUS\r
-EFIAPI\r
-MouseReset (\r
- IN EFI_SIMPLE_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
+ @param This - Pointer of simple pointer Protocol.\r
+ @param 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
+ @retval EFI_SUCCESS - The command byte is written successfully.\r
+ @retval EFI_DEVICE_ERROR - Errors occurred during reseting keyboard.\r
\r
**/\r
+EFI_STATUS\r
+EFIAPI\r
+MouseReset (\r
+ IN EFI_SIMPLE_POINTER_PROTOCOL *This,\r
+ IN BOOLEAN ExtendedVerification\r
+ )\r
{\r
EFI_STATUS Status;\r
PS2_MOUSE_DEV *MouseDev;\r
return Status;\r
}\r
\r
-BOOLEAN\r
-CheckMouseConnect (\r
- IN PS2_MOUSE_DEV *MouseDev\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
+ @param PS2_MOUSE_DEV - Mouse Private Data Structure\r
\r
-Returns:\r
-\r
- TRUE - Keyboard in System.\r
- FALSE - Keyboard not in System.\r
+ @retval TRUE - Keyboard in System.\r
+ @retval FALSE - Keyboard not in System.\r
\r
**/\r
+BOOLEAN\r
+CheckMouseConnect (\r
+ IN PS2_MOUSE_DEV *MouseDev\r
+ )\r
+\r
{\r
EFI_STATUS Status;\r
\r
return FALSE;\r
}\r
\r
+/**\r
+ Get and Clear mouse status.\r
+ \r
+ @param This - Pointer of simple pointer Protocol.\r
+ @param State - Output buffer holding status.\r
+\r
+ @retval EFI_INVALID_PARAMETER Output buffer is invalid.\r
+ @retval EFI_NOT_READY Mouse is not changed status yet.\r
+ @retval EFI_SUCCESS Mouse status is changed and get successful.\r
+**/\r
EFI_STATUS\r
EFIAPI\r
MouseGetState (\r
IN EFI_SIMPLE_POINTER_PROTOCOL *This,\r
IN OUT EFI_SIMPLE_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_DEV *MouseDev;\r
EFI_TPL OldTpl;\r
return EFI_SUCCESS;\r
}\r
\r
-VOID\r
-EFIAPI\r
-MouseWaitForInput (\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
+ @param Event event object\r
+ @param Context event context\r
\r
**/\r
+\r
+VOID\r
+EFIAPI\r
+MouseWaitForInput (\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\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
\r
}\r
\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
+ @param Event - TimerEvent in PS2_MOUSE_DEV\r
+ @param Context - Pointer to PS2_MOUSE_DEV structure\r
+\r
+**/\r
VOID\r
EFIAPI\r
PollMouse (\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_DEV *MouseDev;\r
\r
\r
return Status;\r
}\r
+\r