]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.h
1. Retired HotPlugDevice protocol.
[mirror_edk2.git] / MdeModulePkg / Universal / Console / ConPlatformDxe / ConPlatform.h
index 1ec31a170b7dd21eb24e7a8345a8885c3bb8f328..a47ad1ce303b62204e96cea3e8d423c16fa212cf 100644 (file)
@@ -16,14 +16,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #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
+\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
@@ -52,12 +53,10 @@ typedef enum {
 } 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
@@ -68,20 +67,19 @@ EFI_STATUS
 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
@@ -89,19 +87,19 @@ EFIAPI
 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
@@ -109,11 +107,13 @@ EFIAPI
 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
+  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
@@ -126,7 +126,7 @@ ConPlatformTextOutDriverBindingSupported (
 \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
@@ -138,8 +138,10 @@ ConPlatformTextInDriverBindingStart (
   );\r
 \r
 /**\r
-  Start this driver on ControllerHandle by opening Simple Text Out protocol,\r
-  reading Device Path, and installing Console Out Devcice GUID, Standard Error\r
+  Start this driver on the device for console output and stardard 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
@@ -165,7 +167,7 @@ ConPlatformTextOutDriverBindingStart (
 \r
 /**\r
   Stop this driver on ControllerHandle by removing Console In Devcice GUID \r
-  and closing the Simple Text In protocol on ControllerHandle.\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
@@ -188,7 +190,7 @@ ConPlatformTextInDriverBindingStop (
 \r
 /**\r
   Stop this driver on ControllerHandle by removing Console Out Devcice GUID \r
-  and closing the Simple Text Out protocol on ControllerHandle.\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
@@ -210,13 +212,11 @@ ConPlatformTextOutDriverBindingStop (
   );\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
@@ -230,12 +230,11 @@ ConPlatformUnInstallProtocol (
   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
@@ -257,25 +256,28 @@ ConPlatformGetVariable (
                          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
@@ -290,10 +292,12 @@ ConPlatformUpdateDeviceVariable (
   );\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
-  @param  DriverBindingHandle   Protocol instance pointer.\r
-  @param  ControllerHandle      Handle of device to check.\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  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
@@ -301,8 +305,7 @@ ConPlatformUpdateDeviceVariable (
 **/\r
 BOOLEAN\r
 IsHotPlugDevice (\r
-  EFI_HANDLE    DriverBindingHandle,\r
-  EFI_HANDLE    ControllerHandle\r
+  IN  EFI_DEVICE_PATH_PROTOCOL    *DevicePath\r
   );\r
 \r
 //\r
@@ -320,7 +323,6 @@ IsHotPlugDevice (
 \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
@@ -329,7 +331,6 @@ IsHotPlugDevice (
                                 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
   @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
@@ -338,11 +339,8 @@ IsHotPlugDevice (
   @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
@@ -371,12 +369,10 @@ ConPlatformComponentNameGetDriverName (
 \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
@@ -385,7 +381,6 @@ ConPlatformComponentNameGetDriverName (
                                 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
@@ -394,7 +389,6 @@ ConPlatformComponentNameGetDriverName (
                                 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
   @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
@@ -406,20 +400,14 @@ ConPlatformComponentNameGetDriverName (
                                 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 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