/** @file\r
Header file for Console Platfrom DXE Driver.\r
\r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2011, 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
**/\r
\r
-#ifndef _CON_MANAGE_H_\r
-#define _CON_MANAGE_H_\r
+#ifndef _CON_PLATFORM_H_\r
+#define _CON_PLATFORM_H_\r
\r
#include <Uefi.h>\r
+\r
#include <Protocol/SimpleTextOut.h>\r
+#include <Protocol/DevicePath.h>\r
+#include <Protocol/SimpleTextIn.h>\r
+#include <Protocol/PciIo.h>\r
+#include <Protocol/GraphicsOutput.h>\r
+\r
#include <Guid/GlobalVariable.h>\r
#include <Guid/ConsoleInDevice.h>\r
#include <Guid/StandardErrorDevice.h>\r
#include <Guid/ConsoleOutDevice.h>\r
-#include <Protocol/DevicePath.h>\r
-#include <Protocol/SimpleTextIn.h>\r
-#include <Guid/HotPlugDevice.h>\r
\r
#include <Library/DebugLib.h>\r
#include <Library/UefiDriverEntryPoint.h>\r
\r
\r
typedef enum {\r
- CHECK,\r
- APPEND,\r
- DELETE\r
+ Check,\r
+ Append,\r
+ Delete\r
} CONPLATFORM_VAR_OPERATION;\r
\r
/**\r
- Test to see if specific Protocol could be supported on the ControllerHandle. \r
+ Test to see if specific protocol could be supported on the ControllerHandle. \r
\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
@param ProtocolGuid The specfic protocol.\r
\r
@retval EFI_SUCCESS This driver supports this device\r
ConPlatformDriverBindingSupported (\r
IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
IN EFI_HANDLE ControllerHandle,\r
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath,\r
IN EFI_GUID *ProtocolGuid\r
);\r
\r
/**\r
- Test to see if EFI Text In Protocol could be supported on the ControllerHandle. \r
+ Test to see if EFI_SIMPLE_TEXT_INPUT_PROTOCOL is supported on ControllerHandle. \r
\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
- @retval EFI_SUCCESS This driver supports this device\r
- @retval other This driver does not support this device\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
ConPlatformTextInDriverBindingSupported (\r
IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
IN EFI_HANDLE Handle,\r
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
);\r
\r
/**\r
- Test to see if EFI Text Out Protocol could be supported on the ControllerHandle. \r
+ Test to see if EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL is supported on ControllerHandle. \r
\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
- @retval EFI_SUCCESS This driver supports this device\r
- @retval other This driver does not support this device\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
ConPlatformTextOutDriverBindingSupported (\r
IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
IN EFI_HANDLE Handle,\r
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
);\r
\r
/**\r
- Start this driver on ControllerHandle by opening Simple Text In protocol,\r
- reading Device Path, and installing Console Devcice In GUID on ControllerHandle.\r
+ Start this driver on the device for console input.\r
+\r
+ Start this driver on ControllerHandle by opening Simple Text Input Protocol,\r
+ reading Device Path, and installing Console In Devcice GUID on ControllerHandle.\r
\r
If this devcie is not one hot-plug devce, append its device path into the \r
console environment variables ConInDev.\r
\r
@retval EFI_SUCCESS This driver is added to ControllerHandle\r
@retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle\r
- @retval other This driver does not support this device\r
+ @retval other This driver does not support this device.\r
\r
**/\r
EFI_STATUS\r
);\r
\r
/**\r
- Start this driver on ControllerHandle by opening Simple Text Out protocol,\r
- reading Device Path, and installing Console Devcice Out GUID, Standard Error\r
+ Start this driver on the device for console output and standard error output.\r
+\r
+ Start this driver on ControllerHandle by opening Simple Text Output Protocol,\r
+ reading Device Path, and installing Console Out Devcic GUID, Standard Error\r
Device GUID on ControllerHandle.\r
\r
If this devcie is not one hot-plug devce, append its device path into the \r
);\r
\r
/**\r
- Stop this driver on ControllerHandle by removing Console Devcice In GUID \r
- and closing the Simple Text In protocol on ControllerHandle.\r
+ Stop this driver on ControllerHandle by removing Console In Devcice GUID \r
+ and closing the Simple Text Input protocol on ControllerHandle.\r
\r
@param This Protocol instance pointer.\r
@param ControllerHandle Handle of device to stop driver on\r
);\r
\r
/**\r
- Stop this driver on ControllerHandle by removing Console Devcice Out GUID \r
- and closing the Simple Text Out protocol on ControllerHandle.\r
+ Stop this driver on ControllerHandle by removing Console Out Devcice GUID \r
+ and closing the Simple Text Output protocol on ControllerHandle.\r
\r
@param This Protocol instance pointer.\r
@param ControllerHandle Handle of device to stop driver on\r
);\r
\r
/**\r
- Unstall the specific protocol.\r
+ Uninstall the specified protocol.\r
\r
@param This Protocol instance pointer.\r
- @param Handle Handle of device to unstall protocol on.\r
- @param ProtocolGuid The specific protocol need to be uninstalled.\r
-\r
- @return None.\r
+ @param Handle Handle of device to uninstall protocol on.\r
+ @param ProtocolGuid The specified protocol need to be uninstalled.\r
\r
**/\r
VOID\r
Read the EFI variable (Name) and return a dynamically allocated\r
buffer, and the size of the buffer. On failure return NULL.\r
\r
-\r
@param Name String part of EFI variable name\r
\r
@return Dynamically allocated memory that contains a copy of the EFI variable.\r
- Caller is repsoncible freeing the buffer.\r
- NULL - Variable was not read\r
+ Caller is repsoncible freeing the buffer. Return NULL means Variable \r
+ was not read.\r
\r
**/\r
VOID *\r
If FALSE, the routine just check whether Single matches\r
with any instance in Multi.\r
\r
- @return The function returns EFI_SUCCESS if the Single is contained within Multi.\r
- Otherwise, EFI_NOT_FOUND is returned.\r
+ @retval EFI_SUCCESS If the Single is contained within Multi.\r
+ @retval EFI_NOT_FOUND If the Single is not contained within Multi.\r
+ @retval EFI_INVALID_PARAMETER Multi is NULL.\r
+ @retval EFI_INVALID_PARAMETER Single is NULL.\r
+ @retval EFI_INVALID_PARAMETER NewDevicePath is NULL when Delete is TRUE.\r
\r
**/\r
EFI_STATUS\r
ConPlatformMatchDevicePaths (\r
IN EFI_DEVICE_PATH_PROTOCOL *Multi,\r
IN EFI_DEVICE_PATH_PROTOCOL *Single,\r
- IN EFI_DEVICE_PATH_PROTOCOL **NewDevicePath OPTIONAL,\r
+ OUT EFI_DEVICE_PATH_PROTOCOL **NewDevicePath OPTIONAL,\r
IN BOOLEAN Delete\r
);\r
\r
/**\r
- Update console devicein console environment variables. \r
+ Update console environment variables.\r
\r
@param VariableName Console environment variables, ConOutDev, ConInDev\r
StdErrDev, ConIn or ConOut.\r
@param DevicePath Console devcie's device path.\r
- @param Operation Variable operations, such as APPEND or DELETE.\r
+ @param Operation Variable operations, including APPEND, CHECK and DELETE.\r
\r
@retval EFI_SUCCESS Variable operates successfully.\r
@retval EFI_OUT_OF_RESOURCES If variable cannot be appended.\r
);\r
\r
/**\r
- Check if the device is one hot-plug supported.\r
+ Check if the device supports hot-plug through its device path.\r
+\r
+ This function could be updated to check more types of Hot Plug devices.\r
+ Currently, it checks USB and PCCard device.\r
\r
- @param DriverBindingHandle Protocol instance pointer.\r
- @param ControllerHandle Handle of device to check.\r
+ @param DevicePath Pointer to device's device path.\r
\r
@retval TRUE The devcie is a hot-plug device\r
@retval FALSE The devcie is not a hot-plug device.\r
**/\r
BOOLEAN\r
IsHotPlugDevice (\r
- EFI_HANDLE DriverBindingHandle,\r
- EFI_HANDLE ControllerHandle\r
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
);\r
\r
//\r
\r
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
@param Language[in] A pointer to a Null-terminated ASCII string\r
array indicating the language. This is the\r
language of the driver name that the caller is\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
-\r
+ in RFC 4646 or ISO 639-2 language code format.\r
@param DriverName[out] A pointer to the Unicode string to return.\r
This Unicode string is the name of the\r
driver specified by This in the language\r
@retval EFI_SUCCESS The Unicode string for the Driver specified by\r
This and the language specified by Language was\r
returned in DriverName.\r
-\r
@retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
@retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
@retval EFI_UNSUPPORTED The driver specified by This does not support\r
the language specified by Language.\r
\r
\r
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
@param ControllerHandle[in] The handle of a controller that the driver\r
specified by This is managing. This handle\r
specifies the controller whose name is to be\r
returned.\r
-\r
@param ChildHandle[in] The handle of the child controller to retrieve\r
the name of. This is an optional parameter that\r
may be NULL. It will be NULL for device\r
controller. It will not be NULL for a bus\r
driver that wishes to retrieve the name of a\r
child controller.\r
-\r
@param Language[in] A pointer to a Null-terminated ASCII string\r
array indicating the language. This is the\r
language of the driver name that the caller is\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
-\r
+ RFC 4646 or ISO 639-2 language code format.\r
@param ControllerName[out] A pointer to the Unicode string to return.\r
This Unicode string is the name of the\r
controller specified by ControllerHandle and\r
the language specified by Language for the\r
driver specified by This was returned in\r
DriverName.\r
-\r
- @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\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
-\r
@retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
@retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
@retval EFI_UNSUPPORTED The driver specified by This is not currently\r
managing the controller specified by\r
ControllerHandle and ChildHandle.\r
-\r
@retval EFI_UNSUPPORTED The driver specified by This does not support\r
the language specified by Language.\r
\r
OUT CHAR16 **ControllerName\r
);\r
\r
+/**\r
+ Update ConOutDev and ErrOutDev variables to add the device path of\r
+ GOP controller itself and the sibling controllers.\r
+\r
+ @param DevicePath Pointer to device's device path.\r
+\r
+ @retval TRUE The devcie is a GOP device.\r
+ @retval FALSE The devcie is not a GOP device.\r
+\r
+**/\r
+BOOLEAN\r
+ConPlatformUpdateGopCandidate (\r
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
+ );\r
\r
#endif\r