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