blob: 916e4a5d629392bd86f51e696973c0bf159253ff [file] [log] [blame]
Vishal Bhoj82c80712015-12-15 21:13:33 +05301/** @file
2 EFI Driver Diagnostics Protocol
3
4Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
5This program and the accompanying materials are licensed and made available under
6the terms and conditions of the BSD License that accompanies this distribution.
7The full text of the license may be found at
8http://opensource.org/licenses/bsd-license.php.
9
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11WITHOUT 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
26typedef struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL EFI_DRIVER_DIAGNOSTICS_PROTOCOL;
27
28typedef 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 ///
44 /// This is an optional diagnostic type that would only be used in the situation where an
45 /// EFI_NOT_READY had been returned by a previous call to RunDiagnostics()
46 /// and there is a desire to cancel the current running diagnostics operation.
47 ///
48 EfiDriverDiagnosticTypeCancel = 3,
49 EfiDriverDiagnosticTypeMaximum
50} EFI_DRIVER_DIAGNOSTIC_TYPE;
51
52/**
53 Runs diagnostics on a controller.
54
55 @param This A pointer to the EFI_DRIVER_DIAGNOSTICS_PROTOCOL instance.
56 @param ControllerHandle The handle of the controller to run diagnostics on.
57 @param ChildHandle The handle of the child controller to run diagnostics on
58 This is an optional parameter that may be NULL. It will
59 be NULL for device drivers. It will also be NULL for a
60 bus drivers that wish to run diagnostics on the bus
61 controller. It will not be NULL for a bus driver that
62 wishes to run diagnostics on one of its child controllers.
63 @param DiagnosticType Indicates type of diagnostics to perform on the controller
64 specified by ControllerHandle and ChildHandle. See
65 "Related Definitions" for the list of supported types.
66 @param Language A pointer to a three character ISO 639-2 language
67 identifier. This is the language in which the optional
68 error message should be returned in Buffer, and it must
69 match one of the languages specified in SupportedLanguages.
70 The number of languages supported by a driver is up to
71 the driver writer.
72 @param ErrorType A GUID that defines the format of the data returned in Buffer.
73 @param BufferSize The size, in bytes, of the data returned in Buffer.
74 @param Buffer A buffer that contains a Null-terminated string
75 plus some additional data whose format is defined by
76 ErrorType. Buffer is allocated by this function with
77 AllocatePool(), and it is the caller's responsibility
78 to free it with a call to FreePool().
79
80 @retval EFI_SUCCESS The controller specified by ControllerHandle and
81 ChildHandle passed the diagnostic.
82 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
83 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL, and it is not a valid EFI_HANDLE.
84 @retval EFI_INVALID_PARAMETER Language is NULL.
85 @retval EFI_INVALID_PARAMETER ErrorType is NULL.
86 @retval EFI_INVALID_PARAMETER BufferType is NULL.
87 @retval EFI_INVALID_PARAMETER Buffer is NULL.
88 @retval EFI_UNSUPPORTED The driver specified by This does not support
89 running diagnostics for the controller specified
90 by ControllerHandle and ChildHandle.
91 @retval EFI_UNSUPPORTED The driver specified by This does not support the
92 type of diagnostic specified by DiagnosticType.
93 @retval EFI_UNSUPPORTED The driver specified by This does not support the
94 language specified by Language.
95 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to complete
96 the diagnostics.
97 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to return
98 the status information in ErrorType, BufferSize,
99 and Buffer.
100 @retval EFI_DEVICE_ERROR The controller specified by ControllerHandle and
101 ChildHandle did not pass the diagnostic.
102
103**/
104typedef
105EFI_STATUS
106(EFIAPI *EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS)(
107 IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL *This,
108 IN EFI_HANDLE ControllerHandle,
109 IN EFI_HANDLE ChildHandle OPTIONAL,
110 IN EFI_DRIVER_DIAGNOSTIC_TYPE DiagnosticType,
111 IN CHAR8 *Language,
112 OUT EFI_GUID **ErrorType,
113 OUT UINTN *BufferSize,
114 OUT CHAR16 **Buffer
115 );
116
117///
118/// Used to perform diagnostics on a controller that an EFI Driver is managing.
119///
120struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL {
121 EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS RunDiagnostics;
122 ///
123 /// A Null-terminated ASCII string that contains one or more ISO 639-2
124 /// language codes. This is the list of language codes that this protocol supports.
125 ///
126 CHAR8 *SupportedLanguages;
127};
128
129extern EFI_GUID gEfiDriverDiagnosticsProtocolGuid;
130
131#endif