Home | History | Annotate | Download | only in OpalPasswordDxe
      1 /** @file
      2   Public Header file of HII library used by Opal UEFI Driver.
      3   Defines required callbacks of Opal HII library.
      4 
      5 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
      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 _OPAL_HII_H_
     17 #define _OPAL_HII_H_
     18 
     19 #include <Library/OpalPasswordSupportLib.h>
     20 #include <OpalDriverPrivate.h>
     21 
     22 #define DEFAULT_RESPONSE_SIZE 200
     23 
     24 /**
     25   Get the driver image handle.
     26 
     27   @retval  the driver image handle.
     28 
     29 **/
     30 EFI_HANDLE
     31 HiiGetDriverImageHandleCB(
     32   VOID
     33   );
     34 
     35 /**
     36   Install the HII form and string packages.
     37 
     38   @retval  EFI_SUCCESS           Install all the resources success.
     39   @retval  EFI_OUT_OF_RESOURCES  Out of resource error.
     40 **/
     41 EFI_STATUS
     42 OpalHiiAddPackages(
     43   VOID
     44   );
     45 
     46 /**
     47   Check whether enable feature or not.
     48 
     49   @retval  Return the disk number.
     50 
     51 **/
     52 UINT8
     53 HiiGetNumConfigRequiredOpalDisksCB(
     54   VOID
     55   );
     56 
     57 /**
     58   Returns the driver name.
     59 
     60   @retval Returns the driver name.
     61 
     62 **/
     63 CHAR16*
     64 HiiGetDriverNameCB(
     65   VOID
     66   );
     67 
     68 /**
     69   Returns the opaque pointer to a physical disk context.
     70 
     71   @param  DiskIndex       Input the disk index.
     72 
     73   @retval The device pointer.
     74 
     75 **/
     76 OPAL_DISK*
     77 HiiGetOpalDiskCB(
     78   UINT8 DiskIndex
     79   );
     80 
     81 /**
     82   Returns the disk name.
     83 
     84   @param  DiskIndex       Input the disk index.
     85 
     86   @retval Returns the disk name.
     87 
     88 **/
     89 CHAR8*
     90 HiiDiskGetNameCB(
     91   UINT8 DiskIndex
     92   );
     93 
     94 /**
     95   Set a string Value in a form.
     96 
     97   @param      DestStringId   The stringid which need to update.
     98   @param      SrcAsciiStr    The string nned to update.
     99 
    100   @retval  EFI_SUCCESS       Do the required action success.
    101   @retval  Others            Other error occur.
    102 
    103 **/
    104 EFI_STATUS
    105 HiiSetFormString(
    106   EFI_STRING_ID       DestStringId,
    107   CHAR8               *SrcAsciiStr
    108   );
    109 
    110 /**
    111   Install the HII related resources.
    112 
    113   @retval  EFI_SUCCESS        Install all the resources success.
    114   @retval  other              Error occur when install the resources.
    115 **/
    116 EFI_STATUS
    117 HiiInstall(
    118   VOID
    119   );
    120 
    121 /**
    122   Uninstall the HII capability.
    123 
    124   @retval  EFI_SUCCESS           Uninstall all the resources success.
    125   @retval  others                Other errors occur when unistall the hii resource.
    126 **/
    127 EFI_STATUS
    128 HiiUninstall(
    129   VOID
    130   );
    131 
    132 /**
    133   Initialize the Opal disk base on the hardware info get from device.
    134 
    135   @param Dev                  The Opal device.
    136 
    137   @retval EFI_SUCESS          Initialize the device success.
    138   @retval EFI_DEVICE_ERROR    Get info from device failed.
    139 
    140 **/
    141 EFI_STATUS
    142 OpalDiskInitialize (
    143   IN OPAL_DRIVER_DEVICE          *Dev
    144   );
    145 
    146 #endif // _HII_H_
    147