]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/PlatformToDriverConfiguration.h
Update function description per UEFI2.3d. The main changes include:
[mirror_edk2.git] / MdePkg / Include / Protocol / PlatformToDriverConfiguration.h
index 887b8023ca6f5684fd52ac869985a6aedd640b8e..657c9e8c34e487d2ba5b6457f10cac52c143983b 100644 (file)
@@ -1,9 +1,12 @@
 /** @file\r
-  The file provides the protocol to retrieve configuration\r
-  information for a device that a UEFI driver is about to start.\r
+  UEFI Platform to Driver Configuration Protocol is defined in UEFI specification.\r
+  \r
+  This is a protocol that is optionally produced by the platform and optionally consumed \r
+  by a UEFI Driver in its Start() function. This protocol allows the driver to receive \r
+  configuration information as part of being started.\r
 \r
-  Copyright (c) 2006 - 2008, Intel Corporation \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
@@ -29,24 +32,22 @@ typedef struct _EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL EFI_PLATFORM_TO_DR
   ChildHandle is NULL the driver is requesting information from\r
   the platform about the ControllerHandle that is being started.\r
   Information returned from Query may lead to the drivers Start()\r
-  function failing. If the UEFI driver is a bus driver and\r
-  producing a ChildHandle the driver must call Query after the\r
-  child handle has been created and an EFI_DEVICE_PATH_PROTOCOL\r
-  has been placed on that handle, but before any time consuming\r
-  operation is performed. If information return by Query may lead\r
-  the driver to decide to not create the ChildHandle. The driver\r
-  must then cleanup and remove the ChildHandle from the system.\r
-  The UEFI driver repeatedly calls Query, processes the\r
-  information returned by the platform, and calls Response passing\r
-  in the arguments returned from Query. The Instance value passed\r
-  into Response must be the same value returned from the\r
-  corresponding call to Query. The UEFI driver must continuously\r
-  call Query and Response until EFI_NOT_FOUND is returned by\r
-  Query. The only value of Instance that has meaning to the UEFI\r
-  driver is zero. An Instance value of zero means return the first\r
-  ParameterBlock in the set of unprocessed parameter blocks. If a\r
-  ParameterBlock has been processed via a Query and corresponding\r
-  Response call it must not be returned again via a Query call.\r
+  function failing.\r
+  If the UEFI driver is a bus driver and producing a ChildHandle,\r
+  the driver must call Query after the child handle has been created\r
+  and an EFI_DEVICE_PATH_PROTOCOL has been placed on that handle,\r
+  but before any time consuming operation is performed. If information\r
+  return by Query may lead the driver to decide to not create the\r
+  ChildHandle. The driver must then cleanup and remove the ChildHandle\r
+  from the system.\r
+  The UEFI driver repeatedly calls Query, processes the information\r
+  returned by the platform, and calls Response passing in the\r
+  arguments returned from Query. The Instance value passed into\r
+  Response must be the same value passed into the corresponding\r
+  call to Query.\r
+  An Instance value of zero means return the first ParameterBlock\r
+  in the set of unprocessed parameter blocks. The driver should\r
+  increment the Instance value by one for each successive call to Query.\r
 \r
   @param This                 A pointer to the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL instance.\r
   \r
@@ -56,25 +57,23 @@ typedef struct _EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL EFI_PLATFORM_TO_DR
   @param ChildHandle          The handle of the child controller to\r
                               return information on. This is an optional\r
                               parameter that may be NULL. It will be\r
-                              NULL for device drivers, and for bus\r
+                              NULL for device drivers and for bus\r
                               drivers that attempt to get options for\r
                               the bus controller. It will not be NULL\r
                               for a bus driver that attempts to get\r
                               options for one of its child controllers.\r
   \r
   \r
-  @param Instance             Pointer to the Instance value. On output the\r
-                              instance associated with the parameter data\r
-                              return. On input zero means return the first\r
-                              query data or pass in a valid instance\r
-                              number returned from a previous call to\r
-                              Query.\r
-\r
-  @param ParameterTypeGuid    An EFI_GUID that defines the\r
-                              contents of ParameterBlock. UEFI\r
-                              drivers must use the\r
-                              ParameterTypeGuid to determine how\r
-                              to parser the ParameterBlock.\r
+  @param Instance             Pointer to the Instance value. Zero means\r
+                              return the first query data. The caller should\r
+                              increment this value by one each time to retrieve\r
+                              successive data.\r
+\r
+  @param ParameterTypeGuid    An EFI_GUID that defines the contents\r
+                              of ParameterBlock. UEFI drivers must\r
+                              use the ParameterTypeGuid to determine\r
+                              how to parse the ParameterBlock. The caller\r
+                              should not attempt to free ParameterTypeGuid.\r
 \r
   @param ParameterBlock       The platform returns a pointer to the\r
                               ParameterBlock structure which\r
@@ -124,67 +123,66 @@ EFI_STATUS
   IN CONST  EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL *This,\r
   IN CONST  EFI_HANDLE  ControllerHandle,\r
   IN CONST  EFI_HANDLE  ChildHandle OPTIONAL,\r
-  IN OUT    UINTN       *Instance,\r
-  IN OUT    EFI_GUID    **ParameterTypeGuid,\r
-  IN OUT    VOID        **ParameterBlock,\r
-  IN OUT    UINTN       *ParameterBlockSize\r
+  IN CONST  UINTN       *Instance,\r
+  OUT       EFI_GUID    **ParameterTypeGuid,\r
+  OUT       VOID        **ParameterBlock,\r
+  OUT       UINTN       *ParameterBlockSize\r
 );\r
 \r
-/**\r
-\r
-  @param EfiPlatformConfigurationActionNone\r
-          The controller specified by ControllerHandle is still\r
-          in a usable state, it's configuration has been updated\r
-          via parsing the ParameterBlock. If required by the\r
-          parameter block and the module supports an NVRAM store\r
-          the configuration information from PB was successfully\r
-          saved to the NVRAM. No actions are required before\r
-          this controller can be used again with the updated\r
-          configuration settings.\r
-\r
-\r
-  @param EfiPlatformConfigurationStopController \r
-          The driver has detected that the controller specified\r
-          by ControllerHandle  is not in a usable state, and it\r
-          needs to be stopped. The calling agent can use the\r
-          DisconnectControservice to perform this operation, and\r
-          it should be performed as soon as possible.\r
-\r
-  @param EfiPlatformConfigurationRestartController\r
-          This controller specified by ControllerHandle needs to\r
-          be stopped and restarted before it can be used again.\r
-          The calling agent can use the DisconnectController()\r
-          and ConnectController() services to perform this\r
-          operation. The restart operation can be delayed  until\r
-          all of the configuratiooptions have been set.\r
-\r
-\r
-  @param EfiPlatformConfigurationRestartPlatform\r
-          A configuration change has been made that requires the\r
-          platform to be restarted before the controller\r
-          specified by ControllerHandle can be used again. The\r
-          calling agent can use the ResetSystem() services to\r
-          perform this operation. The restart operation can be\r
-          delayed until all of the configuration options have\r
-          been set.\r
-\r
-  @param EfiPlatformConfigurationActionNvramFailed \r
-          The controller specified by ControllerHandle is still\r
-          in a usable state; its configuration has been updated\r
-          via parsing the ParameterBlock. The driver tried to\r
-          update the driver's private NVRAM store with\r
-          information from ParameterBlock and failed. No actions\r
-          are required before this controller can be used again\r
-          with the updated configuration settings, but these\r
-          configuration settings are not guaranteed to persist\r
-          after ControllerHandle is stopped.\r
-\r
-**/\r
 typedef enum {\r
+  ///\r
+  ///  The controller specified by ControllerHandle is still\r
+  ///  in a usable state, and its configuration has been updated\r
+  ///  via parsing the ParameterBlock. If required by the\r
+  ///  parameter block, and the module supports an NVRAM store,\r
+  ///  the configuration information from PB was successfully\r
+  ///  saved to the NVRAM. No actions are required before\r
+  ///  this controller can be used again with the updated\r
+  ///  configuration settings.\r
+  ///\r
   EfiPlatformConfigurationActionNone              = 0,\r
+  \r
+  ///\r
+  ///  The driver has detected that the controller specified\r
+  ///  by ControllerHandle is not in a usable state and \r
+  ///  needs to be stopped. The calling agent can use the\r
+  ///  DisconnectControservice to perform this operation, and\r
+  ///  it should be performed as soon as possible.  \r
+  ///\r
   EfiPlatformConfigurationActionStopController    = 1,\r
+  \r
+  ///\r
+  ///  This controller specified by ControllerHandle needs to\r
+  ///  be stopped and restarted before it can be used again.\r
+  ///  The calling agent can use the DisconnectController()\r
+  ///  and ConnectController() services to perform this\r
+  ///  operation. The restart operation can be delayed until\r
+  ///  all of the configuration options have been set.  \r
+  ///\r
   EfiPlatformConfigurationActionRestartController = 2,\r
+  \r
+  ///\r
+  ///  A configuration change has been made that requires the\r
+  ///  platform to be restarted before the controller\r
+  ///  specified by ControllerHandle can be used again. The\r
+  ///  calling agent can use the ResetSystem() services to\r
+  ///  perform this operation. The restart operation can be\r
+  ///  delayed until all of the configuration options have\r
+  ///  been set.  \r
+  ///\r
   EfiPlatformConfigurationActionRestartPlatform   = 3,\r
+\r
+  ///\r
+  ///  The controller specified by ControllerHandle is still\r
+  ///  in a usable state; its configuration has been updated\r
+  ///  via parsing the ParameterBlock. The driver tried to\r
+  ///  update the driver's private NVRAM store with\r
+  ///  information from ParameterBlock and failed. No actions\r
+  ///  are required before this controller can be used again\r
+  ///  with the updated configuration settings, but these\r
+  ///  configuration settings are not guaranteed to persist\r
+  ///  after ControllerHandle is stopped. \r
+  /// \r
   EfiPlatformConfigurationActionNvramFailed       = 4,\r
   EfiPlatformConfigurationActionMaximum\r
 } EFI_PLATFORM_CONFIGURATION_ACTION;\r
@@ -201,33 +199,35 @@ typedef enum {
   ParameterBlock, and ParameterBlockSize. The UEFI driver may\r
   update values in ParameterBlock based on rules defined by\r
   ParameterTypeGuid. The platform is responsible for freeing\r
-  ParameterBlock and the UEFI driver must not try to free it\r
+  ParameterBlock and the UEFI driver must not try to free it.\r
+\r
+  @param This                A pointer to the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL instance.\r
 \r
-  @param This               A pointer to the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL instance.\r
+  @param ControllerHandle    The handle the driver is returning\r
+                             configuration information about.\r
 \r
-  @param ControllerHandle   The handle the driver is returning\r
-                            configuration information about.\r
+  @param ChildHandle         The handle of the child controller to\r
+                             return information on. This is an optional\r
+                             parameter that may be NULL. It will be\r
+                             NULL for device drivers, and for bus\r
+                             drivers that attempt to get options for\r
+                             the bus controller. It will not be NULL\r
+                             for a bus driver that attempts to get\r
+                             options for one of its child controllers.\r
+                             Instance Instance data returned from\r
+                             Query().\r
 \r
-  @param ChildHandle        The handle of the child controller to\r
-                            return information on. This is an optional\r
-                            parameter that may be NULL. It will be\r
-                            NULL for device drivers, and for bus\r
-                            drivers that attempt to get options for\r
-                            the bus controller. It will not be NULL\r
-                            for a bus driver that attempts to get\r
-                            options for one of its child controllers.\r
-                            Instance Instance data returned from\r
-                            Query().\r
+  @param Instance            Instance data passed to Query().\r
 \r
-  @param ParameterTypeGuid  ParameterTypeGuid returned from Query.\r
+  @param ParameterTypeGuid   ParameterTypeGuid returned from Query.\r
 \r
-  @param ParameterBlock     ParameterBlock returned from Query.\r
+  @param ParameterBlock      ParameterBlock returned from Query.\r
 \r
-  @param ParameterBlockSize The ParameterBlock size returned from Query.\r
+  @param ParameterBlockSize  The ParameterBlock size returned from Query.\r
 \r
-  @param Configuration      ActionThe driver tells the platform what\r
-                            action is required for ParameterBlock to\r
-                            take effect.\r
+  @param ConfigurationAction The driver tells the platform what\r
+                             action is required for ParameterBlock to\r
+                             take effect.\r
   \r
   \r
   @retval EFI_SUCCESS           The platform return parameter information\r
@@ -254,29 +254,18 @@ EFI_STATUS
 );\r
 \r
 \r
-/**\r
-  @par Protocol Description:\r
-  The EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL is used by the\r
-  UEFI driver to query the platform for configuration information.\r
-  The UEFI driver calls Query() multiple times to get\r
-  configuration information from the platform. For every call to\r
-  Query() there must be a matching call to Response() so the\r
-  UEFI driver can inform the platform how it used the\r
-  information passed in from Query(). It's legal for a UEFI\r
-  driver to use Response() to inform the platform it does not\r
-  understand the data returned via Query() and thus no action was\r
-  taken.\r
-\r
-  @param  Query     Called by the UEFI Driver Start() function to\r
-                    get configuration information from the\r
-                    platform.\r
-  \r
-  @param  Response  Called by the UEFI Driver Start() function\r
-                    to let the platform know how UEFI driver\r
-                    processed the data return from Query.\r
-  \r
-\r
-**/\r
+///\r
+/// The EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL is used by the\r
+/// UEFI driver to query the platform for configuration information.\r
+/// The UEFI driver calls Query() multiple times to get\r
+/// configuration information from the platform. For every call to\r
+/// Query() there must be a matching call to Response() so the\r
+/// UEFI driver can inform the platform how it used the\r
+/// information passed in from Query(). It's legal for a UEFI\r
+/// driver to use Response() to inform the platform it does not\r
+/// understand the data returned via Query() and thus no action was\r
+/// taken.\r
+///\r
 struct _EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL {\r
   EFI_PLATFORM_TO_DRIVER_CONFIGURATION_QUERY    Query;\r
   EFI_PLATFORM_TO_DRIVER_CONFIGURATION_RESPONSE Response;\r
@@ -296,87 +285,44 @@ struct _EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL {
   EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL is platform\r
   firmware and the consumer is the UEFI driver. Note: if future\r
   versions of the DMTF SM CLP Specification require changes to the\r
-  parameter block definition, newer ParameterTypeGuid will be\r
+  parameter block definition, newer ParameterTypeGuid will be\r
   used.\r
-\r
-  @param CLPCommand       A pointer to the DMTF SM CLP command line\r
-                          null-terminated string that the driver is\r
-                          required to parse and process when this\r
-                          EFI_SUCCESS The platform return parameter\r
-                          information for ControllerHandle.\r
-                          EFI_NOT_FOUND Instance was not found.\r
-                          EFI_INVALID_PARAMETER ControllerHandle is\r
-                          not a valid EFI_HANDLE.\r
-                          EFI_INVALID_PARAMETER Instance is zero.\r
-                          function is called. See the DMTF SM CLP\r
-                          Specification 1.0 Final Standard for\r
-                          details on the format and syntax of the\r
-                          CLP command line string. CLPCommand buffer\r
-                          is allocated by the producer of the\r
-                          EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOOL.\r
-\r
-  @param CLPCommandLength The length of the CLP Command in bytes.\r
-\r
-  @param CLPReturnString  A pointer to the CLP return status\r
-                          string that the driver is required to\r
-                          provide to the calling agent. The\r
-                          calling agent may parse and/ or pass\r
-                          this for processing and user feedback.\r
-                          The SM CLP Command Response string\r
-                          buffer is filled in by the UEFI driver\r
-                          in the "keyword=value" format\r
-                          described in the SM CLP Specification,\r
-                          unless otherwise requested via the SM\r
-                          CLP Coutput option in the Command Line\r
-                          string buffer. UEFI driver's support\r
-                          for this default "keyword=value"\r
-                          output format is required if the UEFI\r
-                          driver supports this protocol, while\r
-                          support for other SM CLP output\r
-                          formats is optional (the UEFI Driver\r
-                          should return an EFI_UNSUPPORTED if\r
-                          the SM CLP Coutput option requested by\r
-                          the caller is not supported by the\r
-                          UEFI Driver). CLPReturnString buffer\r
-                          is allocated by the consumer of the\r
-                          EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOC\r
-                          OL and undefined prior to the call to\r
-                          Response().\r
-\r
-  @param CLPReturnStringLength  The length of the CLP return\r
-                                status string in bytes.\r
-\r
-  @param CLPReturnStatus  SM CLP Command Status (see DMTF SM CLP\r
-                          Specification 1.0 Final Standard -\r
-                          Table 4) CLPErrorValue SM CLP\r
-                          Processing Error Value (see DMTF SM\r
-                          CLP Specification 1.0 Final Standard -\r
-                          Table 6). This field is filled in by\r
-                          the consumer of the\r
-                          EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOC \r
-                          OL and undefined prior to the call to\r
-                          Response().\r
-\r
-  @param CLPMessageCode   Bit 15: OEM Message Code Flag 0 =\r
-                          Message Code is an SM CLP Probable\r
-                          Cause Value. (see SM CLP Specification\r
-                          Table 11) 1 = Message Code is OEM\r
-                          Specific Bits 14-0: Message Code This\r
-                          field is filled in by the consumer of\r
-                          the\r
-                          EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOC\r
-                          OL and undefined prior to the call to\r
-                          Response().\r
-\r
 **/\r
 typedef struct {\r
-  CHAR8   *CLPCommand;\r
-  UINT32  CLPCommandLength;\r
-  CHAR8   *CLPReturnString;\r
-  UINT32  CLPReturnStringLength;\r
-  UINT8   CLPCmdStatus;\r
-  UINT8   CLPErrorValue;\r
-  UINT16  CLPMsgCode;\r
+  CHAR8   *CLPCommand;        ///<  A pointer to the null-terminated UTF-8 string that specifies the DMTF SM CLP command\r
+                              ///<  line that the driver is required to parse and process when this function is called. \r
+                              ///<  See the DMTF SM CLP Specification 1.0 Final Standard for details on the \r
+                              ///<  format and syntax of the CLP command line string. CLPCommand buffer\r
+                              ///<  is allocated by the producer of the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOOL.\r
+  UINT32  CLPCommandLength;   ///< The length of the CLP Command in bytes.\r
+  CHAR8   *CLPReturnString;   ///<  A pointer to the null-terminated UTF-8 string that indicates the CLP return status\r
+                              ///<  that the driver is required to provide to the calling agent.\r
+                              ///<  The calling agent may parse and/ or pass\r
+                              ///<  this for processing and user feedback. The SM CLP Command Response string\r
+                              ///<  buffer is filled in by the UEFI driver in the "keyword=value" format\r
+                              ///<  described in the SM CLP Specification, unless otherwise requested via the SM\r
+                              ///<  CLP Coutput option in the Command Line string buffer. UEFI driver's support\r
+                              ///<  for this default "keyword=value" output format is required if the UEFI\r
+                              ///<  driver supports this protocol, while support for other SM CLP output\r
+                              ///<  formats is optional (the UEFI Driver should return an EFI_UNSUPPORTED if\r
+                              ///<  the SM CLP Coutput option requested by the caller is not supported by the\r
+                              ///<  UEFI Driver). CLPReturnString buffer is allocated by the consumer of the\r
+                              ///<  EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOC OL and undefined prior to the call to\r
+                              ///<  Response().  \r
+  UINT32  CLPReturnStringLength; ///< The length of the CLP return status string in bytes.\r
+  UINT8   CLPCmdStatus;       ///<  SM CLP Command Status (see DMTF SM CLP Specification 1.0 Final Standard -\r
+                              ///<  Table 4) CLPErrorValue SM CLP Processing Error Value (see DMTF SM\r
+                              ///<  CLP Specification 1.0 Final Standard - Table 6). This field is filled in by\r
+                              ///<  the consumer of the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOC \r
+                              ///<  OL and undefined prior to the call to Response().  \r
+  UINT8   CLPErrorValue;      ///<  SM CLP Processing Error Value (see DMTF SM CLP Specification 1.0 Final Standard - Table 6).\r
+                              ///<  This field is filled in by the consumer of the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL and undefined prior to the call to Response().                              \r
+  UINT16  CLPMsgCode;         ///<  Bit 15: OEM Message Code Flag 0 = Message Code is an SM CLP Probable\r
+                              ///<  Cause Value. (see SM CLP Specification Table 11) 1 = Message Code is OEM\r
+                              ///<  Specific Bits 14-0: Message Code This field is filled in by the consumer of\r
+                              ///<  the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOC OL and undefined prior to the call to\r
+                              ///<  Response(). \r
+\r
 } EFI_CONFIGURE_CLP_PARAMETER_BLK;\r
 \r
 \r