RedfishConfigHandlerCommon.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /** @file
  2. Common Header file for Redfish Configuration Handler UEFI driver
  3. and DXE driver.
  4. (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
  5. SPDX-License-Identifier: BSD-2-Clause-Patent
  6. **/
  7. #ifndef EFI_REDFISH_CONFIG_HANDLER_COMMON_H_
  8. #define EFI_REDFISH_CONFIG_HANDLER_COMMON_H_
  9. #include <Uefi.h>
  10. //
  11. // Libraries
  12. //
  13. #include <Library/BaseLib.h>
  14. #include <Library/BaseMemoryLib.h>
  15. #include <Library/DebugLib.h>
  16. #include <Library/MemoryAllocationLib.h>
  17. #include <Library/NetLib.h>
  18. #include <Library/UefiBootServicesTableLib.h>
  19. #include <Library/UefiDriverEntryPoint.h>
  20. #include <Library/UefiLib.h>
  21. //
  22. // Consumed Protocols
  23. //
  24. #include <Protocol/EdkIIRedfishCredential.h>
  25. #include <Protocol/EdkIIRedfishConfigHandler.h>
  26. //
  27. // Driver Version
  28. //
  29. #define REDFISH_CONFIG_VERSION 0x00000001
  30. ///
  31. /// Internal structure used by Redfish Config DXE driver.
  32. ///
  33. typedef struct {
  34. UINT32 CallerId; ///< Caller ID used to indicate Redfish Config Handler
  35. ///< has been initiated
  36. EFI_HANDLE Image; ///< Image handle of Redfish Config Driver
  37. EFI_EVENT Event; ///< Event for the notification of EFI_REDFISH_CONFIG_HANDLER_PROTOCOL
  38. REDFISH_CONFIG_SERVICE_INFORMATION RedfishServiceInfo; /// Redfish Service information discovered
  39. } REDFISH_CONFIG_DRIVER_DATA;
  40. /**
  41. Common code of unloading image for both UEFI/DXE Redfish Configuration drivers.
  42. @param[in] ImageHandle Handle that identifies the image to be unloaded.
  43. @retval EFI_SUCCESS The image has been unloaded.
  44. **/
  45. EFI_STATUS
  46. RedfishConfigDriverCommonUnload (
  47. IN EFI_HANDLE ImageHandle
  48. );
  49. /**
  50. This is the common code for Redfish configuration UEFI and DXE driver
  51. initialization.
  52. @param[in] ImageHandle The firmware allocated handle for the UEFI image.
  53. @param[in] SystemTable A pointer to the EFI System Table.
  54. @retval EFI_SUCCESS The operation completed successfully.
  55. @retval Others An unexpected error occurred.
  56. **/
  57. EFI_STATUS
  58. RedfishConfigCommonInit (
  59. IN EFI_HANDLE ImageHandle,
  60. IN EFI_SYSTEM_TABLE *SystemTable
  61. );
  62. /**
  63. This is the common code to stop EDK2 Redfish feature driver.
  64. @retval EFI_SUCCESS All EDK2 Redfish feature drivers are
  65. stopped.
  66. @retval Others An unexpected error occurred.
  67. **/
  68. EFI_STATUS
  69. RedfishConfigCommonStop (
  70. VOID
  71. );
  72. /**
  73. Callback function executed when a Redfish Config Handler Protocol is installed
  74. by EDK2 Redfish Feature Drivers.
  75. **/
  76. VOID
  77. RedfishConfigHandlerInitialization (
  78. VOID
  79. );
  80. #endif