/** @file\r
Private data structures for the Console Splitter driver\r
\r
-Copyright (c) 2006 - 2008 Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2009, 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
#include <Protocol/DevicePath.h>\r
#include <Protocol/ComponentName.h>\r
#include <Protocol/DriverBinding.h>\r
-#include <Protocol/ConsoleControl.h>\r
#include <Protocol/SimplePointer.h>\r
#include <Protocol/AbsolutePointer.h>\r
#include <Protocol/SimpleTextOut.h>\r
#include <Protocol/SimpleTextInEx.h>\r
#include <Protocol/GraphicsOutput.h>\r
#include <Protocol/UgaDraw.h>\r
-#include <Protocol/SimpleTextInExNotify.h>\r
\r
-#include <Guid/PrimaryStandardErrorDevice.h>\r
-#include <Guid/PrimaryConsoleOutDevice.h>\r
-#include <Guid/PrimaryConsoleInDevice.h>\r
-#include <Guid/GenericPlatformVariable.h>\r
#include <Guid/ConsoleInDevice.h>\r
#include <Guid/StandardErrorDevice.h>\r
#include <Guid/ConsoleOutDevice.h>\r
//\r
#define CONSOLE_SPLITTER_CONSOLES_ALLOC_UNIT 32\r
#define CONSOLE_SPLITTER_MODES_ALLOC_UNIT 32\r
-#define MAX_STD_IN_PASSWORD 80\r
\r
-#define VARCONOUTMODE L"ConOutMode"\r
\r
typedef struct {\r
UINTN Column;\r
UINTN AbsolutePointerListCount;\r
BOOLEAN AbsoluteInputEventSignalState;\r
\r
- BOOLEAN PasswordEnabled;\r
- CHAR16 Password[MAX_STD_IN_PASSWORD];\r
- UINTN PwdIndex;\r
- CHAR16 PwdAttempt[MAX_STD_IN_PASSWORD];\r
- EFI_EVENT LockEvent;\r
-\r
BOOLEAN KeyEventSignalState;\r
BOOLEAN InputEventSignalState;\r
} TEXT_IN_SPLITTER_PRIVATE_DATA;\r
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;\r
EFI_UGA_DRAW_PROTOCOL *UgaDraw;\r
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut;\r
- BOOLEAN TextOutEnabled;\r
} TEXT_OUT_AND_GOP_DATA;\r
\r
//\r
UINT32 UgaVerticalResolution;\r
UINT32 UgaColorDepth;\r
UINT32 UgaRefreshRate;\r
- EFI_UGA_PIXEL *UgaBlt;\r
\r
EFI_GRAPHICS_OUTPUT_PROTOCOL GraphicsOutput;\r
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL *GraphicsOutputBlt;\r
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *GraphicsOutputModeBuffer;\r
UINTN CurrentNumberOfGraphicsOutput;\r
UINTN CurrentNumberOfUgaDraw;\r
BOOLEAN HardwareNeedsStarting;\r
\r
- EFI_CONSOLE_CONTROL_PROTOCOL ConsoleControl;\r
-\r
UINTN CurrentNumberOfConsoles;\r
TEXT_OUT_AND_GOP_DATA *TextOutList;\r
UINTN TextOutListCount;\r
UINTN TextOutQueryDataCount;\r
INT32 *TextOutModeMap;\r
\r
- EFI_CONSOLE_CONTROL_SCREEN_MODE ConsoleOutputMode;\r
-\r
- UINTN DevNullColumns;\r
- UINTN DevNullRows;\r
- CHAR16 *DevNullScreen;\r
- INT32 *DevNullAttributes;\r
-\r
} TEXT_OUT_SPLITTER_PRIVATE_DATA;\r
\r
#define TEXT_OUT_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \\r
\r
/**\r
This event agregates all the events of the pointer devices in the splitter.\r
- If the ConIn is password locked then return.\r
+\r
If any events of physical pointer devices are signaled, signal the pointer\r
splitter event. This will cause the calling code to call\r
ConSplitterAbsolutePointerGetState ().\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
+ in RFC 4646 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
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
+ RFC 4646 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
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
+ RFC 4646 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
retrieve the name of the bus controller. It will\r
not be NULL for a bus driver that wishes to\r
retrieve the name of a child controller.\r
- @param Language A pointer to RFC3066 language identifier. This is\r
+ @param Language A pointer to RFC4646 language identifier. This is\r
the language of the controller name that that the\r
caller is requesting, and it must match one of the\r
languages specified in SupportedLanguages. 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
+ RFC 4646 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
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
+ RFC 4646 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
/**\r
Reads the next keystroke from the input device. The WaitForKey Event can\r
be used to test for existance of a keystroke via WaitForEvent () call.\r
- If the ConIn is password locked make it look like no keystroke is availible\r
\r
@param This Protocol instance pointer.\r
@param Key Driver may perform diagnostics on reset.\r
/**\r
This event aggregates all the events of the ConIn devices in the spliter.\r
\r
- If the ConIn is password locked then return.\r
If any events of physical ConIn devices are signaled, signal the ConIn\r
spliter event. This will cause the calling code to call\r
ConSplitterTextInReadKeyStroke ().\r
IN VOID *Context\r
);\r
\r
-/**\r
- Return TRUE if StdIn is locked. The ConIn device on the virtual handle is\r
- the only device locked.\r
-\r
- @retval TRUE StdIn locked\r
- @retval FALSE StdIn working normally\r
-\r
-**/\r
-BOOLEAN\r
-ConSpliterConssoleControlStdInLocked (\r
- VOID\r
- );\r
-\r
-/**\r
- Record and check key sequence on StdIn.\r
-\r
- This timer event will fire when StdIn is locked. It will record the key sequence\r
- on StdIn and also check to see if it matches the password. Any error in the\r
- password will cause the check to reset. As long as a mConIn.PasswordEnabled is\r
- TRUE, the StdIn splitter will not report any input.\r
-\r
- @param Event The Event this notify function registered to.\r
- @param Context Pointer to the context data registerd to the\r
- Event.\r
-**/\r
-VOID\r
-EFIAPI\r
-ConSpliterConsoleControlLockStdInEvent (\r
- IN EFI_EVENT Event,\r
- IN VOID *Context\r
- );\r
-\r
-/**\r
- If Password is NULL unlock the password state variable and set the event\r
- timer. If the Password is too big return an error. If the Password is valid\r
- Copy the Password and enable state variable and then arm the periodic timer\r
-\r
- @param This Console Control protocol pointer.\r
- @param Password The password input.\r
-\r
- @retval EFI_SUCCESS Lock the StdIn device\r
- @retval EFI_INVALID_PARAMETER Password is NULL\r
- @retval EFI_OUT_OF_RESOURCES Buffer allocation to store the password fails\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-ConSpliterConsoleControlLockStdIn (\r
- IN EFI_CONSOLE_CONTROL_PROTOCOL *This,\r
- IN CHAR16 *Password\r
- );\r
\r
/**\r
Reads the next keystroke from the input device. The WaitForKey Event can\r
/**\r
Reads the next keystroke from the input device. The WaitForKey Event can\r
be used to test for existance of a keystroke via WaitForEvent () call.\r
- If the ConIn is password locked make it look like no keystroke is availible\r
\r
@param This A pointer to protocol instance.\r
@param State A pointer to state information on the pointer device\r
\r
/**\r
This event agregates all the events of the ConIn devices in the spliter.\r
- If the ConIn is password locked then return.\r
If any events of physical ConIn devices are signaled, signal the ConIn\r
spliter event. This will cause the calling code to call\r
ConSplitterTextInReadKeyStroke ().\r
**/\r
EFI_STATUS\r
ConSplitterGrowBuffer (\r
- IN UINTN SizeOfCount,\r
- IN UINTN *Count,\r
+ IN UINTN SizeOfCount,\r
+ IN OUT UINTN *Count,\r
IN OUT VOID **Buffer\r
);\r
\r
-/**\r
- Return the current video mode information. Also returns info about existence\r
- of Graphics Output devices or UGA Draw devices in system, and if the Std In device is locked. All the\r
- arguments are optional and only returned if a non NULL pointer is passed in.\r
-\r
- @param This Protocol instance pointer.\r
- @param Mode Are we in text of grahics mode.\r
- @param GopUgaExists TRUE if Console Spliter has found a GOP or UGA device\r
- @param StdInLocked TRUE if StdIn device is keyboard locked\r
-\r
- @retval EFI_SUCCESS Mode information returned.\r
- @retval EFI_INVALID_PARAMETER Invalid parameters.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-ConSpliterConsoleControlGetMode (\r
- IN EFI_CONSOLE_CONTROL_PROTOCOL *This,\r
- OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode,\r
- OUT BOOLEAN *GopUgaExists,\r
- OUT BOOLEAN *StdInLocked\r
- );\r
-\r
-/**\r
- Set the current mode to either text or graphics. Graphics is\r
- for Quiet Boot.\r
-\r
- @param This Console Control Protocol instance pointer.\r
- @param Mode Mode to set.\r
-\r
- @retval EFI_SUCCESS Mode information returned.\r
- @retval EFI_INVALID_PARAMETER Invalid parameter.\r
- @retval EFI_UNSUPPORTED Operation unsupported.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-ConSpliterConsoleControlSetMode (\r
- IN EFI_CONSOLE_CONTROL_PROTOCOL *This,\r
- IN EFI_CONSOLE_CONTROL_SCREEN_MODE Mode\r
- );\r
-\r
/**\r
Returns information for an available graphics mode that the graphics device\r
and the set of active video output devices supports.\r
**/\r
EFI_STATUS\r
EFIAPI\r
-ConSpliterGraphicsOutputQueryMode (\r
+ConSplitterGraphicsOutputQueryMode (\r
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r
IN UINT32 ModeNumber,\r
OUT UINTN *SizeOfInfo,\r
**/\r
EFI_STATUS\r
EFIAPI\r
-ConSpliterGraphicsOutputSetMode (\r
+ConSplitterGraphicsOutputSetMode (\r
IN EFI_GRAPHICS_OUTPUT_PROTOCOL * This,\r
IN UINT32 ModeNumber\r
);\r
**/\r
EFI_STATUS\r
EFIAPI\r
-ConSpliterGraphicsOutputBlt (\r
+ConSplitterGraphicsOutputBlt (\r
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL\r
IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,\r
IN UINTN Delta OPTIONAL\r
);\r
\r
-/**\r
- Write data from the buffer to video display based on Graphics Output setting.\r
-\r
- @param Private Consplitter Text Out pointer.\r
- @param GraphicsOutput Graphics Output protocol pointer.\r
- @param UgaDraw UGA Draw protocol pointer.\r
-\r
- @retval EFI_UNSUPPORTED No graphics devcie available .\r
- @retval EFI_SUCCESS The Blt operation completed.\r
- @retval EFI_INVALID_PARAMETER BltOperation is not valid.\r
- @retval EFI_DEVICE_ERROR A hardware error occured writting to the video buffer.\r
-\r
-\r
-**/\r
-EFI_STATUS\r
-DevNullGopSync (\r
- IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,\r
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,\r
- IN EFI_UGA_DRAW_PROTOCOL *UgaDraw\r
- );\r
\r
/**\r
Return the current video mode information.\r
**/\r
EFI_STATUS\r
EFIAPI\r
-ConSpliterUgaDrawGetMode (\r
+ConSplitterUgaDrawGetMode (\r
IN EFI_UGA_DRAW_PROTOCOL *This,\r
OUT UINT32 *HorizontalResolution,\r
OUT UINT32 *VerticalResolution,\r
**/\r
EFI_STATUS\r
EFIAPI\r
-ConSpliterUgaDrawSetMode (\r
+ConSplitterUgaDrawSetMode (\r
IN EFI_UGA_DRAW_PROTOCOL *This,\r
IN UINT32 HorizontalResolution,\r
IN UINT32 VerticalResolution,\r
**/\r
EFI_STATUS\r
EFIAPI\r
-ConSpliterUgaDrawBlt (\r
+ConSplitterUgaDrawBlt (\r
IN EFI_UGA_DRAW_PROTOCOL *This,\r
IN EFI_UGA_PIXEL *BltBuffer, OPTIONAL\r
IN EFI_UGA_BLT_OPERATION BltOperation,\r
IN UINTN Delta OPTIONAL\r
);\r
\r
-/**\r
- Write data from the buffer to video display based on UGA Draw setting.\r
-\r
- @param Private Consplitter Text Out pointer.\r
- @param GraphicsOutput Graphics Output protocol pointer.\r
- @param UgaDraw UGA Draw protocol pointer.\r
-\r
- @retval EFI_UNSUPPORTED No graphics devcie available .\r
- @retval EFI_SUCCESS The Blt operation completed.\r
- @retval EFI_INVALID_PARAMETER BltOperation is not valid.\r
- @retval EFI_DEVICE_ERROR A hardware error occured writting to the video buffer.\r
-\r
-**/\r
-EFI_STATUS\r
-DevNullUgaSync (\r
- IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,\r
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,\r
- IN EFI_UGA_DRAW_PROTOCOL *UgaDraw\r
- );\r
-\r
-/**\r
- Write a Unicode string to the output device.\r
-\r
- @param Private Pointer to the console output splitter's private\r
- data. It indicates the calling context.\r
- @param WString The NULL-terminated Unicode string to be\r
- displayed on the output device(s). All output\r
- devices must also support the Unicode drawing\r
- defined in this file.\r
-\r
- @retval EFI_SUCCESS The string was output to the device.\r
- @retval EFI_DEVICE_ERROR The device reported an error while attempting to\r
- output the text.\r
- @retval EFI_UNSUPPORTED The output device's mode is not currently in a\r
- defined text mode.\r
- @retval EFI_WARN_UNKNOWN_GLYPH This warning code indicates that some of the\r
- characters in the Unicode string could not be\r
- rendered and were skipped.\r
-\r
-**/\r
-EFI_STATUS\r
-DevNullTextOutOutputString (\r
- IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,\r
- IN CHAR16 *WString\r
- );\r
-\r
/**\r
Sets the output device(s) to a specified mode.\r
\r
@param Private Text Out Splitter pointer.\r
@param ModeNumber The mode number to set.\r
\r
- @retval EFI_SUCCESS The requested text mode was set.\r
- @retval EFI_DEVICE_ERROR The device had an error and could not complete\r
- the request.\r
- @retval EFI_UNSUPPORTED The mode number was not valid.\r
- @retval EFI_OUT_OF_RESOURCES Out of resources.\r
-\r
**/\r
-EFI_STATUS\r
-DevNullTextOutSetMode (\r
+VOID\r
+TextOutSetMode (\r
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,\r
IN UINTN ModeNumber\r
);\r
\r
-/**\r
- Clears the output device(s) display to the currently selected background\r
- color.\r
-\r
- @param Private Text Out Splitter pointer.\r
-\r
- @retval EFI_SUCCESS The operation completed successfully.\r
- @retval EFI_DEVICE_ERROR The device had an error and could not complete\r
- the request.\r
- @retval EFI_UNSUPPORTED The output device is not in a valid text mode.\r
-\r
-**/\r
-EFI_STATUS\r
-DevNullTextOutClearScreen (\r
- IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private\r
- );\r
-\r
-/**\r
- Sets the current coordinates of the cursor position on NULL device.\r
-\r
- @param Private Text Out Splitter pointer.\r
- @param Column The column position to set the cursor to. Must be\r
- greater than or equal to zero and less than the\r
- number of columns by QueryMode ().\r
- @param Row The row position to set the cursor to. Must be\r
- greater than or equal to zero and less than the\r
- number of rows by QueryMode ().\r
-\r
- @retval EFI_SUCCESS Always returned.\r
-\r
-**/\r
-EFI_STATUS\r
-DevNullTextOutSetCursorPosition (\r
- IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,\r
- IN UINTN Column,\r
- IN UINTN Row\r
- );\r
-\r
-/**\r
- Set cursor visibility property on NULL device.\r
-\r
- @param Private Text Out Splitter pointer.\r
- @param Visible If TRUE, the cursor is set to be visible, If\r
- FALSE, the cursor is set to be invisible.\r
-\r
- @retval EFI_SUCCESS Always returned.\r
-\r
-**/\r
-EFI_STATUS\r
-DevNullTextOutEnableCursor (\r
- IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,\r
- IN BOOLEAN Visible\r
- );\r
-\r
-/**\r
- Take the DevNull TextOut device and update the Simple Text Out on every\r
- UGA device.\r
-\r
- @param Private Text Out Splitter pointer.\r
-\r
- @retval EFI_SUCCESS The request is valid.\r
- @retval other Return status of TextOut->OutputString ()\r
-\r
-**/\r
-EFI_STATUS\r
-DevNullSyncStdOut (\r
- IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private\r
- );\r
\r
#endif\r