]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Bus/Pci/IdeBus/Dxe/DriverConfiguration.c
1) Use FeatureFlag PcdPciBusHotplugDeviceSupport to merge LightPciLib.c with PcdLib.c.
[mirror_edk2.git] / EdkModulePkg / Bus / Pci / IdeBus / Dxe / DriverConfiguration.c
index 5a23a43189fdc68c41c18ae60635ece452d64005..75794f81253487d821d77bb33f004c32e7d17676 100644 (file)
@@ -1,21 +1,14 @@
-/*++\r
+/** @file\r
+  Copyright (c) 2006, Intel Corporation                                                         \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
-Copyright (c) 2006, Intel Corporation                                                         \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
+  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
 \r
-Module Name:\r
-\r
-  DriverConfiguration.c\r
-\r
-Abstract:\r
-\r
---*/\r
+**/\r
 \r
 #include "idebus.h"\r
 \r
@@ -63,27 +56,18 @@ EFI_DRIVER_CONFIGURATION_PROTOCOL gIDEBusDriverConfiguration = {
   "eng"\r
 };\r
 \r
+/**\r
+  TODO: Add function description\r
+\r
+  @retval  EFI_ABORTED TODO: Add description for return value\r
+  @retval  EFI_SUCCESS TODO: Add description for return value\r
+  @retval  EFI_NOT_FOUND TODO: Add description for return value\r
+\r
+**/\r
 EFI_STATUS\r
 GetResponse (\r
   VOID\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  None\r
-\r
-Returns:\r
-\r
-  EFI_ABORTED - TODO: Add description for return value\r
-  EFI_SUCCESS - TODO: Add description for return value\r
-  EFI_NOT_FOUND - TODO: Add description for return value\r
-\r
---*/\r
 {\r
   EFI_STATUS    Status;\r
   EFI_INPUT_KEY Key;\r
@@ -118,6 +102,51 @@ Returns:
   }\r
 }\r
 \r
+/**\r
+  Allows the user to set controller specific options for a controller that a \r
+  driver is currently managing.\r
+\r
+  @param  This A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL\r
+  instance.\r
+  @param  ControllerHandle The handle of the controller to set options on.\r
+  @param  ChildHandle The handle of the child controller to set options on.\r
+  This is an optional parameter that may be NULL.\r
+  It will be NULL for device drivers, and for a bus drivers\r
+  that wish to set options for the bus controller.\r
+  It will not be NULL for a bus driver that wishes to set\r
+  options for one of its child controllers.\r
+  @param  Language A pointer to a three character ISO 639-2 language\r
+  identifier. This is the language of the user interface\r
+  that should be presented to the user, and it must match\r
+  one of the languages specified in SupportedLanguages.\r
+  The number of languages supported by a driver is up to\r
+  the driver writer.\r
+  @param  ActionRequired A pointer to the action that the calling agent is\r
+  required to perform when this function returns.\r
+  See "Related Definitions" for a list of the actions that\r
+  the calling agent is required to perform prior to\r
+  accessing ControllerHandle again.\r
+\r
+  @retval  EFI_SUCCESS The driver specified by This successfully set the\r
+  configuration options for the controller specified\r
+  by ControllerHandle..\r
+  @retval  EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval  EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a\r
+  valid EFI_HANDLE.\r
+  @retval  EFI_INVALID_PARAMETER ActionRequired is NULL.\r
+  @retval  EFI_UNSUPPORTED The driver specified by This does not support\r
+  setting configuration options for the controller\r
+  specified by ControllerHandle and ChildHandle.\r
+  @retval  EFI_UNSUPPORTED The driver specified by This does not support the\r
+  language specified by Language.\r
+  @retval  EFI_DEVICE_ERROR A device error occurred while attempt to set the\r
+  configuration options for the controller specified\r
+  by ControllerHandle and ChildHandle.\r
+  @retval  EFI_OUT_RESOURCES There are not enough resources available to set the\r
+  configuration options for the controller specified\r
+  by ControllerHandle and ChildHandle.\r
+\r
+**/\r
 EFI_STATUS\r
 IDEBusDriverConfigurationSetOptions (\r
   IN  EFI_DRIVER_CONFIGURATION_PROTOCOL                      *This,\r
@@ -126,62 +155,12 @@ IDEBusDriverConfigurationSetOptions (
   IN  CHAR8                                                  *Language,\r
   OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED               *ActionRequired\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Allows the user to set controller specific options for a controller that a \r
-    driver is currently managing.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL \r
-                       instance.\r
-    ControllerHandle - The handle of the controller to set options on.\r
-    ChildHandle      - The handle of the child controller to set options on.  \r
-                       This is an optional parameter that may be NULL.  \r
-                       It will be NULL for device drivers, and for a bus drivers\r
-                       that wish to set options for the bus controller.  \r
-                       It will not be NULL for a bus driver that wishes to set \r
-                       options for one of its child controllers.\r
-    Language         - A pointer to a three character ISO 639-2 language \r
-                       identifier. This is the language of the user interface \r
-                       that should be presented to the user, and it must match \r
-                       one of the languages specified in SupportedLanguages.  \r
-                       The number of languages supported by a driver is up to \r
-                       the driver writer.\r
-    ActionRequired   - A pointer to the action that the calling agent is \r
-                       required to perform when this function returns.  \r
-                       See "Related Definitions" for a list of the actions that\r
-                       the calling agent is required to perform prior to \r
-                       accessing ControllerHandle again.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The driver specified by This successfully set the \r
-                            configuration options for the controller specified \r
-                            by ControllerHandle..\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a \r
-                            valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ActionRequired is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support \r
-                            setting configuration options for the controller \r
-                            specified by ControllerHandle and ChildHandle.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
-                            language specified by Language.\r
-    EFI_DEVICE_ERROR      - A device error occurred while attempt to set the \r
-                            configuration options for the controller specified \r
-                            by ControllerHandle and ChildHandle.\r
-    EFI_OUT_RESOURCES     - There are not enough resources available to set the \r
-                            configuration options for the controller specified \r
-                            by ControllerHandle and ChildHandle.\r
-\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
   UINT8       Value;\r
   UINT8       NewValue;\r
   UINTN       DataSize;\r
   UINTN       Index;\r
-  UINT32      Attributes;\r
 \r
   if (ChildHandle != NULL) {\r
     return EFI_UNSUPPORTED;\r
@@ -193,7 +172,7 @@ IDEBusDriverConfigurationSetOptions (
   Status = gRT->GetVariable (\r
                   L"Configuration",\r
                   &gEfiCallerIdGuid,\r
-                  &Attributes,\r
+                  NULL,\r
                   &DataSize,\r
                   &Value\r
                   );\r
@@ -232,54 +211,49 @@ IDEBusDriverConfigurationSetOptions (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Tests to see if a controller's current configuration options are valid.\r
+\r
+  @param  This A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL\r
+  instance.\r
+  @param  ControllerHandle The handle of the controller to test if it's current\r
+  configuration options are valid.\r
+  @param  ChildHandle The handle of the child controller to test if it's\r
+  current\r
+  configuration options are valid.  This is an optional\r
+  parameter that may be NULL.  It will be NULL for device\r
+  drivers.  It will also be NULL for a bus drivers that\r
+  wish to test the configuration options for the bus\r
+  controller. It will not be NULL for a bus driver that\r
+  wishes to test configuration options for one of\r
+  its child controllers.\r
+\r
+  @retval  EFI_SUCCESS The controller specified by ControllerHandle and\r
+  ChildHandle that is being managed by the driver\r
+  specified by This has a valid set of  configuration\r
+  options.\r
+  @retval  EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval  EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
+  EFI_HANDLE.\r
+  @retval  EFI_UNSUPPORTED The driver specified by This is not currently\r
+  managing the controller specified by\r
+  ControllerHandle and ChildHandle.\r
+  @retval  EFI_DEVICE_ERROR The controller specified by ControllerHandle and\r
+  ChildHandle that is being managed by the driver\r
+  specified by This has an invalid set of\r
+  configuration options.\r
+\r
+**/\r
 EFI_STATUS\r
 IDEBusDriverConfigurationOptionsValid (\r
   IN  EFI_DRIVER_CONFIGURATION_PROTOCOL               *This,\r
   IN  EFI_HANDLE                                      ControllerHandle,\r
   IN  EFI_HANDLE                                      ChildHandle  OPTIONAL\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Tests to see if a controller's current configuration options are valid.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL \r
-                       instance.\r
-    ControllerHandle - The handle of the controller to test if it's current \r
-                       configuration options are valid.\r
-    ChildHandle      - The handle of the child controller to test if it's \r
-                       current\r
-                       configuration options are valid.  This is an optional \r
-                       parameter that may be NULL.  It will be NULL for device \r
-                       drivers.  It will also be NULL for a bus drivers that \r
-                       wish to test the configuration options for the bus \r
-                       controller. It will not be NULL for a bus driver that \r
-                       wishes to test configuration options for one of \r
-                       its child controllers.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The controller specified by ControllerHandle and \r
-                            ChildHandle that is being managed by the driver \r
-                            specified by This has a valid set of  configuration\r
-                            options.\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid \r
-                            EFI_HANDLE.\r
-    EFI_UNSUPPORTED       - The driver specified by This is not currently \r
-                            managing the controller specified by \r
-                            ControllerHandle and ChildHandle.\r
-    EFI_DEVICE_ERROR      - The controller specified by ControllerHandle and \r
-                            ChildHandle that is being managed by the driver \r
-                            specified by This has an invalid set of \r
-                            configuration options.\r
-\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
   UINT8       Value;\r
   UINTN       DataSize;\r
-  UINT32      Attributes;\r
 \r
   if (ChildHandle != NULL) {\r
     return EFI_UNSUPPORTED;\r
@@ -289,7 +263,7 @@ IDEBusDriverConfigurationOptionsValid (
   Status = gRT->GetVariable (\r
                   L"Configuration",\r
                   &gEfiCallerIdGuid,\r
-                  &Attributes,\r
+                  NULL,\r
                   &DataSize,\r
                   &Value\r
                   );\r
@@ -300,6 +274,51 @@ IDEBusDriverConfigurationOptionsValid (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Forces a driver to set the default configuration options for a controller.\r
+\r
+  @param  This A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL\r
+  instance.\r
+  @param  ControllerHandle The handle of the controller to force default\r
+  configuration options on.\r
+  @param  ChildHandle The handle of the child controller to force default\r
+  configuration options on  This is an optional parameter\r
+  that may be NULL.  It will be NULL for device drivers.\r
+  It will also be NULL for a bus drivers that wish to\r
+  force default configuration options for the bus\r
+  controller.  It will not be NULL for a bus driver that\r
+  wishes to force default configuration options for one\r
+  of its child controllers.\r
+  @param  DefaultType The type of default configuration options to force on\r
+  the controller specified by ControllerHandle and\r
+  ChildHandle.  See Table 9-1 for legal values.\r
+  A DefaultType of 0x00000000 must be supported\r
+  by this protocol.\r
+  @param  ActionRequired A pointer to the action that the calling agent\r
+  is required to perform when this function returns.\r
+\r
+  @retval  EFI_SUCCESS The driver specified by This successfully forced\r
+  the default configuration options on the\r
+  controller specified by ControllerHandle and\r
+  ChildHandle.\r
+  @retval  EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval  EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a\r
+  valid EFI_HANDLE.\r
+  @retval  EFI_INVALID_PARAMETER ActionRequired is NULL.\r
+  @retval  EFI_UNSUPPORTED The driver specified by This does not support\r
+  forcing the default configuration options on\r
+  the controller specified by ControllerHandle\r
+  and ChildHandle.\r
+  @retval  EFI_UNSUPPORTED The driver specified by This does not support\r
+  the configuration type specified by DefaultType.\r
+  @retval  EFI_DEVICE_ERROR A device error occurred while attempt to force\r
+  the default configuration options on the controller\r
+  specified by  ControllerHandle and ChildHandle.\r
+  @retval  EFI_OUT_RESOURCES There are not enough resources available to force\r
+  the default configuration options on the controller\r
+  specified by ControllerHandle and ChildHandle.\r
+\r
+**/\r
 EFI_STATUS\r
 IDEBusDriverConfigurationForceDefaults (\r
   IN  EFI_DRIVER_CONFIGURATION_PROTOCOL                      *This,\r
@@ -308,56 +327,6 @@ IDEBusDriverConfigurationForceDefaults (
   IN  UINT32                                                 DefaultType,\r
   OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED               *ActionRequired\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Forces a driver to set the default configuration options for a controller.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL \r
-                       instance.\r
-    ControllerHandle - The handle of the controller to force default \r
-                       configuration options on.\r
-    ChildHandle      - The handle of the child controller to force default \r
-                       configuration options on  This is an optional parameter \r
-                       that may be NULL.  It will be NULL for device drivers.  \r
-                       It will also be NULL for a bus drivers that wish to \r
-                       force default configuration options for the bus \r
-                       controller.  It will not be NULL for a bus driver that \r
-                       wishes to force default configuration options for one \r
-                       of its child controllers.\r
-    DefaultType      - The type of default configuration options to force on \r
-                       the controller specified by ControllerHandle and \r
-                       ChildHandle.  See Table 9-1 for legal values.  \r
-                       A DefaultType of 0x00000000 must be supported \r
-                       by this protocol.\r
-    ActionRequired   - A pointer to the action that the calling agent \r
-                       is required to perform when this function returns.  \r
-                       \r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The driver specified by This successfully forced \r
-                            the default configuration options on the \r
-                            controller specified by ControllerHandle and \r
-                            ChildHandle.\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a \r
-                            valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ActionRequired is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support \r
-                            forcing the default configuration options on \r
-                            the controller specified by ControllerHandle \r
-                            and ChildHandle.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support \r
-                            the configuration type specified by DefaultType.\r
-    EFI_DEVICE_ERROR      - A device error occurred while attempt to force \r
-                            the default configuration options on the controller \r
-                            specified by  ControllerHandle and ChildHandle.\r
-    EFI_OUT_RESOURCES     - There are not enough resources available to force \r
-                            the default configuration options on the controller \r
-                            specified by ControllerHandle and ChildHandle.\r
-\r
---*/\r
 {\r
   UINT8 Value;\r
 \r