]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Nt32Pkg/WinNtBlockIoDxe/DriverDiagnostics.c
Nt32Pkg: Remove it
[mirror_edk2.git] / Nt32Pkg / WinNtBlockIoDxe / DriverDiagnostics.c
diff --git a/Nt32Pkg/WinNtBlockIoDxe/DriverDiagnostics.c b/Nt32Pkg/WinNtBlockIoDxe/DriverDiagnostics.c
deleted file mode 100644 (file)
index aebb744..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-/**@file\r
-\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-Module Name:\r
-\r
-  DriverDiagnostics.c\r
-\r
-Abstract:\r
-\r
-**/\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-#include <Protocol/BlockIo.h>\r
-#include <Protocol/ComponentName.h>\r
-#include <Protocol/DriverBinding.h>\r
-\r
-#include "WinNtBlockIo.h"\r
-\r
-//\r
-// EFI Driver Diagnostics Functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoDriverDiagnosticsRunDiagnostics (\r
-  IN  EFI_DRIVER_DIAGNOSTICS_PROTOCOL               *This,\r
-  IN  EFI_HANDLE                                    ControllerHandle,\r
-  IN  EFI_HANDLE                                    ChildHandle  OPTIONAL,\r
-  IN  EFI_DRIVER_DIAGNOSTIC_TYPE                    DiagnosticType,\r
-  IN  CHAR8                                         *Language,\r
-  OUT EFI_GUID                                      **ErrorType,\r
-  OUT UINTN                                         *BufferSize,\r
-  OUT CHAR16                                        **Buffer\r
-  );\r
-\r
-//\r
-// EFI Driver Diagnostics Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_DRIVER_DIAGNOSTICS_PROTOCOL gWinNtBlockIoDriverDiagnostics = {\r
-  WinNtBlockIoDriverDiagnosticsRunDiagnostics,\r
-  "eng"\r
-};\r
-\r
-//\r
-// EFI Driver Diagnostics 2 Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_DRIVER_DIAGNOSTICS2_PROTOCOL gWinNtBlockIoDriverDiagnostics2 = {\r
-  (EFI_DRIVER_DIAGNOSTICS2_RUN_DIAGNOSTICS) WinNtBlockIoDriverDiagnosticsRunDiagnostics,\r
-  "en"\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-WinNtBlockIoDriverDiagnosticsRunDiagnostics (\r
-  IN  EFI_DRIVER_DIAGNOSTICS_PROTOCOL               *This,\r
-  IN  EFI_HANDLE                                    ControllerHandle,\r
-  IN  EFI_HANDLE                                    ChildHandle  OPTIONAL,\r
-  IN  EFI_DRIVER_DIAGNOSTIC_TYPE                    DiagnosticType,\r
-  IN  CHAR8                                         *Language,\r
-  OUT EFI_GUID                                      **ErrorType,\r
-  OUT UINTN                                         *BufferSize,\r
-  OUT CHAR16                                        **Buffer\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Runs diagnostics on a controller.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_DRIVER_DIAGNOSTICS_PROTOCOL instance.\r
-    ControllerHandle - The handle of the controller to run diagnostics on.\r
-    ChildHandle      - The handle of the child controller to run diagnostics on\r
-                       This is an optional parameter that may be NULL.  It will\r
-                       be NULL for device drivers.  It will also be NULL for a\r
-                       bus drivers that wish to run diagnostics on the bus\r
-                       controller.  It will not be NULL for a bus driver that\r
-                       wishes to run diagnostics on one of its child controllers.\r
-    DiagnosticType   - Indicates type of diagnostics to perform on the controller\r
-                       specified by ControllerHandle and ChildHandle.   See\r
-                       "Related Definitions" for the list of supported types.\r
-    Language         - A pointer to a three character ISO 639-2 language\r
-                       identifier or a Null-terminated ASCII string array indicating\r
-                       the language.  This is the language in which the optional\r
-                       error message should be returned in Buffer, and it must\r
-                       match one of the languages specified in SupportedLanguages.\r
-                       The number of languages supported by a driver is up to\r
-                       the driver writer.\r
-    ErrorType        - A GUID that defines the format of the data returned in\r
-                       Buffer.\r
-    BufferSize       - The size, in bytes, of the data returned in Buffer.\r
-    Buffer           - A buffer that contains a Null-terminated Unicode string\r
-                       plus some additional data whose format is defined by\r
-                       ErrorType.  Buffer is allocated by this function with\r
-                       AllocatePool(), and it is the caller's responsibility\r
-                       to free it with a call to FreePool().\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The controller specified by ControllerHandle and\r
-                            ChildHandle passed the diagnostic.\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_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - ErrorType is NULL.\r
-    EFI_INVALID_PARAMETER - BufferType is NULL.\r
-    EFI_INVALID_PARAMETER - Buffer is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support\r
-                            running diagnostics for the controller specified\r
-                            by ControllerHandle and ChildHandle.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the\r
-                            type of diagnostic specified by DiagnosticType.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the\r
-                            language specified by Language.\r
-    EFI_OUT_OF_RESOURCES  - There are not enough resources available to complete\r
-                            the diagnostics.\r
-    EFI_OUT_OF_RESOURCES  - There are not enough resources available to return\r
-                            the status information in ErrorType, BufferSize,\r
-                            and Buffer.\r
-    EFI_DEVICE_ERROR      - The controller specified by ControllerHandle and\r
-                            ChildHandle did not pass the diagnostic.\r
-\r
---*/\r
-{\r
-  EFI_STATUS            Status;\r
-  EFI_BLOCK_IO_PROTOCOL *BlockIo;\r
-  CHAR8                 *SupportedLanguages;\r
-  BOOLEAN               Iso639Language;\r
-  BOOLEAN               Found;\r
-  UINTN                 Index;\r
-\r
-  if (Language         == NULL ||\r
-      ErrorType        == NULL ||\r
-      Buffer           == NULL ||\r
-      ControllerHandle == NULL ||\r
-      BufferSize       == NULL) {\r
-\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  SupportedLanguages = This->SupportedLanguages;\r
-  Iso639Language = (BOOLEAN)(This == &gWinNtBlockIoDriverDiagnostics);\r
-  //\r
-  // Make sure Language is in the set of Supported Languages\r
-  //\r
-  Found = FALSE;\r
-  while (*SupportedLanguages != 0) {\r
-    if (Iso639Language) {\r
-      if (CompareMem (Language, SupportedLanguages, 3) == 0) {\r
-        Found = TRUE;\r
-        break;\r
-      }\r
-      SupportedLanguages += 3;\r
-    } else {\r
-      for (Index = 0; SupportedLanguages[Index] != 0 && SupportedLanguages[Index] != ';'; Index++);\r
-      if ((AsciiStrnCmp(SupportedLanguages, Language, Index) == 0) && (Language[Index] == 0)) {\r
-        Found = TRUE;\r
-        break;\r
-      }\r
-      SupportedLanguages += Index;\r
-      for (; *SupportedLanguages != 0 && *SupportedLanguages == ';'; SupportedLanguages++);\r
-    }\r
-  }\r
-  //\r
-  // If Language is not a member of SupportedLanguages, then return EFI_UNSUPPORTED\r
-  //\r
-  if (!Found) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  \r
-  *ErrorType  = NULL;\r
-  *BufferSize = 0;\r
-  if (DiagnosticType != EfiDriverDiagnosticTypeStandard) {\r
-    *ErrorType  = &gEfiBlockIoProtocolGuid;\r
-    *BufferSize = 0x60;\r
-    *Buffer = AllocatePool ((UINTN) (*BufferSize));\r
-    CopyMem (*Buffer, L"Windows Block I/O Driver Diagnostics Failed\n", *BufferSize);\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-\r
-  //\r
-  // This is a device driver, so ChildHandle must be NULL.\r
-  //\r
-  if (ChildHandle != NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Validate controller handle\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiWinNtIoProtocolGuid,\r
-                  (VOID **) &BlockIo,\r
-                  gWinNtBlockIoDriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-\r
-  if (!EFI_ERROR (Status)) {\r
-    gBS->CloseProtocol (\r
-          ControllerHandle,\r
-          &gEfiWinNtIoProtocolGuid,\r
-          gWinNtBlockIoDriverBinding.DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-\r
-    return EFI_UNSUPPORTED;\r
-  }\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