]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Universal / Console / ConSplitterDxe / ConSplitter.h
index 3bfa24548a93755d01875497521149a0c5f8128b..e9b68e58c6d77ac8b824e8b0a6915943b8f832a2 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
   Private data structures for the Console Splitter driver\r
 \r
-Copyright (c) 2006 - 2009, Intel Corporation. <BR>\r
-All rights reserved. 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
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -16,6 +10,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define _CON_SPLITTER_H_\r
 \r
 #include <Uefi.h>\r
+#include <PiDxe.h>\r
 \r
 #include <Protocol/DevicePath.h>\r
 #include <Protocol/ComponentName.h>\r
@@ -31,6 +26,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Guid/ConsoleInDevice.h>\r
 #include <Guid/StandardErrorDevice.h>\r
 #include <Guid/ConsoleOutDevice.h>\r
+#include <Guid/ConnectConInEvent.h>\r
 \r
 #include <Library/PcdLib.h>\r
 #include <Library/DebugLib.h>\r
@@ -42,7 +38,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/UefiRuntimeServicesTableLib.h>\r
 \r
-\r
 //\r
 // Driver Binding Externs\r
 //\r
@@ -74,8 +69,7 @@ extern EFI_COMPONENT_NAME2_PROTOCOL gConSplitterStdErrComponentName2;
 //\r
 // Private Data Structures\r
 //\r
-#define CONSOLE_SPLITTER_CONSOLES_ALLOC_UNIT  32\r
-#define CONSOLE_SPLITTER_MODES_ALLOC_UNIT     32\r
+#define CONSOLE_SPLITTER_ALLOC_UNIT  32\r
 \r
 \r
 typedef struct {\r
@@ -88,6 +82,7 @@ typedef struct {
   UINTN   Rows;\r
 } TEXT_OUT_SPLITTER_QUERY_DATA;\r
 \r
+#define KEY_STATE_VALID_EXPOSED (EFI_TOGGLE_STATE_VALID | EFI_KEY_STATE_EXPOSED)\r
 \r
 #define TEXT_IN_EX_SPLITTER_NOTIFY_SIGNATURE    SIGNATURE_32 ('T', 'i', 'S', 'n')\r
 \r
@@ -96,8 +91,7 @@ typedef struct {
 //\r
 typedef struct _TEXT_IN_EX_SPLITTER_NOTIFY {\r
   UINTN                                 Signature;\r
-  EFI_HANDLE                            *NotifyHandleList;\r
-  EFI_HANDLE                            NotifyHandle;\r
+  VOID                                  **NotifyHandleList;\r
   EFI_KEY_DATA                          KeyData;\r
   EFI_KEY_NOTIFY_FUNCTION               KeyNotificationFn;\r
   LIST_ENTRY                            NotifyEntry;\r
@@ -129,6 +123,18 @@ typedef struct {
   EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  **TextInExList;\r
   UINTN                              TextInExListCount;\r
   LIST_ENTRY                         NotifyList;\r
+  EFI_KEY_DATA                       *KeyQueue;\r
+  UINTN                              CurrentNumberOfKeys;\r
+  //\r
+  // It will be initialized and synced between console input devices\r
+  // for toggle state sync.\r
+  //\r
+  EFI_KEY_TOGGLE_STATE               PhysicalKeyToggleState;\r
+  //\r
+  // It will be initialized and used to record if virtual KeyState\r
+  // has been required to be exposed.\r
+  //\r
+  BOOLEAN                            VirtualKeyStateExported;\r
 \r
 \r
   EFI_SIMPLE_POINTER_PROTOCOL        SimplePointer;\r
@@ -146,6 +152,7 @@ typedef struct {
 \r
   BOOLEAN                            KeyEventSignalState;\r
   BOOLEAN                            InputEventSignalState;\r
+  EFI_EVENT                          ConnectConInEvent;\r
 } TEXT_IN_SPLITTER_PRIVATE_DATA;\r
 \r
 #define TEXT_IN_SPLITTER_PRIVATE_DATA_FROM_THIS(a)  \\r
@@ -203,7 +210,6 @@ typedef struct {
   EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  *GraphicsOutputModeBuffer;\r
   UINTN                                 CurrentNumberOfGraphicsOutput;\r
   UINTN                                 CurrentNumberOfUgaDraw;\r
-  BOOLEAN                               HardwareNeedsStarting;\r
 \r
   UINTN                                 CurrentNumberOfConsoles;\r
   TEXT_OUT_AND_GOP_DATA                 *TextOutList;\r
@@ -729,7 +735,7 @@ ConSplitterAbsolutePointerWaitForInput (
                                 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
@@ -794,7 +800,7 @@ ConSplitterComponentNameGetDriverName (
                                 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
@@ -808,7 +814,7 @@ ConSplitterComponentNameGetDriverName (
                                 driver specified by This was returned in\r
                                 DriverName.\r
 \r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
 \r
   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
                                 EFI_HANDLE.\r
@@ -873,7 +879,7 @@ ConSplitterConInComponentNameGetControllerName (
                                 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
@@ -887,7 +893,7 @@ ConSplitterConInComponentNameGetControllerName (
                                 driver specified by This was returned in\r
                                 DriverName.\r
 \r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
 \r
   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
                                 EFI_HANDLE.\r
@@ -931,7 +937,7 @@ ConSplitterSimplePointerComponentNameGetControllerName (
                                  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
@@ -946,7 +952,7 @@ ConSplitterSimplePointerComponentNameGetControllerName (
   @retval EFI_SUCCESS            The Unicode string for the user readable name in\r
                                  the language specified by Language for the driver\r
                                  specified by This was returned in DriverName.\r
-  @retval EFI_INVALID_PARAMETER  ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER  ControllerHandle is NULL.\r
   @retval EFI_INVALID_PARAMETER  ChildHandle is not NULL and it is not a valid\r
                                  EFI_HANDLE.\r
   @retval EFI_INVALID_PARAMETER  Language is NULL.\r
@@ -1005,7 +1011,7 @@ ConSplitterAbsolutePointerComponentNameGetControllerName (
                                 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
@@ -1019,7 +1025,7 @@ ConSplitterAbsolutePointerComponentNameGetControllerName (
                                 driver specified by This was returned in\r
                                 DriverName.\r
 \r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
 \r
   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
                                 EFI_HANDLE.\r
@@ -1084,7 +1090,7 @@ ConSplitterConOutComponentNameGetControllerName (
                                 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
@@ -1098,7 +1104,7 @@ ConSplitterConOutComponentNameGetControllerName (
                                 driver specified by This was returned in\r
                                 DriverName.\r
 \r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
 \r
   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
                                 EFI_HANDLE.\r
@@ -1386,11 +1392,14 @@ ConSplitterTextInSetState (
   Register a notification function for a particular keystroke for the input device.\r
 \r
   @param  This                     Protocol instance pointer.\r
-  @param  KeyData                  A pointer to a buffer that is filled in with the\r
-                                   keystroke information data for the key that was\r
-                                   pressed.\r
+  @param  KeyData                  A pointer to a buffer that is filled in with\r
+                                   the keystroke information for the key that was\r
+                                   pressed. If KeyData.Key, KeyData.KeyState.KeyToggleState\r
+                                   and KeyData.KeyState.KeyShiftState are 0, then any incomplete\r
+                                   keystroke will trigger a notification of the KeyNotificationFunction.\r
   @param  KeyNotificationFunction  Points to the function to be called when the key\r
-                                   sequence is typed specified by KeyData.\r
+                                   sequence is typed specified by KeyData. This notification function\r
+                                   should be called at <=TPL_CALLBACK.\r
   @param  NotifyHandle             Points to the unique handle assigned to the\r
                                    registered notification.\r
 \r
@@ -1407,7 +1416,7 @@ ConSplitterTextInRegisterKeyNotify (
   IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,\r
   IN EFI_KEY_DATA                       *KeyData,\r
   IN EFI_KEY_NOTIFY_FUNCTION            KeyNotificationFunction,\r
-  OUT EFI_HANDLE                        *NotifyHandle\r
+  OUT VOID                              **NotifyHandle\r
   );\r
 \r
 \r
@@ -1428,7 +1437,7 @@ EFI_STATUS
 EFIAPI\r
 ConSplitterTextInUnregisterKeyNotify (\r
   IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL  *This,\r
-  IN EFI_HANDLE                         NotificationHandle\r
+  IN VOID                               *NotificationHandle\r
   );\r
 \r
 /**\r
@@ -1733,12 +1742,12 @@ ConSplitterTextOutEnableCursor (
   );\r
 \r
 /**\r
-  Take the passed in Buffer of size SizeOfCount and grow the buffer\r
-  by MAX (CONSOLE_SPLITTER_CONSOLES_ALLOC_UNIT, MaxGrow) * SizeOfCount\r
-  bytes. Copy the current data in Buffer to the new version of Buffer\r
-  and free the old version of buffer.\r
+  Take the passed in Buffer of size ElementSize and grow the buffer\r
+  by CONSOLE_SPLITTER_ALLOC_UNIT * ElementSize bytes.\r
+  Copy the current data in Buffer to the new version of Buffer and\r
+  free the old version of buffer.\r
 \r
-  @param  SizeOfCount              Size of element in array.\r
+  @param  ElementSize              Size of element in array.\r
   @param  Count                    Current number of elements in array.\r
   @param  Buffer                   Bigger version of passed in Buffer with all the\r
                                    data.\r
@@ -1749,8 +1758,8 @@ ConSplitterTextOutEnableCursor (
 **/\r
 EFI_STATUS\r
 ConSplitterGrowBuffer (\r
-  IN  UINTN                           SizeOfCount,\r
-  IN  UINTN                           *Count,\r
+  IN      UINTN                       ElementSize,\r
+  IN OUT  UINTN                       *Count,\r
   IN OUT  VOID                        **Buffer\r
   );\r
 \r
@@ -1766,14 +1775,13 @@ ConSplitterGrowBuffer (
   @retval EFI_SUCCESS           Mode information returned.\r
   @retval EFI_BUFFER_TOO_SMALL  The Info buffer was too small.\r
   @retval EFI_DEVICE_ERROR      A hardware error occurred trying to retrieve the video mode.\r
-  @retval EFI_NOT_STARTED       Video display is not initialized. Call SetMode ()\r
   @retval EFI_INVALID_PARAMETER One of the input args was NULL.\r
   @retval EFI_OUT_OF_RESOURCES  No resource available.\r
 \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
@@ -1795,7 +1803,7 @@ ConSpliterGraphicsOutputQueryMode (
 **/\r
 EFI_STATUS\r
 EFIAPI\r
-ConSpliterGraphicsOutputSetMode (\r
+ConSplitterGraphicsOutputSetMode (\r
   IN  EFI_GRAPHICS_OUTPUT_PROTOCOL * This,\r
   IN  UINT32                       ModeNumber\r
   );\r
@@ -1848,7 +1856,7 @@ ConSpliterGraphicsOutputSetMode (
 **/\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
@@ -1878,7 +1886,7 @@ ConSpliterGraphicsOutputBlt (
 **/\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
@@ -1902,7 +1910,7 @@ ConSpliterUgaDrawGetMode (
 **/\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
@@ -1961,7 +1969,7 @@ ConSpliterUgaDrawSetMode (
 **/\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
@@ -1987,5 +1995,4 @@ TextOutSetMode (
   IN  UINTN                           ModeNumber\r
   );\r
 \r
-\r
 #endif\r