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