Path: blob/main/sys/contrib/edk2/Include/Protocol/DriverDiagnostics.h
96339 views
/** @file1EFI Driver Diagnostics Protocol23Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>4SPDX-License-Identifier: BSD-2-Clause-Patent56**/78#ifndef __EFI_DRIVER_DIAGNOSTICS_H__9#define __EFI_DRIVER_DIAGNOSTICS_H__1011///12/// The global ID for the Driver Diagnostics Protocol as defined in EFI 1.1.13///14#define EFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID \15{ \160x0784924f, 0xe296, 0x11d4, {0x9a, 0x49, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \17}1819typedef struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL EFI_DRIVER_DIAGNOSTICS_PROTOCOL;2021typedef enum {22///23/// Performs standard diagnostics on the controller.24///25EfiDriverDiagnosticTypeStandard = 0,26///27/// This is an optional diagnostic type that performs diagnostics on the controller that may28/// take an extended amount of time to execute.29///30EfiDriverDiagnosticTypeExtended = 1,31///32/// This is an optional diagnostic type that performs diagnostics on the controller that are33/// suitable for a manufacturing and test environment.34///35EfiDriverDiagnosticTypeManufacturing = 2,36///37/// This is an optional diagnostic type that would only be used in the situation where an38/// EFI_NOT_READY had been returned by a previous call to RunDiagnostics()39/// and there is a desire to cancel the current running diagnostics operation.40///41EfiDriverDiagnosticTypeCancel = 3,42EfiDriverDiagnosticTypeMaximum43} EFI_DRIVER_DIAGNOSTIC_TYPE;4445/**46Runs diagnostics on a controller.4748@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 on51This is an optional parameter that may be NULL. It will52be NULL for device drivers. It will also be NULL for a53bus drivers that wish to run diagnostics on the bus54controller. It will not be NULL for a bus driver that55wishes to run diagnostics on one of its child controllers.56@param DiagnosticType Indicates type of diagnostics to perform on the controller57specified by ControllerHandle and ChildHandle. See58"Related Definitions" for the list of supported types.59@param Language A pointer to a three character ISO 639-2 language60identifier. This is the language in which the optional61error message should be returned in Buffer, and it must62match one of the languages specified in SupportedLanguages.63The number of languages supported by a driver is up to64the 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 string68plus some additional data whose format is defined by69ErrorType. Buffer is allocated by this function with70AllocatePool(), and it is the caller's responsibility71to free it with a call to FreePool().7273@retval EFI_SUCCESS The controller specified by ControllerHandle and74ChildHandle passed the diagnostic.75@retval EFI_INVALID_PARAMETER ControllerHandle is NULL.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 support82running diagnostics for the controller specified83by ControllerHandle and ChildHandle.84@retval EFI_UNSUPPORTED The driver specified by This does not support the85type of diagnostic specified by DiagnosticType.86@retval EFI_UNSUPPORTED The driver specified by This does not support the87language specified by Language.88@retval EFI_OUT_OF_RESOURCES There are not enough resources available to complete89the diagnostics.90@retval EFI_OUT_OF_RESOURCES There are not enough resources available to return91the status information in ErrorType, BufferSize,92and Buffer.93@retval EFI_DEVICE_ERROR The controller specified by ControllerHandle and94ChildHandle did not pass the diagnostic.9596**/97typedef98EFI_STATUS99(EFIAPI *EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS)(100IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL *This,101IN EFI_HANDLE ControllerHandle,102IN EFI_HANDLE ChildHandle OPTIONAL,103IN EFI_DRIVER_DIAGNOSTIC_TYPE DiagnosticType,104IN CHAR8 *Language,105OUT EFI_GUID **ErrorType,106OUT UINTN *BufferSize,107OUT CHAR16 **Buffer108);109110///111/// Used to perform diagnostics on a controller that an EFI Driver is managing.112///113struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL {114EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS RunDiagnostics;115///116/// A Null-terminated ASCII string that contains one or more ISO 639-2117/// language codes. This is the list of language codes that this protocol supports.118///119CHAR8 *SupportedLanguages;120};121122extern EFI_GUID gEfiDriverDiagnosticsProtocolGuid;123124#endif125126127