]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/DriverDiagnostics.h
MdePkg/Include/Protocol/Tls.h: pack structures from the TLS RFC
[mirror_edk2.git] / MdePkg / Include / Protocol / DriverDiagnostics.h
CommitLineData
d1f95000 1/** @file\r
2 EFI Driver Diagnostics Protocol\r
3\r
ba146aa3 4Copyright (c) 2006 - 2013, 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
ba146aa3
RN
43 ///\r
44 /// This is an optional diagnostic type that would only be used in the situation where an \r
45 /// EFI_NOT_READY had been returned by a previous call to RunDiagnostics()\r
46 /// and there is a desire to cancel the current running diagnostics operation.\r
47 ///\r
48 EfiDriverDiagnosticTypeCancel = 3,\r
d1f95000 49 EfiDriverDiagnosticTypeMaximum\r
50} EFI_DRIVER_DIAGNOSTIC_TYPE;\r
51\r
52/**\r
53 Runs diagnostics on a controller.\r
54\r
55 @param This A pointer to the EFI_DRIVER_DIAGNOSTICS_PROTOCOL instance.\r
56 @param ControllerHandle The handle of the controller to run diagnostics on.\r
57 @param ChildHandle The handle of the child controller to run diagnostics on\r
58 This is an optional parameter that may be NULL. It will\r
59 be NULL for device drivers. It will also be NULL for a\r
60 bus drivers that wish to run diagnostics on the bus\r
61 controller. It will not be NULL for a bus driver that\r
62 wishes to run diagnostics on one of its child controllers.\r
63 @param DiagnosticType Indicates type of diagnostics to perform on the controller\r
64 specified by ControllerHandle and ChildHandle. See\r
65 "Related Definitions" for the list of supported types.\r
66 @param Language A pointer to a three character ISO 639-2 language\r
67 identifier. This is the language in which the optional\r
68 error message should be returned in Buffer, and it must\r
69 match one of the languages specified in SupportedLanguages.\r
70 The number of languages supported by a driver is up to\r
71 the driver writer.\r
72 @param ErrorType A GUID that defines the format of the data returned in Buffer.\r
73 @param BufferSize The size, in bytes, of the data returned in Buffer.\r
fbf926ad 74 @param Buffer A buffer that contains a Null-terminated string\r
d1f95000 75 plus some additional data whose format is defined by\r
76 ErrorType. Buffer is allocated by this function with\r
77 AllocatePool(), and it is the caller's responsibility\r
78 to free it with a call to FreePool().\r
79\r
80 @retval EFI_SUCCESS The controller specified by ControllerHandle and\r
81 ChildHandle passed the diagnostic.\r
18bd7e85 82 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
af2dc6a7 83 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL, and it is not a valid EFI_HANDLE.\r
d1f95000 84 @retval EFI_INVALID_PARAMETER Language is NULL.\r
85 @retval EFI_INVALID_PARAMETER ErrorType is NULL.\r
86 @retval EFI_INVALID_PARAMETER BufferType is NULL.\r
87 @retval EFI_INVALID_PARAMETER Buffer is NULL.\r
88 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
89 running diagnostics for the controller specified\r
90 by ControllerHandle and ChildHandle.\r
91 @retval EFI_UNSUPPORTED The driver specified by This does not support the\r
92 type of diagnostic specified by DiagnosticType.\r
93 @retval EFI_UNSUPPORTED The driver specified by This does not support the\r
94 language specified by Language.\r
95 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to complete\r
96 the diagnostics.\r
97 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to return\r
98 the status information in ErrorType, BufferSize,\r
99 and Buffer.\r
100 @retval EFI_DEVICE_ERROR The controller specified by ControllerHandle and\r
101 ChildHandle did not pass the diagnostic.\r
102\r
103**/\r
104typedef\r
105EFI_STATUS\r
8b13229b 106(EFIAPI *EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS)(\r
d1f95000 107 IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL *This,\r
108 IN EFI_HANDLE ControllerHandle,\r
109 IN EFI_HANDLE ChildHandle OPTIONAL,\r
110 IN EFI_DRIVER_DIAGNOSTIC_TYPE DiagnosticType,\r
111 IN CHAR8 *Language,\r
112 OUT EFI_GUID **ErrorType,\r
113 OUT UINTN *BufferSize,\r
114 OUT CHAR16 **Buffer\r
115 );\r
116\r
44717a39 117///\r
118/// Used to perform diagnostics on a controller that an EFI Driver is managing.\r
119///\r
d1f95000 120struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL {\r
121 EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS RunDiagnostics;\r
3354353d 122 ///\r
e69ccf58 123 /// A Null-terminated ASCII string that contains one or more ISO 639-2\r
3354353d 124 /// language codes. This is the list of language codes that this protocol supports. \r
125 /// \r
d1f95000 126 CHAR8 *SupportedLanguages;\r
127};\r
128\r
129extern EFI_GUID gEfiDriverDiagnosticsProtocolGuid;\r
d1f95000 130\r
131#endif\r