/** @file\r
Implementation for EFI_SIMPLE_TEXT_INPUT_PROTOCOL protocol.\r
\r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+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
REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
EFI_PROGRESS_CODE,\r
- PcdGet32 (PcdStatusCodeValueRemoteConsoleReset),\r
+ (EFI_PERIPHERAL_REMOTE_CONSOLE | EFI_P_PC_RESET),\r
TerminalDevice->DevicePath\r
);\r
\r
if (EFI_ERROR (Status)) {\r
REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
EFI_ERROR_CODE | EFI_ERROR_MINOR,\r
- PcdGet32 (PcdStatusCodeValueRemoteConsoleError),\r
+ (EFI_PERIPHERAL_REMOTE_CONSOLE | EFI_P_EC_CONTROLLER_ERROR),\r
TerminalDevice->DevicePath\r
);\r
}\r
OUT EFI_HANDLE *NotifyHandle\r
)\r
{\r
- EFI_STATUS Status;\r
TERMINAL_DEV *TerminalDevice;\r
TERMINAL_CONSOLE_IN_EX_NOTIFY *NewNotify;\r
LIST_ENTRY *Link;\r
\r
NewNotify->Signature = TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE;\r
NewNotify->KeyNotificationFn = KeyNotificationFunction;\r
+ NewNotify->NotifyHandle = (EFI_HANDLE) NewNotify;\r
CopyMem (&NewNotify->KeyData, KeyData, sizeof (KeyData));\r
InsertTailList (&TerminalDevice->NotifyList, &NewNotify->NotifyEntry);\r
- //\r
- // Use gSimpleTextInExNotifyGuid to get a valid EFI_HANDLE\r
- //\r
- Status = gBS->InstallMultipleProtocolInterfaces (\r
- &NewNotify->NotifyHandle,\r
- &gSimpleTextInExNotifyGuid,\r
- NULL,\r
- NULL\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
+\r
*NotifyHandle = NewNotify->NotifyHandle;\r
\r
return EFI_SUCCESS;\r
@retval EFI_SUCCESS The notification function was unregistered\r
successfully.\r
@retval EFI_INVALID_PARAMETER The NotificationHandle is invalid.\r
- @retval EFI_NOT_FOUND Can not find the matching entry in database.\r
\r
**/\r
EFI_STATUS\r
IN EFI_HANDLE NotificationHandle\r
)\r
{\r
- EFI_STATUS Status;\r
TERMINAL_DEV *TerminalDevice;\r
LIST_ENTRY *Link;\r
TERMINAL_CONSOLE_IN_EX_NOTIFY *CurrentNotify;\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- Status = gBS->OpenProtocol (\r
- NotificationHandle,\r
- &gSimpleTextInExNotifyGuid,\r
- NULL,\r
- NULL,\r
- NULL,\r
- EFI_OPEN_PROTOCOL_TEST_PROTOCOL\r
- );\r
- if (EFI_ERROR (Status)) {\r
+ if (((TERMINAL_CONSOLE_IN_EX_NOTIFY *) NotificationHandle)->Signature != TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE) {\r
return EFI_INVALID_PARAMETER;\r
- }\r
-\r
+ } \r
+ \r
TerminalDevice = TERMINAL_CON_IN_EX_DEV_FROM_THIS (This);\r
\r
NotifyList = &TerminalDevice->NotifyList;\r
// Remove the notification function from NotifyList and free resources\r
//\r
RemoveEntryList (&CurrentNotify->NotifyEntry);\r
- Status = gBS->UninstallMultipleProtocolInterfaces (\r
- CurrentNotify->NotifyHandle,\r
- &gSimpleTextInExNotifyGuid,\r
- NULL,\r
- NULL\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
+\r
gBS->FreePool (CurrentNotify);\r
return EFI_SUCCESS;\r
}\r
}\r
\r
- return EFI_NOT_FOUND;\r
+ //\r
+ // Can not find the matching entry in database.\r
+ //\r
+ return EFI_INVALID_PARAMETER;\r
}\r
\r
/**\r
if (Status == EFI_DEVICE_ERROR) {\r
REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
EFI_ERROR_CODE | EFI_ERROR_MINOR,\r
- PcdGet32 (PcdStatusCodeValueRemoteConsoleInputError),\r
+ (EFI_PERIPHERAL_REMOTE_CONSOLE | EFI_P_EC_INPUT_ERROR),\r
TerminalDevice->DevicePath\r
);\r
}\r
There is one special input sequence that will force the system to reset.\r
This is ESC R ESC r ESC R.\r
\r
+ Note: current implementation support terminal types include: PC ANSI, VT100+/VTUTF8, VT100. \r
+ The table below is not same with UEFI Spec 2.3 Appendix B Table 201(not support ANSI X3.64 /\r
+ DEC VT200-500 and extra support PC ANSI, VT100)since UEFI Table 201 is just an example.\r
+ \r
Symbols used in table below\r
===========================\r
ESC = 0x1B\r
if (TerminalDevice->ResetState == RESET_STATE_DEFAULT) {\r
TerminalDevice->ResetState = RESET_STATE_ESC_R;\r
SetDefaultResetState = FALSE;\r
- } else if (TerminalDevice->ResetState == RESET_STATE_ESC_R_ESC_r) {\r
+ } else if (TerminalDevice->ResetState == RESET_STATE_ESC_R_ESC_R) {\r
gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);\r
}\r
Key.ScanCode = SCAN_NULL;\r
break;\r
case 'r':\r
if (TerminalDevice->ResetState == RESET_STATE_ESC_R) {\r
- TerminalDevice->ResetState = RESET_STATE_ESC_R_ESC_r;\r
+ TerminalDevice->ResetState = RESET_STATE_ESC_R_ESC_R;\r
SetDefaultResetState = FALSE;\r
}\r
Key.ScanCode = SCAN_NULL;\r