]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/DriverDiagnostics.h
Fix the comments in the core interface to follow the UEFI Spec regarding how to check...
[mirror_edk2.git] / MdePkg / Include / Protocol / DriverDiagnostics.h
1 /** @file
2 EFI Driver Diagnostics Protocol
3
4 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef __EFI_DRIVER_DIAGNOSTICS_H__
16 #define __EFI_DRIVER_DIAGNOSTICS_H__
17
18 ///
19 /// The global ID for the Driver Diagnostics Protocol as defined in EFI 1.1.
20 ///
21 #define EFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID \
22 { \
23 0x0784924f, 0xe296, 0x11d4, {0x9a, 0x49, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
24 }
25
26 typedef struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL EFI_DRIVER_DIAGNOSTICS_PROTOCOL;
27
28 typedef enum {
29 ///
30 /// Performs standard diagnostics on the controller.
31 ///
32 EfiDriverDiagnosticTypeStandard = 0,
33 ///
34 /// This is an optional diagnostic type that performs diagnostics on the controller that may
35 /// take an extended amount of time to execute.
36 ///
37 EfiDriverDiagnosticTypeExtended = 1,
38 ///
39 /// This is an optional diagnostic type that performs diagnostics on the controller that are
40 /// suitable for a manufacturing and test environment.
41 ///
42 EfiDriverDiagnosticTypeManufacturing= 2,
43 EfiDriverDiagnosticTypeMaximum
44 } EFI_DRIVER_DIAGNOSTIC_TYPE;
45
46 /**
47 Runs diagnostics on a controller.
48
49 @param This A pointer to the EFI_DRIVER_DIAGNOSTICS_PROTOCOL instance.
50 @param ControllerHandle The handle of the controller to run diagnostics on.
51 @param ChildHandle The handle of the child controller to run diagnostics on
52 This is an optional parameter that may be NULL. It will
53 be NULL for device drivers. It will also be NULL for a
54 bus drivers that wish to run diagnostics on the bus
55 controller. It will not be NULL for a bus driver that
56 wishes to run diagnostics on one of its child controllers.
57 @param DiagnosticType Indicates type of diagnostics to perform on the controller
58 specified by ControllerHandle and ChildHandle. See
59 "Related Definitions" for the list of supported types.
60 @param Language A pointer to a three character ISO 639-2 language
61 identifier. This is the language in which the optional
62 error message should be returned in Buffer, and it must
63 match one of the languages specified in SupportedLanguages.
64 The number of languages supported by a driver is up to
65 the driver writer.
66 @param ErrorType A GUID that defines the format of the data returned in Buffer.
67 @param BufferSize The size, in bytes, of the data returned in Buffer.
68 @param Buffer A buffer that contains a Null-terminated string
69 plus some additional data whose format is defined by
70 ErrorType. Buffer is allocated by this function with
71 AllocatePool(), and it is the caller's responsibility
72 to free it with a call to FreePool().
73
74 @retval EFI_SUCCESS The controller specified by ControllerHandle and
75 ChildHandle passed the diagnostic.
76 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
77 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL, and it is not a valid EFI_HANDLE.
78 @retval EFI_INVALID_PARAMETER Language is NULL.
79 @retval EFI_INVALID_PARAMETER ErrorType is NULL.
80 @retval EFI_INVALID_PARAMETER BufferType is NULL.
81 @retval EFI_INVALID_PARAMETER Buffer is NULL.
82 @retval EFI_UNSUPPORTED The driver specified by This does not support
83 running diagnostics for the controller specified
84 by ControllerHandle and ChildHandle.
85 @retval EFI_UNSUPPORTED The driver specified by This does not support the
86 type of diagnostic specified by DiagnosticType.
87 @retval EFI_UNSUPPORTED The driver specified by This does not support the
88 language specified by Language.
89 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to complete
90 the diagnostics.
91 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to return
92 the status information in ErrorType, BufferSize,
93 and Buffer.
94 @retval EFI_DEVICE_ERROR The controller specified by ControllerHandle and
95 ChildHandle did not pass the diagnostic.
96
97 **/
98 typedef
99 EFI_STATUS
100 (EFIAPI *EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS)(
101 IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL *This,
102 IN EFI_HANDLE ControllerHandle,
103 IN EFI_HANDLE ChildHandle OPTIONAL,
104 IN EFI_DRIVER_DIAGNOSTIC_TYPE DiagnosticType,
105 IN CHAR8 *Language,
106 OUT EFI_GUID **ErrorType,
107 OUT UINTN *BufferSize,
108 OUT CHAR16 **Buffer
109 );
110
111 ///
112 /// Used to perform diagnostics on a controller that an EFI Driver is managing.
113 ///
114 struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL {
115 EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS RunDiagnostics;
116 ///
117 /// A Null-terminated ASCII string that contains one or more RFC 4646
118 /// language codes. This is the list of language codes that this protocol supports.
119 ///
120 CHAR8 *SupportedLanguages;
121 };
122
123 extern EFI_GUID gEfiDriverDiagnosticsProtocolGuid;
124
125 #endif