diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-10-30 06:45:44 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-10-30 06:45:44 +0000 |
commit | dfc48464891f001b397cd7f32f2c6b5a0f122625 (patch) | |
tree | 1f999210ab07ee87ec9ff96866d8d765d692e353 /IntelFrameworkModulePkg | |
parent | db168de9b09ab36330fb74af590cc80ef6a9e85a (diff) | |
download | edk2-dfc48464891f001b397cd7f32f2c6b5a0f122625.zip edk2-dfc48464891f001b397cd7f32f2c6b5a0f122625.tar.gz edk2-dfc48464891f001b397cd7f32f2c6b5a0f122625.tar.bz2 |
Add Add Driver Diagnostic 2 Protocol support for IdeBus driver.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4241 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r-- | IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/DriverDiagnostics.c | 53 | ||||
-rw-r--r-- | IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/idebus.c | 7 | ||||
-rw-r--r-- | IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/idebus.h | 4 |
3 files changed, 60 insertions, 4 deletions
diff --git a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/DriverDiagnostics.c b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/DriverDiagnostics.c index 8aa6d05..f3f649c 100644 --- a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/DriverDiagnostics.c +++ b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/DriverDiagnostics.c @@ -18,11 +18,19 @@ //
// EFI Driver Diagnostics Protocol
//
-EFI_DRIVER_DIAGNOSTICS_PROTOCOL gIDEBusDriverDiagnostics = {
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_DRIVER_DIAGNOSTICS_PROTOCOL gIDEBusDriverDiagnostics = {
IDEBusDriverDiagnosticsRunDiagnostics,
"eng"
};
+//
+// EFI Driver Diagnostics 2 Protocol
+//
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_DRIVER_DIAGNOSTICS2_PROTOCOL gIDEBusDriverDiagnostics2 = {
+ (EFI_DRIVER_DIAGNOSTICS2_RUN_DIAGNOSTICS) IDEBusDriverDiagnosticsRunDiagnostics,
+ "en"
+};
+
/**
Runs diagnostics on a controller.
@@ -98,6 +106,49 @@ IDEBusDriverDiagnosticsRunDiagnostics ( IDE_BLK_IO_DEV *IdeBlkIoDevice;
UINT32 VendorDeviceId;
VOID *BlockBuffer;
+ CHAR8 *SupportedLanguages;
+ BOOLEAN Iso639Language;
+ BOOLEAN Found;
+ UINTN Index;
+
+ if (Language == NULL ||
+ ErrorType == NULL ||
+ Buffer == NULL ||
+ ControllerHandle == NULL ||
+ BufferSize == NULL) {
+
+ return EFI_INVALID_PARAMETER;
+ }
+
+ SupportedLanguages = This->SupportedLanguages;
+ Iso639Language = (BOOLEAN)(This == &gIDEBusDriverDiagnostics);
+ //
+ // Make sure Language is in the set of Supported Languages
+ //
+ Found = FALSE;
+ while (*SupportedLanguages != 0) {
+ if (Iso639Language) {
+ if (CompareMem (Language, SupportedLanguages, 3) == 0) {
+ Found = TRUE;
+ break;
+ }
+ SupportedLanguages += 3;
+ } else {
+ for (Index = 0; SupportedLanguages[Index] != 0 && SupportedLanguages[Index] != ';'; Index++);
+ if (AsciiStrnCmp(SupportedLanguages, Language, Index) == 0) {
+ Found = TRUE;
+ break;
+ }
+ SupportedLanguages += Index;
+ for (; *SupportedLanguages != 0 && *SupportedLanguages == ';'; SupportedLanguages++);
+ }
+ }
+ //
+ // If Language is not a member of SupportedLanguages, then return EFI_UNSUPPORTED
+ //
+ if (!Found) {
+ return EFI_UNSUPPORTED;
+ }
*ErrorType = NULL;
*BufferSize = 0;
diff --git a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/idebus.c b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/idebus.c index 48c2184..666b817 100644 --- a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/idebus.c +++ b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/idebus.c @@ -1419,13 +1419,16 @@ InitializeIdeBus( //
// Install driver model protocol(s).
//
- Status = EfiLibInstallDriverBindingComponentName2 (
+ Status = EfiLibInstallAllDriverProtocols2 (
ImageHandle,
SystemTable,
&gIDEBusDriverBinding,
ImageHandle,
&gIDEBusComponentName,
- &gIDEBusComponentName2
+ &gIDEBusComponentName2,
+ NULL,
+ &gIDEBusDriverDiagnostics,
+ &gIDEBusDriverDiagnostics2
);
ASSERT_EFI_ERROR (Status);
diff --git a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/idebus.h b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/idebus.h index 9c6e41b..da7a03f 100644 --- a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/idebus.h +++ b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/idebus.h @@ -111,7 +111,9 @@ typedef struct { //
// Global Variables
//
-extern EFI_DRIVER_BINDING_PROTOCOL gIDEBusDriverBinding;
+extern EFI_DRIVER_BINDING_PROTOCOL gIDEBusDriverBinding;
+extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL gIDEBusDriverDiagnostics;
+extern EFI_DRIVER_DIAGNOSTICS2_PROTOCOL gIDEBusDriverDiagnostics2;
#include "ide.h"
|