\r
\r
#include <Uefi.h>\r
+\r
+#include <Guid/GlobalVariable.h>\r
+#include <Guid/PcAnsi.h>\r
+\r
+#include <Protocol/HotPlugDevice.h>\r
#include <Protocol/SimpleTextOut.h>\r
#include <Protocol/SerialIo.h>\r
-#include <Guid/GlobalVariable.h>\r
#include <Protocol/DevicePath.h>\r
#include <Protocol/SimpleTextIn.h>\r
#include <Protocol/SimpleTextInEx.h>\r
-#include <Guid/HotPlugDevice.h>\r
-#include <Guid/PcAnsi.h>\r
+\r
#include <Library/DebugLib.h>\r
#include <Library/UefiDriverEntryPoint.h>\r
#include <Library/UefiLib.h>\r
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOutput;\r
EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutputMode;\r
UINTN SerialInTimeOut;\r
- RAW_DATA_FIFO RawFiFo;\r
- UNICODE_FIFO UnicodeFiFo;\r
- EFI_KEY_FIFO EfiKeyFiFo;\r
+ RAW_DATA_FIFO *RawFiFo;\r
+ UNICODE_FIFO *UnicodeFiFo;\r
+ EFI_KEY_FIFO *EfiKeyFiFo;\r
EFI_UNICODE_STRING_TABLE *ControllerNameTable;\r
EFI_EVENT TwoSecondTimeOut;\r
UINT32 InputState;\r
extern EFI_COMPONENT_NAME_PROTOCOL gTerminalComponentName;\r
extern EFI_COMPONENT_NAME2_PROTOCOL gTerminalComponentName2;\r
\r
-extern EFI_GUID gSimpleTextInExNotifyGuid;\r
-\r
/**\r
The user Entry Point for module Terminal. The user code starts with this function.\r
\r
@param This Indicates the calling context.\r
@param ExtendedVerification Skip by this driver.\r
\r
- @return EFI_SUCCESS The reset operation succeeds.\r
- @return EFI_DEVICE_ERROR The dependent serial port reset fails.\r
+ @retval EFI_SUCCESS The reset operation succeeds.\r
+ @retval EFI_DEVICE_ERROR The dependent serial port reset fails.\r
\r
**/\r
EFI_STATUS\r
keystroke information for the key that was sent\r
from terminal.\r
\r
- @return EFI_SUCCESS The keystroke information is returned successfully.\r
- @return EFI_NOT_READY There is no keystroke data available.\r
- @return EFI_DEVICE_ERROR The dependent serial device encounters error.\r
+ @retval EFI_SUCCESS The keystroke information is returned successfully.\r
+ @retval EFI_NOT_READY There is no keystroke data available.\r
+ @retval EFI_DEVICE_ERROR The dependent serial device encounters error.\r
\r
**/\r
EFI_STATUS\r
@param Event Indicates the event that invoke this function.\r
@param Context Indicates the calling context.\r
\r
- @return none.\r
-\r
**/\r
VOID\r
EFIAPI\r
@param Event Indicates the event that invoke this function.\r
@param Context Indicates the calling context.\r
\r
- @return None\r
-\r
**/\r
VOID\r
EFIAPI\r
exhaustive verification operation of the device\r
during reset.\r
\r
- @return EFI_SUCCESS The reset operation succeeds.\r
- @return EFI_DEVICE_ERROR The terminal is not functioning correctly or the serial port reset fails.\r
+ @retval EFI_SUCCESS The reset operation succeeds.\r
+ @retval EFI_DEVICE_ERROR The terminal is not functioning correctly or the serial port reset fails.\r
\r
**/\r
EFI_STATUS\r
@param This Indicates the calling context.\r
@param WString The Null-terminated Unicode string to be tested.\r
\r
- @return EFI_SUCCESS The terminal is capable of rendering the output string.\r
- @return EFI_UNSUPPORTED Some of the characters in the Unicode string cannot be rendered.\r
+ @retval EFI_SUCCESS The terminal is capable of rendering the output string.\r
+ @retval EFI_UNSUPPORTED Some of the characters in the Unicode string cannot be rendered.\r
\r
**/\r
EFI_STATUS\r
@param Columns The returned columns of the requested mode.\r
@param Rows The returned rows of the requested mode.\r
\r
- @return EFI_SUCCESS The requested mode information is returned.\r
- @return EFI_UNSUPPORTED The mode number is not valid.\r
- @return EFI_DEVICE_ERROR\r
+ @retval EFI_SUCCESS The requested mode information is returned.\r
+ @retval EFI_UNSUPPORTED The mode number is not valid.\r
+ @retval EFI_DEVICE_ERROR\r
\r
**/\r
EFI_STATUS\r
@param This Indicates the calling context.\r
@param ModeNumber The text mode to set.\r
\r
- @return EFI_SUCCESS The requested text mode is set.\r
- @return EFI_DEVICE_ERROR The requested text mode cannot be set \r
+ @retval EFI_SUCCESS The requested text mode is set.\r
+ @retval EFI_DEVICE_ERROR The requested text mode cannot be set\r
because of serial device error.\r
- @return EFI_UNSUPPORTED The text mode number is not valid.\r
+ @retval EFI_UNSUPPORTED The text mode number is not valid.\r
\r
**/\r
EFI_STATUS\r
@param Attribute The attribute to set. Only bit0..6 are valid, all other bits\r
are undefined and must be zero.\r
\r
- @return EFI_SUCCESS The requested attribute is set.\r
- @return EFI_DEVICE_ERROR The requested attribute cannot be set due to serial port error.\r
- @return EFI_UNSUPPORTED The attribute requested is not defined by EFI spec.\r
+ @retval EFI_SUCCESS The requested attribute is set.\r
+ @retval EFI_DEVICE_ERROR The requested attribute cannot be set due to serial port error.\r
+ @retval EFI_UNSUPPORTED The attribute requested is not defined by EFI spec.\r
\r
**/\r
EFI_STATUS\r
\r
@param This Indicates the calling context.\r
\r
- @return EFI_SUCCESS The operation completed successfully.\r
- @return EFI_DEVICE_ERROR The terminal screen cannot be cleared due to serial port error.\r
- @return EFI_UNSUPPORTED The terminal is not in a valid display mode.\r
+ @retval EFI_SUCCESS The operation completed successfully.\r
+ @retval EFI_DEVICE_ERROR The terminal screen cannot be cleared due to serial port error.\r
+ @retval EFI_UNSUPPORTED The terminal is not in a valid display mode.\r
\r
**/\r
EFI_STATUS\r
@param Column The row to set cursor to.\r
@param Row The column to set cursor to.\r
\r
- @return EFI_SUCCESS The operation completed successfully.\r
- @return EFI_DEVICE_ERROR The request fails due to serial port error.\r
- @return EFI_UNSUPPORTED The terminal is not in a valid text mode, or the cursor position\r
+ @retval EFI_SUCCESS The operation completed successfully.\r
+ @retval EFI_DEVICE_ERROR The request fails due to serial port error.\r
+ @retval EFI_UNSUPPORTED The terminal is not in a valid text mode, or the cursor position\r
is invalid for current mode.\r
\r
**/\r
@param Visible If TRUE, the cursor is set to be visible,\r
If FALSE, the cursor is set to be invisible.\r
\r
- @return EFI_SUCCESS The request is valid.\r
- @return EFI_UNSUPPORTED The terminal does not support cursor hidden.\r
+ @retval EFI_SUCCESS The request is valid.\r
+ @retval EFI_UNSUPPORTED The terminal does not support cursor hidden.\r
\r
**/\r
EFI_STATUS\r
);\r
\r
/**\r
- Test to see if this driver supports Controller. \r
+ Test to see if this driver supports Controller.\r
\r
@param This Protocol instance pointer.\r
@param ControllerHandle Handle of device to test\r
/**\r
Stop this driver on Controller by closing Simple Text In, Simple Text\r
In Ex, Simple Text Out protocol, and removing parent device path from\r
- Console Device Environment Variables. \r
+ Console Device Environment Variables.\r
\r
@param This Protocol instance pointer.\r
@param Controller Handle of device to stop driver on\r
**/\r
EFI_STATUS\r
TerminalFreeNotifyList (\r
- IN OUT LIST_ENTRY *ListHead\r
- );\r
+ IN OUT LIST_ENTRY *ListHead\r
+ );\r
\r
/**\r
Retrieves a Unicode string that is the user readable name of the driver.\r
@param VariableName A pointer to the variable name.\r
@param ParentDevicePath A pointer to the parent device path.\r
\r
- @return None.\r
-\r
**/\r
VOID\r
TerminalRemoveConsoleDevVariable (\r
@param VariableSize Returns the size of the EFI variable that was read\r
\r
@return Dynamically allocated memory that contains a copy of the EFI variable.\r
- Caller is repsoncible freeing the buffer. If variable was not read, \r
+ Caller is repsoncible freeing the buffer. If variable was not read,\r
NULL regturned.\r
\r
**/\r
-VOID *\r
+VOID *\r
TerminalGetVariableAndSize (\r
IN CHAR16 *Name,\r
IN EFI_GUID *VendorGuid,\r
OUT EFI_DEVICE_PATH_PROTOCOL **TerminalDevicePath\r
);\r
\r
-/**\r
- Initialize the Raw Data FIFO.\r
-\r
- @param TerminalDevice The terminal device.\r
-\r
- @return None.\r
-\r
-**/\r
-VOID\r
-InitializeRawFiFo (\r
- IN TERMINAL_DEV *TerminalDevice\r
- );\r
-\r
-/**\r
- Initialize the Unicode FIFO.\r
-\r
- @param TerminalDevice The terminal device.\r
-\r
- @return None.\r
-\r
-**/\r
-VOID\r
-InitializeUnicodeFiFo (\r
- IN TERMINAL_DEV *TerminalDevice\r
- );\r
-\r
-/**\r
- Initialize the EFI Key FIFO.\r
-\r
- @param TerminalDevice The terminal device.\r
-\r
- @return None.\r
-\r
-**/\r
-VOID\r
-InitializeEfiKeyFiFo (\r
- IN TERMINAL_DEV *TerminalDevice\r
- );\r
-\r
/**\r
Get one key out of serial buffer.\r
\r
@param SerialIo Serial I/O protocl attached to the serial device.\r
@param Input The fetched key.\r
\r
- @return EFI_NOT_READY If serial buffer is empty.\r
- @return EFI_DEVICE_ERROR If reading serial buffer encounter error.\r
- @return EFI_SUCCESS If reading serial buffer successfully, put\r
+ @retval EFI_NOT_READY If serial buffer is empty.\r
+ @retval EFI_DEVICE_ERROR If reading serial buffer encounter error.\r
+ @retval EFI_SUCCESS If reading serial buffer successfully, put\r
the fetched key to the parameter output.\r
\r
**/\r
@param TerminalDevice Terminal driver private structure.\r
@param Input The key will be input.\r
\r
- @return TRUE If insert successfully.\r
- @return FLASE If Raw Data buffer is full before key insertion,\r
+ @retval TRUE If insert successfully.\r
+ @retval FLASE If Raw Data buffer is full before key insertion,\r
and the key is lost.\r
\r
**/\r
@param TerminalDevice Terminal driver private structure.\r
@param Output The key will be removed.\r
\r
- @return TRUE If insert successfully.\r
- @return FLASE If Raw Data FIFO buffer is empty before remove operation.\r
+ @retval TRUE If insert successfully.\r
+ @retval FLASE If Raw Data FIFO buffer is empty before remove operation.\r
\r
**/\r
BOOLEAN\r
\r
@param TerminalDevice Terminal driver private structure\r
\r
- @return TRUE If Raw Data FIFO buffer is empty.\r
- @return FLASE If Raw Data FIFO buffer is not empty.\r
+ @retval TRUE If Raw Data FIFO buffer is empty.\r
+ @retval FLASE If Raw Data FIFO buffer is not empty.\r
\r
**/\r
BOOLEAN\r
\r
@param TerminalDevice Terminal driver private structure\r
\r
- @return TRUE If Raw Data FIFO buffer is full.\r
- @return FLASE If Raw Data FIFO buffer is not full.\r
+ @retval TRUE If Raw Data FIFO buffer is full.\r
+ @retval FLASE If Raw Data FIFO buffer is not full.\r
\r
**/\r
BOOLEAN\r
@param TerminalDevice Terminal driver private structure.\r
@param Key The key will be input.\r
\r
- @return TRUE If insert successfully.\r
- @return FLASE If FIFO buffer is full before key insertion,\r
+ @retval TRUE If insert successfully.\r
+ @retval FLASE If FIFO buffer is full before key insertion,\r
and the key is lost.\r
\r
**/\r
@param TerminalDevice Terminal driver private structure.\r
@param Output The key will be removed.\r
\r
- @return TRUE If insert successfully.\r
- @return FLASE If FIFO buffer is empty before remove operation.\r
+ @retval TRUE If insert successfully.\r
+ @retval FLASE If FIFO buffer is empty before remove operation.\r
\r
**/\r
BOOLEAN\r
\r
@param TerminalDevice Terminal driver private structure\r
\r
- @return TRUE If FIFO buffer is empty.\r
- @return FLASE If FIFO buffer is not empty.\r
+ @retval TRUE If FIFO buffer is empty.\r
+ @retval FLASE If FIFO buffer is not empty.\r
\r
**/\r
BOOLEAN\r
\r
@param TerminalDevice Terminal driver private structure\r
\r
- @return TRUE If FIFO buffer is full.\r
- @return FLASE If FIFO buffer is not full.\r
+ @retval TRUE If FIFO buffer is full.\r
+ @retval FLASE If FIFO buffer is not full.\r
\r
**/\r
BOOLEAN\r
@param TerminalDevice Terminal driver private structure.\r
@param Input The key will be input.\r
\r
- @return TRUE If insert successfully.\r
- @return FLASE If Unicode FIFO buffer is full before key insertion,\r
+ @retval TRUE If insert successfully.\r
+ @retval FLASE If Unicode FIFO buffer is full before key insertion,\r
and the key is lost.\r
\r
**/\r
@param TerminalDevice Terminal driver private structure.\r
@param Output The key will be removed.\r
\r
- @return TRUE If insert successfully.\r
- @return FLASE If Unicode FIFO buffer is empty before remove operation.\r
+ @retval TRUE If insert successfully.\r
+ @retval FLASE If Unicode FIFO buffer is empty before remove operation.\r
\r
**/\r
BOOLEAN\r
\r
@param TerminalDevice Terminal driver private structure\r
\r
- @return TRUE If Unicode FIFO buffer is empty.\r
- @return FLASE If Unicode FIFO buffer is not empty.\r
+ @retval TRUE If Unicode FIFO buffer is empty.\r
+ @retval FLASE If Unicode FIFO buffer is not empty.\r
\r
**/\r
BOOLEAN\r
\r
@param TerminalDevice Terminal driver private structure\r
\r
- @return TRUE If Unicode FIFO buffer is full.\r
- @return FLASE If Unicode FIFO buffer is not full.\r
+ @retval TRUE If Unicode FIFO buffer is full.\r
+ @retval FLASE If Unicode FIFO buffer is not full.\r
\r
**/\r
BOOLEAN\r
);\r
\r
/**\r
- Translate raw data into Unicode (according to different encode), and \r
- translate Unicode into key information. (according to different standard). \r
+ Translate raw data into Unicode (according to different encode), and\r
+ translate Unicode into key information. (according to different standard).\r
\r
@param TerminalDevice Terminal driver private structure.\r
\r
- @return none.\r
-\r
**/\r
VOID\r
TranslateRawDataToEfiKey (\r
\r
@param TerminalDevice The terminal device.\r
\r
- @return None.\r
-\r
**/\r
VOID\r
AnsiRawDataToUnicode (\r
\r
/**\r
Converts a stream of Unicode characters from a terminal input device into EFI Keys that\r
- can be read through the Simple Input Protocol. \r
- \r
+ can be read through the Simple Input Protocol.\r
+\r
The table below shows the keyboard input mappings that this function supports.\r
If the ESC sequence listed in one of the columns is presented, then it is translated\r
into the coorespoding EFI Scan Code. If a matching sequence is not found, then the raw\r
| F11 | 0x15 | | ESC ! | |\r
| F12 | 0x16 | | ESC @ | |\r
+=========+======+===========+==========+==========+\r
- \r
+\r
Special Mappings\r
================\r
ESC R ESC r ESC R = Reset System\r
\r
@param TerminalDevice The terminal device to use to translate raw input into EFI Keys\r
\r
- @return None.\r
-\r
**/\r
VOID\r
UnicodeToEfiKey (\r
or valid text graphics.\r
\r
@param TerminalDevice The terminal device.\r
- @param WString The input string. \r
- \r
+ @param WString The input string.\r
+\r
@retval EFI_UNSUPPORTED If not all input characters are valid.\r
@retval EFI_SUCCESS If all input characters are valid.\r
\r
//\r
\r
/**\r
- Translate all VT-UTF8 characters in the Raw FIFI into unicode characters, \r
+ Translate all VT-UTF8 characters in the Raw FIFI into unicode characters,\r
and insert them into Unicode FIFO.\r
\r
@param VtUtf8Device The terminal device.\r
\r
- @return None.\r
-\r
**/\r
VOID\r
VTUTF8RawDataToUnicode (\r
Check if input string is valid VT-UTF8 string.\r
\r
@param TerminalDevice The terminal device.\r
- @param WString The input string. \r
- \r
+ @param WString The input string.\r
+\r
@retval EFI_SUCCESS If all input characters are valid.\r
\r
**/\r
IN CHAR16 *WString\r
);\r
\r
-/** \r
+/**\r
Translate one Unicode character into VT-UTF8 characters.\r
\r
UTF8 Encoding Table\r
@param Utf8Char Return VT-UTF8 character set.\r
@param ValidBytes The count of valid VT-UTF8 characters. If\r
ValidBytes is zero, no valid VT-UTF8 returned.\r
- \r
- @return None.\r
\r
**/\r
VOID\r
\r
@param Utf8Device The terminal device.\r
@param Utf8Char Returned valid VT-UTF8 characters set.\r
- @param ValidBytes The count of returned VT-VTF8 characters. \r
+ @param ValidBytes The count of returned VT-VTF8 characters.\r
If ValidBytes is zero, no valid VT-UTF8 returned.\r
\r
**/\r
OUT UINT8 *ValidBytes\r
);\r
\r
-/** \r
+/**\r
Translate VT-UTF8 characters into one Unicode character.\r
\r
UTF8 Encoding Table\r
\r
@param Utf8Char VT-UTF8 character set needs translating.\r
@param ValidBytes The count of valid VT-UTF8 characters.\r
- @param UnicodeChar Returned unicode character. \r
- \r
- @return None.\r
+ @param UnicodeChar Returned unicode character.\r
\r
**/\r
VOID\r
@param Ascii Optional pointer to return ASCII equivalent of\r
Graphic.\r
\r
- @return TRUE If Graphic is a supported Unicode Box Drawing character.\r
+ @retval TRUE If Graphic is a supported Unicode Box Drawing character.\r
\r
**/\r
BOOLEAN\r
Detects if a valid ASCII char.\r
\r
@param Ascii An ASCII character.\r
- \r
+\r
@retval TRUE If it is a valid ASCII character.\r
@retval FALSE If it is not a valid ASCII character.\r
\r
Detects if a valid EFI control character.\r
\r
@param CharC An input EFI Control character.\r
- \r
+\r
@retval TRUE If it is a valid EFI control character.\r
@retval FALSE If it is not a valid EFI control character.\r
\r