+/**\r
+ This function processes the results of changes in configuration\r
+ for TCG2 version information.\r
+\r
+ @param[in] Action Specifies the type of action taken by the browser.\r
+ ASSERT if the Action is not EFI_BROWSER_ACTION_SUBMITTED.\r
+ @param[in] QuestionId A unique value which is sent to the original\r
+ exporting driver so that it can identify the type\r
+ of data to expect.\r
+ @param[in] Type The type of value for the question.\r
+ @param[in] Value A pointer to the data being sent to the original\r
+ exporting driver.\r
+\r
+ @retval EFI_SUCCESS The callback successfully handled the action.\r
+\r
+**/\r
+EFI_STATUS\r
+Tcg2VersionInfoCallback (\r
+ IN EFI_BROWSER_ACTION Action,\r
+ IN EFI_QUESTION_ID QuestionId,\r
+ IN UINT8 Type,\r
+ IN EFI_IFR_TYPE_VALUE *Value\r
+ )\r
+{\r
+ EFI_INPUT_KEY Key;\r
+ UINT64 PcdTcg2PpiVersion;\r
+ UINT8 PcdTpm2AcpiTableRev;\r
+\r
+ ASSERT (Action == EFI_BROWSER_ACTION_SUBMITTED);\r
+\r
+ if (QuestionId == KEY_TCG2_PPI_VERSION) {\r
+ //\r
+ // Get the PCD value after EFI_BROWSER_ACTION_SUBMITTED,\r
+ // the SetVariable to TCG2_VERSION_NAME should have been done.\r
+ // If the PCD value is not equal to the value set to variable,\r
+ // the PCD is not DynamicHii type and does not map to the setup option.\r
+ //\r
+ PcdTcg2PpiVersion = 0;\r
+ CopyMem (\r
+ &PcdTcg2PpiVersion,\r
+ PcdGetPtr (PcdTcgPhysicalPresenceInterfaceVer),\r
+ AsciiStrSize ((CHAR8 *) PcdGetPtr (PcdTcgPhysicalPresenceInterfaceVer))\r
+ );\r
+ if (PcdTcg2PpiVersion != Value->u64) {\r
+ CreatePopUp (\r
+ EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
+ &Key,\r
+ L"WARNING: PcdTcgPhysicalPresenceInterfaceVer is not DynamicHii type and does not map to this option!",\r
+ L"The version configuring by this setup option will not work!",\r
+ NULL\r
+ );\r
+ }\r
+ } else if (QuestionId == KEY_TPM2_ACPI_REVISION){\r
+ //\r
+ // Get the PCD value after EFI_BROWSER_ACTION_SUBMITTED,\r
+ // the SetVariable to TCG2_VERSION_NAME should have been done.\r
+ // If the PCD value is not equal to the value set to variable,\r
+ // the PCD is not DynamicHii type and does not map to the setup option.\r
+ //\r
+ PcdTpm2AcpiTableRev = PcdGet8 (PcdTpm2AcpiTableRev);\r
+\r
+ if (PcdTpm2AcpiTableRev != Value->u8) {\r
+ CreatePopUp (\r
+ EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
+ &Key,\r
+ L"WARNING: PcdTpm2AcpiTableRev is not DynamicHii type and does not map to this option!",\r
+ L"The Revision configuring by this setup option will not work!",\r
+ NULL\r
+ );\r
+ }\r
+ }\r
+\r
+ return EFI_SUCCESS;\r
+}\r
+\r