Home | History | Annotate | Download | only in TcgPpVendorLibNull
      1 /** @file
      2   NULL TCG PP Vendor library instance that does not support any vendor specific PPI.
      3 
      4 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
      5 This program and the accompanying materials
      6 are licensed and made available under the terms and conditions of the BSD License
      7 which accompanies this distribution.  The full text of the license may be found at
      8 http://opensource.org/licenses/bsd-license.php
      9 
     10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     12 
     13 **/
     14 
     15 #include <Library/DebugLib.h>
     16 #include <Library/TcgPpVendorLib.h>
     17 
     18 /**
     19   Check and execute the requested physical presence command.
     20 
     21   This API should be invoked in BIOS boot phase to process pending request.
     22 
     23   Caution: This function may receive untrusted input.
     24 
     25   If OperationRequest < 128, then ASSERT().
     26 
     27   @param[in]      OperationRequest TPM physical presence operation request.
     28   @param[in, out] ManagementFlags  BIOS TPM Management Flags.
     29   @param[out]     ResetRequired    If reset is required to vendor settings in effect.
     30                                    True, it indicates the reset is required.
     31                                    False, it indicates the reset is not required.
     32 
     33   @return TPM Operation Response to OS Environment.
     34 **/
     35 UINT32
     36 EFIAPI
     37 TcgPpVendorLibExecutePendingRequest (
     38   IN UINT32                 OperationRequest,
     39   IN OUT UINT32             *ManagementFlags,
     40   OUT BOOLEAN               *ResetRequired
     41   )
     42 {
     43   ASSERT (OperationRequest >= TCG_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION);
     44   return TCG_PP_OPERATION_RESPONSE_BIOS_FAILURE;
     45 }
     46 
     47 /**
     48   Check if there is a valid physical presence command request.
     49 
     50   This API should be invoked in BIOS boot phase to process pending request.
     51 
     52   Caution: This function may receive untrusted input.
     53 
     54   If OperationRequest < 128, then ASSERT().
     55 
     56   @param[in]      OperationRequest TPM physical presence operation request.
     57   @param[in]      ManagementFlags  BIOS TPM Management Flags.
     58   @param[out]     RequestConfirmed If the physical presence operation command required user confirm from UI.
     59                                    True, it indicates the command doesn't require user confirm.
     60                                    False, it indicates the command need user confirm from UI.
     61 
     62   @retval  TRUE        Physical Presence operation command is valid.
     63   @retval  FALSE       Physical Presence operation command is invalid.
     64 **/
     65 BOOLEAN
     66 EFIAPI
     67 TcgPpVendorLibHasValidRequest (
     68   IN UINT32                 OperationRequest,
     69   IN UINT32                 ManagementFlags,
     70   OUT BOOLEAN               *RequestConfirmed
     71   )
     72 {
     73   ASSERT (OperationRequest >= TCG_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION);
     74   return FALSE;
     75 }
     76 
     77 /**
     78   The callback for TPM vendor specific physical presence which is called for
     79   Submit TPM Operation Request to Pre-OS Environment and
     80   Submit TPM Operation Request to Pre-OS Environment 2.
     81 
     82   This API should be invoked in OS runtime phase to interface with ACPI method.
     83 
     84   Caution: This function may receive untrusted input.
     85 
     86   If OperationRequest < 128, then ASSERT().
     87 
     88   @param[in]      OperationRequest TPM physical presence operation request.
     89   @param[in]      ManagementFlags  BIOS TPM Management Flags.
     90 
     91   @return Return Code for Submit TPM Operation Request to Pre-OS Environment and
     92           Submit TPM Operation Request to Pre-OS Environment 2.
     93 **/
     94 UINT32
     95 EFIAPI
     96 TcgPpVendorLibSubmitRequestToPreOSFunction (
     97   IN UINT32                 OperationRequest,
     98   IN UINT32                 ManagementFlags
     99   )
    100 {
    101   ASSERT (OperationRequest >= TCG_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION);
    102   return TCG_PP_SUBMIT_REQUEST_TO_PREOS_NOT_IMPLEMENTED;
    103 }
    104 
    105 /**
    106   The callback for TPM vendor specific physical presence which is called for
    107   Get User Confirmation Status for Operation.
    108 
    109   This API should be invoked in OS runtime phase to interface with ACPI method.
    110 
    111   Caution: This function may receive untrusted input.
    112 
    113   If OperationRequest < 128, then ASSERT().
    114 
    115   @param[in]      OperationRequest TPM physical presence operation request.
    116   @param[in]      ManagementFlags  BIOS TPM Management Flags.
    117 
    118   @return Return Code for Get User Confirmation Status for Operation.
    119 **/
    120 UINT32
    121 EFIAPI
    122 TcgPpVendorLibGetUserConfirmationStatusFunction (
    123   IN UINT32                 OperationRequest,
    124   IN UINT32                 ManagementFlags
    125   )
    126 {
    127   ASSERT (OperationRequest >= TCG_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION);
    128   return TCG_PP_GET_USER_CONFIRMATION_NOT_IMPLEMENTED;
    129 }
    130