Home | History | Annotate | Download | only in Protocol
      1 /** @file
      2   Protocol to describe devices that are not on a discoverable bus
      3 
      4   Copyright (c) 2016, Linaro, Ltd. All rights reserved.<BR>
      5 
      6   This program and the accompanying materials
      7   are licensed and made available under the terms and conditions of the BSD License
      8   which accompanies this distribution.  The full text of the license may be found at
      9   http://opensource.org/licenses/bsd-license.php
     10 
     11   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     12   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     13 
     14 **/
     15 
     16 #ifndef __NON_DISCOVERABLE_DEVICE_H__
     17 #define __NON_DISCOVERABLE_DEVICE_H__
     18 
     19 #include <IndustryStandard/Acpi.h>
     20 
     21 #define EDKII_NON_DISCOVERABLE_DEVICE_PROTOCOL_GUID \
     22   { 0x0d51905b, 0xb77e, 0x452a, {0xa2, 0xc0, 0xec, 0xa0, 0xcc, 0x8d, 0x51, 0x4a } }
     23 
     24 //
     25 // Protocol interface structure
     26 //
     27 typedef struct _NON_DISCOVERABLE_DEVICE NON_DISCOVERABLE_DEVICE;
     28 
     29 //
     30 // Data Types
     31 //
     32 typedef enum {
     33   NonDiscoverableDeviceDmaTypeCoherent,
     34   NonDiscoverableDeviceDmaTypeNonCoherent,
     35   NonDiscoverableDeviceDmaTypeMax,
     36 } NON_DISCOVERABLE_DEVICE_DMA_TYPE;
     37 
     38 //
     39 // Function Prototypes
     40 //
     41 
     42 /**
     43   Perform device specific initialization before the device is started
     44 
     45   @param  This          The non-discoverable device protocol pointer
     46 
     47   @retval EFI_SUCCESS   Initialization successful, the device may be used
     48   @retval Other         Initialization failed, device should not be started
     49 **/
     50 typedef
     51 EFI_STATUS
     52 (EFIAPI *NON_DISCOVERABLE_DEVICE_INIT) (
     53   IN  NON_DISCOVERABLE_DEVICE       *This
     54   );
     55 
     56 struct _NON_DISCOVERABLE_DEVICE {
     57   //
     58   // The type of device
     59   //
     60   CONST EFI_GUID                      *Type;
     61   //
     62   // Whether this device is DMA coherent
     63   //
     64   NON_DISCOVERABLE_DEVICE_DMA_TYPE    DmaType;
     65   //
     66   // Initialization function for the device
     67   //
     68   NON_DISCOVERABLE_DEVICE_INIT        Initialize;
     69   //
     70   // The MMIO and I/O regions owned by the device
     71   //
     72   EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR   *Resources;
     73 };
     74 
     75 extern EFI_GUID gEdkiiNonDiscoverableDeviceProtocolGuid;
     76 
     77 #endif
     78