Commit | Line | Data |
---|---|---|
d1f95000 | 1 | /** @file\r |
2 | EFI Driver Diagnostics Protocol\r | |
3 | \r | |
9095d37b | 4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
d1f95000 | 6 | \r |
d1f95000 | 7 | **/\r |
8 | \r | |
9 | #ifndef __EFI_DRIVER_DIAGNOSTICS_H__\r | |
10 | #define __EFI_DRIVER_DIAGNOSTICS_H__\r | |
11 | \r | |
99e8ed21 | 12 | ///\r |
af2dc6a7 | 13 | /// The global ID for the Driver Diagnostics Protocol as defined in EFI 1.1.\r |
99e8ed21 | 14 | ///\r |
d1f95000 | 15 | #define EFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID \\r |
16 | { \\r | |
17 | 0x0784924f, 0xe296, 0x11d4, {0x9a, 0x49, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r | |
18 | }\r | |
19 | \r | |
d1f95000 | 20 | typedef struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL EFI_DRIVER_DIAGNOSTICS_PROTOCOL;\r |
21 | \r | |
22 | typedef enum {\r | |
9319d2c2 LG |
23 | ///\r |
24 | /// Performs standard diagnostics on the controller.\r | |
25 | ///\r | |
d1f95000 | 26 | EfiDriverDiagnosticTypeStandard = 0,\r |
9319d2c2 LG |
27 | ///\r |
28 | /// This is an optional diagnostic type that performs diagnostics on the controller that may\r | |
29 | /// take an extended amount of time to execute.\r | |
30 | ///\r | |
d1f95000 | 31 | EfiDriverDiagnosticTypeExtended = 1,\r |
9319d2c2 LG |
32 | ///\r |
33 | /// This is an optional diagnostic type that performs diagnostics on the controller that are\r | |
34 | /// suitable for a manufacturing and test environment.\r | |
35 | ///\r | |
d1f95000 | 36 | EfiDriverDiagnosticTypeManufacturing= 2,\r |
ba146aa3 | 37 | ///\r |
9095d37b | 38 | /// This is an optional diagnostic type that would only be used in the situation where an\r |
ba146aa3 RN |
39 | /// EFI_NOT_READY had been returned by a previous call to RunDiagnostics()\r |
40 | /// and there is a desire to cancel the current running diagnostics operation.\r | |
41 | ///\r | |
42 | EfiDriverDiagnosticTypeCancel = 3,\r | |
d1f95000 | 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 | |
98 | typedef\r | |
99 | EFI_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 | 114 | struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL {\r |
115 | EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS RunDiagnostics;\r | |
3354353d | 116 | ///\r |
e69ccf58 | 117 | /// A Null-terminated ASCII string that contains one or more ISO 639-2\r |
9095d37b LG |
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 | |
123 | extern EFI_GUID gEfiDriverDiagnosticsProtocolGuid;\r | |
d1f95000 | 124 | \r |
125 | #endif\r |