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