Home | History | Annotate | Download | only in TrEEPpVendorLibNull
      1 /** @file
      2   NULL TrEE 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/TrEEPpVendorLib.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]      PlatformAuth     platform auth value. NULL means no platform auth change.
     28   @param[in]      OperationRequest TPM physical presence operation request.
     29   @param[in, out] ManagementFlags  BIOS TPM Management Flags.
     30   @param[out]     ResetRequired    If reset is required to vendor settings in effect.
     31                                    True, it indicates the reset is required.
     32                                    False, it indicates the reset is not required.
     33 
     34   @return TPM Operation Response to OS Environment.
     35 **/
     36 UINT32
     37 EFIAPI
     38 TrEEPpVendorLibExecutePendingRequest (
     39   IN TPM2B_AUTH             *PlatformAuth,  OPTIONAL
     40   IN UINT32                 OperationRequest,
     41   IN OUT UINT32             *ManagementFlags,
     42   OUT BOOLEAN               *ResetRequired
     43   )
     44 {
     45   ASSERT (OperationRequest >= TREE_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION);
     46   return TREE_PP_OPERATION_RESPONSE_BIOS_FAILURE;
     47 }
     48 
     49 /**
     50   Check if there is a valid physical presence command request.
     51 
     52   This API should be invoked in BIOS boot phase to process pending request.
     53 
     54   Caution: This function may receive untrusted input.
     55 
     56   If OperationRequest < 128, then ASSERT().
     57 
     58   @param[in]      OperationRequest TPM physical presence operation request.
     59   @param[in]      ManagementFlags  BIOS TPM Management Flags.
     60   @param[out]     RequestConfirmed If the physical presence operation command required user confirm from UI.
     61                                    True, it indicates the command doesn't require user confirm.
     62                                    False, it indicates the command need user confirm from UI.
     63 
     64   @retval  TRUE        Physical Presence operation command is valid.
     65   @retval  FALSE       Physical Presence operation command is invalid.
     66 **/
     67 BOOLEAN
     68 EFIAPI
     69 TrEEPpVendorLibHasValidRequest (
     70   IN UINT32                 OperationRequest,
     71   IN UINT32                 ManagementFlags,
     72   OUT BOOLEAN               *RequestConfirmed
     73   )
     74 {
     75   ASSERT (OperationRequest >= TREE_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION);
     76   return FALSE;
     77 }
     78 
     79 /**
     80   The callback for TPM vendor specific physical presence which is called for
     81   Submit TPM Operation Request to Pre-OS Environment and
     82   Submit TPM Operation Request to Pre-OS Environment 2.
     83 
     84   This API should be invoked in OS runtime phase to interface with ACPI method.
     85 
     86   Caution: This function may receive untrusted input.
     87 
     88   If OperationRequest < 128, then ASSERT().
     89 
     90   @param[in]      OperationRequest TPM physical presence operation request.
     91   @param[in]      ManagementFlags  BIOS TPM Management Flags.
     92 
     93   @return Return Code for Submit TPM Operation Request to Pre-OS Environment and
     94           Submit TPM Operation Request to Pre-OS Environment 2.
     95 **/
     96 UINT32
     97 EFIAPI
     98 TrEEPpVendorLibSubmitRequestToPreOSFunction (
     99   IN UINT32                 OperationRequest,
    100   IN UINT32                 ManagementFlags
    101   )
    102 {
    103   ASSERT (OperationRequest >= TREE_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION);
    104   return TREE_PP_SUBMIT_REQUEST_TO_PREOS_NOT_IMPLEMENTED;
    105 }
    106 
    107 /**
    108   The callback for TPM vendor specific physical presence which is called for
    109   Get User Confirmation Status for Operation.
    110 
    111   This API should be invoked in OS runtime phase to interface with ACPI method.
    112 
    113   Caution: This function may receive untrusted input.
    114 
    115   If OperationRequest < 128, then ASSERT().
    116 
    117   @param[in]      OperationRequest TPM physical presence operation request.
    118   @param[in]      ManagementFlags  BIOS TPM Management Flags.
    119 
    120   @return Return Code for Get User Confirmation Status for Operation.
    121 **/
    122 UINT32
    123 EFIAPI
    124 TrEEPpVendorLibGetUserConfirmationStatusFunction (
    125   IN UINT32                 OperationRequest,
    126   IN UINT32                 ManagementFlags
    127   )
    128 {
    129   ASSERT (OperationRequest >= TREE_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION);
    130   return TREE_PP_GET_USER_CONFIRMATION_NOT_IMPLEMENTED;
    131 }
    132