]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/DriverDiagnostics.h
Initial import.
[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 //
29 // Global ID for the Driver Diagnostics Protocol as defined in UEFI 2.0.
30 //
31 #define UEFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID \
32 { \
33 0x4d330321, 0x025f, 0x4aac, {0x90, 0xd8, 0x5e, 0xd9, 0x00, 0x17, 0x3b, 0x63 } \
34 }
35
36 typedef struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL EFI_DRIVER_DIAGNOSTICS_PROTOCOL;
37
38 typedef enum {
39 EfiDriverDiagnosticTypeStandard = 0,
40 EfiDriverDiagnosticTypeExtended = 1,
41 EfiDriverDiagnosticTypeManufacturing= 2,
42 EfiDriverDiagnosticTypeMaximum
43 } EFI_DRIVER_DIAGNOSTIC_TYPE;
44
45 /**
46 Runs diagnostics on a controller.
47
48 @param This A pointer to the EFI_DRIVER_DIAGNOSTICS_PROTOCOL instance.
49 @param ControllerHandle The handle of the controller to run diagnostics on.
50 @param ChildHandle The handle of the child controller to run diagnostics on
51 This is an optional parameter that may be NULL. It will
52 be NULL for device drivers. It will also be NULL for a
53 bus drivers that wish to run diagnostics on the bus
54 controller. It will not be NULL for a bus driver that
55 wishes to run diagnostics on one of its child controllers.
56 @param DiagnosticType Indicates type of diagnostics to perform on the controller
57 specified by ControllerHandle and ChildHandle. See
58 "Related Definitions" for the list of supported types.
59 @param Language A pointer to a three character ISO 639-2 language
60 identifier. This is the language in which the optional
61 error message should be returned in Buffer, and it must
62 match one of the languages specified in SupportedLanguages.
63 The number of languages supported by a driver is up to
64 the driver writer.
65 @param ErrorType A GUID that defines the format of the data returned in Buffer.
66 @param BufferSize The size, in bytes, of the data returned in Buffer.
67 @param Buffer A buffer that contains a Null-terminated Unicode string
68 plus some additional data whose format is defined by
69 ErrorType. Buffer is allocated by this function with
70 AllocatePool(), and it is the caller's responsibility
71 to free it with a call to FreePool().
72
73 @retval EFI_SUCCESS The controller specified by ControllerHandle and
74 ChildHandle passed the diagnostic.
75 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
76 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
77 @retval EFI_INVALID_PARAMETER Language is NULL.
78 @retval EFI_INVALID_PARAMETER ErrorType is NULL.
79 @retval EFI_INVALID_PARAMETER BufferType is NULL.
80 @retval EFI_INVALID_PARAMETER Buffer is NULL.
81 @retval EFI_UNSUPPORTED The driver specified by This does not support
82 running diagnostics for the controller specified
83 by ControllerHandle and ChildHandle.
84 @retval EFI_UNSUPPORTED The driver specified by This does not support the
85 type of diagnostic specified by DiagnosticType.
86 @retval EFI_UNSUPPORTED The driver specified by This does not support the
87 language specified by Language.
88 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to complete
89 the diagnostics.
90 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to return
91 the status information in ErrorType, BufferSize,
92 and Buffer.
93 @retval EFI_DEVICE_ERROR The controller specified by ControllerHandle and
94 ChildHandle did not pass the diagnostic.
95
96 **/
97 typedef
98 EFI_STATUS
99 (EFIAPI *EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS) (
100 IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL *This,
101 IN EFI_HANDLE ControllerHandle,
102 IN EFI_HANDLE ChildHandle OPTIONAL,
103 IN EFI_DRIVER_DIAGNOSTIC_TYPE DiagnosticType,
104 IN CHAR8 *Language,
105 OUT EFI_GUID **ErrorType,
106 OUT UINTN *BufferSize,
107 OUT CHAR16 **Buffer
108 );
109
110
111 //
112 //
113
114 /**
115 Interface structure for the Driver Diagnostics Protocol.
116
117 @par Protocol Description:
118 Used to perform diagnostics on a controller that an EFI Driver is managing.
119
120 @param RunDiagnostics Runs diagnostics on a controller.
121 @param SupportedLanguages A Null-terminated ASCII string that contains one or more
122 ISO 639-2 language codes. This is the list of language
123 codes that this protocol supports.
124
125 **/
126 struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL {
127 EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS RunDiagnostics;
128 CHAR8 *SupportedLanguages;
129 };
130
131 extern EFI_GUID gEfiDriverDiagnosticsProtocolGuid;
132 extern EFI_GUID gUefiDriverDiagnosticsProtocolGuid;
133
134 #endif