]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UnixPkg/UnixBlockIoDxe/DriverConfiguration.c
UnixPkg: Remove UnixPkg files (It is replaced by EmulatorPkg)
[mirror_edk2.git] / UnixPkg / UnixBlockIoDxe / DriverConfiguration.c
diff --git a/UnixPkg/UnixBlockIoDxe/DriverConfiguration.c b/UnixPkg/UnixBlockIoDxe/DriverConfiguration.c
deleted file mode 100644 (file)
index 245aab6..0000000
+++ /dev/null
@@ -1,338 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2004 - 2005, 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
-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
-#include "UnixBlockIo.h"\r
-\r
-//\r
-// EFI Driver Configuration Functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverConfigurationSetOptions (\r
-  IN  EFI_DRIVER_CONFIGURATION_PROTOCOL                      *This,\r
-  IN  EFI_HANDLE                                             ControllerHandle,\r
-  IN  EFI_HANDLE                                             ChildHandle  OPTIONAL,\r
-  IN  CHAR8                                                  *Language,\r
-  OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED               *ActionRequired\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverConfigurationOptionsValid (\r
-  IN  EFI_DRIVER_CONFIGURATION_PROTOCOL               *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle  OPTIONAL\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverConfigurationForceDefaults (\r
-  IN  EFI_DRIVER_CONFIGURATION_PROTOCOL                      *This,\r
-  IN  EFI_HANDLE                                             ControllerHandle,\r
-  IN  EFI_HANDLE                                             ChildHandle  OPTIONAL,\r
-  IN  UINT32                                                 DefaultType,\r
-  OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED               *ActionRequired\r
-  );\r
-\r
-//\r
-// EFI Driver Configuration Protocol\r
-//\r
-EFI_DRIVER_CONFIGURATION_PROTOCOL gUnixBlockIoDriverConfiguration = {\r
-  UnixBlockIoDriverConfigurationSetOptions,\r
-  UnixBlockIoDriverConfigurationOptionsValid,\r
-  UnixBlockIoDriverConfigurationForceDefaults,\r
-  LANGUAGESUPPORTED\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverConfigurationSetOptions (\r
-  IN  EFI_DRIVER_CONFIGURATION_PROTOCOL                      *This,\r
-  IN  EFI_HANDLE                                             ControllerHandle,\r
-  IN  EFI_HANDLE                                             ChildHandle  OPTIONAL,\r
-  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 instance.\r
-    ControllerHandle - The handle of the controller to set options on.\r
-    ChildHandle      - The handle of the child controller to set options on.  This\r
-                       is an optional parameter that may be NULL.  It will be NULL \r
-                       for device drivers, and for a bus drivers that wish to set \r
-                       options for the bus controller.  It will not be NULL for a \r
-                       bus driver that wishes to set options for one of its child \r
-                       controllers.\r
-    Language         - A pointer to a three character ISO 639-2 language identifier.\r
-                       This is the language of the user interface that should be \r
-                       presented to the user, and it must match one of the languages \r
-                       specified in SupportedLanguages.  The number of languages \r
-                       supported by a driver is up to the driver writer.\r
-    ActionRequired   - A pointer to the action that the calling agent is required \r
-                       to perform when this function returns.  See "Related \r
-                       Definitions" for a list of the actions that the calling \r
-                       agent is required to perform prior to accessing \r
-                       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 valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ActionRequired is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support setting \r
-                            configuration options for the controller specified by \r
-                            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
-  EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
-  CHAR8                 *SupportedLanguage;\r
-\r
-  SupportedLanguage = This->SupportedLanguages;\r
-\r
-  Status            = EFI_UNSUPPORTED;\r
-  while (*SupportedLanguage != 0) {\r
-    if (AsciiStrnCmp (Language, SupportedLanguage, 3)) {\r
-      Status = EFI_SUCCESS;\r
-    }\r
-\r
-    SupportedLanguage += 3;\r
-  }\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  if (ActionRequired == NULL || ControllerHandle == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (ChildHandle != NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Validate controller handle\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (void *)&BlockIo,\r
-                  gUnixBlockIoDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-\r
-  if (!EFI_ERROR (Status)) {\r
-    gBS->CloseProtocol (\r
-          ControllerHandle,\r
-          &gEfiUnixIoProtocolGuid,\r
-          gUnixBlockIoDriverBinding.DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  if (Status == EFI_UNSUPPORTED) {\r
-    return Status;\r
-  } else if (Status != EFI_ALREADY_STARTED) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  *ActionRequired = EfiDriverConfigurationActionNone;\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverConfigurationOptionsValid (\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 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 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 wish\r
-                       to test the configuration options for the bus controller.\r
-                       It will not be NULL for a bus driver that wishes to test \r
-                       configuration options for one of 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 EFI_HANDLE.\r
-    EFI_UNSUPPORTED       - The driver specified by This is not currently \r
-                            managing the controller specified by ControllerHandle \r
-                            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 configuration \r
-                            options.\r
-\r
---*/\r
-{\r
-  EFI_STATUS            Status;\r
-  EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
-\r
-  if (ChildHandle != NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  if (ControllerHandle == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Validate controller handle\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (void *)&BlockIo,\r
-                  gUnixBlockIoDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-\r
-  if (!EFI_ERROR (Status)) {\r
-    gBS->CloseProtocol (\r
-          ControllerHandle,\r
-          &gEfiUnixIoProtocolGuid,\r
-          gUnixBlockIoDriverBinding.DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  if (Status == EFI_UNSUPPORTED) {\r
-    return Status;\r
-  } else if (Status != EFI_ALREADY_STARTED) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UnixBlockIoDriverConfigurationForceDefaults (\r
-  IN  EFI_DRIVER_CONFIGURATION_PROTOCOL                      *This,\r
-  IN  EFI_HANDLE                                             ControllerHandle,\r
-  IN  EFI_HANDLE                                             ChildHandle  OPTIONAL,\r
-  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 instance.\r
-    ControllerHandle - The handle of the controller to force default configuration options on.\r
-    ChildHandle      - The handle of the child controller to force default configuration options on  This is an optional parameter that may be NULL.  It will be NULL for device drivers.  It will also be NULL for a bus drivers that wish to force default configuration options for the bus controller.  It will not be NULL for a bus driver that wishes to force default configuration options for one of its child controllers.\r
-    DefaultType      - The type of default configuration options to force on the controller specified by ControllerHandle and ChildHandle.  See Table 9-1 for legal values.  A DefaultType of 0x00000000 must be supported by this protocol.\r
-    ActionRequired   - A pointer to the action that the calling agent is required to perform when this function returns.  See "Related Definitions" in Section 9.1for a list of the actions that the calling agent is required to perform prior to accessing ControllerHandle again.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The driver specified by This successfully forced the default configuration options on the controller specified by ControllerHandle and 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 valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ActionRequired is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support forcing the default configuration options on the controller specified by ControllerHandle and ChildHandle.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the configuration type specified by DefaultType.\r
-    EFI_DEVICE_ERROR      - A device error occurred while attempt to force the default configuration options on the controller specified by  ControllerHandle and ChildHandle.\r
-    EFI_OUT_RESOURCES     - There are not enough resources available to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.\r
-\r
---*/\r
-{\r
-  EFI_STATUS            Status;\r
-  EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
-\r
-  if (ChildHandle != NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  if (ActionRequired == NULL || ControllerHandle == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Validate controller handle\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiUnixIoProtocolGuid,\r
-                  (void *)&BlockIo,\r
-                  gUnixBlockIoDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-\r
-  if (!EFI_ERROR (Status)) {\r
-    gBS->CloseProtocol (\r
-          ControllerHandle,\r
-          &gEfiUnixIoProtocolGuid,\r
-          gUnixBlockIoDriverBinding.DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  if (Status == EFI_UNSUPPORTED) {\r
-    return Status;\r
-  } else if (Status != EFI_ALREADY_STARTED) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  *ActionRequired = EfiDriverConfigurationActionNone;\r
-  return EFI_SUCCESS;\r
-}\r