Changeset 105670 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/RedfishPkg/RestJsonStructureDxe
- Timestamp:
- Aug 14, 2024 1:16:30 PM (9 months ago)
- svn:sync-xref-src-repo-rev:
- 164367
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-159268 /vendor/edk2/current 103735-103757,103769-103776,129194-164365
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.c
r99404 r105670 5 5 6 6 (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR> 7 Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR> 7 8 8 9 SPDX-License-Identifier: BSD-2-Clause-Patent … … 11 12 12 13 #include <Uefi.h> 14 #include <Library/DebugLib.h> 13 15 #include <Protocol/RestJsonStructure.h> 14 16 #include "RestJsonStructureInternal.h" … … 73 75 } 74 76 77 DEBUG ((DEBUG_MANAGEABILITY, "%a: %d REST JSON-C interpreter(s) to register for the name spaces.\n", __func__, NumberOfNS)); 78 75 79 Instance = 76 80 (REST_JSON_STRUCTURE_INSTANCE *)AllocateZeroPool (sizeof (REST_JSON_STRUCTURE_INSTANCE) + NumberOfNS * sizeof (EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER)); … … 89 93 for (Index = 0; Index < NumberOfNS; Index++) { 90 94 CopyMem ((VOID *)CloneSupportedInterpId, (VOID *)&ThisSupportedInterp->RestResourceInterp, sizeof (EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER)); 95 DEBUG ((DEBUG_MANAGEABILITY, " Resource type : %a\n", ThisSupportedInterp->RestResourceInterp.NameSpace.ResourceTypeName)); 96 DEBUG ((DEBUG_MANAGEABILITY, " Major version : %a\n", ThisSupportedInterp->RestResourceInterp.NameSpace.MajorVersion)); 97 DEBUG ((DEBUG_MANAGEABILITY, " Minor version : %a\n", ThisSupportedInterp->RestResourceInterp.NameSpace.MinorVersion)); 98 DEBUG ((DEBUG_MANAGEABILITY, " Errata version: %a\n\n", ThisSupportedInterp->RestResourceInterp.NameSpace.ErrataVersion)); 91 99 ThisSupportedInterp = (EFI_REST_JSON_STRUCTURE_SUPPORTED *)ThisSupportedInterp->NextSupportedRsrcInterp.ForwardLink; 92 100 CloneSupportedInterpId++; … … 125 133 EFI_STATUS Status; 126 134 EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *ThisSupportedRsrcTypeId; 135 136 DEBUG ((DEBUG_MANAGEABILITY, "%a: Entry\n", __func__)); 127 137 128 138 if ((This == NULL) || … … 147 157 RestJSonHeader 148 158 ); 159 if (EFI_ERROR (Status)) { 160 if (Status == EFI_UNSUPPORTED) { 161 DEBUG (( 162 DEBUG_MANAGEABILITY, 163 "%a %a.%a.%a REST JSON to C structure interpreter has no capability to interpret the resource.\n", 164 InterpreterInstance->SupportedRsrcIndentifier->NameSpace.ResourceTypeName, 165 InterpreterInstance->SupportedRsrcIndentifier->NameSpace.MajorVersion, 166 InterpreterInstance->SupportedRsrcIndentifier->NameSpace.MinorVersion, 167 InterpreterInstance->SupportedRsrcIndentifier->NameSpace.ErrataVersion 168 )); 169 } else { 170 DEBUG ((DEBUG_MANAGEABILITY, "REST JsonToStructure returns failure - %r\n", Status)); 171 } 172 } 149 173 } else { 150 174 // 151 // Check if the names apce and version is supported by this interpreter.175 // Check if the namespace and version is supported by this interpreter. 152 176 // 153 177 ThisSupportedRsrcTypeId = InterpreterInstance->SupportedRsrcIndentifier; … … 172 196 RestJSonHeader 173 197 ); 198 if (EFI_ERROR (Status)) { 199 DEBUG ((DEBUG_MANAGEABILITY, "Don't check version of this resource type identifier JsonToStructure returns %r\n", Status)); 200 DEBUG ((DEBUG_MANAGEABILITY, " Supported ResourceTypeName = %a\n", ThisSupportedRsrcTypeId->NameSpace.ResourceTypeName)); 201 } 202 174 203 break; 175 204 } else { … … 196 225 RestJSonHeader 197 226 ); 227 if (EFI_ERROR (Status)) { 228 DEBUG ((DEBUG_MANAGEABILITY, "Check version of this resource type identifier JsonToStructure returns %r\n", Status)); 229 DEBUG ((DEBUG_MANAGEABILITY, " Supported ResourceTypeName = %a\n", ThisSupportedRsrcTypeId->NameSpace.ResourceTypeName)); 230 DEBUG ((DEBUG_MANAGEABILITY, " Supported MajorVersion = %a\n", ThisSupportedRsrcTypeId->NameSpace.MajorVersion)); 231 DEBUG ((DEBUG_MANAGEABILITY, " Supported MinorVersion = %a\n", ThisSupportedRsrcTypeId->NameSpace.MinorVersion)); 232 DEBUG ((DEBUG_MANAGEABILITY, " Supported ErrataVersion = %a\n", ThisSupportedRsrcTypeId->NameSpace.ErrataVersion)); 233 } 234 198 235 break; 199 236 } … … 232 269 EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *ThisSupportedRsrcTypeId; 233 270 EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *RsrcTypeIdentifier; 271 272 DEBUG ((DEBUG_MANAGEABILITY, "%a: Entry\n", __func__)); 234 273 235 274 if ((This == NULL) || … … 285 324 ResourceRaw 286 325 ); 326 if (EFI_ERROR (Status)) { 327 DEBUG ((DEBUG_MANAGEABILITY, "StructureToJson returns %r\n", Status)); 328 DEBUG ((DEBUG_MANAGEABILITY, " Supported ResourceTypeName = %a\n", ThisSupportedRsrcTypeId->NameSpace.ResourceTypeName)); 329 DEBUG ((DEBUG_MANAGEABILITY, " Supported MajorVersion = %a\n", ThisSupportedRsrcTypeId->NameSpace.MajorVersion)); 330 DEBUG ((DEBUG_MANAGEABILITY, " Supported MinorVersion = %a\n", ThisSupportedRsrcTypeId->NameSpace.MinorVersion)); 331 DEBUG ((DEBUG_MANAGEABILITY, " Supported ErrataVersion = %a\n", ThisSupportedRsrcTypeId->NameSpace.ErrataVersion)); 332 } 333 287 334 break; 288 335 } … … 417 464 } 418 465 466 if (RsrcTypeIdentifier != NULL) { 467 DEBUG ((DEBUG_MANAGEABILITY, "%a: Looking for the REST JSON to C Structure converter:\n", __func__)); 468 if (RsrcTypeIdentifier->NameSpace.ResourceTypeName != NULL) { 469 DEBUG ((DEBUG_MANAGEABILITY, " ResourceType: %a\n", RsrcTypeIdentifier->NameSpace.ResourceTypeName)); 470 } else { 471 DEBUG ((DEBUG_MANAGEABILITY, " ResourceType: NULL")); 472 } 473 474 if (RsrcTypeIdentifier->NameSpace.MajorVersion != NULL) { 475 DEBUG ((DEBUG_MANAGEABILITY, " MajorVersion: %a\n", RsrcTypeIdentifier->NameSpace.MajorVersion)); 476 } else { 477 DEBUG ((DEBUG_MANAGEABILITY, " MajorVersion: NULL")); 478 } 479 480 if (RsrcTypeIdentifier->NameSpace.MinorVersion != NULL) { 481 DEBUG ((DEBUG_MANAGEABILITY, " MinorVersion: %a\n", RsrcTypeIdentifier->NameSpace.MinorVersion)); 482 } else { 483 DEBUG ((DEBUG_MANAGEABILITY, " MinorVersion: NULL")); 484 } 485 486 if (RsrcTypeIdentifier->NameSpace.ErrataVersion != NULL) { 487 DEBUG ((DEBUG_MANAGEABILITY, " ErrataVersion: %a\n", RsrcTypeIdentifier->NameSpace.ErrataVersion)); 488 } else { 489 DEBUG ((DEBUG_MANAGEABILITY, " ErrataVersion: NULL")); 490 } 491 } else { 492 DEBUG ((DEBUG_MANAGEABILITY, "%a: RsrcTypeIdentifier is given as NULL, go through all of the REST JSON to C structure interpreters.\n", __func__)); 493 } 494 419 495 Status = EFI_SUCCESS; 420 496 Instance = (REST_JSON_STRUCTURE_INSTANCE *)GetFirstNode (&mRestJsonStructureList); … … 428 504 ); 429 505 if (!EFI_ERROR (Status)) { 506 DEBUG ((DEBUG_MANAGEABILITY, "%a: REST JSON to C structure is interpreted successfully.\n", __func__)); 430 507 break; 431 508 } 432 509 433 510 if (IsNodeAtEnd (&mRestJsonStructureList, &Instance->NextRestJsonStructureInstance)) { 511 DEBUG ((DEBUG_ERROR, "%a: No REST JSON to C structure interpreter found.\n", __func__)); 434 512 Status = EFI_UNSUPPORTED; 435 513 break; … … 484 562 485 563 if (IsNodeAtEnd (&mRestJsonStructureList, &Instance->NextRestJsonStructureInstance)) { 564 DEBUG ((DEBUG_ERROR, "%a: No REST JSON to C structure interpreter found.\n", __func__)); 486 565 Status = EFI_UNSUPPORTED; 487 566 break; … … 513 592 ) 514 593 { 515 EFI_STATUS Status; 516 REST_JSON_STRUCTURE_INSTANCE *Instance; 594 EFI_STATUS Status; 595 REST_JSON_STRUCTURE_INSTANCE *Instance; 596 EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *RsrcTypeIdentifier; 517 597 518 598 if ((This == NULL) || (RestJSonHeader == NULL) || (ResourceRaw == NULL)) { … … 523 603 return EFI_UNSUPPORTED; 524 604 } 605 606 RsrcTypeIdentifier = &RestJSonHeader->JsonRsrcIdentifier; 607 DEBUG ((DEBUG_MANAGEABILITY, "Looking for the REST C Structure to JSON resource converter:\n")); 608 DEBUG ((DEBUG_MANAGEABILITY, " ResourceType : %a\n", RsrcTypeIdentifier->NameSpace.ResourceTypeName)); 609 DEBUG ((DEBUG_MANAGEABILITY, " MajorVersion : %a\n", RsrcTypeIdentifier->NameSpace.MajorVersion)); 610 DEBUG ((DEBUG_MANAGEABILITY, " MinorVersion : %a\n", RsrcTypeIdentifier->NameSpace.MinorVersion)); 611 DEBUG ((DEBUG_MANAGEABILITY, " ErrataVersion: %a\n", RsrcTypeIdentifier->NameSpace.ErrataVersion)); 525 612 526 613 Status = EFI_SUCCESS; … … 538 625 539 626 if (IsNodeAtEnd (&mRestJsonStructureList, &Instance->NextRestJsonStructureInstance)) { 627 DEBUG ((DEBUG_ERROR, "%a: No REST C structure to JSON interpreter found.\n", __func__)); 540 628 Status = EFI_UNSUPPORTED; 541 629 break; … … 588 676 589 677 /** 590 This is the unload handle for R edfish discovermodule.678 This is the unload handle for REST JSON to C structure module. 591 679 592 680 Disconnect the driver specified by ImageHandle from all the devices in the handle database. -
trunk/src/VBox/Devices/EFI/FirmwareNew/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf
r89983 r105670 3 3 # 4 4 # (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR> 5 # Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR> 5 6 # SPDX-License-Identifier: BSD-2-Clause-Patent 6 7 ## … … 18 19 MdePkg/MdePkg.dec 19 20 MdeModulePkg/MdeModulePkg.dec 20 RedfishPkg/RedfishPkg.dec21 21 22 22 [Sources] … … 27 27 BaseLib 28 28 BaseMemoryLib 29 DebugLib 29 30 MemoryAllocationLib 30 31 UefiBootServicesTableLib -
trunk/src/VBox/Devices/EFI/FirmwareNew/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h
r99404 r105670 4 4 5 5 (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR> 6 Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR> 6 7 7 8 SPDX-License-Identifier: BSD-2-Clause-Patent … … 26 27 LIST_ENTRY NextRestJsonStructureInstance; ///< Next convertor instance 27 28 UINTN NumberOfNameSpaceToConvert; ///< Number of resource type this convertor supports. 28 EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *SupportedRsrcIndentifier; ///< The resource type linklist29 EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER *SupportedRsrcIndentifier; ///< The supported resource type array. 29 30 EFI_REST_JSON_STRUCTURE_TO_STRUCTURE JsonToStructure; ///< JSON to C structure function 30 31 EFI_REST_JSON_STRUCTURE_TO_JSON StructureToJson; ///< C structure to JSON function
Note:
See TracChangeset
for help on using the changeset viewer.