Home | History | Annotate | Download | only in DriverDiagnostics2
      1 /*++
      2 
      3 Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
      4 This program and the accompanying materials
      5 are licensed and made available under the terms and conditions of the BSD License
      6 which accompanies this distribution.  The full text of the license may be found at
      7 http://opensource.org/licenses/bsd-license.php
      8 
      9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     11 
     12 Module Name:
     13 
     14     DriverDiagnostics2.h
     15 
     16 Abstract:
     17 
     18     EFI Driver Diagnostics2 Protocol
     19 
     20 Revision History
     21 
     22 --*/
     23 
     24 #ifndef _EFI_DRIVER_DIAGNOSTICS2_H_
     25 #define _EFI_DRIVER_DIAGNOSTICS2_H_
     26 
     27 #include EFI_PROTOCOL_DEFINITION (DriverDiagnostics)
     28 
     29 //
     30 // Global ID for the Driver Diagnostics Protocol
     31 //
     32 #define EFI_DRIVER_DIAGNOSTICS2_PROTOCOL_GUID \
     33   { \
     34     0x4d330321, 0x025f, 0x4aac, {0x90, 0xd8, 0x5e, 0xd9, 0x0, 0x17, 0x3b, 0x63} \
     35   }
     36 
     37 EFI_FORWARD_DECLARATION (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL);
     38 
     39 typedef
     40 EFI_STATUS
     41 (EFIAPI *EFI_DRIVER_DIAGNOSTICS2_RUN_DIAGNOSTICS) (
     42   IN EFI_DRIVER_DIAGNOSTICS2_PROTOCOL                       * This,
     43   IN  EFI_HANDLE                                            ControllerHandle,
     44   IN  EFI_HANDLE                                            ChildHandle  OPTIONAL,
     45   IN  EFI_DRIVER_DIAGNOSTIC_TYPE                            DiagnosticType,
     46   IN  CHAR8                                                 *Language,
     47   OUT EFI_GUID                                              **ErrorType,
     48   OUT UINTN                                                 *BufferSize,
     49   OUT CHAR16                                                **Buffer
     50   );
     51 
     52 /*++
     53 
     54   Routine Description:
     55     Runs diagnostics on a controller.
     56 
     57   Arguments:
     58     This             - A pointer to the EFI_DRIVER_DIAGNOSTICS2_PROTOCOL instance.
     59     ControllerHandle - The handle of the controller to run diagnostics on.
     60     ChildHandle      - The handle of the child controller to run diagnostics on
     61                        This is an optional parameter that may be NULL.  It will
     62                        be NULL for device drivers.  It will also be NULL for a
     63                        bus drivers that wish to run diagnostics on the bus
     64                        controller.  It will not be NULL for a bus driver that
     65                        wishes to run diagnostics on one of its child controllers.
     66     DiagnosticType   - Indicates type of diagnostics to perform on the controller
     67                        specified by ControllerHandle and ChildHandle.   See
     68                        "Related Definitions" for the list of supported types.
     69     Language         - A pointer to a NULL-terminated ASCII string array indicating
     70                        the language. This is the language in which the optional
     71                        error message should be returned in Buffer, and it must
     72                        match one of the languages specified in SupportedLanguages.
     73                        The number of languages supported by a driver is up to
     74                        the driver writer. Language is specified in RFC 3066
     75                        language code format.
     76     ErrorType        - A GUID that defines the format of the data returned in
     77                        Buffer.
     78     BufferSize       - The size, in bytes, of the data returned in Buffer.
     79     Buffer           - A buffer that contains a Null-terminated Unicode string
     80                        plus some additional data whose format is defined by
     81                        ErrorType.  Buffer is allocated by this function with
     82                        AllocatePool(), and it is the caller's responsibility
     83                        to free it with a call to FreePool().
     84 
     85   Returns:
     86     EFI_SUCCESS           - The controller specified by ControllerHandle and
     87                             ChildHandle passed the diagnostic.
     88     EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
     89     EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid
     90                             EFI_HANDLE.
     91     EFI_INVALID_PARAMETER - Language is NULL.
     92     EFI_INVALID_PARAMETER - ErrorType is NULL.
     93     EFI_INVALID_PARAMETER - BufferType is NULL.
     94     EFI_INVALID_PARAMETER - Buffer is NULL.
     95     EFI_UNSUPPORTED       - The driver specified by This does not support
     96                             running diagnostics for the controller specified
     97                             by ControllerHandle and ChildHandle.
     98     EFI_UNSUPPORTED       - The driver specified by This does not support the
     99                             type of diagnostic specified by DiagnosticType.
    100     EFI_UNSUPPORTED       - The driver specified by This does not support the
    101                             language specified by Language.
    102     EFI_OUT_OF_RESOURCES  - There are not enough resources available to complete
    103                             the diagnostics.
    104     EFI_OUT_OF_RESOURCES  - There are not enough resources available to return
    105                             the status information in ErrorType, BufferSize,
    106                             and Buffer.
    107     EFI_DEVICE_ERROR      - The controller specified by ControllerHandle and
    108                             ChildHandle did not pass the diagnostic.
    109 
    110 --*/
    111 
    112 //
    113 // Interface structure for the Driver Diagnostics Protocol
    114 //
    115 struct _EFI_DRIVER_DIAGNOSTICS2_PROTOCOL {
    116   EFI_DRIVER_DIAGNOSTICS2_RUN_DIAGNOSTICS  RunDiagnostics;
    117   CHAR8                                    *SupportedLanguages;
    118 };
    119 
    120 /*++
    121 
    122   Protocol Description:
    123     Used to perform diagnostics on a controller that an EFI Driver is managing.
    124 
    125   Parameters:
    126     RunDiagnostics     - Runs diagnostics on a controller.
    127     SupportedLanguages - A Null-terminated ASCII string that contains one or more
    128                          RFC 3066 language codes.  This is the list of language
    129                          codes that this protocol supports.
    130 
    131 --*/
    132 
    133 extern EFI_GUID gEfiDriverDiagnostics2ProtocolGuid;
    134 
    135 #endif
    136