#include "ConSplitter.h"\r
\r
//\r
-// Global Variables\r
+// Template for Text In Splitter\r
//\r
-STATIC TEXT_IN_SPLITTER_PRIVATE_DATA mConIn = {\r
+TEXT_IN_SPLITTER_PRIVATE_DATA mConIn = {\r
TEXT_IN_SPLITTER_PRIVATE_DATA_SIGNATURE,\r
(EFI_HANDLE) NULL,\r
{\r
FALSE\r
};\r
\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_UGA_DRAW_PROTOCOL gUgaDrawProtocolTemplate = {\r
+//\r
+// Template for Uga Draw Protocol\r
+//\r
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_UGA_DRAW_PROTOCOL mUgaDrawProtocolTemplate = {\r
ConSpliterUgaDrawGetMode,\r
ConSpliterUgaDrawSetMode,\r
ConSpliterUgaDrawBlt\r
};\r
\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GRAPHICS_OUTPUT_PROTOCOL gGraphicsOutputProtocolTemplate = {\r
+//\r
+// Template for Graphics Output Protocol\r
+//\r
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_GRAPHICS_OUTPUT_PROTOCOL mGraphicsOutputProtocolTemplate = {\r
ConSpliterGraphicsOutputQueryMode,\r
ConSpliterGraphicsOutputSetMode,\r
ConSpliterGraphicsOutputBlt,\r
NULL\r
};\r
\r
-STATIC TEXT_OUT_SPLITTER_PRIVATE_DATA mConOut = {\r
+//\r
+// Template for Text Out Splitter\r
+//\r
+TEXT_OUT_SPLITTER_PRIVATE_DATA mConOut = {\r
TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE,\r
(EFI_HANDLE) NULL,\r
{\r
(INT32 *) NULL\r
};\r
\r
-STATIC TEXT_OUT_SPLITTER_PRIVATE_DATA mStdErr = {\r
+//\r
+// Template for Standard Error Text Out Splitter\r
+//\r
+TEXT_OUT_SPLITTER_PRIVATE_DATA mStdErr = {\r
TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE,\r
(EFI_HANDLE) NULL,\r
{\r
(INT32 *) NULL\r
};\r
\r
+//\r
+// Driver binding instance for Console Input Device\r
+//\r
EFI_DRIVER_BINDING_PROTOCOL gConSplitterConInDriverBinding = {\r
ConSplitterConInDriverBindingSupported,\r
ConSplitterConInDriverBindingStart,\r
NULL\r
};\r
\r
+//\r
+// Driver binding instance for Simple Pointer protocol\r
+//\r
EFI_DRIVER_BINDING_PROTOCOL gConSplitterSimplePointerDriverBinding = {\r
ConSplitterSimplePointerDriverBindingSupported,\r
ConSplitterSimplePointerDriverBindingStart,\r
NULL\r
};\r
\r
+//\r
+// Driver binding instance for Console Out device\r
+//\r
EFI_DRIVER_BINDING_PROTOCOL gConSplitterConOutDriverBinding = {\r
ConSplitterConOutDriverBindingSupported,\r
ConSplitterConOutDriverBindingStart,\r
NULL\r
};\r
\r
+//\r
+// Driver binding instance for Standard Error device\r
+//\r
EFI_DRIVER_BINDING_PROTOCOL gConSplitterStdErrDriverBinding = {\r
ConSplitterStdErrDriverBindingSupported,\r
ConSplitterStdErrDriverBindingStart,\r
/**\r
The user Entry Point for module ConSplitter. The user code starts with this function.\r
\r
+ Installs driver module protocols and. Creates virtual device handles for ConIn,\r
+ ConOut, and StdErr. Installs Simple Text In protocol, Simple Text In Ex protocol,\r
+ Simple Pointer protocol, Absolute Pointer protocol on those virtual handlers. \r
+ Installs Graphics Output protocol and/or UGA Draw protocol if needed.\r
+\r
@param[in] ImageHandle The firmware allocated handle for the EFI image.\r
@param[in] SystemTable A pointer to the EFI System Table.\r
\r
**/\r
EFI_STATUS\r
EFIAPI\r
-InitializeConSplitter(\r
+ConSplitterDriverEntry(\r
IN EFI_HANDLE ImageHandle,\r
IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
ASSERT_EFI_ERROR (Status);\r
\r
\r
- //\r
- // Call the original Entry Point\r
- //\r
- Status = ConSplitterDriverEntry (ImageHandle, SystemTable);\r
-\r
- return Status;\r
-}\r
-\r
-\r
-\r
-/**\r
- Intialize a virtual console device to act as an agrigator of physical console\r
- devices.\r
-\r
- @param ImageHandle (Standard EFI Image entry -\r
- EFI_IMAGE_ENTRY_POINT)\r
- @param SystemTable (Standard EFI Image entry -\r
- EFI_IMAGE_ENTRY_POINT)\r
- EFI_SUCCESS\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-ConSplitterDriverEntry (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- )\r
-{\r
- EFI_STATUS Status;\r
-\r
ASSERT (FeaturePcdGet (PcdConOutGopSupport) ||\r
FeaturePcdGet (PcdConOutUgaSupport));\r
//\r
);\r
\r
return EFI_SUCCESS;\r
+\r
}\r
\r
\r
/**\r
- Construct the ConSplitter.\r
+ Construct console input devices' private data.\r
\r
@param ConInPrivate A pointer to the TEXT_IN_SPLITTER_PRIVATE_DATA\r
structure.\r
\r
@retval EFI_OUT_OF_RESOURCES Out of resources.\r
+ @retval EFI_SUCCESS Text Input Devcie's private data has been constructed.\r
+ @retval other Failed to construct private data.\r
\r
**/\r
EFI_STATUS\r
return Status;\r
}\r
\r
+/**\r
+ Construct console output devices' private data.\r
+\r
+ @param ConOutPrivate A pointer to the TEXT_IN_SPLITTER_PRIVATE_DATA\r
+ structure.\r
+\r
+ @retval EFI_OUT_OF_RESOURCES Out of resources.\r
+ @retval EFI_SUCCESS Text Input Devcie's private data has been constructed.\r
+\r
+**/\r
EFI_STATUS\r
ConSplitterTextOutConstructor (\r
TEXT_OUT_SPLITTER_PRIVATE_DATA *ConOutPrivate\r
// Copy protocols template\r
//\r
if (FeaturePcdGet (PcdConOutUgaSupport)) {\r
- CopyMem (&ConOutPrivate->UgaDraw, &gUgaDrawProtocolTemplate, sizeof (EFI_UGA_DRAW_PROTOCOL));\r
+ CopyMem (&ConOutPrivate->UgaDraw, &mUgaDrawProtocolTemplate, sizeof (EFI_UGA_DRAW_PROTOCOL));\r
}\r
\r
if (FeaturePcdGet (PcdConOutGopSupport)) {\r
- CopyMem (&ConOutPrivate->GraphicsOutput, &gGraphicsOutputProtocolTemplate, sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL));\r
+ CopyMem (&ConOutPrivate->GraphicsOutput, &mGraphicsOutputProtocolTemplate, sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL));\r
}\r
\r
//\r
\r
ConOutPrivate->GraphicsOutput.Mode->MaxMode = 1;\r
//\r
- // Initial current mode to unknow state, and then set to mode 0\r
+ // Initial current mode to unknown state, and then set to mode 0\r
//\r
ConOutPrivate->GraphicsOutput.Mode->Mode = 0xffff;\r
ConOutPrivate->GraphicsOutput.SetMode (&ConOutPrivate->GraphicsOutput, 0);\r
}\r
\r
- return Status;\r
+ return EFI_SUCCESS;\r
}\r
\r
\r
/**\r
- Generic Supported Check\r
+ Test to see if the specified protocol could be supported on the ControllerHandle. \r
\r
- @param This Pointer to protocol.\r
- @param ControllerHandle Controller Handle.\r
- @param Guid Guid.\r
+ @param This Protocol instance pointer.\r
+ @param ControllerHandle Handle of device to test.\r
+ @param Guid The specified protocol guid.\r
\r
- @retval EFI_UNSUPPORTED unsupported.\r
- @retval EFI_SUCCESS operation is OK.\r
+ @retval EFI_SUCCESS The specified protocol is supported on this device.\r
+ @retval other The specified protocol is not supported on this device.\r
\r
**/\r
EFI_STATUS\r
return EFI_SUCCESS;\r
}\r
\r
-\r
/**\r
- Console In Supported Check\r
+ Test to see if Console In Device could be supported on the ControllerHandle. \r
\r
- @param This Pointer to protocol.\r
- @param ControllerHandle Controller handle.\r
- @param RemainingDevicePath Remaining device path.\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
- @return EFI_STATUS\r
+ @retval EFI_SUCCESS This driver supports this device.\r
+ @retval other This driver does not support this device.\r
\r
**/\r
EFI_STATUS\r
);\r
}\r
\r
-\r
/**\r
- Standard Error Supported Check\r
+ Test to see if Simple Pointer protocol could be supported on the ControllerHandle. \r
\r
- @param This Pointer to protocol.\r
- @param ControllerHandle Controller handle.\r
- @param RemainingDevicePath Remaining device path.\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
- @return EFI_STATUS\r
+ @retval EFI_SUCCESS This driver supports this device.\r
+ @retval other This driver does not support this device.\r
\r
**/\r
EFI_STATUS\r
\r
\r
/**\r
- Absolute Pointer Supported Check\r
+ Test to see if Absolute Pointer protocol could be supported on the ControllerHandle. \r
\r
- @param This Pointer to protocol.\r
- @param ControllerHandle Controller handle.\r
- @param RemainingDevicePath Remaining device path.\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
- @return EFI_STATUS\r
+ @retval EFI_SUCCESS This driver supports this device.\r
+ @retval other This driver does not support this device.\r
\r
**/\r
EFI_STATUS\r
\r
\r
/**\r
- Console Out Supported Check\r
+ Test to see if Console Out Device could be supported on the ControllerHandle. \r
\r
- @param This Pointer to protocol.\r
- @param ControllerHandle Controller handle.\r
- @param RemainingDevicePath Remaining device path.\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
- @return EFI_STATUS\r
+ @retval EFI_SUCCESS This driver supports this device.\r
+ @retval other This driver does not support this device.\r
\r
**/\r
EFI_STATUS\r
);\r
}\r
\r
-\r
/**\r
- Standard Error Supported Check\r
+ Test to see if Standard Error Device could be supported on the ControllerHandle. \r
\r
- @param This Pointer to protocol.\r
- @param ControllerHandle Controller handle.\r
- @param RemainingDevicePath Remaining device path.\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
- @return EFI_STATUS\r
+ @retval EFI_SUCCESS This driver supports this device.\r
+ @retval other This driver does not support this device.\r
\r
**/\r
EFI_STATUS\r
\r
\r
/**\r
- Start ConSplitter on ControllerHandle, and create the virtual\r
- agrogated console device on first call Start for a SimpleTextIn handle.\r
-\r
- (Standard DriverBinding Protocol Start() function)\r
-\r
- @return EFI_ERROR if a SimpleTextIn protocol is not started.\r
+ Start ConSplitter on devcie handle by opening Console Device Guid on device handle \r
+ and the console virtual handle. And Get the console interface on controller handle.\r
+ \r
+ @param This Protocol instance pointer.\r
+ @param ControllerHandle Handle of device.\r
+ @param ConSplitterVirtualHandle Console virtual Handle.\r
+ @param DeviceGuid The specified Console Device, such as ConInDev,\r
+ ConOutDev.\r
+ @param InterfaceGuid The specified protocol to be opened.\r
+ @param Interface Protocol interface returned.\r
+\r
+ @retval EFI_SUCCESS This driver supports this device.\r
+ @retval other Failed to open the specified Console Device Guid\r
+ or specified protocol.\r
\r
**/\r
EFI_STATUS\r
-EFIAPI\r
ConSplitterStart (\r
IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
IN EFI_HANDLE ControllerHandle,\r
IN EFI_HANDLE ConSplitterVirtualHandle,\r
IN EFI_GUID *DeviceGuid,\r
IN EFI_GUID *InterfaceGuid,\r
- IN VOID **Interface\r
+ OUT VOID **Interface\r
)\r
{\r
EFI_STATUS Status;\r
VOID *Instance;\r
\r
//\r
- // Check to see whether the handle has the ConsoleInDevice GUID on it\r
+ // Check to see whether the ControllerHandle has the InterfaceGuid on it.\r
//\r
Status = gBS->OpenProtocol (\r
ControllerHandle,\r
\r
\r
/**\r
- Start ConSplitter on ControllerHandle, and create the virtual\r
- agrogated console device on first call Start for a SimpleTextIn handle.\r
+ Start Console In Consplitter on device handle. \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
- @param This Pointer to protocol.\r
- @param ControllerHandle Controller handle.\r
- @param RemainingDevicePath Remaining device path.\r
-\r
- @return EFI_STATUS\r
- @return EFI_ERROR if a SimpleTextIn protocol is not started.\r
+ @retval EFI_SUCCESS Console In Consplitter is added to ControllerHandle.\r
+ @retval other Console In Consplitter does not support this device.\r
\r
**/\r
EFI_STATUS\r
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
)\r
{\r
- EFI_STATUS Status;\r
- EFI_SIMPLE_TEXT_INPUT_PROTOCOL *TextIn;\r
- EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInEx;\r
+ EFI_STATUS Status;\r
+ EFI_SIMPLE_TEXT_INPUT_PROTOCOL *TextIn;\r
+ EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInEx;\r
\r
//\r
// Start ConSplitter on ControllerHandle, and create the virtual\r
return Status;\r
}\r
\r
+ //\r
+ // Add this device into Text In devices list.\r
+ //\r
Status = ConSplitterTextInAddDevice (&mConIn, TextIn);\r
if (EFI_ERROR (Status)) {\r
return Status;\r
mConIn.VirtualHandle,\r
EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
+ if (!EFI_ERROR (Status)) {\r
+ //\r
+ // If Simple Text Input Ex protocol exists,\r
+ // add this device into Text In Ex devices list.\r
+ //\r
+ Status = ConSplitterTextInExAddDevice (&mConIn, TextInEx);\r
}\r
\r
- Status = ConSplitterTextInExAddDevice (&mConIn, TextInEx);\r
-\r
return Status;\r
}\r
\r
\r
/**\r
- Start ConSplitter on ControllerHandle, and create the virtual\r
- agrogated console device on first call Start for a SimpleTextIn handle.\r
+ Start Simple Pointer Consplitter on device handle. \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
- @param This Pointer to protocol.\r
- @param ControllerHandle Controller handle.\r
- @param RemainingDevicePath Remaining device path.\r
-\r
- @return EFI_ERROR if a SimpleTextIn protocol is not started.\r
+ @retval EFI_SUCCESS Simple Pointer Consplitter is added to ControllerHandle.\r
+ @retval other Simple Pointer Consplitter does not support this device.\r
\r
**/\r
EFI_STATUS\r
EFI_STATUS Status;\r
EFI_SIMPLE_POINTER_PROTOCOL *SimplePointer;\r
\r
+ //\r
+ // Start ConSplitter on ControllerHandle, and create the virtual\r
+ // agrogated console device on first call Start for a SimplePointer handle.\r
+ //\r
Status = ConSplitterStart (\r
This,\r
ControllerHandle,\r
return Status;\r
}\r
\r
+ //\r
+ // Add this devcie into Simple Pointer devices list.\r
+ //\r
return ConSplitterSimplePointerAddDevice (&mConIn, SimplePointer);\r
}\r
\r
\r
/**\r
- Start ConSplitter on ControllerHandle, and create the virtual\r
- agrogated console device on first call Start for a ConIn handle.\r
-\r
- @param This Pointer to protocol.\r
- @param ControllerHandle Controller handle.\r
- @param RemainingDevicePath Remaining device path.\r
+ Start Absolute Pointer Consplitter on device handle. \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
- @return EFI_ERROR if a AbsolutePointer protocol is not started.\r
+ @retval EFI_SUCCESS Absolute Pointer Consplitter is added to ControllerHandle.\r
+ @retval other Absolute Pointer Consplitter does not support this device.\r
\r
**/\r
EFI_STATUS\r
EFI_STATUS Status;\r
EFI_ABSOLUTE_POINTER_PROTOCOL *AbsolutePointer;\r
\r
+ //\r
+ // Start ConSplitter on ControllerHandle, and create the virtual\r
+ // agrogated console device on first call Start for a AbsolutePointer handle.\r
+ //\r
Status = ConSplitterStart (\r
This,\r
ControllerHandle,\r
return Status;\r
}\r
\r
+ //\r
+ // Add this devcie into Absolute Pointer devices list.\r
+ //\r
return ConSplitterAbsolutePointerAddDevice (&mConIn, AbsolutePointer);\r
}\r
\r
\r
/**\r
- Start ConSplitter on ControllerHandle, and create the virtual\r
- agrogated console device on first call Start for a SimpleTextIn handle.\r
+ Start Console Out Consplitter on device handle. \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
- @param This Pointer to protocol.\r
- @param ControllerHandle Controller handle.\r
- @param RemainingDevicePath Remaining device path.\r
-\r
- @return EFI_ERROR if a SimpleTextIn protocol is not started.\r
+ @retval EFI_SUCCESS Console Out Consplitter is added to ControllerHandle.\r
+ @retval other Console Out Consplitter does not support this device.\r
\r
**/\r
EFI_STATUS\r
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;\r
EFI_UGA_DRAW_PROTOCOL *UgaDraw;\r
\r
+ //\r
+ // Start ConSplitter on ControllerHandle, and create the virtual\r
+ // agrogated console device on first call Start for a ConsoleOut handle.\r
+ //\r
Status = ConSplitterStart (\r
This,\r
ControllerHandle,\r
\r
if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {\r
//\r
- // Open UGA_DRAW protocol\r
+ // Open UGA DRAW protocol\r
//\r
Status = gBS->OpenProtocol (\r
ControllerHandle,\r
\r
\r
/**\r
- Start ConSplitter on ControllerHandle, and create the virtual\r
- agrogated console device on first call Start for a SimpleTextIn handle.\r
-\r
- @param This Pointer to protocol.\r
- @param ControllerHandle Controller handle.\r
- @param RemainingDevicePath Remaining device path.\r
+ Start Standard Error Consplitter on device handle. \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
- @return EFI_ERROR if a SimpleTextIn protocol is not started.\r
+ @retval EFI_SUCCESS Standard Error Consplitter is added to ControllerHandle.\r
+ @retval other Standard Error Consplitter does not support this device.\r
\r
**/\r
EFI_STATUS\r
EFI_STATUS Status;\r
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut;\r
\r
+ //\r
+ // Start ConSplitter on ControllerHandle, and create the virtual\r
+ // agrogated console device on first call Start for a StandardError handle.\r
+ //\r
Status = ConSplitterStart (\r
This,\r
ControllerHandle,\r
\r
\r
/**\r
-\r
- (Standard DriverBinding Protocol Stop() function)\r
-\r
- @return None\r
+ Stop ConSplitter on device handle by closing Console Device Guid on device handle \r
+ and the console virtual handle.\r
+ \r
+ @param This Protocol instance pointer.\r
+ @param ControllerHandle Handle of device.\r
+ @param ConSplitterVirtualHandle Console virtual Handle.\r
+ @param DeviceGuid The specified Console Device, such as ConInDev,\r
+ ConOutDev.\r
+ @param InterfaceGuid The specified protocol to be opened.\r
+ @param Interface Protocol interface returned.\r
+\r
+ @retval EFI_SUCCESS Stop ConSplitter on ControllerHandle successfully.\r
+ @retval other Failed to Stop ConSplitter on ControllerHandle.\r
\r
**/\r
EFI_STATUS\r
-EFIAPI\r
ConSplitterStop (\r
IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
IN EFI_HANDLE ControllerHandle,\r
This->DriverBindingHandle,\r
ConSplitterVirtualHandle\r
);\r
+\r
gBS->CloseProtocol (\r
ControllerHandle,\r
DeviceGuid,\r
\r
\r
/**\r
+ Stop Console In ConSplitter on ControllerHandle by closing Console In Devcice GUID.\r
\r
- (Standard DriverBinding Protocol Stop() function)\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
- @return None\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
IN EFI_HANDLE *ChildHandleBuffer\r
)\r
{\r
- EFI_STATUS Status;\r
- EFI_SIMPLE_TEXT_INPUT_PROTOCOL *TextIn;\r
-\r
+ EFI_STATUS Status;\r
+ EFI_SIMPLE_TEXT_INPUT_PROTOCOL *TextIn;\r
EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInEx;\r
+\r
if (NumberOfChildren == 0) {\r
return EFI_SUCCESS;\r
}\r
ControllerHandle,\r
EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- Status = ConSplitterTextInExDeleteDevice (&mConIn, TextInEx);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
+ if (!EFI_ERROR (Status)) {\r
+ //\r
+ // If Simple Text Input Ex protocol exists,\r
+ // remove device from Text Input Ex devices list.\r
+ // \r
+ Status = ConSplitterTextInExDeleteDevice (&mConIn, TextInEx);\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
}\r
\r
-\r
+ //\r
+ // Close Simple Text In protocol on controller handle and virtual handle.\r
+ //\r
Status = ConSplitterStop (\r
This,\r
ControllerHandle,\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
+\r
//\r
- // Delete this console input device's data structures.\r
- //\r
+ // Remove device from Text Input devices list.\r
+ // \r
return ConSplitterTextInDeleteDevice (&mConIn, TextIn);\r
}\r
\r
\r
/**\r
+ Stop Simple Pointer protocol ConSplitter on ControllerHandle by closing\r
+ Simple Pointer protocol.\r
\r
- (Standard DriverBinding Protocol Stop() function)\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
- @return None\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
return EFI_SUCCESS;\r
}\r
\r
+ //\r
+ // Close Simple Pointer protocol on controller handle and virtual handle.\r
+ //\r
Status = ConSplitterStop (\r
This,\r
ControllerHandle,\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
+\r
//\r
- // Delete this console input device's data structures.\r
+ // Remove this device from Simple Pointer device list.\r
//\r
return ConSplitterSimplePointerDeleteDevice (&mConIn, SimplePointer);\r
}\r
\r
\r
/**\r
+ Stop Absolute Pointer protocol ConSplitter on ControllerHandle by closing\r
+ Absolute Pointer protocol.\r
\r
- (Standard DriverBinding Protocol Stop() function)\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
- @return None\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
return EFI_SUCCESS;\r
}\r
\r
+ //\r
+ // Close Absolute Pointer protocol on controller handle and virtual handle.\r
+ //\r
Status = ConSplitterStop (\r
This,\r
ControllerHandle,\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
+\r
//\r
- // Delete this console input device's data structures.\r
+ // Remove this device from Absolute Pointer device list.\r
//\r
return ConSplitterAbsolutePointerDeleteDevice (&mConIn, AbsolutePointer);\r
}\r
\r
\r
/**\r
+ Stop Console Out ConSplitter on device handle by closing Console Out Devcice GUID.\r
\r
- (Standard DriverBinding Protocol Stop() function)\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
- @return None\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
return EFI_SUCCESS;\r
}\r
\r
+ //\r
+ // Close Absolute Pointer protocol on controller handle and virtual handle.\r
+ //\r
Status = ConSplitterStop (\r
This,\r
ControllerHandle,\r
}\r
\r
//\r
- // Delete this console output device's data structures.\r
+ // Remove this device from Text Out device list.\r
//\r
return ConSplitterTextOutDeleteDevice (&mConOut, TextOut);\r
}\r
\r
\r
/**\r
+ Stop Standard Error ConSplitter on ControllerHandle by closing Standard Error GUID.\r
\r
- (Standard DriverBinding Protocol Stop() function)\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 Complete successfully.\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
return EFI_SUCCESS;\r
}\r
\r
+ //\r
+ // Close Standard Error Device on controller handle and virtual handle.\r
+ //\r
Status = ConSplitterStop (\r
This,\r
ControllerHandle,\r
data\r
\r
@retval EFI_SUCCESS Buffer size has grown\r
- @retval EFI_OUT_OF_RESOURCES Could not grow the buffer size\r
- @return None\r
+ @retval EFI_OUT_OF_RESOURCES Could not grow the buffer size.\r
\r
**/\r
EFI_STATUS\r
\r
\r
/**\r
+ Add Text Input Device in Consplitter Text Input list.\r
\r
+ @param Private Text In Splitter pointer.\r
+ @param TextIn Simple Text Input protocol pointer.\r
\r
- @return EFI_SUCCESS\r
- @return EFI_OUT_OF_RESOURCES\r
+ @retval EFI_SUCCESS Text Input Device added successfully.\r
+ @retval EFI_OUT_OF_RESOURCES Could not grow the buffer size.\r
\r
**/\r
EFI_STATUS\r
\r
\r
/**\r
+ Remove Simple Text Device in Consplitter Absolute Pointer list.\r
\r
+ @param Private Text In Splitter pointer.\r
+ @param TextIn Simple Text protocol pointer.\r
\r
- @return EFI_SUCCESS\r
- @return EFI_NOT_FOUND\r
+ @retval EFI_SUCCESS Simple Text Device removed successfully.\r
+ @retval EFI_NOT_FOUND No Simple Text Device found.\r
\r
**/\r
EFI_STATUS\r
return EFI_NOT_FOUND;\r
}\r
\r
+/**\r
+ Add Text Input Ex Device in Consplitter Text Input Ex list.\r
+\r
+ @param Private Text In Splitter pointer.\r
+ @param TextInEx Simple Text Ex Input protocol pointer.\r
+\r
+ @retval EFI_SUCCESS Text Input Ex Device added successfully.\r
+ @retval EFI_OUT_OF_RESOURCES Could not grow the buffer size.\r
+\r
+**/\r
EFI_STATUS\r
ConSplitterTextInExAddDevice (\r
IN TEXT_IN_SPLITTER_PRIVATE_DATA *Private,\r
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ Remove Simple Text Ex Device in Consplitter Absolute Pointer list.\r
+\r
+ @param Private Text In Splitter pointer.\r
+ @param TextInEx Simple Text Ex protocol pointer.\r
+\r
+ @retval EFI_SUCCESS Simple Text Ex Device removed successfully.\r
+ @retval EFI_NOT_FOUND No Simple Text Ex Device found.\r
+\r
+**/\r
EFI_STATUS\r
ConSplitterTextInExDeleteDevice (\r
IN TEXT_IN_SPLITTER_PRIVATE_DATA *Private,\r
\r
\r
/**\r
+ Add Simple Pointer Device in Consplitter Simple Pointer list.\r
\r
+ @param Private Text In Splitter pointer.\r
+ @param SimplePointer Simple Pointer protocol pointer.\r
\r
- @return EFI_OUT_OF_RESOURCES\r
- @return EFI_SUCCESS\r
+ @retval EFI_SUCCESS Simple Pointer Device added successfully.\r
+ @retval EFI_OUT_OF_RESOURCES Could not grow the buffer size.\r
\r
**/\r
EFI_STATUS\r
\r
\r
/**\r
+ Remove Simple Pointer Device in Consplitter Absolute Pointer list.\r
\r
+ @param Private Text In Splitter pointer.\r
+ @param SimplePointer Simple Pointer protocol pointer.\r
\r
- @return None\r
+ @retval EFI_SUCCESS Simple Pointer Device removed successfully.\r
+ @retval EFI_NOT_FOUND No Simple Pointer Device found.\r
\r
**/\r
EFI_STATUS\r
\r
\r
/**\r
+ Add Absolute Pointer Device in Consplitter Absolute Pointer list.\r
\r
+ @param Private Text In Splitter pointer.\r
+ @param AbsolutePointer Absolute Pointer protocol pointer.\r
\r
- @return EFI_OUT_OF_RESOURCES\r
- @return EFI_SUCCESS\r
+ @retval EFI_SUCCESS Absolute Pointer Device added successfully.\r
+ @retval EFI_OUT_OF_RESOURCES Could not grow the buffer size.\r
\r
**/\r
EFI_STATUS\r
\r
\r
/**\r
+ Remove Absolute Pointer Device in Consplitter Absolute Pointer list.\r
\r
+ @param Private Text In Splitter pointer.\r
+ @param AbsolutePointer Absolute Pointer protocol pointer.\r
\r
- @return None\r
+ @retval EFI_SUCCESS Absolute Pointer Device removed successfully.\r
+ @retval EFI_NOT_FOUND No Absolute Pointer Device found.\r
\r
**/\r
EFI_STATUS\r
return EFI_NOT_FOUND;\r
}\r
\r
-\r
/**\r
+ Reallocate Text Out mode map.\r
\r
+ @param Private Consplitter Text Out pointer.\r
\r
- @return None\r
+ @retval EFI_SUCCESS Buffer size has grown\r
+ @retval EFI_OUT_OF_RESOURCES Could not grow the buffer size.\r
\r
**/\r
EFI_STATUS\r
\r
\r
/**\r
+ Add the device's output mode to console splitter's mode list.\r
\r
-\r
- @return None\r
+ @param Private Text Out Splitter pointer\r
+ @param TextOut Simple Text Output protocol pointer.\r
+ \r
+ @retval EFI_SUCCESS Device added successfully.\r
+ @retval EFI_OUT_OF_RESOURCES Could not grow the buffer size.\r
\r
**/\r
EFI_STATUS\r
}\r
\r
/**\r
- Reconstruct TextOutModeMap to get intersection of modes\r
+ Reconstruct TextOutModeMap to get intersection of modes.\r
\r
This routine reconstruct TextOutModeMap to get the intersection\r
of modes for all console out devices. Because EFI/UEFI spec require\r
@param MaxMode Current max text mode\r
@param CurrentMode Current text mode\r
\r
- @retval None\r
-\r
**/\r
VOID\r
ConSplitterGetIntersection (\r
\r
\r
/**\r
+ Add the device's output mode to console splitter's mode list.\r
\r
- @param Private Private data structure.\r
- @param TextOut Text Out Protocol.\r
-\r
+ @param Private Text Out Splitter pointer.\r
+ @param TextOut Simple Text Output protocol pointer.\r
+ \r
@return None\r
\r
**/\r
\r
\r
/**\r
+ Sync output device between ConOut and StdErr output.\r
\r
-\r
- @return EFI_SUCCESS\r
- @return EFI_OUT_OF_RESOURCES\r
+ @retval EFI_SUCCESS Sync implemented successfully.\r
+ @retval EFI_OUT_OF_RESOURCES Could not grow the buffer size.\r
\r
**/\r
EFI_STATUS\r
\r
\r
/**\r
+ Add GOP or UGA output mode into Consplitter Text Out list.\r
\r
+ @param Private Text Out Splitter pointer.\r
+ @param GraphicsOutput Graphics Output protocol pointer.\r
+ @param UgaDraw UGA Draw protocol pointer.\r
\r
- @return None\r
+ @retval EFI_SUCCESS Output mode added successfully.\r
+ @retval other Failed to add output mode.\r
\r
**/\r
EFI_STATUS\r
from ConsoleOutMode variable and set it; if the variable does not exist,\r
set to user defined console mode.\r
\r
- None\r
+ @param Private Consplitter Text Out pointer.\r
\r
@return None\r
\r
}\r
\r
\r
-\r
/**\r
+ Add Text Output Device in Consplitter Text Output list.\r
\r
+ @param Private Text Out Splitter pointer.\r
+ @param TextOut Simple Text Output protocol pointer.\r
+ @param GraphicsOutput Graphics Output protocol pointer.\r
+ @param UgaDraw UGA Draw protocol pointer.\r
\r
- @return None\r
+ @retval EFI_SUCCESS Text Output Device added successfully.\r
+ @retval EFI_OUT_OF_RESOURCES Could not grow the buffer size.\r
\r
**/\r
EFI_STATUS\r
\r
\r
/**\r
+ Remove Text Out Device in Consplitter Text Out list.\r
\r
+ @param Private Text Out Splitter pointer.\r
+ @param TextOut Simple Text Output Pointer protocol pointer.\r
\r
- @return None\r
+ @retval EFI_SUCCESS Text Out Device removed successfully.\r
+ @retval EFI_NOT_FOUND No Text Out Device found.\r
\r
**/\r
EFI_STATUS\r
\r
return Status;\r
}\r
-//\r
-// ConSplitter TextIn member functions\r
-//\r
+\r
\r
/**\r
Reset the input device and optionaly run diagnostics\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
\r
- @param This Protocol instance pointer.\r
+ @param Private Protocol instance pointer.\r
@param Key Driver may perform diagnostics on reset.\r
\r
@retval EFI_SUCCESS The keystroke information was returned.\r
password will cause the check to reset. As long a mConIn.PasswordEnabled is\r
TRUE the StdIn splitter will not report any input.\r
\r
- (Standard EFI_EVENT_NOTIFY)\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
@return None\r
\r
BackSpaceString[0] = CHAR_BACKSPACE;\r
BackSpaceString[1] = 0;\r
\r
- SpaceString[0] = ' ';\r
+ SpaceString[0] = L' ';\r
SpaceString[1] = 0;\r
\r
ConSplitterTextOutOutputString (&mConOut.TextOut, BackSpaceString);\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
\r
\r
/**\r
+ Test if the key has been registered on input device.\r
\r
@param RegsiteredData A pointer to a buffer that is filled in with the\r
keystroke state data for the key that was\r
\r
}\r
\r
-//\r
-// Simple Text Input Ex protocol functions\r
-//\r
-\r
\r
/**\r
Reset the input device and optionaly run diagnostics\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
\r
- @param This Protocol instance pointer. State -\r
+ @param Private Protocol instance pointer.\r
+ @param State The state information of simple pointer device.\r
\r
@retval EFI_SUCCESS The keystroke information was returned.\r
@retval EFI_NOT_READY There was no keystroke data availiable.\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. State -\r
+ @param This A pointer to protocol instance.\r
+ @param State A pointer to state information on the pointer device\r
\r
- @retval EFI_SUCCESS The keystroke information was returned.\r
+ @retval EFI_SUCCESS The keystroke information was returned in State.\r
@retval EFI_NOT_READY There was no keystroke data availiable.\r
@retval EFI_DEVICE_ERROR The keydtroke information was not returned due\r
to hardware errors.\r
}\r
}\r
\r
-//\r
-// Absolute Pointer Protocol functions\r
-//\r
-\r
-\r
/**\r
Resets the pointer device hardware.\r
\r
Write a Unicode string to the output device.\r
\r
@param This Protocol instance pointer.\r
- @param String The NULL-terminated Unicode string to be\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
target device.\r
\r
@param This Protocol instance pointer.\r
- @param String The NULL-terminated Unicode string to be\r
+ @param WString The NULL-terminated Unicode string to be\r
examined for the output device(s).\r
\r
@retval EFI_SUCCESS The device(s) are capable of rendering the\r
\r
@param This Protocol instance pointer.\r
@param ModeNumber The mode number to return information on.\r
- @param Rows Returns the geometry of the text output device\r
+ @param Columns Returns the columns of the text output device\r
+ for the requested ModeNumber.\r
+ @param Rows Returns the rows of the text output device\r
for the requested ModeNumber.\r
\r
@retval EFI_SUCCESS The requested mode information was returned.\r
Sets the current coordinates of the cursor position\r
\r
@param This Protocol instance pointer.\r
- @param Row the position to set the cursor to. Must be\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 columns and rows by QueryMode ().\r
+ number of rows by QueryMode ().\r
\r
@retval EFI_SUCCESS The operation completed successfully.\r
@retval EFI_DEVICE_ERROR The device had an error and could not complete\r